Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Umbrella167/Rocos
Browse files Browse the repository at this point in the history
  • Loading branch information
Umbrella167 committed May 16, 2024
2 parents 223e905 + a2169fc commit d3e2ecc
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions Core/HuRocos-2024/play/their_Penalty.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
local playerCount = {'', '', '', '', '', ''}
local DSS_FLAG = flag.allow_dss + flag.dodge_ball

local readyPosX = param.pitchLength / 2 - 300

local stopPos = function(role)
for i=1, #playerCount do
-- debugEngine:gui_debug_msg(CGeoPoint(1000, 1000+150*i), playerCount[i])
if playerCount[i] == role then
if i<#playerCount/2 then
return CGeoPoint(- param.pitchLength / 2 + 300,-param.pitchWidth / 2 + 300 * i)
return CGeoPoint(readyPosX,-param.pitchWidth / 2 + 300 * i)
end
return CGeoPoint(- param.pitchLength / 2 + 300,param.pitchWidth / 2 - 300 * (#playerCount-i))
return CGeoPoint(readyPosX,param.pitchWidth / 2 - 300 * (#playerCount-i))
end
if playerCount[i] == '' then
playerCount[i] = role
return CGeoPoint(- param.pitchLength / 2 + 300,-param.pitchWidth / 2 + 300 * i)
return CGeoPoint(readyPosX,-param.pitchWidth / 2 + 300 * i)
end
end
return CGeoPoint(-param.pitchLength / 2 + 300,-param.pitchWidth / 2 + 300)
return CGeoPoint(readyPosX,-param.pitchWidth / 2 + 300)
end

local getBallPos = function(role)
local rolePos = player.pos(role)
local tPos = Utils.GetBestInterPos(vision, rolePos, param.playerVel, 1, 1,param.V_DECAY_RATE)
return tPos
end


local subScript = false

return {
Expand Down Expand Up @@ -62,11 +72,15 @@ firstState = "Init",
["Getball"] = {
switch = function()
-- debugEngine:gui_debug_msg(CGeoPoint(0,0),ball.posX())
if ball.pos():dist(enemy.pos(enemy.closestBall())) > param.playerRadius * 1.5 then
-- if ball.pos():dist(enemy.pos(enemy.closestBall())) > param.playerRadius * 1.5 then
-- return "Defend"
-- end
if ball.posX() < player.posX("Goalie") then
return "Defend"
end

end,
Goalie = function() return task.goSimplePos(ball.pos(), player.toBallDir("Goalie"), flag.dribbling) end,
Goalie = function() return task.goSimplePos(getBallPos, player.toBallDir("Goalie"), flag.dribbling) end,
match = "{G}"
},
name = "their_Penalty",
Expand Down

0 comments on commit d3e2ecc

Please sign in to comment.