Reorganize files

This commit is contained in:
David Skrundz 2020-04-25 21:48:47 -06:00
parent cca2c2a70f
commit 4ed9aca3b1
No known key found for this signature in database
GPG Key ID: 9A0FA0614CE9422E
354 changed files with 2511 additions and 1962 deletions

View File

@ -1,274 +0,0 @@
Baseless = {}
Baseless.Needs = {}
-- FIXME
Baseless.RenderLayer = "water-tile"
Baseless.Image = "__core__/graphics/empty.png"
Baseless.Image32 = "__core__/graphics/factorio-icon.png"
Baseless.Sound =
{
filename = "__core__/sound/achievement-unlocked.ogg",
}
Baseless.RotatedAnimation =
{
filename = Baseless.Image,
size = 1,
direction_count = 18,
}
Baseless.RotatedAnimation32 =
{
filename = Baseless.Image32,
size = 1,
direction_count = 18,
}
Baseless.RotatedAnimation4Way = Baseless.RotatedAnimation
Baseless.RotatedAnimation4Way32 = Baseless.RotatedAnimation32
-- END
Baseless._AmmoType = {category = "dummy-ammo-category"}
Baseless.AmmoType = function (register)
if register then
Baseless.Needs.AmmoType = true
end
return Baseless._AmmoType
end
Baseless.AttackParameters = {}
Baseless.AttackParameters._Stream =
{
type = "stream",
range = 0,
cooldown = 0,
ammo_type = Baseless._AmmoType,
animation = Baseless.RotatedAnimation32,
}
Baseless.AttackParameters.Stream = function (register)
if register then
Baseless.AmmoType(true)
end
return Baseless.AttackParameters._Stream
end
Baseless._DamagePrototype =
{
amount = 1,
type = "dummy-damage-type",
}
Baseless.DamagePrototype = function (register)
if register then
Baseless.Needs.DamageType = true
end
return Baseless._DamagePrototype
end
Baseless.EnergySource = {}
Baseless.EnergySource._Burner =
{
type = "burner",
fuel_inventory_size = 0,
fuel_category = "dummy-fuel-category",
}
Baseless.EnergySource.Burner = function (register)
if register then
Baseless.Needs.FuelType = true
end
return Baseless.EnergySource._Burner
end
Baseless.EnergySource.Electric =
{
type = "electric",
usage_priority = "tertiary",
}
Baseless.EnergySource.Void =
{
type = "void",
usage_priority = "tertiary",
}
Baseless._ModuleType = "dummy-module-category"
Baseless.ModuleType = function (register)
if register then
Baseless.Needs.ModuleType = true
end
return Baseless._ModuleType
end
Baseless._RecipeType = "dummy-recipe-category"
Baseless.RecipeType = function (register)
if register then
Baseless.Needs.RecipeType = true
end
return Baseless._RecipeType
end
Baseless._ResourceType = "dummy-resource-category"
Baseless.ResourceType = function (register)
if register then
Baseless.Needs.ResourceType = true
end
return Baseless._ResourceType
end
Baseless._ScienceType = "dummy-science-pack"
Baseless.ScienceType = function (register)
if register then
Baseless.Needs.ScienceType = true
end
return Baseless._ScienceType
end
-- FIXME
Baseless.IconSpecification =
{
icon = Baseless.Image,
icon_size = 1,
}
Baseless.BoundingBox = {{0, 0}, {0, 0}}
Baseless.Color = {0, 0, 0}
Baseless.Sprite =
{
filename = Baseless.Image32,
size = 1,
}
Baseless.RotatedSprite =
{
filename = Baseless.Image,
size = 1,
direction_count = 1,
}
Baseless.SpriteVariations =
{
sheet = Baseless.Sprite,
}
Baseless.Animation =
{
filename = Baseless.Image32,
size = 1,
variation_count = 12,
}
Baseless.Animation4Way = Baseless.Animation
Baseless.AnimationVariations =
{
sheet = Baseless.Animation,
}
Baseless.RotatedAnimation =
{
filename = Baseless.Image32,
size = 1,
direction_count = 18,
}
Baseless.RotatedAnimation4Way = Baseless.RotatedAnimation
Baseless.Sprite4Way = Baseless.Sprite
Baseless.Sprite8Way =
{
sheets = {Baseless.Sprite},
}
Baseless.CombinatorOffsets =
{
{0, 0},
{0, 0},
{0, 0},
{0, 0},
}
Baseless.WireConnectionPoint = {}
Baseless.WireConnectionPoint.Combinator =
{
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
}
Baseless.WireConnectionPoint.Pole =
{
{wire = {}, shadow = {}},
}
Baseless.WireConnectionPoint.PowerSwitch = {wire = {}, shadow = {}}
Baseless.FluidBox = {pipe_connections = {}}
Baseless.HeatBuffer =
{
max_temperature = 15,
specific_heat = "1W",
max_transfer = "1W",
}
Baseless.TransportBeltConnectorFrame =
{
frame_main = Baseless.AnimationVariations,
frame_shadow = Baseless.AnimationVariations,
frame_main_scanner = Baseless.Animation,
frame_main_scanner_movement_speed = 1,
frame_main_scanner_horizontal_start_shift = {0, 0},
frame_main_scanner_horizontal_end_shift = {0, 0},
frame_main_scanner_horizontal_y_scale = 1,
frame_main_scanner_horizontal_rotation = 0,
frame_main_scanner_vertical_start_shift = {0, 0},
frame_main_scanner_vertical_end_shift = {0, 0},
frame_main_scanner_vertical_y_scale = 1,
frame_main_scanner_vertical_rotation = 0,
frame_main_scanner_cross_horizontal_start_shift = {0, 0},
frame_main_scanner_cross_horizontal_end_shift = {0, 0},
frame_main_scanner_cross_horizontal_y_scale = 1,
frame_main_scanner_cross_horizontal_rotation = 0,
frame_main_scanner_cross_vertical_start_shift = {0, 0},
frame_main_scanner_cross_vertical_end_shift = {0, 0},
frame_main_scanner_cross_vertical_y_scale = 1,
frame_main_scanner_cross_vertical_rotation = 0,
frame_main_scanner_nw_ne = Baseless.Animation,
frame_main_scanner_sw_se = Baseless.Animation,
}
Baseless.BeltAnimation =
{
filename = Baseless.Image32,
size = 1,
variation_count = 1,
direction_count = 12,
}
Baseless.EquipmentShape =
{
width = 1,
height = 1,
type = "full",
}
Baseless.TileTransitionSprite =
{
count = 1,
picture = Baseless.Image32,
size = 1,
}
Baseless.Transitions =
{
main = {Baseless.TileTransitionSprite},
empty_transitions = true,
}
-- END

11
Baseless/Baseless.lua Normal file
View File

@ -0,0 +1,11 @@
Baseless = {}
Baseless.PrototypeCount = 0
require("Data")
require("Graphics")
require("Register")
require("Sound")
Baseless.Make = {}
Baseless.Needs = {}
require("prototypes.constructors")

78
Baseless/Data.lua Normal file
View File

@ -0,0 +1,78 @@
Baseless.Data = {}
Baseless.Data.BoundingBox = {{-1, -1}, {1, 1}}
Baseless.Data.CollisionMask = {}
Baseless.Data.Color = {}
Baseless.Data.DaytimeColorLookupTable = {{1, "identity"}}
Baseless.Data.Effect = {}
Baseless.Data.Energy = "1W"
Baseless.Data.FluidBox = {pipe_connections = {}}
Baseless.Data.ModuleSpecification = {}
Baseless.Data.SelectionType = "not-allowed"
Baseless.Data.SelectionMode = {"nothing"}
Baseless.Data.SpeechBubbleStyle = "compilatron_speech_bubble"
Baseless.Data.AmmoType = {category = "dummy-ammo-category"}
Baseless.Data.EquipmentType = "dummy-equipment-category"
Baseless.Data.FuelType = "dummy-fuel-category"
Baseless.Data.ModuleType = "dummy-module-category"
Baseless.Data.RecipeType = "dummy-recipe-category"
Baseless.Data.ResourceType = "dummy-resource-category"
Baseless.Data.Fluid = "dummy-fluid"
Baseless.Data.Group = "other"
Baseless.Data.CurvedRailEntity = "dummy-curved-rail"
Baseless.Data.RocketEntity = "dummy-rocket-silo-rocket"
Baseless.Data.StraightRailEntity = "dummy-straight-rail"
Baseless.Data.UnitEntity = "dummy-unit"
Baseless.Data.GunItem = "dummy-gun"
Baseless.Data.Particle = "dummy-optimized-particle"
Baseless.Data.AttackParameters =
{
type = "stream", -- StreamAttackParameters
range = 0,
cooldown = 0,
ammo_type = Baseless.Data.AmmoType,
}
Baseless.Data.DamagePrototype =
{
amount = 0,
type = "physical",
}
Baseless.Data.EnergySource = {}
Baseless.Data.EnergySource.Burner =
{
type = "burner",
fuel_inventory_size = 0,
fuel_category = Baseless.Data.FuelType,
}
Baseless.Data.EnergySource.Electric =
{
type = "electric",
usage_priority = "tertiary",
}
Baseless.Data.EquipmentShape =
{
width = 1,
height = 1,
type = "full",
}
Baseless.Data.HeatBuffer =
{
max_temperature = 15,
specific_heat = Baseless.Data.Energy,
max_transfer = Baseless.Data.Energy,
}
Baseless.Data.MinableProperties =
{
mining_time = 1,
}
Baseless.Data.Vector = {}
Baseless.Data.Vector.Zero = {0, 0}
Baseless.Data.Vector.One = {1, 1}

