Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions character/onlyOL/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,15 @@ const skills = {
},
intro: {
markcount(storage, player) {
if (!storage) {
return "当前暂无记录";
}
return Object.values(storage).flat().length;
},
content(storage, player) {
if (!storage) {
return "当前暂无记录";
}
const cards = storage["card"],
skills = storage["skill"];
let str = "";
Expand Down
4 changes: 2 additions & 2 deletions noname/game/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ export class Check {
const player = event.player;
const card = get.card();
const targets = game.players.slice();
if (event.deadTarget || (event.skill && get.info(event.skill)?.deadTarget)) {
if (event.deadTarget || (event.skill && get.info(event.skill)?.deadTarget) || (card && get.info(card)?.deadTarget)) {
targets.addArray(game.dead);
}
const isSelectable = (target, event) => {
if (game.chess && !event.chessForceAll && player && get.distance(player, target, "pure") > 7) {
return false;
}
if (target.isOut() && !event.includeOut && !(event.skill && get.info(event.skill)?.includeOut)) {
if (target.isOut() && !event.includeOut && !(event.skill && get.info(event.skill)?.includeOut) && !(card && get.info(card)?.includeOut)) {
return false;
}
return event.filterTarget(card, player, target);
Expand Down
3 changes: 2 additions & 1 deletion noname/game/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7014,7 +7014,8 @@ export class Game extends GameCompatible {

if (event.isMine() && game.chess && get.config("show_distance") && game.me) {
const players = game.players.slice();
if (event.deadTarget || (event.skill && get.info(event.skill)?.deadTarget)) {
const card = get.card();
if (event.deadTarget || (event.skill && get.info(event.skill)?.deadTarget) || (card && get.info(card)?.deadTarget)) {
players.addArray(game.dead);
}
players.forEach(player => {
Expand Down
2 changes: 1 addition & 1 deletion noname/get/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4024,7 +4024,7 @@ else if (entry[1] !== void 0) stringifying[key] = JSON.stringify(entry[1]);*/
selectableTargets(sort) {
var selectable = [];
var players = game.players.slice(0);
if (_status.event.deadTarget || (_status.event.skill && get.info(_status.event.skill)?.deadTarget)) {
if (_status.event.deadTarget || (_status.event.skill && get.info(_status.event.skill)?.deadTarget) || (get.card() && get.info(get.card())?.deadTarget)) {
players.addArray(game.dead);
}
for (var i = 0; i < players.length; i++) {
Expand Down
12 changes: 5 additions & 7 deletions noname/library/element/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -6361,7 +6361,7 @@ player.removeVirtualEquip(card);
event.finish();
return;
}
game.log(player, "对", target, "发起", (event.isDelay ? "延时" : ""), "拼点");
game.log(player, "对", target, "发起", event.isDelay ? "延时" : "", "拼点");
if (!event.filterCard) {
event.filterCard = lib.filter.all;
}
Expand Down Expand Up @@ -6443,8 +6443,7 @@ player.removeVirtualEquip(card);
if (cardsx?.some(card => get.position(card) == "s")) {
evt.isDestoryed = true;
game.cardsGotoOrdering(cardsx);
}
else {
} else {
event.finish();
}
})
Expand All @@ -6453,8 +6452,7 @@ player.removeVirtualEquip(card);
});
event.untrigger();
event.finish();
}
else {
} else {
event.trigger("compareCardShowBefore");
}
"step 6";
Expand Down Expand Up @@ -9123,10 +9121,10 @@ player.removeVirtualEquip(card);
if (num == 0 && targets.length > 1) {
event.sortTarget(true, true);
}
if (targets[num] && targets[num].isDead()) {
if (targets[num] && targets[num].isDead() && !info?.deadTarget) {
return;
}
if (targets[num] && targets[num].isOut()) {
if (targets[num] && targets[num].isOut() && !info?.includeOut) {
return;
}
if (targets[num] && targets[num].removed) {
Expand Down
8 changes: 4 additions & 4 deletions noname/library/element/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -9332,9 +9332,9 @@ export class Player extends HTMLDivElement {
*/
hasUseTarget(card, distance, includecard) {
var player = this;
return game.hasPlayer(function (current) {
return game.hasPlayer2(function (current) {
return player.canUse(card, current, distance, includecard);
});
}, true);
}
/**
* 场上是否存在收益为正的目标
Expand All @@ -9348,7 +9348,7 @@ export class Player extends HTMLDivElement {
card = { name: card, isCard: true };
}
var player = this;
var targets = game.filterPlayer();
var targets = game.filterPlayer2(null, null, true);
var value = [];
var min = 0;
var info = get.info(card);
Expand Down Expand Up @@ -9410,7 +9410,7 @@ export class Player extends HTMLDivElement {
card = { name: card, isCard: true };
}
var player = this;
var targets = game.filterPlayer();
var targets = game.filterPlayer2(null, null, true);
var value = [];
var min = 0;
var info = get.info(card);
Expand Down
65 changes: 39 additions & 26 deletions noname/library/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ export class Library {
※ 部分功能将会作用于联机模式
`,
/**
* @param {boolean} bool
* @param {boolean} bool
*/
async onclick(bool) {
await game.promises.saveConfig("experimental_enable", bool);
Expand Down Expand Up @@ -11082,7 +11082,7 @@ export class Library {
return player.countUsed(card) < num;
}
},
cardUsable: function (card, player, event) {
cardUsable(card, player, event) {
card = get.autoViewAs(card);
var info = get.info(card);
event = event || _status.event;
Expand Down Expand Up @@ -11113,9 +11113,9 @@ export class Library {
return true;
}
if (
game.hasPlayer(function (current) {
game.hasPlayer2(function (current) {
return game.checkMod(card, player, current, false, "cardUsableTarget", player);
})
}, true)
) {
return true;
}
Expand Down Expand Up @@ -11183,7 +11183,7 @@ export class Library {
}
return _status.event._aiexclude.includes(card) == false;
},
filterCard: function (card, player, event) {
filterCard(card, player, event) {
var info = get.info(card);
//if(info.toself&&!lib.filter.targetEnabled(card,player,player)) return false;
if (player == undefined) {
Expand Down Expand Up @@ -11214,15 +11214,19 @@ export class Library {
return true;
}
var filterTarget = event && event.filterTarget ? event.filterTarget : lib.filter.filterTarget;
return game.hasPlayer(function (current) {
return game.hasPlayer2(function (current) {
return filterTarget(card, player, current);
});
}, true);
},
targetEnabledx: function (card, player, target) {
if (!card) {
targetEnabledx(card, player, target) {
if (!card || !target || target.removed) {
return false;
}
const info = get.info(card);
if (!info?.deadTarget && target.isDead()) {
return false;
}
if (!target || !target.isIn()) {
if (!info?.includeOut && target.isOut()) {
return false;
}
let event = _status.event,
Expand All @@ -11238,27 +11242,29 @@ export class Library {
return false;
}
}
var info = get.info(card);
if (info.singleCard && info.filterAddedTarget && ui.selected.targets.length) {
return Boolean(info.filterAddedTarget(card, player, target, ui.selected.targets[ui.selected.targets.length - 1]));
}
return lib.filter.targetEnabled.apply(this, arguments);
},
targetEnabled: function (card, player, target) {
if (!card) {
targetEnabled(card, player, target) {
if (!card || !target || target.removed) {
return false;
}
if (!target || !target.isIn()) {
const info = get.info(card);
if (!info?.deadTarget && target.isDead()) {
return false;
}
var info = get.info(card);
var filter = info.filterTarget;
if (!info?.includeOut && target.isOut()) {
return false;
}
const filter = info.filterTarget;
if (!info.singleCard || ui.selected.targets.length == 0) {
var mod = game.checkMod(card, player, target, "unchanged", "playerEnabled", player);
let mod = game.checkMod(card, player, target, "unchanged", "playerEnabled", player);
if (mod != "unchanged") {
return mod;
}
var mod = game.checkMod(card, player, target, "unchanged", "targetEnabled", target);
mod = game.checkMod(card, player, target, "unchanged", "targetEnabled", target);
if (mod != "unchanged") {
return mod;
}
Expand All @@ -11270,11 +11276,15 @@ export class Library {
return Boolean(filter(card, player, target));
}
},
targetEnabled2: function (card, player, target) {
if (!card) {
targetEnabled2(card, player, target) {
if (!card || !target || target.removed) {
return false;
}
const info = get.info(card);
if (!info?.deadTarget && target.isDead()) {
return false;
}
if (!target || !target.isIn()) {
if (!info?.includeOut && target.isOut()) {
return false;
}
if (lib.filter.targetEnabled(card, player, target)) {
Expand All @@ -11288,7 +11298,7 @@ export class Library {
return false;
}

var filter = get.info(card).modTarget;
const filter = get.info(card).modTarget;
if (typeof filter == "boolean") {
return filter;
}
Expand All @@ -11297,14 +11307,17 @@ export class Library {
}
return false;
},
targetEnabled3: function (card, player, target) {
if (!card) {
targetEnabled3(card, player, target) {
if (!card || !target || target.removed) {
return false;
}
if (!target || !target.isIn()) {
const info = get.info(card);
if (!info?.deadTarget && target.isDead()) {
return false;
}
if (!info?.includeOut && target.isOut()) {
return false;
}
var info = get.info(card);

if (info.filterTarget == true) {
return true;
Expand Down