Ideas for Stendhal/Magic: Difference between revisions
Content deleted Content added
imported>Madmetzger |
imported>Madmetzger |
||
Line 55:
Some spell like Freeze or Weaken Creature temporarily affect specific attributes of an entity. As it is reasonable not to change the attributes themselves, it is necessary to add attribute modifiers to an entity.
A first approach would store the modifier factors in a class and the entity classes compute an attribute's value by summing up all modifiers and applying it to the actual attribute's value. To reflect the temporal nature of a modifier it is capable of determining its validity based on a timestamp within the method ''isValid''. This approach has the obvious disadvantage, that within ''GuidedEntity'' the modifiers for not existing attributes are available.
<gallery caption="Attribute modifiers variants">
| |||