1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-25 21:29:06 +02:00
This commit is contained in:
MewMew 2018-11-20 22:30:08 +01:00
parent 0195279c31
commit 9a72b53c40
4 changed files with 93 additions and 98 deletions

View File

@ -61,7 +61,7 @@ local function get_biter_initial_pool()
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.25 then
if game.forces.enemy.evolution_factor < 0.2 then
biter_pool = {
{name = "small-biter", threat = threat_values.small_biter, weight = 10},
{name = "medium-biter", threat = threat_values.medium_biter, weight = 2},
@ -70,6 +70,16 @@ local function get_biter_initial_pool()
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.3 then
biter_pool = {
{name = "small-biter", threat = threat_values.small_biter, weight = 18},
{name = "medium-biter", threat = threat_values.medium_biter, weight = 6},
{name = "small-spitter", threat = threat_values.small_spitter, weight = 8},
{name = "medium-spitter", threat = threat_values.medium_spitter, weight = 3},
{name = "big-biter", threat = threat_values.big_biter, weight = 1}
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.4 then
biter_pool = {
{name = "small-biter", threat = threat_values.small_biter, weight = 2},
@ -81,7 +91,7 @@ local function get_biter_initial_pool()
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.6 then
if game.forces.enemy.evolution_factor < 0.5 then
biter_pool = {
{name = "small-biter", threat = threat_values.small_biter, weight = 2},
{name = "medium-biter", threat = threat_values.medium_biter, weight = 4},
@ -92,17 +102,46 @@ local function get_biter_initial_pool()
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.6 then
biter_pool = {
{name = "medium-biter", threat = threat_values.medium_biter, weight = 4},
{name = "big-biter", threat = threat_values.big_biter, weight = 8},
{name = "medium-spitter", threat = threat_values.medium_spitter, weight = 2},
{name = "big-spitter", threat = threat_values.big_spitter, weight = 4}
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.7 then
biter_pool = {
{name = "behemoth-biter", threat = threat_values.small_biter, weight = 2},
{name = "medium-biter", threat = threat_values.medium_biter, weight = 12},
{name = "big-biter", threat = threat_values.big_biter, weight = 20},
{name = "behemoth-spitter", threat = threat_values.small_spitter, weight = 1},
{name = "medium-spitter", threat = threat_values.medium_spitter, weight = 6},
{name = "big-spitter", threat = threat_values.big_spitter, weight = 10}
}
return biter_pool
end
if game.forces.enemy.evolution_factor < 0.8 then
biter_pool = {
{name = "behemoth-biter", threat = threat_values.small_biter, weight = 2},
{name = "medium-biter", threat = threat_values.medium_biter, weight = 6},
{name = "medium-biter", threat = threat_values.medium_biter, weight = 4},
{name = "big-biter", threat = threat_values.big_biter, weight = 10},
{name = "behemoth-spitter", threat = threat_values.small_spitter, weight = 1},
{name = "medium-spitter", threat = threat_values.medium_spitter, weight = 3},
{name = "medium-spitter", threat = threat_values.medium_spitter, weight = 2},
{name = "big-spitter", threat = threat_values.big_spitter, weight = 5}
}
return biter_pool
end
if game.forces.enemy.evolution_factor <= 0.9 then
biter_pool = {
{name = "big-biter", threat = threat_values.big_biter, weight = 12},
{name = "behemoth-biter", threat = threat_values.behemoth_biter, weight = 2},
{name = "big-spitter", threat = threat_values.big_spitter, weight = 6},
{name = "behemoth-spitter", threat = threat_values.behemoth_spitter, weight = 1}
}
return biter_pool
end
if game.forces.enemy.evolution_factor <= 1 then
biter_pool = {
{name = "big-biter", threat = threat_values.big_biter, weight = 4},
@ -161,13 +200,17 @@ local function biter_attack_wave()
if game.forces.enemy.evolution_factor > 0.98 then
if not global.endgame_modifier then
global.endgame_modifier = 0.01
global.endgame_modifier = 0.005
game.print("Endgame enemy evolution reached. Biter damage is rising...", {r = 0.7, g = 0.1, b = 0.1})
else
global.endgame_modifier = global.endgame_modifier + 0.01
global.endgame_modifier = global.endgame_modifier + 0.005
end
end
if global.wave_count > 100 then
surface.set_multi_command{command={type=defines.command.attack , target=global.market, distraction=defines.distraction.by_enemy}, unit_count=999, force="enemy", unit_search_distance=400}
end
local spawn_x = 242
local group_coords = {
{spawn = {x = spawn_x, y = -160}, target = {x = -32, y = -64}},
@ -184,15 +227,15 @@ local function biter_attack_wave()
}
group_coords = shuffle(group_coords)
local max_group_size = 25 * math.ceil(global.wave_count / 100)
local max_group_size = 25 + math.ceil(global.wave_count / 10)
if max_group_size > 300 then max_group_size = 300 end
if global.wave_count < 35 then max_group_size = 200 end
if global.wave_count <= 50 then max_group_size = 300 end
for i = 1, #group_coords, 1 do
local biter_squad = spawn_biter_attack_group(group_coords[i].spawn, max_group_size)
if biter_squad == false then return end
if global.wave_count < 35 then
if global.wave_count <= 50 then
biter_squad.set_command({type=defines.command.attack , target=global.market, distraction=defines.distraction.by_enemy})
else
if math_random(1,6) == 1 then
@ -215,52 +258,57 @@ local function refresh_market_offers()
str1 = str1 .. " Coins."
local str2 = "Laser Turret Slot for " .. tostring(global.entity_limits["laser-turret"].limit * global.entity_limits["laser-turret"].slot_price)
str2 = str2 .. " Coins."
local str3 = "Landmine Slot for " .. tostring(global.entity_limits["land-mine"].limit * global.entity_limits["land-mine"].slot_price)
local str3 = "Flamethrower Turret Slot for " .. tostring(global.entity_limits["flamethrower-turret"].limit * global.entity_limits["flamethrower-turret"].slot_price)
str3 = str3 .. " Coins."
local str4 = "Landmine Slot for " .. tostring(global.entity_limits["land-mine"].limit * global.entity_limits["land-mine"].slot_price)
str4 = str4 .. " Coins."
local market_items = {
{price = {}, offer = {type = 'nothing', effect_description = str1}},
{price = {}, offer = {type = 'nothing', effect_description = str2}},
{price = {}, offer = {type = 'nothing', effect_description = str3}},
{price = {}, offer = {type = 'nothing', effect_description = str4}},
{price = {{"coin", 3}}, offer = {type = 'give-item', item = "raw-fish", count = 1}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'raw-wood', count = 4}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'raw-wood', count = 8}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'explosives', count = 4}},
{price = {{"coin", 10}}, offer = {type = 'give-item', item = 'grenade', count = 1}},
{price = {{"coin", 8}}, offer = {type = 'give-item', item = 'grenade', count = 1}},
{price = {{"coin", 60}}, offer = {type = 'give-item', item = 'cluster-grenade', count = 1}},
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'land-mine', count = 1}},
{price = {{"coin", 2}}, offer = {type = 'give-item', item = 'land-mine', count = 1}},
{price = {{"coin", 80}}, offer = {type = 'give-item', item = 'car', count = 1}},
{price = {{"coin", 650}}, offer = {type = 'give-item', item = 'tank', count = 1}},
{price = {{"coin", 800}}, offer = {type = 'give-item', item = 'tank', count = 1}},
{price = {{"coin", 6}}, offer = {type = 'give-item', item = 'cannon-shell', count = 1}},
{price = {{"coin", 12}}, offer = {type = 'give-item', item = 'explosive-cannon-shell', count = 1}},
{price = {{"coin", 75}}, offer = {type = 'give-item', item = 'gun-turret', count = 1}},
{price = {{"coin", 750}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}},
{price = {{"coin", 50}}, offer = {type = 'give-item', item = 'gun-turret', count = 1}},
{price = {{"coin", 300}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'firearm-magazine', count = 1}},
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine', count = 1}},
{price = {{"coin", 3}}, offer = {type = 'give-item', item = 'shotgun-shell', count = 1}},
{price = {{"coin", 7}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 1}},
{price = {{"coin", 2}}, offer = {type = 'give-item', item = 'shotgun-shell', count = 1}},
{price = {{"coin", 6}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 1}},
{price = {{"coin", 50}}, offer = {type = 'give-item', item = "submachine-gun", count = 1}},
{price = {{"coin", 250}}, offer = {type = 'give-item', item = 'combat-shotgun', count = 1}},
{price = {{"coin", 500}}, offer = {type = 'give-item', item = 'flamethrower', count = 1}},
{price = {{"coin", 35}}, offer = {type = 'give-item', item = 'flamethrower-ammo', count = 1}},
{price = {{"coin", 25}}, offer = {type = 'give-item', item = 'flamethrower-ammo', count = 1}},
{price = {{"coin", 125}}, offer = {type = 'give-item', item = 'rocket-launcher', count = 1}},
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'rocket', count = 1}},
{price = {{"coin", 8}}, offer = {type = 'give-item', item = 'explosive-rocket', count = 1}},
{price = {{"coin", 1000}}, offer = {type = 'give-item', item = 'atomic-bomb', count = 1}},
{price = {{"coin", 150}}, offer = {type = 'give-item', item = 'railgun', count = 1}},
{price = {{"coin", 750}}, offer = {type = 'give-item', item = 'atomic-bomb', count = 1}},
{price = {{"coin", 90}}, offer = {type = 'give-item', item = 'railgun', count = 1}},
{price = {{"coin", 5}}, offer = {type = 'give-item', item = 'railgun-dart', count = 1}},
{price = {{"coin", 40}}, offer = {type = 'give-item', item = 'poison-capsule', count = 1}},
{price = {{"coin", 30}}, offer = {type = 'give-item', item = 'poison-capsule', count = 1}},
{price = {{"coin", 8}}, offer = {type = 'give-item', item = 'defender-capsule', count = 1}},
{price = {{"coin", 10}}, offer = {type = 'give-item', item = 'light-armor', count = 1}},
{price = {{"coin", 150}}, offer = {type = 'give-item', item = 'heavy-armor', count = 1}},
{price = {{"coin", 350}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
{price = {{"coin", 1500}}, offer = {type = 'give-item', item = 'power-armor', count = 1}},
{price = {{"coin", 2500}}, offer = {type = 'give-item', item = 'fusion-reactor-equipment', count = 1}},
{price = {{"coin", 10000}}, offer = {type = 'give-item', item = 'power-armor-mk2', count = 1}},
{price = {{"coin", 1750}}, offer = {type = 'give-item', item = 'fusion-reactor-equipment', count = 1}},
{price = {{"coin", 100}}, offer = {type = 'give-item', item = 'battery-equipment', count = 1}},
{price = {{"coin", 75}}, offer = {type = 'give-item', item = 'solar-panel-equipment', count = 1}},
{price = {{"coin", 200}}, offer = {type = 'give-item', item = 'energy-shield-equipment', count = 1}},
{price = {{"coin", 50}}, offer = {type = 'give-item', item = 'solar-panel-equipment', count = 1}},
{price = {{"coin", 200}}, offer = {type = 'give-item', item = 'energy-shield-equipment', count = 1}},
{price = {{"coin", 750}}, offer = {type = 'give-item', item = 'personal-laser-defense-equipment', count = 1}},
{price = {{"coin", 175}}, offer = {type = 'give-item', item = 'exoskeleton-equipment', count = 1}},
{price = {{"coin", 125}}, offer = {type = 'give-item', item = 'night-vision-equipment', count = 1}},
{price = {{"coin", 500}}, offer = {type = 'give-item', item = 'belt-immunity-equipment', count = 1}},
{price = {{"coin", 150}}, offer = {type = 'give-item', item = 'belt-immunity-equipment', count = 1}},
{price = {{"coin", 250}}, offer = {type = 'give-item', item = 'personal-roboport-equipment', count = 1}},
{price = {{"coin", 40}}, offer = {type = 'give-item', item = 'construction-robot', count = 1}}
}
@ -462,7 +510,7 @@ local function on_entity_died(event)
return
end
if event.entity == global.market then
global.market = nil
global.market_age = game.tick
@ -506,8 +554,6 @@ local function on_entity_damaged(event)
if event.cause.force.name == "enemy" then return end
event.entity.health = event.entity.health + event.final_damage_amount
end
end
@ -518,10 +564,6 @@ local function on_player_joined_game(event)
local surface = game.surfaces[1]
game.map_settings.enemy_expansion.enabled = false
--game.map_settings.enemy_evolution.destroy_factor = 0.008
--game.map_settings.enemy_evolution.time_factor = 0.00005
--game.map_settings.enemy_evolution.pollution_factor = 0.000015
game.map_settings.enemy_evolution.destroy_factor = 0
game.map_settings.enemy_evolution.time_factor = 0
game.map_settings.enemy_evolution.pollution_factor = 0
@ -537,8 +579,8 @@ local function on_player_joined_game(event)
global.entity_limits = {
["gun-turret"] = {placed = 1, limit = 1, str = "gun turret", slot_price = 100},
["laser-turret"] = {placed = 0, limit = 1, str = "laser turret", slot_price = 350},
["flamethrower-turret"] = {placed = 0, limit = 0, str = "flamethrower turret", slot_price = 100},
["laser-turret"] = {placed = 0, limit = 1, str = "laser turret", slot_price = 300},
["flamethrower-turret"] = {placed = 0, limit = 1, str = "flamethrower turret", slot_price = 25000},
["land-mine"] = {placed = 0, limit = 5, str = "landmine", slot_price = 1}
}
@ -549,15 +591,13 @@ local function on_player_joined_game(event)
local pos = surface.find_non_colliding_position("gun-turret",{4, 1}, 50, 1)
local turret = surface.create_entity({name = "gun-turret", position = pos, force = "player"})
turret.insert({name = "firearm-magazine", count = 32})
turret.insert({name = "firearm-magazine", count = 64})
local radius = 256
game.forces.player.chart(game.players[1].surface,{{x = -1 * radius, y = -1 * radius}, {x = radius, y = radius}})
surface.create_entity({name = "electric-beam", position = {160, -95}, source = {160, -95}, target = {160,96}})
global.fish_defense_init_done = true
end
@ -622,8 +662,9 @@ local function on_chunk_generated(event)
map_functions.draw_smoothed_out_ore_circle({x = -64, y = -64}, "copper-ore", surface, 15, 2500)
map_functions.draw_smoothed_out_ore_circle({x = -64, y = -32}, "iron-ore", surface, 15, 2500)
map_functions.draw_smoothed_out_ore_circle({x = -64, y = 32}, "coal", surface, 15, 1500)
map_functions.draw_smoothed_out_ore_circle({x = -64, y = 64}, "stone", surface, 15, 1500)
map_functions.draw_noise_tile_circle({x = -32, y = 0}, "water", surface, 16)
map_functions.draw_smoothed_out_ore_circle({x = -64, y = 64}, "stone", surface, 15, 1500)
map_functions.draw_noise_tile_circle({x = -32, y = 0}, "water", surface, 16)
map_functions.draw_oil_circle({x = -64, y = 0}, "crude-oil", surface, 8, 200000)
global.spawn_ores_generated = true
end
end
@ -710,7 +751,6 @@ local function on_chunk_generated(event)
end
end
surface.regenerate_decorative(decorative_names, {{x=math.floor(event.area.left_top.x/32),y=math.floor(event.area.left_top.y/32)}})
end
local function on_built_entity(event)
@ -742,8 +782,7 @@ end
local function on_robot_built_entity(event)
local entity = event.created_entity
if global.entity_limits[entity.name] then
local surface = entity.surface
local surface = entity.surface
if global.entity_limits[entity.name].placed < global.entity_limits[entity.name].limit then
global.entity_limits[entity.name].placed = global.entity_limits[entity.name].placed + 1
surface.create_entity(
@ -802,8 +841,6 @@ local function on_robot_mined_entity(event)
end
end
local function on_market_item_purchased(event)
local player = game.players[event.player_index]
local market = event.market
@ -814,9 +851,10 @@ local function on_market_item_purchased(event)
local slot_upgrade_offers = {
[1] = {"gun-turret", "gun turret"},
[2] = {"laser-turret", "gun turret"},
[3] = {"land-mine", "land mine"}
[3] = {"flamethrower-turret", "flamethrower turret"},
[4] = {"land-mine", "land mine"}
}
for x = 1, 3, 1 do
for x = 1, 4, 1 do
if offer_index == x then
local price = global.entity_limits[slot_upgrade_offers[x][1]].limit * global.entity_limits[slot_upgrade_offers[x][1]].slot_price
local coins_removed = player.remove_item({name = "coin", count = price})
@ -844,4 +882,4 @@ event.add(defines.events.on_robot_mined_entity, on_robot_mined_entity)
event.add(defines.events.on_entity_died, on_entity_died)
event.add(defines.events.on_entity_damaged, on_entity_damaged)
event.add(defines.events.on_chunk_generated, on_chunk_generated)
event.add(defines.events.on_player_joined_game, on_player_joined_game)
event.add(defines.events.on_player_joined_game, on_player_joined_game)

View File

@ -1,3 +1,7 @@
0.11
added spawn oil
wave adjustments
0.10
biter waves complete rework
turret slots can now be purchased in the market

View File

@ -1,47 +0,0 @@
local items = {
{price = {}, offer = {type = 'nothing', effect_description = 'Buy Turret Slot for 100 Coins.'}},
{price = {}, offer = {type = 'nothing', effect_description = 'Buy Laser Turret Slot'}},
{price = {}, offer = {type = 'nothing', effect_description = 'Buy Mine Slot'}},
{price = {{"coin", 3}}, offer = {type = 'give-item', item = "raw-fish", count = 1}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'raw-wood', count = 4}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'explosives', count = 4}},
{price = {{"coin", 10}}, offer = {type = 'give-item', item = 'grenade', count = 1}},
{price = {{"coin", 60}}, offer = {type = 'give-item', item = 'cluster-grenade', count = 1}},
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'land-mine', count = 1}},
{price = {{"coin", 80}}, offer = {type = 'give-item', item = 'car', count = 1}},
{price = {{"coin", 650}}, offer = {type = 'give-item', item = 'tank', count = 1}},
{price = {{"coin", 6}}, offer = {type = 'give-item', item = 'cannon-shell', count = 1}},
{price = {{"coin", 12}}, offer = {type = 'give-item', item = 'explosive-cannon-shell', count = 1}},
{price = {{"coin", 75}}, offer = {type = 'give-item', item = 'gun-turret', count = 1}},
{price = {{"coin", 750}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}},
{price = {{"coin", 1}}, offer = {type = 'give-item', item = 'firearm-magazine', count = 1}},
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine', count = 1}},
{price = {{"coin", 3}}, offer = {type = 'give-item', item = 'shotgun-shell', count = 1}},
{price = {{"coin", 7}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 1}},
{price = {{"coin", 50}}, offer = {type = 'give-item', item = "submachine-gun", count = 1}},
{price = {{"coin", 250}}, offer = {type = 'give-item', item = 'combat-shotgun', count = 1}},
{price = {{"coin", 500}}, offer = {type = 'give-item', item = 'flamethrower', count = 1}},
{price = {{"coin", 35}}, offer = {type = 'give-item', item = 'flamethrower-ammo', count = 1}},
{price = {{"coin", 125}}, offer = {type = 'give-item', item = 'rocket-launcher', count = 1}},
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'rocket', count = 1}},
{price = {{"coin", 8}}, offer = {type = 'give-item', item = 'explosive-rocket', count = 1}},
{price = {{"coin", 1000}}, offer = {type = 'give-item', item = 'atomic-bomb', count = 1}},
{price = {{"coin", 150}}, offer = {type = 'give-item', item = 'railgun', count = 1}},
{price = {{"coin", 5}}, offer = {type = 'give-item', item = 'railgun-dart', count = 1}},
{price = {{"coin", 40}}, offer = {type = 'give-item', item = 'poison-capsule', count = 1}},
{price = {{"coin", 8}}, offer = {type = 'give-item', item = 'defender-capsule', count = 1}},
{price = {{"coin", 10}}, offer = {type = 'give-item', item = 'light-armor', count = 1}},
{price = {{"coin", 150}}, offer = {type = 'give-item', item = 'heavy-armor', count = 1}},
{price = {{"coin", 350}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
{price = {{"coin", 1500}}, offer = {type = 'give-item', item = 'power-armor', count = 1}},
{price = {{"coin", 2500}}, offer = {type = 'give-item', item = 'fusion-reactor-equipment', count = 1}},
{price = {{"coin", 100}}, offer = {type = 'give-item', item = 'battery-equipment', count = 1}},
{price = {{"coin", 75}}, offer = {type = 'give-item', item = 'solar-panel-equipment', count = 1}},
{price = {{"coin", 200}}, offer = {type = 'give-item', item = 'energy-shield-equipment', count = 1}},
{price = {{"coin", 175}}, offer = {type = 'give-item', item = 'exoskeleton-equipment', count = 1}},
{price = {{"coin", 125}}, offer = {type = 'give-item', item = 'night-vision-equipment', count = 1}},
{price = {{"coin", 500}}, offer = {type = 'give-item', item = 'belt-immunity-equipment', count = 1}},
{price = {{"coin", 250}}, offer = {type = 'give-item', item = 'personal-roboport-equipment', count = 1}},
{price = {{"coin", 40}}, offer = {type = 'give-item', item = 'construction-robot', count = 1}}
}
return items

View File

@ -6,7 +6,7 @@ function cheat_mode()
game.players[1].insert({name="personal-laser-defense-equipment", count=8})
game.players[1].insert({name="rocket-launcher"})
game.players[1].insert({name="explosive-rocket", count=200})
game.players[1].insert({name="coin", count = 1000})
game.players[1].insert({name="coin", count = 100000})
game.players[1].insert({name="loader"})
game.players[1].insert({name="fast-loader"})
game.players[1].insert({name="express-loader"})