Add effects/attributes to all game entities#68
Conversation
seanohue
left a comment
There was a problem hiding this comment.
An excellent refactor/expansion of the original engine design in a way that makes a lot of sense and opens a lot of avenues for cool features done in a way that is appropriate to the engine and not a workaround.
Some nitpicks. Otherwise solid and good to merge since I don't think the nits would cause any issues outside of perhaps documentation.
| * default it will target all npcs in the room. To customize this behavior you | ||
| * can extend this class and override the `getValidTargets` method | ||
| */ | ||
| class AreaOfEffectDamage extends Damage |
There was a problem hiding this comment.
This beats the hacky code I put into Myelin to make AoE possible
| const Attributes = require('./Attributes'); | ||
|
|
||
| /** | ||
| * @ignore |
There was a problem hiding this comment.
This jsdoc appears to be copy-and-pasted
| * @param {string} attr Attribute name | ||
| * @return {boolean} | ||
| */ | ||
| hasAttribute(attr) { |
There was a problem hiding this comment.
This is an excellent refactor. Having attributes, effects, and damage possible on everything is huge.
| * @return {number} | ||
| */ | ||
| getBaseAttribute(attr) { | ||
| var attr = this.attributes.get(attr); |
|
When you guys say this allows for effects/attributes on all game entities, what existing entities does that include? |
|
Effects are currently only available to characters. This change makes everything in the game able to have both attributes and effects. characters (NPCs, players), items, rooms, and areas themselves. |
|
Just to clarify though, these wouldn't deal with proxying any listeners or modifiers from a room effect to characters within the room? |
See #60