Skip to content
Open
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
3 changes: 3 additions & 0 deletions fle/env/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class EntityStatus(Enum):
NO_INGREDIENTS = "no_ingredients"
ITEM_INGREDIENT_SHORTAGE = "item_ingredient_shortage"
RECIPE_NOT_RESEARCHED = "recipe_not_researched"
RECIPE_IS_PARAMETER = "recipe_is_parameter"

# Fluid-related states
NO_INPUT_FLUID = "no_input_fluid"
Expand All @@ -98,6 +99,7 @@ class EntityStatus(Enum):

# Inserter/logistics states
WAITING_FOR_SOURCE_ITEMS = "waiting_for_source_items"
WAITING_FOR_MORE_ITEMS = "waiting_for_more_items"
WAITING_FOR_SPACE_IN_DESTINATION = "waiting_for_space_in_destination"
OUT_OF_LOGISTIC_NETWORK = "out_of_logistic_network"
NO_FILTER = "no_filter"
Expand All @@ -112,6 +114,7 @@ class EntityStatus(Enum):
ON_THE_WAY = "on_the_way"
WAITING_IN_ORBIT = "waiting_in_orbit"
WAITING_FOR_ROCKET_TO_ARRIVE = "waiting_for_rocket_to_arrive"
WAITING_FOR_ROCKETS_TO_ARRIVE = "waiting_for_rockets_to_arrive"

# Combat/turret states
NO_AMMO = "no_ammo"
Expand Down
30 changes: 22 additions & 8 deletions fle/env/game_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ class RecipeName(enum.Enum):
"basic-oil-processing" # Recipe for producing petroleum gas with a oil refinery
)
AdvancedOilProcessing = "advanced-oil-processing" # Recipe for producing petroleum gas, heavy oil and light oil with a oil refinery
CoalLiquefaction = (
"coal-liquefaction" # Recipe for producing petroleum gas in a oil refinery
)
CoalLiquefaction = "coal-liquefaction" # Recipe for producing heavy oil, light oil and petroleum gas from coal, heavy oil and steam in an oil refinery
HeavyOilCracking = (
"heavy-oil-cracking" # Recipe for producing light oil in a chemical plant
)
Expand Down Expand Up @@ -123,7 +121,13 @@ class Prototype(enum.Enum, metaclass=PrototypeMetaclass):
FastSplitter = "fast-splitter", ent.Splitter
ExpressSplitter = "express-splitter", ent.Splitter

# Factorio 2.0: the "rail" item places a straight-rail; placed rails are one of
# straight-rail, curved-rail-a, curved-rail-b or half-diagonal-rail
Rail = "rail", ent.Rail
StraightRail = "straight-rail", ent.Rail
CurvedRailA = "curved-rail-a", ent.Rail
CurvedRailB = "curved-rail-b", ent.Rail
HalfDiagonalRail = "half-diagonal-rail", ent.Rail

TransportBelt = "transport-belt", ent.TransportBelt
FastTransportBelt = "fast-transport-belt", ent.TransportBelt
Expand Down Expand Up @@ -171,7 +175,8 @@ class Prototype(enum.Enum, metaclass=PrototypeMetaclass):
StoneBrick = "stone-brick", None # Crafting requires smelting 2 stone
CopperCable = "copper-cable", None
PlasticBar = "plastic-bar", None
EmptyBarrel = "empty-barrel", None
Barrel = "barrel", None # Factorio 2.0: empty-barrel renamed to barrel
EmptyBarrel = "barrel", None # Alias of Barrel (the 1.1 name was empty-barrel)
Battery = "battery", None
SulfuricAcid = "sulfuric-acid", None
Uranium235 = "uranium-235", None
Expand All @@ -183,8 +188,11 @@ class Prototype(enum.Enum, metaclass=PrototypeMetaclass):
"advanced-oil-processing",
None,
) # These are recipes, not prototypes.
CoalLiquifaction = "coal-liquifaction", None # These are recipes, not prototypes.
SolidFuel = "solid-fuel", None # These are recipes, not prototypes.
CoalLiquefaction = (
"coal-liquefaction",
None,
) # These are recipes, not prototypes.
SolidFuel = "solid-fuel", None
LightOil = "light-oil", None
HeavyOil = "heavy-oil", None

