Fix stuff including texture on pick up items and fix pickup

This commit is contained in:
2025-03-04 23:27:17 -08:00
parent 8cc6d85265
commit e7a48a08ee
29 changed files with 168 additions and 140 deletions

View File

@@ -14,7 +14,7 @@ config/name="GameJamDungeon"
run/main_scene="uid://d1gjaijijd5ot"
run/print_header=false
config/features=PackedStringArray("4.4", "C#", "GL Compatibility")
run/max_fps=60
run/delta_smoothing=false
boot_splash/show_image=false
[autoload]

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=14 format=3 uid="uid://33ek675mfb5n"]
[gd_scene load_steps=13 format=3 uid="uid://33ek675mfb5n"]
[ext_resource type="Script" uid="uid://chftlu4proh3d" path="res://src/game/Game.cs" id="1_ytcii"]
[ext_resource type="Shader" uid="uid://dmjxo4k2rx1an" path="res://src/app/App.gdshader" id="2_6ifxs"]
[ext_resource type="PackedScene" uid="uid://by67pn7fdsg1m" path="res://src/map/Map.tscn" id="3_d8awv"]
[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="3_kk6ly"]
[ext_resource type="Resource" uid="uid://bpdbuf0k0exb5" path="res://src/items/weapons/resources/Swan Sword Odette.tres" id="4_6pp6l"]
[ext_resource type="PackedScene" uid="uid://b1muxus5qdbeu" path="res://src/ui/in_game_ui/InGameUI.tscn" id="5_lxtnp"]
[ext_resource type="PackedScene" uid="uid://b16ejcwanod72" path="res://src/audio/InGameAudio.tscn" id="6_qc71l"]
[ext_resource type="Script" uid="uid://daphxl6vvsbjm" path="res://src/game/DialogueController.cs" id="10_58pbt"]
@@ -49,8 +48,7 @@ process_mode = 1
[node name="Player" parent="SubViewportContainer/SubViewport/PauseContainer" instance=ExtResource("3_kk6ly")]
unique_name_in_owner = true
process_mode = 1
transform = Transform3D(0.0141716, 0, 0.9999, 0, 1, 0, -0.9999, 0, 0.0141716, 0, -2.25339, -6.18796)
_defaultWeapon = ExtResource("4_6pp6l")
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, -3, 0)
[node name="Map" parent="SubViewportContainer/SubViewport/PauseContainer" instance=ExtResource("3_d8awv")]
unique_name_in_owner = true

View File

@@ -37,4 +37,6 @@ public abstract partial class InventoryItem : Node3D, IInventoryItem
[Save("inventory_item_stats")]
public abstract InventoryItemStats ItemStats { get; set; }
public Sprite3D Sprite { get; set; }
}

View File

@@ -34,6 +34,8 @@ public partial class ItemDatabase : Node
var armorInfo = GD.Load<ArmorStats>($"res://src/items/armor/resources/{armor}");
var armorScene = ArmorScene.Instantiate<Armor>();
armorScene.ItemStats = armorInfo;
armorScene.Sprite = armorScene.GetNode<Sprite3D>("%Sprite");
armorScene.Sprite.Texture = armorInfo.Texture;
database.Add(armorScene);
}
@@ -42,6 +44,8 @@ public partial class ItemDatabase : Node
var weaponInfo = GD.Load<WeaponStats>($"res://src/items/weapons/resources/{weapon}");
var weaponScene = WeaponScene.Instantiate<Weapon>();
weaponScene.ItemStats = weaponInfo;
weaponScene.Sprite = weaponScene.GetNode<Sprite3D>("%Sprite");
weaponScene.Sprite.Texture = weaponInfo.Texture;
database.Add(weaponScene);
}
@@ -50,6 +54,8 @@ public partial class ItemDatabase : Node
var accessoryInfo = GD.Load<AccessoryStats>($"res://src/items/accessory/resources/{accessory}");
var accessoryScene = AccessoryScene.Instantiate<Accessory>();
accessoryScene.ItemStats = accessoryInfo;
accessoryScene.Sprite = accessoryScene.GetNode<Sprite3D>("%Sprite");
accessoryScene.Sprite.Texture = accessoryInfo.Texture;
database.Add(accessoryScene);
}
@@ -58,6 +64,8 @@ public partial class ItemDatabase : Node
var throwableItemInfo = GD.Load<ThrowableItemStats>($"res://src/items/throwable/resources/{throwable}");
var throwableItemScene = ThrowableItemScene.Instantiate<ThrowableItem>();
throwableItemScene.ItemStats = throwableItemInfo;
throwableItemScene.Sprite = throwableItemScene.GetNode<Sprite3D>("%Sprite");
throwableItemScene.Sprite.Texture = throwableItemInfo.Texture;
database.Add(throwableItemScene);
}
@@ -66,6 +74,8 @@ public partial class ItemDatabase : Node
var consumableItemInfo = GD.Load<ConsumableItemStats>($"res://src/items/consumable/resources/{consumable}");
var consumableItemScene = ConsumableItemScene.Instantiate<ConsumableItem>();
consumableItemScene.ItemStats = consumableItemInfo;
consumableItemScene.Sprite = consumableItemScene.GetNode<Sprite3D>("%Sprite");
consumableItemScene.Sprite.Texture = consumableItemInfo.Texture;
database.Add(consumableItemScene);
}

