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")
global.version = constants.VERSION_57
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")
global.version = constants.VERSION_66
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.32")
global.version = constants.VERSION_67
end
return starting ~= global.version, natives
+22 -2
View File
@@ -21,7 +21,7 @@ constants.VERSION_41 = 41
constants.VERSION_44 = 44
constants.VERSION_51 = 51
constants.VERSION_57 = 57
constants.VERSION_66 = 66
constants.VERSION_67 = 67
-- misc
@@ -148,6 +148,11 @@ constants.BASE_ALIGNMENT_DEADZONE = 20
constants.BASE_ALIGNMENT_NE = 21
constants.BASE_ALIGNMENT_BOBS = 22
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_PROCESS_INTERVAL = constants.TICKS_A_SECOND * 2
@@ -212,6 +217,22 @@ end
if constants.ENABLED_NE_UNITS then
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
-- ai retreat
@@ -478,7 +499,6 @@ constants.ENERGY_THIEF_WORM_VARIATIONS = wormVariations
constants.ENERGY_THIEF_UNIT_TIERS = unitTiers
constants.ENERGY_THIEF_UNIT_VARIATIONS = unitVariations
constants.LASER_NEST_TIERS = nestTiers
constants.LASER_NEST_VARIATIONS = nestVariations
constants.LASER_WORM_TIERS = wormTiers
+70 -11
View File
@@ -10,6 +10,12 @@ local EVOLUTION_INCREMENTS = constants.EVOLUTION_INCREMENTS
local BASE_ALIGNMENT_NE = constants.BASE_ALIGNMENT_NE
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
local mFloor = math.floor
@@ -34,12 +40,29 @@ end
function ne.processNEUnitClass(natives, surface)
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
local entity = surface.create_entity({
name = "ne-spawner-blue",
position = position
})
fileEntity(BASE_ALIGNMENT_NE_BLUE, entity, natives.evolutionTableUnitSpawner, 0.0)
factionSet[#factionSet+1] = BASE_ALIGNMENT_NE_BLUE
entity.destroy()
end
@@ -49,9 +72,42 @@ function ne.processNEUnitClass(natives, surface)
position = position
})
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()
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
entity = surface.create_entity({
@@ -68,77 +124,80 @@ function ne.processNEUnitClass(natives, surface)
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableUnitSpawner, 0.0)
entity.destroy()
for _,alignment in ipairs(factionSet) do
entity = surface.create_entity({
name = "bob-big-fire-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-big-poison-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-big-piercing-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-big-electric-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-giant-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-behemoth-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "bob-big-explosive-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
end
end
for _,alignment in ipairs(factionSet) do
entity = surface.create_entity({
name = "small-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "medium-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
entity = surface.create_entity({
name = "big-worm-turret",
position = position
})
fileEntity(BASE_ALIGNMENT_NE, entity, natives.evolutionTableWorm)
fileEntity(alignment, entity, natives.evolutionTableWorm)
entity.destroy()
end
end
return ne