消灭炉石传说模式下[4]和[5]的垃圾

This commit is contained in:
Spmario233 2024-04-23 21:42:40 +08:00
parent 88c31a49a0
commit 1f96b1f3ee
4 changed files with 60 additions and 35 deletions

View File

@ -67,7 +67,6 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
delete lib.translate.shuiyanqijunx_info_guozhan;
const pack = lib.yingbian_guozhan;
for (const i in pack) {
if (!pack[i][4]) pack[i][4] = [];
lib.character[i] = pack[i];
lib.characterPack.mode_guozhan[i] = pack[i];
if (!lib.translate[i]) lib.translate[i] = lib.translate[i.slice(3)];
@ -120,7 +119,6 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
delete lib.translate.shuiyanqijunx_info_guozhan;
const pack2 = lib.yingbian_guozhan;
for (const i in pack2) {
if (!pack2[i][4]) pack2[i][4] = [];
pack[i] = pack2[i];
}
}
@ -22329,7 +22327,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}
}
}
if (lib.character[button.link][4].includes("hiddenSkill")) return false;
if (lib.character[button.link].hasHiddenSkill) return false;
var filterChoice = function (name1, name2) {
if (_status.separatism) return true;
var group1 = lib.character[name1][1];

View File

@ -307,9 +307,6 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
if (_status.mode != "normal") return;
for (var i in lib.characterSingle) {
lib.character[i] = lib.characterSingle[i];
if (!lib.character[i][4]) {
lib.character[i][4] = [];
}
}
for (var j in lib.singleTranslate) lib.translate[j] = lib.singleTranslate[j];
},
@ -352,11 +349,8 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
for (var j in singleTranslate) lib.translate[j] = singleTranslate[j];
_status.characterlist = [];
for (var i in characterSingle) {
if (!jin && characterSingle[i][1] == "jin") continue;
if (!jin && get.convertedCharacter(characterSingle[i]) == "jin") continue;
lib.character[i] = characterSingle[i];
if (!lib.character[i][4]) {
lib.character[i][4] = [];
}
_status.characterlist.push(i);
}
},
@ -647,7 +641,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
[game.me, game.me.enemy].forEach((current) => {
if (
current.storage.nohp ||
(lib.character[current.name1][4].includes("hiddenSkill") && !current.noclick)
(lib.character[current.name1].hasHiddenSkil && !current.noclick)
) {
current.storage.rawHp = 1;
current.storage.rawMaxHp = 1;
@ -1116,7 +1110,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
current.init(result[i][0]);
if (
current.storage.nohp ||
(lib.character[current.name1][4].includes("hiddenSkill") && !current.noclick)
(lib.character[current.name1].hasHiddenSkil && !current.noclick)
) {
current.storage.rawHp = 1;
current.storage.rawMaxHp = 1;
@ -1134,7 +1128,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
current.init(result[i][0]);
if (
current.storage.nohp ||
(lib.character[current.name1][4].includes("hiddenSkill") &&
(lib.character[current.name1].hasHiddenSkil &&
!current.noclick)
) {
current.storage.rawHp = 1;

View File

@ -2256,33 +2256,33 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
var i, j, name;
for (var i in lib.characterPack.mode_stone) {
lib.character[i] = lib.characterPack.mode_stone[i];
if (lib.characterPack.mode_stone[i][4].includes("stonespecial")) continue;
lib.character[i][3].add("stonesha");
lib.character[i][3].add("stoneshan");
lib.character[i][3].add("stonedraw");
if (lib.character[i].isSpecialInStoneMode) continue;
lib.character[i].skills.add("stonesha");
lib.character[i].skills.add("stoneshan");
lib.character[i].skills.add("stonedraw");
name = i + "_stonecharacter";
lib.card[name] = {
image: "mode/stone/character/" + i,
stoneact: lib.character[i][5][0],
career: lib.character[i][5][2] || null,
stoneact: lib.character[i].stoneModeData[0],
career: lib.character[i].stoneModeData[2] || null,
};
for (j in lib.element.stonecharacter) {
lib.card[name][j] = lib.element.stonecharacter[j];
}
lib.translate[name] = get.translation(i);
lib.translate[name + "_info"] = get.skillintro(i);
if (lib.character[i][4].includes("stonehidden")) {
if (lib.character[i].isHiddenInStoneMode) {
lib.card[name].stonehidden = true;
continue;
}
if (!lib.character[i][5][2]) {
if (lib.character[i][5][0] < 3) {
if (!lib.character[i].stoneModeData[2]) {
if (lib.character[i].stoneModeData[0] < 3) {
list.push(name);
} else {
list2.push(name);
}
} else {
list3[lib.character[i][5][2]].push(name);
list3[lib.character[i].stoneModeData[2]].push(name);
}
}
if (_status.mode == "deck") {
@ -2415,8 +2415,8 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
var list = [];
event.list = list;
for (i in lib.character) {
if (lib.character[i][4] && lib.character[i][4].includes("minskin")) continue;
if (lib.character[i][4] && lib.character[i][4].includes("stonehidden")) continue;
if (lib.character[i].isMinskin) continue;
if (lib.character[i].isHiddenInStoneMode) continue;
if (lib.config.forbidstone.includes(i)) continue;
if (lib.filter.characterDisabled(i)) continue;
list.push(i);
@ -7232,10 +7232,10 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
var list = [];
for (var i in lib.character) {
if (
lib.character[i][4].includes("stone") &&
!lib.character[i][4].includes("stonehidden") &&
lib.character[i][5] &&
lib.character[i][5][0] == num
lib.character[i].isFellowInStoneMode &&
!lib.character[i].isHiddenInStoneMode &&
lib.character[i].stoneModeData &&
lib.character[i].stoneModeData[0] == num
) {
list.push(i);
}
@ -7787,10 +7787,10 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
var list = [];
for (var i in lib.character) {
if (
lib.character[i][4].includes("stone") &&
!lib.character[i][4].includes("stonehidden") &&
lib.character[i][5] &&
lib.character[i][5][0] == 1
lib.character[i].isFellowInStoneMode &&
!lib.character[i].isHiddenInStoneMode &&
lib.character[i].stoneModeData &&
lib.character[i].stoneModeData[0] == 1
) {
list.push(i);
}
@ -10366,9 +10366,9 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
var list = [];
var list2 = [];
for (var i in lib.character) {
if (lib.character[i][4].includes("stonelegend_" + player.career)) {
if (lib.character[i].trashBin.includes("stonelegend_" + player.career)) {
list.push(i);
} else if (lib.character[i][4].includes("stonelegend")) {
} else if (lib.character[i].trashBin.includes("stonelegend")) {
list2.push(i);
}
}

View File

@ -95,11 +95,26 @@ export class Character {
* @type { boolean }
**/
isAiForbidden = false;
/**
* 武将牌在炉石模式下的特殊信息
* @type { array|undefined }
**/
stoneModeData;
/**
* 武将牌是否为炉石模式下的随从
* @type { boolean }
**/
isFellowInStoneMode = false;
/**
* 武将牌是否为炉石模式下的隐藏武将
* @type { boolean }
**/
isHiddenInStoneMode = false;
/**
* 武将牌是否为炉石模式下的特殊随从可以使用装备和锦囊
* @type { boolean }
**/
isSpecialInStoneMode = false;
/**
* 武将牌是否为bossallowed
* @type { boolean }
@ -137,6 +152,7 @@ export class Character {
this.hujia = get.infoHujia(data[2]);
this.skills = get.copy(data[3] || []);
if (data[4]) Character.convertTrashToProperties(this, data[4]);
if (data[5]) this.stoneModeData = data[5];
} else if (get.is.object(data)) {
Object.assign(this, data);
if (typeof this.maxHp !== "number") this.maxHp = this.hp;
@ -175,8 +191,12 @@ export class Character {
character.isHiddenBoss = true;
} else if (item === "forbidai") {
character.isAiForbidden = true;
} else if (item === "stone") {
character.isFellowInStoneMode = true;
} else if (item === "stonehidden") {
character.isHiddenInStoneMode = true;
} else if (item === "stonespecial") {
character.isSpecialInStoneMode = true;
} else if (item === "hiddenSkill") {
character.hasHiddenSkill = true;
} else if (item.startsWith("border:")) {
@ -278,9 +298,15 @@ export class Character {
if (character.isAiForbidden) {
trashes.push("forbidai");
}
if (character.isFellowInStoneMode) {
trashes.push("stone");
}
if (character.isHiddenInStoneMode) {
trashes.push("stonehidden");
}
if (character.isSpecialInStoneMode) {
trashes.push("stonespecial");
}
if (character.hasHiddenSkill) {
trashes.push("hiddenSkill");
}
@ -302,4 +328,11 @@ export class Character {
set 4(trashBin) {
console.warn("你set你🐎的废弃属性");
}
get 5(){
return this.stoneModeData;
}
set 5(stoneData){
this.stoneModeData = stoneData;
}
}