Commit 8757cd68 authored by nanahira's avatar nanahira

fix

parent 06e5f107
...@@ -1400,6 +1400,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)-> ...@@ -1400,6 +1400,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
pos = 1 - pos unless client.is_first pos = 1 - pos unless client.is_first
val = buffer.readInt32LE(2) val = buffer.readInt32LE(2)
room.dueling_players[pos].lp -= val room.dueling_players[pos].lp -= val
room.dueling_players[pos].lp = 0 if room.dueling_players[pos].lp < 0
if 0 < room.dueling_players[pos].lp <= 100 if 0 < room.dueling_players[pos].lp <= 100
ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK) ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK)
...@@ -1420,6 +1421,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)-> ...@@ -1420,6 +1421,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
pos = 1 - pos unless client.is_first pos = 1 - pos unless client.is_first
val = buffer.readInt32LE(2) val = buffer.readInt32LE(2)
room.dueling_players[pos].lp -= val room.dueling_players[pos].lp -= val
room.dueling_players[pos].lp = 0 if room.dueling_players[pos].lp < 0
if 0 < room.dueling_players[pos].lp <= 100 if 0 < room.dueling_players[pos].lp <= 100
ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK) ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK)
...@@ -1900,14 +1902,12 @@ ygopro.stoc_follow 'CHAT', true, (buffer, info, client, server)-> ...@@ -1900,14 +1902,12 @@ ygopro.stoc_follow 'CHAT', true, (buffer, info, client, server)->
return unless room and pid < 4 and settings.modules.chat_color.enabled return unless room and pid < 4 and settings.modules.chat_color.enabled
if room.started and room.turn > 0 and !room.dueling_players[0].is_first if room.started and room.turn > 0 and !room.dueling_players[0].is_first
if room.hostinfo.mode == 2 if room.hostinfo.mode == 2
if pid == 0 pid = {
pid = 2 0: 2,
else if pid = 1 1: 3,
pid = 3 2: 0,
else if pid = 2 3: 1
pid = 0 }[pid]
else if pid = 3
pid = 1
else else
pid = 1 - pid pid = 1 - pid
for player in room.players when player and player.pos == pid for player in room.players when player and player.pos == pid
......
...@@ -1684,6 +1684,9 @@ ...@@ -1684,6 +1684,9 @@
} }
val = buffer.readInt32LE(2); val = buffer.readInt32LE(2);
room.dueling_players[pos].lp -= val; room.dueling_players[pos].lp -= val;
if (room.dueling_players[pos].lp < 0) {
room.dueling_players[pos].lp = 0;
}
if ((0 < (ref = room.dueling_players[pos].lp) && ref <= 100)) { if ((0 < (ref = room.dueling_players[pos].lp) && ref <= 100)) {
ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK); ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK);
} }
...@@ -1711,6 +1714,9 @@ ...@@ -1711,6 +1714,9 @@
} }
val = buffer.readInt32LE(2); val = buffer.readInt32LE(2);
room.dueling_players[pos].lp -= val; room.dueling_players[pos].lp -= val;
if (room.dueling_players[pos].lp < 0) {
room.dueling_players[pos].lp = 0;
}
if ((0 < (ref1 = room.dueling_players[pos].lp) && ref1 <= 100)) { if ((0 < (ref1 = room.dueling_players[pos].lp) && ref1 <= 100)) {
ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK); ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK);
} }
...@@ -2387,15 +2393,12 @@ ...@@ -2387,15 +2393,12 @@
} }
if (room.started && room.turn > 0 && !room.dueling_players[0].is_first) { if (room.started && room.turn > 0 && !room.dueling_players[0].is_first) {
if (room.hostinfo.mode === 2) { if (room.hostinfo.mode === 2) {
if (pid === 0) { pid = {
pid = 2; 0: 2,
} else if (pid = 1) { 1: 3,
pid = 3; 2: 0,
} else if (pid = 2) { 3: 1
pid = 0; }[pid];
} else if (pid = 3) {
pid = 1;
}
} else { } else {
pid = 1 - pid; pid = 1 - pid;
} }
......
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