-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add effects/attributes to all game entities #68
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This jsdoc appears to be copy-and-pasted
* @param {string} attr Attribute name | ||
* @return {boolean} | ||
*/ | ||
hasAttribute(attr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of var seems out of place here
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