Skip to content

Commit

Permalink
Fix bug and update.
Browse files Browse the repository at this point in the history
1. update DecadeUI assets.
2. fix connect mod bugs.
3. fix character bugs.
  • Loading branch information
adeFuLoDgu committed Oct 29, 2024
1 parent 58ab567 commit 7f1ce71
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 40 deletions.
20 changes: 20 additions & 0 deletions card/yunchou.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ game.import("card", function () {
ui.create.button(result.cards[0], "card", event.button.parentNode)
);
event.button.remove();
game.broadcast(
function (removed_card, added_card, id) {
let dialog = get.idDialog(id);
if (dialog) {
for (var i = 0; i < dialog.buttons.length; i++) {
if (dialog.buttons[i].link == removed_card) {
let removed_card_button = dialog.buttons[i];
dialog.buttons.remove(dialog.buttons[i]);
dialog.buttons.push(
ui.create.button(added_card, "card", removed_card_button.parentNode)
);
removed_card_button.remove();
}
}
}
},
event.button.link,
result.cards[0],
event.dialog.videoId
);
}
"step 3";
game.delay(2);
Expand Down
2 changes: 1 addition & 1 deletion character/offline/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ const skills = {
global: "xk_qiyijun_effect",
qiyi(player) {
player.addSkill("xk_qiyijun");
player.markSkillCharacter("xk_qiyijun", "shibing1", "起义军", "已决定起义<br>未起义的角色对你使用【杀】次数+1");
player.markSkillCharacter("xk_qiyijun", player, "起义军", "已决定起义<br>未起义的角色对你使用【杀】次数+1");
const next = game.createEvent("becomeQiyi");
next.player = player;
next.setContent("emptyEvent");
Expand Down
1 change: 1 addition & 0 deletions character/sp/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -5218,6 +5218,7 @@ const skills = {
info[result.index] = Math.min(5, info[result.index] + 1);
game.log(player, "的", result.control.slice(0, result.control.indexOf("(")), "#y+1");
player.markSkill("olgangshu_buff");
player.addTip("olgangshu_buff", "刚述 " + info.slice().join(" "));
}
},
ai: {
Expand Down
Binary file modified extension/十周年UI/image/card/dagongche_attack.webp
Binary file not shown.
Binary file modified extension/十周年UI/image/card/dagongche_defend.webp
Binary file not shown.
Binary file modified extension/十周年UI/image/card/jingxiangshengshi.webp
Binary file not shown.
Binary file modified extension/十周年UI/image/card/lx_huoshaolianying.webp
Binary file not shown.
Binary file added extension/十周年UI/image/card/mengchong.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified extension/十周年UI/image/card/sizhaojian.webp
Binary file not shown.
Binary file added extension/十周年UI/image/card/suibozhuliu.webp
Binary file not shown.
Binary file modified extension/十周年UI/image/card/tiejili.webp
Binary file not shown.
Binary file not shown.
Binary file added extension/十周年UI/image/card/xingbian.webp
Binary file not shown.
71 changes: 35 additions & 36 deletions extension/十周年UI/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}).length) event.num++;
if (!player.isMinHandcard()) event.num++;
if (!player.getStat('damage')) event.num++;
'step 1'
'step 1';
if (event.num == 0) {
player.gain(event.cards, 'draw');
event.finish();
Expand Down Expand Up @@ -376,16 +376,16 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
} else if (!event.isMine()) {
event.switchToAuto();
}
'step 2'
event.cards = event.cards2
'step 2';
event.cards = event.cards2;
if (event.result && event.result.bool) {
var cards = event.cards1;
var first = ui.cardPile.firstChild;
for (var i = 0; i < cards.length; i++) {
ui.cardPile.insertBefore(cards[i], first);
}
}
'step 3'
'step 3';
game.updateRoundNumber();
if (event.cards.length) {
player.gain(event.cards, 'draw');
Expand All @@ -397,15 +397,15 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
return - get.attitude(_status.event.player, target);
};
}
'step 4'
'step 4';
player.line(result.targets[0], 'fire');
player.loseHp();
result.targets[0].loseHp();
},
},
xunxun: {
content:function(){
'step 0'
'step 0';
var cards = get.cards(4);
var player = event.player;
var xunxun = decadeUI.content.chooseGuanXing(player, cards, cards.length, null, 2);
Expand Down Expand Up @@ -448,7 +448,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
event.switchToAuto();
}

'step 1'
'step 1';
var first = ui.cardPile.firstChild;
var cards = event.cards2;
for (var i = 0; i < cards.length; i++) {
Expand All @@ -464,7 +464,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
},
xinfu_dianhua: {
content:function(){
'step 0'
'step 0';
var player = event.player;
if(player.isUnderControl()) game.modeSwapPlayer(player);
var num = 0;
Expand All @@ -475,12 +475,11 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
var cards = get.cards(num);
var dianhua = decadeUI.content.chooseGuanXing(player, cards, cards.length, null, cards.length);
dianhua.caption = '【点化】';
game.broadcast(function(player, cards, callback){
game.broadcast(function(player, cards){
if (!window.decadeUI) return;
var dianhua = decadeUI.content.chooseGuanXing(player, cards, cards.length, null, cards.length);
dianhua.caption = '【点化】';
dianhua.callback = callback;
}, player, cards, dianhua.callback);
}, player, cards);

event.switchToAuto = function(){
var cards = dianhua.cards[0].concat();
Expand All @@ -506,12 +505,12 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
if (friend) {
if (get.value(cards[i], friend) >= 5) {
cheats.push(cards[i]);
cards.splice(i, 1)
cards.splice(i, 1);
}
} else {
if (get.value(cards[i], next) < 4) {
cheats.push(cards[i]);
cards.splice(i, 1)
cards.splice(i, 1);
}
}
}
Expand Down Expand Up @@ -545,7 +544,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
} else if (!event.isMine()) {
event.switchToAuto();
}
'step 1'
'step 1';
player.popup(get.cnNumber(event.num1) + '上' + get.cnNumber(event.num2) + '下');
game.log(player, '将' + get.cnNumber(event.num1) + '张牌置于牌堆顶,' + get.cnNumber(event.num2) +'张牌置于牌堆底');
game.updateRoundNumber();
Expand Down Expand Up @@ -636,7 +635,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
event.switchToAuto();
}

'step 1'
'step 1';
var first = ui.cardPile.firstChild;
var cards = event.cards2;
for (var i = 0; i < cards.length; i++) {
Expand Down Expand Up @@ -678,7 +677,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
for (var i = 0; i >= 0 && i < cards.length; i++) {
if (get.value(cards[i], player) >= 5) {
cheats.push(cards[i]);
cards.splice(i, 1)
cards.splice(i, 1);
}
}
}
Expand All @@ -699,7 +698,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}, time, cards[i], i, (i >= cards.length - 1));
time += 500;
}
}
};

