Version 2.2.3

Many changes, most relating to "Expansion", some community requests. Little Documentation of those changes available yet, though.
This commit is contained in:
Christian Franz
2024-05-09 09:39:22 +02:00
parent 2422d89a32
commit 07a32bd051
24 changed files with 2202 additions and 241 deletions

View File

@@ -14,7 +14,7 @@ cfxPlayerScore.firstSave = true -- to force overwrite
3.0.1 - cleanup
3.0.2 - interface with ObjectDestructDetector for scoring scenery objects
3.1.0 - shared data for persistence
3.2.0 - integration with bank
3.2.0 - integration with bank
--]]--
cfxPlayerScore.requiredLibs = {
@@ -1023,6 +1023,7 @@ function cfxPlayerScore.scheduledAward(args)
cfxPlayerScore.coalitionScore[playerSide] = cfxPlayerScore.coalitionScore[playerSide] + theScore.scoreaccu
if bank and bank.addFunds then
bank.addFunds(playerSide, cfxPlayerScore.score2finance * theScore.scoreaccu)
desc = desc .. "(transferred §" .. cfxPlayerScore.score2finance * theScore.scoreaccu .. " to funding)\n"
end
theScore.scoreaccu = 0
hasAward = true
@@ -1360,14 +1361,21 @@ function cfxPlayerScore.update()
-- score!
cfxPlayerScore.coalitionScore[coa] = cfxPlayerScore.coalitionScore[coa] + cfxPlayerScore.blueTriggerScore[tName]
cfxPlayerScore.blueTriggerFlags[tName] = newVal
-- bank it if exists
if bank and bank.addFunds then
bank.addFunds(coa, cfxPlayerScore.score2finance * cfxPlayerScore.blueTriggerScore[tName])
end
if cfxPlayerScore.announcer then
trigger.action.outTextForCoalition(coa, "BLUE goal [" .. tName .. "] achieved, new BLUE coalition score is " .. cfxPlayerScore.coalitionScore[coa], 30)
trigger.action.outSoundForCoalition(coa, cfxPlayerScore.scoreSound)
end
-- bank it if exists
local amount
if bank and bank.addFunds then
amount = cfxPlayerScore.score2finance * cfxPlayerScore.blueTriggerScore[tName]
bank.addFunds(coa, amount)
if cfxPlayerScore.announcer then
trigger.action.outTextForCoalition(coa, "Transferred §" .. amount .. " to funds.", 30)
end
end
end
end
end
@@ -1380,13 +1388,23 @@ function cfxPlayerScore.update()
cfxPlayerScore.coalitionScore[coa] = cfxPlayerScore.coalitionScore[coa] + cfxPlayerScore.redTriggerScore[tName]
cfxPlayerScore.redTriggerFlags[tName] = newVal
if bank and bank.addFunds then
bank.addFunds(coa, cfxPlayerScore.score2finance * cfxPlayerScore.blueTriggerScore[tName])
end
--if bank and bank.addFunds then
-- bank.addFunds(coa, cfxPlayerScore.score2finance * cfxPlayerScore.blueTriggerScore[tName])
--end
if cfxPlayerScore.announcer then
trigger.action.outTextForCoalition(coa, "RED goal [" .. tName .. "] achieved, new RED coalition score is " .. cfxPlayerScore.coalitionScore[coa], 30)
trigger.action.outSoundForCoalition(coa, cfxPlayerScore.scoreSound)
end
-- bank it if exists
local amount
if bank and bank.addFunds then
amount = cfxPlayerScore.score2finance * cfxPlayerScore.redTriggerScore[tName]
bank.addFunds(coa, amount)
if cfxPlayerScore.announcer then
trigger.action.outTextForCoalition(coa, "Transferred §" .. amount .. " to funds.", 30)
end
end
end
end
end