mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Factorio: add Traps
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
from Options import Choice, OptionDict, Option, DefaultOnToggle
|
||||
from Options import Choice, OptionDict, Option, DefaultOnToggle, Range
|
||||
from schema import Schema, Optional, And, Or
|
||||
|
||||
# schema helpers
|
||||
@@ -125,6 +125,27 @@ class FactorioStartItems(OptionDict):
|
||||
default = {"burner-mining-drill": 19, "stone-furnace": 19}
|
||||
|
||||
|
||||
class TrapCount(Range):
|
||||
range_end = 4
|
||||
|
||||
|
||||
class AttackTrapCount(TrapCount):
|
||||
"""Trap items that when received trigger an attack on your base."""
|
||||
displayname = "Attack Traps"
|
||||
|
||||
|
||||
class EvolutionTrapCount(TrapCount):
|
||||
"""Trap items that when received increase the enemy evolution."""
|
||||
displayname = "Evolution Traps"
|
||||
|
||||
|
||||
class EvolutionTrapIncrease(Range):
|
||||
displayname = "Evolution Trap % Effect"
|
||||
range_start = 1
|
||||
default = 10
|
||||
range_end = 100
|
||||
|
||||
|
||||
class FactorioWorldGen(OptionDict):
|
||||
displayname = "World Generation"
|
||||
# FIXME: do we want default be a rando-optimized default or in-game DS?
|
||||
@@ -257,9 +278,11 @@ class FactorioWorldGen(OptionDict):
|
||||
else:
|
||||
raise NotImplementedError(f"Cannot Convert from non-dictionary, got {type(data)}")
|
||||
|
||||
|
||||
class ImportedBlueprint(DefaultOnToggle):
|
||||
displayname = "Blueprints"
|
||||
|
||||
|
||||
factorio_options: typing.Dict[str, type(Option)] = {
|
||||
"max_science_pack": MaxSciencePack,
|
||||
"tech_tree_layout": TechTreeLayout,
|
||||
@@ -272,5 +295,8 @@ factorio_options: typing.Dict[str, type(Option)] = {
|
||||
"recipe_ingredients": RecipeIngredients,
|
||||
"imported_blueprints": ImportedBlueprint,
|
||||
"world_gen": FactorioWorldGen,
|
||||
"progressive": Progressive
|
||||
"progressive": Progressive,
|
||||
"evolution_traps": EvolutionTrapCount,
|
||||
"attack_traps": AttackTrapCount,
|
||||
"evolution_trap_increase": EvolutionTrapIncrease,
|
||||
}
|
||||
|
Reference in New Issue
Block a user