This commit is contained in:
FlightControl 2019-03-21 06:57:04 +01:00
parent b1e99dc317
commit 9856a8625d
3 changed files with 12 additions and 8 deletions

View File

@ -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

View File

@ -507,14 +507,18 @@ function COMMANDCENTER:AssignTask( TaskGroup )
end end
local Task = Tasks[ math.random( 1, #Tasks ) ] -- Tasking.Task#TASK local Task = Tasks[ math.random( 1, #Tasks ) ] -- Tasking.Task#TASK
if Task then
self:I( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority ) 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 if not self.AutoAcceptTasks == true then
Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) ) Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) )
end
Task:AssignToGroup( TaskGroup )
end end
Task:AssignToGroup( TaskGroup )
end end

View File

@ -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