mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Group Updates
This commit is contained in:
parent
96216494bb
commit
2620927146
@ -996,11 +996,33 @@ end
|
||||
|
||||
|
||||
--- Randomize the unit positions for the units of the respawned group.
|
||||
-- When a Respawn happens, the units of the group will be placed at random positions within the Zone (selected).
|
||||
-- @param #GROUP self
|
||||
-- @param #boolean Positions true will randomize the positions.
|
||||
-- @param #boolean Positions true will randomize the positions within the Zone.
|
||||
-- @return #GROUP self
|
||||
function GROUP:InitRandomizePositions( Positions )
|
||||
|
||||
self.InitRespawnRandomizePositions = Positions
|
||||
self.InitRespawnRandomizePositionsInner = nil
|
||||
self.InitRespawnRandomizePositionsOuter = nil
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Randomize the unit positions for the units in a circle band.
|
||||
-- When a Respawn happens, the units of the group will be positioned at random places within the Outer and Inner radius.
|
||||
-- Thus, a band is created around the respawn location where the units will be placed at random positions.
|
||||
-- @param #GROUP self
|
||||
-- @param #boolean OuterRadius Outer band in meters from the center.
|
||||
-- @param #boolean InnerRadius Inner band in meters from the center.
|
||||
-- @return #GROUP self
|
||||
function GROUP:InitRandomizePositionsRadius( OuterRadius, InnerRadius )
|
||||
|
||||
self.InitRespawnRandomizePositions = nil
|
||||
self.InitRespawnRandomizePositionsInner = Inner
|
||||
self.InitRespawnRandomizePositionsOuter = Outer
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@ -1050,7 +1072,11 @@ function GROUP:Respawn( Template )
|
||||
if self.InitRespawnRandomizePositions then
|
||||
GroupUnitVec3 = Zone:GetRandomVec3()
|
||||
else
|
||||
GroupUnitVec3 = Zone:GetVec3()
|
||||
if self.InitRespawnRandomizePositionsInner and self.InitRespawnRandomizePositionsOuter then
|
||||
GroupUnitVec3 = POINT_VEC3:NewFromVec2( From ):GetRandomPointVec3InRadius( self.InitRespawnRandomizePositionsOuter, self.InitRespawnRandomizePositionsInner )
|
||||
else
|
||||
GroupUnitVec3 = Zone:GetVec3()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user