You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-09-16 09:06:21 +02:00
tweaks and fixes
This commit is contained in:
@@ -187,7 +187,7 @@ local function on_player_ammo_inventory_changed(event)
|
|||||||
playtime = player.online_time + tracker[player.name]
|
playtime = player.online_time + tracker[player.name]
|
||||||
end
|
end
|
||||||
if playtime < 1296000 then
|
if playtime < 1296000 then
|
||||||
if this.enable_capsule_warning then
|
if this.enable_capsule_warning then
|
||||||
local nukes = player.remove_item({name = 'atomic-bomb', count = 1000})
|
local nukes = player.remove_item({name = 'atomic-bomb', count = 1000})
|
||||||
if nukes > 0 then
|
if nukes > 0 then
|
||||||
Utils.action_warning('{Nuke}', player.name .. ' tried to equip nukes but was not trusted.')
|
Utils.action_warning('{Nuke}', player.name .. ' tried to equip nukes but was not trusted.')
|
||||||
@@ -671,17 +671,11 @@ end
|
|||||||
local function on_init()
|
local function on_init()
|
||||||
local branch_version = '0.18.35'
|
local branch_version = '0.18.35'
|
||||||
local sub = string.sub
|
local sub = string.sub
|
||||||
game.forces.player.research_queue_enabled = true
|
|
||||||
local is_branch_18 = sub(branch_version, 3, 4)
|
local is_branch_18 = sub(branch_version, 3, 4)
|
||||||
local get_active_version = sub(game.active_mods.base, 3, 4)
|
local get_active_version = sub(game.active_mods.base, 3, 4)
|
||||||
local default = game.permissions.get_group('Default')
|
local default = game.permissions.get_group('Default')
|
||||||
|
|
||||||
default.set_allows_action(defines.input_action.change_multiplayer_config, false)
|
game.forces.player.research_queue_enabled = true
|
||||||
default.set_allows_action(defines.input_action.edit_permission_group, false)
|
|
||||||
default.set_allows_action(defines.input_action.import_permissions_string, false)
|
|
||||||
default.set_allows_action(defines.input_action.delete_permission_group, false)
|
|
||||||
default.set_allows_action(defines.input_action.add_permission_group, false)
|
|
||||||
default.set_allows_action(defines.input_action.admin_action, false)
|
|
||||||
|
|
||||||
is_branch_18 = is_branch_18 .. sub(branch_version, 6, 7)
|
is_branch_18 = is_branch_18 .. sub(branch_version, 6, 7)
|
||||||
get_active_version = get_active_version .. sub(game.active_mods.base, 6, 7)
|
get_active_version = get_active_version .. sub(game.active_mods.base, 6, 7)
|
||||||
|
@@ -753,6 +753,12 @@ local function on_built_entity(event)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local map_name = 'mountain_fortress_v3'
|
||||||
|
|
||||||
|
if string.sub(entity.surface.name, 0, #map_name) ~= map_name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local upg = this.upgrades
|
local upg = this.upgrades
|
||||||
local surface = entity.surface
|
local surface = entity.surface
|
||||||
|
|
||||||
@@ -814,6 +820,12 @@ local function on_robot_built_entity(event)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local map_name = 'mountain_fortress_v3'
|
||||||
|
|
||||||
|
if string.sub(entity.surface.name, 0, #map_name) ~= map_name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local upg = this.upgrades
|
local upg = this.upgrades
|
||||||
local surface = entity.surface
|
local surface = entity.surface
|
||||||
|
|
||||||
|
@@ -3,6 +3,7 @@ local Event = require 'utils.event'
|
|||||||
local Market = require 'maps.mountain_fortress_v3.basic_markets'
|
local Market = require 'maps.mountain_fortress_v3.basic_markets'
|
||||||
local ICW = require 'maps.mountain_fortress_v3.icw.main'
|
local ICW = require 'maps.mountain_fortress_v3.icw.main'
|
||||||
local WPT = require 'maps.mountain_fortress_v3.table'
|
local WPT = require 'maps.mountain_fortress_v3.table'
|
||||||
|
local Session = require 'utils.session_data'
|
||||||
local Difficulty = require 'modules.difficulty_vote'
|
local Difficulty = require 'modules.difficulty_vote'
|
||||||
local Jailed = require 'utils.jail_data'
|
local Jailed = require 'utils.jail_data'
|
||||||
local RPG_Settings = require 'modules.rpg.table'
|
local RPG_Settings = require 'modules.rpg.table'
|
||||||
@@ -56,33 +57,77 @@ end
|
|||||||
|
|
||||||
function Public.add_player_to_permission_group(player, group)
|
function Public.add_player_to_permission_group(player, group)
|
||||||
local jailed = Jailed.get_jailed_table()
|
local jailed = Jailed.get_jailed_table()
|
||||||
|
local enable_permission_group_disconnect = WPT.get('disconnect_wagon')
|
||||||
|
local tracker = Session.get_tracker_table()
|
||||||
|
|
||||||
|
if player.admin then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local playtime = player.online_time
|
||||||
|
if tracker[player.name] then
|
||||||
|
playtime = player.online_time + tracker[player.name]
|
||||||
|
end
|
||||||
|
|
||||||
if jailed[player.name] then
|
if jailed[player.name] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if group == 'locomotive' then
|
if enable_permission_group_disconnect then
|
||||||
local locomotive_group = game.permissions.get_group('locomotive')
|
local locomotive_group = game.permissions.get_group('locomotive')
|
||||||
if not locomotive_group then
|
if locomotive_group then
|
||||||
locomotive_group = game.permissions.create_group('locomotive')
|
locomotive_group.set_allows_action(defines.input_action.disconnect_rolling_stock, true)
|
||||||
locomotive_group.set_allows_action(defines.input_action.cancel_craft, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.edit_permission_group, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.import_permissions_string, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.delete_permission_group, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.add_permission_group, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.admin_action, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.drop_item, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.place_equipment, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.take_equipment, false)
|
|
||||||
locomotive_group.set_allows_action(defines.input_action.disconnect_rolling_stock, false)
|
|
||||||
-- locomotive_group.set_allows_action(defines.input_action.connect_rolling_stock, false)
|
|
||||||
end
|
end
|
||||||
locomotive_group = game.permissions.get_group('locomotive')
|
else
|
||||||
locomotive_group.add_player(player)
|
local locomotive_group = game.permissions.get_group('locomotive')
|
||||||
elseif group == 'default' then
|
if locomotive_group then
|
||||||
local default_group = game.permissions.get_group('Default')
|
locomotive_group.set_allows_action(defines.input_action.disconnect_rolling_stock, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
default_group.add_player(player)
|
local not_trusted = game.permissions.get_group('not_trusted')
|
||||||
|
if playtime < 2592000 then -- 12 hours
|
||||||
|
if not not_trusted then
|
||||||
|
not_trusted = game.permissions.create_group('not_trusted')
|
||||||
|
not_trusted.set_allows_action(defines.input_action.cancel_craft, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.edit_permission_group, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.import_permissions_string, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.delete_permission_group, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.add_permission_group, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.admin_action, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.drop_item, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.place_equipment, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.take_equipment, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.disconnect_rolling_stock, false)
|
||||||
|
not_trusted.set_allows_action(defines.input_action.connect_rolling_stock, false)
|
||||||
|
end
|
||||||
|
not_trusted = game.permissions.get_group('not_trusted')
|
||||||
|
not_trusted.add_player(player)
|
||||||
|
else
|
||||||
|
if group == 'locomotive' then
|
||||||
|
local locomotive_group = game.permissions.get_group('locomotive')
|
||||||
|
if not locomotive_group then
|
||||||
|
locomotive_group = game.permissions.create_group('locomotive')
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.cancel_craft, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.edit_permission_group, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.import_permissions_string, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.delete_permission_group, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.add_permission_group, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.admin_action, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.drop_item, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.place_equipment, false)
|
||||||
|
locomotive_group.set_allows_action(defines.input_action.take_equipment, false)
|
||||||
|
-- locomotive_group.set_allows_action(defines.input_action.disconnect_rolling_stock, false)
|
||||||
|
-- locomotive_group.set_allows_action(defines.input_action.connect_rolling_stock, false)
|
||||||
|
end
|
||||||
|
|
||||||
|
locomotive_group = game.permissions.get_group('locomotive')
|
||||||
|
locomotive_group.add_player(player)
|
||||||
|
elseif group == 'default' then
|
||||||
|
local default_group = game.permissions.get_group('Default')
|
||||||
|
|
||||||
|
default_group.add_player(player)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -941,6 +986,52 @@ local function on_player_changed_position(event)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function spawn_biter()
|
||||||
|
local this = WPT.get()
|
||||||
|
local loco_surface = this.icw_locomotive.surface
|
||||||
|
|
||||||
|
if not loco_surface.valid then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local locomotive = this.icw_locomotive
|
||||||
|
|
||||||
|
local center_position = {
|
||||||
|
x = locomotive.area.left_top.x + (locomotive.area.right_bottom.x - locomotive.area.left_top.x) * 0.5,
|
||||||
|
y = locomotive.area.left_top.y + (locomotive.area.right_bottom.y - locomotive.area.left_top.y) * 0.5
|
||||||
|
}
|
||||||
|
|
||||||
|
if not this.icw_area then
|
||||||
|
this.icw_area = center_position
|
||||||
|
end
|
||||||
|
|
||||||
|
local position = loco_surface.find_non_colliding_position('market', center_position, 128, 0.5)
|
||||||
|
local biters = {
|
||||||
|
'big-biter',
|
||||||
|
'behemoth-biter',
|
||||||
|
'big-spitter',
|
||||||
|
'behemoth-spitter'
|
||||||
|
}
|
||||||
|
this.locomotive_biter =
|
||||||
|
loco_surface.create_entity(
|
||||||
|
{name = biters[math.random(1, 4)], position = position, force = 'player', create_build_effect_smoke = false}
|
||||||
|
)
|
||||||
|
this.locomotive_biter.ai_settings.allow_destroy_when_commands_fail = false
|
||||||
|
this.locomotive_biter.ai_settings.allow_try_return_to_spawner = false
|
||||||
|
|
||||||
|
rendering.draw_text {
|
||||||
|
text = 'please don´t shoo at me',
|
||||||
|
surface = this.locomotive_biter.surface,
|
||||||
|
target = this.locomotive_biter,
|
||||||
|
target_offset = {0, -3.5},
|
||||||
|
scale = 1.05,
|
||||||
|
font = 'default-large-semibold',
|
||||||
|
color = {r = 175, g = 75, b = 255},
|
||||||
|
alignment = 'center',
|
||||||
|
scale_with_zoom = false
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
local function create_market(data, rebuild)
|
local function create_market(data, rebuild)
|
||||||
local surface = data.surface
|
local surface = data.surface
|
||||||
local this = data.this
|
local this = data.this
|
||||||
@@ -1001,19 +1092,7 @@ local function create_market(data, rebuild)
|
|||||||
|
|
||||||
this.market.destructible = false
|
this.market.destructible = false
|
||||||
|
|
||||||
local position = loco_surface.find_non_colliding_position('market', center_position, 128, 0.5)
|
spawn_biter()
|
||||||
local biters = {
|
|
||||||
'big-biter',
|
|
||||||
'behemoth-biter',
|
|
||||||
'big-spitter',
|
|
||||||
'behemoth-spitter'
|
|
||||||
}
|
|
||||||
local e =
|
|
||||||
loco_surface.create_entity(
|
|
||||||
{name = biters[math.random(1, 4)], position = position, force = 'player', create_build_effect_smoke = false}
|
|
||||||
)
|
|
||||||
e.ai_settings.allow_destroy_when_commands_fail = false
|
|
||||||
e.ai_settings.allow_try_return_to_spawner = false
|
|
||||||
|
|
||||||
for x = center_position.x - 5, center_position.x + 5, 1 do
|
for x = center_position.x - 5, center_position.x + 5, 1 do
|
||||||
for y = center_position.y - 5, center_position.y + 5, 1 do
|
for y = center_position.y - 5, center_position.y + 5, 1 do
|
||||||
@@ -1293,6 +1372,59 @@ local function on_research_finished()
|
|||||||
Public.refresh_gui()
|
Public.refresh_gui()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function shoo(event)
|
||||||
|
local icw_locomotive = WPT.get('icw_locomotive')
|
||||||
|
local loco_surface = icw_locomotive.surface
|
||||||
|
|
||||||
|
if not loco_surface.valid then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local player = game.players[event.player_index]
|
||||||
|
|
||||||
|
if player and player.valid then
|
||||||
|
if player.surface.index ~= loco_surface.index then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local locomotive_biter = WPT.get('locomotive_biter')
|
||||||
|
local surface = player.surface
|
||||||
|
local message = event.message
|
||||||
|
message = string.lower(message)
|
||||||
|
for word in string.gmatch(message, '%g+') do
|
||||||
|
if word == 'shoo' then
|
||||||
|
if not locomotive_biter then
|
||||||
|
spawn_biter()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
surface.create_entity(
|
||||||
|
{
|
||||||
|
name = 'rocket',
|
||||||
|
position = locomotive_biter.position,
|
||||||
|
force = 'enemy',
|
||||||
|
speed = 1,
|
||||||
|
max_range = 1200,
|
||||||
|
target = locomotive_biter,
|
||||||
|
source = locomotive_biter
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if locomotive_biter and locomotive_biter.valid then
|
||||||
|
locomotive_biter.die()
|
||||||
|
WPT.set().locomotive_biter = nil
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_console_chat(event)
|
||||||
|
if not event.player_index then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
shoo(event)
|
||||||
|
end
|
||||||
|
|
||||||
local function tick()
|
local function tick()
|
||||||
local ticker = game.tick
|
local ticker = game.tick
|
||||||
|
|
||||||
@@ -1744,5 +1876,6 @@ Event.add(defines.events.on_robot_built_entity, on_built_entity)
|
|||||||
Event.add(defines.events.on_entity_died, on_player_and_robot_mined_entity)
|
Event.add(defines.events.on_entity_died, on_player_and_robot_mined_entity)
|
||||||
Event.add(defines.events.on_pre_player_mined_item, on_player_and_robot_mined_entity)
|
Event.add(defines.events.on_pre_player_mined_item, on_player_and_robot_mined_entity)
|
||||||
Event.add(defines.events.on_robot_mined_entity, on_player_and_robot_mined_entity)
|
Event.add(defines.events.on_robot_mined_entity, on_player_and_robot_mined_entity)
|
||||||
|
Event.add(defines.events.on_console_chat, on_console_chat)
|
||||||
|
|
||||||
return Public
|
return Public
|
||||||
|
@@ -12,6 +12,7 @@ require 'modules.biters_yield_coins'
|
|||||||
require 'modules.wave_defense.main'
|
require 'modules.wave_defense.main'
|
||||||
require 'modules.mineable_wreckage_yields_scrap'
|
require 'modules.mineable_wreckage_yields_scrap'
|
||||||
require 'modules.charging_station'
|
require 'modules.charging_station'
|
||||||
|
require 'modules.admins_operate_biters'
|
||||||
|
|
||||||
local Autostash = require 'modules.autostash'
|
local Autostash = require 'modules.autostash'
|
||||||
local PL = require 'comfy_panel.player_list'
|
local PL = require 'comfy_panel.player_list'
|
||||||
@@ -788,6 +789,17 @@ local on_init = function()
|
|||||||
Explosives.set_destructible_tile('water-mud', 1000)
|
Explosives.set_destructible_tile('water-mud', 1000)
|
||||||
Explosives.set_whitelist_entity('straight-rail')
|
Explosives.set_whitelist_entity('straight-rail')
|
||||||
Explosives.set_whitelist_entity('curved-rail')
|
Explosives.set_whitelist_entity('curved-rail')
|
||||||
|
Explosives.set_whitelist_entity('character')
|
||||||
|
|
||||||
|
if global.biter_command and global.biter_command.whitelist then
|
||||||
|
global.biter_command.whitelist = {
|
||||||
|
['Hanakocz'] = true,
|
||||||
|
['mewmew'] = true,
|
||||||
|
['Gerkiz'] = true
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
global.biter_command.enabled = false
|
||||||
end
|
end
|
||||||
|
|
||||||
Event.on_nth_tick(10, on_tick)
|
Event.on_nth_tick(10, on_tick)
|
||||||
|
@@ -93,6 +93,8 @@ function Public.reset_table()
|
|||||||
randomized = false
|
randomized = false
|
||||||
}
|
}
|
||||||
this.collapse_grace = true
|
this.collapse_grace = true
|
||||||
|
this.locomotive_biter = nil
|
||||||
|
this.disconnect_wagon = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.get(key)
|
function Public.get(key)
|
||||||
|
@@ -6,6 +6,7 @@ global.biter_command.active_unit_groups = {}
|
|||||||
global.biter_command.enabled = true
|
global.biter_command.enabled = true
|
||||||
global.biter_command.whitelist = {}
|
global.biter_command.whitelist = {}
|
||||||
global.biter_command.admin_mode = true --if only admins can see and use the panel
|
global.biter_command.admin_mode = true --if only admins can see and use the panel
|
||||||
|
|
||||||
global.biter_command.teleporting = false --if teleporting is allowed for non-admins
|
global.biter_command.teleporting = false --if teleporting is allowed for non-admins
|
||||||
global.biter_command.buildings = true ---if player can trigger building nests and worms
|
global.biter_command.buildings = true ---if player can trigger building nests and worms
|
||||||
|
|
||||||
@@ -618,14 +619,14 @@ local function on_player_joined_game(event)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function on_unit_group_created(event)
|
local function on_unit_group_created(event)
|
||||||
if event and event.group then
|
if event and event.group and event.group.valid then
|
||||||
global.biter_command.active_unit_groups[event.group.group_number] = {id = event.group.group_number, group = event.group}
|
global.biter_command.active_unit_groups[event.group.group_number] = {id = event.group.group_number, group = event.group}
|
||||||
refresh_panel()
|
refresh_panel()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function on_unit_removed_from_group(event)
|
local function on_unit_removed_from_group(event)
|
||||||
if event and event.group then
|
if event and event.group and event.group.valid then
|
||||||
if #event.group.members == 1 then
|
if #event.group.members == 1 then
|
||||||
global.biter_command.active_unit_groups[event.group.group_number] = nil
|
global.biter_command.active_unit_groups[event.group.group_number] = nil
|
||||||
refresh_panel()
|
refresh_panel()
|
||||||
|
@@ -9,7 +9,6 @@ local Math2D = require 'math2d'
|
|||||||
|
|
||||||
--RPG Modules
|
--RPG Modules
|
||||||
local RPG = require 'modules.rpg.table'
|
local RPG = require 'modules.rpg.table'
|
||||||
local Spells = require 'modules.rpg.spells'
|
|
||||||
local Settings = require 'modules.rpg.settings'
|
local Settings = require 'modules.rpg.settings'
|
||||||
local Functions = require 'modules.rpg.functions'
|
local Functions = require 'modules.rpg.functions'
|
||||||
local RPG_GUI = require 'modules.rpg.gui'
|
local RPG_GUI = require 'modules.rpg.gui'
|
||||||
@@ -18,8 +17,6 @@ local RPG_GUI = require 'modules.rpg.gui'
|
|||||||
local enemy_types = RPG.enemy_types
|
local enemy_types = RPG.enemy_types
|
||||||
local die_cause = RPG.die_cause
|
local die_cause = RPG.die_cause
|
||||||
local rpg_frame_icons = RPG.rpg_frame_icons
|
local rpg_frame_icons = RPG.rpg_frame_icons
|
||||||
local conjure_items = Spells.conjure_items
|
|
||||||
local projectile_types = Spells.projectile_types
|
|
||||||
local points_per_level = RPG.points_per_level
|
local points_per_level = RPG.points_per_level
|
||||||
local nth_tick = RPG.nth_tick
|
local nth_tick = RPG.nth_tick
|
||||||
local visuals_delay = RPG.visuals_delay
|
local visuals_delay = RPG.visuals_delay
|
||||||
@@ -853,6 +850,10 @@ local function get_near_coord_modifier(range)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function damage_entity(e)
|
local function damage_entity(e)
|
||||||
|
if not e or not e.valid then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if not e.health then
|
if not e.health then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -916,6 +917,9 @@ local function on_player_used_capsule(event)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local conjure_items = RPG.get_spells()
|
||||||
|
local projectile_types = RPG.get_projectiles
|
||||||
|
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
if not player or not player.valid then
|
if not player or not player.valid then
|
||||||
return
|
return
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
local RPG = require 'modules.rpg.table'
|
local RPG = require 'modules.rpg.table'
|
||||||
local Spells = require 'modules.rpg.spells'
|
|
||||||
local Gui = require 'utils.gui'
|
local Gui = require 'utils.gui'
|
||||||
local P = require 'player_modifiers'
|
local P = require 'player_modifiers'
|
||||||
local Session = require 'utils.session_data'
|
local Session = require 'utils.session_data'
|
||||||
@@ -29,7 +28,7 @@ function Public.extra_settings(player)
|
|||||||
local rpg_extra = RPG.get('rpg_extra')
|
local rpg_extra = RPG.get('rpg_extra')
|
||||||
local rpg_t = RPG.get('rpg_t')
|
local rpg_t = RPG.get('rpg_t')
|
||||||
local trusted = Session.get_trusted_table()
|
local trusted = Session.get_trusted_table()
|
||||||
local conjure_items = Spells.conjure_items
|
local conjure_items = RPG.get_spells()
|
||||||
local main_frame =
|
local main_frame =
|
||||||
player.gui.screen.add(
|
player.gui.screen.add(
|
||||||
{
|
{
|
||||||
|
@@ -1,11 +1,13 @@
|
|||||||
-- one table to rule them all!
|
-- one table to rule them all!
|
||||||
local Global = require 'utils.global'
|
local Global = require 'utils.global'
|
||||||
|
local Spells = require 'modules.rpg.spells'
|
||||||
local Event = require 'utils.event'
|
local Event = require 'utils.event'
|
||||||
local Gui = require 'utils.gui'
|
local Gui = require 'utils.gui'
|
||||||
|
|
||||||
local this = {
|
local this = {
|
||||||
rpg_extra = {},
|
rpg_extra = {},
|
||||||
rpg_t = {}
|
rpg_t = {},
|
||||||
|
rpg_spells = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
--! Gui Frames
|
--! Gui Frames
|
||||||
@@ -120,6 +122,7 @@ function Public.reset_table()
|
|||||||
['small-worm-turret'] = 16,
|
['small-worm-turret'] = 16,
|
||||||
['spitter-spawner'] = 64
|
['spitter-spawner'] = 64
|
||||||
}
|
}
|
||||||
|
this.rpg_spells = Spells.conjure_items
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Gets value from table
|
--- Gets value from table
|
||||||
@@ -272,6 +275,31 @@ function Public.enable_one_punch_globally(value)
|
|||||||
return this.rpg_extra.enable_one_punch_globally
|
return this.rpg_extra.enable_one_punch_globally
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Retrieves the spell table.
|
||||||
|
---@param key <string>
|
||||||
|
function Public.get_spells(key)
|
||||||
|
if key then
|
||||||
|
return this.rpg_spells[key]
|
||||||
|
else
|
||||||
|
return this.rpg_spells
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Adds a spell to the rpg_spells
|
||||||
|
---@param key <string>
|
||||||
|
---@param value <string>
|
||||||
|
function Public.set_spells(key, value)
|
||||||
|
if key and value then
|
||||||
|
this.rpg_spells[key] = value
|
||||||
|
return this.rpg_spells[key]
|
||||||
|
elseif key then
|
||||||
|
return this.rpg_spells[key]
|
||||||
|
else
|
||||||
|
return this.rpg_spells
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Public.get_projectiles = Spells.projectile_types
|
||||||
Public.settings_frame_name = settings_frame_name
|
Public.settings_frame_name = settings_frame_name
|
||||||
Public.save_button_name = save_button_name
|
Public.save_button_name = save_button_name
|
||||||
Public.discard_button_name = discard_button_name
|
Public.discard_button_name = discard_button_name
|
||||||
|
Reference in New Issue
Block a user