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))
_player.Unequip(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]