Skip to content

Commit 4209865

Browse files
authored
Merge pull request #2825 from chavaenc/issue-1976
feat: Golden Wyrm's Executioner Axe icon bounce to indicate bonus, closes #1976
2 parents 363c0c0 + e1a4de8 commit 4209865

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/abilities/Golden-Wyrm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export default (G: Game) => {
128128
activate: function (target: Creature) {
129129
this.end();
130130
G.Phaser.camera.shake(0.02, 200, true, G.Phaser.camera.SHAKE_BOTH, true);
131+
// Removes bounce after use
132+
G.UI.abilitiesButtons[1].$button.removeClass('bounce');
131133

132134
if (target.health <= this._executeHealthThreshold) {
133135
const executeDamage = new Damage(
@@ -290,6 +292,8 @@ export default (G: Game) => {
290292
this.game,
291293
);
292294
ability.creature.addEffect(offenseBuffEffect);
295+
296+
G.UI.abilitiesButtons[1].$button.addClass('bounce');
293297
},
294298
},
295299

src/style/styles.less

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,27 @@ span.pure {
15681568
animation-iteration-count: 1;
15691569
}
15701570

1571+
@keyframes button-bounce-right {
1572+
0% {
1573+
transform: translateX(0);
1574+
}
1575+
50% {
1576+
transform: translateX(10px);
1577+
}
1578+
100% {
1579+
transform: translateX(0);
1580+
}
1581+
}
1582+
1583+
// Bounce only when ability is usable (slideIn) and not selected (active)
1584+
.ability.bounce.slideIn:not(.active) {
1585+
animation: button-bounce-right 1s ease-in-out infinite;
1586+
}
1587+
1588+
.ability.bounce.slideIn:not(.active):hover {
1589+
animation-iteration-count: 1;
1590+
}
1591+
15711592
/*--------------Framed Modal------------------*/
15721593
/* Modal window with graphical border and close button. */
15731594
.framed-modal {

src/ui/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,7 @@ export class UI {
19061906
$desc.find('span.title').text(ab.title);
19071907
$desc.find('p.description').html(ab.desc);
19081908
$desc.find('p.full-info').html(ab.info);
1909+
btn.$button.removeClass('bounce');
19091910
btn.changeState(); // Apply changes
19101911
});
19111912
}

0 commit comments

Comments
 (0)