117
Baseless/Graphics.lua Normal file
View File

@ -0,0 +1,117 @@
Baseless.Graphics = {}
Baseless.Graphics.Image1 = "__core__/graphics/empty.png"
Baseless.Graphics.Image32 = "__core__/graphics/too-far.png"
Baseless.Graphics.IconSpecification =
{
icon = Baseless.Graphics.Image1,
icon_size = 1,
}
Baseless.Graphics.Animation =
{
filename = Baseless.Graphics.Image1,
size = 1,
}
Baseless.Graphics.Animation4Way = Baseless.Graphics.Animation
Baseless.Graphics.AnimationVariations =
{
sheet = Merge(
Baseless.Graphics.Animation,
{
variation_count = 1,
}
),
}
Baseless.Graphics.RotatedAnimation =
{
filename = Baseless.Graphics.Image1,
size = 1,
direction_count = 1,
}
Baseless.Graphics.RotatedAnimation4Way = Baseless.Graphics.RotatedAnimation
Baseless.Graphics.Animation32 =
{
filename = Baseless.Graphics.Image32,
size = 1,
}
Baseless.Graphics.RotatedAnimation32 =
{
filename = Baseless.Graphics.Image32,
size = 1,
direction_count = 1,
}
Baseless.Graphics.Sprite =
{
filename = Baseless.Graphics.Image1,
size = 1,
}
Baseless.Graphics.Sprite4Way = Baseless.Graphics.Sprite
Baseless.Graphics.SpriteVariations =
{
sheet = Baseless.Graphics.Sprite,
}
Baseless.Graphics.RotatedSprite =
{
filename = Baseless.Graphics.Image1,
size = 1,
direction_count = 1,
}
Baseless.Graphics.Sprite32 =
{
filename = Baseless.Graphics.Image32,
size = 1,
}
Baseless.Graphics.SpriteVariations32 =
{
sheet = Baseless.Graphics.Sprite32,
}
Baseless.Graphics.Sprite8Way32 =
{
sheets = {Baseless.Graphics.Sprite32},
}
Baseless.Graphics.TileTransitionSprite =
{
count = 1,
picture = Baseless.Graphics.Image32,
size = 1,
}
Baseless.Graphics.Transitions =
{
main =
{
Baseless.Graphics.TileTransitionSprite,
},
empty_transitions = true,
}
Baseless.Graphics.RailPieceLayers =
{
metals = Baseless.Graphics.SpriteVariations32,
backplates = Baseless.Graphics.SpriteVariations32,
ties = Baseless.Graphics.SpriteVariations32,
stone_path = Baseless.Graphics.SpriteVariations32,
}
Baseless.Graphics.RailPictures =
{
straight_rail_horizontal = Baseless.Graphics.RailPieceLayers,
straight_rail_vertical = Baseless.Graphics.RailPieceLayers,
straight_rail_diagonal_left_top = Baseless.Graphics.RailPieceLayers,
straight_rail_diagonal_right_top = Baseless.Graphics.RailPieceLayers,
straight_rail_diagonal_right_bottom = Baseless.Graphics.RailPieceLayers,
straight_rail_diagonal_left_bottom = Baseless.Graphics.RailPieceLayers,
curved_rail_vertical_left_top = Baseless.Graphics.RailPieceLayers,
curved_rail_vertical_right_top = Baseless.Graphics.RailPieceLayers,
curved_rail_vertical_right_bottom = Baseless.Graphics.RailPieceLayers,
curved_rail_vertical_left_bottom = Baseless.Graphics.RailPieceLayers,
curved_rail_horizontal_left_top = Baseless.Graphics.RailPieceLayers,
curved_rail_horizontal_right_top = Baseless.Graphics.RailPieceLayers,
curved_rail_horizontal_right_bottom = Baseless.Graphics.RailPieceLayers,
curved_rail_horizontal_left_bottom = Baseless.Graphics.RailPieceLayers,
rail_endings = Baseless.Graphics.Sprite8Way32,
}

57
Baseless/Register.lua Normal file
View File

@ -0,0 +1,57 @@
Baseless._RegisterIfNew = function (prototype)
local type = prototype.type
local name = prototype.name
if data.raw[type] == nil or data.raw[type][name] == nil then
Baseless.PrototypeCount = Baseless.PrototypeCount + 1
log(" ✓ [" .. type .. "]" .. name .. " - IfNew")
data:extend { prototype }
Baseless.EnableConditions(prototype.baseless_conditions or {})
return true
else
log("✗ [" .. type .. "]" .. name .. " - IfNew")
return false
end
end
Baseless.RegisterIfNew = function (prototypes)
if #prototypes == 0 then
return Baseless._RegisterIfNew(prototypes)
end
for _, prototype in ipairs(prototypes) do
Baseless._RegisterIfNew(prototype)
end
end
Baseless._RegisterIfUnique = function (prototype)
local type = prototype.type
local name = prototype.name
if data.raw[type] == nil then
Baseless.PrototypeCount = Baseless.PrototypeCount + 1
log("✓ [" .. type .. "]" .. name .. " - IfUnique")
data:extend { prototype }
Baseless.EnableConditions(prototype.baseless_conditions or {})
return true
else
log("✗ [" .. type .. "]" .. name .. " - IfUnique")
return false
end
end
Baseless.RegisterIfUnique = function (prototypes)
if #prototypes == 0 then
return Baseless._RegisterIfUnique(prototypes)
end
for _, prototype in ipairs(prototypes) do
Baseless._RegisterIfUnique(prototype)
end
end
Baseless.EnableCondition = function (condition)
if Baseless.Needs[condition] ~= true then
Baseless.Needs[condition] = true
log(" - Condition: " .. condition .. " - Enabled")
end
end
Baseless.EnableConditions = function (conditions)
for _, condition in ipairs(conditions) do
Baseless.EnableCondition(condition)
end
end

4
Baseless/Sound.lua Normal file
View File

@ -0,0 +1,4 @@
Baseless.Sound =
{
filename = "__core__/sound/achievement-unlocked.ogg",
}

14
Helpers/Append.lua Normal file
View File

@ -0,0 +1,14 @@
-- Append multiple tables together
--
-- *Values are not deep copies
function Append(...)
local newArray = {}
for _, array in ipairs({...}) do
if array then
for _, value in ipairs(array) do
table.insert(newArray, value)
end
end
end
return newArray
end

15
Helpers/Merge.lua Normal file
View File

@ -0,0 +1,15 @@
-- Combine multiple tables into one
--
-- *In the case of duplicate keys the latest one is used
-- *Values are not deep copies
function Merge(...)
local newTable = {}
for _, table in ipairs({...}) do
if table then
for key, value in pairs(table) do
newTable[key] = value
end
end
end
return newTable
end

View File

