修复富甲天下自由点将无限刷金币BUG

This commit is contained in:
kuangthree 2024-04-20 13:23:28 +08:00
parent 5dffc03b14
commit 16a391f74a
13 changed files with 18 additions and 14 deletions

BIN
audio/effect/coin.mp3 Normal file

Binary file not shown.

BIN
audio/effect/coin_cost.mp3 Normal file

Binary file not shown.

View File

@ -131,8 +131,12 @@ game.import("play", function () {
}
},
game: {
changeCoin: function (num) {
changeCoin: function (num,toast) {
if (typeof num == "number" && ui.coin) {
if(num!=0 && toast!== false){
game.playAudio('effect',num > 0?"coin":"coin_cost");
ui.create.toast(`${num > 0 ? "获得":"花费"} ${num} 金币`);
}
game.saveConfig("coin", lib.config.coin + num);
var str;
if (lib.config.coin_display_playpackconfig == "text") {

View File

@ -1,5 +1,5 @@
.toast-container {
position: fixed;
position: absolute;
top: 15%;
left: 50%;
transform: translateX(-50%);

View File

@ -1718,7 +1718,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -3420,7 +3420,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -4306,7 +4306,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -1094,7 +1094,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -22429,7 +22429,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -2303,7 +2303,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -2486,7 +2486,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -841,7 +841,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;
@ -1115,7 +1115,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;
@ -1446,7 +1446,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;
@ -1637,7 +1637,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
ui.cheat2 = ui.create.control("自由选将", function () {
if (this.dialog == _status.event.dialog) {
if (game.changeCoin) {
game.changeCoin(50);
game.changeCoin(10);
}
this.dialog.close();
_status.event.dialog = this.backup;

View File

@ -360,7 +360,7 @@ export class Create {
return container;
})();
const toast = document.createElement("div");
toast.textContent = message;
toast.innerHTML = message;
toast.classList.add("toast");
toastContainer.appendChild(toast);
ui.toastQueue.push(toast);