mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Goal
This commit is contained in:
parent
b1e99dc317
commit
9856a8625d
@ -142,6 +142,7 @@ do -- Goal
|
|||||||
-- @param #GOAL self
|
-- @param #GOAL self
|
||||||
-- @param #string PlayerName The name of the player.
|
-- @param #string PlayerName The name of the player.
|
||||||
function GOAL:AddPlayerContribution( PlayerName )
|
function GOAL:AddPlayerContribution( PlayerName )
|
||||||
|
self:F({PlayerName})
|
||||||
self.Players[PlayerName] = self.Players[PlayerName] or 0
|
self.Players[PlayerName] = self.Players[PlayerName] or 0
|
||||||
self.Players[PlayerName] = self.Players[PlayerName] + 1
|
self.Players[PlayerName] = self.Players[PlayerName] + 1
|
||||||
self.TotalContributions = self.TotalContributions + 1
|
self.TotalContributions = self.TotalContributions + 1
|
||||||
|
|||||||
@ -508,14 +508,18 @@ function COMMANDCENTER:AssignTask( TaskGroup )
|
|||||||
|
|
||||||
local Task = Tasks[ math.random( 1, #Tasks ) ] -- Tasking.Task#TASK
|
local Task = Tasks[ math.random( 1, #Tasks ) ] -- Tasking.Task#TASK
|
||||||
|
|
||||||
self:I( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority )
|
if Task then
|
||||||
|
|
||||||
|
self:I( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority )
|
||||||
|
|
||||||
|
if not self.AutoAcceptTasks == true then
|
||||||
|
Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) )
|
||||||
|
end
|
||||||
|
|
||||||
|
Task:AssignToGroup( TaskGroup )
|
||||||
|
|
||||||
if not self.AutoAcceptTasks == true then
|
|
||||||
Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Task:AssignToGroup( TaskGroup )
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -253,7 +253,6 @@ do -- TASK_CAPTURE_ZONE
|
|||||||
|
|
||||||
if self.ZoneGoal then
|
if self.ZoneGoal then
|
||||||
if self.ZoneGoal.Goal:IsAchieved() then
|
if self.ZoneGoal.Goal:IsAchieved() then
|
||||||
self:Success()
|
|
||||||
local TotalContributions = self.ZoneGoal.Goal:GetTotalContributions()
|
local TotalContributions = self.ZoneGoal.Goal:GetTotalContributions()
|
||||||
local PlayerContributions = self.ZoneGoal.Goal:GetPlayerContributions()
|
local PlayerContributions = self.ZoneGoal.Goal:GetPlayerContributions()
|
||||||
self:F( { TotalContributions = TotalContributions, PlayerContributions = PlayerContributions } )
|
self:F( { TotalContributions = TotalContributions, PlayerContributions = PlayerContributions } )
|
||||||
@ -263,7 +262,7 @@ do -- TASK_CAPTURE_ZONE
|
|||||||
Scoring:_AddMissionGoalScore( self.Mission, PlayerName, "Zone " .. self.ZoneGoal:GetZoneName() .." captured", PlayerContribution * 200 / TotalContributions )
|
Scoring:_AddMissionGoalScore( self.Mission, PlayerName, "Zone " .. self.ZoneGoal:GetZoneName() .." captured", PlayerContribution * 200 / TotalContributions )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:AddProgress( PlayerName, "Zone " .. self.ZoneGoal:GetZoneName() .." captured", timer.getTime() , 1 )
|
self:Success()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user