@ -2,4 +2,10 @@
Defines missing prototypes required to launch the game. Defines missing prototypes required to launch the game.
**Incompatible with the base mod.** ---
## Folder structure
- `Baseless` - shared constants
- `Helpers` - generic functions
- `prototypes/constructors` mirrors [https://wiki.factorio.com/Prototype_definitions](https://wiki.factorio.com/Prototype_definitions)

5
changelog.txt Normal file
View File

@ -0,0 +1,5 @@
---------------------------------------------------------------------------------------------------
Version: 0.0.1
Date: 26.04.2020
Features:
- Initial release

View File

@ -1,198 +1,9 @@
require("Baseless") require("prototypes.required")
require("helpers.MergeTables") require("prototypes.entity")
require("prototypes.equipment")
require("prototypes.item")
-- Prototype Hierarchy require("prototypes.conditional")
require("helpers.CreatePrototype")
require("helpers.CreateItem")
require("helpers.CreateItemWithLabel")
require("helpers.CreateItemWithInventory")
require("helpers.CreateItemWithTags")
require("helpers.CreateSelectionTool")
require("helpers.CreateTool")
require("helpers.CreateEntity")
require("helpers.CreateCorpse")
require("helpers.CreateEntityWithHealth")
require("helpers.CreateCombinator")
require("helpers.CreateContainer")
require("helpers.CreateLogisticContainer")
require("helpers.CreateCraftingMachine")
require("helpers.CreateAssemblingMachine")
require("helpers.CreateFlyingRobot")
require("helpers.CreateRobotWithLogisticInterface")
require("helpers.CreatePipe")
require("helpers.CreateRail")
require("helpers.CreateRailSignalBase")
require("helpers.CreateTransportBeltConnectable")
require("helpers.CreateTurret")
require("helpers.CreateVehicle")
require("helpers.CreateRollingStock")
require("helpers.CreateExplosion")
require("helpers.CreateSmoke")
require("helpers.CreateEquipment")
-- Items log("Added " .. Baseless.PrototypeCount .. " prototypes")
require("prototypes.item.ammo")
require("prototypes.item.armor")
require("prototypes.item.blueprint")
require("prototypes.item.blueprint-book")
require("prototypes.item.capsule")
require("prototypes.item.copy-paste-tool")
require("prototypes.item.deconstruction-item")
require("prototypes.item.gun")
require("prototypes.item.item")
require("prototypes.item.item-with-entity-data")
require("prototypes.item.item-with-inventory")
require("prototypes.item.item-with-label")
require("prototypes.item.item-with-tags")
require("prototypes.item.mining-tool")
require("prototypes.item.module")
require("prototypes.item.rail-planner")
require("prototypes.item.repair-tool")
require("prototypes.item.selection-tool")
require("prototypes.item.tool")
require("prototypes.item.upgrade-item")
-- Entities (depends on above)
-- Entities
require("prototypes.entity.accumulator")
require("prototypes.entity.ammo-turret")
require("prototypes.entity.arithmetic-combinator")
require("prototypes.entity.arrow")
require("prototypes.entity.artillery-flare")
require("prototypes.entity.artillery-projectile")
require("prototypes.entity.artillery-turret")
require("prototypes.entity.artillery-wagon")
require("prototypes.entity.assembling-machine")
require("prototypes.entity.beacon")
require("prototypes.entity.beam")
require("prototypes.entity.boiler")
require("prototypes.entity.burner-generator")
require("prototypes.entity.car")
require("prototypes.entity.cargo-wagon")
require("prototypes.entity.character")
require("prototypes.entity.character-corpse")
require("prototypes.entity.cliff")
require("prototypes.entity.combat-robot")
require("prototypes.entity.constant-combinator")
require("prototypes.entity.construction-robot")
require("prototypes.entity.container")
require("prototypes.entity.corpse")
require("prototypes.entity.decider-combinator")
require("prototypes.entity.deconstructible-tile-proxy")
require("prototypes.entity.decorative")
require("prototypes.entity.electric-energy-interface")
require("prototypes.entity.electric-pole")
require("prototypes.entity.electric-turret")
require("prototypes.entity.entity-ghost")
require("prototypes.entity.explosion")
require("prototypes.entity.fire")
require("prototypes.entity.fish")
require("prototypes.entity.flame-thrower-explosion")
require("prototypes.entity.fluid-turret")
require("prototypes.entity.fluid-wagon")
require("prototypes.entity.flying-text")
require("prototypes.entity.furnace")
require("prototypes.entity.gate")
require("prototypes.entity.generator")
require("prototypes.entity.heat-interface")
require("prototypes.entity.heat-pipe")
require("prototypes.entity.highlight-box")
require("prototypes.entity.infinity-container")
require("prototypes.entity.infinity-pipe")
require("prototypes.entity.inserter")
require("prototypes.entity.item-entity")
require("prototypes.entity.item-request-proxy")
require("prototypes.entity.lab")
require("prototypes.entity.lamp")
require("prototypes.entity.land-mine")
require("prototypes.entity.leaf-particle")
require("prototypes.entity.loader")
require("prototypes.entity.loader-1x1")
require("prototypes.entity.locomotive")
require("prototypes.entity.logistic-container")
require("prototypes.entity.logistic-robot")
require("prototypes.entity.market")
require("prototypes.entity.mining-drill")
require("prototypes.entity.offshore-pump")
require("prototypes.entity.particle")
require("prototypes.entity.particle-source")
require("prototypes.entity.pipe")
require("prototypes.entity.pipe-to-ground")
require("prototypes.entity.player-port")
require("prototypes.entity.power-switch")
require("prototypes.entity.programmable-speaker")
require("prototypes.entity.projectile")
require("prototypes.entity.pump")
require("prototypes.entity.radar")
require("prototypes.entity.rail-chain-signal")
require("prototypes.entity.rail-remnants")
require("prototypes.entity.rail-signal")
require("prototypes.entity.reactor")
require("prototypes.entity.resource")
require("prototypes.entity.roboport")
require("prototypes.entity.rocket-silo")
require("prototypes.entity.rocket-silo-rocket-shadow")
require("prototypes.entity.simple-entity")
require("prototypes.entity.simple-entity-with-force")
require("prototypes.entity.simple-entity-with-owner")
require("prototypes.entity.smoke")
require("prototypes.entity.smoke-with-trigger")
require("prototypes.entity.solar-panel")
require("prototypes.entity.speech-bubble")
require("prototypes.entity.splitter")
require("prototypes.entity.sticker")
require("prototypes.entity.storage-tank")
require("prototypes.entity.stream")
require("prototypes.entity.tile-ghost")
require("prototypes.entity.train-stop")
require("prototypes.entity.transport-belt")
require("prototypes.entity.tree")
require("prototypes.entity.turret")
require("prototypes.entity.underground-belt")
require("prototypes.entity.unit-spawner")
require("prototypes.entity.wall")
-- Equipment
require("prototypes.equipment.active-defense-equipment")
require("prototypes.equipment.battery-equipment")
require("prototypes.equipment.belt-immunity-equipment")
require("prototypes.equipment.energy-shield-equipment")
require("prototypes.equipment.generator-equipment")
require("prototypes.equipment.movement-bonus-equipment")
require("prototypes.equipment.night-vision-equipment")
require("prototypes.equipment.roboport-equipment")
require("prototypes.equipment.solar-panel-equipment")
-- Items (depends on above)
require("prototypes.item.science")
-- Entities (depends on above)
require("prototypes.entity.curved-rail")
require("prototypes.entity.rocket-silo-rocket")
require("prototypes.entity.straight-rail")
require("prototypes.entity.unit")
-- Categories (depends on above)
require("prototypes.category.ammo")
require("prototypes.category.damage")
require("prototypes.category.equipment")
require("prototypes.category.fuel")
require("prototypes.category.module")
require("prototypes.category.recipe")
require("prototypes.category.resource")
require("prototypes.category.trigger-target")
-- Other (depends on above)
require("prototypes.item-group")
require("prototypes.item.copper-cable")
require("prototypes.item.green-wire")
require("prototypes.item.red-wire")
require("prototypes.other.equipment-grid")
require("prototypes.other.fluid")
require("prototypes.other.optimized-particle")
require("prototypes.other.tile")
require("prototypes.other.trivial-smoke")
require("prototypes.other.virtual-signal")

View File

@ -1 +1,5 @@
require("Helpers.Append")
require("Helpers.Merge")
require("Baseless.Baseless")
require("prototypes.map-settings") require("prototypes.map-settings")

View File

@ -1,3 +0,0 @@
function CreateAssemblingMachine (type, prototype)
return CreateCraftingMachine(type, prototype)
end

View File

@ -1,20 +0,0 @@
function CreateCombinator (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
active_energy_usage = "1W",
activity_led_light_offsets = Baseless.CombinatorOffsets,
activity_led_sprites = Baseless.Sprite4Way,
energy_source = Baseless.EnergySource.Void,
input_connection_bounding_box = Baseless.BoundingBox,
input_connection_points = Baseless.WireConnectionPoint.Combinator,
output_connection_bounding_box = Baseless.BoundingBox,
output_connection_points = Baseless.WireConnectionPoint.Combinator,
screen_light_offsets = Baseless.CombinatorOffsets,
sprites = Baseless.Sprite4Way,
}
)
)
end

View File

@ -1,12 +0,0 @@
function CreateContainer (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
inventory_size = 1,
picture = Baseless.Sprite,
}
)
)
end

View File

@ -1,3 +0,0 @@
function CreateCorpse (type, prototype)
return CreateEntity(type, prototype)
end

View File

@ -1,18 +0,0 @@
function CreateCraftingMachine (type, prototype)
if CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
crafting_categories = {Baseless.RecipeType()},
crafting_speed = 1,
energy_source = Baseless.EnergySource.Void,
energy_usage = "1W",
}
)
) then
Baseless.RecipeType(true)
return true
end
return false
end

View File

@ -1,16 +0,0 @@
function CreateEntity (type, prototype)
if CreateUniquePrototype(
type,
MergeTables(
prototype,
Baseless.IconSpecification,
{
subgroup = "dummy-item-subgroup",
}
)
) then
Baseless.Needs.ItemGroup = true
return true
end
return false
end

View File

@ -1,3 +0,0 @@
function CreateEntityWithHealth (type, prototype)
return CreateEntity(type, prototype)
end

View File

@ -1,30 +0,0 @@
function CreateEquipment (type, prototype)
if CreateUniquePrototype(
type,
MergeTables(
prototype,
Baseless.IconSpecification,
{
categories = {"dummy-equipment-category"},
energy_source = Baseless.EnergySource.Void,
shape = Baseless.EquipmentShape,
sprite = Baseless.Sprite,
}
)
) then
Baseless.Needs.EquipmentType = true
data:extend
{
{
type = "item",
name = "dummy-" .. type,
icon = Baseless.Image,
icon_size = 1,
stack_size = 1,
subgroup = "dummy-item-subgroup",
},
}
return true
end
return false
end

View File

@ -1,11 +0,0 @@
function CreateExplosion (type, prototype)
return CreateEntity(
type,
MergeTables(
prototype,
{
animations = Baseless.AnimationVariations,
}
)
)
end

View File

@ -1,11 +0,0 @@
function CreateFlyingRobot (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
speed = 1,
}
)
)
end

