From b478ad39febc207347b591f73d267aab6c3c28b4 Mon Sep 17 00:00:00 2001 From: Zenny Date: Sat, 7 Sep 2024 01:01:50 -0700 Subject: [PATCH] Fix inventory menu, add armor as equippable item --- .../floating_enemy/FloatingEnemy.tscn | 28 +------ src/game/IGameRepo.cs | 32 +++++-- .../EquippedInventoryLabelSettings.tres | 7 ++ .../InventoryLabelSettings.tres | 6 ++ src/inventory_menu/InventoryMenu.cs | 78 +++++++++++++++--- src/inventory_menu/InventoryMenu.tscn | 15 ++-- src/items/ArmorItem.cs | 8 -- src/items/InventoryItem.cs | 22 ++++- src/items/armor/Armor.cs | 18 ++++ src/items/armor/Armor.tscn | 24 +++++- src/items/armor/ArmorInfo.cs | 10 +++ src/items/weapons/Weapon.cs | 18 ++++ src/items/{ => weapons}/WeaponInfo.cs | 0 src/items/weapons/models/CommonSword.tscn | 14 +++- src/items/weapons/models/RareSword.tscn | 14 +++- src/items/weapons/models/UncommonSword.tscn | 14 +++- src/items/weapons/resources/CommonSword.tres | 10 +-- src/items/weapons/resources/RareSword.tres | 8 +- .../weapons/resources/UncommonSword.tres | 10 +-- src/map/dungeon/rooms/Room1.tscn | 6 +- src/npc/goddess/Goddess.tscn | 12 +++ src/npc/goddess/goddess.png | Bin 0 -> 4886 bytes src/npc/goddess/goddess.png.import | 35 ++++++++ 23 files changed, 305 insertions(+), 84 deletions(-) create mode 100644 src/inventory_menu/EquippedInventoryLabelSettings.tres create mode 100644 src/inventory_menu/InventoryLabelSettings.tres delete mode 100644 src/items/ArmorItem.cs create mode 100644 src/items/armor/ArmorInfo.cs rename src/items/{ => weapons}/WeaponInfo.cs (100%) create mode 100644 src/npc/goddess/Goddess.tscn create mode 100644 src/npc/goddess/goddess.png create mode 100644 src/npc/goddess/goddess.png.import diff --git a/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn b/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn index fd21ec0b..675034d3 100644 --- a/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn +++ b/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn @@ -114,24 +114,12 @@ length = 0.001 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("DISSAPPEARING ENEMY:scale") +tracks/0/path = NodePath("Hitbox/CollisionShape3D:disabled") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(1, 1, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Hitbox/CollisionShape3D:disabled") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), "update": 1, "values": [true] } @@ -142,22 +130,10 @@ length = 0.7 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("DISSAPPEARING ENEMY:scale") +tracks/0/path = NodePath("Hitbox/CollisionShape3D:disabled") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.366667, 0.7), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Vector3(1, 1, 1), Vector3(1.77, 1.77, 1.77), Vector3(1, 1, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Hitbox/CollisionShape3D:disabled") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { "times": PackedFloat32Array(0, 0.3, 0.5), "transitions": PackedFloat32Array(1, 1, 1), "update": 1, diff --git a/src/game/IGameRepo.cs b/src/game/IGameRepo.cs index 968579ea..d25d226e 100644 --- a/src/game/IGameRepo.cs +++ b/src/game/IGameRepo.cs @@ -9,7 +9,7 @@ public interface IGameRepo : IDisposable { event Action? Ended; - IAutoProp> InventoryItems { get; } + AutoProp> InventoryItems { get; } IAutoProp IsInventoryScreenOpened { get; } @@ -23,7 +23,13 @@ public interface IGameRepo : IDisposable void SetPlayerGlobalPosition(Vector3 playerGlobalPosition); - public Weapon EquippedWeapon { get; } + public void OnWeaponEquipped(WeaponInfo equippedItem); + + public void OnArmorEquipped(ArmorInfo equippedItem); + + public WeaponInfo EquippedWeapon { get; } + + public ArmorInfo EquippedArmor { get; } public AutoProp HPBarValue { get; } @@ -37,7 +43,7 @@ public class GameRepo : IGameRepo private readonly AutoProp> _inventoryItems; private readonly AutoProp _isInventoryScreenOpened; - public IAutoProp> InventoryItems => _inventoryItems; + public AutoProp> InventoryItems => _inventoryItems; public IAutoProp IsInventoryScreenOpened => _isInventoryScreenOpened; @@ -47,8 +53,12 @@ public class GameRepo : IGameRepo public IAutoProp IsPaused => _isPaused; private readonly AutoProp _isPaused; - private Weapon _equippedWeapon; - public Weapon EquippedWeapon => _equippedWeapon; + private WeaponInfo _equippedWeapon; + public WeaponInfo EquippedWeapon => _equippedWeapon; + + private ArmorInfo _equippedArmor; + + public ArmorInfo EquippedArmor => _equippedArmor; public AutoProp HPBarValue { get; } @@ -62,7 +72,7 @@ public class GameRepo : IGameRepo _isInventoryScreenOpened = new AutoProp(false); _isPaused = new AutoProp(false); _playerGlobalPosition = new AutoProp(Vector3.Zero); - _equippedWeapon = new Weapon(); + _equippedWeapon = WeaponInfo.Default; HPBarValue = new AutoProp(0); VTBarValue = new AutoProp(0); } @@ -81,6 +91,16 @@ public class GameRepo : IGameRepo public void SetPlayerGlobalPosition(Vector3 playerGlobalPosition) => _playerGlobalPosition.OnNext(playerGlobalPosition); + public void OnWeaponEquipped(WeaponInfo equippedItem) + { + _equippedWeapon = equippedItem; + } + + public void OnArmorEquipped(ArmorInfo equippedItem) + { + _equippedArmor = equippedItem; + } + public void OnGameEnded() { Pause(); diff --git a/src/inventory_menu/EquippedInventoryLabelSettings.tres b/src/inventory_menu/EquippedInventoryLabelSettings.tres new file mode 100644 index 00000000..bc09bc4f --- /dev/null +++ b/src/inventory_menu/EquippedInventoryLabelSettings.tres @@ -0,0 +1,7 @@ +[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://kpdmgv5ktypo"] + +[sub_resource type="SystemFont" id="SystemFont_w2gvn"] + +[resource] +font = SubResource("SystemFont_w2gvn") +font_color = Color(0, 0, 1, 1) diff --git a/src/inventory_menu/InventoryLabelSettings.tres b/src/inventory_menu/InventoryLabelSettings.tres new file mode 100644 index 00000000..7ff5f0e9 --- /dev/null +++ b/src/inventory_menu/InventoryLabelSettings.tres @@ -0,0 +1,6 @@ +[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://bl5xpqyq8vjtv"] + +[sub_resource type="SystemFont" id="SystemFont_1ibjc"] + +[resource] +font = SubResource("SystemFont_1ibjc") diff --git a/src/inventory_menu/InventoryMenu.cs b/src/inventory_menu/InventoryMenu.cs index 98d1bdae..b5755521 100644 --- a/src/inventory_menu/InventoryMenu.cs +++ b/src/inventory_menu/InventoryMenu.cs @@ -29,7 +29,7 @@ public partial class InventoryMenu : Control, IInventoryMenu { foreach (var item in items) { - var label = new WeaponLabel(item) { Text = item.Name }; + var label = new ItemLabel(item) { Text = item.Name }; ItemList.AddChild(label); } @@ -41,9 +41,15 @@ public partial class InventoryMenu : Control, IInventoryMenu { if (ItemList.GetChildCount() > 0) { - var currentItem = ItemList.GetChild(_currentSelection); + var currentItem = ItemList.GetChild(_currentSelection); SetCursorLocation(currentItem); } + + foreach (ItemLabel item in ItemList.GetChildren()) + { + if (item.InventoryItem == GameRepo.EquippedWeapon || item.InventoryItem == GameRepo.EquippedArmor) + item.EquipItem(); + } } public void ClearItems() @@ -86,11 +92,6 @@ public partial class InventoryMenu : Control, IInventoryMenu } } - private void UnequipItem(WeaponLabel item) - { - item.UnequipItem(); - } - public override void _Process(double delta) { var input = Vector2.Zero; @@ -98,12 +99,67 @@ public partial class InventoryMenu : Control, IInventoryMenu SetCursorToPrevious(); if (Input.IsActionJustPressed(GameInputs.MoveDown)) SetCursorToNext(); + if (Input.IsActionJustPressed(GameInputs.Attack)) + EquipOrUnequipCurrentItem(); + } + + public void EquipOrUnequipCurrentItem() + { + if (ItemList.GetChildCount() == 0) + return; + + var currentlySelectedItem = ItemList.GetChild(_currentSelection); + + if (currentlySelectedItem.InventoryItem is WeaponInfo weapon && GameRepo.EquippedWeapon == weapon) + { + UnequipItem(currentlySelectedItem); + GameRepo.OnWeaponEquipped(WeaponInfo.Default); + } + else if (currentlySelectedItem.InventoryItem is ArmorInfo armor && GameRepo.EquippedArmor == armor) + { + UnequipItem(currentlySelectedItem); + GameRepo.OnArmorEquipped(null); + } + else + EquipItem(currentlySelectedItem); + } + + private void EquipItem(ItemLabel currentItem) + { + if (currentItem.InventoryItem is WeaponInfo weaponInfo) + { + foreach (ItemLabel item in ItemList.GetChildren()) + { + if (item.InventoryItem is WeaponInfo) + UnequipItem(item); + } + + GameRepo.OnWeaponEquipped(weaponInfo); + currentItem.EquipItem(); + } + + if (currentItem.InventoryItem is ArmorInfo armorInfo) + { + foreach (ItemLabel item in ItemList.GetChildren()) + { + if (item.InventoryItem is ArmorInfo) + UnequipItem(item); + } + + GameRepo.OnArmorEquipped(armorInfo); + currentItem.EquipItem(); + } + } + + private void UnequipItem(ItemLabel item) + { + item.UnequipItem(); } } -public partial class WeaponLabel : Label +public partial class ItemLabel : Label { - public WeaponLabel(InventoryItemInfo inventoryItem) + public ItemLabel(InventoryItemInfo inventoryItem) { InventoryItem = inventoryItem; LabelSettings = UnequippedItemFont; @@ -111,8 +167,8 @@ public partial class WeaponLabel : Label public InventoryItemInfo InventoryItem { get; set; } = default!; - private static LabelSettings UnequippedItemFont => GD.Load("res://src/vfx/Fonts/InventoryLabelSettings.tres"); - private static LabelSettings EquippedItemFont => GD.Load("res://src/vfx/Fonts/EquippedInventoryLabelSettings.tres"); + private static LabelSettings UnequippedItemFont => GD.Load("res://src/inventory_menu/InventoryLabelSettings.tres"); + private static LabelSettings EquippedItemFont => GD.Load("res://src/inventory_menu/EquippedInventoryLabelSettings.tres"); public void EquipItem() { diff --git a/src/inventory_menu/InventoryMenu.tscn b/src/inventory_menu/InventoryMenu.tscn index 093cf69f..2cd406a7 100644 --- a/src/inventory_menu/InventoryMenu.tscn +++ b/src/inventory_menu/InventoryMenu.tscn @@ -14,13 +14,17 @@ size_flags_horizontal = 3 size_flags_vertical = 3 script = ExtResource("1_l64wl") -[node name="CenterContainer" type="CenterContainer" parent="."] +[node name="CenterContainer" type="MarginContainer" parent="."] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +theme_override_constants/margin_left = 80 +theme_override_constants/margin_top = 80 +theme_override_constants/margin_right = 80 +theme_override_constants/margin_bottom = 80 [node name="ItemList" type="VBoxContainer" parent="CenterContainer"] unique_name_in_owner = true @@ -34,12 +38,3 @@ offset_top = -47.0 offset_right = -48.0 offset_bottom = -7.0 texture = ExtResource("1_efrp8") - -[node name="ColorRect" type="ColorRect" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0, 0, 0, 1) diff --git a/src/items/ArmorItem.cs b/src/items/ArmorItem.cs deleted file mode 100644 index 2efab8a9..00000000 --- a/src/items/ArmorItem.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Godot; - -[GlobalClass] -public partial class ArmorItem : InventoryItemInfo -{ - [Export] - public required int Defense { get; set; } -} diff --git a/src/items/InventoryItem.cs b/src/items/InventoryItem.cs index c7bacc23..9499d6d1 100644 --- a/src/items/InventoryItem.cs +++ b/src/items/InventoryItem.cs @@ -1,9 +1,27 @@ -using Godot; +using Chickensoft.AutoInject; +using Chickensoft.GodotNodeInterfaces; +using Chickensoft.Introspection; +using Godot; +using System.Linq; namespace GameJamDungeon { - public abstract partial class InventoryItem : Node3D + public interface IInventoryItem : INode3D { public abstract InventoryItemInfo InventoryInfo { get; set; } + + public IGameRepo GameRepo { get; } + } + + [Meta(typeof(IAutoNode))] + public abstract partial class InventoryItem : Node3D, IInventoryItem + { + public override void _Notification(int what) => this.Notify(what); + + [Dependency] public IGameRepo GameRepo => this.DependOn(); + + public abstract InventoryItemInfo InventoryInfo { get; set; } + + [Node] public Area3D Pickup { get; set; } = default!; } } diff --git a/src/items/armor/Armor.cs b/src/items/armor/Armor.cs index a138921c..31b83c86 100644 --- a/src/items/armor/Armor.cs +++ b/src/items/armor/Armor.cs @@ -1,8 +1,26 @@ +using Chickensoft.AutoInject; +using Chickensoft.Introspection; using GameJamDungeon; using Godot; +using System.Linq; +[Meta(typeof(IAutoNode))] public partial class Armor : InventoryItem { + public override void _Notification(int what) => this.Notify(what); + [Export] public override InventoryItemInfo InventoryInfo { get; set; } + + public void OnReady() + { + Pickup.BodyEntered += OnEntered; + } + + public void OnEntered(Node3D body) + { + var inventoryList = GameRepo.InventoryItems.Value.Append(InventoryInfo).ToList(); + GameRepo.InventoryItems.OnNext(inventoryList); + QueueFree(); + } } diff --git a/src/items/armor/Armor.tscn b/src/items/armor/Armor.tscn index 08f6cc66..ac1940e7 100644 --- a/src/items/armor/Armor.tscn +++ b/src/items/armor/Armor.tscn @@ -1,15 +1,33 @@ -[gd_scene load_steps=4 format=3 uid="uid://dorr7v1tkeiy0"] +[gd_scene load_steps=6 format=3 uid="uid://dorr7v1tkeiy0"] [ext_resource type="Script" path="res://src/items/armor/Armor.cs" id="1_cmjpq"] [ext_resource type="Texture2D" uid="uid://cgoubcl86pib4" path="res://src/items/armor/armor.png" id="1_vpnem"] -[ext_resource type="Resource" uid="uid://chjmkb3aiomvr" path="res://src/items/armor/resources/PatheticCoat.tres" id="2_eftit"] +[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="2_cuhrp"] + +[sub_resource type="Resource" id="Resource_o1cok"] +script = ExtResource("2_cuhrp") +Defense = 2 +Name = "Pathetic" +Description = "A pathetic coat." + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1gpxo"] +radius = 0.470016 +height = 0.940032 [node name="Armor" type="Node3D"] script = ExtResource("1_cmjpq") -InventoryInfo = ExtResource("2_eftit") +InventoryInfo = SubResource("Resource_o1cok") [node name="Sprite3D" type="Sprite3D" parent="."] billboard = 2 alpha_cut = 1 texture_filter = 0 texture = ExtResource("1_vpnem") + +[node name="Pickup" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 4 +collision_mask = 4 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"] +shape = SubResource("CapsuleShape3D_1gpxo") diff --git a/src/items/armor/ArmorInfo.cs b/src/items/armor/ArmorInfo.cs new file mode 100644 index 00000000..cb1ce29b --- /dev/null +++ b/src/items/armor/ArmorInfo.cs @@ -0,0 +1,10 @@ +using Godot; + +namespace GameJamDungeon; + +[GlobalClass] +public partial class ArmorInfo : InventoryItemInfo +{ + [Export] + public int Defense { get; set; } +} diff --git a/src/items/weapons/Weapon.cs b/src/items/weapons/Weapon.cs index ff5c3526..edbacc14 100644 --- a/src/items/weapons/Weapon.cs +++ b/src/items/weapons/Weapon.cs @@ -1,8 +1,14 @@ +using Chickensoft.AutoInject; +using Chickensoft.Introspection; using GameJamDungeon; using Godot; +using System.Linq; +[Meta(typeof(IAutoNode))] public partial class Weapon : InventoryItem { + public override void _Notification(int what) => this.Notify(what); + public Weapon() { _inventoryInfo = WeaponInfo.Default; @@ -12,4 +18,16 @@ public partial class Weapon : InventoryItem private WeaponInfo _inventoryInfo { get; set; } public override InventoryItemInfo InventoryInfo { get => _inventoryInfo; set => _inventoryInfo = value as WeaponInfo; } + + public void OnReady() + { + Pickup.BodyEntered += OnEntered; + } + + public void OnEntered(Node3D body) + { + var inventoryList = GameRepo.InventoryItems.Value.Append(InventoryInfo).ToList(); + GameRepo.InventoryItems.OnNext(inventoryList); + QueueFree(); + } } diff --git a/src/items/WeaponInfo.cs b/src/items/weapons/WeaponInfo.cs similarity index 100% rename from src/items/WeaponInfo.cs rename to src/items/weapons/WeaponInfo.cs diff --git a/src/items/weapons/models/CommonSword.tscn b/src/items/weapons/models/CommonSword.tscn index d5548e6d..96f97287 100644 --- a/src/items/weapons/models/CommonSword.tscn +++ b/src/items/weapons/models/CommonSword.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=4 format=3 uid="uid://b6atdgf2e6e2t"] +[gd_scene load_steps=5 format=3 uid="uid://b6atdgf2e6e2t"] [ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_sr3bh"] [ext_resource type="Resource" uid="uid://dq8tdmjhrqsrh" path="res://src/items/weapons/resources/CommonSword.tres" id="2_krjts"] [ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="3_ixjdd"] +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_j2it8"] +radius = 0.470016 +height = 0.940032 + [node name="CommonSword" type="Node3D"] script = ExtResource("1_sr3bh") _inventoryInfo = ExtResource("2_krjts") @@ -16,3 +20,11 @@ alpha_scissor_threshold = 0.511 alpha_antialiasing_mode = 1 texture_filter = 0 texture = ExtResource("3_ixjdd") + +[node name="Pickup" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 4 +collision_mask = 4 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"] +shape = SubResource("CapsuleShape3D_j2it8") diff --git a/src/items/weapons/models/RareSword.tscn b/src/items/weapons/models/RareSword.tscn index 6096d6b4..f6cd759b 100644 --- a/src/items/weapons/models/RareSword.tscn +++ b/src/items/weapons/models/RareSword.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=4 format=3 uid="uid://c10nhqq8su6pp"] +[gd_scene load_steps=5 format=3 uid="uid://c10nhqq8su6pp"] [ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_f8v7v"] [ext_resource type="Resource" uid="uid://b4oxsf4k3nr43" path="res://src/items/weapons/resources/RareSword.tres" id="2_6nmyd"] [ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="3_meaac"] +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4ic28"] +radius = 0.470016 +height = 0.940032 + [node name="RareSword" type="Node3D"] script = ExtResource("1_f8v7v") _inventoryInfo = ExtResource("2_6nmyd") @@ -16,3 +20,11 @@ alpha_scissor_threshold = 0.511 alpha_antialiasing_mode = 1 texture_filter = 0 texture = ExtResource("3_meaac") + +[node name="Pickup" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 4 +collision_mask = 4 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"] +shape = SubResource("CapsuleShape3D_4ic28") diff --git a/src/items/weapons/models/UncommonSword.tscn b/src/items/weapons/models/UncommonSword.tscn index 5a98061e..35c232ce 100644 --- a/src/items/weapons/models/UncommonSword.tscn +++ b/src/items/weapons/models/UncommonSword.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=4 format=3 uid="uid://cbb1fxllrnlyr"] +[gd_scene load_steps=5 format=3 uid="uid://cbb1fxllrnlyr"] [ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_3o4dy"] [ext_resource type="Resource" uid="uid://e0t7swnl2sfd" path="res://src/items/weapons/resources/UncommonSword.tres" id="2_ga52m"] [ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="3_r8wg3"] +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cbafi"] +radius = 0.470016 +height = 0.940032 + [node name="UncommonSword" type="Node3D"] script = ExtResource("1_3o4dy") _inventoryInfo = ExtResource("2_ga52m") @@ -16,3 +20,11 @@ alpha_scissor_threshold = 0.511 alpha_antialiasing_mode = 1 texture_filter = 0 texture = ExtResource("3_r8wg3") + +[node name="Pickup" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 4 +collision_mask = 4 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"] +shape = SubResource("CapsuleShape3D_cbafi") diff --git a/src/items/weapons/resources/CommonSword.tres b/src/items/weapons/resources/CommonSword.tres index eb989c78..28cd6a38 100644 --- a/src/items/weapons/resources/CommonSword.tres +++ b/src/items/weapons/resources/CommonSword.tres @@ -1,9 +1,9 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://dq8tdmjhrqsrh"] -[ext_resource type="Script" path="res://src/items/WeaponInfo.cs" id="1_wc11x"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_k7yyo"] [resource] -script = ExtResource("1_wc11x") -Damage = 2 -Name = "Common Sword" -Description = "This is just a regular sword." +script = ExtResource("1_k7yyo") +Damage = 3 +Name = "Common sword" +Description = "Common" diff --git a/src/items/weapons/resources/RareSword.tres b/src/items/weapons/resources/RareSword.tres index 0647c92e..4fa673c8 100644 --- a/src/items/weapons/resources/RareSword.tres +++ b/src/items/weapons/resources/RareSword.tres @@ -1,9 +1,9 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://b4oxsf4k3nr43"] -[ext_resource type="Script" path="res://src/items/WeaponInfo.cs" id="1_ybm7s"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_oqgv2"] [resource] -script = ExtResource("1_ybm7s") +script = ExtResource("1_oqgv2") Damage = 7 -Name = "Rare Sword" -Description = "Wow. How did you get this one?" +Name = "Rare sword" +Description = "Rare" diff --git a/src/items/weapons/resources/UncommonSword.tres b/src/items/weapons/resources/UncommonSword.tres index 7ff05bb5..9c8ee56d 100644 --- a/src/items/weapons/resources/UncommonSword.tres +++ b/src/items/weapons/resources/UncommonSword.tres @@ -1,9 +1,9 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://e0t7swnl2sfd"] -[ext_resource type="Script" path="res://src/items/WeaponInfo.cs" id="1_0u4lk"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_8os8m"] [resource] -script = ExtResource("1_0u4lk") -Damage = 4 -Name = "Uncommon Sword." -Description = "This one is a little bit better." +script = ExtResource("1_8os8m") +Damage = 5 +Name = "Uncommon sword" +Description = "Uncommon" diff --git a/src/map/dungeon/rooms/Room1.tscn b/src/map/dungeon/rooms/Room1.tscn index ac0ac5e4..5666d02a 100644 --- a/src/map/dungeon/rooms/Room1.tscn +++ b/src/map/dungeon/rooms/Room1.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://dhpwwqow1ahrc"] +[gd_scene load_steps=18 format=3 uid="uid://dhpwwqow1ahrc"] [ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_0tfda"] [ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="1_ti7ur"] @@ -9,6 +9,7 @@ [ext_resource type="PackedScene" uid="uid://cbb1fxllrnlyr" path="res://src/items/weapons/models/UncommonSword.tscn" id="5_viqv4"] [ext_resource type="PackedScene" uid="uid://c10nhqq8su6pp" path="res://src/items/weapons/models/RareSword.tscn" id="6_c8gn4"] [ext_resource type="PackedScene" uid="uid://dorr7v1tkeiy0" path="res://src/items/armor/Armor.tscn" id="7_bm50w"] +[ext_resource type="PackedScene" uid="uid://d4l4qutp8x40c" path="res://src/npc/goddess/Goddess.tscn" id="10_82rsb"] [sub_resource type="PlaneMesh" id="PlaneMesh_luhnj"] size = Vector2(10, 10) @@ -100,3 +101,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.655729, 0, 0) [node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.144196, -4.84337, -0.0752945) shape = SubResource("BoxShape3D_4exnc") + +[node name="Goddess" parent="." instance=ExtResource("10_82rsb")] +transform = Transform3D(1.4, 0, 0, 0, 1.4, 0, 0, 0, 1.4, -3.23054, -3.37962, 2.05892) diff --git a/src/npc/goddess/Goddess.tscn b/src/npc/goddess/Goddess.tscn new file mode 100644 index 00000000..5010cf71 --- /dev/null +++ b/src/npc/goddess/Goddess.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=2 format=3 uid="uid://d4l4qutp8x40c"] + +[ext_resource type="Texture2D" uid="uid://bhiyrdo2jk1qg" path="res://src/npc/goddess/goddess.png" id="1_uay1m"] + +[node name="Goddess" type="Node3D"] + +[node name="Sprite3D" type="Sprite3D" parent="."] +transform = Transform3D(1.25, 0, 0, 0, 1.25, 0, 0, 0, 1.25, 0, 0, 0) +gi_mode = 0 +billboard = 2 +texture_filter = 0 +texture = ExtResource("1_uay1m") diff --git a/src/npc/goddess/goddess.png b/src/npc/goddess/goddess.png new file mode 100644 index 0000000000000000000000000000000000000000..c7aae64bde908a93ab118285585f1cb6cb78edd8 GIT binary patch literal 4886 zcmc&&c|4SB`yXU25fKs7M2Tj#%#4gBqfCr_uP|mYBg~i?j3sF!&O`}E;UGfCRzkKU zBqzcVS}kSYB}=mXMs@m~^ZT6hd*9Fd&wGD9&-2{({e185bzR@dlBkI;`tsUO4dn@9^CJM77%#J^A?YQA!FX%uiUi#9V5IvNgs+9Vx8)brva@+cPlL!&c&9Zi?R za{?j!zR|Qw|HAua?E(HwKfe@`(Z=Uugc|5lL=?@8-jjNLc6sH2A9Z~^_DNaxt&`4N zNA#nHrZ@MJmOArGBbtsG=&!#XD33Ht58P?~IN714>+^X3>*j}r55nZ7Ks9$AJgmhN zBK%*z?Y&}QUf+^b^E9shvhR5&_YbX{1^ggOw~r6#vx_XJKxa_FpnET9wlELot!d!l-?F|DZhL_P(i)s!yvA-I`5K5&;9+p zT%;_DXl^EkZDV1(@!uT)l%Sa>&lgdKsWS@z*ebnw@d0k8$N>OCGBi6UwiDi5mq_=4 z5J+?nGKAy9;GqEkJp&GdKs-%m13k!|G+zv8rs@$0NF!lDj@oz_o?%R;(oBPyWZPg1 zJ7Vx@BANs;&2ffjue`dv`Q|nh1pEqNpT>ZUHVp!u@K!)$ zI+F}ULttPc3YC`BtPbeIXMnho;C;|cIA;7F4Up9dQ_GRt+g8@rs5t%dw zn@0BqZZZ-)=>BXBi0A6J7b-od;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;@)N}is}o+g6S(e2>e4U+2!(c8+2Ig{MqUO qi1qvd>JaZY#CEb1j)KPn)OmA}&Hoa-(P4Xi^MNz5z!n~HKmR|jiGKP3 literal 0 HcmV?d00001 diff --git a/src/npc/goddess/goddess.png.import b/src/npc/goddess/goddess.png.import new file mode 100644 index 00000000..07cbe639 --- /dev/null +++ b/src/npc/goddess/goddess.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bhiyrdo2jk1qg" +path.s3tc="res://.godot/imported/goddess.png-acb5c411edb71ef5e959e417175ba39f.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://src/npc/goddess/goddess.png" +dest_files=["res://.godot/imported/goddess.png-acb5c411edb71ef5e959e417175ba39f.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0