mirror of
https://gitlab.com/hoggit/developers/hoggit.git
synced 2025-11-10 15:43:28 +00:00
adds smokeName and smokeAtGroup.
This commit is contained in:
parent
cfe5f10823
commit
450b97b91d
@ -1,8 +1,19 @@
|
|||||||
-- Returns the location of the first unit in a given group.
|
-- Returns the location of the first unit in a given group.
|
||||||
-- If the group is nil, this function returns nil.
|
-- If the group is nil, this function returns nil.
|
||||||
|
-- @param grp The group you want coordinates for.
|
||||||
|
-- @return Vec3 The group's first unit's coordinates, or nil if the group is nil
|
||||||
HOGGIT.groupCoords = function(grp)
|
HOGGIT.groupCoords = function(grp)
|
||||||
if grp ~= nil then
|
if grp ~= nil then
|
||||||
return grp:getUnits()[1]:getPosition().p
|
return grp:getUnits()[1]:getPosition().p
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Starts a smoke beacon at the specified group's location
|
||||||
|
-- @param grp The group to smoke. Will be placed on or near the first unit.
|
||||||
|
-- @param smokeColor The trigger.smokeColor enum value to use. Defaults to White smoke
|
||||||
|
HOGGIT.smokeAtGroup = function(grp, smokeColor)
|
||||||
|
local pos = HOGGIT.groupCoords(grp)
|
||||||
|
if smokeColor == nil then smokeColor = trigger.smokeColor.White end
|
||||||
|
trigger.action.smoke(pos, smokeColor)
|
||||||
|
end
|
||||||
|
|||||||
@ -26,3 +26,14 @@ HOGGIT.getLatLongString = function(pos, decimal)
|
|||||||
if decimal == nil then decimal = false end
|
if decimal == nil then decimal = false end
|
||||||
return mist.tostringLL(lat, long, 3, decimal)
|
return mist.tostringLL(lat, long, 3, decimal)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns a textual smoke name based on the provided enum
|
||||||
|
-- @param a trigger.smokeColor enum
|
||||||
|
-- @return the English word as a string representing the color of the smoke. i.e. trigger.smokeColor.Red returns "Red"
|
||||||
|
HOGGIT.getSmokeName = function(smokeColor)
|
||||||
|
if smokeColor == trigger.smokeColor.Green then return "Green" end
|
||||||
|
if smokeColor == trigger.smokeColor.Red then return "Red" end
|
||||||
|
if smokeColor == trigger.smokeColor.White then return "White" end
|
||||||
|
if smokeColor == trigger.smokeColor.Orange then return "Orange" end
|
||||||
|
if smokeColor == trigger.smokeColor.Blue then return "Blue" end
|
||||||
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user