Commit 1bffbd6a authored by nanahira's avatar nanahira

fix death

parent 24047452
......@@ -141,6 +141,7 @@
"public_roomlist": false,
"show_ip": false,
"show_info": true,
"quick_death_rule": false,
"ssl": {
"enabled": false,
"port": 7923,
......
......@@ -185,8 +185,10 @@
"cannot_to_observer": "匹配模式中决斗者不允许观战。",
"death_cancel": "已取消本房间的加时赛状态。",
"death_start": "加时赛开始,从本回合开始计算4回合,基本分高的玩家获得本次决斗的胜利。",
"death_start_siding": "加时赛开始,下次决斗将进入猝死赛,基本分发生变动的回合结束时将决出胜负。",
"death_start_siding": "加时赛开始,下次决斗的第4回合结束时,基本分高的玩家决斗胜利。",
"death_start_quick": "加时赛开始,下次决斗将进入猝死赛,基本分发生变动的回合结束时将决出胜负。",
"death_start_final": "本次决斗将进入猝死赛,基本分发生变动的回合结束时,基本分高的玩家将获得本次决斗的胜利。",
"death_start_extra": "本次决斗为额外决斗,第4回合结束时,基本分高的玩家获得本次决斗的胜利。",
"death_remain_part1": "本次决斗将在",
"death_remain_part2": "回合后结束,基本分高的玩家将获得本次决斗的胜利。",
"death_remain_final": "若本回合有双方的基本分发生变动,则回合结束时基本分高的玩家将获得本次决斗的胜利。",
......
......@@ -1252,9 +1252,13 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
room.turn = 0
room.dueling = true
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)
if room.death
if settings.modules.http.quick_death_rule and room.duel_count > 1
room.death = -1
ygopro.stoc_send_chat_to_room(room, "${death_start_final}", ygopro.constants.COLORS.BABYBLUE)
else
room.death = 5
ygopro.stoc_send_chat_to_room(room, "${death_start_extra}", ygopro.constants.COLORS.BABYBLUE)
#ygopro.stoc_send_chat_to_room(room, "LP跟踪调试信息: #{client.name} 初始LP #{client.lp}")
......@@ -1267,6 +1271,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
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)
ygopro.ctos_send((if room.dueling_players[0].lp > room.dueling_players[1].lp then room.dueling_players[1] else room.dueling_players[0]).server, 'SURRENDER')
else
room.death = -1
ygopro.stoc_send_chat_to_room(room, "${death_remain_final}", ygopro.constants.COLORS.BABYBLUE)
else
ygopro.stoc_send_chat_to_room(room, "${death_remain_part1}" + (room.death - room.turn) + "${death_remain_part2}", ygopro.constants.COLORS.BABYBLUE)
......@@ -2040,9 +2045,12 @@ if settings.modules.http
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
else
room.death = -1
ygopro.stoc_send_chat_to_room(room, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE)
if settings.modules.http.quick_death_rule
ygopro.stoc_send_chat_to_room(room, "${death_start_quick}", ygopro.constants.COLORS.BABYBLUE)
else
ygopro.stoc_send_chat_to_room(room, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE)
response.writeHead(200)
if death_room_found
response.end(addCallback(u.query.callback, "['death ok', '" + u.query.death + "']"))
......
......@@ -1497,9 +1497,14 @@
room.turn = 0;
room.dueling = true;
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 (room.death) {
if (settings.modules.http.quick_death_rule && room.duel_count > 1) {
room.death = -1;
ygopro.stoc_send_chat_to_room(room, "${death_start_final}", ygopro.constants.COLORS.BABYBLUE);
} else {
room.death = 5;
ygopro.stoc_send_chat_to_room(room, "${death_start_extra}", ygopro.constants.COLORS.BABYBLUE);
}
}
}
}
......@@ -1512,6 +1517,7 @@
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);
ygopro.ctos_send((room.dueling_players[0].lp > room.dueling_players[1].lp ? room.dueling_players[1] : room.dueling_players[0]).server, 'SURRENDER');
} else {
room.death = -1;
ygopro.stoc_send_chat_to_room(room, "${death_remain_final}", ygopro.constants.COLORS.BABYBLUE);
}
} else {
......@@ -2575,7 +2581,11 @@
ygopro.stoc_send_chat_to_room(room, "${death_start}", ygopro.constants.COLORS.BABYBLUE);
} else {
room.death = -1;
ygopro.stoc_send_chat_to_room(room, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE);
if (settings.modules.http.quick_death_rule) {
ygopro.stoc_send_chat_to_room(room, "${death_start_quick}", ygopro.constants.COLORS.BABYBLUE);
} else {
ygopro.stoc_send_chat_to_room(room, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE);
}
}
}
response.writeHead(200);
......
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