Forged Alliance Forever Forged Alliance Forever Forums 2019-10-27T15:02:34+02:00 /feed.php?f=67&t=18325 2019-10-27T15:02:34+02:00 2019-10-27T15:02:34+02:00 /viewtopic.php?t=18325&p=179262#p179262 <![CDATA[Re: mass storage wreck]]>
PhilipJFry wrote:
can you make a PR on the fa repo for that?

I fail on publishing new branch, me github don't allow me to publish brunch not even make PR, and im too lazy now to figure out how to fix it. But:

There is code from equilibrium for the first half, second half if far beyond my skill.

fa/lua/sim/unit.lua

Code:
-----
--Mass storages lose the mass contained in them when they die 
-----

    HandleStorage = function(self, to_army)
        if EntityCategoryContains(categories.MOBILE, self) then
            return -- Exclude ACU / SCU / sparky
        end

        local bp = self:GetBlueprint()
        local brain = GetArmyBrain(self:GetArmy())
        for _, t in {'Mass', 'Energy'} do
            if bp.Economy['Storage' .. t] then
                local type = string.upper(t)
                local amount = bp.Economy['Storage' .. t] * brain:GetEconomyStoredRatio(type)

                brain:TakeResource(type, amount)
                if to_army then
                    local to = GetArmyBrain(to_army)
                    to:GiveResource(type, amount)
                end
            end
        end
    end,   

Statistics: Posted by Ithilis_Quo — 27 Oct 2019, 15:02


]]>
2019-10-27T12:57:38+02:00 2019-10-27T12:57:38+02:00 /viewtopic.php?t=18325&p=179257#p179257 <![CDATA[Re: mass storage wreck]]> Statistics: Posted by PhilipJFry — 27 Oct 2019, 12:57


]]>
2019-10-27T12:05:46+02:00 2019-10-27T12:05:46+02:00 /viewtopic.php?t=18325&p=179252#p179252 <![CDATA[mass storage wreck]]>
Storage store mass, when someone lose storage should lose also mass that is stored inside (that is logical) not only max amount of mass but also that % portion that was stored in that concrete storage.

When mass storages is destroyed realse wreck with mass. And this mass should contain also portion of mass that was stored inside (that is also logical).

Taking this storages can be a tasty treasure when destroying storages, so mass will be less abstract magnitude but something that is more real and ready for reclaim.



half of this is in some mod that I will not name here.

Statistics: Posted by Ithilis_Quo — 27 Oct 2019, 12:05


]]>