mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-09 13:37:02 +02:00
Update
Fixed that worms and spawners did not accurately reduce threat, scaling with their current health bonus. Fixed that worms and spawners did not accurately give the correct amount of xp, scaling with their current health bonus. Value tweaks.
This commit is contained in:
parent
28d6c3bd1d
commit
5a8fe50216
@ -234,7 +234,7 @@ angels-ore6=umber
|
||||
gui_1=First wave in
|
||||
gui_2=Wave:
|
||||
gui_3=Threat:
|
||||
tooltip_1=High threat may empower biters.\nBiter health: __1__%
|
||||
tooltip_1=High threat empowers biters, worms and spawners.\nBiter health: __1__%
|
||||
tooltip_2=gain / minute
|
||||
|
||||
[native_war]
|
||||
|
@ -4,7 +4,7 @@ local function on_research_finished(event)
|
||||
local force_name = research.force.name
|
||||
if research.name == "military" then
|
||||
if not global.flamethrower_damage then global.flamethrower_damage = {} end
|
||||
global.flamethrower_damage[force_name] = -0.75
|
||||
global.flamethrower_damage[force_name] = -0.65
|
||||
game.forces[force_name].set_turret_attack_modifier("flamethrower-turret", global.flamethrower_damage[force_name])
|
||||
game.forces[force_name].set_ammo_damage_modifier("flamethrower", global.flamethrower_damage[force_name])
|
||||
end
|
||||
|
@ -14,12 +14,18 @@ local blacklist = {
|
||||
}
|
||||
|
||||
function Public.treasure_chest(surface, position, container_name)
|
||||
local budget = 64 + math_abs(position.y) * 1.75
|
||||
budget = budget * math_random(35, 165) * 0.01
|
||||
if math_random(1,200) == 1 then
|
||||
local budget = 48 + math_abs(position.y) * 2
|
||||
budget = budget * math_random(25, 175) * 0.01
|
||||
|
||||
if math_random(1, 128) == 1 then
|
||||
budget = budget * 5
|
||||
container_name = "crash-site-chest-" .. math_random(1, 2)
|
||||
end
|
||||
if math_random(1, 256) == 1 then
|
||||
budget = budget * 10
|
||||
container_name = "crash-site-chest-" .. math_random(1, 2)
|
||||
end
|
||||
|
||||
budget = math_floor(budget) + 1
|
||||
|
||||
local item_stacks = LootRaffle.roll(budget, 8, blacklist)
|
||||
|
@ -60,6 +60,32 @@ local classes = {
|
||||
["vitality"] = "TANK",
|
||||
}
|
||||
|
||||
local xp_yield = {
|
||||
["behemoth-biter"] = 16,
|
||||
["behemoth-spitter"] = 16,
|
||||
["behemoth-worm-turret"] = 64,
|
||||
["big-biter"] = 8,
|
||||
["big-spitter"] = 8,
|
||||
["big-worm-turret"] = 48,
|
||||
["biter-spawner"] = 64,
|
||||
["character"] = 16,
|
||||
["gun-turret"] = 8,
|
||||
["laser-turret"] = 16,
|
||||
["medium-biter"] = 4,
|
||||
["medium-spitter"] = 4,
|
||||
["medium-worm-turret"] = 32,
|
||||
["small-biter"] = 1,
|
||||
["small-spitter"] = 1,
|
||||
["small-worm-turret"] = 16,
|
||||
["spitter-spawner"] = 64,
|
||||
}
|
||||
|
||||
local enemy_types = {
|
||||
["unit"] = true,
|
||||
["unit-spawner"] = true,
|
||||
["turret"] = true,
|
||||
}
|
||||
|
||||
local function level_up_effects(player)
|
||||
local position = {x = player.position.x - 0.75, y = player.position.y - 1}
|
||||
player.surface.create_entity({name = "flying-text", position = position, text = "+LVL ", color = level_up_floating_text_color})
|
||||
@ -527,26 +553,6 @@ local function on_gui_click(event)
|
||||
draw_gui(player, true)
|
||||
end
|
||||
|
||||
local xp_yield = {
|
||||
["behemoth-biter"] = 16,
|
||||
["behemoth-spitter"] = 16,
|
||||
["behemoth-worm-turret"] = 64,
|
||||
["big-biter"] = 8,
|
||||
["big-spitter"] = 8,
|
||||
["big-worm-turret"] = 48,
|
||||
["biter-spawner"] = 64,
|
||||
["character"] = 16,
|
||||
["gun-turret"] = 8,
|
||||
["laser-turret"] = 16,
|
||||
["medium-biter"] = 4,
|
||||
["medium-spitter"] = 4,
|
||||
["medium-worm-turret"] = 32,
|
||||
["small-biter"] = 1,
|
||||
["small-spitter"] = 1,
|
||||
["small-worm-turret"] = 16,
|
||||
["spitter-spawner"] = 64,
|
||||
}
|
||||
|
||||
local function train_type_cause(cause)
|
||||
local players = {}
|
||||
if cause.train.passengers then
|
||||
@ -612,7 +618,7 @@ local function on_entity_died(event)
|
||||
|
||||
--Grant modified XP for health boosted units
|
||||
if global.biter_health_boost then
|
||||
if event.entity.type == "unit" then
|
||||
if enemy_types[event.entity.type] then
|
||||
for _, player in pairs(players) do
|
||||
if xp_yield[event.entity.name] then
|
||||
gain_xp(player, xp_yield[event.entity.name] * global.biter_health_boost)
|
||||
|
@ -172,9 +172,8 @@ local function on_entity_died(event)
|
||||
if entity.force.index == 2 then
|
||||
if entity.health then
|
||||
if threat_values[entity.name] then
|
||||
wave_defense_table.threat = wave_defense_table.threat - threat_values[entity.name]
|
||||
end
|
||||
|
||||
wave_defense_table.threat = math.round(wave_defense_table.threat - threat_values[entity.name] * global.biter_health_boost, 2)
|
||||
end
|
||||
spawn_unit_spawner_inhabitants(wave_defense_table, entity)
|
||||
end
|
||||
end
|
||||
|
@ -1,17 +1,17 @@
|
||||
local t = {
|
||||
["biter-spawner"] = 128,
|
||||
["spitter-spawner"] = 128,
|
||||
["behemoth-biter"] = 36,
|
||||
["behemoth-spitter"] = 36,
|
||||
["big-biter"] = 12,
|
||||
["big-spitter"] = 12,
|
||||
["behemoth-biter"] = 64,
|
||||
["behemoth-spitter"] = 64,
|
||||
["big-biter"] = 16,
|
||||
["big-spitter"] = 16,
|
||||
["medium-biter"] = 4,
|
||||
["medium-spitter"] = 4,
|
||||
["small-biter"] = 1,
|
||||
["small-spitter"] = 1,
|
||||
["small-worm-turret"] = 16,
|
||||
["medium-worm-turret"] = 32,
|
||||
["big-worm-turret"] = 48,
|
||||
["behemoth-worm-turret"] = 64,
|
||||
["big-worm-turret"] = 64,
|
||||
["behemoth-worm-turret"] = 128,
|
||||
}
|
||||
return t
|
Loading…
x
Reference in New Issue
Block a user