mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Range
This commit is contained in:
parent
7d7c521bce
commit
223de9d1aa
@ -395,8 +395,6 @@ function CARRIERTRAINER:_CheckPlayerStatus()
|
|||||||
|
|
||||||
if playerData then
|
if playerData then
|
||||||
|
|
||||||
self:I("player "..playerData.callsign)
|
|
||||||
|
|
||||||
-- Player unit.
|
-- Player unit.
|
||||||
local unit = playerData.unit
|
local unit = playerData.unit
|
||||||
|
|
||||||
@ -940,9 +938,6 @@ function CARRIERTRAINER:_Ninety(playerData)
|
|||||||
local idealAltitude = 500
|
local idealAltitude = 500
|
||||||
local score, hint=self:_AltitudeCheck(playerData, self.Ninety)
|
local score, hint=self:_AltitudeCheck(playerData, self.Ninety)
|
||||||
|
|
||||||
self:_SendMessageToPlayer( hint, 8, playerData )
|
|
||||||
self:_PrintAltitudeFeedback(altitude, idealAltitude, playerData)
|
|
||||||
|
|
||||||
--local aoa = math.deg(mist.getAoA(playerData.mistUnit))
|
--local aoa = math.deg(mist.getAoA(playerData.mistUnit))
|
||||||
local aoa = playerData.unit:GetAoA()
|
local aoa = playerData.unit:GetAoA()
|
||||||
local aoaFeedback = self:_PrintAoAFeedback(aoa, 8.1, playerData)
|
local aoaFeedback = self:_PrintAoAFeedback(aoa, 8.1, playerData)
|
||||||
@ -979,9 +974,6 @@ function CARRIERTRAINER:_Wake(playerData)
|
|||||||
local idealAltitude = 370
|
local idealAltitude = 370
|
||||||
local score, hint=self:_AltitudeCheck(playerData, self.Wake)
|
local score, hint=self:_AltitudeCheck(playerData, self.Wake)
|
||||||
|
|
||||||
self:_SendMessageToPlayer( hint, 8, playerData )
|
|
||||||
self:_PrintAltitudeFeedback(altitude, idealAltitude, playerData)
|
|
||||||
|
|
||||||
local aoa = playerData.unit:GetAoA()
|
local aoa = playerData.unit:GetAoA()
|
||||||
|
|
||||||
local aoaFeedback = self:_PrintAoAFeedback(aoa, 8.1, playerData)
|
local aoaFeedback = self:_PrintAoAFeedback(aoa, 8.1, playerData)
|
||||||
|
|||||||
@ -276,7 +276,7 @@ RANGE.id="RANGE | "
|
|||||||
|
|
||||||
--- Range script version.
|
--- Range script version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
RANGE.version="1.2.1"
|
RANGE.version="1.2.2"
|
||||||
|
|
||||||
--TODO list:
|
--TODO list:
|
||||||
--TODO: Add custom weapons, which can be specified by the user.
|
--TODO: Add custom weapons, which can be specified by the user.
|
||||||
@ -1161,11 +1161,13 @@ function RANGE:OnEventShot(EventData)
|
|||||||
local _callsign=self:_myname(_unitName)
|
local _callsign=self:_myname(_unitName)
|
||||||
|
|
||||||
-- Coordinate of impact point.
|
-- Coordinate of impact point.
|
||||||
local impactcoord=COORDINATE:NewFromVec3(_lastBombPos)
|
local impactcoord=COORDINATE:NewFromVec3(_lastBombPos)
|
||||||
|
|
||||||
-- Distance from range. We dont want to smoke targets outside of the range.
|
-- Distance from range. We dont want to smoke targets outside of the range.
|
||||||
local impactdist=impactcoord:Get2DDistance(self.location)
|
local impactdist=impactcoord:Get2DDistance(self.location)
|
||||||
|
|
||||||
|
--impactcoord:MarkToAll("Bomb impact point")
|
||||||
|
|
||||||
-- Smoke impact point of bomb.
|
-- Smoke impact point of bomb.
|
||||||
if self.PlayerSettings[_playername].smokebombimpact and impactdist<self.rangeradius then
|
if self.PlayerSettings[_playername].smokebombimpact and impactdist<self.rangeradius then
|
||||||
if self.PlayerSettings[_playername].delaysmoke then
|
if self.PlayerSettings[_playername].delaysmoke then
|
||||||
@ -1184,6 +1186,8 @@ function RANGE:OnEventShot(EventData)
|
|||||||
|
|
||||||
-- Distance between bomb and target.
|
-- Distance between bomb and target.
|
||||||
local _temp = impactcoord:Get2DDistance(_target:GetCoordinate())
|
local _temp = impactcoord:Get2DDistance(_target:GetCoordinate())
|
||||||
|
|
||||||
|
--env.info(string.format("FF target = %s dist = %d m", _target:GetName(), _temp))
|
||||||
|
|
||||||
-- Find closest target to last known position of the bomb.
|
-- Find closest target to last known position of the bomb.
|
||||||
if _distance == nil or _temp < _distance then
|
if _distance == nil or _temp < _distance then
|
||||||
@ -1225,7 +1229,7 @@ function RANGE:OnEventShot(EventData)
|
|||||||
elseif _distance <= self.rangeradius then
|
elseif _distance <= self.rangeradius then
|
||||||
-- Send message
|
-- Send message
|
||||||
local _message=string.format("%s, weapon fell more than %.1f km away from nearest range target. No score!", _callsign, self.scorebombdistance/1000)
|
local _message=string.format("%s, weapon fell more than %.1f km away from nearest range target. No score!", _callsign, self.scorebombdistance/1000)
|
||||||
self:_DisplayMessageToGroup(_unit, _message, nil, true)
|
self:_DisplayMessageToGroup(_unit, _message, nil, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Terminate the timer
|
--Terminate the timer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user