Changeset 3337
- Timestamp:
- 12/01/08 03:45:41 (5 weeks ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/SpringModEdit/Procedures/planetwarsUpgrades.lua
r3315 r3337 280 280 }, 281 281 } 282 283 local automaticUnitExclusions = { 284 'armflea', 285 'corclog', 286 } 287 288 local automaticUnitCosts = {75, 200, 500, 800, 1500} 289 290 291 -------------------------------------------------------------------------------- 292 293 294 local processedExclusions = {} 295 296 local function ProcessExclusions() 297 for _,unit in pairs(automaticUnitExclusions) do 298 processedExclusions[unit] = true 299 end 300 end 282 301 283 302 local function CalculateFactions() … … 322 341 local unit = Units[name] 323 342 local cost = unit.buildCostMetal 324 if unit.buildCostMetal > minCost and unit.buildCostMetal <= maxCost then 343 if unit.buildCostMetal > minCost and unit.buildCostMetal <= maxCost 344 and not processedExclusions[name] then 325 345 returnUnits[unit.unitname] = unit 326 346 end … … 331 351 332 352 local function AddStandardCostMobiles(division, branch, faction, factories) 333 local costs = {75, 200, 500, 800, 1500}334 353 local returnUnits = {} 335 for level = 1,5 do 336 AddToDef(division, branch, level, faction, UnitsByFactoryAndCost(factories, costs[level-1] or 0, costs[level])) 337 end 338 end 339 354 local numberOfLevels = 0 355 for level,_ in ipairs(automaticUnitCosts) do numberOfLevels = level end 356 for level = 1,numberOfLevels do 357 AddToDef(division, branch, level, faction, UnitsByFactoryAndCost(factories, automaticUnitCosts[level-1] or 0, automaticUnitCosts[level])) 358 end 359 end 340 360 341 361 local function PrintDefs(defs) … … 374 394 end 375 395 396 397 -------------------------------------------------------------------------------- 398 399 376 400 CalculateFactions() 401 ProcessExclusions() 377 402 378 403 AddToDef('Buildings', 'Economy', 3, 'Arm', FindFactories(ArmUnits))