Remaining changes
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user