From 0236f6395c7280433b2e04d3640f2bf4cb22a5e2 Mon Sep 17 00:00:00 2001 From: Umbrella167 <1670187757@qq.com> Date: Mon, 13 May 2024 22:05:35 +0800 Subject: [PATCH] stage --- Core/HuRocos-2024/play/NORMALPLAY.lua | 17 +++++++++-------- ZBin/lua_scripts/worldmodel/task.lua | 17 ++++++++++++----- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Core/HuRocos-2024/play/NORMALPLAY.lua b/Core/HuRocos-2024/play/NORMALPLAY.lua index 5c13a11..7bbf00a 100644 --- a/Core/HuRocos-2024/play/NORMALPLAY.lua +++ b/Core/HuRocos-2024/play/NORMALPLAY.lua @@ -161,7 +161,7 @@ local UpdataTickMessage = function (our_goalie_num,defend_num1,defend_num2) end param.shootPos = shoot_pos end - + param.goalieTargetPos = SpecialRUNPos debugEngine:gui_debug_x(shoot_pos,0) debugEngine:gui_debug_msg(shoot_pos,"resShootPos",0) debugEngine:gui_debug_msg(CGeoPoint(0,3000),"ballVel:" .. ball.velMod()) @@ -233,6 +233,7 @@ firstState = "Init", gSubPlay.new("ShootPoint", "Nor_Shoot",{pos = function() return shoot_pos end}) gSubPlay.new("ShowDribbling", "Nor_Dribbling",{pos = function() return shoot_pos end}) gSubPlay.new("Defender", "Nor_Defend") + gSubPlay.new("Goalie", "Nor_Goalie") end return "GetGlobalMessage" end, @@ -241,7 +242,7 @@ firstState = "Init", Special = task.stop(), Tier = task.stop(), Defender = task.stop(), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "[A][KS]{TDG}" }, @@ -258,7 +259,7 @@ firstState = "Init", Special = task.goCmuRush(function() return SpecialRUNPos end ,closures_dir_ball("Special"),_,DSS_FLAG), Tier = gSubPlay.roleTask("Defender", "Tier"), Defender = gSubPlay.roleTask("Defender", "Defender"), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "{AKSTDG}" }, @@ -279,7 +280,7 @@ firstState = "Init", Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG), Tier = gSubPlay.roleTask("Defender", "Tier"), Defender = gSubPlay.roleTask("Defender", "Defender"), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "{AKSTDG}" }, @@ -300,7 +301,7 @@ firstState = "Init", Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG), Tier = gSubPlay.roleTask("Defender", "Tier"), Defender = gSubPlay.roleTask("Defender", "Defender"), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "{AKSTDG}" }, -- 接球 @@ -325,7 +326,7 @@ firstState = "Init", Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG), Tier = gSubPlay.roleTask("Defender", "Tier"), Defender = gSubPlay.roleTask("Defender", "Defender"), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "[A][KS]{TDG}" }, @@ -347,7 +348,7 @@ firstState = "Init", Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG), Tier = gSubPlay.roleTask("Defender", "Tier"), Defender = gSubPlay.roleTask("Defender", "Defender"), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "{AKSTDG}" }, -- 防守 盯防 @@ -363,7 +364,7 @@ firstState = "Init", Special = function() return task.defender_marking("Special",function() return SpecialRUNPos end) end ,--task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG),-- Tier = gSubPlay.roleTask("Defender", "Tier"), Defender = gSubPlay.roleTask("Defender", "Defender"), - Goalie = task.goalie("Goalie"), + Goalie = gSubPlay.roleTask("Goalie", "Goalie"), match = "[A][KS]{TDG}" }, name = "NORMALPLAY", diff --git a/ZBin/lua_scripts/worldmodel/task.lua b/ZBin/lua_scripts/worldmodel/task.lua index ee05940..1b4ff3a 100644 --- a/ZBin/lua_scripts/worldmodel/task.lua +++ b/ZBin/lua_scripts/worldmodel/task.lua @@ -901,7 +901,10 @@ function goalie_getBall(role) -- goaliePoint = ballPos + Utils.Polar2Vector(param.playerRadius, ballToRoleDir) + Utils.Polar2Vector(50, playerToStablePointDir) a = param.goalieDribblingA goaliePoint = param.goalieStablePoint - idir = (param.goalieTargetPos - rolePos):dir() + local fungoalieTargetPos = function() + return param.goalieTargetPos + end + idir = (fungoalieTargetPos() - rolePos):dir() elseif player.myinfraredCount(role) > param.goalieDribblingFrame then -- 一般这个状态就跳到kick去了 -- goaliePoint = ballPos + Utils.Polar2Vector(param.playerRadius, ballToRoleDir) @@ -915,15 +918,18 @@ function goalie_getBall(role) end function goalie_kick(role) + local fungoalieTargetPos = function() + return param.goalieTargetPos + end local rolePos = CGeoPoint:new_local(player.rawPos(role):x(), player.rawPos(role):y()) local ballPos = ball.pos() local getBallPos = Utils.GetBestInterPos(vision, rolePos, param.playerVel, 1, 1,param.V_DECAY_RATE) local roleToBallTargetDir = math.abs((ballPos - rolePos):dir()) - local ballToTargetDir = math.abs((param.goalieTargetPos - ballPos):dir()) + local ballToTargetDir = math.abs((fungoalieTargetPos() - ballPos):dir()) - local kp = 1 + local kp = 9999 local idir = function(runner) - return (param.goalieTargetPos - rolePos):dir() + return (fungoalieTargetPos() - rolePos):dir() end local goaliePoint = CGeoPoint:new_local(getBallPos:x(), getBallPos:y()) + Utils.Polar2Vector(-param.playerRadius+10, ballToTargetDir) @@ -939,7 +945,8 @@ function goalie_kick(role) local mexe, mpos = GoCmuRush { pos = goaliePoint, dir = idir, acc = a, flag = iflag, rec = r, vel = v } -- return { mexe, mpos, kick.chip, idir, pre.low, power(param.goalieTargetPos, kp), power(param.goalieTargetPos, kp), 0x00000000 } - return { mexe, mpos, param.goalieShootMode, idir, pre.low, power(param.goalieTargetPos, kp,player.num(role)), power(param.goalieTargetPos, kp,player.num(role)), 0x00000000 } + -- return { mexe, mpos, param.goalieShootMode, idir, pre.low, power(fungoalieTargetPos(), kp,player.num(role)), power(fungoalieTargetPos(), kp,player.num(role)), 0x00000000 } + return { mexe, mpos, param.goalieShootMode, idir, pre.low, cp.specified(8000), cp.specified(8000), 0x00000000 } end