Changeset 3321

Show
Ignore:
Timestamp:
11/29/08 16:16:29 (5 weeks ago)
Author:
carrepairer
Message:

Reverting changes to boost in 3240 which broke it, to quickly deploy good stable. Also removing chicken faction.

Location:
trunk/mods/ca
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/mods/ca/LuaRules/Gadgets/unit_start_boost.lua

    r3282 r3321  
    4848local boost = {} 
    4949local startMetal = {} 
    50 local boostUnits = {} 
    51 local teamsToBoost = {} 
    5250 
    5351 
     
    9492local init = false 
    9593 
    96 --[[ 
    9794function gadget:GameFrame(n) 
    9895  if (n > 1 and not init) then 
     
    110107                        Spring.SetTeamResource(teamID, 'ms', START_STORAGE) 
    111108                        Spring.SetTeamResource(teamID, 'es', START_STORAGE) 
    112                          
     109 
    113110                        for _, unitID in pairs(Spring.GetTeamUnits(teamID)) do 
    114111                                local defID = Spring.GetUnitDefID(unitID) 
     
    126123        end 
    127124  end 
    128 end 
    129 --]] 
    130  
    131  
    132 function gadget:UnitCreated(unitID, unitDefID, unitTeam) 
    133          
    134          
    135         --Spring.SendMessage("Initializing team "..unitTeam.." with "..metal) 
    136          
    137         if teamsToBoost[unitTeam] then 
    138                 local unitName = unitDefID and UnitDefs[unitDefID].name 
    139                 if unitName and boostUnits[unitName] then 
    140                         local metal = Spring.GetTeamResources(unitTeam, 'metal')         
    141                          
    142                         Spring.SetTeamResource(unitTeam, 'energy', 0) 
    143                         Spring.SetTeamResource(unitTeam, 'metal', 0) 
    144                                  
    145                         --[[ 
    146                         if Spring.GetModOptions().commtype ~= 'con' then         
    147                                 Spring.SetTeamResource(unitTeam, 'ms', START_STORAGE) 
    148                                 Spring.SetTeamResource(unitTeam, 'es', START_STORAGE) 
    149                         end 
    150                         --]] 
    151                          
    152                         boost[unitID]  = metal 
    153                         startMetal[unitID] = metal 
    154                         --Spring.SendMessage("for unit " ..unitID) 
    155                         SendToUnsynced("UpdateBoost", unitID, metal, metal)  
    156                          
    157                         teamsToBoost[unitTeam] = nil 
    158                          
    159                 end 
    160         end 
    161  
    162 end 
    163  
    164 function gadget:Initialize() 
    165  
    166         for _, teamID in pairs(Spring.GetTeamList()) do 
    167                 local gaiaID = Spring.GetGaiaTeamID() 
    168                 local teamLuaAI = Spring.GetTeamLuaAI(teamID) 
    169                 if (teamID ~= gaiaID and (not teamLuaAI or teamLuaAI == "")) then 
    170                         teamsToBoost[teamID] = true 
    171                 end 
    172         end 
    173  
    174         if Spring.GetModOptions().commtype == 'con' then 
    175                 boostUnits = { 
    176                         armrectr        = 1, 
    177                         armch           = 1, 
    178                         arm_conveh      = 1, 
    179                         armcs           = 1, 
    180  
    181                         cornecro        = 1, 
    182                         corch           = 1, 
    183                         corned          = 1, 
    184                         corcs           = 1, 
    185  
    186                         --chicken_drone = 1, 
    187                 }        
    188         else 
    189                 boostUnits = { 
    190                         armcom = 1, 
    191                         corcom = 1, 
    192                 } 
    193         end 
    194125end 
    195126 
  • trunk/mods/ca/gamedata/sidedata.lua

    r3280 r3321  
    2222    startunit = 'corcom', 
    2323  }, 
     24  --[[ 
    2425  [4] = { 
    2526    name      = 'Chicken (random if disabled)', 
    2627    startunit = 'chickenbroodqueen', 
    2728  }, 
     29  --]] 
    2830} 
    2931