185 lines
5.9 KiB
C#
185 lines
5.9 KiB
C#
using System.Xml.Linq;
|
|
|
|
public class MinEventActionAOEDamage : MinEventActionTargetedBase
|
|
{
|
|
|
|
public override void Execute(MinEventParams _params)
|
|
{
|
|
//Log.Out("MinEventActionAOEDamage-Execute");
|
|
var entityAlive = _params.Self as EntityAlive;
|
|
|
|
if (entityAlive == null)
|
|
{
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("ENTITY: " + entityAlive.EntityName);
|
|
//Log.Out("POSITION: " + entityAlive.position);
|
|
//Log.Out("BELONGS TO PLAYER: " + entityAlive.belongsPlayerId);
|
|
//Log.Out("ENTITY radius: " + this.entityRadius);
|
|
//Log.Out("ENTITY damage: " + this.entityDamage);
|
|
|
|
int entityId = EntityClass.FromString("FuriousRamsayNoEarthDamage");
|
|
|
|
DynamicProperties properties = EntityClass.list[entityId].Properties;
|
|
|
|
ExplosionData tmpExplosionData = new ExplosionData(properties);
|
|
|
|
bool ignore = false;
|
|
|
|
if (this.ignoreHeatmap == 1)
|
|
{
|
|
ignore = true;
|
|
}
|
|
|
|
ExplosionData explosionData = new ExplosionData
|
|
{
|
|
BlastPower = this.blastPower,
|
|
BlockDamage = (float)this.blockDamage,
|
|
BlockRadius = (float)this.blockRadius,
|
|
BlockTags = this.blockTags,
|
|
EntityDamage = (float)this.entityDamage,
|
|
EntityRadius = this.entityRadius,
|
|
ParticleIndex = this.ParticleIndex,
|
|
damageMultiplier = tmpExplosionData.damageMultiplier,
|
|
IgnoreHeatMap = ignore
|
|
|
|
};
|
|
|
|
ItemValue itemExplosion = null;
|
|
|
|
if (explosionType == 1)
|
|
{
|
|
itemExplosion = ItemClass.GetItem("thrownGrenadeContact", false);
|
|
}
|
|
else if (explosionType == 9997)
|
|
{
|
|
itemExplosion = ItemClass.GetItem("otherExplosion2", false);
|
|
}
|
|
else if (explosionType == 9998)
|
|
{
|
|
itemExplosion = ItemClass.GetItem("otherExplosion", false);
|
|
}
|
|
else if (explosionType == 9999)
|
|
{
|
|
itemExplosion = ItemClass.GetItem("auraExplosion", false);
|
|
}
|
|
else if (explosionType == 9996)
|
|
{
|
|
itemExplosion = ItemClass.GetItem("auraExplosion2", false);
|
|
}
|
|
|
|
//Log.Out("MinEventActionAOEDamage-Execute: InstigatorId: " + _params.Buff.InstigatorId);
|
|
//Log.Out("MinEventActionAOEDamage-Execute: entityAlive.belongsPlayerId: " + entityAlive.belongsPlayerId);
|
|
|
|
if (entityAlive is EntityZombieSDX)
|
|
{
|
|
//Log.Out("MinEventActionAOEDamage-Execute: InstigatorId: " + _params.Buff.InstigatorId);
|
|
EntityZombieSDX entityZombie = (EntityZombieSDX)entityAlive;
|
|
if (entityZombie != null)
|
|
{
|
|
//Log.Out("MinEventActionAOEDamage-Execute: InstigatorId B");
|
|
entityZombie.entityThatKilledMeID = _params.Buff.InstigatorId;
|
|
}
|
|
}
|
|
|
|
if (this.blastPower == 201)
|
|
{
|
|
RebirthUtilities.InstantiateParticleEffect(particleName, impactPosition, soundName, _params.Self, _params.Position);
|
|
}
|
|
|
|
GameManager.Instance.ExplosionServer(0, entityAlive.position, entityAlive.GetBlockPosition(), entityAlive.qrotation, explosionData, _params.Buff.InstigatorId, 0f, false, itemExplosion);
|
|
}
|
|
}
|
|
|
|
public override bool ParseXmlAttribute(XAttribute _attribute)
|
|
{
|
|
var flag = base.ParseXmlAttribute(_attribute);
|
|
if (flag) return true;
|
|
var name = _attribute.Name;
|
|
|
|
if (name == null)
|
|
{
|
|
return flag;
|
|
}
|
|
else if (name == "blastPower")
|
|
{
|
|
blastPower = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "blockDamage")
|
|
{
|
|
blockDamage = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "blockRadius")
|
|
{
|
|
blockRadius = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "entityDamage")
|
|
{
|
|
entityDamage = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "entityRadius")
|
|
{
|
|
entityRadius = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "ParticleIndex")
|
|
{
|
|
ParticleIndex = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "explosionType")
|
|
{
|
|
explosionType = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "blockTags")
|
|
{
|
|
blockTags = _attribute.Value;
|
|
return true;
|
|
}
|
|
else if (name == "ignoreHeatmap")
|
|
{
|
|
ignoreHeatmap = Int32.Parse(_attribute.Value);
|
|
return true;
|
|
}
|
|
else if (name == "particleName")
|
|
{
|
|
particleName = _attribute.Value;
|
|
return true;
|
|
}
|
|
else if (name == "impactPosition")
|
|
{
|
|
impactPosition = _attribute.Value;
|
|
return true;
|
|
}
|
|
else if (name == "soundName")
|
|
{
|
|
soundName = _attribute.Value;
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
protected int blastPower = 0;
|
|
protected int blockDamage = 0;
|
|
protected int blockRadius = 0;
|
|
protected int entityDamage = 0;
|
|
protected int entityRadius = 0;
|
|
protected int ParticleIndex = 13;
|
|
protected int explosionType = 0;
|
|
protected int ignoreHeatmap = 0;
|
|
protected string blockTags = "";
|
|
protected string particleName = "";
|
|
protected string impactPosition = "";
|
|
protected string soundName = "";
|
|
}
|