83 lines
2.6 KiB
C#
83 lines
2.6 KiB
C#
public class MinEventActionProcessRespawn : MinEventActionRemoveBuff
|
|
{
|
|
private int numItems = 1;
|
|
private int numLocation = 0;
|
|
private int numQuality = 0;
|
|
private string itemName = "";
|
|
|
|
public override void Execute(MinEventParams _params)
|
|
{
|
|
if (GameManager.IsDedicatedServer)
|
|
{
|
|
//Log.Out("MinEventActionProcessRespawn-Execute IS SERVER");
|
|
return;
|
|
}
|
|
|
|
//Log.Out("MinEventActionProcessRespawn-Execute IS CLIENT");
|
|
|
|
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
|
|
|
if (player == null)
|
|
{
|
|
//Log.Out("MinEventActionProcessRespawn-Execute NO Player");
|
|
return;
|
|
}
|
|
|
|
if (player.Progression.Level >= 5)
|
|
{
|
|
int random = UnityEngine.Random.Range(45, 66);
|
|
player.Stats.Water.Value = player.Stats.Water.Max * random / 100;
|
|
|
|
random = UnityEngine.Random.Range(45, 66);
|
|
player.Stats.Food.Value = player.Stats.Food.Max * random / 100;
|
|
|
|
player.Buffs.AddBuff("triggerAbrasion");
|
|
|
|
if (player.Progression.Level >= 10 && player.Progression.Level < 20)
|
|
{
|
|
random = UnityEngine.Random.Range(0, 2);
|
|
if (random == 0)
|
|
{
|
|
player.Buffs.AddBuff("triggerSprainedArm");
|
|
}
|
|
else if (random == 1)
|
|
{
|
|
player.Buffs.AddBuff("triggerSprainedLeg");
|
|
}
|
|
}
|
|
else if (player.Progression.Level >= 20)
|
|
{
|
|
random = UnityEngine.Random.Range(0, 3);
|
|
if (random == 0)
|
|
{
|
|
player.Buffs.AddBuff("triggerFatigued");
|
|
}
|
|
else if (random == 1)
|
|
{
|
|
player.Buffs.AddBuff("triggerSprainedArm");
|
|
}
|
|
else if (random == 2)
|
|
{
|
|
player.Buffs.AddBuff("triggerSprainedLeg");
|
|
}
|
|
}
|
|
|
|
float zombieKilledMe = player.Buffs.GetCustomVar("$ZombieKilledMe");
|
|
|
|
if (zombieKilledMe == 1f)
|
|
{
|
|
player.Buffs.AddBuff("buffInfectionCatchRebirth-5");
|
|
}
|
|
else if (zombieKilledMe == 2f)
|
|
{
|
|
player.Buffs.AddBuff("buffInfectionCatchRebirth-10");
|
|
}
|
|
else if (zombieKilledMe == 3f)
|
|
{
|
|
player.Buffs.AddBuff("buffInfectionCatchRebirth-25");
|
|
}
|
|
|
|
player.Buffs.SetCustomVar("$ZombieKilledMe", 0f);
|
|
}
|
|
}
|
|
} |