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

Clean up support for multiple effectiveness modifiers #54

Closed
winsomniak opened this issue Jan 13, 2018 · 0 comments
Closed

Clean up support for multiple effectiveness modifiers #54

winsomniak opened this issue Jan 13, 2018 · 0 comments
Assignees

Comments

@winsomniak
Copy link
Owner

Code segment

 // super effectiveness against movement types with sacred seal check and thani check
 -    if (attacker.weaponData.hasOwnProperty("move_effective") && defender.moveType.includes(attacker.weaponData.move_effective)) {		 +    if ((attacker.weaponData.hasOwnProperty("move_effective2") && defender.moveType.includes(attacker.weaponData.move_effective2))||(attacker.weaponData.hasOwnProperty("move_effective") && defender.moveType.includes(attacker.weaponData.move_effective))) {
          if (defender.passiveAData.hasOwnProperty("cancel_effective")) {		          if (defender.passiveAData.hasOwnProperty("cancel_effective")) {
              battleInfo.logMsg += "Effectiveness against " + defender.moveType + " neutralized by opponent [" + skillInfo['a'][defender.passiveA].name + "]. ";		              battleInfo.logMsg += "Effectiveness against " + defender.moveType + " neutralized by opponent [" + skillInfo['a'][defender.passiveA].name + "]. ";
          } else if (defender.sealData.hasOwnProperty("cancel_effective")){		          } else if (defender.sealData.hasOwnProperty("cancel_effective")){

Ideally we don't have move_effective2 anymore, since this is more of the old style that has a lot of copy/pasted code. Gets hard to maintain.

Thanks to @Lorenzooone for implementing this in the first place! Minor gripe, and nothing we haven't seen before.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants