diff --git a/package-lock.json b/package-lock.json index c6af2d2e5..384e64338 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,12 +12,13 @@ "@heroiclabs/nakama-js": "^2.0.1", "compression": "^1.7.4", "express": "^4.17.3", - "jquery": "^3.5.0", + "jquery": "^3.7.1", "jquery.transit": "0.9.12", "js-cookie": "^3.0.1", "node-emoji": "^1.10.0", "phaser-ce": "2.16.0", - "semver": "^7.5.2" + "semver": "^7.5.2", + "server.js": "^1.0.0" }, "devDependencies": { "@babel/core": "^7.21.4", @@ -9155,9 +9156,9 @@ } }, "node_modules/jquery": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.4.tgz", - "integrity": "sha512-v28EW9DWDFpzcD9O5iyJXg3R3+q+mET5JhnjJzQUZMHOv67bpSIHq81GEYpPNZHG+XXHsfSme3nxp/hndKEcsQ==" + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" }, "node_modules/jquery.transit": { "version": "0.9.12", @@ -11461,6 +11462,11 @@ "node": ">= 0.8.0" } }, + "node_modules/server.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/server.js/-/server.js-1.0.0.tgz", + "integrity": "sha512-fO4IvzkZ09bBB++XU/gWGuzxJs0OpghSd/34mlW8coMoakLzj/+W5d1pHX+I+7H52GkBKu96UQU0K5vptNjaqg==" + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", diff --git a/package.json b/package.json index b446c2ad6..9adc3b50a 100644 --- a/package.json +++ b/package.json @@ -26,12 +26,13 @@ "@heroiclabs/nakama-js": "^2.0.1", "compression": "^1.7.4", "express": "^4.17.3", - "jquery": "^3.5.0", + "jquery": "^3.7.1", "jquery.transit": "0.9.12", "js-cookie": "^3.0.1", "node-emoji": "^1.10.0", "phaser-ce": "2.16.0", - "semver": "^7.5.2" + "semver": "^7.5.2", + "server.js": "^1.0.0" }, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/src/style/styles.less b/src/style/styles.less index ea89dc73c..d1189d851 100644 --- a/src/style/styles.less +++ b/src/style/styles.less @@ -377,6 +377,11 @@ cursor: help !important; } } + + &.potential { + animation: rightJump 1s infinite; + } + } #fullscreen { @@ -1439,6 +1444,20 @@ span.pure { } } +@keyframes rightJump { + 0% { + transform: translateX(0); + } + 50% { + transform: translateX(10px); + } + 100% { + transform: translateX(0); + } +} + + + /*--------------Framed Modal------------------*/ /* Modal window with graphical border and close button. */ .framed-modal { diff --git a/src/ui/button.ts b/src/ui/button.ts index 4acaf59ff..b59b9c897 100644 --- a/src/ui/button.ts +++ b/src/ui/button.ts @@ -9,6 +9,7 @@ export const ButtonStateEnum = { hidden: 'hidden', noClick: 'noclick', slideIn: 'slideIn', + potential: 'potential', } as const; /** @@ -101,6 +102,7 @@ export class Button { slideIn: {}, hidden: {}, noclick: {}, + potential: {}, }, }; @@ -204,7 +206,7 @@ export class Button { } }); - this.$button.removeClass('disabled glowing selected active noclick slideIn hidden'); + this.$button.removeClass('disabled glowing selected active noclick slideIn hidden potential'); wrapperElement && wrapperElement.removeClass('hidden'); this.$button.css(this.css.normal); diff --git a/src/ui/interface.js b/src/ui/interface.js index ef4e93d9a..0a3dc9008 100644 --- a/src/ui/interface.js +++ b/src/ui/interface.js @@ -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(){ + //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 + //Once Dragon Flight is upgraded + 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{ + 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 } // Change the ability's frame when it gets upgraded @@ -1938,6 +1971,7 @@ export class UI { $abilityInfo.append('
Upgrade : ' + ab.upgrade + '
'); } }); + 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){ + //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 ( @@ -2001,6 +2041,8 @@ export class UI { } } + this.showBonusPotential(); + // No action possible if (!oneUsableAbility && game.activeCreature.remainingMove === 0) { //game.skipTurn( { tooltip: "Finished" } ); // Autoskip