From ba651a82d585c181e9632fadba5bb4d683842d44 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 14 Mar 2017 18:19:06 -0400 Subject: better slash, scale fixes --- include/components/damage.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/components/damage.hpp (limited to 'include/components/damage.hpp') diff --git a/include/components/damage.hpp b/include/components/damage.hpp new file mode 100644 index 0000000..c257426 --- /dev/null +++ b/include/components/damage.hpp @@ -0,0 +1,22 @@ +#ifndef COMPONENTS_DAMAGE_HPP_ +#define COMPONENTS_DAMAGE_HPP_ + +#include "base.hpp" + +struct Damage : public Component { + Damage(int p = 0) + : pain(p) {} + Damage(XMLElement* imp, XMLElement* def) { + fromXML(imp, def); + } + + int pain; + + void fromXML(XMLElement* imp, XMLElement* def) final { + (void)imp; + if (def->QueryIntAttribute("value", &pain) != XML_NO_ERROR) + pain = 0; + } +}; + +#endif // COMPONENTS_DAMAGE_HPP_ -- cgit v1.2.3