You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Character effects methods/properties should be abstracted into an Effectable behavior that can be used by both Character and GameEntity (room/item/area). Effectable should also include the functionality of attributes thus moving all attribute and effect code into this behavior
This will allow all game entities to have effects. In addition effects should be updated with some new functionality: property modifiers.
Property Modifiers
Attribute modifiers exist to allow effects to temporarily alter an attribute's max value but attributes are purely numeric stats on a character. Property modifiers should allow effects to temporarily modify any property on an entity:
A disguise effect that temporarily changes a how player's name appears to other players
a darken effect that changes a room's description to be "It is pitch dark."
a poison effect that changes an item's room desc to append " (poisoned)" in addition to its other effects
To facilitate this Effect.modifiers should support a new properties key. This should act nearly identically to attribute modifiers. Effect will also need a new modifyProperty a la modifyAttribute mutatis mutandis. EffectList therefor will need an evaluateProperty a la evaluateAttribute. Finally to actually access these modified properties the Effectable behavior should have a getProperty(string propertyName) method a la getAttribute(string attributeName).
Effect docs will need to be updated to demonstrate these features as well as reinforce the the fact that when using modifiers one should never directly modify a property via an effect, e.g., this.name = "newName"; as that could result in Very Bad Things(tm).
The text was updated successfully, but these errors were encountered:
Room effect ideas that should be possible given this and #61
metadata management effects, e.g., a silence effect which on activate sets a room's silenced metadata disallowing spell casting, and unsets the metadata on deactivate
player trap skill: skill creates a trap effect on the room which gets triggered the next time an NPC enters the room.
shawncplus
changed the title
Rooms should have an EffectList
Effectable behavior refactor for rooms/items/characters
Mar 20, 2019
Character effects methods/properties should be abstracted into an
Effectable
behavior that can be used by bothCharacter
andGameEntity
(room/item/area). Effectable should also include the functionality of attributes thus moving all attribute and effect code into this behaviorThis will allow all game entities to have effects. In addition effects should be updated with some new functionality: property modifiers.
Property Modifiers
Attribute modifiers exist to allow effects to temporarily alter an attribute's max value but attributes are purely numeric stats on a character. Property modifiers should allow effects to temporarily modify any property on an entity:
To facilitate this
Effect.modifiers
should support a newproperties
key. This should act nearly identically to attribute modifiers.Effect
will also need a newmodifyProperty
a lamodifyAttribute
mutatis mutandis.EffectList
therefor will need anevaluateProperty
a laevaluateAttribute
. Finally to actually access these modified properties theEffectable
behavior should have agetProperty(string propertyName)
method a lagetAttribute(string attributeName)
.Effect docs will need to be updated to demonstrate these features as well as reinforce the the fact that when using modifiers one should never directly modify a property via an effect, e.g.,
this.name = "newName";
as that could result in Very Bad Things(tm).The text was updated successfully, but these errors were encountered: