Refactor recent gameplay systems after code review
This commit is contained in:
parent
3f3a22227d
commit
d68f4d4f88
57 changed files with 530 additions and 572 deletions
1
tests/_black_hole_space_preview.gd.uid
Normal file
1
tests/_black_hole_space_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://25xjfqi2qk7a
|
||||
1
tests/_carrier_crafter_preview.gd.uid
Normal file
1
tests/_carrier_crafter_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://f5a8wm4wr2i4
|
||||
1
tests/_carrier_hangar_preview.gd.uid
Normal file
1
tests/_carrier_hangar_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b5ah2jh0i16du
|
||||
1
tests/_fleet_cargo_limit_preview.gd.uid
Normal file
1
tests/_fleet_cargo_limit_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://brt82kn8lb3u5
|
||||
1
tests/_gas_burner_build_menu_preview.gd.uid
Normal file
1
tests/_gas_burner_build_menu_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bs6hguk0tkc6c
|
||||
1
tests/_gas_burner_transfer_preview.gd.uid
Normal file
1
tests/_gas_burner_transfer_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://fd1m4excjdbn
|
||||
1
tests/_laser_aim_preview.gd.uid
Normal file
1
tests/_laser_aim_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c0q640rosb53o
|
||||
1
tests/_mothership_beam_preview.gd.uid
Normal file
1
tests/_mothership_beam_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c8lgxg63d8s52
|
||||
1
tests/_resource_readout_surface_preview.gd.uid
Normal file
1
tests/_resource_readout_surface_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cy6n62kcp7q1y
|
||||
1
tests/_rocky_surface_preview.gd.uid
Normal file
1
tests/_rocky_surface_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c0yjf3qdv31eo
|
||||
1
tests/_turret_vs_chaser_preview.gd.uid
Normal file
1
tests/_turret_vs_chaser_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dfi84x2tcwqwy
|
||||
1
tests/_void_surface_preview.gd.uid
Normal file
1
tests/_void_surface_preview.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://clf1bitxms0ti
|
||||
1
tests/test_black_hole.gd.uid
Normal file
1
tests/test_black_hole.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://vlcbg3juhpy3
|
||||
1
tests/test_carrier_vessel.gd.uid
Normal file
1
tests/test_carrier_vessel.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://gj02xu88lxpm
|
||||
1
tests/test_distorder_energy.gd.uid
Normal file
1
tests/test_distorder_energy.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bistn7dgiv7lw
|
||||
1
tests/test_enemy_mothership.gd.uid
Normal file
1
tests/test_enemy_mothership.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c18rxosfduxoa
|
||||
1
tests/test_fleet_cargo_limit.gd.uid
Normal file
1
tests/test_fleet_cargo_limit.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b1fyqy5i8mqf0
|
||||
1
tests/test_gas_bomber_ammo.gd.uid
Normal file
1
tests/test_gas_bomber_ammo.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cwcw77qvykk35
|
||||
1
tests/test_gas_bomber_cooldowns.gd.uid
Normal file
1
tests/test_gas_bomber_cooldowns.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://tguuracp1ewt
|
||||
|
|
@ -30,6 +30,8 @@ var hub_id: int = 0
|
|||
var burner_id: int = 0
|
||||
var load_limit: int = 0
|
||||
var energy_before_stall: int = 0
|
||||
var conversion_rate: float = 0.0
|
||||
var conversion_yield: int = 0
|
||||
|
||||
const MOTHERSHIP_AT := Vector2.ZERO
|
||||
const HUB_AT := Vector2(150.0, 0.0)
|
||||
|
|
@ -48,6 +50,9 @@ func _initialize() -> void:
|
|||
mothership_id = game_state.add_building(GameState.BUILDING_MOTHERSHIP, MOTHERSHIP_AT)
|
||||
burner_id = game_state.add_building(GameState.BUILDING_GAS_BURNER, BURNER_AT)
|
||||
game_state.deposit_resource_to_building(burner_id, GameState.RESOURCE_GAS, 20)
|
||||
var logistics: Resource = game_state.building_logistics_profile(game_state.find_building(burner_id))
|
||||
conversion_rate = logistics.conversion_rate
|
||||
conversion_yield = logistics.conversion_yield
|
||||
|
||||
|
||||
func _process(delta: float) -> bool:
|
||||
|
|
@ -73,10 +78,10 @@ func _process(delta: float) -> bool:
|
|||
var energy_made: int = game_state.building_resource(burner_id, GameState.RESOURCE_ENERGY)
|
||||
var gas_burned: int = 20 - gas_left
|
||||
if gas_burned < 2:
|
||||
return _fail("burner only burned %d gas in 2.5s at rate %.1f/s" % [gas_burned, GameState.GAS_BURN_RATE])
|
||||
if energy_made != gas_burned * GameState.ENERGY_PER_GAS:
|
||||
return _fail("burner only burned %d gas in 2.5s at rate %.1f/s" % [gas_burned, conversion_rate])
|
||||
if energy_made != gas_burned * conversion_yield:
|
||||
return _fail("burner made %d energy for %d gas burned, expected %dx" % [
|
||||
energy_made, gas_burned, GameState.ENERGY_PER_GAS
|
||||
energy_made, gas_burned, conversion_yield
|
||||
])
|
||||
if game_state.rocks != 0 or game_state.gas != 0:
|
||||
return _fail("conversion touched the bank (rocks=%d gas=%d) - it must only use local stock" % [
|
||||
|
|
|
|||
1
tests/test_gas_burner.gd.uid
Normal file
1
tests/test_gas_burner.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dlx2eu6lw3ps6
|
||||
|
|
@ -12,6 +12,7 @@ func _initialize() -> void:
|
|||
state.transporters.clear()
|
||||
state.reset_progression()
|
||||
state.rocks = 900
|
||||
state.research_points = state.skill_research_point_cost("freight_yards")
|
||||
state.unlocked = ["shipyards", "logistics", "freight"]
|
||||
|
||||
var hub_a: int = state.add_building(state.BUILDING_TRANSPORT_HUB, Vector2(-500, 0))
|
||||
|
|
|
|||
1
tests/test_laser_ammo.gd.uid
Normal file
1
tests/test_laser_ammo.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d24p5etger56g
|
||||
1
tests/test_laser_vessel.gd.uid
Normal file
1
tests/test_laser_vessel.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dp0e71h2124c8
|
||||
1
tests/test_research_points.gd.uid
Normal file
1
tests/test_research_points.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://x08iyhs2lrrr
|
||||
1
tests/test_resource_readout.gd.uid
Normal file
1
tests/test_resource_readout.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bhad0657luiec
|
||||
1
tests/test_space_time_distorder.gd.uid
Normal file
1
tests/test_space_time_distorder.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://btmmwkkgw6qwi
|
||||
1
tests/test_surface_profiles.gd.uid
Normal file
1
tests/test_surface_profiles.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://crbidmy4oqat7
|
||||
1
tests/test_turret_spawner_enemy.gd.uid
Normal file
1
tests/test_turret_spawner_enemy.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://du2i8ayup3qkd
|
||||
|
|
@ -23,8 +23,7 @@ func _process(delta: float) -> bool:
|
|||
return false
|
||||
var definitions: Array = VESSEL_DEFINITIONS.all()
|
||||
var fleet_definitions: Array = VESSEL_DEFINITIONS.fleet()
|
||||
if fleet_definitions.size() != 5 \
|
||||
or fleet_definitions.any(func(definition): return definition.has_capability("transport")):
|
||||
if fleet_definitions.any(func(definition): return definition.has_capability("transport")):
|
||||
return _fail("logistics transporters leaked into the combat-fleet catalog")
|
||||
if ships.size() != definitions.size():
|
||||
return _fail("catalog and composed fleet differ in size")
|
||||
|
|
|
|||
Loading…
Reference in a new issue