1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-09-16 09:06:21 +02:00

minor modifications

This commit is contained in:
Gerkiz
2020-07-26 22:06:19 +02:00
parent fb97c7e6bc
commit c670ce2380
7 changed files with 482 additions and 378 deletions

View File

@@ -28,7 +28,8 @@ local this = {
log_tree_harvest = false,
do_not_check_trusted = true,
enable_autokick = true,
enable_autoban = false
enable_autoban = false,
enable_capsule_warning = false
}
local blacklisted_types = {
@@ -186,10 +187,12 @@ local function on_player_ammo_inventory_changed(event)
playtime = player.online_time + tracker[player.name]
end
if playtime < 1296000 then
local nukes = player.remove_item({name = 'atomic-bomb', count = 1000})
if nukes > 0 then
Utils.action_warning('{Nuke}', player.name .. ' tried to equip nukes but was not trusted.')
damage_player(player)
if this.enable_capsule_warning then
local nukes = player.remove_item({name = 'atomic-bomb', count = 1000})
if nukes > 0 then
Utils.action_warning('{Nuke}', player.name .. ' tried to equip nukes but was not trusted.')
damage_player(player)
end
end
end
end
@@ -291,34 +294,36 @@ local function on_player_used_capsule(event)
then
return
end
local msg = ''
if this.enable_capsule_warning then
local count = 0
local entities =
player.surface.find_entities_filtered {force = player.force, area = {{x - 5, y - 5}, {x + 5, y + 5}}}
local count = 0
local entities =
player.surface.find_entities_filtered {force = player.force, area = {{x - 5, y - 5}, {x + 5, y + 5}}}
for i = 1, #entities do
local e = entities[i]
local entity_name = e.name
if entity_name ~= name and entity_name ~= 'entity-ghost' and not blacklisted_types[e.type] then
count = count + 1
for i = 1, #entities do
local e = entities[i]
local entity_name = e.name
if entity_name ~= name and entity_name ~= 'entity-ghost' and not blacklisted_types[e.type] then
count = count + 1
end
end
if count <= capsule_bomb_threshold then
return
end
local prefix = '{Capsule}'
msg = format(player.name .. ' damaged: %s with: %s', get_entities(name, entities), name)
local ban_msg =
format(
'Damaged: %s with: %s. This action was performed automatically. Visit getcomfy.eu/discord for forgiveness',
get_entities(name, entities),
name
)
do_action(player, prefix, msg, ban_msg, true)
end
if count <= capsule_bomb_threshold then
return
end
local prefix = '{Capsule}'
local msg = format(player.name .. ' damaged: %s with: %s', get_entities(name, entities), name)
local ban_msg =
format(
'Damaged: %s with: %s. This action was performed automatically. Visit getcomfy.eu/discord for forgiveness',
get_entities(name, entities),
name
)
do_action(player, prefix, msg, ban_msg, true)
if not this.capsule_history[player.index] then
this.capsule_history[player.index] = {}
end
@@ -602,11 +607,13 @@ local function on_player_cursor_stack_changed(event)
end
if playtime < 1296000 then
if ammo_names[name] then
local item_to_remove = player.remove_item({name = name, count = 1000})
if item_to_remove > 0 then
Utils.action_warning('{Capsule}', player.name .. ' equipped ' .. name .. ' but was not trusted.')
damage_player(player)
if this.enable_capsule_warning then
if ammo_names[name] then
local item_to_remove = player.remove_item({name = name, count = 1000})
if item_to_remove > 0 then
Utils.action_warning('{Capsule}', player.name .. ' equipped ' .. name .. ' but was not trusted.')
damage_player(player)
end
end
end
end
@@ -695,28 +702,66 @@ function Public.reset_tables()
end
--- Enable this to log when trees are destroyed
---@param value boolean
---@param value <boolean>
function Public.log_tree_harvest(value)
if value then
this.log_tree_harvest = value
end
return this.log_tree_harvest
end
--- Add entity type to the whitelist so it gets logged.
---@param key string
---@param value string
---@param key <string>
---@param value <string>
function Public.whitelist_types(key, value)
if key and value then
this.whitelist_types[key] = value
end
return this.whitelist_types[key]
end
--- If the event should also check trusted players.
---@param value string
---@param value <string>
function Public.do_not_check_trusted(value)
if value then
this.do_not_check_trusted = value
end
return this.do_not_check_trusted
end
--- If ANY actions should be performed when a player misbehaves.
---@param value <string>
function Public.enable_capsule_warning(value)
if value then
this.enable_capsule_warning = value
end
return this.enable_capsule_warning
end
--- This is used for the RPG module, when casting capsules.
---@param player <LuaPlayer>
---@param position <EventPosition>
---@param msg <string>
function Public.insert_into_capsule_history(player, position)
if not this.capsule_history[player.index] then
this.capsule_history[player.index] = {}
end
if #this.capsule_history[player.index] > 100 then
this.capsule_history[player.index] = {}
end
local t = math.abs(math.floor((game.tick) / 3600))
local str = '[' .. t .. '] '
str = str .. ' at X:'
str = str .. math.floor(position.x)
str = str .. ' Y:'
str = str .. math.floor(position.y)
str = str .. ' '
str = str .. 'surface:' .. player.surface.index
increment(this.capsule_history, player.index, str)
end
--- Returns the table.

View File

@@ -16,6 +16,25 @@ local Event = require 'utils.event'
local Session = require 'utils.session_data'
local Jailed = require 'utils.jail_data'
local Tabs = require 'comfy_panel.main'
local Global = require 'utils.global'
local Public = {}
local this = {
player_list = {
last_poke_tick = {},
pokes = {},
sorting_method = {}
},
show_roles_in_list = false
}
Global.register(
this,
function(t)
this = t
end
)
local symbol_asc = ''
local symbol_desc = ''
@@ -356,7 +375,7 @@ local function get_sorted_list(sort_by)
player_list[i].played_time = get_formatted_playtime(player.online_time)
player_list[i].played_ticks = player.online_time
player_list[i].pokes = global.player_list.pokes[player.index]
player_list[i].pokes = this.player_list.pokes[player.index]
player_list[i].player_index = player.index
end
@@ -422,9 +441,9 @@ local function player_list_show(player, frame, sort_by)
}
if sort_by then
global.player_list.sorting_method[player.index] = sort_by
this.player_list.sorting_method[player.index] = sort_by
else
sort_by = global.player_list.sorting_method[player.index]
sort_by = this.player_list.sorting_method[player.index]
end
header_modifier[sort_by](headers)
@@ -490,14 +509,22 @@ local function player_list_show(player, frame, sort_by)
tooltip = 'This player is not trusted.'
end
local caption
if this.show_roles_in_list or game.players[player_list[i].name].admin then
caption = player_list[i].name .. ' ' .. trusted
else
caption = player_list[i].name
end
-- Name
local name_label =
player_list_panel_table.add {
type = 'label',
name = 'player_list_panel_player_names_' .. i,
caption = player_list[i].name .. ' ' .. trusted,
caption = caption,
tooltip = tooltip
}
local p_color = game.players[player_list[i].player_index]
name_label.style.font = 'default'
name_label.style.font_color = {
@@ -616,7 +643,7 @@ local function on_gui_click(event)
if player.name == poked_player then
return
end
if global.player_list.last_poke_tick[event.element.player_index] + 300 < game.tick then
if this.player_list.last_poke_tick[event.element.player_index] + 300 < game.tick then
local str = '>> '
str = str .. player.name
str = str .. ' has poked '
@@ -626,9 +653,9 @@ local function on_gui_click(event)
str = str .. pokemessages[z]
str = str .. ' <<'
game.print(str)
global.player_list.last_poke_tick[event.element.player_index] = game.tick
this.player_list.last_poke_tick[event.element.player_index] = game.tick
local p = game.players[poked_player]
global.player_list.pokes[p.index] = global.player_list.pokes[p.index] + 1
this.player_list.pokes[p.index] = this.player_list.pokes[p.index] + 1
end
end
end
@@ -640,16 +667,16 @@ local function refresh()
if frame.name ~= 'Players' then
return
end
player_list_show(player, frame, global.player_list.sorting_method[player.index])
player_list_show(player, frame, this.player_list.sorting_method[player.index])
end
end
end
local function on_player_joined_game(event)
if not global.player_list.last_poke_tick[event.player_index] then
global.player_list.pokes[event.player_index] = 0
global.player_list.last_poke_tick[event.player_index] = 0
global.player_list.sorting_method[event.player_index] = 'total_time_played_desc'
if not this.player_list.last_poke_tick[event.player_index] then
this.player_list.pokes[event.player_index] = 0
this.player_list.last_poke_tick[event.player_index] = 0
this.player_list.sorting_method[event.player_index] = 'total_time_played_desc'
end
refresh()
end
@@ -658,16 +685,20 @@ local function on_player_left_game()
refresh()
end
local on_init = function()
global.player_list = {}
global.player_list.last_poke_tick = {}
global.player_list.pokes = {}
global.player_list.sorting_method = {}
--- If the different roles should be shown in the player_list.
---@param value string
function Public.show_roles_in_list(value)
if value then
this.show_roles_in_list = value
end
return this.show_roles_in_list
end
comfy_panel_tabs['Players'] = {gui = player_list_show, admin = false}
Event.on_init(on_init)
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_player_left_game, on_player_left_game)
Event.add(defines.events.on_gui_click, on_gui_click)
return Public

