Quest taking and rejecting

This commit is contained in:
2ndbeam 2024-05-31 11:23:15 +03:00
commit c6d8ae8be0
12 changed files with 87 additions and 14 deletions

View file

@ -14,8 +14,10 @@ var selected_node: Node2D = null
var money: float = 1000.0
## Base which was requested to dock last
var docking_base: Base = null
## Items that player ship carries
var cargo = {}
## Current quest
var quest: Quest = null
func destroy():
super.destroy()
@ -23,3 +25,6 @@ func destroy():
docking_base.dock_ready()
docking_base = null
selected_node = null
if quest != null:
if Quest.Restriction.NoDeaths in quest.restrictions:
quest.fail()

View file

@ -42,6 +42,10 @@ func _process(_delta) -> void:
ship.shield.can_recharge_laser = false
func shoot() -> void:
if ship is PlayerShip:
if ship.quest != null:
if Quest.Restriction.NoWeapon in ship.quest.restrictions:
ship.quest.fail()
for spawner in spawner_points:
var projectile_instance = projectile.instantiate()
ProjectileContainer.instance.add_child(projectile_instance)