Commit 24047452 authored by nanahira's avatar nanahira

fix death 3 rule

parent d1429cd6
......@@ -185,7 +185,8 @@
"cannot_to_observer": "匹配模式中决斗者不允许观战。",
"death_cancel": "已取消本房间的加时赛状态。",
"death_start": "加时赛开始,从本回合开始计算4回合,基本分高的玩家获得本次决斗的胜利。",
"death_start_siding": "加时赛开始,下次决斗第4回合结束后,基本分高的玩家将获得本次决斗的胜利。",
"death_start_siding": "加时赛开始,下次决斗将进入猝死赛,基本分发生变动的回合结束时将决出胜负。",
"death_start_final": "本次决斗将进入猝死赛,基本分发生变动的回合结束时,基本分高的玩家将获得本次决斗的胜利。",
"death_remain_part1": "本次决斗将在",
"death_remain_part2": "回合后结束,基本分高的玩家将获得本次决斗的胜利。",
"death_remain_final": "若本回合有双方的基本分发生变动,则回合结束时基本分高的玩家将获得本次决斗的胜利。",
......
......@@ -1251,18 +1251,17 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
if client.pos == 0
room.turn = 0
room.dueling = true
if room.death == -1
room.death = 5
else
room.death = 0
room.duel_count = room.duel_count + 1
if room.death and room.duel_count > 1
room.death = -1
ygopro.stoc_send_chat_to_room(room, "${death_start_final}", ygopro.constants.COLORS.BABYBLUE)
#ygopro.stoc_send_chat_to_room(room, "LP跟踪调试信息: #{client.name} 初始LP #{client.lp}")
if ygopro.constants.MSG[msg] == 'NEW_TURN'
if client.pos == 0
room.turn = room.turn + 1
if room.death > 0
if room.death
if room.turn >= room.death
if room.dueling_players[0].lp != room.dueling_players[1].lp
ygopro.stoc_send_chat_to_room(room, "${death_finish_part1}" + (if room.dueling_players[0].lp > room.dueling_players[1].lp then room.dueling_players[0] else room.dueling_players[1]).name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
......@@ -1280,8 +1279,6 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
pos = 1 - pos unless client.is_first or pos == 2
reason = buffer.readUInt8(2)
room.dueling = false
if room.death
room.death = -1
#log.info {winner: pos, reason: reason}
#room.duels.push {winner: pos, reason: reason}
room.winner = pos
......@@ -1910,7 +1907,7 @@ if settings.modules.http
name: player.name + (if settings.modules.http.show_ip and pass_validated and player.ip != '::ffff:127.0.0.1' then (" (IP: " + player.ip.slice(7) + ")") else "") + (if settings.modules.http.show_info and room.started and not (room.hostinfo.mode == 2 and player.pos > 1) then (" (Score:" + room.scores[player.name] + " LP:" + (if player.lp? then player.lp else room.hostinfo.start_lp) + ")") else ""),
pos: player.pos
),
istart: if room.started then (if settings.modules.http.show_info then ("Duel:" + room.duel_count + " Turn:" + (if room.turn? then room.turn else 0) + (if room.death > 0 then "/" + (room.death - 1) else "")) else 'start') else 'wait'
istart: if room.started then (if settings.modules.http.show_info then ("Duel:" + room.duel_count + " Turn:" + (if room.turn? then room.turn else 0) + (if room.death then "/" + (if room.death > 0 then room.death - 1 else "Death") else "")) else 'start') else 'wait'
), null, 2
response.end(addCallback(u.query.callback, roomsjson))
......@@ -2040,7 +2037,7 @@ if settings.modules.http
death_room_found = false
for room in ROOM_all when room and room.established and room.started and !room.death and (u.query.death == "all" or u.query.death == room.port.toString())
death_room_found = true
if room.dueling
if room.dueling or !room.duel_count
room.death = (if room.turn then room.turn + 4 else 5)
ygopro.stoc_send_chat_to_room(room, "${death_start}", ygopro.constants.COLORS.BABYBLUE)
else
......
......@@ -1496,18 +1496,17 @@
if (client.pos === 0) {
room.turn = 0;
room.dueling = true;
if (room.death === -1) {
room.death = 5;
} else {
room.death = 0;
}
room.duel_count = room.duel_count + 1;
if (room.death && room.duel_count > 1) {
room.death = -1;
ygopro.stoc_send_chat_to_room(room, "${death_start_final}", ygopro.constants.COLORS.BABYBLUE);
}
}
}
if (ygopro.constants.MSG[msg] === 'NEW_TURN') {
if (client.pos === 0) {
room.turn = room.turn + 1;
if (room.death > 0) {
if (room.death) {
if (room.turn >= room.death) {
if (room.dueling_players[0].lp !== room.dueling_players[1].lp) {
ygopro.stoc_send_chat_to_room(room, "${death_finish_part1}" + (room.dueling_players[0].lp > room.dueling_players[1].lp ? room.dueling_players[0] : room.dueling_players[1]).name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
......@@ -1532,9 +1531,6 @@
}
reason = buffer.readUInt8(2);
room.dueling = false;
if (room.death) {
room.death = -1;
}
room.winner = pos;
if (room && !room.finished && room.dueling_players[pos]) {
room.winner_name = room.dueling_players[pos].name;
......@@ -2413,7 +2409,7 @@
}
return results1;
})(),
istart: room.started ? (settings.modules.http.show_info ? "Duel:" + room.duel_count + " Turn:" + (room.turn != null ? room.turn : 0) + (room.death > 0 ? "/" + (room.death - 1) : "") : 'start') : 'wait'
istart: room.started ? (settings.modules.http.show_info ? "Duel:" + room.duel_count + " Turn:" + (room.turn != null ? room.turn : 0) + (room.death ? "/" + (room.death > 0 ? room.death - 1 : "Death") : "") : 'start') : 'wait'
});
}
}
......@@ -2574,7 +2570,7 @@
continue;
}
death_room_found = true;
if (room.dueling) {
if (room.dueling || !room.duel_count) {
room.death = (room.turn ? room.turn + 4 : 5);
ygopro.stoc_send_chat_to_room(room, "${death_start}", ygopro.constants.COLORS.BABYBLUE);
} else {
......
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