Commit 300a4d40 authored by mercury233's avatar mercury233

fix ai uppercase and surrender

parent 6eb1de84
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
"unwelcome_warn_part1": "如果您经常", "unwelcome_warn_part1": "如果您经常",
"unwelcome_warn_part2": ",您的对手可能会离你而去。", "unwelcome_warn_part2": ",您的对手可能会离你而去。",
"unwelcome_tip_part1": "因为您的对手有", "unwelcome_tip_part1": "因为您的对手有",
"unwelcome_tip_part2": "行为,现在您可以直接离开游戏,不视为强退。" "unwelcome_tip_part2": "行为,现在您可以直接离开游戏或投降,不视为强退。"
}, },
"ko-kr": { "ko-kr": {
"random_duel_enter_room_waiting": "땅콩: 게임을 진행하게 준비 또는 시작을 하십시오.", "random_duel_enter_room_waiting": "땅콩: 게임을 진행하게 준비 또는 시작을 하십시오.",
......
...@@ -234,9 +234,10 @@ ROOM_find_or_create_ai = (name)-> ...@@ -234,9 +234,10 @@ ROOM_find_or_create_ai = (name)->
if name == '' if name == ''
name = 'AI' name = 'AI'
namea = name.split('#') namea = name.split('#')
uname = name.toUpperCase()
if room = ROOM_find_by_name(name) if room = ROOM_find_by_name(name)
return room return room
else if name == 'AI' else if uname == 'AI'
windbot = _.sample settings.modules.windbots windbot = _.sample settings.modules.windbots
name = 'AI#' + Math.floor(Math.random() * 100000) name = 'AI#' + Math.floor(Math.random() * 100000)
else if namea.length>1 else if namea.length>1
...@@ -1425,7 +1426,7 @@ ygopro.ctos_follow 'SURRENDER', true, (buffer, info, client, server)-> ...@@ -1425,7 +1426,7 @@ ygopro.ctos_follow 'SURRENDER', true, (buffer, info, client, server)->
return unless room return unless room
if !room.started or room.hostinfo.mode==2 if !room.started or room.hostinfo.mode==2
return true return true
if room.random_type and room.turn < 3 if room.random_type and room.turn < 3 and not client.flee_free
ygopro.stoc_send_chat(client, "${surrender_denied}", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat(client, "${surrender_denied}", ygopro.constants.COLORS.BABYBLUE)
return true return true
return false return false
......
...@@ -314,14 +314,15 @@ ...@@ -314,14 +314,15 @@
}; };
ROOM_find_or_create_ai = function(name) { ROOM_find_or_create_ai = function(name) {
var ainame, namea, result, room, windbot; var ainame, namea, result, room, uname, windbot;
if (name === '') { if (name === '') {
name = 'AI'; name = 'AI';
} }
namea = name.split('#'); namea = name.split('#');
uname = name.toUpperCase();
if (room = ROOM_find_by_name(name)) { if (room = ROOM_find_by_name(name)) {
return room; return room;
} else if (name === 'AI') { } else if (uname === 'AI') {
windbot = _.sample(settings.modules.windbots); windbot = _.sample(settings.modules.windbots);
name = 'AI#' + Math.floor(Math.random() * 100000); name = 'AI#' + Math.floor(Math.random() * 100000);
} else if (namea.length > 1) { } else if (namea.length > 1) {
...@@ -1750,7 +1751,7 @@ ...@@ -1750,7 +1751,7 @@
if (!room.started || room.hostinfo.mode === 2) { if (!room.started || room.hostinfo.mode === 2) {
return true; return true;
} }
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); ygopro.stoc_send_chat(client, "${surrender_denied}", ygopro.constants.COLORS.BABYBLUE);
return true; return true;
} }
......
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