1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-14 02:34:09 +02:00

minor fixes

This commit is contained in:
Gerkiz 2021-11-23 20:28:23 +01:00
parent 85438bb23b
commit 18d126463f
14 changed files with 254 additions and 120 deletions

View File

@ -287,7 +287,7 @@ local fortress_functions = {
get_actor(event, '[Collapse]', 'has enabled the collapse function. Collapse will occur after wave 100!')
else
Module.collapse_grace = false
get_actor(event, '[Collapse]', 'has disabled the collapse function. You must reach zone 2 for collapse to occur!')
get_actor(event, '[Collapse]', 'has disabled the collapse function. You must breach the first zone for collapse to occur!')
end
end,
['comfy_panel_spill_items_to_surface'] = function(event)
@ -438,7 +438,13 @@ local function build_config_gui(data)
if not poll_table[player.index] then
switch_state = 'left'
end
add_switch(scroll_pane, switch_state, 'comfy_panel_poll_no_notify_toggle', 'Notify on polls', 'Receive a message when new polls are created and popup the poll.')
add_switch(
scroll_pane,
switch_state,
'comfy_panel_poll_no_notify_toggle',
'Notify on polls',
'Receive a message when new polls are created and popup the poll.'
)
scroll_pane.add({type = 'line'})
end
@ -487,7 +493,13 @@ local function build_config_gui(data)
if bottom_frame and bottom_frame.portable then
switch_state = 'left'
end
add_switch(scroll_pane, switch_state, 'comfy_panel_portable_button', 'Position - portable', 'Toggle to select if you want the bottom button to be portable or not.')
add_switch(
scroll_pane,
switch_state,
'comfy_panel_portable_button',
'Position - portable',
'Toggle to select if you want the bottom button to be portable or not.'
)
scroll_pane.add({type = 'line'})
end
@ -623,7 +635,13 @@ local function build_config_gui(data)
if full.fullness_enabled then
switch_state = 'left'
end
add_switch(scroll_pane, switch_state, 'comfy_panel_disable_fullness', 'Inventory Fullness', 'Left = Enables inventory fullness.\nRight = Disables inventory fullness.')
add_switch(
scroll_pane,
switch_state,
'comfy_panel_disable_fullness',
'Inventory Fullness',
'On = Enables inventory fullness.\nOff = Disables inventory fullness.'
)
scroll_pane.add({type = 'line'})
@ -638,7 +656,7 @@ local function build_config_gui(data)
switch_state,
'comfy_panel_offline_players',
'Offline Players',
'Left = Enables offline player inventory drop.\nRight = Disables offline player inventory drop.'
'On = Enables offline player inventory drop.\nOff = Disables offline player inventory drop.'
)
scroll_pane.add({type = 'line'})
@ -652,7 +670,7 @@ local function build_config_gui(data)
switch_state,
'comfy_panel_collapse_grace',
'Collapse',
'Left = Enables collapse after wave 100.\nRight = Disables collapse - you must reach zone 2 for collapse to occur.'
'On = Enables collapse after wave 100.\nOff = Disables collapse - you must breach the first zone for collapse to occur.'
)
scroll_pane.add({type = 'line'})
@ -666,7 +684,7 @@ local function build_config_gui(data)
switch_state,
'comfy_panel_spill_items_to_surface',
'Spill Ores',
'Left = Enables ore spillage to surface when mining.\nRight = Disables ore spillage to surface when mining.'
'On = Enables ore spillage to surface when mining.\nOff = Disables ore spillage to surface when mining.'
)
scroll_pane.add({type = 'line'})
@ -674,7 +692,13 @@ local function build_config_gui(data)
if Module.void_or_tile then
switch_state = 'left'
end
add_switch(scroll_pane, switch_state, 'comfy_panel_void_or_tile', 'Void Tiles', 'Left = Changes the tiles to out-of-map.\nRight = Changes the tiles to lab-dark-2')
add_switch(
scroll_pane,
switch_state,
'comfy_panel_void_or_tile',
'Void Tiles',
'On = Changes the tiles to out-of-map.\nOff = Changes the tiles to lab-dark-2'
)
scroll_pane.add({type = 'line'})
switch_state = 'right'
@ -686,7 +710,7 @@ local function build_config_gui(data)
switch_state,
'comfy_panel_trusted_only_car_tanks',
'Market Purchase',
'Left = Allows only trusted people to buy car/tanks.\nRight = Allows everyone to buy car/tanks.'
'On = Allows only trusted people to buy car/tanks.\nOff = Allows everyone to buy car/tanks.'
)
scroll_pane.add({type = 'line'})
@ -694,7 +718,13 @@ local function build_config_gui(data)
if Module.allow_decon then
switch_state = 'left'
end
add_switch(scroll_pane, switch_state, 'comfy_panel_allow_decon', 'Deconstruct', 'Left = Allows decon on car/tanks/trains.\nRight = Disables decon on car/tanks/trains.')
add_switch(
scroll_pane,
switch_state,
'comfy_panel_allow_decon',
'Deconstruct',
'On = Allows decon on car/tanks/trains.\nOff = Disables decon on car/tanks/trains.'
)
scroll_pane.add({type = 'line'})
end
end

