protected override void InstantEffect() { if (NPCinfo.target) { if (moveable) { moveable.targetPos = transform.position; } GameObject newArrow = Instantiate(arrowPrefab, transform.position, Quaternion.identity); HomingArrow homingArrow = newArrow.GetComponent <HomingArrow>(); homingArrow.destination = NPCinfo.target.transform; homingArrow.grounded += delegate { NPCinfo.DealDmg2Target(AADmg, homingArrow.destination.GetComponent <NPCBase>(), DMGType.Range); }; } base.InstantEffect(); }
public void ActivateBowSpell3() { if (CurrentTarget) { Vector3 Center = transform.position + new Vector3(0, 2, 0); for (int i = 0; i < skills[SkillIndex].Value; i++) { float a = i * (360 / skills[SkillIndex].Value); Vector3 pos = RandomCircle(Center, 0.1f, a); Quaternion rot = Quaternion.FromToRotation(Vector3.back, Center - pos); HomingArrow arrow = Instantiate(HomingArrow, pos, rot).GetComponent <HomingArrow>(); arrow.Sender = transform; arrow.Damage = skills[SkillIndex].SpellDamage; arrow.Crit = IsCrit(); } Mana -= skills[SkillIndex].SpellManaCost; StartCoroutine(skills[SkillIndex].CoolDownTimer()); } }
protected override void InstantEffect() { base.InstantEffect(); if (NPCinfo.target) { GameObject newArrow = Instantiate(arrowPrefab, transform.position, Quaternion.identity); HomingArrow homingArrow = newArrow.GetComponent <HomingArrow>(); homingArrow.destination = NPCinfo.target.transform; homingArrow.grounded += delegate { if (NPCinfo.target) { NPCinfo.DealDmg2Target(AADmg); Burning burning = NPCinfo.target.gameObject.AddComponent <Burning>(); burning.duration = FireDuration; burning.dps = FireDPS; } }; } }