if (event.isOnline()) {
event.player.send(function(){
Expand All @@ -711,7 +710,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
} else if (!event.isMine()) {
event.switchToAuto();
}
"step 1"
"step 1";
player.popup(get.cnNumber(event.num1) + '上' + get.cnNumber(event.num2) + '下');
game.log(player, '将' + get.cnNumber(event.num1) + '张牌置于牌堆顶,' + get.cnNumber(event.num2) +'张牌置于牌堆底');
game.updateRoundNumber();
Expand Down Expand Up @@ -760,7 +759,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}, time, cards[i], i, i >= cards.length - 1);
time += 500;
}
}
};

if (event.isOnline()) {
event.player.send(function(){
Expand All @@ -776,9 +775,9 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
},
luoying_discard: {
content: function() {
"step 0"
"step 0";
if (trigger.delay == false) game.delay();
"step 1"
"step 1";
var cards = [];
for (var i = 0; i < trigger.cards2.length; i++) {
var card = trigger.cards2[i];
Expand Down Expand Up @@ -818,7 +817,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}, time, cards[i], i, i >= cards.length - 1);
time += 500;
}
}
};

if (event.isOnline()) {
event.player.send(function(){
Expand All @@ -830,7 +829,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
} else if (!event.isMine()) {
event.switchToAuto();
}
"step 2"
"step 2";
game.cardsDiscard(event.cards1);
if (event.cards2) {
player.gain(event.cards2, 'gain2', 'log');
Expand All @@ -839,7 +838,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
},
luoying_judge: {
content: function() {
"step 0"
"step 0";
var cards = trigger.cards;

var dialog = decadeUI.content.chooseGuanXing(player, cards, cards.length, null, cards.length, false);
Expand Down Expand Up @@ -870,7 +869,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}, time, cards[i], i, i >= cards.length - 1);
time += 500;
}
}
};

