Remaining changes

This commit is contained in:
2026-02-13 16:33:30 -08:00
parent e14007b7f4
commit a20c80d922
21 changed files with 89 additions and 93 deletions

View File

@@ -252,17 +252,13 @@ public class EffectService
public void TradeRandomItem<T>(BoxItem box)
where T : IBaseInventoryItem
{
var tradableItems = _player.Inventory.Items.OfType<T>().Where(x => x != box).ToList();
var tradableItems = _player.Inventory.Items.OfType<T>().ToList();
var rng = new RandomNumberGenerator();
rng.Randomize();
var randomIndex = rng.RandiRange(0, tradableItems.Count - 1);
var randomItem = tradableItems[randomIndex];
if (randomItem is IEquipableItem equipableItem)
{
if (_player.EquipmentComponent.IsItemEquipped(equipableItem))
if (randomItem is IEquipableItem equipableItem && _player.EquipmentComponent.IsItemEquipped(equipableItem))
_player.Unequip(equipableItem);
}
_player.Inventory.Remove(randomItem);
GetRandomItemOfType<T>();

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c63uufq63qpuy"
path.bptc="res://.godot/imported/RONDO.PNG-77b50e9afaf9eb46f5672e079a5f50bf.bptc.ctex"
path.bptc="res://.godot/imported/Rondo.png-57553b850a093da6dba43a1e1947fcce.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
@@ -11,8 +11,8 @@ metadata={
[deps]
source_file="res://src/items/weapons/textures/RONDO.PNG"
dest_files=["res://.godot/imported/RONDO.PNG-77b50e9afaf9eb46f5672e079a5f50bf.bptc.ctex"]
source_file="res://src/items/weapons/textures/Rondo.png"
dest_files=["res://.godot/imported/Rondo.png-57553b850a093da6dba43a1e1947fcce.bptc.ctex"]
[params]

View File

@@ -63,7 +63,7 @@ public partial class MonsterRoom : DungeonRoom
break;
numberOfItemsToSpawn--;
var selectedItem = database.PickItem<InventoryItem>();
var selectedItem = database.PickItem<IBaseInventoryItem>() as Node3D;
var duplicated = selectedItem.Duplicate((int)DuplicateFlags.UseInstantiation) as Node3D;
duplicated.Position = new Vector3(spawnPoint.Position.X, 0, spawnPoint.Position.Z);
AddChild(duplicated);

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cp0er3xxxjkr5"
path="res://.godot/imported/a2-puer_AREA_2_MAIN_222STONE.png-139f243ac630853348798dfe584da1e0.ctex"
path="res://.godot/imported/A2-Puer_AREA_2_MAIN_222STONE.png-992459ef9849c39922a9b9e0c7774a4a.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_AREA_2_MAIN_222STONE.png"
dest_files=["res://.godot/imported/a2-puer_AREA_2_MAIN_222STONE.png-139f243ac630853348798dfe584da1e0.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_AREA_2_MAIN_222STONE.png"
dest_files=["res://.godot/imported/A2-Puer_AREA_2_MAIN_222STONE.png-992459ef9849c39922a9b9e0c7774a4a.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://5r16swvuqjjg"
path="res://.godot/imported/a2-puer_AREA_2_MAIN_STONE.png-986249227e569ea1e40b4825b7f05c47.ctex"
path="res://.godot/imported/A2-Puer_AREA_2_MAIN_STONE.png-2267bd7e464cdc2e03c8954de01941bf.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_AREA_2_MAIN_STONE.png"
dest_files=["res://.godot/imported/a2-puer_AREA_2_MAIN_STONE.png-986249227e569ea1e40b4825b7f05c47.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_AREA_2_MAIN_STONE.png"
dest_files=["res://.godot/imported/A2-Puer_AREA_2_MAIN_STONE.png-2267bd7e464cdc2e03c8954de01941bf.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cvnpxln2mmtkp"
path="res://.godot/imported/a2-puer_COLUMN_WHITE.png-0b80d510851319464b2ef729d8868892.ctex"
path="res://.godot/imported/A2-Puer_COLUMN_WHITE.png-18037c22b966bb159d05cb7acac1bc53.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_COLUMN_WHITE.png"
dest_files=["res://.godot/imported/a2-puer_COLUMN_WHITE.png-0b80d510851319464b2ef729d8868892.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_COLUMN_WHITE.png"
dest_files=["res://.godot/imported/A2-Puer_COLUMN_WHITE.png-18037c22b966bb159d05cb7acac1bc53.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://tjtjbktl51kd"
path="res://.godot/imported/a2-puer_GREENBIT.png-e1ed395f917a2fe57ed6288185af0729.ctex"
path="res://.godot/imported/A2-Puer_GREENBIT.png-40a9ca6a0efc569a5f329f19b3c3e572.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_GREENBIT.png"
dest_files=["res://.godot/imported/a2-puer_GREENBIT.png-e1ed395f917a2fe57ed6288185af0729.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_GREENBIT.png"
dest_files=["res://.godot/imported/A2-Puer_GREENBIT.png-40a9ca6a0efc569a5f329f19b3c3e572.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dqfdyguq83bhs"
path="res://.godot/imported/a2-puer_M13_14.png-ed8b29b0af1c2b973bfaee62e57cab14.ctex"
path="res://.godot/imported/A2-Puer_M13_14.png-e781478f15895763a566a64ff37db311.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_M13_14.png"
dest_files=["res://.godot/imported/a2-puer_M13_14.png-ed8b29b0af1c2b973bfaee62e57cab14.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_M13_14.png"
dest_files=["res://.godot/imported/A2-Puer_M13_14.png-e781478f15895763a566a64ff37db311.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dorqwrqy03rim"
path="res://.godot/imported/a2-puer_M13_49.png-86429b5a3cd80a9159f32ded99a631bc.ctex"
path="res://.godot/imported/A2-Puer_M13_49.png-44faadb5ae300e9ecea145cfe1949536.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_M13_49.png"
dest_files=["res://.godot/imported/a2-puer_M13_49.png-86429b5a3cd80a9159f32ded99a631bc.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_M13_49.png"
dest_files=["res://.godot/imported/A2-Puer_M13_49.png-44faadb5ae300e9ecea145cfe1949536.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://nl3bwenfa8fi"
path="res://.godot/imported/a2-puer_RUBBLE_1.png-c7185e2aad2613007d1951f1515ef882.ctex"
path="res://.godot/imported/A2-Puer_RUBBLE_1.png-72d7ff861d1df58d800502546da8d607.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_RUBBLE_1.png"
dest_files=["res://.godot/imported/a2-puer_RUBBLE_1.png-c7185e2aad2613007d1951f1515ef882.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_RUBBLE_1.png"
dest_files=["res://.godot/imported/A2-Puer_RUBBLE_1.png-72d7ff861d1df58d800502546da8d607.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://0p6suo7fpxum"
path="res://.godot/imported/a2-puer_STUCCO_DECAL_BIG.png-882b477f490f6ddbf5bffb3a6f8904e1.ctex"
path="res://.godot/imported/A2-Puer_STUCCO_DECAL_BIG.png-015d9f8dd06372231a1f422979d3604e.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_STUCCO_DECAL_BIG.png"
dest_files=["res://.godot/imported/a2-puer_STUCCO_DECAL_BIG.png-882b477f490f6ddbf5bffb3a6f8904e1.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_STUCCO_DECAL_BIG.png"
dest_files=["res://.godot/imported/A2-Puer_STUCCO_DECAL_BIG.png-015d9f8dd06372231a1f422979d3604e.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ct3mkni0v0y3g"
path="res://.godot/imported/a2-puer_Tile 4.png-9d089a32db3fc38a0c5dee6cdb6d3495.ctex"
path="res://.godot/imported/A2-Puer_Tile 4.png-0cfd085ec5fcea35eb2d1373e4717f77.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_Tile 4.png"
dest_files=["res://.godot/imported/a2-puer_Tile 4.png-9d089a32db3fc38a0c5dee6cdb6d3495.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_Tile 4.png"
dest_files=["res://.godot/imported/A2-Puer_Tile 4.png-0cfd085ec5fcea35eb2d1373e4717f77.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b40fbcriycpp5"
path="res://.godot/imported/a2-puer_imag2esnormal.jpg-d6e063b2785344af34fa3bb45d47aa2f.ctex"
path="res://.godot/imported/A2-Puer_imag2esnormal.jpg-be023c8af9ff59eedfb3ede232c75195.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_imag2esnormal.jpg"
dest_files=["res://.godot/imported/a2-puer_imag2esnormal.jpg-d6e063b2785344af34fa3bb45d47aa2f.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_imag2esnormal.jpg"
dest_files=["res://.godot/imported/A2-Puer_imag2esnormal.jpg-be023c8af9ff59eedfb3ede232c75195.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b25r6gysyhu3e"
path="res://.godot/imported/a2-puer_inner_rock2.png-943622742770f7b55d1e40645d07d057.ctex"
path="res://.godot/imported/A2-Puer_inner_rock2.png-7c99975de214e5dddd3507f87212b910.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_inner_rock2.png"
dest_files=["res://.godot/imported/a2-puer_inner_rock2.png-943622742770f7b55d1e40645d07d057.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_inner_rock2.png"
dest_files=["res://.godot/imported/A2-Puer_inner_rock2.png-7c99975de214e5dddd3507f87212b910.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cw4hq3kofjowa"
path="res://.godot/imported/a2-puer_lime_hand_relief.png-85b73e808337e8b8841453cbda0e78cd.ctex"
path="res://.godot/imported/A2-Puer_lime_hand_relief.png-825857ea33249fe0361c829ba37bbfdb.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_lime_hand_relief.png"
dest_files=["res://.godot/imported/a2-puer_lime_hand_relief.png-85b73e808337e8b8841453cbda0e78cd.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_lime_hand_relief.png"
dest_files=["res://.godot/imported/A2-Puer_lime_hand_relief.png-825857ea33249fe0361c829ba37bbfdb.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bqrsde28o867s"
path="res://.godot/imported/a2-puer_mother_GREEN.png-7bb7d8dd57027953ba1e08ed0c256c8b.ctex"
path="res://.godot/imported/A2-Puer_mother_GREEN.png-ba1f3d21981ed19fc5cc87868e04808c.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_mother_GREEN.png"
dest_files=["res://.godot/imported/a2-puer_mother_GREEN.png-7bb7d8dd57027953ba1e08ed0c256c8b.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_mother_GREEN.png"
dest_files=["res://.godot/imported/A2-Puer_mother_GREEN.png-ba1f3d21981ed19fc5cc87868e04808c.ctex"]
[params]

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://4aq3a26dliyg"
path="res://.godot/imported/a2-puer_swirled_column _AREA222.png-6f90c188eae5b7e81110f39984d5d43f.ctex"
path="res://.godot/imported/A2-Puer_swirled_column _AREA222.png-4842b180cffdbc0274ecb9cbbbbc8221.ctex"
metadata={
"vram_texture": false
}
@@ -13,8 +13,8 @@ generator_parameters={
[deps]
source_file="res://src/map/dungeon/models/Area 2/Puer/a2-puer_swirled_column _AREA222.png"
dest_files=["res://.godot/imported/a2-puer_swirled_column _AREA222.png-6f90c188eae5b7e81110f39984d5d43f.ctex"]
source_file="res://src/map/dungeon/models/Area 2/Puer/A2-Puer_swirled_column _AREA222.png"
dest_files=["res://.godot/imported/A2-Puer_swirled_column _AREA222.png-4842b180cffdbc0274ecb9cbbbbc8221.ctex"]
[params]

View File

@@ -340,7 +340,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
{
Inventory.Remove(jewel);
ApplyNewAugment((dynamic)augmentableItem, jewel.Stats.JewelTag);
ApplyNewAugment((dynamic)augmentableItem, (jewel as Jewel).Stats.JewelTag);
if (augmentableItem is IEquipableItem equipable && EquipmentComponent.IsItemEquipped(equipable))
augmentableItem.Augment.AugmentType.Apply();

View File

@@ -1,13 +1,12 @@
using Chickensoft.Collections;
using Chickensoft.GodotNodeInterfaces;
using System;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
public interface IItemSlot : IControl
{
public AutoProp<InventoryItem> Item { get; }
public AutoProp<IBaseInventoryItem> Item { get; }
public void SetItemEquipmentStatus(bool isEquipped);

View File

@@ -173,7 +173,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
DropButton.Disabled = true;
InteractButton.GrabFocus();
}
else if (item is EquipableItem equipable)
else if (item is IEquipableItem equipable)
{
var itemIsEquipped = _player.EquipmentComponent.IsItemEquipped(equipable);
InteractButton.Text = itemIsEquipped ? "Unequip" : "Equip";

View File

@@ -71,7 +71,8 @@ public partial class ItemSlot : Control, IItemSlot
return;
ItemName.Text = obj.ItemName;
SetItemEquipmentStatus(_player.EquipmentComponent.IsItemEquipped(obj));
if (obj is IEquipableItem equipable)
SetItemEquipmentStatus(_player.EquipmentComponent.IsItemEquipped(equipable));
if (obj is IAugmentableItem augmentable)
SetAugmentStatus(augmentable.Augment != null);
}