View File

@ -1,17 +0,0 @@
function CreateItem (type, prototype)
if CreateUniquePrototype(
type,
MergeTables(
prototype,
Baseless.IconSpecification,
{
stack_size = 1,
subgroup = "dummy-item-subgroup",
}
)
) then
Baseless.Needs.ItemGroup = true
return true
end
return false
end

View File

@ -1,11 +0,0 @@
function CreateItemWithInventory (type, prototype)
return CreateItemWithLabel(
type,
MergeTables(
prototype,
{
inventory_size = 0,
}
)
)
end

View File

@ -1,3 +0,0 @@
function CreateItemWithLabel (type, prototype)
return CreateItem(type, prototype)
end

View File

@ -1,3 +0,0 @@
function CreateItemWithTags (type, prototype)
return CreateItemWithLabel(type, prototype)
end

View File

@ -1,11 +0,0 @@
function CreateLogisticContainer (type, prototype)
return CreateContainer(
type,
MergeTables(
prototype,
{
logistic_mode = "storage",
}
)
)
end

View File

@ -1,43 +0,0 @@
Baseless.PipePictures =
{
straight_vertical_single = Baseless.Sprite,
straight_vertical = Baseless.Sprite,
straight_vertical_window = Baseless.Sprite,
straight_horizontal = Baseless.Sprite,
straight_horizontal_window = Baseless.Sprite,
corner_up_right = Baseless.Sprite,
corner_up_left = Baseless.Sprite,
corner_down_right = Baseless.Sprite,
corner_down_left = Baseless.Sprite,
t_up = Baseless.Sprite,
t_down = Baseless.Sprite,
t_right = Baseless.Sprite,
t_left = Baseless.Sprite,
cross = Baseless.Sprite,
ending_up = Baseless.Sprite,
ending_down = Baseless.Sprite,
ending_right = Baseless.Sprite,
ending_left = Baseless.Sprite,
horizontal_window_background = Baseless.Sprite,
vertical_window_background = Baseless.Sprite,
fluid_background = Baseless.Sprite,
low_temperature_flow = Baseless.Sprite,
middle_temperature_flow = Baseless.Sprite,
high_temperature_flow = Baseless.Sprite,
gas_flow = Baseless.Animation,
}
function CreatePipe (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
fluid_box = Baseless.FluidBox,
horizontal_window_bounding_box = Baseless.BoundingBox,
pictures = Baseless.PipePictures,
vertical_window_bounding_box = Baseless.BoundingBox,
}
)
)
end

View File

@ -1,22 +0,0 @@
function CreatePrototype (type, prototype)
data:extend
{
MergeTables(
prototype,
{
type = type,
name = "dummy-" .. type,
flags = {"hidden"}, -- Make everything hidden
}
),
}
end
-- Does not create if that type already exists
function CreateUniquePrototype (type, prototype)
if data.raw[type] == nil then
CreatePrototype(type, prototype)
return true
end
return false
end

View File

@ -1,38 +0,0 @@
Baseless.RailPieceLayers =
{
metals = Baseless.SpriteVariations,
backplates = Baseless.SpriteVariations,
ties = Baseless.SpriteVariations,
stone_path = Baseless.SpriteVariations,
}
Baseless.RailPictures =
{
straight_rail_horizontal = Baseless.RailPieceLayers,
straight_rail_vertical = Baseless.RailPieceLayers,
straight_rail_diagonal_left_top = Baseless.RailPieceLayers,
straight_rail_diagonal_right_top = Baseless.RailPieceLayers,
straight_rail_diagonal_right_bottom = Baseless.RailPieceLayers,
straight_rail_diagonal_left_bottom = Baseless.RailPieceLayers,
curved_rail_vertical_left_top = Baseless.RailPieceLayers,
curved_rail_vertical_right_top = Baseless.RailPieceLayers,
curved_rail_vertical_right_bottom = Baseless.RailPieceLayers,
curved_rail_vertical_left_bottom = Baseless.RailPieceLayers,
curved_rail_horizontal_left_top = Baseless.RailPieceLayers,
curved_rail_horizontal_right_top = Baseless.RailPieceLayers,
curved_rail_horizontal_right_bottom = Baseless.RailPieceLayers,
curved_rail_horizontal_left_bottom = Baseless.RailPieceLayers,
rail_endings = Baseless.Sprite8Way,
}
function CreateRail (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
pictures = Baseless.RailPictures,
}
)
)
end

View File

@ -1,11 +0,0 @@
function CreateRailSignalBase (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
animation = Baseless.RotatedAnimation,
}
)
)
end

View File

@ -1,12 +0,0 @@
function CreateRobotWithLogisticInterface (type, prototype)
return CreateFlyingRobot(
type,
MergeTables(
prototype,
{
cargo_centered = {0, 0},
max_payload_size = 1,
}
)
)
end

View File

@ -1,19 +0,0 @@
function CreateRollingStock (type, prototype)
return CreateVehicle(
type,
MergeTables(
prototype,
{
air_resistance = 1,
connection_distance = 1,
joint_distance = 2, -- Must be compatible with collision_box
max_speed = 1,
pictures = Baseless.RotatedSprite,
vertical_selection_shift = 1,
-- Required for joint_distance to work
collision_box = {{-0.1, -2}, {0.1, 2}},
}
)
)
end

View File

@ -1,16 +0,0 @@
function CreateSelectionTool (type, prototype)
return CreateItemWithLabel(
type,
MergeTables(
prototype,
{
alt_selection_color = Baseless.Color,
alt_selection_cursor_box_type = "not-allowed",
alt_selection_mode = {"nothing"},
selection_color = Baseless.Color,
selection_cursor_box_type = "not-allowed",
selection_mode = {"nothing"},
}
)
)
end

View File

@ -1,11 +0,0 @@
function CreateSmoke (type, prototype)
return CreateEntity(
type,
MergeTables(
prototype,
{
animation = Baseless.Animation,
}
)
)
end

View File

@ -1,11 +0,0 @@
function CreateTool (type, prototype)
return CreateItem(
type,
MergeTables(
prototype,
{
infinite = true,
}
)
)
end

View File

@ -1,20 +0,0 @@
function CreateTransportBeltConnectable (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
speed = 1,
belt_horizontal = Baseless.Animation,
belt_vertical = Baseless.Animation,
ending_bottom = Baseless.Animation,
ending_side = Baseless.Animation,
ending_top = Baseless.Animation,
starting_bottom = Baseless.Animation,
starting_side = Baseless.Animation,
starting_top = Baseless.Animation,
collision_box = {{-1, -1}, {1, 1}},
}
)
)
end

View File

@ -1,17 +0,0 @@
function CreateTurret (type, prototype)
if CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
attack_parameters = Baseless.AttackParameters.Stream(),
call_for_help_radius = 0,
folded_animation = Baseless.RotatedAnimation4Way,
}
)
) then
Baseless.AttackParameters.Stream(true)
return true
end
return false
end

View File

@ -1,14 +0,0 @@
function CreateVehicle (type, prototype)
return CreateEntityWithHealth(
type,
MergeTables(
prototype,
{
braking_force = 1,
energy_per_hit_point = 1,
friction_force = 1,
weight = 1,
}
)
)
end

View File

@ -1,13 +0,0 @@
-- Combine multiple tables into one
--
-- *Tables should not share keys
-- *Values are not deep copies
function MergeTables(...)
local newTable = {}
for _, table in pairs({...}) do
for key, value in pairs(table) do
newTable[key] = value
end
end
return newTable
end

View File

@ -7,7 +7,5 @@
"contact": "david@skrundz.ca", "contact": "david@skrundz.ca",
"homepage": "https://github.com/DavidSkrundz/Baseless", "homepage": "https://github.com/DavidSkrundz/Baseless",
"factorio_version": "0.18", "factorio_version": "0.18",
"dependencies": [ "dependencies": []
"! base"
]
} }

View File

@ -8,9 +8,13 @@ modFiles = [
"info.json", "info.json",
"changelog.txt", "changelog.txt",
"thumbnail.png", "thumbnail.png",
"data.lua",
"data-final-fixes.lua",
] ]
modFolders = [ modFolders = [
"helpers", "Baseless",
"Helpers",
"prototypes", "prototypes",
] ]

12
prototype.py Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
import os
with open(os.path.join("prototypes", "constructors.lua"), "w+") as data:
for root, dirs, files in os.walk(os.path.join("prototypes", "constructors")):
for file in files:
fileParts = os.path.splitext(file)
if fileParts[1] != '.lua':
continue
filePath = os.path.join(root, fileParts[0])
data.write('require("{}")\n'.format(filePath.replace(os.sep, '.')))

View File

@ -1,3 +0,0 @@
if Baseless.Needs.AmmoType then
CreatePrototype("ammo-category", {})
end

View File

@ -1,26 +0,0 @@
if data.raw["damage-type"] == nil or
data.raw["damage-type"]["physical"] == nil then
data:extend
{
{
type = "damage-type",
name = "physical",
},
}
end
if data.raw["damage-type"] == nil or
data.raw["damage-type"]["impact"] == nil then
data:extend
{
{
type = "damage-type",
name = "impact",
},
}
end
if Baseless.Needs.DamageType then
CreatePrototype("damage-type", {})
end