View File

@ -31,6 +31,29 @@ local scrap = {
[15] = true
}
local clear_breach_text_and_render = function()
local beam1 = WPT.get('zone1_beam1')
if beam1 and beam1.valid then
beam1.destroy()
end
local beam2 = WPT.get('zone1_beam2')
if beam2 and beam2.valid then
beam2.destroy()
end
local zone1_text1 = WPT.get('zone1_text1')
if zone1_text1 then
rendering.set_text(zone1_text1, 'Collapse has started!')
end
local zone1_text2 = WPT.get('zone1_text2')
if zone1_text2 then
rendering.set_text(zone1_text2, 'Collapse has started!')
end
local zone1_text3 = WPT.get('zone1_text3')
if zone1_text3 then
rendering.set_text(zone1_text3, 'Collapse has started!')
end
end
local collapse_message =
Token.register(
function(data)
@ -243,6 +266,7 @@ local function distance(player)
end
if not Collapse.start_now() then
clear_breach_text_and_render()
Collapse.start_now(true)
local data = {
position = Collapse.get_position()

View File

@ -203,7 +203,7 @@ local function do_magic_crafters()
if entity.get_output_inventory().can_insert({name = data.item, count = fcount}) then
entity.get_output_inventory().insert {name = data.item, count = fcount}
entity.products_finished = entity.products_finished + fcount
data.last_tick = tick - (count - fcount) / rate
data.last_tick = round(tick - (count - fcount) / rate)
end
end
end
@ -366,9 +366,9 @@ local function add_magic_crafter_output(entity, output, distance)
local fluidbox_index = output.fluidbox_index
local data = {
entity = entity,
last_tick = game.tick,
base_rate = rate,
rate = rate,
last_tick = round(game.tick),
base_rate = round(rate, 8),
rate = round(rate, 8),
item = output.item,
fluidbox_index = fluidbox_index
}
@ -929,17 +929,17 @@ function Public.set_difficulty()
end
if Diff.name == "I'm too young to die" then
wave_defense_table.wave_interval = 3600 - player_count * 60
wave_defense_table.wave_interval = 4600 - player_count * 60
if wave_defense_table.wave_interval < 1800 or threat_check then
wave_defense_table.wave_interval = 1800
end
elseif Diff.name == 'Hurt me plenty' then
wave_defense_table.wave_interval = 2600 - player_count * 60
wave_defense_table.wave_interval = 3600 - player_count * 60
if wave_defense_table.wave_interval < 1500 or threat_check then
wave_defense_table.wave_interval = 1500
end
elseif Diff.name == 'Ultra-violence' then
wave_defense_table.wave_interval = 1600 - player_count * 60
wave_defense_table.wave_interval = 2600 - player_count * 60
if wave_defense_table.wave_interval < 1100 or threat_check then
wave_defense_table.wave_interval = 1100
end
@ -1128,8 +1128,8 @@ function Public.boost_difficulty()
WPT.set('bonus_xp_on_join', 500)
WD.set('next_wave', game.tick + 3600 * 15)
WPT.set('spidertron_unlocked_at_zone', 10)
WD.set_normal_unit_current_health(1.2)
WD.set_normal_unit_current_per_wave(0.5)
WD.set_normal_unit_current_health(1.0)
WD.set_normal_unit_current_per_wave(0.3)
WD.set_boss_unit_current_health(2)
WD.set_boss_unit_current_per_wave(3)
WPT.set('difficulty_set', true)
@ -1146,7 +1146,7 @@ function Public.boost_difficulty()
WD.set('next_wave', game.tick + 3600 * 8)
WPT.set('spidertron_unlocked_at_zone', 8)
WD.set_normal_unit_current_health(1.6)
WD.set_normal_unit_current_per_wave(0.8)
WD.set_normal_unit_current_per_wave(0.5)
WD.set_boss_unit_current_health(3)
WD.set_boss_unit_current_per_wave(5)
WPT.set('difficulty_set', true)

View File

@ -4,6 +4,8 @@ local ICT = require 'maps.mountain_fortress_v3.ic.table'
local Functions = require 'maps.mountain_fortress_v3.ic.functions'
local Gui = require 'maps.mountain_fortress_v3.ic.gui'
local round = math.round
local function validate_player(player)
if not player then
return false
@ -142,7 +144,7 @@ local function draw_minimap(player, surface, position)
name = 'minimap_frame',
position = position,
surface_index = surface.index,
zoom = player_data.zoom,
zoom = round(player_data.zoom),
tooltip = 'LMB: Increase zoom level.\nRMB: Decrease zoom level.\nMMB: Toggle camera size.'
}
)
@ -197,7 +199,7 @@ function Public.toggle_minimap(event)
if player_data.zoom < 0.07 then
player_data.zoom = 0.07
end
element.zoom = player_data.zoom
element.zoom = round(player_data.zoom)
return
end
if event.button == defines.mouse_button_type.left then
@ -205,7 +207,7 @@ function Public.toggle_minimap(event)
if player_data.zoom > 2 then
player_data.zoom = 2
end
element.zoom = player_data.zoom
element.zoom = round(player_data.zoom)
return
end
if event.button == defines.mouse_button_type.middle then

