Add rust immunity to rusted plate

Throw items in spray pattern for trickster's box
This commit is contained in:
2026-06-06 15:58:31 -07:00
parent 09db0ccd88
commit 85e74821ad
4 changed files with 33 additions and 6 deletions
+23 -3
View File
@@ -313,6 +313,16 @@ public partial class Game : Node3D, IGame
RemoveItemOrSubtractFromItemCount(item);
}
public void ThrowItem(IBaseInventoryItem item, double throwAngle)
{
var thrownScene = GD.Load<PackedScene>("res://src/items/thrown/ThrownItem.tscn");
var thrown = thrownScene.Instantiate<ThrownItem>();
thrown.ItemThatIsThrown = item;
_map.AddChild(thrown);
thrown.Throw(_effectService, throwAngle);
RemoveItemOrSubtractFromItemCount(item);
}
public void DoubleExp()
{
GameRepo.AnnounceMessageOnMainScreen("Experience points temporarily doubled.");
@@ -596,11 +606,21 @@ public partial class Game : Node3D, IGame
_player.Unequip(_player.EquipmentComponent.EquippedAccessory.Value);
_player.Inventory.Items.Remove(boxItem);
foreach (var item in _player.Inventory.Items.ToList())
ThrowItem(item);
_player.Inventory.Items.Clear();
GameRepo.CloseInventory();
var itemsToThrow = _player.Inventory.Items.ToList();
_player.Inventory.Items.Clear();
double[] throwAngles = [0, -5, 5, -15, -25, 25];
var throwIndex = 0;
var arrayDirection = 1;
BroadcastMessage($"All items have been ejected from inventory.");
foreach (var item in itemsToThrow)
{
ThrowItem(item, throwAngles[throwIndex]);
throwIndex += (1 * arrayDirection);
if (throwIndex >= throwAngles.Length - 1 || throwIndex <= 0)
arrayDirection *= -1;
await ToSignal(GetTree().CreateTimer(0.2f), "timeout");
}
break;
}
}