Commit e315c8f3 authored by nanahira's avatar nanahira

auto surrender for windbots

parent 6d727895
......@@ -2670,7 +2670,7 @@ ygopro.ctos_follow 'SURRENDER', true, (buffer, info, client, server)->
if room.hostinfo.mode == 2
if !settings.modules.tag_duel_surrender
return true
else if !client.surrend_confirm and !CLIENT_get_partner(client).closed
else if !client.surrend_confirm and !CLIENT_get_partner(client).closed and !CLIENT_get_partner(client).is_local
sur_player = CLIENT_get_partner(client)
ygopro.stoc_send_chat(sur_player, "${surrender_confirm_tag}", ygopro.constants.COLORS.BABYBLUE)
ygopro.stoc_send_chat(client, "${surrender_confirm_sent}", ygopro.constants.COLORS.BABYBLUE)
......@@ -2710,14 +2710,14 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when '/投降', '/surrender'
if !room.started or (room.hostinfo.mode==2 and !settings.modules.tag_duel_surrender)
return cancel
if room.random_type and room.turn < 3
if room.random_type and room.turn < 3 and !client.flee_free
ygopro.stoc_send_chat(client, "${surrender_denied}", ygopro.constants.COLORS.BABYBLUE)
return cancel
if client.surrend_confirm
ygopro.ctos_send(client.server, 'SURRENDER')
else
sur_player = CLIENT_get_partner(client)
if sur_player.closed
if sur_player.closed or sur_player.is_local
sur_player = client
if room.hostinfo.mode==2 and sur_player != client
ygopro.stoc_send_chat(sur_player, "${surrender_confirm_tag}", ygopro.constants.COLORS.BABYBLUE)
......
......@@ -3365,7 +3365,7 @@
if (room.hostinfo.mode === 2) {
if (!settings.modules.tag_duel_surrender) {
return true;
} else if (!client.surrend_confirm && !CLIENT_get_partner(client).closed) {
} else if (!client.surrend_confirm && !CLIENT_get_partner(client).closed && !CLIENT_get_partner(client).is_local) {
sur_player = CLIENT_get_partner(client);
ygopro.stoc_send_chat(sur_player, "${surrender_confirm_tag}", ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send_chat(client, "${surrender_confirm_sent}", ygopro.constants.COLORS.BABYBLUE);
......@@ -3420,7 +3420,7 @@
if (!room.started || (room.hostinfo.mode === 2 && !settings.modules.tag_duel_surrender)) {
return cancel;
}
if (room.random_type && room.turn < 3) {
if (room.random_type && room.turn < 3 && !client.flee_free) {
ygopro.stoc_send_chat(client, "${surrender_denied}", ygopro.constants.COLORS.BABYBLUE);
return cancel;
}
......@@ -3428,7 +3428,7 @@
ygopro.ctos_send(client.server, 'SURRENDER');
} else {
sur_player = CLIENT_get_partner(client);
if (sur_player.closed) {
if (sur_player.closed || sur_player.is_local) {
sur_player = client;
}
if (room.hostinfo.mode === 2 && sur_player !== client) {
......
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