View File

@@ -14,6 +14,7 @@ require 'modules.mineable_wreckage_yields_scrap'
require 'modules.charging_station'
local Autostash = require 'modules.autostash'
local PL = require 'comfy_panel.player_list'
local CS = require 'maps.mountain_fortress_v3.surface'
local Map_score = require 'comfy_panel.map_score'
local Server = require 'utils.server'
@@ -72,9 +73,6 @@ local collapse_kill = {
enabled = true
}
local add_to_config = function()
end
local disable_tech = function()
game.forces.player.technologies['landfill'].enabled = false
game.forces.player.technologies['optics'].researched = true
@@ -258,6 +256,9 @@ function Public.reset_map()
Entities.set_scores()
AntiGrief.log_tree_harvest(true)
AntiGrief.whitelist_types('tree', true)
AntiGrief.enable_capsule_warning(true)
PL.show_roles_in_list(true)
local players = game.connected_players
for i = 1, #players do
@@ -735,7 +736,6 @@ local on_tick = function()
end
local on_init = function()
add_to_config()
local this = WPT.get()
Public.reset_map()

View File

@@ -1,5 +1,6 @@
local Gui = require 'utils.gui'
local Event = require 'utils.event'
local AntiGrief = require 'antigrief'
local Color = require 'utils.color_presets'
local Alert = require 'utils.alert'
@@ -8,6 +9,7 @@ local Math2D = require 'math2d'
--RPG Modules
local RPG = require 'modules.rpg.table'
local Spells = require 'modules.rpg.spells'
local Settings = require 'modules.rpg.settings'
local Functions = require 'modules.rpg.functions'
local RPG_GUI = require 'modules.rpg.gui'
@@ -16,8 +18,8 @@ local RPG_GUI = require 'modules.rpg.gui'
local enemy_types = RPG.enemy_types
local die_cause = RPG.die_cause
local rpg_frame_icons = RPG.rpg_frame_icons
local conjure_items = RPG.conjure_items
local projectile_types = RPG.projectile_types
local conjure_items = Spells.conjure_items
local projectile_types = Spells.projectile_types
local points_per_level = RPG.points_per_level
local nth_tick = RPG.nth_tick
local visuals_delay = RPG.visuals_delay
@@ -1046,6 +1048,8 @@ local function on_player_used_capsule(event)
rpg_t[player.index].last_spawned = game.tick + object.tick
Functions.update_mana(player)
AntiGrief.insert_into_capsule_history(player, position)
return p('You wave your wand and ' .. object_name .. ' appears.', Color.success)
end

