-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
Implmented showcase ability bonus potential in Golden Wyrm (Issue #1976) #2523
base: master
Are you sure you want to change the base?
Changes from all commits
bba3711
2a3e7e3
f818301
8107e27
38b3e81
fb4f76c
2282726
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,6 +255,7 @@ export class UI { | |
cursor: 'default', | ||
}, | ||
slideIn: {}, | ||
potential: {}, | ||
}, | ||
}, | ||
{ isAcceptingInput: () => this.interfaceAPI.isAcceptingInput }, | ||
|
@@ -266,6 +267,8 @@ export class UI { | |
{ | ||
$button: $j('.ability[ability="' + i + '"]'), | ||
hasShortcut: true, | ||
|
||
|
||
click: () => { | ||
const game = this.game; | ||
if (this.selectedAbility != i) { | ||
|
@@ -286,8 +289,10 @@ export class UI { | |
if (ability.require() == true && i != 0) { | ||
this.selectAbility(i); | ||
} | ||
|
||
// Activate Ability | ||
game.activeCreature.abilities[i].use(); | ||
|
||
} else { | ||
// Cancel Ability | ||
this.closeDash(); | ||
|
@@ -342,9 +347,11 @@ export class UI { | |
slideIn: { | ||
cursor: 'pointer', | ||
}, | ||
potential: {}, | ||
}, | ||
}, | ||
{ isAcceptingInput: () => this.interfaceAPI.isAcceptingInput }, | ||
{ isAcceptingInput: () => { | ||
this.interfaceAPI.isAcceptingInput }}, | ||
); | ||
this.buttons.push(b); | ||
this.abilitiesButtons.push(b); | ||
|
@@ -658,6 +665,32 @@ export class UI { | |
} | ||
} | ||
|
||
|
||
showBonusPotential(){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Linting: space between "()" and "{" |
||
//Shows bonus capability | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after "//" |
||
|
||
const game = this.game; | ||
this.abilitiesButtons.forEach((btn) => { | ||
const ability = game.activeCreature.abilities[btn.abilityId]; | ||
|
||
//The executioner Axes for Golden Wyrm jumps to the right | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be more generic, reusable for other abilities. Meaning no mention of specific unit and ability in |
||
//Once Dragon Flight is upgraded | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after "//". |
||
if(ability.used == false && | ||
game.activeCreature.name == "Golden Wyrm" && | ||
game.activeCreature.abilities[2].isUpgraded() && | ||
ability.require() && | ||
game.selectedAbility != 1 && | ||
btn.abilityId == 1 | ||
){ | ||
btn.$button.addClass('potential') | ||
btn.changeState(ButtonStateEnum.potential); | ||
} | ||
else{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after "else". |
||
btn.$button.removeClass('potential') | ||
} | ||
}); | ||
} | ||
|
||
showAbilityCosts(abilityId) { | ||
const game = this.game, | ||
creature = game.activeCreature, | ||
|
@@ -1857,7 +1890,7 @@ export class UI { | |
|
||
updateAbilityUpgrades() { | ||
const game = this.game, | ||
creature = game.activeCreature; | ||
creature = game.activeCreature; | ||
|
||
// Change ability buttons | ||
this.abilitiesButtons.forEach((btn) => { | ||
|
@@ -1895,7 +1928,7 @@ export class UI { | |
} | ||
}, 1500); | ||
|
||
ab.setUpgraded(); // Set the ability to upgraded | ||
ab.setUpgraded(); // Set the ability to upgraded | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some tabs after comment it seems. |
||
} | ||
|
||
// Change the ability's frame when it gets upgraded | ||
|
@@ -1938,6 +1971,7 @@ export class UI { | |
$abilityInfo.append('<div class="info upgrade">Upgrade : ' + ab.upgrade + '</div>'); | ||
} | ||
}); | ||
this.showBonusPotential(); | ||
} | ||
|
||
checkAbilities() { | ||
|
@@ -1966,7 +2000,13 @@ export class UI { | |
} | ||
if (ab.message == game.msg.abilities.passiveCycle) { | ||
this.abilitiesButtons[i].changeState(ButtonStateEnum.slideIn); | ||
} else if (req && !ab.used && ab.trigger == 'onQuery') { | ||
} else if(this.abilitiesButtons[i].state == ButtonStateEnum.potential){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space between ")" and "{". |
||
//Makes sure the right bounce is not stopped if ability not used yet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after "//" |
||
if(ab.used){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after ")" |
||
this.abilitiesButtons[i].changeState(ButtonStateEnum.normal); | ||
} | ||
} | ||
else if (req && !ab.used && ab.trigger == 'onQuery') { | ||
this.abilitiesButtons[i].changeState(ButtonStateEnum.slideIn); | ||
oneUsableAbility = true; | ||
} else if ( | ||
|
@@ -2001,6 +2041,8 @@ export class UI { | |
} | ||
} | ||
|
||
this.showBonusPotential(); | ||
|
||
// No action possible | ||
if (!oneUsableAbility && game.activeCreature.remainingMove === 0) { | ||
//game.skipTurn( { tooltip: "Finished" } ); // Autoskip | ||
|
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.
What's with this package?