Add gas bomber skill-shot vessel
This commit is contained in:
parent
d0a9f5b971
commit
1d9afcbc2e
28 changed files with 882 additions and 85 deletions
25
Fleet.gd
25
Fleet.gd
|
|
@ -86,6 +86,31 @@ func vessel_types() -> PackedStringArray:
|
|||
return result
|
||||
|
||||
|
||||
func has_vessel_type(vessel_type: String) -> bool:
|
||||
for ship in ships:
|
||||
if is_instance_valid(ship) and String(ship.vessel_type) == vessel_type:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func first_vessel_of_type(vessel_type: String) -> Node2D:
|
||||
for ship in ships:
|
||||
if is_instance_valid(ship) and String(ship.vessel_type) == vessel_type:
|
||||
return ship
|
||||
return null
|
||||
|
||||
|
||||
func has_capability(capability: String) -> bool:
|
||||
return first_ship_with_capability(capability) != null
|
||||
|
||||
|
||||
func first_ship_with_capability(capability: String) -> Node2D:
|
||||
for ship in ships:
|
||||
if is_instance_valid(ship) and ship.has_capability(capability):
|
||||
return ship
|
||||
return null
|
||||
|
||||
|
||||
func add_ship(vessel_type: String = GameState.VESSEL_INTERCEPTOR) -> bool:
|
||||
# Adds one vessel in the next free formation slot (bought from a ship
|
||||
# crafter). Returns false when the wedge is already full.
|
||||
|
|
|
|||
Loading…
Reference in a new issue