View File

@@ -1,4 +1,5 @@
local RPG = require 'modules.rpg.table'
local Spells = require 'modules.rpg.spells'
local Gui = require 'utils.gui'
local P = require 'player_modifiers'
local Session = require 'utils.session_data'
@@ -28,7 +29,7 @@ function Public.extra_settings(player)
local rpg_extra = RPG.get('rpg_extra')
local rpg_t = RPG.get('rpg_t')
local trusted = Session.get_trusted_table()
local conjure_items = RPG.conjure_items
local conjure_items = Spells.conjure_items
local main_frame =
player.gui.screen.add(
{

314
modules/rpg/spells.lua Normal file
View File

@@ -0,0 +1,314 @@
local Public = {}
Public.conjure_items = {
[1] = {
name = 'Stone Wall',
obj_to_create = 'stone-wall',
level = 10,
type = 'item',
mana_cost = 35,
tick = 160,
enabled = true
},
[2] = {
name = 'Wooden Chest',
obj_to_create = 'wooden-chest',
level = 2,
type = 'item',
mana_cost = 30,
tick = 160,
enabled = true
},
[3] = {
name = 'Iron Chest',
obj_to_create = 'iron-chest',
level = 10,
type = 'item',
mana_cost = 40,
tick = 260,
enabled = true
},
[4] = {
name = 'Steel Chest',
obj_to_create = 'steel-chest',
level = 15,
type = 'item',
mana_cost = 50,
tick = 360,
enabled = true
},
[5] = {
name = 'Transport Belt',
obj_to_create = 'transport-belt',
level = 3,
type = 'item',
mana_cost = 40,
tick = 160,
enabled = true
},
[6] = {
name = 'Fast Transport Belt',
obj_to_create = 'fast-transport-belt',
level = 20,
type = 'item',
mana_cost = 50,
tick = 260,
enabled = true
},
[7] = {
name = 'Express Transport Belt',
obj_to_create = 'express-transport-belt',
level = 60,
type = 'item',
mana_cost = 60,
tick = 360,
enabled = true
},
[8] = {
name = 'Underground Belt',
obj_to_create = 'underground-belt',
level = 3,
type = 'item',
mana_cost = 40,
tick = 160,
enabled = true
},
[9] = {
name = 'Fast Underground Belt',
obj_to_create = 'fast-underground-belt',
level = 20,
type = 'item',
mana_cost = 50,
tick = 260,
enabled = true
},
[10] = {
name = 'Express Underground Belt',
obj_to_create = 'express-underground-belt',
level = 60,
type = 'item',
mana_cost = 60,
tick = 360,
enabled = true
},
[11] = {
name = 'Sandy Rock',
obj_to_create = 'sand-rock-big',
level = 80,
type = 'entity',
mana_cost = 80,
tick = 420,
enabled = true
},
[12] = {
name = 'Smol Biter',
obj_to_create = 'small-biter',
level = 50,
biter = true,
type = 'entity',
mana_cost = 55,
tick = 100,
enabled = true
},
[13] = {
name = 'Smol Spitter',
obj_to_create = 'small-spitter',
level = 50,
biter = true,
type = 'entity',
mana_cost = 55,
tick = 100,
enabled = true
},
[14] = {
name = 'Medium Biter',
obj_to_create = 'medium-biter',
level = 70,
biter = true,
type = 'entity',
mana_cost = 100,
tick = 200,
enabled = true
},
[15] = {
name = 'Medium Spitter',
obj_to_create = 'medium-spitter',
level = 70,
type = 'entity',
mana_cost = 100,
tick = 200,
enabled = true
},
[16] = {
name = 'Bitter Spawner',
obj_to_create = 'biter-spawner',
level = 100,
biter = true,
type = 'entity',
mana_cost = 600,
tick = 1420,
enabled = true
},
[17] = {
name = 'Spitter Spawner',
obj_to_create = 'spitter-spawner',
level = 100,
biter = true,
type = 'entity',
mana_cost = 600,
tick = 1420,
enabled = true
},
[18] = {
name = 'AOE Grenade',
obj_to_create = 'grenade',
target = true,
amount = 1,
damage = true,
force = 'player',
level = 30,
type = 'special',
mana_cost = 100,
tick = 150,
enabled = true
},
[19] = {
name = 'Big AOE Grenade',
obj_to_create = 'cluster-grenade',
target = true,
amount = 2,
damage = true,
force = 'player',
level = 50,
type = 'special',
mana_cost = 150,
tick = 200,
enabled = true
},
[20] = {
name = 'Pointy Rocket',
obj_to_create = 'rocket',
range = 240,
target = true,
amount = 4,
damage = true,
force = 'enemy',
level = 40,
type = 'special',
mana_cost = 60,
tick = 320,
enabled = true
},
[21] = {
name = 'Bitter Spew',
obj_to_create = 'acid-stream-spitter-big',
target = true,
amount = 2,
range = 0,
damage = true,
force = 'player',
level = 70,
type = 'special',
mana_cost = 90,
tick = 200,
enabled = true
},
[22] = {
name = 'Fire my lazors!!',
obj_to_create = 'railgun-beam',
target = false,
amount = 3,
damage = true,
range = 240,
force = 'player',
level = 50,
type = 'special',
mana_cost = 66,
tick = 320,
enabled = true
},
[23] = {
name = 'Conjure Raw-fish',
obj_to_create = 'fish',
target = false,
amount = 4,
damage = false,
range = 30,
force = 'player',
level = 50,
type = 'special',
mana_cost = 120,
tick = 320,
enabled = true
},
[24] = {
name = 'Suicidal Comfylatron',
obj_to_create = 'suicidal_comfylatron',
target = false,
amount = 4,
damage = false,
range = 30,
force = 'player',
level = 60,
type = 'special',
mana_cost = 250,
tick = 320,
enabled = true
},
[25] = {
name = 'Distractor Capsule',
obj_to_create = 'distractor-capsule',
target = true,
amount = 1,
damage = false,
range = 30,
force = 'player',
level = 60,
type = 'special',
mana_cost = 200,
tick = 320,
enabled = true
}
}
Public.projectile_types = {
['explosives'] = {name = 'grenade', count = 0.5, max_range = 32, tick_speed = 1},
['land-mine'] = {name = 'grenade', count = 1, max_range = 32, tick_speed = 1},
['grenade'] = {name = 'grenade', count = 1, max_range = 40, tick_speed = 1},
['cluster-grenade'] = {name = 'cluster-grenade', count = 1, max_range = 40, tick_speed = 3},
['artillery-shell'] = {name = 'artillery-projectile', count = 1, max_range = 60, tick_speed = 3},
['cannon-shell'] = {name = 'cannon-projectile', count = 1, max_range = 60, tick_speed = 1},
['explosive-cannon-shell'] = {name = 'explosive-cannon-projectile', count = 1, max_range = 60, tick_speed = 1},
['explosive-uranium-cannon-shell'] = {
name = 'explosive-uranium-cannon-projectile',
count = 1,
max_range = 60,
tick_speed = 1
},
['uranium-cannon-shell'] = {name = 'uranium-cannon-projectile', count = 1, max_range = 60, tick_speed = 1},
['atomic-bomb'] = {name = 'atomic-rocket', count = 1, max_range = 80, tick_speed = 20},
['explosive-rocket'] = {name = 'explosive-rocket', count = 1, max_range = 48, tick_speed = 1},
['rocket'] = {name = 'rocket', count = 1, max_range = 48, tick_speed = 1},
['flamethrower-ammo'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 28, tick_speed = 1},
['crude-oil-barrel'] = {name = 'flamethrower-fire-stream', count = 3, max_range = 24, tick_speed = 1},
['petroleum-gas-barrel'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 24, tick_speed = 1},
['light-oil-barrel'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 24, tick_speed = 1},
['heavy-oil-barrel'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 24, tick_speed = 1},
['acid-stream-spitter-big'] = {
name = 'acid-stream-spitter-big',
count = 3,
max_range = 16,
tick_speed = 1,
force = 'enemy'
},
['lubricant-barrel'] = {name = 'acid-stream-spitter-big', count = 3, max_range = 16, tick_speed = 1},
['railgun-beam'] = {name = 'railgun-beam', count = 5, max_range = 40, tick_speed = 5},
['shotgun-shell'] = {name = 'shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['piercing-shotgun-shell'] = {name = 'piercing-shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['firearm-magazine'] = {name = 'shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['piercing-rounds-magazine'] = {name = 'piercing-shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['uranium-rounds-magazine'] = {name = 'piercing-shotgun-pellet', count = 32, max_range = 24, tick_speed = 1},
['cliff-explosives'] = {name = 'cliff-explosives', count = 1, max_range = 48, tick_speed = 2}
}
return Public

View File

@@ -79,317 +79,6 @@ Public.classes = {
['vitality'] = 'SOLDIER'
}
Public.conjure_items = {
[1] = {
name = 'Stone Wall',
obj_to_create = 'stone-wall',
level = 10,
type = 'item',
mana_cost = 35,
tick = 160,
enabled = true
},
[2] = {
name = 'Wooden Chest',
obj_to_create = 'wooden-chest',
level = 2,
type = 'item',
mana_cost = 30,
tick = 160,
enabled = true
},
[3] = {
name = 'Iron Chest',
obj_to_create = 'iron-chest',
level = 10,
type = 'item',
mana_cost = 40,
tick = 260,
enabled = true
},
[4] = {
name = 'Steel Chest',
obj_to_create = 'steel-chest',
level = 15,
type = 'item',
mana_cost = 50,
tick = 360,
enabled = true
},
[5] = {
name = 'Transport Belt',
obj_to_create = 'transport-belt',
level = 3,
type = 'item',
mana_cost = 40,
tick = 160,
enabled = true
},
[6] = {
name = 'Fast Transport Belt',
obj_to_create = 'fast-transport-belt',
level = 20,
type = 'item',
mana_cost = 50,
tick = 260,
enabled = true
},
[7] = {
name = 'Express Transport Belt',
obj_to_create = 'express-transport-belt',
level = 60,
type = 'item',
mana_cost = 60,
tick = 360,
enabled = true
},
[8] = {
name = 'Underground Belt',
obj_to_create = 'underground-belt',
level = 3,
type = 'item',
mana_cost = 40,
tick = 160,
enabled = true
},
[9] = {
name = 'Fast Underground Belt',
obj_to_create = 'fast-underground-belt',
level = 20,
type = 'item',
mana_cost = 50,
tick = 260,
enabled = true
},
[10] = {
name = 'Express Underground Belt',
obj_to_create = 'express-underground-belt',
level = 60,
type = 'item',
mana_cost = 60,
tick = 360,
enabled = true
},
[11] = {
name = 'Sandy Rock',
obj_to_create = 'sand-rock-big',
level = 80,
type = 'entity',
mana_cost = 80,
tick = 420,
enabled = true
},
[12] = {
name = 'Smol Biter',
obj_to_create = 'small-biter',
level = 50,
biter = true,
type = 'entity',
mana_cost = 55,
tick = 100,
enabled = true
},
[13] = {
name = 'Smol Spitter',
obj_to_create = 'small-spitter',
level = 50,
biter = true,
type = 'entity',
mana_cost = 55,
tick = 100,
enabled = true
},
[14] = {
name = 'Medium Biter',
obj_to_create = 'medium-biter',
level = 70,
biter = true,
type = 'entity',
mana_cost = 100,
tick = 200,
enabled = true
},
[15] = {
name = 'Medium Spitter',
obj_to_create = 'medium-spitter',
level = 70,
type = 'entity',
mana_cost = 100,
tick = 200,
enabled = true
},
[16] = {
name = 'Bitter Spawner',
obj_to_create = 'biter-spawner',
level = 100,
biter = true,
type = 'entity',
mana_cost = 600,
tick = 1420,
enabled = true
},
[17] = {
name = 'Spitter Spawner',
obj_to_create = 'spitter-spawner',
level = 100,
biter = true,
type = 'entity',
mana_cost = 600,
tick = 1420,
enabled = true
},
[18] = {
name = 'AOE Grenade',
obj_to_create = 'grenade',
target = true,
amount = 1,
damage = true,
force = 'player',
level = 30,
type = 'special',
mana_cost = 100,
tick = 150,
enabled = true
},
[19] = {
name = 'Big AOE Grenade',
obj_to_create = 'cluster-grenade',
target = true,
amount = 2,
damage = true,
force = 'player',
level = 50,
type = 'special',
mana_cost = 150,
tick = 200,
enabled = true
},
[20] = {
name = 'Pointy Rocket',
obj_to_create = 'rocket',
range = 240,
target = true,
amount = 4,
damage = true,
force = 'enemy',
level = 40,
type = 'special',
mana_cost = 60,
tick = 320,
enabled = true
},
[21] = {
name = 'Bitter Spew',
obj_to_create = 'acid-stream-spitter-big',
target = true,
amount = 2,
range = 0,
damage = true,
force = 'player',
level = 70,
type = 'special',
mana_cost = 90,
tick = 200,
enabled = true
},
[22] = {
name = 'Fire my lazors!!',
obj_to_create = 'railgun-beam',
target = false,
amount = 3,
damage = true,
range = 240,
force = 'player',
level = 50,
type = 'special',
mana_cost = 66,
tick = 320,
enabled = true
},
[23] = {
name = 'Conjure Raw-fish',
obj_to_create = 'fish',
target = false,
amount = 4,
damage = false,
range = 30,
force = 'player',
level = 50,
type = 'special',
mana_cost = 120,
tick = 320,
enabled = true
},
[24] = {
name = 'Suicidal Comfylatron',
obj_to_create = 'suicidal_comfylatron',
target = false,
amount = 4,
damage = false,
range = 30,
force = 'player',
level = 60,
type = 'special',
mana_cost = 250,
tick = 320,
enabled = true
},
[25] = {
name = 'Distractor Capsule',
obj_to_create = 'distractor-capsule',
target = true,
amount = 1,
damage = false,
range = 30,
force = 'player',
level = 60,
type = 'special',
mana_cost = 200,
tick = 320,
enabled = true
}
}
Public.projectile_types = {
['explosives'] = {name = 'grenade', count = 0.5, max_range = 32, tick_speed = 1},
['land-mine'] = {name = 'grenade', count = 1, max_range = 32, tick_speed = 1},
['grenade'] = {name = 'grenade', count = 1, max_range = 40, tick_speed = 1},
['cluster-grenade'] = {name = 'cluster-grenade', count = 1, max_range = 40, tick_speed = 3},
['artillery-shell'] = {name = 'artillery-projectile', count = 1, max_range = 60, tick_speed = 3},
['cannon-shell'] = {name = 'cannon-projectile', count = 1, max_range = 60, tick_speed = 1},
['explosive-cannon-shell'] = {name = 'explosive-cannon-projectile', count = 1, max_range = 60, tick_speed = 1},
['explosive-uranium-cannon-shell'] = {
name = 'explosive-uranium-cannon-projectile',
count = 1,
max_range = 60,
tick_speed = 1
},
['uranium-cannon-shell'] = {name = 'uranium-cannon-projectile', count = 1, max_range = 60, tick_speed = 1},
['atomic-bomb'] = {name = 'atomic-rocket', count = 1, max_range = 80, tick_speed = 20},
['explosive-rocket'] = {name = 'explosive-rocket', count = 1, max_range = 48, tick_speed = 1},
['rocket'] = {name = 'rocket', count = 1, max_range = 48, tick_speed = 1},
['flamethrower-ammo'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 28, tick_speed = 1},
['crude-oil-barrel'] = {name = 'flamethrower-fire-stream', count = 3, max_range = 24, tick_speed = 1},
['petroleum-gas-barrel'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 24, tick_speed = 1},
['light-oil-barrel'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 24, tick_speed = 1},
['heavy-oil-barrel'] = {name = 'flamethrower-fire-stream', count = 4, max_range = 24, tick_speed = 1},
['acid-stream-spitter-big'] = {
name = 'acid-stream-spitter-big',
count = 3,
max_range = 16,
tick_speed = 1,
force = 'enemy'
},
['lubricant-barrel'] = {name = 'acid-stream-spitter-big', count = 3, max_range = 16, tick_speed = 1},
['railgun-beam'] = {name = 'railgun-beam', count = 5, max_range = 40, tick_speed = 5},
['shotgun-shell'] = {name = 'shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['piercing-shotgun-shell'] = {name = 'piercing-shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['firearm-magazine'] = {name = 'shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['piercing-rounds-magazine'] = {name = 'piercing-shotgun-pellet', count = 16, max_range = 24, tick_speed = 1},
['uranium-rounds-magazine'] = {name = 'piercing-shotgun-pellet', count = 32, max_range = 24, tick_speed = 1},
['cliff-explosives'] = {name = 'cliff-explosives', count = 1, max_range = 48, tick_speed = 2}
}
function Public.reset_table()
this.rpg_extra.debug = false
this.rpg_extra.breached_walls = 1
@@ -460,6 +149,8 @@ function Public.toggle_debug()
else
this.rpg_extra.debug = true
end
return this.rpg_extra.debug
end
--- Debug only - when you need to troubleshoot.
@@ -479,6 +170,8 @@ function Public.set_surface_name(name)
else
return error('No surface name given.', 2)
end
return this.rpg_extra.surface_name
end
--- Enables the bars that shows above the player character.
@@ -490,6 +183,8 @@ function Public.enable_health_and_mana_bars(value)
else
this.rpg_extra.enable_health_and_mana_bars = false
end
return this.rpg_extra.enable_health_and_mana_bars
end
--- Enables the mana feature that allows players to spawn entities.
@@ -500,6 +195,8 @@ function Public.enable_mana(value)
else
this.rpg_extra.enable_mana = false
end
return this.rpg_extra.enable_mana
end
--- This should only be enabled if wave_defense is enabled.
@@ -511,6 +208,8 @@ function Public.enable_wave_defense(value)
else
this.rpg_extra.enable_wave_defense = false
end
return this.rpg_extra.enable_wave_defense
end
--- Enables/disabled flame boots.
@@ -521,6 +220,8 @@ function Public.enable_flame_boots(value)
else
this.rpg_extra.enable_flame_boots = false
end
return this.rpg_extra.enable_flame_boots
end
--- Enables/disabled personal tax.
@@ -529,8 +230,10 @@ function Public.personal_tax_rate(value)
if value then
this.rpg_extra.personal_tax_rate = value
else
this.rpg_extra.personal_tax_rate = nil
this.rpg_extra.personal_tax_rate = false
end
return this.rpg_extra.personal_tax_rate
end
--- Enables/disabled stone-path-tile creation on mined.
@@ -539,8 +242,10 @@ function Public.enable_stone_path(value)
if value then
this.rpg_extra.enable_stone_path = value
else
this.rpg_extra.enable_stone_path = nil
this.rpg_extra.enable_stone_path = false
end
return this.rpg_extra.enable_stone_path
end
--- Enables/disabled stone-path-tile creation on mined.
@@ -549,8 +254,10 @@ function Public.enable_one_punch(value)
if value then
this.rpg_extra.enable_one_punch = value
else
this.rpg_extra.enable_one_punch = nil
this.rpg_extra.enable_one_punch = false
end
return this.rpg_extra.enable_one_punch
end
--- Enables/disabled stone-path-tile creation on mined.
@@ -559,8 +266,10 @@ function Public.enable_one_punch_globally(value)
if value then
this.rpg_extra.enable_one_punch_globally = value
else
this.rpg_extra.enable_one_punch_globally = nil
this.rpg_extra.enable_one_punch_globally = false
end
return this.rpg_extra.enable_one_punch_globally
end
Public.settings_frame_name = settings_frame_name