Commit b2f27e6e authored by nanahira's avatar nanahira

fix otp same lp handle

parent f91fac8b
Pipeline #21406 passed with stages
in 9 minutes and 28 seconds
...@@ -1824,7 +1824,11 @@ class Room ...@@ -1824,7 +1824,11 @@ class Room
if @duel_stage == ygopro.constants.DUEL_STAGE.DUELING if @duel_stage == ygopro.constants.DUEL_STAGE.DUELING
switch settings.modules.http.quick_death_rule switch settings.modules.http.quick_death_rule
when 4 # instant death when 4 # instant death
win_pos = if @dueling_players[0].lp > @dueling_players[oppo_pos].lp then 0 else oppo_pos win_pos = 0
if @dueling_players[0].lp == @dueling_players[oppo_pos].lp
win_pos = if @dueling_players[oppo_pos].is_first then 0 else oppo_pos
else
win_pos = if @dueling_players[0].lp > @dueling_players[oppo_pos].lp then 0 else oppo_pos
ygopro.stoc_send_chat_to_room(this, "${death_finish_part1}" + @dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat_to_room(this, "${death_finish_part1}" + @dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
ygopro.ctos_send(@dueling_players[oppo_pos - win_pos].server, 'SURRENDER') ygopro.ctos_send(@dueling_players[oppo_pos - win_pos].server, 'SURRENDER')
when 3 when 3
...@@ -1856,7 +1860,7 @@ class Room ...@@ -1856,7 +1860,7 @@ class Room
when 1 when 1
@death = -1 @death = -1
ygopro.stoc_send_chat_to_room(this, "${death_start_quick}", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat_to_room(this, "${death_start_quick}", ygopro.constants.COLORS.BABYBLUE)
else when 0
@death = 5 @death = 5
ygopro.stoc_send_chat_to_room(this, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat_to_room(this, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE)
return true return true
......
...@@ -2422,7 +2422,12 @@ ...@@ -2422,7 +2422,12 @@
if (this.duel_stage === ygopro.constants.DUEL_STAGE.DUELING) { if (this.duel_stage === ygopro.constants.DUEL_STAGE.DUELING) {
switch (settings.modules.http.quick_death_rule) { switch (settings.modules.http.quick_death_rule) {
case 4: // instant death case 4: // instant death
win_pos = this.dueling_players[0].lp > this.dueling_players[oppo_pos].lp ? 0 : oppo_pos; win_pos = 0;
if (this.dueling_players[0].lp === this.dueling_players[oppo_pos].lp) {
win_pos = this.dueling_players[oppo_pos].is_first ? 0 : oppo_pos;
} else {
win_pos = this.dueling_players[0].lp > this.dueling_players[oppo_pos].lp ? 0 : oppo_pos;
}
ygopro.stoc_send_chat_to_room(this, "${death_finish_part1}" + this.dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE); ygopro.stoc_send_chat_to_room(this, "${death_finish_part1}" + this.dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
ygopro.ctos_send(this.dueling_players[oppo_pos - win_pos].server, 'SURRENDER'); ygopro.ctos_send(this.dueling_players[oppo_pos - win_pos].server, 'SURRENDER');
break; break;
...@@ -2468,7 +2473,7 @@ ...@@ -2468,7 +2473,7 @@
this.death = -1; this.death = -1;
ygopro.stoc_send_chat_to_room(this, "${death_start_quick}", ygopro.constants.COLORS.BABYBLUE); ygopro.stoc_send_chat_to_room(this, "${death_start_quick}", ygopro.constants.COLORS.BABYBLUE);
break; break;
default: case 0:
this.death = 5; this.death = 5;
ygopro.stoc_send_chat_to_room(this, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE); ygopro.stoc_send_chat_to_room(this, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE);
} }
......
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