if (event.isOnline()) {
event.player.send(function(){
Expand All @@ -882,7 +881,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
} else if (!event.isMine()) {
event.switchToAuto();
}
"step 1"
"step 1";
game.cardsDiscard(event.cards1);
if (event.cards2) {
player.gain(event.cards2, 'gain2', 'log');
Expand All @@ -903,7 +902,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
},
nk_shekong: {
content:function(){
'step 0'
'step 0';
event.cardsx = cards.slice(0);
var num = get.cnNumber(cards.length);
var trans = get.translation(player);
Expand All @@ -923,7 +922,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}) >= _status.event.numx)) return 7 - get.value(card);
return - 1;
};
'step 1'
'step 1';
if (result.bool) {
if (result.cards.length == cards.length) player.draw();
else player.draw(cards.length);
Expand All @@ -932,7 +931,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
if (get.position(event.cardsx[i]) != 'd') event.cardsx.splice(i--, 1);
}
} else event.finish();
'step 2'
'step 2';
if (event.cardsx.length) {
var cards = event.cardsx;
var dialog = decadeUI.content.chooseGuanXing(player, cards, cards.length);
Expand Down Expand Up @@ -972,7 +971,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}, time, cards[i], i, i >= cards.length - 1);
time += 500;
}
}
};

if (event.isOnline()) {
event.player.send(function(){
Expand All @@ -985,15 +984,15 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
event.switchToAuto();
}
} else event.finish();
}
},
},
kamome_huanmeng:{
content:function(){
"step 0"
"step 0";
if (player.isUnderControl()) {
game.modeSwapPlayer(player);
}
var num = 1 + player.countCards('e');;
var num = 1 + player.countCards('e');
var cards = get.cards(num);
var guanxing = decadeUI.content.chooseGuanXing(player, cards, cards.length, null, cards.length);
guanxing.caption = '【幻梦】';
Expand All @@ -1014,7 +1013,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
for (var i = 0; i >= 0 && i < cards.length; i++) {
if (get.value(cards[i], player) >= 5) {
cheats.push(cards[i]);
cards.splice(i, 1)
cards.splice(i, 1);
}
}
}
Expand All @@ -1035,7 +1034,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
}, time, cards[i], i, (i >= cards.length - 1));
time += 500;
}
}
};

if (event.isOnline()) {
event.player.send(function(){
Expand All @@ -1047,7 +1046,7 @@ decadeModule.import((lib, game, ui, get, ai, _status) => {
} else if (!event.isMine()) {
event.switchToAuto();
}
"step 1"
"step 1";
player.popup(get.cnNumber(event.num1) + '上' + get.cnNumber(event.num2) + '下');
game.log(player, '将' + get.cnNumber(event.num1) + '张牌置于牌堆顶,' + get.cnNumber(event.num2) +'张牌置于牌堆底');
game.updateRoundNumber()
Expand Down
2 changes: 1 addition & 1 deletion game/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ window.config = {
right_click: "pause",
sort: "type_sort",

cards: ["standard", "extra", "sp", "zhulu", "yingbian", "yongjian", "yunchou"],
cards: ["standard", "extra", "sp", "zhulu", "yingbian", "yongjian", "yunchou", "xianxia"],
characters: ["standard", "shenhua", "sp", "sp2", "yijiang", "newjiang", "sixiang", "refresh", "mobile", "extra", "yingbian", "sb", "tw", "offline", "clan", "collab", "xianding", "huicui", "shiji", "jsrg", "onlyOL", "old"],
moderned_chracters: ["standard", "shenhua", "sp", "sp2", "yijiang", "newjiang", "sixiang", "refresh", "mobile", "extra", "yingbian", "sb", "tw", "offline", "clan", "collab", "xianding", "huicui", "shiji", "onlyOL", "jsrg", "old", "diy", "ddd", "key"],
connect_characters: ["diy", "ddd", "key"],
Expand Down
4 changes: 2 additions & 2 deletions noname/library/element/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -3040,8 +3040,8 @@ export const Content = {
}
}
"step 4";
if (window.decadeUI){
setTimeout(decadeUI.effect.gameStart, 51);
if (window.decadeUI) {
game.broadcastAll( () => setTimeout(decadeUI.effect.gameStart, 51) );
}
},
phaseLoop: function () {
Expand Down
1 change: 1 addition & 0 deletions noname/ui/create/menu/pages/startMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export const startMenu = function (connectMenu) {
30: "30秒",
60: "60秒",
90: "90秒",
300: "5分钟",
},
connect: true,
frequent: true,
Expand Down

0 comments on commit 7f1ce71

Please sign in to comment.