feat: rifle pickup added to map

This commit is contained in:
Sara 2025-08-11 16:10:16 +02:00
parent 2511ac69c0
commit 6b7a092961
8 changed files with 57 additions and 6 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=31 format=4 uid="uid://dllho5nkq2smw"]
[gd_scene load_steps=32 format=4 uid="uid://dllho5nkq2smw"]
[ext_resource type="PackedScene" uid="uid://eu0yil2ylm0q" path="res://objects/props/box_car_fully_enclosed.tscn" id="1_ti8jp"]
[ext_resource type="PackedScene" uid="uid://hf7yyyiep30l" path="res://objects/props/box_car_enclosed.tscn" id="2_cfpv2"]
@ -12,6 +12,7 @@
[ext_resource type="PackedScene" uid="uid://22j1too6rheq" path="res://objects/props/sand_bag_half_circle.tscn" id="9_ug5on"]
[ext_resource type="PackedScene" uid="uid://cclghy01gblif" path="res://objects/pickups/demo_pack_pickup.tscn" id="11_foo0w"]
[ext_resource type="PackedScene" uid="uid://5hg5eirw7v8n" path="res://objects/units/unit_4_wretched.tscn" id="12_plog7"]
[ext_resource type="PackedScene" uid="uid://crml35t12hx2h" path="res://objects/pickups/weapon_pickup.tscn" id="13_qwrat"]
[sub_resource type="GDScript" id="GDScript_ug5on"]
script/source = "extends Interactable
@ -802,3 +803,6 @@ use_collision = true
collision_layer = 19
collision_mask = 0
size = Vector3(5.7617188, 4.102051, 0.33398438)
[node name="WeaponPickup" parent="." instance=ExtResource("13_qwrat")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -17.444277, 0.05698805, -22.7964)

View file

@ -17,7 +17,7 @@ func _on_health_status_death() -> void:
radius = 0.26953125
[node name="EnemyWretched" type="EnemyWretched"]
chase_speed = 4.0
chase_speed = 7.0
script = SubResource("GDScript_qot2n")
[node name="wretched" parent="." instance=ExtResource("1_qot2n")]

View file

@ -0,0 +1,39 @@
[gd_scene load_steps=5 format=3 uid="uid://crml35t12hx2h"]
[ext_resource type="PackedScene" uid="uid://ce40pq785yoyi" path="res://objects/weapons/rifle.tscn" id="1_y6dn2"]
[sub_resource type="GDScript" id="GDScript_fn0cd"]
script/source = "extends Interactable
@export var weapon_name : String = \"Rifle\"
@export var weapon_scene : PackedScene
func _highlight_changed(_interactor: PlayerInteractor, value: bool) -> void:
var hud := HeadsUpDisplay.get_singleton()
if hud:
hud.set_tooltip(\"Pick up %s\" % weapon_name if value else \"\")
func _activated(interactor: PlayerInteractor) -> void:
interactor.get_inventory().pickup_weapon(weapon_scene)
get_parent().queue_free()
"
[sub_resource type="BoxMesh" id="BoxMesh_fn0cd"]
size = Vector3(0.2, 0.1, 0.7)
[sub_resource type="BoxShape3D" id="BoxShape3D_fn0cd"]
size = Vector3(0.20874023, 0.115478516, 0.7109375)
[node name="WeaponPickup" type="StaticBody3D"]
collision_layer = 16
collision_mask = 0
[node name="Interactable" type="Interactable" parent="."]
script = SubResource("GDScript_fn0cd")
weapon_scene = ExtResource("1_y6dn2")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_fn0cd")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("BoxShape3D_fn0cd")

View file

@ -9,7 +9,7 @@ radius = 0.2
script/source = "extends HealthStatus
func _on_death() -> void:
get_tree().change_scene_to_file.call_deferred(\"res://menus/main_menu.tscn\")
get_tree().change_scene_to_file.call_deferred(\"res://guis/main_menu.tscn\")
"
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bxedw"]