Fix stuff including texture on pick up items and fix pickup
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
|
||||
namespace GameJamDungeon;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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="."]
|
||||
|
||||
Reference in New Issue
Block a user