Skip to content

Commit

Permalink
New rigth bounce to show bonus onf Executioner Axe works
Browse files Browse the repository at this point in the history
  • Loading branch information
Mina928 committed Oct 29, 2023
1 parent 8107e27 commit 38b3e81
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ui/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class Button {
}
});

this.$button.removeClass('disabled glowing selected active noclick slideIn hidden potential');
this.$button.removeClass('disabled glowing selected active noclick slideIn hidden potential potentialoff');
wrapperElement && wrapperElement.removeClass('hidden');
this.$button.css(this.css.normal);

Expand Down
25 changes: 18 additions & 7 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ export class UI {
// Activate Ability
game.activeCreature.abilities[i].use();

this.showBonusPotential();

} else {
// Cancel Ability
this.closeDash();
Expand Down Expand Up @@ -670,22 +668,27 @@ export class UI {


showBonusPotential(){
//Shows bonus capability

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
if( ability.used == false &&
//Once Dragon Flight is upgraded
if(ability.used == false &&
game.activeCreature.name == "Golden Wyrm" &&
game.activeCreature.abilities[2].isUpgraded() &&
ability.require() &&
game.selectedAbility != ability &&
game.selectedAbility != 1 &&
btn.abilityId == 1
){
btn.$button.addClass('potential')
btn.changeState(ButtonStateEnum.potential);
}
else{
btn.changeState(ButtonStateEnum.normal);
}
});
}

Expand Down Expand Up @@ -1857,7 +1860,6 @@ export class UI {
this.changeAbilityButtons();
// Update upgrade info
this.updateAbilityUpgrades();
//this.showBonusPotential();
// Callback after final transition
this.$activebox.children('#abilities').transition(
{
Expand Down Expand Up @@ -1889,7 +1891,7 @@ export class UI {

updateAbilityUpgrades() {
const game = this.game,
creature = game.activeCreature;
creature = game.activeCreature;

// Change ability buttons
this.abilitiesButtons.forEach((btn) => {
Expand Down Expand Up @@ -1970,6 +1972,7 @@ export class UI {
$abilityInfo.append('<div class="info upgrade">Upgrade : ' + ab.upgrade + '</div>');
}
});
this.showBonusPotential();
}

checkAbilities() {
Expand Down Expand Up @@ -1998,7 +2001,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){
//Makes sure the right bounce is not stopped if ability not used yet
if(ab.used){
this.abilitiesButtons[i].changeState(ButtonStateEnum.normal);
}
}
else if (req && !ab.used && ab.trigger == 'onQuery') {
this.abilitiesButtons[i].changeState(ButtonStateEnum.slideIn);
oneUsableAbility = true;
} else if (
Expand Down Expand Up @@ -2033,6 +2042,8 @@ export class UI {
}
}

this.showBonusPotential();

// No action possible
if (!oneUsableAbility && game.activeCreature.remainingMove === 0) {
//game.skipTurn( { tooltip: "Finished" } ); // Autoskip
Expand Down

0 comments on commit 38b3e81

Please sign in to comment.