Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Currently upgrades are units like any other. This is simply the easiest way to do them.
- -- If you want to do it any other way, just call GG.UpgradeComplete on your appropriate event.
- function gadget:UnitCreated(unitID, unitDefID, teamID, builderID)
- ApplyGroundWeaponUpgrades()
- end
- -- Modularize upgrades
- function gadget:ApplyGroundWeaponUpgrades()
- local ud = UnitDefs[unitDefID];
- if ud.customParams then
- local tech = ud.customParams.upgradetech;
- local level = tonumber(ud.customParams.upgradelevel);
- if tech and level then
- GG.UpgradeComplete(tech, level, teamID);
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment