Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effectable behavior refactor for rooms/items/characters #60

Open
shawncplus opened this issue Mar 6, 2019 · 1 comment
Open

Effectable behavior refactor for rooms/items/characters #60

shawncplus opened this issue Mar 6, 2019 · 1 comment
Labels
active PR Issue has a open PR waiting for review/merge enhancement New feature or request
Milestone

Comments

@shawncplus
Copy link
Member

shawncplus commented Mar 6, 2019

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).

@shawncplus shawncplus added the enhancement New feature or request label Mar 6, 2019
@shawncplus
Copy link
Member Author

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 shawncplus changed the title Rooms should have an EffectList Effectable behavior refactor for rooms/items/characters Mar 20, 2019
shawncplus added a commit that referenced this issue Mar 21, 2019
shawncplus added a commit that referenced this issue Aug 10, 2019
@shawncplus shawncplus added the active PR Issue has a open PR waiting for review/merge label Aug 22, 2019
@shawncplus shawncplus added this to the 3.1 milestone Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active PR Issue has a open PR waiting for review/merge enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant