Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
Umbrella167 committed May 14, 2024
1 parent 1dc5a5d commit 84a0bc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
24 changes: 12 additions & 12 deletions Core/HuRocos-2024/play/NORMALPLAY.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ firstState = "Init",
Assister = task.getball(function() return shoot_pos end,playerVel,getballMode),
Kicker = task.goCmuRush(function() return KickerRUNPos end,closures_dir_ball("Kicker"),_,DSS_FLAG),
Special = task.goCmuRush(function() return SpecialRUNPos end ,closures_dir_ball("Special"),_,DSS_FLAG),
Tier = gSubPlay.roleTask("Defender", "Tier"),
Defender = gSubPlay.roleTask("Defender", "Defender"),
Tier = gSubPlay.roleTask("Defender", "Breaker"),
Defender = gSubPlay.roleTask("Defender", "Fronter"),
Goalie = gSubPlay.roleTask("Goalie", "Goalie"),
match = "{AKSTDG}"
},
Expand All @@ -278,8 +278,8 @@ firstState = "Init",
Assister = gSubPlay.roleTask("ShootPoint", "Assister"),
Kicker = task.goCmuRush(function() return KickerRUNPos end,closures_dir_ball("Kicker"),_,DSS_FLAG),
Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG),
Tier = gSubPlay.roleTask("Defender", "Tier"),
Defender = gSubPlay.roleTask("Defender", "Defender"),
Tier = gSubPlay.roleTask("Defender", "Breaker"),
Defender = gSubPlay.roleTask("Defender", "Fronter"),
Goalie = gSubPlay.roleTask("Goalie", "Goalie"),
match = "{AKSTDG}"
},
Expand All @@ -295,8 +295,8 @@ firstState = "Init",
Assister = task.touchKick(function() return shoot_pos end, false, function() return shoot_kp end, kick.flat),
Kicker = task.goCmuRush(function() return KickerRUNPos end,closures_dir_ball("Kicker"),_,DSS_FLAG),
Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG),
Tier = gSubPlay.roleTask("Defender", "Tier"),
Defender = gSubPlay.roleTask("Defender", "Defender"),
Tier = gSubPlay.roleTask("Defender", "Breaker"),
Defender = gSubPlay.roleTask("Defender", "Fronter"),
Goalie = gSubPlay.roleTask("Goalie", "Goalie"),
match = "[AKS]{TDG}"
},
Expand All @@ -320,8 +320,8 @@ firstState = "Init",
Assister = task.getball(function() return shoot_pos end,playerVel,getballMode),
Kicker = task.goCmuRush(function() return KickerRUNPos end,closures_dir_ball("Kicker"),_,DSS_FLAG),
Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG),
Tier = gSubPlay.roleTask("Defender", "Tier"),
Defender = gSubPlay.roleTask("Defender", "Defender"),
Tier = gSubPlay.roleTask("Defender", "Breaker"),
Defender = gSubPlay.roleTask("Defender", "Fronter"),
Goalie = gSubPlay.roleTask("Goalie", "Goalie"),
match = "[A][KS]{TDG}"
},
Expand All @@ -342,8 +342,8 @@ firstState = "Init",
Assister = gSubPlay.roleTask("ShowDribbling", "Assister"),
Kicker = task.goCmuRush(function() return KickerRUNPos end,closures_dir_ball("Kicker"),_,DSS_FLAG),
Special = task.goCmuRush(function() return SpecialRUNPos end,closures_dir_ball("Special"),_,DSS_FLAG),
Tier = gSubPlay.roleTask("Defender", "Tier"),
Defender = gSubPlay.roleTask("Defender", "Defender"),
Tier = gSubPlay.roleTask("Defender", "Breaker"),
Defender = gSubPlay.roleTask("Defender", "Fronter"),
Goalie = gSubPlay.roleTask("Goalie", "Goalie"),
match = "{AKSTDG}"
},
Expand All @@ -358,8 +358,8 @@ firstState = "Init",
Assister = task.getball(function() return shoot_pos end,playerVel,getballMode),
Kicker = function() return task.defender_marking("Kicker",function() return KickerRUNPos end) end,--task.goCmuRush(function() return KickerRUNPos end,closures_dir_ball("Kicker"),_,DSS_FLAG),--
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"),
Tier = gSubPlay.roleTask("Defender", "Breaker"),
Defender = gSubPlay.roleTask("Defender", "Fronter"),
Goalie = gSubPlay.roleTask("Goalie", "Goalie"),
match = "[A][KS]{TDG}"
},
Expand Down
18 changes: 9 additions & 9 deletions ZBin/lua_scripts/worldmodel/task.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,10 @@ function getLineCrossDefenderPos(pos_, posOrDir_)
local line_ = CGeoSegment(pos_, pos_)
if type(posOrDir_) == 'number' then
line_ = CGeoSegment(pos_, pos_+Utils.Polar2Vector(param.INF, posOrDir_))
debugEngine:gui_debug_line(pos_, pos_+Utils.Polar2Vector(param.INF, posOrDir_))
-- debugEngine:gui_debug_line(pos_, pos_+Utils.Polar2Vector(param.INF, posOrDir_))
elseif type(posOrDir_) == 'userdata' then
line_ = CGeoSegment(pos_, posOrDir_)
debugEngine:gui_debug_line(pos_, posOrDir_)
-- debugEngine:gui_debug_line(pos_, posOrDir_)
end
-- 打印defender行走的框
debugEngine:gui_debug_line(param.defenderTopRightPos, param.defenderButtomRightPos)
Expand Down Expand Up @@ -786,8 +786,8 @@ end
function isCrossPenalty(rolePos, targetPos)
local line_ = CGeoSegment(rolePos, targetPos)
local tPos = line_:segmentsIntersectPoint(param.penaltyMiddleLine)
debugEngine:gui_debug_x(tPos)
debugEngine:gui_debug_msg(CGeoPoint(1000, 1000), tPos:x().." "..tPos:y())
-- debugEngine:gui_debug_x(tPos)
-- debugEngine:gui_debug_msg(CGeoPoint(1000, 1000), tPos:x().." "..tPos:y())
if tPos == CGeoPoint(9999, 9999) then
return false
end
Expand All @@ -797,10 +797,10 @@ end
function simpleMoveTargetPos(rolePos, targetPos)
local tPosX = targetPos:x()
local tPosY = targetPos:y()
debugEngine:gui_debug_msg(CGeoPoint(-2000, 2000), "x: "..math.abs(rolePos:x() - targetPos:x()))
debugEngine:gui_debug_msg(CGeoPoint(-2000, 2200), "y: "..math.abs(rolePos:y() - targetPos:y()))
-- debugEngine:gui_debug_msg(CGeoPoint(-2000, 2000), "x: "..math.abs(rolePos:x() - targetPos:x()))
-- debugEngine:gui_debug_msg(CGeoPoint(-2000, 2200), "y: "..math.abs(rolePos:y() - targetPos:y()))

