Upload from upload_mods.ps1
This commit is contained in:
49
Scripts/MinEvents/MinEventActionAddBuffRebirth.cs
Normal file
49
Scripts/MinEvents/MinEventActionAddBuffRebirth.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
public class MinEventActionAddBuffRebirth : MinEventActionBuffModifierBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
bool flag = !_params.Self.isEntityRemote | _params.IsLocal;
|
||||
int num = -1;
|
||||
if (_params.Buff != null)
|
||||
{
|
||||
num = _params.Buff.InstigatorId;
|
||||
}
|
||||
if (num == -1)
|
||||
{
|
||||
num = _params.Self.entityId;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
float num2 = 0f;
|
||||
for (int j = 0; j < this.buffNames.Length; j++)
|
||||
{
|
||||
string name = this.buffNames[j];
|
||||
if (BuffManager.GetBuff(name) != null)
|
||||
{
|
||||
if (this.buffOneOnly && this.buffWeights != null)
|
||||
{
|
||||
num2 += this.buffWeights[j];
|
||||
if (num2 >= this.targets[i].rand.RandomFloat)
|
||||
{
|
||||
primaryPlayer.Buffs.AddBuff(name, num, flag && this.targets[i].isEntityRemote, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (this.buffWeights != null)
|
||||
{
|
||||
if (this.buffWeights[j] >= this.targets[i].rand.RandomFloat)
|
||||
{
|
||||
primaryPlayer.Buffs.AddBuff(name, num, flag && this.targets[i].isEntityRemote, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
primaryPlayer.Buffs.AddBuff(name, num, flag && this.targets[i].isEntityRemote, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user