View File

@ -1,3 +0,0 @@
if Baseless.Needs.EquipmentType then
CreatePrototype("equipment-category", {})
end

View File

@ -1,3 +0,0 @@
if Baseless.Needs.FuelType then
CreatePrototype("fuel-category", {})
end

View File

@ -1,3 +0,0 @@
if Baseless.Needs.ModuleType then
CreatePrototype("module-category", {})
end

View File

@ -1,14 +0,0 @@
if data.raw["recipe-category"] == nil or
data.raw["recipe-category"]["crafting"] == nil then
data:extend
{
{
type = "recipe-category",
name = "crafting",
},
}
end
if Baseless.Needs.RecipeType then
CreatePrototype("recipe-category", {})
end

View File

@ -1,14 +0,0 @@
if data.raw["resource-category"] == nil or
data.raw["resource-category"]["basic-solid"] == nil then
data:extend
{
{
type = "resource-category",
name = "basic-solid",
},
}
end
if Baseless.Needs.ResourceType then
CreatePrototype("resource-category", {})
end

View File

@ -1,21 +0,0 @@
if data.raw["trigger-target-type"] == nil or
data.raw["trigger-target-type"]["common"] == nil then
data:extend
{
{
type = "trigger-target-type",
name = "common",
},
}
end
if data.raw["trigger-target-type"] == nil or
data.raw["trigger-target-type"]["ground-unit"] == nil then
data:extend
{
{
type = "trigger-target-type",
name = "ground-unit",
},
}
end

View File

@ -0,0 +1,22 @@
local function RegisterConditionals(conditionals)
for key, value in pairs(conditionals) do
if Baseless.Needs[key] then
Baseless.RegisterIfNew(value)
end
end
end
RegisterConditionals {
AmmoType = Baseless.Make.AmmoCategory(),
EquipmentType = Baseless.Make.EquipmentCategory(),
FuelType = Baseless.Make.FuelCategory(),
ModuleType = Baseless.Make.ModuleCategory(),
ResourceType = Baseless.Make.ResourceCategory(),
RecipeType = Baseless.Make.RecipeCategory(),
GunItem = Baseless.Make.Gun(),
RailEntity = { Baseless.Make.CurvedRail(), Baseless.Make.StraightRail()} ,
RocketEntity = Baseless.Make.RocketSiloRocket(),
UnitEntity = Baseless.Make.Unit(),
Fluid = Baseless.Make.Fluid(),
Particle = Baseless.Make.Particle(),
}

154
prototypes/constructors.lua Normal file
View File

@ -0,0 +1,154 @@
require("prototypes.constructors.AmmoCategory")
require("prototypes.constructors.Base")
require("prototypes.constructors.DamageType")
require("prototypes.constructors.Entity")
require("prototypes.constructors.Equipment")
require("prototypes.constructors.EquipmentCategory")
require("prototypes.constructors.EquipmentGrid")
require("prototypes.constructors.Fluid")
require("prototypes.constructors.FuelCategory")
require("prototypes.constructors.Item")
require("prototypes.constructors.ItemGroup")
require("prototypes.constructors.ItemSubGroup")
require("prototypes.constructors.ModuleCategory")
require("prototypes.constructors.Particle")
require("prototypes.constructors.RecipeCategory")
require("prototypes.constructors.ResourceCategory")
require("prototypes.constructors.Tile")
require("prototypes.constructors.TrivialSmoke")
require("prototypes.constructors.VirtualSignal")
require("prototypes.constructors.Entity.Arrow")
require("prototypes.constructors.Entity.ArtilleryFlare")
require("prototypes.constructors.Entity.ArtilleryProjectile")
require("prototypes.constructors.Entity.Beam")
require("prototypes.constructors.Entity.CharacterCorpse")
require("prototypes.constructors.Entity.Cliff")
require("prototypes.constructors.Entity.Corpse")
require("prototypes.constructors.Entity.DeconstructibleTileProxy")
require("prototypes.constructors.Entity.EntityGhost")
require("prototypes.constructors.Entity.EntityWithHealth")
require("prototypes.constructors.Entity.Explosion")
require("prototypes.constructors.Entity.FireFlame")
require("prototypes.constructors.Entity.FluidStream")
require("prototypes.constructors.Entity.FlyingText")
require("prototypes.constructors.Entity.HighlightBoxEntity")
require("prototypes.constructors.Entity.ItemEntity")
require("prototypes.constructors.Entity.ItemRequestProxy")
require("prototypes.constructors.Entity.ParticleSource")
require("prototypes.constructors.Entity.Projectile")
require("prototypes.constructors.Entity.ResourceEntity")
require("prototypes.constructors.Entity.RocketSiloRocket")
require("prototypes.constructors.Entity.RocketSiloRocketShadow")
require("prototypes.constructors.Entity.Smoke")
require("prototypes.constructors.Entity.SpeechBubble")
require("prototypes.constructors.Entity.Sticker")
require("prototypes.constructors.Entity.TileGhost")
require("prototypes.constructors.Entity.Corpse.RailRemnants")
require("prototypes.constructors.Entity.EntityWithHealth.Accumulator")
require("prototypes.constructors.Entity.EntityWithHealth.ArtilleryTurret")
require("prototypes.constructors.Entity.EntityWithHealth.Beacon")
require("prototypes.constructors.Entity.EntityWithHealth.Boiler")
require("prototypes.constructors.Entity.EntityWithHealth.BurnerGenerator")
require("prototypes.constructors.Entity.EntityWithHealth.Character")
require("prototypes.constructors.Entity.EntityWithHealth.Combinator")
require("prototypes.constructors.Entity.EntityWithHealth.ConstantCombinator")
require("prototypes.constructors.Entity.EntityWithHealth.Container")
require("prototypes.constructors.Entity.EntityWithHealth.CraftingMachine")
require("prototypes.constructors.Entity.EntityWithHealth.ElectricEnergyInterface")
require("prototypes.constructors.Entity.EntityWithHealth.ElectricPole")
require("prototypes.constructors.Entity.EntityWithHealth.EnemySpawner")
require("prototypes.constructors.Entity.EntityWithHealth.Fish")
require("prototypes.constructors.Entity.EntityWithHealth.FlyingRobot")
require("prototypes.constructors.Entity.EntityWithHealth.Gate")
require("prototypes.constructors.Entity.EntityWithHealth.Generator")
require("prototypes.constructors.Entity.EntityWithHealth.HeatInterface")
require("prototypes.constructors.Entity.EntityWithHealth.HeatPipe")
require("prototypes.constructors.Entity.EntityWithHealth.Inserter")
require("prototypes.constructors.Entity.EntityWithHealth.Lab")
require("prototypes.constructors.Entity.EntityWithHealth.Lamp")
require("prototypes.constructors.Entity.EntityWithHealth.LandMine")
require("prototypes.constructors.Entity.EntityWithHealth.Market")
require("prototypes.constructors.Entity.EntityWithHealth.MiningDrill")
require("prototypes.constructors.Entity.EntityWithHealth.OffshorePump")
require("prototypes.constructors.Entity.EntityWithHealth.Pipe")
require("prototypes.constructors.Entity.EntityWithHealth.PipeToGround")
require("prototypes.constructors.Entity.EntityWithHealth.PlayerPort")
require("prototypes.constructors.Entity.EntityWithHealth.PowerSwitch")
require("prototypes.constructors.Entity.EntityWithHealth.ProgrammableSpeaker")
require("prototypes.constructors.Entity.EntityWithHealth.Pump")
require("prototypes.constructors.Entity.EntityWithHealth.Radar")
require("prototypes.constructors.Entity.EntityWithHealth.Rail")
require("prototypes.constructors.Entity.EntityWithHealth.RailSignalBase")
require("prototypes.constructors.Entity.EntityWithHealth.Reactor")
require("prototypes.constructors.Entity.EntityWithHealth.Roboport")
require("prototypes.constructors.Entity.EntityWithHealth.SimpleEntity")
require("prototypes.constructors.Entity.EntityWithHealth.SimpleEntityWithForce")
require("prototypes.constructors.Entity.EntityWithHealth.SimpleEntityWithOwner")
require("prototypes.constructors.Entity.EntityWithHealth.SolarPanel")
require("prototypes.constructors.Entity.EntityWithHealth.StorageTank")
require("prototypes.constructors.Entity.EntityWithHealth.TrainStop")
require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable")
require("prototypes.constructors.Entity.EntityWithHealth.Tree")
require("prototypes.constructors.Entity.EntityWithHealth.Turret")
require("prototypes.constructors.Entity.EntityWithHealth.Unit")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle")
require("prototypes.constructors.Entity.EntityWithHealth.Wall")
require("prototypes.constructors.Entity.EntityWithHealth.Combinator.ArithmeticCombinator")
require("prototypes.constructors.Entity.EntityWithHealth.Combinator.DeciderCombinator")
require("prototypes.constructors.Entity.EntityWithHealth.Container.LogisticContainer")
require("prototypes.constructors.Entity.EntityWithHealth.Container.LogisticContainer.InfinityContainer")
require("prototypes.constructors.Entity.EntityWithHealth.CraftingMachine.AssemblingMachine")
require("prototypes.constructors.Entity.EntityWithHealth.CraftingMachine.Furnace")
require("prototypes.constructors.Entity.EntityWithHealth.CraftingMachine.AssemblingMachine.RocketSilo")
require("prototypes.constructors.Entity.EntityWithHealth.FlyingRobot.CombatRobot")
require("prototypes.constructors.Entity.EntityWithHealth.FlyingRobot.RobotWithLogisticInterface")
require("prototypes.constructors.Entity.EntityWithHealth.FlyingRobot.RobotWithLogisticInterface.ConstructionRobot")
require("prototypes.constructors.Entity.EntityWithHealth.FlyingRobot.RobotWithLogisticInterface.LogisticRobot")
require("prototypes.constructors.Entity.EntityWithHealth.Pipe.InfinityPipe")
require("prototypes.constructors.Entity.EntityWithHealth.Rail.CurvedRail")
require("prototypes.constructors.Entity.EntityWithHealth.Rail.StraightRail")
require("prototypes.constructors.Entity.EntityWithHealth.RailSignalBase.RailChainSignal")
require("prototypes.constructors.Entity.EntityWithHealth.RailSignalBase.RailSignal")
require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable.Loader1x1")
require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable.Loader1x2")
require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable.Splitter")
require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable.TransportBelt")
require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable.UndergroundBelt")
require("prototypes.constructors.Entity.EntityWithHealth.Turret.AmmoTurret")
require("prototypes.constructors.Entity.EntityWithHealth.Turret.ElectricTurret")
require("prototypes.constructors.Entity.EntityWithHealth.Turret.FluidTurret")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.Car")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.ArtilleryWagon")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.CargoWagon")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.FluidWagon")
require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.Locomotive")
require("prototypes.constructors.Entity.Explosion.FlameThrowerExplosion")
require("prototypes.constructors.Entity.Smoke.SmokeWithTrigger")
require("prototypes.constructors.Equipment.ActiveDefenseEquipment")
require("prototypes.constructors.Equipment.BatteryEquipment")
require("prototypes.constructors.Equipment.BeltImmunityEquipment")
require("prototypes.constructors.Equipment.EnergyShieldEquipment")
require("prototypes.constructors.Equipment.GeneratorEquipment")
require("prototypes.constructors.Equipment.MovementBonusEquipment")
require("prototypes.constructors.Equipment.NightVisionEquipment")
require("prototypes.constructors.Equipment.RoboportEquipment")
require("prototypes.constructors.Equipment.SolarPanelEquipment")
require("prototypes.constructors.Item.Ammo")
require("prototypes.constructors.Item.Capsule")
require("prototypes.constructors.Item.Gun")
require("prototypes.constructors.Item.ItemWithEntityData")
require("prototypes.constructors.Item.ItemWithLabel")
require("prototypes.constructors.Item.Module")
require("prototypes.constructors.Item.RailPlanner")
require("prototypes.constructors.Item.Tool")
require("prototypes.constructors.Item.ItemWithLabel.ItemWithInventory")
require("prototypes.constructors.Item.ItemWithLabel.ItemWithTags")
require("prototypes.constructors.Item.ItemWithLabel.SelectionTool")
require("prototypes.constructors.Item.ItemWithLabel.ItemWithInventory.BlueprintBook")
require("prototypes.constructors.Item.ItemWithLabel.SelectionTool.Blueprint")
require("prototypes.constructors.Item.ItemWithLabel.SelectionTool.CopyPasteTool")
require("prototypes.constructors.Item.ItemWithLabel.SelectionTool.DeconstructionItem")
require("prototypes.constructors.Item.ItemWithLabel.SelectionTool.UpgradeItem")
require("prototypes.constructors.Item.Tool.Armor")
require("prototypes.constructors.Item.Tool.RepairTool")

