From 20875b1edea28c6815e1e9c95c8de26612d3b79f Mon Sep 17 00:00:00 2001 From: Umbrella167 <1670187757@qq.com> Date: Fri, 17 May 2024 03:44:47 +0800 Subject: [PATCH] over rice --- Core/HuRocos-2024/play/Nor_Dribbling.lua | 2 +- Core/HuRocos-2024/play/Nor_Shoot.lua | 2 +- Core/HuRocos-2024/play/STOP.lua | 2 +- Core/HuRocos-2024/play/our_BallPlacement.lua | 64 ++++--- Core/HuRocos-2024/play/our_CenterKick.lua | 161 +++++++----------- Core/HuRocos-2024/play/our_CornerKick.lua | 107 ++++++------ Core/HuRocos-2024/play/our_FrontKick.lua | 81 +++++---- Core/HuRocos-2024/play/our_KickOff.lua | 81 ++++----- Core/HuRocos-2024/play/our_Penalty.lua | 15 +- Core/HuRocos-2024/play/theirBallPlacement.lua | 8 +- Core/HuRocos-2024/play/their_KickOff.lua | 8 +- Core/HuRocos-2024/play/their_Penalty.lua | 15 +- ZBin/lua_scripts/worldmodel/cond.lua | 4 +- ZBin/lua_scripts/worldmodel/task.lua | 3 +- 14 files changed, 262 insertions(+), 291 deletions(-) diff --git a/Core/HuRocos-2024/play/Nor_Dribbling.lua b/Core/HuRocos-2024/play/Nor_Dribbling.lua index 78ba024c..20b27f13 100644 --- a/Core/HuRocos-2024/play/Nor_Dribbling.lua +++ b/Core/HuRocos-2024/play/Nor_Dribbling.lua @@ -30,7 +30,7 @@ local dribblingDir = function(role) end end local dribblingCount = 0 -local dribblingVel = 3000 +local dribblingVel = 1900 local canShootAngle = 30 local showPassPos = param.shootPos return { diff --git a/Core/HuRocos-2024/play/Nor_Shoot.lua b/Core/HuRocos-2024/play/Nor_Shoot.lua index c0dcd811..90f4e78c 100644 --- a/Core/HuRocos-2024/play/Nor_Shoot.lua +++ b/Core/HuRocos-2024/play/Nor_Shoot.lua @@ -113,7 +113,7 @@ firstState = "Init", end end, - Assister = task.ShootdotV2(function() return resShootPos end, param.shootError,function() return (player.num("Assister") == 3 and param.Team == "TWO") and kick.chip() or kick.flat() end), + Assister = task.ShootdotV2(function() return resShootPos end, param.shootError, kick.flat ), match = "{A}" }, diff --git a/Core/HuRocos-2024/play/STOP.lua b/Core/HuRocos-2024/play/STOP.lua index 135881c8..4ea9a319 100644 --- a/Core/HuRocos-2024/play/STOP.lua +++ b/Core/HuRocos-2024/play/STOP.lua @@ -26,7 +26,7 @@ local defendpos = { CGeoPoint(-3300,-850), } -local a = 1800 +local a = 2500 local DSS_FLAG = bit:_or(flag.allow_dss, flag.dodge_ball) gPlayTable.CreatePlay { diff --git a/Core/HuRocos-2024/play/our_BallPlacement.lua b/Core/HuRocos-2024/play/our_BallPlacement.lua index ec964a03..288a46d4 100644 --- a/Core/HuRocos-2024/play/our_BallPlacement.lua +++ b/Core/HuRocos-2024/play/our_BallPlacement.lua @@ -50,7 +50,7 @@ local waitPosKicker = function() local startPos local endPos local KickerShootPos = Utils.PosGetShootPoint(vision, player.posX("Kicker"),player.posY("Kicker")) - -- 角球 + if ball.placementPos():x() > 3000 then if ball.posY() > 0 then startPos = CGeoPoint(2600,-1250) @@ -59,8 +59,9 @@ local waitPosKicker = function() startPos = CGeoPoint(2600,1250) endPos = CGeoPoint(3000,850) end - -- 中场球 + elseif ball.placementPos():x() < 3000 and ball.placementPos():x() > 0 then + if ball.posY() < 0 then startPos = CGeoPoint(4050,1500) endPos = CGeoPoint(4400,800) @@ -68,10 +69,10 @@ local waitPosKicker = function() startPos = CGeoPoint(4050,-1500) endPos = CGeoPoint(4400,-800) end + else - -- 前场球 - startPos = CGeoPoint(ball.placementPos():x()+3000,1000) - endPos = CGeoPoint(ball.placementPos():x()+4000,-1000) + startPos = CGeoPoint(ball.placementPos():x()+1000,0) + endPos = CGeoPoint(ball.placementPos():x()+2500,-1700) end local attackPos = Utils.GetAttackPos(vision, player.num("Kicker"),KickerShootPos,startPos,endPos,130,500) if attackPos:x() == 0 and attackPos:y() == 0 then @@ -93,6 +94,8 @@ local waitPosSpecial = function() local startPos local endPos local SpecialShootPos = Utils.PosGetShootPoint(vision, player.posX("Special"),player.posY("Special")) + + -- 角球 if ball.placementPos():x() > 3000 then if ball.posY() < 0 then startPos = CGeoPoint(2400,-1100) @@ -101,6 +104,7 @@ local waitPosSpecial = function() startPos = CGeoPoint(2400,1100) endPos = CGeoPoint(2900,700) end + -- 中场球 elseif ball.placementPos():x() < 3000 and ball.placementPos():x() > 0 then if ball.posY() < 0 then startPos = CGeoPoint(3000,-750) @@ -110,8 +114,9 @@ local waitPosSpecial = function() endPos = CGeoPoint(3500,1300) end else - startPos = CGeoPoint(ball.placementPos():x()+1000,0) - endPos = CGeoPoint(ball.placementPos():x()+2500,-1700) + -- 前场球 + startPos = CGeoPoint(ball.placementPos():x()+3000,1000) + endPos = CGeoPoint(ball.placementPos():x()+4000,-1000) end local attackPos = Utils.GetAttackPos(vision, player.num("Special"),SpecialShootPos,startPos,endPos,130,500) if attackPos:x() == 0 and attackPos:y() == 0 then @@ -130,8 +135,20 @@ local count = 0 local DSS_FLAG = flag.allow_dss + flag.dodge_ball + flag.our_ball_placement gPlayTable.CreatePlay { -firstState = "start", +firstState = "Init1", +["Init1"] = { + switch = function() + return "start" + end, + Assister = task.goCmuRush(function() return player.pos(param.LeaderNum) end, player.toBallDir("Assister"), a, DSS_FLAG), + Kicker = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Special = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.stop(), + Defender = task.stop(), + Goalie = task.stop(), + match = "[A][KSC]{DG}" +}, ["start"] = { switch = function() debugEngine:gui_debug_arc(ball.pos(),500,0,360,1) @@ -140,10 +157,11 @@ firstState = "start", Assister = task.stop(), Kicker = task.stop(), Special = task.stop(), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" + match = "{AKSCDG}" + }, ["getball"] = { @@ -164,10 +182,12 @@ firstState = "start", Assister = task.getBall_BallPlacement("Assister"), Kicker = task.goCmuRush(avoidPlacementPos("Kicker",waitPosKicker()),function() return player.toBallDir("Kicker") end,_,DSS_FLAG), Special = task.goCmuRush(avoidPlacementPos("Special",waitPosSpecial()),function() return player.toBallDir("Special") end,_,DSS_FLAG), - Tier = task.goCmuRush(avoidPlacementPos("Tier"),function() return player.toBallDir("Tier") end,_,DSS_FLAG), + Center = task.goCmuRush(avoidPlacementPos("Center"),function() return player.toBallDir("Center") end,_,DSS_FLAG), Defender = task.goCmuRush(avoidPlacementPos("Defender"),function() return player.toBallDir("Defender") end,_,DSS_FLAG), - Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end,_,DSS_FLAG), - match = "(AKS){TDG}" + Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end), + match = "{AKSCDG}" + + }, ["getball1"] = { switch = function() @@ -179,7 +199,7 @@ firstState = "start", else count = 0 end - if count > 100 then + if count > 50 then count = 0 return "avoid" end @@ -187,10 +207,12 @@ firstState = "start", Assister = task.stop(), Kicker = task.goCmuRush(avoidPlacementPos("Kicker",waitPosKicker()),function() return player.toBallDir("Kicker") end,_,DSS_FLAG), Special = task.goCmuRush(avoidPlacementPos("Special",waitPosSpecial()),function() return player.toBallDir("Special") end,_,DSS_FLAG), - Tier = task.goCmuRush(avoidPlacementPos("Tier"),function() return player.toBallDir("Tier") end,_,DSS_FLAG), + Center = task.goCmuRush(avoidPlacementPos("Center"),function() return player.toBallDir("Center") end,_,DSS_FLAG), Defender = task.goCmuRush(avoidPlacementPos("Defender"),function() return player.toBallDir("Defender") end,_,DSS_FLAG), - Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end,_,DSS_FLAG), - match = "(AKS){TDG}" + Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end), + match = "{AKSCDG}" + + }, ["avoid"] = { switch = function() @@ -205,10 +227,12 @@ firstState = "start", Assister = task.goCmuRush(function() return ball.pos() + Utils.Polar2Vector(-220,AssisterDir())end,function() return player.toBallDir("Assister") end,_,DSS_FLAG), Kicker = task.goCmuRush(avoidPlacementPos("Kicker",waitPosKicker()),function() return player.toBallDir("Kicker") end,_,DSS_FLAG), Special = task.goCmuRush(avoidPlacementPos("Special",waitPosSpecial()),function() return player.toBallDir("Special") end,_,DSS_FLAG), - Tier = task.goCmuRush(avoidPlacementPos("Tier"),function() return player.toBallDir("Tier") end,_,DSS_FLAG), + Center = task.goCmuRush(avoidPlacementPos("Center"),function() return player.toBallDir("Center") end,_,DSS_FLAG), Defender = task.goCmuRush(avoidPlacementPos("Defender"),function() return player.toBallDir("Defender") end,_,DSS_FLAG), - Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end,_,DSS_FLAG), - match = "(AKS){TDG}" + Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end), + match = "{AKSCDG}" + + }, diff --git a/Core/HuRocos-2024/play/our_CenterKick.lua b/Core/HuRocos-2024/play/our_CenterKick.lua index ce7d2577..9bab1990 100644 --- a/Core/HuRocos-2024/play/our_CenterKick.lua +++ b/Core/HuRocos-2024/play/our_CenterKick.lua @@ -19,42 +19,79 @@ local toBallDir = function(role) return player.toBallDir(role) end end +local ikkflag = 1 +local kickFalg = function(startPos,endPos) + local istartPos + if type(startPos) == 'function' then + istartPos = startPos() + else + istartPos = startPos + end + + local iendPos + if type(endPos) == 'function' then + iendPos = endPos() + else + iendPos = endPos + end + if Utils.isValidPass(vision,istartPos,iendPos,param.enemy_buffer+30) then + ikkflag = kick.flat() + else + ikkflag = kick.chip() + end +end gPlayTable.CreatePlay { -firstState = "start", +firstState = "Init1", + + +["Init1"] = { + switch = function() + return "start" + end, + Assister = task.goCmuRush(function() return player.pos(param.LeaderNum) end, player.toBallDir("Assister"), a, DSS_FLAG), + Kicker = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Special = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.stop(), + Defender = task.stop(), + Goalie = task.stop(), + match = "[A][KSC]{DG}" +}, + ["start"] = { switch = function() + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) + debugEngine:gui_debug_arc(ball.pos(),500,0,360,1) return "ready" end, Assister = task.goCmuRush(function() return ball.pos() end), Special = task.stop(), Kicker = task.stop(), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AK)(S){TDG}" + match = "{AKSCDG}" + }, ["ready"] = { switch = function() + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) pass_pos = CGeoPoint (param.SpecialWaitPlacementPos():x(),param.SpecialWaitPlacementPos():y()) - -- 如果有挑球,无脑传bugpass - if Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,param.enemy_buffer) then - return "BugPass" - elseif Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,param.enemy_buffer) then - - end + return "BugPass" + end, Assister = task.stop(), Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,toBallDir("Special")), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" + match = "{AKSCDG}" + }, @@ -62,6 +99,7 @@ firstState = "start", ["BugPass"] = { switch = function() + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) pass_pos = CGeoPoint (param.KickerWaitPlacementPos():x(),param.KickerWaitPlacementPos():y()) @@ -77,107 +115,28 @@ firstState = "start", if(GlobalMessage.Tick().ball.rights == -1) then return "exit" end - debugEngine:gui_debug_msg(CGeoPoint(-1000,-1000),player.num("Special"),4) - if(player.kickBall("Assister"))then - if player.num("Special") == -1 or player.num("Special") == nil then - return "exit" - end - if(player.canTouch(pass_pos, shootPosKicker__, param.canTouchAngle) and - Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,param.enemy_buffer)) then - return "KickerTouch" - elseif Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,param.enemy_buffer) then - return "KickerGetball" - else - return "exit" - end + shootPosKicker__ = Utils.PosGetShootPoint(vision, pass_pos:x(),pass_pos:y()) + debugEngine:gui_debug_x(shootPosKicker__,3) + debugEngine:gui_debug_msg(CGeoPoint(0,0),GlobalMessage.Tick().ball.rights) + if(GlobalMessage.Tick().ball.rights == -1) then + return "exit" + end + if(player.kickBall("Assister") )then + return "exit" end end, - Assister = task.Shootdot("Assister",function() return pass_pos end,15,kick.flat), + Assister = task.Shootdot("Assister",function() return pass_pos end,param.shootError + 5,function() return ikkflag end), Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,function() return (player.pos("Special") - player.pos("Kicker") ):dir() end), Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,function() return (shootPosSpecial__ - player.pos("Special")):dir() end), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" -}, - - -["KickerTouch"] = { - switch = function() - - if(GlobalMessage.Tick().ball.rights == -1) then - return "exit" - end - debugEngine:gui_debug_msg(CGeoPoint(-1000,-1000),tostring(player.canTouch(ball.pos(), shootPosSpecial__, param.canTouchAngle))) - if (player.kickBall("Kicker")) then - return "SpecialTouch" - -- if(player.canTouch(ball.pos(), shootPosSpecial__, param.canTouchAngle) and - -- Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),shootPosSpecial__,param.enemy_buffer)) then - -- return "SpecialTouch" - - -- elseif Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),shootPosSpecial__,param.enemy_buffer) then - -- -- return "SpecialGetball" - -- else - -- return "exit" - -- end - end - debugEngine:gui_debug_x(shootPosKicker__,3) - end, - Assister = task.stop(), - Kicker = task.touchKick(function() return CGeoPoint(player.posX("Special"),player.posY("Special")) end, false, param.shootKp, kick.flat), - Special = task.goCmuRush(function() return CGeoPoint(player.posX("Special"),player.posY("Special")) end,function() return (shootPosSpecial__ - player.pos("Special")):dir() end,_,DSS_FLAG), + match = "{AKSCDG}" - Tier = task.stop(), - Defender = task.stop(), - Goalie = task.stop(), - match = "{ASKTDG}" }, -["KickerGetball"] = { - switch = function() - - if(GlobalMessage.Tick().ball.rights == -1 or player.toBallDist("Kicker") < 500) then - return "exit" - end - end, - Assister = task.stop(), - Special =task.getball(function() return pass_pos end,param.playerVel,param.getballMode), - Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), - Tier = task.stop(), - Defender = task.stop(), - Goalie = task.stop(), - match = "{ASKTDG}" -}, -["SpecialTouch"] = { - switch = function() - - if(GlobalMessage.Tick().ball.rights == -1) then - return "exit" - end - if (player.kickBall("Kicker")) then - if(player.canTouch(ball.pos(), shootPosSpecial__, param.canTouchAngle) and - Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),shootPosSpecial__,param.enemy_buffer)) then - return "SpecialTouch" - elseif Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),shootPosSpecial__,param.enemy_buffer) then - -- return "SpecialGetball" - else - return "exit" - end - end - debugEngine:gui_debug_x(shootPosKicker__,3) - end, - Assister = task.stop(), - Kicker = task.stop(), - Special = task.touchKick(function() return shootPosSpecial__ end, false, 999, kick.flat), - - Tier = task.stop(), - Defender = task.stop(), - Goalie = task.stop(), - match = "{ASKTDG}" - }, - name = "our_CenterKick", applicable = { exp = "a", diff --git a/Core/HuRocos-2024/play/our_CornerKick.lua b/Core/HuRocos-2024/play/our_CornerKick.lua index f496b1e9..69501810 100644 --- a/Core/HuRocos-2024/play/our_CornerKick.lua +++ b/Core/HuRocos-2024/play/our_CornerKick.lua @@ -19,48 +19,83 @@ local toBallDir = function(role) return player.toBallDir(role) end end + +local ikkflag = 1 +local kickFalg = function(startPos,endPos) + local istartPos + if type(startPos) == 'function' then + istartPos = startPos() + else + istartPos = startPos + end + + local iendPos + if type(endPos) == 'function' then + iendPos = endPos() + else + iendPos = endPos + end + if Utils.isValidPass(vision,istartPos,iendPos,param.enemy_buffer+30) then + ikkflag = kick.flat() + else + ikkflag = kick.chip() + end +end gPlayTable.CreatePlay { -firstState = "start", +firstState = "Init1", + +["Init1"] = { + switch = function() + return "start" + end, + Assister = task.goCmuRush(function() return player.pos(param.LeaderNum) end, player.toBallDir("Assister"), a, DSS_FLAG), + Kicker = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Special = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.stop(), + Defender = task.stop(), + Goalie = task.stop(), + match = "[A][KSC]{DG}" +}, + ["start"] = { switch = function() - debugEngine:gui_debug_arc(ball.pos(),500,0,360,1) + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) + debugEngine:gui_debug_arc(ball.pos(),500,0,360,1) return "ready" end, Assister = task.goCmuRush(function() return ball.pos() end), Kicker = task.stop(), Special = task.stop(), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" + match = "{AKSCDG}" }, ["ready"] = { switch = function() + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) pass_pos = PassPos() debugEngine:gui_debug_x(pass_pos) debugEngine:gui_debug_msg(pass_pos,"PassPos") -- 如果有挑球,无脑传bugpass - if Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,130) then return "BugPass" - else - - end - end, Assister = task.stop(), Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,toBallDir("Special")), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" + match = "{AKSCDG}" + }, ["BugPass"] = { switch = function() + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) shootPosKicker__ = Utils.PosGetShootPoint(vision, pass_pos:x(),pass_pos:y()) debugEngine:gui_debug_x(shootPosKicker__,3) @@ -69,61 +104,19 @@ firstState = "start", return "exit" end if(player.kickBall("Assister") )then - if(player.canTouch(pass_pos, shootPosKicker__, param.canTouchAngle) and - Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,param.enemy_buffer)) then - return "exit" - elseif Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),pass_pos,param.enemy_buffer) then - return "KickerGetball" - else - return "exit" - end + return "exit" end end, - Assister = task.Shootdot("Assister",function() return pass_pos end,param.shootError + 5,kick.chip), + Assister = task.Shootdot("Assister",function() return pass_pos end,param.shootError + 5,function() return ikkflag end), Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,toBallDir("Special")), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "{AKSTDG}" -}, - -["KickerTouch"] = { - switch = function() + match = "{AKSCDG}" - if(GlobalMessage.Tick().ball.rights == -1) then - return "exit" - end - if (player.kickBall("Kicker")) then - return "exit" - end - shootPosKicker__ = Utils.PosGetShootPoint(vision, pass_pos:x(),pass_pos:y()) - debugEngine:gui_debug_x(shootPosKicker__,3) - end, - Assister = task.stop(), - Kicker = task.touchKick(function() return shootPosKicker__ end, false, 9999, kick.flat), - Special = task.stop(), - Tier = task.stop(), - Defender = task.stop(), - Goalie = task.stop(), - match = "{AKSTDG}" }, -["KickerGetball"] = { - switch = function() - - if(GlobalMessage.Tick().ball.rights == -1 or player.toBallDist("Kicker") < 500) then - return "exit" - end - end, - Assister = task.stop(), - Kicker = task.getball(function() return pass_pos end,param.playerVel,param.getballMode), - Special = task.stop(), - Tier = task.stop(), - Defender = task.stop(), - Goalie = task.stop(), - match = "{AKSTDG}" -}, name = "our_CornerKick", applicable = { exp = "a", diff --git a/Core/HuRocos-2024/play/our_FrontKick.lua b/Core/HuRocos-2024/play/our_FrontKick.lua index 21a00ace..8009463e 100644 --- a/Core/HuRocos-2024/play/our_FrontKick.lua +++ b/Core/HuRocos-2024/play/our_FrontKick.lua @@ -6,74 +6,95 @@ local toBallDir = function(role) return player.toBallDir(role) end end +local ikkflag = 1 +local kickFalg = function(startPos,endPos) + local istartPos + if type(startPos) == 'function' then + istartPos = startPos() + else + istartPos = startPos + end + + local iendPos + if type(endPos) == 'function' then + iendPos = endPos() + else + iendPos = endPos + end + if Utils.isValidPass(vision,istartPos,iendPos,param.enemy_buffer+30) then + ikkflag = kick.flat() + else + ikkflag = kick.chip() + end +end gPlayTable.CreatePlay { -firstState = "start", +firstState = "Init1", + +["Init1"] = { + switch = function() + + return "start" + end, + Assister = task.goCmuRush(function() return player.pos(param.LeaderNum) end, player.toBallDir("Assister"), a, DSS_FLAG), + Kicker = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Special = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.stop(), + Defender = task.stop(), + Goalie = task.stop(), + match = "[A][KSC]{DG}" +}, ["start"] = { switch = function() + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) debugEngine:gui_debug_arc(ball.pos(),500,0,360,1) return "ready" end, Assister = task.goCmuRush(function() return ball.pos() end), Kicker = task.stop(), Special = task.stop(), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" + match = "{AKSCDG}" + }, ["ready"] = { switch = function() - - if Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),CGeoPoint(player.posX("Kicker"),player.posY("Kicker")),param.enemy_buffer) then + kickFalg(ball.pos(),function() return param.KickerWaitPlacementPos() end) return "passToKicker" - elseif Utils.isValidPass(vision,CGeoPoint(ball.posX(),ball.posY()),CGeoPoint(player.posX("Special"),player.posY("Special")),param.enemy_buffer) then - return "passToSpecial" - end + end, Assister = task.stop(), Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,toBallDir("Special")), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" -}, + match = "{AKSCDG}" +}, ["passToKicker"] = { switch = function() - - if(GlobalMessage.Tick().ball.rights == -1 or player.toBallDist("Kicker") > 500) then + kickFalg(ball.pos(), param.KickerWaitPlacementPos()) + if(GlobalMessage.Tick().ball.rights == -1 or player.kickBall("Assister")) then return "exit" end end, - Assister = task.Shootdot("Assister",function() return player.pos("Kicker") end,kick.flat), + Assister = task.Shootdot("Assister",function() return param.KickerWaitPlacementPos() end,param.shootError + 5,function() return ikkflag end), Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,toBallDir("Special")), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" -}, -["passToSpecial"] = { - switch = function() + match = "{AKSCDG}" - if(GlobalMessage.Tick().ball.rights == -1 or player.toBallDist("Special") > 500) then - return "exit" - end - end, - Assister = task.Shootdot("Assister",function() return player.pos("Special") end,kick.flat), - Kicker = task.goCmuRush(function() return param.KickerWaitPlacementPos() end,toBallDir("Kicker")), - Special = task.goCmuRush(function() return param.SpecialWaitPlacementPos() end,toBallDir("Special")), - Tier = task.stop(), - Defender = task.stop(), - Goalie = task.stop(), - match = "(AKS){TDG}" }, + name = "our_FrontKick", applicable = { exp = "a", diff --git a/Core/HuRocos-2024/play/our_KickOff.lua b/Core/HuRocos-2024/play/our_KickOff.lua index 18623464..ddcf6d3b 100644 --- a/Core/HuRocos-2024/play/our_KickOff.lua +++ b/Core/HuRocos-2024/play/our_KickOff.lua @@ -174,14 +174,28 @@ local KickerShootPos = function() end local DSS_FLAG = bit:_or(flag.allow_dss, flag.dodge_ball) gPlayTable.CreatePlay{ -firstState = "ready", +firstState = "Init1", + +["Init1"] = { + switch = function() + return "ready" + end, + Assister = task.goCmuRush(function() return player.pos(param.LeaderNum) end, player.toBallDir("Assister"), a, DSS_FLAG), + Kicker = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Special = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.goCmuRush(p3, 0, a, DSS_FLAG, r, v, s, force_manual), + Defender = task.goCmuRush(p4, 0, a, DSS_FLAG, r, v, s, force_manual), + Goalie = task.goCmuRush(p5, 0, a, DSS_FLAG, r, v, s, force_manual), + match = "[A][KSC]{DG}" +}, + ["ready"] = { switch = function () UpdataTickMessage() if cond.isNormalStart() then - return "OtherRunPos" + return "wti" elseif cond.isGameOn() then - return "OtherRunPos" + return "wti" end end, Assister = task.goCmuRush(p1, Dir_ball("Assister"),_,DSS_FLAG), @@ -190,76 +204,41 @@ firstState = "ready", Center = task.goCmuRush(p7, Dir_ball("Center"),_,DSS_FLAG), Defender = task.goCmuRush(p6, Dir_ball("Defender"),_,DSS_FLAG), Goalie = task.goalie("Goalie"), - match = "[ASKC]{DG}" + match = "[SKC]{ADG}" }, -["OtherRunPos"] = { +["wti"] = { switch = function () - if GlobalMessage.Tick().ball.rights == -1 then - return "exit" - end - if(player.kickBall("Assister")) then - return "SpecialTouch" + if bufcnt(true,20) then + return "OtherRunPos" end end, - Assister = task.Shootdot("Assister",runPos_Special(-400), 5, kick.flat), + Assister = task.stop(), Special = task.goCmuRush(runPos_Special(-400), Dir_ball("Special"), a, f, r, v), Kicker = task.goCmuRush(runPos_Kicker(-400), Dir_ball("Kicker"), a, f, r, v), Goalie = task.goalie("Goalie"), - match = "[ASKC]{DG}" + match = "[SKC]{ADG}" }, -["SpecialTouch"] = { + +["OtherRunPos"] = { switch = function () if GlobalMessage.Tick().ball.rights == -1 then return "exit" end - if(player.kickBall("Special")) then - return "KickerTouch" - end - end, - Assister = task.goCmuRush(runPos_Assister(-400), Dir_ball("Assister"), a, DSS_FLAG, r, v), - Special = task.touchKick(runPos_Kicker(0), false, param.shootKp, kick.flat), - Kicker = task.goCmuRush(runPos_Kicker(-400), Dir_ball("Kicker"), a, f, r, v), - Goalie = task.goalie("Goalie"), - match = "{ASKTDG}" -}, - - -["KickerTouch"] = { - switch = function () - if GlobalMessage.Tick().ball.rights == -1 then + if(player.kickBall("Assister")) then return "exit" end - if(player.toBallDist("Kicker") < 300) then + if(player.kickBall("Assister")) then return "exit" end end, - Assister = task.goCmuRush(runPos_Assister(-400), Dir_ball("Assister"), a, DSS_FLAG, r, v), + Assister = task.Shootdot("Assister",runPos_Special(-400), param.shootError, kick.flat), Special = task.goCmuRush(runPos_Special(-400), Dir_ball("Special"), a, f, r, v), - Kicker = task.getball(_, param.playerVel, param.getballMode, KickerShootPos()), - -- Tier = task.defender_defence("Tier"), - -- Defender = task.defender_defence("Defender"), + Kicker = task.goCmuRush(runPos_Kicker(-400), Dir_ball("Kicker"), a, f, r, v), Goalie = task.goalie("Goalie"), - match = "{ASKTDG}" -}, + match = "[SKC]{ADG}" - - -["shoot"] = { - switch = function () - - if GlobalMessage.Tick().ball.rights == -1 then - return "exit" - end - end, - Assister = task.goCmuRush(runPos_Assister(-400), Dir_ball("Assister"), a, DSS_FLAG, r, v), - Special = task.goCmuRush(runPos_Special(-400), Dir_ball("Special"), a, f, r, v), - Kicker = task.getball("Kicker", param.playerVel, param.getballMode, KickerShootPos()), - -- Tier = task.defender_defence("Tier"), - -- Defender = task.defender_defence("Defender"), - Goalie = task.goalie("Goalie"), - match = "{ASKTDG}" }, diff --git a/Core/HuRocos-2024/play/our_Penalty.lua b/Core/HuRocos-2024/play/our_Penalty.lua index 091e8846..3e70d47a 100644 --- a/Core/HuRocos-2024/play/our_Penalty.lua +++ b/Core/HuRocos-2024/play/our_Penalty.lua @@ -44,11 +44,11 @@ local Power = function(role,shoot_flag,ishootThreshold) end if ball.posX() > ishootThreshold then if (ishoot_falg == kick.chip()) then - ipower = 7000 + ipower = 3000 end else if (ishoot_falg == kick.chip()) then - ipower = 7000 + ipower = 3000 end end return ipower @@ -71,10 +71,10 @@ firstState = "Init1", Assister = task.goCmuRush(function() return player.pos(param.LeaderNum) end, player.toBallDir("Assister"), a, DSS_FLAG), Kicker = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), Special = task.goCmuRush(function() return player.pos(param.LeaderNum) end, 0, a, DSS_FLAG, r, v, s, force_manual), - Tier = task.goCmuRush(p3, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.goCmuRush(p3, 0, a, DSS_FLAG, r, v, s, force_manual), Defender = task.goCmuRush(p4, 0, a, DSS_FLAG, r, v, s, force_manual), Goalie = task.goCmuRush(p5, 0, a, DSS_FLAG, r, v, s, force_manual), - match = "[A][KS]{TDG}" + match = "[A][KSC]{DG}" }, @@ -82,18 +82,19 @@ firstState = "Init1", switch = function() shoot_flag = shootFlag("Assister") param.shootPos = Utils.GetShootPoint(vision,player.num("Assister")) - -- debugEngine:gui_debug_msg(CGeoPoint(0,0),ball.posX()) if cond.isNormalStart() then return "getball" end + print(vision:gameState():gameOff()) end, Assister = function() return task.goCmuRush(function() return ball.pos() + Utils.Polar2Vector(-180,0) end, player.toBallDir("Assister"), a, DSS_FLAG) end, Kicker = task.goCmuRush(p1, 0, a, DSS_FLAG, r, v, s, force_manual), Special = task.goCmuRush(p2, 0, a, DSS_FLAG, r, v, s, force_manual), - Tier = task.goCmuRush(p3, 0, a, DSS_FLAG, r, v, s, force_manual), + Center = task.goCmuRush(p3, 0, a, DSS_FLAG, r, v, s, force_manual), Defender = task.goCmuRush(p4, 0, a, DSS_FLAG, r, v, s, force_manual), Goalie = task.goCmuRush(p5, 0, a, DSS_FLAG, r, v, s, force_manual), - match = "{AKSTDG}" + match = "{AKSCDG}" + }, ["getball"] = { diff --git a/Core/HuRocos-2024/play/theirBallPlacement.lua b/Core/HuRocos-2024/play/theirBallPlacement.lua index c7a5a780..10c217f9 100644 --- a/Core/HuRocos-2024/play/theirBallPlacement.lua +++ b/Core/HuRocos-2024/play/theirBallPlacement.lua @@ -95,10 +95,10 @@ firstState = "start", Assister = task.stop(), Kicker = task.stop(), Special = task.stop(), - Tier = task.stop(), + Center = task.stop(), Defender = task.stop(), Goalie = task.stop(), - match = "(AKS){TDG}" + match = "(AKSC){DG}" }, ["getball"] = { @@ -108,10 +108,10 @@ firstState = "start", Assister = task.goCmuRush(avoidPlacementPos("Assister"),function() return player.toBallDir("Assister") end,_,DSS_FLAG), Kicker = task.goCmuRush(avoidPlacementPos("Kicker"),function() return player.toBallDir("Kicker") end,_,DSS_FLAG), Special = task.goCmuRush(avoidPlacementPos("Special"),function() return player.toBallDir("Special") end,_,DSS_FLAG), - Tier = task.goCmuRush(avoidPlacementPos("Tier"),function() return player.toBallDir("Tier") end,_,DSS_FLAG), + Center = task.goCmuRush(avoidPlacementPos("Center"),function() return player.toBallDir("Center") end,_,DSS_FLAG), Defender = task.goCmuRush(avoidPlacementPos("Defender"),function() return player.toBallDir("Defender") end,_,DSS_FLAG), Goalie = task.goCmuRush(avoidPlacementPos("Goalie"),function() return player.toBallDir("Goalie") end,_,DSS_FLAG), - match = "(AKS){TDG}" + match = "(AKSC){DG}" }, name = "theirBallPlacement", diff --git a/Core/HuRocos-2024/play/their_KickOff.lua b/Core/HuRocos-2024/play/their_KickOff.lua index 9ee6b64f..a26c37e1 100644 --- a/Core/HuRocos-2024/play/their_KickOff.lua +++ b/Core/HuRocos-2024/play/their_KickOff.lua @@ -25,10 +25,10 @@ gPlayTable.CreatePlay{ Assister = task.goCmuRush(CGeoPoint(-200,1000), Dir_ball("Assister")), Special = task.goCmuRush(p3, Dir_ball("Special")), Kicker = task.goCmuRush(p2, Dir_ball("Kicker")), - Tier = task.goCmuRush(p1, Dir_ball("Tier")), + Center = task.goCmuRush(p1, Dir_ball("Center")), Defender = task.goCmuRush(p6, Dir_ball("Defender")), Goalie = task.goalie("Goalie"), - match = "[ASK]{TDG}" + match = "[ASKC]{DG}" }, ["judge"] = { switch = function () @@ -39,10 +39,10 @@ gPlayTable.CreatePlay{ Assister = task.goCmuRush(CGeoPoint(-200,1000), Dir_ball("Assister")), Special = task.goCmuRush(p3, Dir_ball("Special")), Kicker = task.goCmuRush(p2, Dir_ball("Kicker")), - Tier = task.goCmuRush(p1, Dir_ball("Tier")), + Center = task.goCmuRush(p1, Dir_ball("Center")), Defender = task.goCmuRush(p6, Dir_ball("Defender")), Goalie = task.goalie("Goalie"), - match = "[ASK]{TDG}" + match = "[ASKC]{DG}" }, name = "their_KickOff", diff --git a/Core/HuRocos-2024/play/their_Penalty.lua b/Core/HuRocos-2024/play/their_Penalty.lua index 29c237dd..cf5163e5 100644 --- a/Core/HuRocos-2024/play/their_Penalty.lua +++ b/Core/HuRocos-2024/play/their_Penalty.lua @@ -55,9 +55,9 @@ firstState = "Init", Kicker = function() return task.goCmuRush(stopPos("Kicker"), 0, a, DSS_FLAG, r, v, s, force_manual) end, Special = function() return task.goCmuRush(stopPos("Special"), 0, a, DSS_FLAG, r, v, s, force_manual) end, Defender = function() return task.goCmuRush(stopPos("Defender"), 0, a, DSS_FLAG, r, v, s, force_manual) end, - Tier = function() return task.goCmuRush(stopPos("Tier"), 0, a, DSS_FLAG, r, v, s, force_manual) end, + Center = function() return task.goCmuRush(stopPos("Tier"), 0, a, DSS_FLAG, r, v, s, force_manual) end, Goalie = task.goCmuRush(param.ourGoalPos, player.toBallDir("Goalie"), a, DSS_FLAG), - match = "[AKS]{TDG}" + match = "[AKSC]{DG}" }, ["Defend"] = { @@ -93,16 +93,7 @@ firstState = "Init", match = "{G}" }, --- ["CatchBall"] = { --- switch = function() --- -- debugEngine:gui_debug_msg(CGeoPoint(0,0),ball.posX()) --- -- if ball.pos():dist(enemy.pos(enemy.closestBall())) > param.playerRadius * 1.5 then --- -- return "Defend" --- -- end --- end, --- Goalie = function() return task.goalie_catchBall("Goalie") end, --- match = "{G}" --- }, + name = "their_Penalty", applicable ={ exp = "a", diff --git a/ZBin/lua_scripts/worldmodel/cond.lua b/ZBin/lua_scripts/worldmodel/cond.lua index 93d979a9..9389b7ca 100644 --- a/ZBin/lua_scripts/worldmodel/cond.lua +++ b/ZBin/lua_scripts/worldmodel/cond.lua @@ -4,7 +4,9 @@ module(..., package.seeall) --~ ----------------------------------------------- --~ referee box condition --~ ----------------------------------------------- - +function gameStop () + return vision:getCurrentRefereeMsg() == "GameStop" +end function ourBallPlace() return vision:getCurrentRefereeMsg() == "OurBallPlacement" end diff --git a/ZBin/lua_scripts/worldmodel/task.lua b/ZBin/lua_scripts/worldmodel/task.lua index 4ac79bf1..8d1de986 100644 --- a/ZBin/lua_scripts/worldmodel/task.lua +++ b/ZBin/lua_scripts/worldmodel/task.lua @@ -333,7 +333,8 @@ function power(p, num,shootFlag) ---仿真的力度 if not param.isReality then local SimulationRate = 15 - res = res * SimulationRate + -- res = res * SimulationRate + res = 3500 if iflag == kick.chip() then res = 3500 end