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

Add effects/attributes to all game entities #68

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shawncplus
Copy link
Member

See #60

Copy link
Contributor

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

* 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
Contributor

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
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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