View File

@ -0,0 +1,3 @@
Baseless.Make.AmmoCategory = function (name, prototype)
return Baseless.Make.Base("ammo-category", name, prototype)
end

View File

@ -0,0 +1,10 @@
Baseless.Make.Base = function (type, name, prototype, conditions)
return Merge(
{
type = type,
name = name or "dummy-" .. type,
baseless_conditions = conditions, -- Conditions to enable when Registered
},
prototype
)
end

View File

@ -0,0 +1,3 @@
Baseless.Make.DamageType = function (name, prototype)
return Baseless.Make.Base("damage-type", name, prototype)
end

View File

@ -0,0 +1,8 @@
Baseless.Make.Entity = function (type, name, prototype, conditions)
return Baseless.Make.Base(type, name, Merge(
Baseless.Graphics.IconSpecification,
{
},
prototype
), conditions)
end

View File

@ -0,0 +1,8 @@
Baseless.Make.Arrow = function (name, prototype)
return Baseless.Make.Entity("arrow", name, Merge(
{
arrow_picture = Baseless.Graphics.Sprite,
},
prototype
))
end

View File

@ -0,0 +1,10 @@
Baseless.Make.ArtilleryFlare = function (name, prototype)
return Baseless.Make.Entity("artillery-flare", name, Merge(
{
life_time = 0,
pictures = Baseless.Graphics.AnimationVariations,
map_color = Baseless.Data.Color,
},
prototype
))
end

View File

@ -0,0 +1,9 @@
Baseless.Make.ArtilleryProjectile = function (name, prototype)
return Baseless.Make.Entity("artillery-projectile", name, Merge(
{
reveal_map = false,
map_color = Baseless.Data.Color,
},
prototype
))
end

View File

@ -0,0 +1,12 @@
Baseless.Make.Beam = function (name, prototype)
return Baseless.Make.Entity("beam", name, Merge(
{
body = Baseless.Graphics.AnimationVariations,
damage_interval = 1,
head = Baseless.Graphics.Animation,
tail = Baseless.Graphics.Animation,
width = 0,
},
prototype
))
end

View File

@ -0,0 +1,9 @@
Baseless.Make.CharacterCorpse = function (name, prototype)
return Baseless.Make.Entity("character-corpse", name, Merge(
{
time_to_live = 0,
picture = Baseless.Graphics.Animation,
},
prototype
))
end

View File

@ -0,0 +1,41 @@
local OrientedCliffPrototype =
{
collision_bounding_box = Baseless.Data.BoundingBox,
pictures = Baseless.Graphics.SpriteVariations,
fill_volume = 1,
}
local CliffOrientations =
{
west_to_east = OrientedCliffPrototype,
north_to_south = OrientedCliffPrototype,
east_to_west = OrientedCliffPrototype,
south_to_north = OrientedCliffPrototype,
west_to_north = OrientedCliffPrototype,
north_to_east = OrientedCliffPrototype,
east_to_south = OrientedCliffPrototype,
south_to_west = OrientedCliffPrototype,
west_to_south = OrientedCliffPrototype,
north_to_west = OrientedCliffPrototype,
east_to_north = OrientedCliffPrototype,
south_to_east = OrientedCliffPrototype,
west_to_none = OrientedCliffPrototype,
none_to_east = OrientedCliffPrototype,
north_to_none = OrientedCliffPrototype,
none_to_south = OrientedCliffPrototype,
east_to_none = OrientedCliffPrototype,
none_to_west = OrientedCliffPrototype,
south_to_none = OrientedCliffPrototype,
none_to_north = OrientedCliffPrototype,
}
Baseless.Make.Cliff = function (name, prototype)
return Baseless.Make.Entity("cliff", name, Merge(
{
grid_offset = Baseless.Data.Vector.Zero,
grid_size = Baseless.Data.Vector.One,
orientations = CliffOrientations,
},
prototype
))
end

View File

@ -0,0 +1,7 @@
Baseless.Make.Corpse = function (type, name, prototype, conditions)
return Baseless.Make.Entity(type or "corpse", name, Merge(
{
},
prototype
), conditions)
end

View File

@ -0,0 +1,11 @@
Baseless.Make.RailRemnants = function (name, prototype)
return Baseless.Make.Corpse("rail-remnants", name, Merge(
{
bending_type = "turn",
pictures = Baseless.Graphics.RailPictures,
collision_box = Baseless.Data.BoundingBox,
secondary_collision_box = Baseless.Data.BoundingBox,
},
prototype
))
end

View File

@ -0,0 +1,7 @@
Baseless.Make.DeconstructibleTileProxy = function (name, prototype)
return Baseless.Make.Entity("deconstructible-tile-proxy", name, Merge(
{
},
prototype
))
end

View File

@ -0,0 +1,7 @@
Baseless.Make.EntityGhost = function (name, prototype)
return Baseless.Make.Entity("entity-ghost", name, Merge(
{
},
prototype
))
end

View File

@ -0,0 +1,7 @@
Baseless.Make.EntityWithHealth = function (type, name, prototype, conditions)
return Baseless.Make.Entity(type, name, Merge(
{
},
prototype
), conditions)
end

View File

@ -0,0 +1,11 @@
Baseless.Make.Accumulator = function (name, prototype)
return Baseless.Make.EntityWithHealth("accumulator", name, Merge(
{
charge_cooldown = 0,
discharge_cooldown = 0,
energy_source = Baseless.Data.EnergySource.Electric,
picture = Baseless.Graphics.Sprite,
},
prototype
))
end

View File

