Commit 96fe8f96 authored by nanahira's avatar nanahira

js

parent fd9183a6
......@@ -3492,6 +3492,7 @@
pos = pos * 2;
}
val = buffer.readInt32LE(2);
if (room.dueling_players[pos]) {
room.dueling_players[pos].lp -= val;
if (room.dueling_players[pos].lp < 0) {
room.dueling_players[pos].lp = 0;
......@@ -3500,6 +3501,7 @@
ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK);
}
}
}
if (msg_name === 'RECOVER' && client.pos === 0) {
pos = buffer.readUInt8(1);
if (!client.is_first) {
......@@ -3509,8 +3511,10 @@
pos = pos * 2;
}
val = buffer.readInt32LE(2);
if (room.dueling_players[pos]) {
room.dueling_players[pos].lp += val;
}
}
if (msg_name === 'LPUPDATE' && client.pos === 0) {
pos = buffer.readUInt8(1);
if (!client.is_first) {
......@@ -3520,8 +3524,10 @@
pos = pos * 2;
}
val = buffer.readInt32LE(2);
if (room.dueling_players[pos]) {
room.dueling_players[pos].lp = val;
}
}
if (msg_name === 'PAY_LPCOST' && client.pos === 0) {
pos = buffer.readUInt8(1);
if (!client.is_first) {
......@@ -3531,6 +3537,7 @@
pos = pos * 2;
}
val = buffer.readInt32LE(2);
if (room.dueling_players[pos]) {
room.dueling_players[pos].lp -= val;
if (room.dueling_players[pos].lp < 0) {
room.dueling_players[pos].lp = 0;
......@@ -3539,6 +3546,7 @@
ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK);
}
}
}
//track card count
//todo: track card count in tag mode
if (msg_name === 'MOVE' && room.hostinfo.mode !== 2) {
......
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