public void BuffExecute(GameObject Target) { if (HitAudio != null) { Instantiate(HitAudio, Target.transform.position, Target.transform.rotation); } switch (considred) { case Considred.Friendly: { npc_list = Target.GetComponent <NPC>().Friendly_Effects; break; } default: case Considred.Malicious: { npc_list = Target.GetComponent <NPC>().Malicious_Effects; break; } } GameObject temp = npc_list.Find(AttachedSkill => AttachedSkill.name == this.gameObject.ToString()); if (!temp) { npc_list.Add(this.gameObject); TheCaster.GetComponent <SkillUser>().SkillTimer(this); //CountUp(); ExecuteConEffect(); } else { temp.GetComponent <CharEffect>().timer = duration; } }
public float Calc_heal() { heal = TheCaster.GetComponent <SkillUser>().Healing(); heal += TheCaster.GetComponent <SkillUser>().INT *Main_Stat_Multi; return(heal); }
public override void SkillAbility(GameObject Target) { if (Target.GetComponent <Entity>() != null) { if (AOE == true) { Collider[] EnemiesAround = Physics.OverlapSphere(Target.transform.position, AOE_Radius); for (int i = 0; i < EnemiesAround.Length; i++) { if (EnemiesAround[i].tag != "Untagged" && EnemiesAround[i].tag != "Projectile" && EnemiesAround[i].tag != TheCaster.tag && EnemiesAround[i].tag != "Shop" && EnemiesAround[i].gameObject != null) { float EnemyX = EnemiesAround[i].transform.position.x; float EnemyZ = EnemiesAround[i].transform.position.z; float EnemyY = EnemiesAround[i].transform.position.y; Vector3 IsHit = Target.transform.position; if (EfectOnHit != null) { Instantiate(EfectOnHit, IsHit = new Vector3(EnemyX, EnemyY + 1f, EnemyZ), Target.transform.rotation); } EnemiesAround[i].GetComponent <Entity>().IWasHitBy = TheCaster.gameObject; TheCaster.GetComponent <SkillUser>().DealDmg(EnemiesAround[i].gameObject, Calc_Dmg()); if (Extra_Skill_CharEffect != null) { Extra_Skill_CharEffect.GetComponent <CharEffect>().DoSkill(EnemiesAround[i].gameObject); } } } } else { float EnemyX = Target.transform.position.x; float EnemyZ = Target.transform.position.z; float EnemyY = Target.transform.position.y; Vector3 IsHit = Target.transform.position; if (EfectOnHit != null) { Instantiate(EfectOnHit, IsHit = new Vector3(EnemyX, EnemyY + 1f, EnemyZ), Target.transform.rotation); } Target.GetComponent <Entity>().IWasHitBy = TheCaster.gameObject; TheCaster.GetComponent <SkillUser>().DealDmg(Target, Calc_Dmg()); if (Extra_Skill_CharEffect != null) { Extra_Skill_CharEffect.GetComponent <CharEffect>().DoSkill(Target); } } } }
public override void SkillAbility(GameObject Target) { if (TheCaster.gameObject.GetComponent <NPC>() != null || Target.GetComponent <NPC>() != null) { float HealingInTotal = TheCaster.GetComponent <SkillUser>().TotalHealing; if (AOE != false) { Collider[] AlliesAround = Physics.OverlapSphere(Target.transform.position, AOE_Radius); for (int i = 0; i < AlliesAround.Length; i++) { if (AlliesAround[i].tag != "Untagged" && AlliesAround[i].tag != "Projectile" && AlliesAround[i].tag == TheCaster.tag && AlliesAround[i].tag != "Shop") { float AlliesX = AlliesAround[i].transform.position.x; float AlliesZ = AlliesAround[i].transform.position.z; float AlliesY = AlliesAround[i].transform.position.y; Vector3 IsHit = Target.transform.position; if (EfectOnHit != null) { Instantiate(EfectOnHit, IsHit = new Vector3(AlliesX, AlliesY + 1f, AlliesZ), Target.transform.rotation); } AlliesAround[i].GetComponent <NPC>().HealTarget(AlliesAround[i].gameObject, Calc_heal()); HealingInTotal = HealingInTotal + Calc_heal(); if (ToLifeSteel == true) { int ReturnHealth = ((int)heal / 100) * (int)LifeStrealPrecent; TheCaster.GetComponent <SkillUser>().GetHealed(ReturnHealth); } } } } else { TheCaster.GetComponent <SkillUser>().HealTarget(Target, Calc_heal()); HealingInTotal = HealingInTotal + Calc_heal(); if (ToLifeSteel == true) { int ReturnHealth = ((int)heal / 100) * (int)LifeStrealPrecent; TheCaster.GetComponent <SkillUser>().GetHealed(ReturnHealth); } } } }
public override void ExecuteConEffect() { switch (ailment) { case Ailments.Poison: { DOT = Target.GetComponent <NPC>().RollDmg(); TheCaster.GetComponent <SkillUser>().DmgOverTimTimer(this); break; } case Ailments.Burn: case Ailments.Curse: { TheCaster.GetComponent <SkillUser>().DmgOverTimTimer(this); break; } case Ailments.Freeze: { Target.GetComponent <NPC>().Frozen = true; TargetSpeed = Target.GetComponent <NavMeshAgent>().speed; Target.GetComponent <NavMeshAgent>().speed = 0; // set the targets Behavior tree to skip the movment node, can do it by adding a state in the Behavior tree that checks the "Frozen" variable in NPC break; } case Ailments.Stun: { Target.GetComponent <NPC>().Stunned = true; Target.GetComponent <BehaviorTree>().DisableBehavior(); Target.GetComponent <Animator>().speed = 0; // set the targets Behavior tree to stop taking action, can do it by adding a state in the Behavior tree that checks the "Stunned" variable in NPC break; } default: { break; } } }
public float Calc_Dmg() { if (TheCaster.gameObject.GetComponent <NPC>() != null || Target.GetComponent <NPC>() != null) { var SkillUser = TheCaster.gameObject.GetComponent <NPC>(); DMG = SkillUser.RollDmg(); switch (Main_Stat) { case StatType.STR: DMG += SkillUser.STR * Main_Stat_Multi; break; case StatType.INT: DMG += SkillUser.INT * Main_Stat_Multi; break; case StatType.DEX: DMG += SkillUser.DEX * Main_Stat_Multi; break; default: break; } switch (Second_Stat) { case StatType.STR: DMG += SkillUser.STR * Second_Stat_Multi; break; case StatType.INT: DMG += SkillUser.INT * Second_Stat_Multi; break; case StatType.DEX: DMG += SkillUser.DEX * Second_Stat_Multi; break; default: break; } } if (ToLifeSteel == true) { float ReturnHealth = (DMG / 100) * LifeStrealPrecent; Debug.Log(TheCaster.name + " is leeching"); TheCaster.GetComponent <SkillUser>().GetHealed(ReturnHealth); } if (LeechSummon == true) { float ReturnHealth = (DMG / 100) * LeechSummonAmount; var healMe = TheCaster.GetComponent <SummonCount>(); for (int y = 0; y < healMe.summonsList.Count; y++) { if (healMe.summonsList[y].GetComponent <NPC>() != null) { healMe.summonsList[y].GetComponent <NPC>().GetHealed(ReturnHealth); } } } return(DMG); }