Commit aae57da1 authored by nanahira's avatar nanahira

Merge branch 'master' into tcg_random

parents 418ff149 85d8b76d
...@@ -1254,7 +1254,7 @@ class Room ...@@ -1254,7 +1254,7 @@ class Room
if (param = rule.match /(^|,|,)(DUELRULE|MR)(\d+)(,|,|$)/) if (param = rule.match /(^|,|,)(DUELRULE|MR)(\d+)(,|,|$)/)
duel_rule = parseInt(param[3]) duel_rule = parseInt(param[3])
if duel_rule and duel_rule > 0 and duel_rule <= 4 if duel_rule and duel_rule > 0 and duel_rule <= 5
@hostinfo.duel_rule = duel_rule @hostinfo.duel_rule = duel_rule
if (rule.match /(^|,|,)(NOWATCH|NW)(,|,|$)/) if (rule.match /(^|,|,)(NOWATCH|NW)(,|,|$)/)
...@@ -1558,6 +1558,8 @@ class Room ...@@ -1558,6 +1558,8 @@ class Room
else else
for player in @players when player.pos != 7 for player in @players when player.pos != 7
@scores[player.name_vpass] = -5 @scores[player.name_vpass] = -5
if @players.length == 2
@scores[client.name_vpass] = -9
@arena_score_handled = true @arena_score_handled = true
index = _.indexOf(@players, client) index = _.indexOf(@players, client)
@players.splice(index, 1) unless index == -1 @players.splice(index, 1) unless index == -1
...@@ -2601,8 +2603,6 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)-> ...@@ -2601,8 +2603,6 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
if ygopro.constants.MSG[msg] == 'START' if ygopro.constants.MSG[msg] == 'START'
playertype = buffer.readUInt8(1) playertype = buffer.readUInt8(1)
client.is_first = !(playertype & 0xf) client.is_first = !(playertype & 0xf)
if client.is_first and (room.hostinfo.mode != 2 or client.pos == 0 or client.pos == 2)
room.first_list[room.duel_count - 1] = client.name_vpass
client.lp = room.hostinfo.start_lp client.lp = room.hostinfo.start_lp
client.card_count = 0 if room.hostinfo.mode != 2 client.card_count = 0 if room.hostinfo.mode != 2
room.duel_stage = ygopro.constants.DUEL_STAGE.DUELING room.duel_stage = ygopro.constants.DUEL_STAGE.DUELING
...@@ -2614,6 +2614,8 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)-> ...@@ -2614,6 +2614,8 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
ygopro.stoc_send_chat_to_room(room, "${death_start_final}", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat_to_room(room, "${death_start_final}", ygopro.constants.COLORS.BABYBLUE)
else else
ygopro.stoc_send_chat_to_room(room, "${death_start_extra}", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat_to_room(room, "${death_start_extra}", ygopro.constants.COLORS.BABYBLUE)
if client.is_first and (room.hostinfo.mode != 2 or client.pos == 0 or client.pos == 2)
room.first_list.push(client.name_vpass)
if settings.modules.retry_handle.enabled if settings.modules.retry_handle.enabled
client.retry_count = 0 client.retry_count = 0
client.last_game_msg = null client.last_game_msg = null
......
...@@ -1613,7 +1613,7 @@ ...@@ -1613,7 +1613,7 @@
} }
if ((param = rule.match(/(^|,|,)(DUELRULE|MR)(\d+)(,|,|$)/))) { if ((param = rule.match(/(^|,|,)(DUELRULE|MR)(\d+)(,|,|$)/))) {
duel_rule = parseInt(param[3]); duel_rule = parseInt(param[3]);
if (duel_rule && duel_rule > 0 && duel_rule <= 4) { if (duel_rule && duel_rule > 0 && duel_rule <= 5) {
this.hostinfo.duel_rule = duel_rule; this.hostinfo.duel_rule = duel_rule;
} }
} }
...@@ -2042,6 +2042,9 @@ ...@@ -2042,6 +2042,9 @@
this.scores[player.name_vpass] = -5; this.scores[player.name_vpass] = -5;
} }
} }
if (this.players.length === 2) {
this.scores[client.name_vpass] = -9;
}
} }
this.arena_score_handled = true; this.arena_score_handled = true;
} }
...@@ -3270,9 +3273,6 @@ ...@@ -3270,9 +3273,6 @@
if (ygopro.constants.MSG[msg] === 'START') { if (ygopro.constants.MSG[msg] === 'START') {
playertype = buffer.readUInt8(1); playertype = buffer.readUInt8(1);
client.is_first = !(playertype & 0xf); client.is_first = !(playertype & 0xf);
if (client.is_first && (room.hostinfo.mode !== 2 || client.pos === 0 || client.pos === 2)) {
room.first_list[room.duel_count - 1] = client.name_vpass;
}
client.lp = room.hostinfo.start_lp; client.lp = room.hostinfo.start_lp;
if (room.hostinfo.mode !== 2) { if (room.hostinfo.mode !== 2) {
client.card_count = 0; client.card_count = 0;
...@@ -3289,6 +3289,9 @@ ...@@ -3289,6 +3289,9 @@
} }
} }
} }
if (client.is_first && (room.hostinfo.mode !== 2 || client.pos === 0 || client.pos === 2)) {
room.first_list.push(client.name_vpass);
}
if (settings.modules.retry_handle.enabled) { if (settings.modules.retry_handle.enabled) {
client.retry_count = 0; client.retry_count = 0;
client.last_game_msg = null; client.last_game_msg = null;
......
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