Ideas for Stendhal/Magic: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Krupi m →Sorted |
imported>AntumDeluge m AntumDeluge moved page Stendhal/ideas/Magic to Ideas for Stendhal/Magic over redirect: Undoing previous move |
||
| (53 intermediate revisions by 4 users not shown) | |||
| Line 25: | Line 25: | ||
** Mana - Mana give for another player from own bottle [[File:Heal_blue.png]] |
** Mana - Mana give for another player from own bottle [[File:Heal_blue.png]] |
||
** Shield of Light - Increase defense for some time {{done}} |
** Shield of Light - Increase defense for some time {{done}} |
||
** Knowing - The player has the ability to know what's happened now at this place [[File:Knowing.png]] |
|||
** Adding a sound around the player (should somehow fit to the nature) |
** Adding a sound around the player (should somehow fit to the nature) |
||
* Dark |
* Dark |
||
| Line 55: | Line 56: | ||
** Colour a pet / sheep |
** Colour a pet / sheep |
||
** Different outfit |
** Different outfit |
||
* Walk through walls (care needed to be sure disallowed areas aren't reachable, perhaps only to certain preset portals or if there is a path - just might be a long path without the shortcut) |
|||
=== Needed Changes To Entities |
=== Needed Changes To Entities === |
||
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. |
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. But as this is not the only kind of effects, that can be applied to an entity, this is documented on a separate [[Ideas for Stendhal/Effects|page]] |
||
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. |
|||
The second approach uses an additional layer of indirection to hide the modifiers for not existing attributes. On each level of the entity inheritance hierarchy is a specific modifier defined that is called to calculate the modified value. |
|||
The TurnNotifier is used to clean up expired modifiers. As a modifier is able to distinguish between being valid and not, it is not necessary, that this clean up helper runs every second or even more frequently. |
|||
<gallery caption="Attribute modifiers variants"> |
|||
File:Modifier-idea-01.png|Simple modifier |
|||
File:Modifier-idea-02.png|Modifier concept hiding the "full" modifiers |
|||
</gallery> |
|||
The second option has been implemented. |
|||
There still needs to be a generic way on how to display the modified attributes at the client side. |
|||
== Learning Spells == |
== Learning Spells == |
||
| Line 134: | Line 121: | ||
{| border="0" |
{| border="0" |
||
|[[File:Spellnatures.png]] || Spell natures (ice, fire, light, dark) |
|[[File:Spellnatures.png]] || Spell natures (ice, fire, light, dark) |
||
|- |
|||
|[[File:Knowing.png]] || Example for the spell "knowing" |
|||
|- |
|- |
||
|[[File:Heal.png]] || Example for the spell "heal" |
|[[File:Heal.png]] || Example for the spell "heal" |
||