View File

@@ -1,6 +1,4 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
namespace GameJamDungeon;

View File

@@ -10,7 +10,7 @@ DEFUp = 0
LuckUp = 0.1
MaxHPUp = 0
MaxVTUp = 0
AccessoryTags = Array[int]([])
AccessoryTag = 0
Name = "Mask of the Goddess of Avarice"
Description = "Raises Luck"
Texture = ExtResource("1_q42cv")
@@ -19,4 +19,4 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("2_yytis")
UsableItemTags = Array[int]([9])
UsableItemTag = 0
ElementalDamageType = 1
Name = "Aeolic Caster"
Description = "Deal Aeolic Damage to all enemies in the room."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("2_53wiy")
UsableItemTags = Array[int]([11])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Cloth Resolution"
Description = "Raises currently equipped armor's defense by 1."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("2_n1557")
UsableItemTags = Array[int]([12])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Cosmos"
Description = "Raises current Level by 1."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,8 @@
[resource]
script = ExtResource("1_50lqu")
UsableItemTags = Array[int]([6])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Devic Balance"
Description = "Kill half of all enemies in current room."
Texture = ExtResource("1_j7j7j")
@@ -14,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,8 @@
[resource]
script = ExtResource("1_0uaie")
UsableItemTags = Array[int]([4])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Devic Recall"
Description = "Teleports all enemies to current room."
Texture = ExtResource("1_j462p")
@@ -14,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_3l06v")
UsableItemTags = Array[int]([10])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Entropic Seal"
Description = "Random effect."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_uojwo")
UsableItemTags = Array[int]([10])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Ferrous Resolution"
Description = "Raises currently equipped weapon's attack by 1."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("2_i4na1")
UsableItemTags = Array[int]([9])
UsableItemTag = 0
ElementalDamageType = 5
Name = "Ferrum Caster"
Description = "Deal Ferrum Damage to all enemies in the room."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,8 @@
[resource]
script = ExtResource("1_drp30")
UsableItemTags = Array[int]([8])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Heaven's Rebellion"
Description = "Heals self and all enemies in current room to maximum HP."
Texture = ExtResource("1_g0a3x")
@@ -14,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_mj844")
UsableItemTags = Array[int]([9])
UsableItemTag = 0
ElementalDamageType = 3
Name = "Hydric Caster"
Description = "Deal Hydric Damage to all enemies in the room."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("2_cl8lc")
UsableItemTags = Array[int]([9])
UsableItemTag = 0
ElementalDamageType = 4
Name = "Igneous Caster"
Description = "Deal Igneous Damage to all enemies in the room."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_lq0bc")
UsableItemTags = Array[int]([3])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Perspective"
Description = "Swap current HP and VT."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,8 @@
[resource]
script = ExtResource("1_ksb1c")
UsableItemTags = Array[int]([5])
UsableItemTag = 0
ElementalDamageType = 0
Name = "Sine Morphization"
Description = "Turns all enemies in room to healing item."
Texture = ExtResource("1_vqhky")
@@ -14,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,7 +5,7 @@
[resource]
script = ExtResource("2_38yjb")
UsableItemTags = Array[int]([9])
UsableItemTag = 0
ElementalDamageType = 2
Name = "Telluric Caster"
Description = "Deal Telluric Damage to all enemies in the room."
@@ -15,5 +15,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -5,9 +5,9 @@
[resource]
script = ExtResource("2_m680r")
ThrowableItemTags = Array[int]([2])
ThrowableItemTag = 0
ElementType = 0
UsableItemTags = Array[int]([])
UsableItemTag = 0
Name = "Gospel of Dimension"
Description = "Teleports target to a random location."
Texture = ExtResource("1_xt2mp")
@@ -16,4 +16,4 @@ ThrowSpeed = 20.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 20
ItemTags = Array[int]([])
ItemTag = 0

View File

@@ -5,9 +5,9 @@
[resource]
script = ExtResource("1_pn8sr")
ThrowableItemTags = Array[int]([3])
ThrowableItemTag = 0
ElementType = 0
UsableItemTags = Array[int]([])
UsableItemTag = 0
Name = "Gospel of Escape"
Description = "Warps target to the exit. No effect on player if exit has not been found."
Texture = ExtResource("1_26kno")
@@ -16,5 +16,5 @@ ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
ItemTag = 0
metadata/_custom_type_script = "uid://d3wlunkcuv2w2"

