36 lines
1.4 KiB
Text
36 lines
1.4 KiB
Text
[gd_scene format=3 uid="uid://c4ocislhm428e"]
|
|
|
|
[ext_resource type="PackedScene" uid="uid://hmnpg2lm6u02" path="res://assets/models/pickups/rifle_ammo_pickup.blend" id="1_nigrf"]
|
|
|
|
[sub_resource type="SphereShape3D" id="SphereShape3D_txvix"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_nigrf"]
|
|
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().rifle_ammo += 10
|
|
get_parent().queue_free()
|
|
|
|
func _process(delta : float):
|
|
$\"../rifle_ammo_pickup\".global_rotate(Vector3(0, 1, 0), delta)
|
|
"
|
|
|
|
[node name="RifleAmmoPickup" type="StaticBody3D" unique_id=384637127]
|
|
collision_layer = 16
|
|
collision_mask = 0
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=41210596]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4182733, 0)
|
|
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=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)
|