debugEngine:gui_debug_msg(CGeoPoint(0,0), tostring(isCrossPenalty(rolePos, targetPos)))
-- debugEngine:gui_debug_msg(CGeoPoint(0,0), tostring(isCrossPenalty(rolePos, targetPos)))

if math.abs(rolePos:x() - targetPos:x()) > 100 and math.abs(rolePos:y() - targetPos:y()) > 100 or isCrossPenalty(rolePos, targetPos) then
tPosX = param.defenderTopRightPos:x()
Expand All @@ -822,8 +822,8 @@ end
-- mode: 0 upper area, 1 down area, 2 middle
-- flag: 0 aim the ball, 1 aim the enemy
function defend_normV2(role, mode, flag)
debugEngine:gui_debug_x(getLineCrossDefenderPos(ball.pos(), ball.velDir()), 3)
debugEngine:gui_debug_x(getLineCrossDefenderPos(ball.pos(), param.ourGoalPos), 3)
-- debugEngine:gui_debug_x(getLineCrossDefenderPos(ball.pos(), ball.velDir()), 3)
-- debugEngine:gui_debug_x(getLineCrossDefenderPos(ball.pos(), param.ourGoalPos), 3)


getDefenderCount()
Expand Down

0 comments on commit 84a0bc2

Please sign in to comment.