Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/MinEvents/MinEventActionLoseInventoryRebirth.cs
Nathaniel Cosford e06f2bd282 Add All Mods
2025-05-29 23:33:28 +09:30

38 lines
1.2 KiB
C#

public class MinEventActionLoseInventoryRebirth : MinEventActionRemoveBuff
{
public override void Execute(MinEventParams _params)
{
if (GameManager.IsDedicatedServer)
{
return;
}
var player = _params.Self as EntityPlayerLocal;
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
var playerInventory = uiforPlayer.xui.PlayerInventory;
//Log.Out("MinEventActionLoseInventoryRebirth-Execute Clearing Backpack");
playerInventory.Backpack.Clear();
//Log.Out("MinEventActionLoseInventoryRebirth-Execute Clearing Toolbelt");
playerInventory.Toolbelt.Clear();
int numIndex;
float flClass = player.Buffs.GetCustomVar("$ActiveClass_FR");
foreach (var classKey in RebirthVariables.localClasses.Keys)
{
if (RebirthVariables.localClasses[classKey] == flClass)
{
player.Buffs.AddBuff("FuriousRamsayGive" + classKey + "Weapon");
break;
}
}
string ID = "PermadeathRebirth";
//Log.Out("MinEventActionLoseInventoryRebirth-Execute OPENING WINDOW: " + ID);
uiforPlayer.windowManager.Open(ID, true, false, true);
}
}