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

WIP: Implement Basic Stats #9

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

WIP: Implement Basic Stats #9

wants to merge 6 commits into from

Conversation

colearkenach
Copy link

This is a list of changes made while I was messing around with IdleRPG in a VM. entity.js is the one with the most change, as there was an attempt to implement stats from the below document as a test.

https://docs.google.com/document/d/1oaVJZnrUKijAUTkEgU7HETitG3MPeXecwQm31HmGzJo/edit?usp=sharing

@martindale martindale changed the title 4.14.2019 Test Build WIP: 4.14.2019 Test Build Apr 15, 2019
@martindale martindale changed the title WIP: 4.14.2019 Test Build WIP: Implement Basic Stats Apr 15, 2019
@@ -10,16 +9,39 @@ function Entity (entity) {
this.type = entity.type || 'Unknown';
this.name = entity.name || this.id;

this.experience = 0;
this.EXP = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid changing the name of properties on templates, since other parts of the program most likely depend on them. Also, as a general rule, try to keep all properties human-friendly — there's no need to shorten variable names in modern languages!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I'll change it back to this.experience


this.equipment = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scanned over the rest of the file; is equipment just being removed? Same feedback as earlier comment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't intend to remove equipment completely, that may have been something I was trying to accomplish but meant to undo.

shielding: 0,
smarts: 0,
willpower: 0,
charm: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, that's a lot of different stats! Let's coordinate out-of-band to go over the player experience.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's potential for slimming the amount down. Or at least subdividing them to make them reader-friendly (original subdivisions were physical, magical, and mental).

summonCards: 0,
spellCards: 0,
enchantCards: 0,
leylineCards: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two new properties seem like they should be simplified and variable names thought about a bit more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are meant to be "maximum" variables, so the names should likely be changed to represent this, or they should be condensed -- or maximums removed entirely. Not sure.

@@ -29,29 +51,66 @@ function Entity (entity) {
return this;
}

Object.defineProperty(Entity.prototype, 'level', {
Copy link
Member

@martindale martindale Apr 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to stick around, as it's used elsewhere.


return Entity.stats.attack;
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to use Object.defineProperty() if the value isn't calculated on the fly. Just do something like this:

Suggested change
});
this.attack = `foo`;

If you're just looking for the raw statistic, you can remove these entirely.

@martindale
Copy link
Member

I've reviewed everything here to date — nice work, dude! Let's chat out-of-band to begin next steps. 🚀

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.

2 participants