feat: finished rifle ammo pickup

This commit is contained in:
Sara Gerretsen 2026-02-09 17:33:46 +01:00
parent 1b1eca2e6a
commit fb1e707039

View file

@ -8,8 +8,13 @@
resource_name = "RifleAmmoPickup"
script/source = "extends Interactable
func _highlight_changed(interactor: PlayerInteractor, value: bool) -> void:
var hud := HeadsUpDisplay.get_singleton()
if hud:
hud.set_tooltip(\"Pick up 10 shots of rifle ammo\" if value else \"\")
func _activated(interactor: PlayerInteractor) -> void:
interactor.get_inventory().pistol_ammo += 10
interactor.get_inventory().rifle_ammo += 10
get_parent().queue_free()
func _process(delta : float):
@ -27,5 +32,5 @@ shape = SubResource("SphereShape3D_txvix")
[node name="Interactable" type="Interactable" parent="." unique_id=1018953245]
script = SubResource("GDScript_nigrf")
[node name="rifle_ammo_pickup" parent="." unique_id=775409181 instance=ExtResource("1_nigrf")]
[node name="rifle_ammo_pickup" parent="." unique_id=949497395 instance=ExtResource("1_nigrf")]
transform = Transform3D(0.9304751, -0.3154218, 0.1863468, 0.3663551, 0.80111384, -0.4732869, 0, 0.5086508, 0.8609729, 0, 1.3961476, 0)