mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
MP test
This commit is contained in:
parent
ffe04ff657
commit
6183a9acab
@ -544,6 +544,7 @@ function SCORING:_AddPlayerFromUnit( UnitData )
|
|||||||
local UnitCategory = UnitDesc.category
|
local UnitCategory = UnitDesc.category
|
||||||
local UnitCoalition = UnitData:GetCoalition()
|
local UnitCoalition = UnitData:GetCoalition()
|
||||||
local UnitTypeName = UnitData:GetTypeName()
|
local UnitTypeName = UnitData:GetTypeName()
|
||||||
|
local ThreatLevel = UnitData:GetThreatLevel()
|
||||||
|
|
||||||
self:T( { PlayerName, UnitName, UnitCategory, UnitCoalition, UnitTypeName } )
|
self:T( { PlayerName, UnitName, UnitCategory, UnitCoalition, UnitTypeName } )
|
||||||
|
|
||||||
@ -953,6 +954,7 @@ function SCORING:_EventOnHit( Event )
|
|||||||
PlayerHit.PenaltyHit = PlayerHit.PenaltyHit or 0
|
PlayerHit.PenaltyHit = PlayerHit.PenaltyHit or 0
|
||||||
PlayerHit.TimeStamp = PlayerHit.TimeStamp or 0
|
PlayerHit.TimeStamp = PlayerHit.TimeStamp or 0
|
||||||
PlayerHit.UNIT = PlayerHit.UNIT or TargetUNIT
|
PlayerHit.UNIT = PlayerHit.UNIT or TargetUNIT
|
||||||
|
PlayerHit.ThreatLevel = PlayerHit.UNIT:GetThreatLevel()
|
||||||
|
|
||||||
-- Only grant hit scores if there was more than one second between the last hit.
|
-- Only grant hit scores if there was more than one second between the last hit.
|
||||||
if timer.getTime() - PlayerHit.TimeStamp > 1 then
|
if timer.getTime() - PlayerHit.TimeStamp > 1 then
|
||||||
@ -1064,6 +1066,8 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
-- What is the player destroying?
|
-- What is the player destroying?
|
||||||
if Player and Player.Hit and Player.Hit[TargetCategory] and Player.Hit[TargetCategory][TargetUnitName] and Player.Hit[TargetCategory][TargetUnitName].TimeStamp ~= 0 then -- Was there a hit for this unit for this player before registered???
|
if Player and Player.Hit and Player.Hit[TargetCategory] and Player.Hit[TargetCategory][TargetUnitName] and Player.Hit[TargetCategory][TargetUnitName].TimeStamp ~= 0 then -- Was there a hit for this unit for this player before registered???
|
||||||
|
|
||||||
|
local TargetTreatLevel = Player.Hit[TargetCategory][TargetUnitName].ThreatLevel
|
||||||
|
|
||||||
Player.Destroy[TargetCategory] = Player.Destroy[TargetCategory] or {}
|
Player.Destroy[TargetCategory] = Player.Destroy[TargetCategory] or {}
|
||||||
Player.Destroy[TargetCategory][TargetType] = Player.Destroy[TargetCategory][TargetType] or {}
|
Player.Destroy[TargetCategory][TargetType] = Player.Destroy[TargetCategory][TargetType] or {}
|
||||||
|
|
||||||
@ -1076,8 +1080,8 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
|
|
||||||
if TargetCoalition then
|
if TargetCoalition then
|
||||||
if InitCoalition == TargetCoalition then
|
if InitCoalition == TargetCoalition then
|
||||||
local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel()
|
local ThreatLevelTarget, ThreatTypeTarget = TargetTreatLevel
|
||||||
local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1
|
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
||||||
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
|
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
|
||||||
self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||||
|
|
||||||
@ -1109,8 +1113,8 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
self:ScoreCSV( PlayerName, TargetPlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
|
self:ScoreCSV( PlayerName, TargetPlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
|
||||||
else
|
else
|
||||||
|
|
||||||
local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel()
|
local ThreatLevelTarget, ThreatTypeTarget = TargetTreatLevel
|
||||||
local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1
|
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
||||||
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
|
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
|
||||||
|
|
||||||
self:E( { ThreatLevel = ThreatScore, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
self:E( { ThreatLevel = ThreatScore, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user