View File

@@ -22,6 +22,7 @@ public partial class ThrownItem : RigidBody3D
public void OnResolved()
{
BodyEntered += ThrownItem_BodyEntered;
GlobalPosition = Player.CurrentPosition;
Sprite.Texture = ItemThatIsThrown.ItemStats.Texture;
AddCollisionExceptionWith((Node)Player);

View File

@@ -1,7 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://b1twcuneob5kt"]
[gd_scene load_steps=5 format=3 uid="uid://b1twcuneob5kt"]
[ext_resource type="Script" uid="uid://bx1k4yff3m82m" path="res://src/items/thrown/ThrownItem.cs" id="1_wlplc"]
[ext_resource type="Texture2D" uid="uid://mi70lolgtf3n" path="res://src/items/throwable/textures/GEOMANCER-DICE.png" id="2_alcjn"]
[ext_resource type="Material" uid="uid://x2bv1q51mcjq" path="res://src/enemy/PixelMelt.tres" id="2_qjpqg"]
[sub_resource type="BoxShape3D" id="BoxShape3D_s4ym5"]
@@ -13,7 +12,8 @@ viewport_path = NodePath("Sprite3D/SubViewportContainer/SubViewport")
[node name="Hitbox" type="RigidBody3D"]
collision_layer = 1040
collision_mask = 25
gravity_scale = 0.25
mass = 0.1
gravity_scale = 0.01
contact_monitor = true
max_contacts_reported = 50
script = ExtResource("1_wlplc")
@@ -54,5 +54,4 @@ render_target_update_mode = 4
unique_name_in_owner = true
material = ExtResource("2_qjpqg")
scale = Vector2(0.1, 0.1)
texture = ExtResource("2_alcjn")
centered = false

View File

@@ -1,6 +1,4 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
namespace GameJamDungeon;
@@ -8,9 +6,6 @@ namespace GameJamDungeon;
[Meta, Id("weapon")]
public partial class Weapon : EquipableItem
{
[Signal]
public delegate void EquippedItemEventHandler(Weapon equippedWeapon);
[Export]
private WeaponStats _weaponStats { get; set; } = new WeaponStats();

View File

@@ -6,7 +6,6 @@
radius = 0.470016
[node name="Weapon" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.75, 0)
script = ExtResource("1_7pkyf")
[node name="Pickup" type="Area3D" parent="."]

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=42 format=4 uid="uid://bn4gslp2gk8ds"]
[gd_scene load_steps=43 format=4 uid="uid://bn4gslp2gk8ds"]
[ext_resource type="Script" uid="uid://fk3jis6rsipv" path="res://src/map/dungeon/code/corridor.gd" id="1_lepkf"]
[ext_resource type="Texture2D" uid="uid://crsw35eypj6ry" path="res://src/map/dungeon/models/Set A/18. Corridor A/18_A1_CORRIDOR_A_WALL TILE 1.jpg" id="2_jmyyj"]
@@ -433,6 +433,9 @@ shadow_mesh = SubResource("ArrayMesh_etli6")
[sub_resource type="BoxShape3D" id="BoxShape3D_d16dk"]
size = Vector3(0.236, 5.538, 0.149)
[sub_resource type="BoxShape3D" id="BoxShape3D_xywry"]
size = Vector3(4, 0.557617, 4)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2qrwe"]
transparency = 1
shading_mode = 0
@@ -741,6 +744,10 @@ shape = SubResource("BoxShape3D_d16dk")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.637, 2.14158, 2.73139)
shape = SubResource("BoxShape3D_d16dk")
[node name="CollisionShape3D5" type="CollisionShape3D" parent="Collision/StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.88863, -0.243546, 0.997182)
shape = SubResource("BoxShape3D_xywry")
[node name="Doors" type="Node3D" parent="."]
[node name="DOOR?_F_CUT" type="CSGBox3D" parent="Doors"]

View File

@@ -215,16 +215,16 @@ public partial class Player : CharacterBody3D, IPlayer
this.Provide();
HealthTimer.Timeout += OnHealthTimerTimeout;
Hitbox.AreaEntered += Hitbox_AreaEntered;
CollisionDetector.BodyEntered += CollisionDetector_BodyEntered;
CollisionDetector.AreaEntered += CollisionDetector_AreaEntered;
}
private void CollisionDetector_BodyEntered(Node3D body)
private void CollisionDetector_AreaEntered(Area3D area)
{
if (body is InventoryItem inventoryItem)
if (area.GetParent() is InventoryItem inventoryItem)
{
var isAdded = Inventory.TryAdd(inventoryItem);
if (isAdded)
QueueFree();
inventoryItem.QueueFree();
}
}