needs testing

This commit is contained in:
Aaron Veden
2018-07-31 21:52:44 -07:00
parent 1acc706baa
commit 8108b3b953
3 changed files with 147 additions and 68 deletions
+3 -3
View File
@@ -217,10 +217,10 @@ function upgrade.attempt(natives)
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.22") game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.22")
global.version = constants.VERSION_57 global.version = constants.VERSION_57
end end
if (global.version < constants.VERSION_66) then if (global.version < constants.VERSION_67) then
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.31") game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.32")
global.version = constants.VERSION_66 global.version = constants.VERSION_67
end end
return starting ~= global.version, natives return starting ~= global.version, natives
+22 -2
View File
@@ -21,7 +21,7 @@ constants.VERSION_41 = 41
constants.VERSION_44 = 44 constants.VERSION_44 = 44
constants.VERSION_51 = 51 constants.VERSION_51 = 51
constants.VERSION_57 = 57 constants.VERSION_57 = 57
constants.VERSION_66 = 66 constants.VERSION_67 = 67
-- misc -- misc
@@ -148,6 +148,11 @@ constants.BASE_ALIGNMENT_DEADZONE = 20
constants.BASE_ALIGNMENT_NE = 21 constants.BASE_ALIGNMENT_NE = 21
constants.BASE_ALIGNMENT_BOBS = 22 constants.BASE_ALIGNMENT_BOBS = 22
constants.BASE_ALIGNMENT_SPAWNER = 23 constants.BASE_ALIGNMENT_SPAWNER = 23
constants.BASE_ALIGNMENT_NE_BLUE = 24
constants.BASE_ALIGNMENT_NE_RED = 25
constants.BASE_ALIGNMENT_NE_YELLOW = 26
constants.BASE_ALIGNMENT_NE_GREEN = 27
constants.BASE_ALIGNMENT_NE_PINK = 28
-- constants.BASE_ALIGNMENT_BURROW = 3 -- constants.BASE_ALIGNMENT_BURROW = 3
constants.BASE_PROCESS_INTERVAL = constants.TICKS_A_SECOND * 2 constants.BASE_PROCESS_INTERVAL = constants.TICKS_A_SECOND * 2
@@ -212,6 +217,22 @@ end
if constants.ENABLED_NE_UNITS then if constants.ENABLED_NE_UNITS then
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE] = 0.1 constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE] = 0.1
if settings.startup["NE_Blue_Spawners"].value then
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE_BLUE] = 0.1
end
if settings.startup["NE_Red_Spawners"].value then
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE_RED] = 0.1
end
if settings.startup["NE_Pink_Spawners"].value then
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE_PINK] = 0.1
end
if settings.startup["NE_Green_Spawners"].value then
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE_GREEN] = 0.1
end
if settings.startup["NE_Yellow_Spawners"].value then
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_NE_YELLOW] = 0.1
end
end end
-- ai retreat -- ai retreat
@@ -478,7 +499,6 @@ constants.ENERGY_THIEF_WORM_VARIATIONS = wormVariations
constants.ENERGY_THIEF_UNIT_TIERS = unitTiers constants.ENERGY_THIEF_UNIT_TIERS = unitTiers
constants.ENERGY_THIEF_UNIT_VARIATIONS = unitVariations constants.ENERGY_THIEF_UNIT_VARIATIONS = unitVariations
constants.LASER_NEST_TIERS = nestTiers constants.LASER_NEST_TIERS = nestTiers
constants.LASER_NEST_VARIATIONS = nestVariations constants.LASER_NEST_VARIATIONS = nestVariations
constants.LASER_WORM_TIERS = wormTiers constants.LASER_WORM_TIERS = wormTiers
+122 -63
View File
@@ -10,6 +10,12 @@ local EVOLUTION_INCREMENTS = constants.EVOLUTION_INCREMENTS
local BASE_ALIGNMENT_NE = constants.BASE_ALIGNMENT_NE local BASE_ALIGNMENT_NE = constants.BASE_ALIGNMENT_NE
local ENABLED_BOBS_UNITS = constants.ENABLED_BOBS_UNITS local ENABLED_BOBS_UNITS = constants.ENABLED_BOBS_UNITS
local BASE_ALIGNMENT_NE_BLUE = constants.BASE_ALIGNMENT_NE_BLUE
local BASE_ALIGNMENT_NE_RED = constants.BASE_ALIGNMENT_NE_RED
local BASE_ALIGNMENT_NE_PINK = constants.BASE_ALIGNMENT_NE_PINK
local BASE_ALIGNMENT_NE_GREEN = constants.BASE_ALIGNMENT_NE_GREEN
local BASE_ALIGNMENT_NE_YELLOW = constants.BASE_ALIGNMENT_NE_YELLOW
-- imported functions -- imported functions
local mFloor = math.floor local mFloor = math.floor
@@ -34,25 +40,75 @@ end
function ne.processNEUnitClass(natives, surface) function ne.processNEUnitClass(natives, surface)
local position = { x = 0, y = 0 } local position = { x = 0, y = 0 }
local factionSet = {}
local entity = surface.create_entity({
name = "biter-spawner",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableUnitSpawner, 0.0)
entity.destroy()
entity = surface.create_entity({
name = "spitter-spawner",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableUnitSpawner, 0.0)
if settings.startup["NE_Blue_Spawners"].value then if settings.startup["NE_Blue_Spawners"].value then
local entity = surface.create_entity({ local entity = surface.create_entity({
name = "ne-spawner-blue", name = "ne-spawner-blue",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE_BLUE, entity, natives.evolutionTableUnitSpawner, 0.0) fileEntity(BASE_ALIGNMENT_NE_BLUE, entity, natives.evolutionTableUnitSpawner, 0.0)
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE_BLUE
entity.destroy() entity.destroy()
end end
if settings.startup["NE_Red_Spawners"].value then if settings.startup["NE_Red_Spawners"].value then
local entity = surface.create_entity({ local entity = surface.create_entity({
name = "ne-spawner-red", name = "ne-spawner-red",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE_RED, entity, natives.evolutionTableUnitSpawner, 0.0) fileEntity(BASE_ALIGNMENT_NE_RED, entity, natives.evolutionTableUnitSpawner, 0.0)
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE_RED
entity.destroy()
end
if settings.startup["NE_Green_Spawners"].value then
local entity = surface.create_entity({
name = "ne-spawner-green",
position = position
})
fileEntity(BASE_ALIGNMENT_NE_GREEN, entity, natives.evolutionTableUnitSpawner, 0.0)
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE_GREEN
entity.destroy() entity.destroy()
end end
if settings.startup["NE_Yellow_Spawners"].value then
local entity = surface.create_entity({
name = "ne-spawner-yellow",
position = position
})
fileEntity(BASE_ALIGNMENT_NE_YELLOW, entity, natives.evolutionTableUnitSpawner, 0.0)
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE_YELLOW
entity.destroy()
end
if settings.startup["NE_Pink_Spawners"].value then
local entity = surface.create_entity({
name = "ne-spawner-pink",
position = position
})
fileEntity(BASE_ALIGNMENT_NE_PINK, entity, natives.evolutionTableUnitSpawner, 0.0)
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE_PINK
entity.destroy()
end
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE
if ENABLED_BOBS_UNITS then if ENABLED_BOBS_UNITS then
entity = surface.create_entity({ entity = surface.create_entity({
name = "bob-biter-spawner", name = "bob-biter-spawner",
@@ -66,79 +122,82 @@ function ne.processNEUnitClass(natives, surface)
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableUnitSpawner, 0.0) fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableUnitSpawner, 0.0)
entity.destroy() entity.destroy()
entity = surface.create_entity({ for _,alignment in ipairs(factionSet) do
name = "bob-big-fire-worm-turret", entity = surface.create_entity({
position = position name = "bob-big-fire-worm-turret",
}) position = position
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) })
entity.destroy() fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "bob-big-poison-worm-turret", name = "bob-big-poison-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "bob-big-piercing-worm-turret", name = "bob-big-piercing-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "bob-big-electric-worm-turret", name = "bob-big-electric-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "bob-giant-worm-turret", name = "bob-giant-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "bob-behemoth-worm-turret", name = "bob-behemoth-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
entity = surface.create_entity({
name = "bob-big-explosive-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-big-explosive-worm-turret",
position = position
})
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
end
end end
entity = surface.create_entity({ for _,alignment in ipairs(factionSet) do
name = "small-worm-turret", entity = surface.create_entity({
position = position name = "small-worm-turret",
}) position = position
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) })
entity.destroy() fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "medium-worm-turret", name = "medium-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
entity = surface.create_entity({ entity = surface.create_entity({
name = "big-worm-turret", name = "big-worm-turret",
position = position position = position
}) })
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm) fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy() entity.destroy()
end
end end
return ne return ne