38 lines
1.2 KiB
C#
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);
|
|
}
|
|
} |