Skip to content

Commit

Permalink
Fix bugs.
Browse files Browse the repository at this point in the history
1. fix strNumber function.
2. revert default character image.
3. update tip function and dialogue box for DecadeUI.
  • Loading branch information
adeFuLoDgu committed Oct 28, 2024
1 parent 699515e commit 58ab567
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 18 deletions.
4 changes: 2 additions & 2 deletions character/extra/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -4705,7 +4705,7 @@ const skills = {
if (result.bool) {
var card = result.cards[0];
var num = get.number(card);
if (typeof get.strNumber(num) === "string") {
if (typeof get.strNumber(num, false) === "string") {
if (lib.filter.canBeGained(card, player, target)) player.gain(card, target, "give", "bySelf");
} else if (lib.filter.canBeDiscarded(card, player, target)) target.discard(card);
} else event.finish();
Expand Down Expand Up @@ -4909,7 +4909,7 @@ const skills = {
audio: 2,
mod: {
cardname(card, player) {
if (player.storage.yuheng && typeof get.strNumber(card.number) === "string") {
if (player.storage.yuheng && typeof get.strNumber(card.number, false) === "string") {
var list = ["rezhiheng", "jiexun", "reanxu"];
for (var i of list) {
if (!player.storage.yuheng.includes(i)) return;
Expand Down
8 changes: 4 additions & 4 deletions character/sixiang/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -1405,24 +1405,24 @@ const skills = {
aiValue: (player, card, val) => {
if (card.name == "wuxie") return 0;
var num = get.number(card);
if (typeof get.strNumber(num) === "string") return 0;
if (typeof get.strNumber(num, false) === "string") return 0;
},
aiUseful: (player, card, val) => {
if (card.name == "wuxie") return 0;
var num = get.number(card);
if (typeof get.strNumber(num) === "string") return 0;
if (typeof get.strNumber(num, false) === "string") return 0;
},
aiOrder: (player, card, order) => {
var num = get.number(card);
if (typeof get.strNumber(num) === "string") return 0;
if (typeof get.strNumber(num, false) === "string") return 0;
return order;
},
},
trigger: {
player: "useCard",
},
filter(event, player) {
return typeof get.strNumber(get.number(event.card)) === "string";
return typeof get.strNumber(get.number(event.card), false) === "string";
},
forced: true,
async content(event, trigger, player) {
Expand Down
8 changes: 4 additions & 4 deletions character/sp/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -5459,17 +5459,17 @@ const skills = {
aiValue: (player, card, val) => {
if (card.name == "wuxie") return 0;
var num = get.number(card);
if (typeof get.strNumber(num) === "string") return val * 1.1;
if (typeof get.strNumber(num, false) === "string") return val * 1.1;
},
aiUseful: (player, card, val) => {
if (card.name == "wuxie") return 0;
var num = get.number(card);
if (typeof get.strNumber(num) === "string") return val * 1.1;
if (typeof get.strNumber(num, false) === "string") return val * 1.1;
},
aiOrder: (player, card, order) => {
if (get.name(card) == "sha" && player.hasSkill("oltuishi_unlimit")) order += 9;
var num = get.number(card);
if (typeof get.strNumber(num) === "string") order += 3;
if (typeof get.strNumber(num, false) === "string") order += 3;
return order;
},
},
Expand All @@ -5489,7 +5489,7 @@ const skills = {
.indexOf(event) >= 2
);
}
return typeof get.strNumber(get.number(event.card)) === "string";
return typeof get.strNumber(get.number(event.card), false) === "string";
},
forced: true,
content: function () {
Expand Down
4 changes: 4 additions & 0 deletions extension/十周年UI/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ body>.background {
background-size: 100% 100%;
}

.dialog.addNewRow .button.card {
zoom: 0.7;
}

.card,
#window:not(*[data-radius_size='']) .card {
border-radius: 2px;
Expand Down
11 changes: 11 additions & 0 deletions extension/十周年UI/player.css
Original file line number Diff line number Diff line change
Expand Up @@ -1381,4 +1381,15 @@
background-size: 100% 100%;
pointer-events: none;
z-index: 87;
}

.player .tipContainer {
z-index: 61;
top: 30%;
}

.player .tipContainer>.tip {
width: 100%;
left: 3%;
transform: scale(0.9);
}
Binary file modified image/character/default_silhouette_double.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/character/default_silhouette_female.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/character/default_silhouette_male.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 4 additions & 7 deletions noname/get/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2844,22 +2844,19 @@ export class Get extends GetCompatible {
/**
* 返回数字在扑克牌中的表示形式
* @param { number } num
* @param { boolean } [forced] 未获取点数字母对应元素时是否返回字符串格式
* @param { boolean } [forced] 未获取点数字母对应元素时,若此参数不为false,则返回字符串格式
* @returns { string }
*/
strNumber(num, forced) {
if (typeof num !== "number") return;
let result = lib.numstrList.get(num);
if (result === undefined) {
if (forced) result = num.toString();
result = num;
}
if (result === undefined && forced !== false) result = num.toString();
return result;
}
/**
* 返回扑克牌中的表示形式对应的数字
* @param { string } str
* @param { boolean } [forced] 未获取字母点数对应元素时是否返回数字格式
* @param { boolean } [forced] 未获取字母点数对应元素时,若此参数不为false,则返回数字格式
* @returns { number }
*/
numString(str, forced) {
Expand All @@ -2868,7 +2865,7 @@ export class Get extends GetCompatible {
map[list[1]] = list[0];
return map;
}, {})[str];
if (result === undefined && forced) result = parseInt(str);
if (result === undefined && forced !== false) result = parseInt(str);
return result;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion noname/library/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4166,7 +4166,7 @@ export class Library {
},
show_tip: {
name: "显示tip标记",
init: false,
init: true,
unfrequent: true,
onclick(bool) {
game.saveConfig("show_tip", bool);
Expand Down

0 comments on commit 58ab567

Please sign in to comment.