@ -0,0 +1,13 @@
Baseless.Make.ArtilleryTurret = function (name, prototype)
return Baseless.Make.EntityWithHealth("artillery-turret", name, Merge(
{
ammo_stack_limit = 1,
automated_ammo_count = 0,
gun = Baseless.Data.GunItem,
inventory_size = 1,
manual_range_modifier = 1,
turret_rotation_speed = 0,
},
prototype
), {"GunItem"})
end

View File

@ -0,0 +1,15 @@
Baseless.Make.Beacon = function (name, prototype)
return Baseless.Make.EntityWithHealth("beacon", name, Merge(
{
animation = Baseless.Graphics.Animation,
animation_shadow = Baseless.Graphics.Animation,
base_picture = Baseless.Graphics.Sprite,
distribution_effectivity = 0,
energy_source = Baseless.Data.EnergySource.Electric,
energy_usage = Baseless.Data.Energy,
module_specification = Baseless.Data.ModuleSpecification,
supply_area_distance = 0,
},
prototype
))
end

View File

@ -0,0 +1,22 @@
Baseless.Make.Boiler = function (name, prototype)
return Baseless.Make.EntityWithHealth("boiler", name, Merge(
{
burning_cooldown = 0,
energy_consumption = Baseless.Data.Energy,
energy_source = Baseless.Data.EnergySource.Electric,
fire = {},
fire_glow = {},
fluid_box = Baseless.Data.FluidBox,
output_fluid_box = Baseless.Data.FluidBox,
structure =
{
north = Baseless.Graphics.Sprite,
south = Baseless.Graphics.Sprite,
east = Baseless.Graphics.Sprite,
west = Baseless.Graphics.Sprite,
},
target_temperature = 0,
},
prototype
))
end

View File

@ -0,0 +1,11 @@
Baseless.Make.BurnerGenerator = function (name, prototype)
return Baseless.Make.EntityWithHealth("burner-generator", name, Merge(
{
animation = Baseless.Graphics.Animation4Way,
burner = Baseless.Data.EnergySource.Burner,
energy_source = Baseless.Data.EnergySource.Electric,
max_power_output = Baseless.Data.Energy,
},
prototype
), {"FuelType"})
end

View File

@ -0,0 +1,42 @@
local RotatedAnimation32 = Merge(
Baseless.Graphics.RotatedAnimation32,
{
direction_count = 18,
}
)
local CharacterArmorAnimation =
{
idle = RotatedAnimation32,
idle_with_gun = RotatedAnimation32,
running = RotatedAnimation32,
running_with_gun = RotatedAnimation32,
mining_with_tool = RotatedAnimation32,
}
Baseless.Make.Character = function (name, prototype)
return Baseless.Make.EntityWithHealth("character", name, Merge(
{
animations = {CharacterArmorAnimation},
build_distance = 0,
damage_hit_tint = Baseless.Data.Color,
distance_per_frame = 0,
drop_item_distance = 0,
eat = Baseless.Sound,
heartbeat = Baseless.Sound,
inventory_size = 0,
item_pickup_distance = 0,
loot_pickup_distance = 0,
maximum_corner_sliding_distance = 0,
mining_speed = 0,
mining_with_tool_particles_animation_positions = {},
reach_distance = 0,
reach_resource_distance = 0,
running_sound_animation_positions = {},
running_speed = 0,
ticks_to_keep_aiming_direction = 0,
ticks_to_keep_gun = 0,
ticks_to_stay_in_combat = 0,
},
prototype
))
end

View File

@ -0,0 +1,32 @@
local WireConnectionPoint =
{
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
}
local Offsets =
{
{0, 0},
{0, 0},
{0, 0},
{0, 0},
}
Baseless.Make.Combinator = function (type, name, prototype, conditions)
return Baseless.Make.EntityWithHealth(type, name, Merge(
{
active_energy_usage = Baseless.Data.Energy,
activity_led_light_offsets = Offsets,
activity_led_sprites = Baseless.Graphics.Sprite4Way,
energy_source = Baseless.Data.EnergySource.Electric,
input_connection_bounding_box = Baseless.Data.BoundingBox,
input_connection_points = WireConnectionPoint,
output_connection_bounding_box = Baseless.Data.BoundingBox,
output_connection_points = WireConnectionPoint,
screen_light_offsets = Offsets,
sprites = Baseless.Graphics.Sprite4Way,
},
prototype
), conditions)
end

View File

@ -0,0 +1,18 @@
Baseless.Make.ArithmeticCombinator = function (name, prototype)
return Baseless.Make.Combinator("arithmetic-combinator", name, Merge(
{
and_symbol_sprites = Baseless.Graphics.Sprite4Way,
divide_symbol_sprites = Baseless.Graphics.Sprite4Way,
left_shift_symbol_sprites = Baseless.Graphics.Sprite4Way,
minus_symbol_sprites = Baseless.Graphics.Sprite4Way,
modulo_symbol_sprites = Baseless.Graphics.Sprite4Way,
multiply_symbol_sprites = Baseless.Graphics.Sprite4Way,
or_symbol_sprites = Baseless.Graphics.Sprite4Way,
plus_symbol_sprites = Baseless.Graphics.Sprite4Way,
power_symbol_sprites = Baseless.Graphics.Sprite4Way,
right_shift_symbol_sprites = Baseless.Graphics.Sprite4Way,
xor_symbol_sprites = Baseless.Graphics.Sprite4Way,
},
prototype
))
end

View File

@ -0,0 +1,13 @@
Baseless.Make.DeciderCombinator = function (name, prototype)
return Baseless.Make.Combinator("decider-combinator", name, Merge(
{
equal_symbol_sprites = Baseless.Graphics.Sprite4Way,
greater_or_equal_symbol_sprites = Baseless.Graphics.Sprite4Way,
greater_symbol_sprites = Baseless.Graphics.Sprite4Way,
less_or_equal_symbol_sprites = Baseless.Graphics.Sprite4Way,
less_symbol_sprites = Baseless.Graphics.Sprite4Way,
not_equal_symbol_sprites = Baseless.Graphics.Sprite4Way,
},
prototype
))
end

View File

@ -0,0 +1,27 @@
local WireConnectionPoint =
{
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
{wire = {}, shadow = {}},
}
local Offsets =
{
{0, 0},
{0, 0},
{0, 0},
{0, 0},
}
Baseless.Make.ConstantCombinator = function (name, prototype)
return Baseless.Make.EntityWithHealth("constant-combinator", name, Merge(
{
activity_led_light_offsets = Offsets,
activity_led_sprites = Baseless.Graphics.Sprite4Way,
circuit_wire_connection_points = WireConnectionPoint,
item_slot_count = 0,
sprites = Baseless.Graphics.Sprite4Way,
},
prototype
))
end

View File

@ -0,0 +1,9 @@
Baseless.Make.Container = function (type, name, prototype, conditions)
return Baseless.Make.EntityWithHealth(type or "container", name, Merge(
{
inventory_size = 1,
picture = Baseless.Graphics.Sprite,
},
prototype
), conditions)
end

View File

@ -0,0 +1,8 @@
Baseless.Make.LogisticContainer = function (type, name, prototype, conditions)
return Baseless.Make.Container(type or "logistic-container", name, Merge(
{
logistic_mode = "storage",
},
prototype
), conditions)
end

View File

@ -0,0 +1,8 @@
Baseless.Make.InfinityContainer = function (name, prototype)
return Baseless.Make.LogisticContainer("infinity-container", name, Merge(
{
erase_contents_when_mined = false,
},
prototype
))
end

View File

@ -0,0 +1,11 @@
Baseless.Make.CraftingMachine = function (type, name, prototype, conditions)
return Baseless.Make.EntityWithHealth(type, name, Merge(
{
crafting_categories = {Baseless.Data.RecipeType},
crafting_speed = 1,
energy_source = Baseless.Data.EnergySource.Electric,
energy_usage = Baseless.Data.Energy,
},
prototype
), Append({"RecipeType"}, conditions))
end

View File

@ -0,0 +1,7 @@
Baseless.Make.AssemblingMachine = function (type, name, prototype, conditions)
return Baseless.Make.CraftingMachine(type or "assembling-machine", name, Merge(
{
},
prototype
), conditions)
end

View File

@ -0,0 +1,37 @@
Baseless.Make.RocketSilo = function (name, prototype)
return Baseless.Make.AssemblingMachine("rocket-silo", name, Merge(
{
active_energy_usage = Baseless.Data.Energy,
arm_01_back_animation = Baseless.Graphics.Animation,
arm_02_right_animation = Baseless.Graphics.Animation,
arm_03_front_animation = Baseless.Graphics.Animation,
base_day_sprite = Baseless.Graphics.Sprite,
base_front_sprite = Baseless.Graphics.Sprite,
door_back_open_offset = Baseless.Data.Vector.Zero,
door_back_sprite = Baseless.Graphics.Sprite,
door_front_open_offset = Baseless.Data.Vector.Zero,
door_front_sprite = Baseless.Graphics.Sprite,
door_opening_speed = 0,
energy_usage = Baseless.Data.Energy,
hole_clipping_box = Baseless.Data.BoundingBox,
hole_light_sprite = Baseless.Graphics.Sprite,
hole_sprite = Baseless.Graphics.Sprite,
idle_energy_usage = Baseless.Data.Energy,
lamp_energy_usage = Baseless.Data.Energy,
light_blinking_speed = 0,
red_lights_back_sprites = Baseless.Graphics.Sprite,
red_lights_front_sprites = Baseless.Graphics.Sprite,
rocket_entity = Baseless.Data.RocketEntity,
rocket_glow_overlay_sprite = Baseless.Graphics.Sprite,
rocket_parts_required = 0,
rocket_shadow_overlay_sprite = Baseless.Graphics.Sprite,
satellite_animation = Baseless.Graphics.Animation,
satellite_shadow_animation = Baseless.Graphics.Animation,
shadow_sprite = Baseless.Graphics.Sprite,
silo_fade_out_end_distance = 0,
silo_fade_out_start_distance = 0,
times_to_blink = 0,
},
prototype
), {"RocketEntity"})
end