Expand All @@ -201,6 +209,10 @@ class Prototype(enum.Enum, metaclass=PrototypeMetaclass):
PiercingRoundsMagazine = "piercing-rounds-magazine", ent.Ammo
FirearmMagazine = "firearm-magazine", ent.Ammo
Grenade = "grenade", None
Explosives = "explosives", None
CliffExplosives = "cliff-explosives", None
Landfill = "landfill", None
RepairPack = "repair-pack", None

Radar = "radar", ent.Entity
StoneWall = "stone-wall", ent.Entity
Expand All @@ -225,10 +237,12 @@ class Prototype(enum.Enum, metaclass=PrototypeMetaclass):
FlyingRobotFrame = "flying-robot-frame", None

RocketSilo = "rocket-silo", ent.RocketSilo
Rocket = "rocket", ent.Rocket
Rocket = (
"rocket",
ent.Ammo,
) # The rocket launcher's ammo item, not the silo's rocket
Satellite = "satellite", None
RocketPart = "rocket-part", None
RocketControlUnit = "rocket-control-unit", None
LowDensityStructure = "low-density-structure", None
RocketFuel = "rocket-fuel", None
SpaceSciencePack = "space-science-pack", None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Prototype(enum.Enum):
AutomationSciencePack, LogisticsSciencePack, ChemicalSciencePack
MilitarySciencePack, ProductionSciencePack, UtilitySciencePack, SpaceSciencePack
# Rocket
RocketSilo, Satellite, RocketPart, RocketControlUnit, LowDensityStructure, RocketFuel
RocketSilo, Satellite, RocketPart, LowDensityStructure, RocketFuel

class RecipeName(enum.Enum):
# Oil processing
Expand Down
6 changes: 3 additions & 3 deletions tests/entities/test_rockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def game(configure_game):
"steam-engine": 5,
"inserter": 10,
"iron-chest": 5,
"rocket-control-unit": 100,
"processing-unit": 100,
"rocket-fuel": 100,
"low-density-structure": 100,
"solar-panel": 10,
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_inserter_to_rocket_silo(configure_game):
"coal": 100,
"low-density-structure": 200,
"rocket-fuel": 200,
"rocket-control-unit": 200,
"processing-unit": 200,
},
merge=True,
)
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_inserter_to_rocket_silo(configure_game):
for item_name, prototype in [
("low-density-structure", Prototype.LowDensityStructure),
("rocket-fuel", Prototype.RocketFuel),
("rocket-control-unit", Prototype.RocketControlUnit),
("processing-unit", Prototype.ProcessingUnit),
]:
try:
game.insert_item(prototype, chest, quantity=10)
Expand Down
7 changes: 2 additions & 5 deletions tests/render/test_assembler_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def game(instance):
"sulfur": 50,
"low-density-structure": 10,
"rocket-fuel": 10,
"rocket-control-unit": 10,
"flying-robot-frame": 10,
"grenade": 20,
"firearm-magazine": 50,
Expand Down Expand Up @@ -97,7 +96,7 @@ def game(instance):
Prototype.UndergroundPipe,
Prototype.StorageTank,
Prototype.Pump,
Prototype.EmptyBarrel,
Prototype.Barrel,
# Storage
Prototype.WoodenChest,
Prototype.IronChest,
Expand All @@ -124,7 +123,6 @@ def game(instance):
# Rocket parts
Prototype.RocketFuel,
Prototype.LowDensityStructure,
Prototype.RocketControlUnit,
Prototype.Satellite,
# Misc
Prototype.SmallLamp,
Expand Down Expand Up @@ -202,7 +200,7 @@ def clear_terrain(game):
"pipe-to-ground",
"storage-tank",
"pump",
"empty-barrel",
"barrel",
# Storage
"wooden-chest",
"iron-chest",
Expand Down Expand Up @@ -235,7 +233,6 @@ def clear_terrain(game):
# Rocket parts
"rocket-fuel",
"low-density-structure",
"rocket-control-unit",
"satellite",
# Misc
"small-lamp",
Expand Down
Loading