Skip to content

Commit

Permalink
stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Umbrella167 committed May 13, 2024
1 parent 9897553 commit 0236f63
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
17 changes: 9 additions & 8 deletions Core/HuRocos-2024/play/NORMALPLAY.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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,
Expand All @@ -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}"
},

Expand All @@ -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}"
},

Expand All @@ -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}"
},

Expand All @@ -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}"
},
-- 接球
Expand All @@ -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}"
},

Expand All @@ -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}"
},
-- 防守 盯防
Expand All @@ -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",
Expand Down
17 changes: 12 additions & 5 deletions ZBin/lua_scripts/worldmodel/task.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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


Expand Down

0 comments on commit 0236f63

Please sign in to comment.