View File

@ -0,0 +1,9 @@
Baseless.Make.Furnace = function (name, prototype)
return Baseless.Make.CraftingMachine("furnace", name, Merge(
{
result_inventory_size = 0,
source_inventory_size = 0,
},
prototype
))
end

View File

@ -0,0 +1,8 @@
Baseless.Make.ElectricEnergyInterface = function (name, prototype)
return Baseless.Make.EntityWithHealth("electric-energy-interface", name, Merge(
{
energy_source = Baseless.Data.EnergySource.Electric,
},
prototype
))
end

View File

@ -0,0 +1,15 @@
local WireConnectionPoint =
{
{wire = {}, shadow = {}},
}
Baseless.Make.ElectricPole = function (name, prototype)
return Baseless.Make.EntityWithHealth("electric-pole", name, Merge(
{
connection_points = WireConnectionPoint,
pictures = Baseless.Graphics.RotatedSprite,
supply_area_distance = 0,
},
prototype
))
end

View File

@ -0,0 +1,34 @@
local UnitSpawnDefinition =
{
{
unit = Baseless.Data.UnitEntity,
spawn_points =
{
{
evolution_factor = 0,
spawn_weight = 0,
},
},
},
}
local Cooldowns = {1, 1}
Baseless.Make.EnemySpawner = function (name, prototype)
return Baseless.Make.EntityWithHealth("unit-spawner", name, Merge(
{
animations = Baseless.Graphics.AnimationVariations,
call_for_help_radius = 0,
max_count_of_owned_units = 0,
max_friends_around_to_spawn = 0,
max_richness_for_spawn_shift = 0,
max_spawn_shift = 0,
pollution_absorption_absolute = 0,
pollution_absorption_proportional = 0,
result_units = UnitSpawnDefinition,
spawning_cooldown = Cooldowns,
spawning_radius = 0,
spawning_spacing = 0,
},
prototype
), {"UnitEntity"})
end

View File

@ -0,0 +1,8 @@
Baseless.Make.Fish = function (name, prototype)
return Baseless.Make.EntityWithHealth("fish", name, Merge(
{
pictures = Baseless.Graphics.SpriteVariations,
},
prototype
))
end

View File

@ -0,0 +1,8 @@
Baseless.Make.FlyingRobot = function (type, name, prototype, conditions)
return Baseless.Make.EntityWithHealth(type, name, Merge(
{
speed = 0,
},
prototype
), conditions)
end

View File

@ -0,0 +1,13 @@
Baseless.Make.CombatRobot = function (name, prototype)
return Baseless.Make.FlyingRobot("combat-robot", name, Merge(
{
attack_parameters = Baseless.Data.AttackParameters,
idle = Baseless.Graphics.RotatedAnimation,
in_motion = Baseless.Graphics.RotatedAnimation,
shadow_idle = Baseless.Graphics.RotatedAnimation,
shadow_in_motion = Baseless.Graphics.RotatedAnimation,
time_to_live = 0,
},
prototype
), {"AmmoType"})
end

View File

@ -0,0 +1,9 @@
Baseless.Make.RobotWithLogisticInterface = function (type, name, prototype, conditions)
return Baseless.Make.FlyingRobot(type, name, Merge(
{
cargo_centered = Baseless.Data.Vector.Zero,
max_payload_size = 0,
},
prototype
), conditions)
end

View File

@ -0,0 +1,8 @@
Baseless.Make.ConstructionRobot = function (name, prototype)
return Baseless.Make.RobotWithLogisticInterface("construction-robot", name, Merge(
{
construction_vector = Baseless.Data.Vector.Zero,
},
prototype
))
end

View File

@ -0,0 +1,7 @@
Baseless.Make.LogisticRobot = function (name, prototype)
return Baseless.Make.RobotWithLogisticInterface("logistic-robot", name, Merge(
{
},
prototype
))
end

View File

@ -0,0 +1,21 @@
Baseless.Make.Gate = function (name, prototype)
return Baseless.Make.EntityWithHealth("gate", name, Merge(
{
activation_distance = 0,
close_sound = Baseless.Sound,
horizontal_animation = Baseless.Graphics.Animation,
horizontal_rail_animation_left = Baseless.Graphics.Animation,
horizontal_rail_animation_right = Baseless.Graphics.Animation,
horizontal_rail_base = Baseless.Graphics.Animation,
open_sound = Baseless.Sound,
opening_speed = 0,
timeout_to_close = 0,
vertical_animation = Baseless.Graphics.Animation,
vertical_rail_animation_left = Baseless.Graphics.Animation,
vertical_rail_animation_right = Baseless.Graphics.Animation,
vertical_rail_base = Baseless.Graphics.Animation,
wall_patch = Baseless.Graphics.Animation,
},
prototype
))
end

View File

@ -0,0 +1,15 @@
Baseless.Make.Generator = function (name, prototype)
return Baseless.Make.EntityWithHealth("generator", name, Merge(
{
effectivity = 0,
energy_source = Baseless.Data.EnergySource.Electric,
fluid_box = Baseless.Data.FluidBox,
fluid_usage_per_tick = 0,
horizontal_animation = Baseless.Graphics.Animation,
maximum_temperature = 0,
vertical_animation = Baseless.Graphics.Animation,
max_power_output = Baseless.Data.Energy,
},
prototype
))
end

View File

@ -0,0 +1,8 @@
Baseless.Make.HeatInterface = function (name, prototype)
return Baseless.Make.EntityWithHealth("heat-interface", name, Merge(
{
heat_buffer = Baseless.Data.HeatBuffer,
},
prototype
))
end

View File

@ -0,0 +1,30 @@
local ConnectableEntityGraphics =
{
single = Baseless.Graphics.SpriteVariations,
straight_vertical = Baseless.Graphics.SpriteVariations,
straight_horizontal = Baseless.Graphics.SpriteVariations,
corner_right_down = Baseless.Graphics.SpriteVariations,
corner_left_down = Baseless.Graphics.SpriteVariations,
corner_right_up = Baseless.Graphics.SpriteVariations,
corner_left_up = Baseless.Graphics.SpriteVariations,
t_up = Baseless.Graphics.SpriteVariations,
t_right = Baseless.Graphics.SpriteVariations,
t_down = Baseless.Graphics.SpriteVariations,
t_left = Baseless.Graphics.SpriteVariations,
ending_up = Baseless.Graphics.SpriteVariations,
ending_right = Baseless.Graphics.SpriteVariations,
ending_down = Baseless.Graphics.SpriteVariations,
ending_left = Baseless.Graphics.SpriteVariations,
cross = Baseless.Graphics.SpriteVariations,
}
Baseless.Make.HeatPipe = function (name, prototype)
return Baseless.Make.EntityWithHealth("heat-pipe", name, Merge(
{
connection_sprites = ConnectableEntityGraphics,
heat_buffer = Baseless.Data.HeatBuffer,
heat_glow_sprites = ConnectableEntityGraphics,
},
prototype
))
end

View File

@ -0,0 +1,24 @@
local InsertVector = {0, 1}
local PickupVector = {0, -1}
local CollisionBox = {{-0.1, -0.1}, {0.1, 0.1}}
Baseless.Make.Inserter = function (name, prototype)
return Baseless.Make.EntityWithHealth("inserter", name, Merge(
{
energy_source = Baseless.Data.EnergySource.Electric,
extension_speed = 0,
hand_base_picture = Baseless.Graphics.Sprite,
hand_base_shadow = Baseless.Graphics.Sprite,
hand_closed_picture = Baseless.Graphics.Sprite,
hand_closed_shadow = Baseless.Graphics.Sprite,
hand_open_picture = Baseless.Graphics.Sprite,
hand_open_shadow = Baseless.Graphics.Sprite,
insert_position = InsertVector,
pickup_position = PickupVector,
platform_picture = Baseless.Graphics.Sprite4Way,
rotation_speed = 0,
collision_box = CollisionBox,
},
prototype
))
end

View File

@ -0,0 +1,12 @@
Baseless.Make.Lab = function (name, prototype)
return Baseless.Make.EntityWithHealth("lab", name, Merge(
{
energy_source = Baseless.Data.EnergySource.Electric,
energy_usage = Baseless.Data.Energy,
inputs = {},
off_animation = Baseless.Graphics.Animation,
on_animation = Baseless.Graphics.Animation,
},
prototype
))
end

Some files were not shown because too many files have changed in this diff Show More