Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accidental globals and references to undeclared variables #819

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions angelsaddons-mobility/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ angelsmods.addons.mobility.smeltingtrain.number_tint = {r = 1, g = 0.38, b = 0,



tech_unlocks = {}

require("prototypes.categories")
--CRAWLER
require("prototypes.entities.crawler-locomotive")
Expand All @@ -45,5 +43,3 @@ require("prototypes.technology.crawler-technology")
require("prototypes.technology.petro-technology")
--SMELTING
require("prototypes.technology.smelting-technology")

tech_unlocks = nil
4 changes: 3 additions & 1 deletion angelsaddons-mobility/prototypes/train-functions.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require("util")

local tech_unlocks = {}

local function set_type(name)
local train_type
if string.find(name,"crawler") then
Expand Down Expand Up @@ -34,7 +36,7 @@ local function add_speed_locale()
end

local function generate_additional_pastable_entities(name)
all_entity_names = {}
local all_entity_names = {}
for _, entity_type_name in pairs{
"crawler-locomotive",
"crawler-locomotive-wagon",
Expand Down
10 changes: 6 additions & 4 deletions angelsexploration/prototypes/entities/biter-builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ local function new_random_seed()
return enemy_random_seed
end

local control_name = "enemy-base"

-- Copy from base.. since local...
local function enemy_autoplace(params)
local distance_factor = params.distance_factor or 1
Expand Down Expand Up @@ -825,7 +827,7 @@ local function make_attack_parameter(data_app, data_dmg)
damage_modifier = data_dmg.damage_modifier,
warmup = data_dmg.warmup,
ammo_type = data_dmg.ammo,
sound = make_roar_sound(data_app.type, volume),
sound = make_roar_sound(data_app.type, nil), -- TODO: replace nil with atual volume
animation = make_attack_animation(data_app)
}
end
Expand Down Expand Up @@ -1048,11 +1050,11 @@ function angelsmods.functions.update_spawner(us_data)
--log(serpent.block(spawner))
spawner.resistances = spawner.resistances or {}
for _,new_resistance_data in pairs(us_data.resistance or {}) do
local existing_resistace = false
local existing_resistance = false
for old_resistance_index,old_resistance_data in pairs(spawner.resistances) do
if old_resistance_data.type == new_resistance_data.type then
spawner.resistances[old_resistance_index] = new_resistance_data
existing_resistace = true
existing_resistance = true
break
end
end
Expand All @@ -1072,7 +1074,7 @@ function angelsmods.functions.update_spawner(us_data)
break
end
end
if not existing_resistance then
if not existing_result_unit then
table.insert(spawner.result_units, new_result_unit_data)
end
end
Expand Down
52 changes: 28 additions & 24 deletions angelsexploration/prototypes/entities/biter-definitions.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local biter_definitions = {}

--HEALTH:
--SCARAB: 150/300/450/600/750
--BITER 100/200/300/400/500
Expand All @@ -23,7 +25,7 @@
-------------------------------------------------------------------------------
-- BITER DEFINITIONS ----------------------------------------------------------
-------------------------------------------------------------------------------
small_biter =
biter_definitions.small_biter =
{
appearance = {
type = "biter",
Expand Down Expand Up @@ -59,7 +61,7 @@ small_biter =
--}
}

medium_biter =
biter_definitions.medium_biter =
{
appearance = {
type = "biter",
Expand Down Expand Up @@ -92,7 +94,7 @@ medium_biter =
}
}

big_biter =
biter_definitions.big_biter =
{
appearance = {
type = "biter",
Expand Down Expand Up @@ -125,7 +127,7 @@ big_biter =
}
}

behemoth_biter =
biter_definitions.behemoth_biter =
{
appearance = {
type = "biter",
Expand Down Expand Up @@ -158,7 +160,7 @@ behemoth_biter =
}
}

colossal_biter =
biter_definitions.colossal_biter =
{
appearance = {
type = "biter",
Expand Down Expand Up @@ -196,7 +198,7 @@ colossal_biter =
-------------------------------------------------------------------------------
-- SPITTER DEFINITIONS --------------------------------------------------------
-------------------------------------------------------------------------------
small_spitter =
biter_definitions.small_spitter =
{
appearance = {
type = "spitter",
Expand Down Expand Up @@ -227,7 +229,7 @@ small_spitter =
}
}

medium_spitter =
biter_definitions.medium_spitter =
{
appearance = {
type = "spitter",
Expand Down Expand Up @@ -258,7 +260,7 @@ medium_spitter =
}
}

big_spitter =
biter_definitions.big_spitter =
{
appearance = {
type = "spitter",
Expand Down Expand Up @@ -289,7 +291,7 @@ big_spitter =
}
}

behemoth_spitter =
biter_definitions.behemoth_spitter =
{
appearance = {
type = "spitter",
Expand Down Expand Up @@ -320,7 +322,7 @@ behemoth_spitter =
}
}

colossal_spitter =
biter_definitions.colossal_spitter =
{
appearance = {
type = "spitter",
Expand Down Expand Up @@ -356,7 +358,7 @@ colossal_spitter =
-------------------------------------------------------------------------------
-- SCARAB DEFINITIONS ---------------------------------------------------------
-------------------------------------------------------------------------------
small_scarab =
biter_definitions.small_scarab =
{
appearance = {
type = "scarab",
Expand Down Expand Up @@ -387,7 +389,7 @@ small_scarab =
}
}

medium_scarab =
biter_definitions.medium_scarab =
{
appearance = {
type = "scarab",
Expand Down Expand Up @@ -418,7 +420,7 @@ medium_scarab =
}
}

big_scarab =
biter_definitions.big_scarab =
{
appearance = {
type = "scarab",
Expand Down Expand Up @@ -449,7 +451,7 @@ big_scarab =
}
}

behemoth_scarab =
biter_definitions.behemoth_scarab =
{
appearance = {
type = "scarab",
Expand Down Expand Up @@ -480,7 +482,7 @@ behemoth_scarab =
}
}

colossal_scarab =
biter_definitions.colossal_scarab =
{
appearance = {
type = "scarab",
Expand Down Expand Up @@ -514,7 +516,7 @@ colossal_scarab =
-------------------------------------------------------------------------------
-- PSYKER DEFINITIONS ---------------------------------------------------------
-------------------------------------------------------------------------------
small_psyker =
biter_definitions.small_psyker =
{
appearance = {
type = "psyker",
Expand Down Expand Up @@ -545,7 +547,7 @@ small_psyker =
}
}

medium_psyker =
biter_definitions.medium_psyker =
{
appearance = {
type = "psyker",
Expand Down Expand Up @@ -576,7 +578,7 @@ medium_psyker =
}
}

big_psyker =
biter_definitions.big_psyker =
{
appearance = {
type = "psyker",
Expand Down Expand Up @@ -607,7 +609,7 @@ big_psyker =
}
}

behemoth_psyker =
biter_definitions.behemoth_psyker =
{
appearance = {
type = "psyker",
Expand Down Expand Up @@ -638,7 +640,7 @@ behemoth_psyker =
}
}

colossal_psyker =
biter_definitions.colossal_psyker =
{
appearance = {
type = "psyker",
Expand Down Expand Up @@ -672,7 +674,7 @@ colossal_psyker =
-------------------------------------------------------------------------------
-- SPAWNER DEFINITIONS --------------------------------------------------------
-------------------------------------------------------------------------------
biter_spawner =
biter_definitions.biter_spawner =
{
appearance = {
type = "biter",
Expand All @@ -693,7 +695,7 @@ biter_spawner =
}
}

spitter_spawner =
biter_definitions.spitter_spawner =
{
appearance = {
type = "spitter",
Expand All @@ -714,7 +716,7 @@ spitter_spawner =
}
}

scarab_spawner =
biter_definitions.scarab_spawner =
{
appearance = {
type = "scarab",
Expand All @@ -740,7 +742,7 @@ scarab_spawner =
}
}

psyker_spawner =
biter_definitions.psyker_spawner =
{
appearance = {
type = "psyker",
Expand All @@ -766,3 +768,5 @@ psyker_spawner =
{type = "plasma", decrease = 5, percent = 10}
}
}

return biter_definitions
30 changes: 15 additions & 15 deletions angelsexploration/prototypes/entities/biter.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
-- INCLUDE BUILDER PROPERTIES
require("prototypes.entities.biter-definitions")
local biter_definitions = require("prototypes.entities.biter-definitions")

-- EXECUTE
angelsmods.functions.make_alien(colossal_biter)
angelsmods.functions.make_alien(biter_definitions.colossal_biter)

angelsmods.functions.make_alien(colossal_spitter)
angelsmods.functions.make_alien(biter_definitions.colossal_spitter)

angelsmods.functions.make_alien(small_scarab)
angelsmods.functions.make_alien(medium_scarab)
angelsmods.functions.make_alien(big_scarab)
angelsmods.functions.make_alien(behemoth_scarab)
angelsmods.functions.make_alien(colossal_scarab)
angelsmods.functions.make_alien(biter_definitions.small_scarab)
angelsmods.functions.make_alien(biter_definitions.medium_scarab)
angelsmods.functions.make_alien(biter_definitions.big_scarab)
angelsmods.functions.make_alien(biter_definitions.behemoth_scarab)
angelsmods.functions.make_alien(biter_definitions.colossal_scarab)

angelsmods.functions.make_alien(small_psyker)
angelsmods.functions.make_alien(medium_psyker)
angelsmods.functions.make_alien(big_psyker)
angelsmods.functions.make_alien(behemoth_psyker)
angelsmods.functions.make_alien(colossal_psyker)
angelsmods.functions.make_alien(biter_definitions.small_psyker)
angelsmods.functions.make_alien(biter_definitions.medium_psyker)
angelsmods.functions.make_alien(biter_definitions.big_psyker)
angelsmods.functions.make_alien(biter_definitions.behemoth_psyker)
angelsmods.functions.make_alien(biter_definitions.colossal_psyker)

angelsmods.functions.make_alien_spawner(scarab_spawner)
angelsmods.functions.make_alien_spawner(psyker_spawner)
angelsmods.functions.make_alien_spawner(biter_definitions.scarab_spawner)
angelsmods.functions.make_alien_spawner(biter_definitions.psyker_spawner)
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ function angelsmods.functions.create_gathering_turret_beam_body(inputs)
width = 32,
height = 39,
frame_count = 16,
tint = beam_tint,
blend_mode = inputs.blend_mode
},
{
Expand Down
23 changes: 18 additions & 5 deletions angelsexploration/prototypes/entities/vehicles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,25 @@ data:extend(
projectile_center = {-0.15625, -0.07812},
projectile_creation_distance = 1,
range = 20,
sound = heavy_gunshot --[[{
sound =
{
filename="__base__/prototypes/entity/sounds/heavy_gunshot.ogg",--make_heavy_gunshot_sounds()
volume=1.0,
}
},]]
{
filename = "__base__/sound/fight/heavy-gunshot-1.ogg",
volume = 0.4
},
{
filename = "__base__/sound/fight/heavy-gunshot-2.ogg",
volume = 0.4
},
{
filename = "__base__/sound/fight/heavy-gunshot-3.ogg",
volume = 0.4
},
{
filename = "__base__/sound/fight/heavy-gunshot-4.ogg",
volume = 0.4
}
},
},
stack_size = 1
},
Expand Down
Loading