protected override void Activate() { GameObject obj = Instantiate(aoeObj, mpd.CalculateWorldPosition(), new Quaternion()); obj.transform.localScale = new Vector3(size, 1f, size); AoeBehave ab = obj.GetComponent <AoeBehave>(); ab.friendly = true; ab.ttl = duration; ab.Friend = new List <TimedBuff>(); ab.Enemy = new List <TimedBuff>(); TimedBuff ignite = Ignite.Instance; Stat stat = ignite.Stats.Find(item => item.Name == Stat.HEALTH_REGEN); stat.Value = stats.RealDotDamage(stat.Value, igniteMult, false, true, false, false, true); ab.Enemy.Add(ignite); if (buffs) { ab.Friend.Add(Friendly.Instance); } if (debuffs) { ab.Enemy.Add(Enemy.Instance); } }
override public void OnDeath() { GameObject obj = Instantiate(aoeObj, transform.position - new Vector3(0, 1.2f, 0), new Quaternion()); obj.transform.localScale = new Vector3(5.5f, 1f, 5.5f); AoeBehave ab = obj.GetComponent <AoeBehave>(); ab.friendly = false; ab.ttl = -10; ab.Friend = new List <TimedBuff>(); ab.Enemy = new List <TimedBuff>(); TimedBuff ignite = Ignite.Instance; Stat stat = ignite.Stats.Find(item => item.Name == Stat.HEALTH_REGEN); stat.Value = realIgniteDmg; ab.Enemy.Add(ignite); }
protected override void Activate() { GameObject obj = Instantiate(aoeEffect, gameObject.transform.position + new Vector3(0f, .50f, 0f), new Quaternion()); obj.transform.localScale = new Vector3(size, 1f, size); AoeBehave ab = obj.GetComponent <AoeBehave>(); ab.friendly = true; ab.ttl = duration; ab.Friend = new List <TimedBuff>(); ab.Enemy = new List <TimedBuff>(); TimedBuff corrupt = Corruption.Instance; Stat stat = corrupt.Stats.Find(item => item.Name == Stat.HEALTH_REGEN); stat.Value = stats.RealDotDamage(stat.Value, corruption, true, false, false, false, true); ab.Enemy.Add(corrupt); }
public void AoeAttack(float range, float ttl) { // Generate an AOE instance GameObject aoeInstance = new GameObject("AOE"); aoeInstance.transform.parent = transform; aoeInstance.transform.position = transform.position; aoeInstance.transform.localScale = new Vector3(range, 1f, range); // Add collider CapsuleCollider collider = aoeInstance.AddComponent <CapsuleCollider>(); collider.isTrigger = true; collider.radius = 0.5f; // Add behave script AoeBehave aoeBehave = aoeInstance.AddComponent <AoeAttackBehave>(); aoeBehave.ttl = ttl; // Cause damage Damage dmg = new Damage(Random.Range(dmgMin, dmgMax), 0f, true, false, false); aoeBehave.dmg = statBlock.RealDamage(dmg); }