View File

@ -16,10 +16,10 @@ Public.level_width = WPT.level_width
local worm_level_modifier = 0.19
local start_ground_tiles = {
'hazard-concrete-left',
'hazard-concrete-right',
'brown-refined-concrete',
'concrete'
'dirt-1',
'grass-1',
'grass-2',
'dirt-2'
}
local wagon_raffle = {
@ -315,39 +315,54 @@ local function wall(p, data)
if not alert_zone_1 then
local x_min = -WPT.level_width / 2
local x_max = WPT.level_width / 2
surface.create_entity({name = 'electric-beam', position = {x_min, p.y}, source = {x_min, p.y}, target = {x_max, p.y}})
surface.create_entity({name = 'electric-beam', position = {x_min, p.y}, source = {x_min, p.y}, target = {x_max, p.y}})
WPT.set(
'zone1_beam1',
surface.create_entity({name = 'electric-beam', position = {x_min, p.y}, source = {x_min, p.y}, target = {x_max, p.y}})
)
WPT.set(
'zone1_beam2',
surface.create_entity({name = 'electric-beam', position = {x_min, p.y}, source = {x_min, p.y}, target = {x_max, p.y}})
)
WPT.set('alert_zone_1', true)
rendering.draw_text {
text = 'Breaching the far side wall will start collapse.',
surface = surface,
target = {0, p.y + 35},
color = {r = 0.98, g = 0.66, b = 0.22},
scale = 8,
font = 'heading-1',
alignment = 'center',
scale_with_zoom = false
}
rendering.draw_text {
text = 'Breaching the far side wall will start collapse',
surface = surface,
target = {-180, p.y + 35},
color = {r = 0.98, g = 0.66, b = 0.22},
scale = 8,
font = 'heading-1',
alignment = 'center',
scale_with_zoom = false
}
rendering.draw_text {
text = 'Breaching the far side wall will start collapse',
surface = surface,
target = {180, p.y + 35},
color = {r = 0.98, g = 0.66, b = 0.22},
scale = 8,
font = 'heading-1',
alignment = 'center',
scale_with_zoom = false
}
WPT.set(
'zone1_text1',
rendering.draw_text {
text = 'Breaching the far side wall will start collapse.',
surface = surface,
target = {0, p.y + 35},
color = {r = 0.98, g = 0.66, b = 0.22},
scale = 8,
font = 'heading-1',
alignment = 'center',
scale_with_zoom = false
}
)
WPT.set(
'zone1_text2',
rendering.draw_text {
text = 'Breaching the far side wall will start collapse',
surface = surface,
target = {-180, p.y + 35},
color = {r = 0.98, g = 0.66, b = 0.22},
scale = 8,
font = 'heading-1',
alignment = 'center',
scale_with_zoom = false
}
)
WPT.set(
'zone1_text3',
rendering.draw_text {
text = 'Breaching the far side wall will start collapse',
surface = surface,
target = {180, p.y + 35},
color = {r = 0.98, g = 0.66, b = 0.22},
scale = 8,
font = 'heading-1',
alignment = 'center',
scale_with_zoom = false
}
)
end
end
else
@ -2407,7 +2422,7 @@ local function border_chunk(p, data)
entities[#entities + 1] = {name = trees[random(1, #trees)], position = pos}
end
local noise = get_perlin('dungeons', pos, 14882)
local noise = get_perlin('dungeons', pos, data.seed)
local index = floor(noise * 32) % 4 + 1
tiles[#tiles + 1] = {name = start_ground_tiles[index], position = pos}

View File

@ -57,9 +57,4 @@ local function on_init()
script.on_event(defines.events.on_player_main_inventory_changed, check_burden)
end
local function on_load()
script.on_event(defines.events.on_player_main_inventory_changed, check_burden)
end
Event.on_init(on_init)
Event.on_load(on_load)

View File

@ -167,7 +167,7 @@ local function add_to_global_pool(amount, personal_tax)
fee = amount * 0.3
end
rpg_extra.global_pool = rpg_extra.global_pool + fee
rpg_extra.global_pool = round(rpg_extra.global_pool + fee, 8)
return amount - fee
end
@ -718,7 +718,7 @@ function Public.rpg_reset_player(player, one_time_reset)
}
)
rpg_t.points_left = old_points_left + total
rpg_t.xp = old_xp
rpg_t.xp = round(old_xp)
rpg_t.level = old_level
else
Public.set_new_player_tbl(
@ -817,7 +817,7 @@ function Public.gain_xp(player, amount, added_to_pool, text)
end
rpg_t.xp = round(rpg_t.xp + amount, 3)
rpg_t.xp_since_last_floaty_text = rpg_t.xp_since_last_floaty_text + amount
rpg_t.xp_since_last_floaty_text = round(rpg_t.xp_since_last_floaty_text + amount)
if not experience_levels[rpg_t.level + 1] then
return

View File

@ -24,6 +24,7 @@ local sub = string.sub
local round = math.round
local floor = math.floor
local random = math.random
local sqrt = math.sqrt
local abs = math.abs
local function log_one_punch(callback)
@ -749,7 +750,7 @@ local function on_entity_damaged(event)
{
name = 'flying-text',
position = entity.position,
text = '' .. math.floor(damage),
text = '' .. floor(damage),
color = {255, 0, 0}
}
)
@ -758,7 +759,7 @@ local function on_entity_damaged(event)
damage = damage * random(100, 125) * 0.01
cause.player.create_local_flying_text(
{
text = math.floor(damage),
text = floor(damage),
position = entity.position,
color = {150, 150, 150},
time_to_live = 90,
@ -923,26 +924,28 @@ local function on_pre_player_mined_item(event)
end
local rpg_t = Public.get_value_from_player(player.index)
if rpg_t.last_mined_entity_position.x == event.entity.position.x and rpg_t.last_mined_entity_position.y == event.entity.position.y then
if rpg_t.last_mined_entity_position.x == entity.position.x and rpg_t.last_mined_entity_position.y == entity.position.y then
return
end
rpg_t.last_mined_entity_position.x = entity.position.x
rpg_t.last_mined_entity_position.y = entity.position.y
local distance_multiplier = math.floor(math.sqrt(entity.position.x ^ 2 + entity.position.y ^ 2)) * 0.0005 + 1
local distance_multiplier = floor(sqrt(entity.position.x ^ 2 + entity.position.y ^ 2)) * 0.0005 + 1
local xp_modifier_when_mining = Public.get('rpg_extra').xp_modifier_when_mining
local xp_amount
if entity.type == 'resource' then
xp_amount = 0.5 * distance_multiplier
xp_amount = 0.9 * distance_multiplier
else
xp_amount = (1.5 + event.entity.prototype.max_health * 0.0035) * distance_multiplier
xp_amount = (1.5 + entity.prototype.max_health * xp_modifier_when_mining) * distance_multiplier
end
if player.gui.screen[main_frame_name] then
local f = player.gui.screen[main_frame_name]
local data = Gui.get_data(f)
if data.exp_gui and data.exp_gui.valid then
data.exp_gui.caption = math.floor(rpg_t.xp)
data.exp_gui.caption = floor(rpg_t.xp)
end
end
@ -969,7 +972,8 @@ local function on_player_crafted_item(event)
local item = event.item_stack
local amount = 0.30 * random(1, 2)
local amount = 0.40 * random(1, 2)
local recipe = event.recipe
if tweaked_crafting_items_enabled then
if item and item.valid then
@ -979,7 +983,9 @@ local function on_player_crafted_item(event)
end
end
Public.gain_xp(player, event.recipe.energy * amount)
local final_xp = recipe.energy * amount
Public.gain_xp(player, final_xp)
Public.reward_mana(player, amount)
end
@ -1067,7 +1073,11 @@ local function damage_entity(e)
return
end
e.surface.create_entity({name = 'water-splash', position = e.position})
if not e.destructible then
return
end
e.surface.create_entity({name = 'ground-explosion', position = e.position})
if e.type == 'entity-ghost' then
e.destroy()
@ -1203,8 +1213,7 @@ local function on_player_used_capsule(event)
target_pos = {position.x, position.y}
elseif projectile_types[object.entityName] then
local coord_modifier = get_near_coord_modifier(projectile_types[object.entityName].max_range)
local proj_pos = {position.x + coord_modifier.x, position.y + coord_modifier.y}
target_pos = proj_pos
target_pos = {position.x + coord_modifier.x, position.y + coord_modifier.y}
end
local range
@ -1273,7 +1282,7 @@ local function on_player_used_capsule(event)
left_top = {x = position.x - 2, y = position.y - 2},
right_bottom = {x = position.x + 2, y = position.y + 2}
}
create_projectile(surface, object.entityName, position, force, target_pos, range)
create_projectile(surface, projectile_types[object.entityName].name, position, force, target_pos, range)
if object.damage then
for _, e in pairs(surface.find_entities_filtered({area = damage_area})) do
damage_entity(e)

View File

@ -6,7 +6,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.stone-wall'},
entityName = 'stone-wall',
level = 10,
level = 1,
type = 'item',
mana_cost = 60,
tick = 100,
@ -17,7 +17,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.wooden-chest'},
entityName = 'wooden-chest',
level = 2,
level = 1,
type = 'item',
mana_cost = 50,
tick = 100,
@ -39,7 +39,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.steel-chest'},
entityName = 'steel-chest',
level = 15,
level = 30,
type = 'item',
mana_cost = 150,
tick = 300,
@ -50,7 +50,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.transport-belt'},
entityName = 'transport-belt',
level = 3,
level = 1,
type = 'item',
mana_cost = 80,
tick = 100,
@ -61,7 +61,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.fast-transport-belt'},
entityName = 'fast-transport-belt',
level = 20,
level = 10,
type = 'item',
mana_cost = 110,
tick = 200,
@ -72,7 +72,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.express-transport-belt'},
entityName = 'express-transport-belt',
level = 60,
level = 30,
type = 'item',
mana_cost = 150,
tick = 300,
@ -83,7 +83,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.underground-belt'},
entityName = 'underground-belt',
level = 3,
level = 1,
type = 'item',
mana_cost = 80,
tick = 100,
@ -94,7 +94,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.fast-underground-belt'},
entityName = 'fast-underground-belt',
level = 20,
level = 10,
type = 'item',
mana_cost = 110,
tick = 200,
@ -105,7 +105,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.express-underground-belt'},
entityName = 'express-underground-belt',
level = 60,
level = 30,
type = 'item',
mana_cost = 150,
tick = 300,
@ -138,7 +138,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.tree'},
entityName = 'tree-05',
level = 70,
level = 30,
type = 'entity',
mana_cost = 100,
tick = 350,
@ -149,7 +149,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.sand-rock-big'},
entityName = 'sand-rock-big',
level = 80,
level = 60,
type = 'entity',
mana_cost = 80,
tick = 350,
@ -160,7 +160,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.small-biter'},
entityName = 'small-biter',
level = 50,
level = 30,
biter = true,
type = 'entity',
mana_cost = 55,
@ -171,7 +171,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.small-spitter'},
entityName = 'small-spitter',
level = 50,
level = 30,
biter = true,
type = 'entity',
mana_cost = 55,
@ -182,7 +182,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.medium-biter'},
entityName = 'medium-biter',
level = 70,
level = 60,
biter = true,
type = 'entity',
mana_cost = 100,
@ -193,7 +193,7 @@ function Public.conjure_items()
spells[#spells + 1] = {
name = {'entity-name.medium-spitter'},
entityName = 'medium-spitter',
level = 70,
level = 60,
biter = true,
type = 'entity',
mana_cost = 100,
@ -223,6 +223,21 @@ function Public.conjure_items()
enabled = false,
sprite = 'entity/spitter-spawner'
}
spells[#spells + 1] = {
name = {'item-name.shotgun-shell'},
entityName = 'shotgun-shell',
target = true,
amount = 1,
damage = true,
force = 'player',
level = 10,
type = 'item',
mana_cost = 40,
tick = 150,
enabled = true,
sprite = 'recipe/shotgun-shell'
}
spells[#spells + 1] = {
name = {'item-name.grenade'},
entityName = 'grenade',
@ -231,8 +246,8 @@ function Public.conjure_items()
damage = true,
force = 'player',
level = 30,
type = 'special',
mana_cost = 150,
type = 'item',
mana_cost = 100,
tick = 150,
enabled = true,
sprite = 'recipe/grenade'
@ -245,12 +260,54 @@ function Public.conjure_items()
damage = true,
force = 'player',
level = 50,
type = 'special',
mana_cost = 250,
type = 'item',
mana_cost = 225,
tick = 200,
enabled = true,
sprite = 'recipe/cluster-grenade'
}
spells[#spells + 1] = {
name = {'item-name.cannon-shell'},
entityName = 'cannon-shell',
target = true,
amount = 1,
damage = true,
force = 'player',
level = 30,
type = 'item',
mana_cost = 125,
tick = 150,
enabled = true,
sprite = 'recipe/cannon-shell'
}
spells[#spells + 1] = {
name = {'item-name.explosive-cannon-shell'},
entityName = 'explosive-cannon-shell',
target = true,
amount = 2,
damage = true,
force = 'player',
level = 50,
type = 'item',
mana_cost = 250,
tick = 200,
enabled = true,
sprite = 'recipe/explosive-cannon-shell'
}
spells[#spells + 1] = {
name = {'item-name.uranium-cannon-shell'},
entityName = 'uranium-cannon-shell',
target = true,
amount = 2,
damage = true,
force = 'player',
level = 70,
type = 'item',
mana_cost = 400,
tick = 200,
enabled = true,
sprite = 'recipe/uranium-cannon-shell'
}
spells[#spells + 1] = {
name = {'item-name.rocket'},
entityName = 'rocket',
@ -260,7 +317,7 @@ function Public.conjure_items()
damage = true,
force = 'enemy',
level = 40,
type = 'special',
type = 'item',
mana_cost = 60,
tick = 320,
enabled = true,
@ -289,9 +346,9 @@ function Public.conjure_items()
range = 50,
damage = false,
force = 'player',
level = 50,
level = 45,
type = 'special',
mana_cost = 200,
mana_cost = 150,
tick = 100,
enabled = true,
sprite = 'recipe/repair-pack'
@ -304,9 +361,9 @@ function Public.conjure_items()
range = 0,
damage = true,
force = 'player',
level = 70,
level = 50,
type = 'special',
mana_cost = 90,
mana_cost = 70,
tick = 100,
enabled = true,
sprite = 'virtual-signal/signal-S'
@ -357,7 +414,7 @@ function Public.conjure_items()
name = {'spells.dynamites'},
entityName = 'explosives',
target = false,
amount = 2,
amount = 3,
capsule = true,
damage = false,
range = 30,
@ -379,7 +436,7 @@ function Public.conjure_items()
force = 'player',
level = 60,
type = 'special',
mana_cost = 250,
mana_cost = 150,
tick = 320,
enabled = true,
sprite = 'entity/compilatron'
@ -394,7 +451,7 @@ function Public.conjure_items()
force = 'player',
level = 50,
type = 'special',
mana_cost = 340,
mana_cost = 220,
tick = 320,
enabled = true,
sprite = 'recipe/distractor-capsule'

View File

@ -108,6 +108,7 @@ function Public.reset_table()
this.rpg_extra.enable_explosive_bullets = false
this.rpg_extra.enable_explosive_bullets_globally = false
this.rpg_extra.mana_per_tick = 0.1
this.rpg_extra.xp_modifier_when_mining = 0.0045
this.rpg_extra.force_mana_per_tick = false
this.rpg_extra.enable_stone_path = false
this.rpg_extra.enable_auto_allocate = false

View File

@ -1,6 +1,8 @@
local Public = require 'modules.wave_defense.table'
local BiterHealthBooster = require 'modules.biter_health_booster_v2'
local floor = math.floor
local function create_gui(player)
local frame = player.gui.top.add({type = 'frame', name = 'wave_defense'})
frame.style.maximal_height = 37
@ -59,7 +61,7 @@ local function get_threat_gain()
if past_index < 1 then
past_index = 1
end
local gain = math.floor((threat_log[threat_log_index] - threat_log[past_index]) / 15)
local gain = floor((threat_log[threat_log_index] - threat_log[past_index]) / 15)
return gain
end
@ -85,14 +87,14 @@ function Public.update_gui(player)
gui.wave_number.caption = wave_number
if wave_number == 0 then
gui.label.caption = {'wave_defense.gui_1'}
gui.wave_number.caption = math.floor((next_wave - game.tick) / 60) + 1
gui.wave_number.caption = floor((next_wave - game.tick) / 60) + 1
end
local interval = next_wave - last_wave
gui.progressbar.value = 1 - (next_wave - game.tick) / interval
gui.threat.caption = {'wave_defense.gui_3'}
gui.threat.tooltip = {'wave_defense.tooltip_1', biter_health_boost * 100, max_active_biters}
gui.threat_value.caption = math.floor(threat)
gui.threat_value.caption = floor(threat)
gui.threat_value.tooltip = {
'wave_defense.tooltip_1',
biter_health_boost * 100,
@ -109,14 +111,14 @@ function Public.update_gui(player)
if gain >= 0 then
gui.threat_gains.caption = ' (+' .. gain .. ')'
local g = 255 - math.floor(gain / d)
local g = 255 - floor(gain / d)
if g < 0 then
g = 0
end
gui.threat_gains.style.font_color = {255, g, 0}
else
gui.threat_gains.caption = ' (' .. gain .. ')'
local r = 255 - math.floor(math.abs(gain) / d)
local r = 255 - floor(math.abs(gain) / d)
if r < 0 then
r = 0
end

View File

@ -517,12 +517,9 @@ local function spawn_biter(surface, position, forceSpawn, is_boss_biter)
local old_position = position
position = surface.find_non_colliding_position('steel-chest', position, 2, 1)
position = surface.find_non_colliding_position('steel-chest', position, 3, 1)
if not position then
position = surface.find_non_colliding_position('steel-chest', old_position, 4, 1)
if not position then
position = old_position
end
position = old_position
end
local biter = surface.create_entity({name = name, position = position, force = 'enemy'})

View File

@ -32,7 +32,7 @@ function Public.reset_wave_defense()
this.max_biter_age = 3600 * 60
this.nests = {}
this.nest_building_density = 48
this.next_wave = game.tick + 3600 * 15
this.next_wave = game.tick + 3600 * 20
this.enable_grace_time = {
enabled = true,
set = nil

View File

@ -4,6 +4,8 @@
local Event = require 'utils.event'
local Global = require 'utils.global'
local round = math.round
local this = {
modifiers = {},
disabled_modifier = {}
@ -72,7 +74,7 @@ function Public.update_player_modifiers(player)
if disabled_modifiers and disabled_modifiers[k] then
player[modifier] = 0
else
player[modifier] = sum_value
player[modifier] = round(sum_value, 8)
end
end
end