Upload from upload_mods.ps1
This commit is contained in:
80
Scripts/Network/NetPackageSetAuraChance.cs
Normal file
80
Scripts/Network/NetPackageSetAuraChance.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class NetPackageSetAuraChance : NetPackage
|
||||
{
|
||||
public NetPackageSetAuraChance Setup(string _itemClassName, int _entitySourceID, int _classID, int _entityTargetID, int _npcEntityID, bool _fromOther, bool _isMelee)
|
||||
{
|
||||
this.itemClassName = _itemClassName;
|
||||
this.entitySourceID = _entitySourceID;
|
||||
this.classID = _classID;
|
||||
this.entityTargetID = _entityTargetID;
|
||||
this.npcEntityID = _npcEntityID;
|
||||
this.fromOther = _fromOther;
|
||||
this.isMelee = _isMelee;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _reader)
|
||||
{
|
||||
this.itemClassName = _reader.ReadString();
|
||||
this.entitySourceID = _reader.ReadInt32();
|
||||
this.classID = _reader.ReadInt32();
|
||||
this.entityTargetID = _reader.ReadInt32();
|
||||
this.npcEntityID = _reader.ReadInt32();
|
||||
this.fromOther = _reader.ReadBoolean();
|
||||
this.isMelee = _reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter _writer)
|
||||
{
|
||||
base.write(_writer);
|
||||
_writer.Write(this.itemClassName);
|
||||
_writer.Write(this.entitySourceID);
|
||||
_writer.Write(this.classID);
|
||||
_writer.Write(this.entityTargetID);
|
||||
_writer.Write(this.npcEntityID);
|
||||
_writer.Write(this.fromOther);
|
||||
_writer.Write(this.isMelee);
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World _world, GameManager _callbacks)
|
||||
{
|
||||
//Log.Out("NetPackageSetAuraChance-ProcessPackage 1 this.itemClassName: " + this.itemClassName);
|
||||
if (_world == null || !_world.IsRemote())
|
||||
{
|
||||
//Log.Out("NetPackageSetAuraChance-ProcessPackage 2");
|
||||
return;
|
||||
}
|
||||
|
||||
EntityNPCRebirth npc = _world.GetEntity(this.npcEntityID) as EntityNPCRebirth;
|
||||
|
||||
if (npc != null || this.itemClassName.ToLower().StartsWith("gunbot") || this.itemClassName.ToLower().StartsWith("furiousramsayjunkturret"))
|
||||
{
|
||||
//Log.Out("NetPackageSetAuraChance-ProcessPackage 3");
|
||||
RebirthUtilities.SetAuraChance(ItemClass.GetItem(this.itemClassName, false), this.itemClassName, this.entitySourceID, this.classID, this.entityTargetID, true, this.isMelee, this.npcEntityID, this.fromOther);
|
||||
if (npc != null)
|
||||
{
|
||||
GameManager.Instance.StartCoroutine(RebirthUtilities.delayNPCShotgunTrigger(1.0f, npc));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("NetPackageSetAuraChance-ProcessPackage 3");
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
private string itemClassName;
|
||||
private int entitySourceID;
|
||||
private int classID;
|
||||
private int entityTargetID;
|
||||
private int npcEntityID;
|
||||
private bool fromOther;
|
||||
private bool isMelee;
|
||||
}
|
||||
Reference in New Issue
Block a user