Got Task_SEAD template working with all the variations and complexity!

This commit is contained in:
FlightControl
2017-03-04 08:51:31 +01:00
parent 5ddeb8d396
commit b46d61d865
13 changed files with 68834 additions and 90 deletions

View File

@@ -990,11 +990,11 @@ function SCORING:_EventOnDeadOrCrash( Event )
TargetDestroy.ScoreDestroy = TargetDestroy.ScoreDestroy or 0
TargetDestroy.Penalty = TargetDestroy.Penalty or 0
TargetDestroy.PenaltyDestroy = TargetDestroy.PenaltyDestroy or 0
TargetDestroy.UNIT = TargetDestroy.UNIT or Player.Hit[TargetCategory][TargetUnitName].UNIT
local TargetUNIT = Player.Hit[TargetCategory][TargetUnitName].UNIT
if TargetCoalition then
if InitCoalition == TargetCoalition then
local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel()
local ThreatLevelTarget, ThreatTypeTarget = TargetUNIT:GetThreatLevel()
local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
@@ -1025,7 +1025,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
self:ScoreCSV( PlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
else
local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel()
local ThreatLevelTarget, ThreatTypeTarget = TargetUNIT:GetThreatLevel()
local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
@@ -1055,7 +1055,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
end
self:ScoreCSV( PlayerName, "DESTROY_SCORE", 1, ThreatScore, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
local UnitName = TargetDestroy.UNIT:GetName()
local UnitName = TargetUNIT:GetName()
local Score = self.ScoringObjects[UnitName]
if Score then
Player.Score = Player.Score + Score
@@ -1075,7 +1075,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
self:E( { ScoringZone = ScoreZoneData } )
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
local Score = ScoreZoneData.Score
if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then
if ScoreZone:IsVec2InZone( TargetUNIT:GetVec2() ) then
Player.Score = Player.Score + Score
TargetDestroy.Score = TargetDestroy.Score + Score
MESSAGE
@@ -1096,7 +1096,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
self:E( { ScoringZone = ScoreZoneData } )
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
local Score = ScoreZoneData.Score
if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then
if ScoreZone:IsVec2InZone( TargetUNIT:GetVec2() ) then
Player.Score = Player.Score + Score
TargetDestroy.Score = TargetDestroy.Score + Score
MESSAGE