Commit b0152b7e authored by nanahira's avatar nanahira

update death rule 2

parent 0de28045
......@@ -209,7 +209,7 @@
"death_remain_final": "若本回合基本分发生变动,在该回合结束时决斗即告结束,生命值多的玩家获得本场决斗的胜利。",
"death_finish_part1": "加时赛决斗结束,恭喜 ",
"death_finish_part2": " 获得本次决斗的胜利。",
"death2_finish_part1": "加时赛开始,恭喜 ",
"death2_finish_part1": "加时赛结束,恭喜 ",
"death2_finish_part2": " 获得本次比赛的胜利。",
"side_timeout_part1": "你现在有",
"side_timeout_part2": "分钟来更换副卡组。",
......
......@@ -1843,6 +1843,11 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
clearInterval client.side_interval
client.side_interval = null
client.side_tcount = null
if settings.modules.http.quick_death_rule == 2 and room.started and room.death and room.scores[room.dueling_players[0].name] != room.scores[room.dueling_players[1].name]
win_pos = if room.scores[room.dueling_players[0].name] > room.scores[room.dueling_players[1].name] then 0 else 1
ygopro.stoc_send_chat_to_room(room, "${death2_finish_part1}" + room.dueling_players[win_pos].name + "${death2_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
room.dueling_players[1 - win_pos].destroy()
return true
if room.random_type or room.arena
if client.pos == 0
room.waiting_for_player = room.waiting_for_player2
......
......@@ -2290,7 +2290,7 @@
});
ygopro.ctos_follow('UPDATE_DECK', true, function(buffer, info, client, server) {
var buff_main, buff_side, card, current_deck, deck, deck_array, deck_main, deck_side, deck_text, deckbuf, decks, found_deck, i, j, k, len, len1, line, room, struct;
var buff_main, buff_side, card, current_deck, deck, deck_array, deck_main, deck_side, deck_text, deckbuf, decks, found_deck, i, j, k, len, len1, line, room, struct, win_pos;
room = ROOM_all[client.rid];
if (!room) {
return false;
......@@ -2318,6 +2318,12 @@
client.side_interval = null;
client.side_tcount = null;
}
if (settings.modules.http.quick_death_rule === 2 && room.started && room.death && room.scores[room.dueling_players[0].name] !== room.scores[room.dueling_players[1].name]) {
win_pos = room.scores[room.dueling_players[0].name] > room.scores[room.dueling_players[1].name] ? 0 : 1;
ygopro.stoc_send_chat_to_room(room, "${death2_finish_part1}" + room.dueling_players[win_pos].name + "${death2_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
room.dueling_players[1 - win_pos].destroy();
return true;
}
if (room.random_type || room.arena) {
if (client.pos === 0) {
room.waiting_for_player = room.waiting_for_player2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment