Skip to content

Add effects/attributes to all game entities#68

Open
shawncplus wants to merge 3 commits into
masterfrom
effectable
Open

Add effects/attributes to all game entities#68
shawncplus wants to merge 3 commits into
masterfrom
effectable

Conversation

@shawncplus
Copy link
Copy Markdown
Member

See #60

Copy link
Copy Markdown

@seanohue seanohue left a 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.

Comment thread src/AreaOfEffectDamage.js
* 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
Copy link
Copy Markdown

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

Comment thread src/EffectableEntity.js
const Attributes = require('./Attributes');

/**
* @ignore
Copy link
Copy Markdown

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

Comment thread src/EffectableEntity.js
* @param {string} attr Attribute name
* @return {boolean}
*/
hasAttribute(attr) {
Copy link
Copy Markdown

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.

Comment thread src/EffectableEntity.js
* @return {number}
*/
getBaseAttribute(attr) {
var attr = this.attributes.get(attr);
Copy link
Copy Markdown

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

@ratacat
Copy link
Copy Markdown
Contributor

ratacat commented Jun 20, 2019

When you guys say this allows for effects/attributes on all game entities, what existing entities does that include?
Characters, Rooms, Items, Areas?

@shawncplus
Copy link
Copy Markdown
Member Author

shawncplus commented Jun 20, 2019

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.

@ratacat
Copy link
Copy Markdown
Contributor

ratacat commented Jul 25, 2019

Just to clarify though, these wouldn't deal with proxying any listeners or modifiers from a room effect to characters within the room?

@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants