Example #1
0
    // this function allows for the execution of the skill. using all of the information of the skill it will determine what to execute and how long to put the skill on cooldown
    // Params:
    // Targets - is a list of monsters that this skill can target. if this skill is not an AOE the list will only have one monster included within it
    // UsingMonster - this is the monster that is using the skill. this will allow for information like damage and defence to be used
    public int UseSkill(List <MonsterScript> Targets, MonsterScript UsingMonster)
    {
        //this is a return number for the amount of damage/healing done
        int TempDamageReturn = 0;

        if (CurrentCoolDown == 0)
        {
            switch (MainEffect)
            {
            case ("Healing"):
            {
                float TempHealAmount = Mathf.Round((UsingMonster.ReturnBaseHealth() * MainEffectMultiplier) + UsingMonster.ReturnBaseHealth());

                foreach (MonsterScript M in Targets)
                {
                    TempDamageReturn = (int)M.ApplyHeal(TempHealAmount);
                }

                break;
            }

            case ("Damage"):
            {
                float TempDamageAmount = Mathf.Round((UsingMonster.ReturnBaseDamage() * MainEffectMultiplier) + UsingMonster.ReturnBaseDamage());

                foreach (MonsterScript M in Targets)
                {
                    TempDamageReturn = (int)M.ApplyDamage(TempDamageAmount, UsingMonster.ReturnBeneficialEffects(), UsingMonster.ReturnHarmfulEffects());
                    LandedAsCrit     = M.ReturnLastSkillCrit();
                }


                break;
            }

            case ("BeneficialEffect"):
            {
                foreach (MonsterScript M in Targets)
                {
                    foreach (string S in SkillEffects)
                    {
                        switch (S)
                        {
                        case ("Accuracy"):
                        {
                            BeneficialEffects AccuracyEffect = new BeneficialEffects();
                            AccuracyEffect.SetBeneficialEffects("Accuracy");
                            AccuracyEffect.SetTurns(2);

                            M.AddBeneficialEffect(AccuracyEffect);

                            break;
                        }

                        case ("Attack"):
                        {
                            BeneficialEffects AttackEffect = new BeneficialEffects();
                            AttackEffect.SetBeneficialEffects("Attack");
                            AttackEffect.SetTurns(2);

                            M.AddBeneficialEffect(AttackEffect);

                            break;
                        }

                        case ("CritRate"):
                        {
                            BeneficialEffects CritRateEffect = new BeneficialEffects();
                            CritRateEffect.SetBeneficialEffects("CritRate");
                            CritRateEffect.SetTurns(2);

                            M.AddBeneficialEffect(CritRateEffect);

                            break;
                        }

                        case ("Defence"):
                        {
                            BeneficialEffects DefenceEffect = new BeneficialEffects();
                            DefenceEffect.SetBeneficialEffects("Defence");
                            DefenceEffect.SetTurns(2);

                            M.AddBeneficialEffect(DefenceEffect);

                            break;
                        }

                        case ("Immunity"):
                        {
                            BeneficialEffects ImmunityEffect = new BeneficialEffects();
                            ImmunityEffect.SetBeneficialEffects("Immunity");
                            ImmunityEffect.SetTurns(2);

                            M.AddBeneficialEffect(ImmunityEffect);

                            break;
                        }

                        case ("Shield"):
                        {
                            BeneficialEffects ShieldEffect = new BeneficialEffects();
                            ShieldEffect.SetBeneficialEffects("Shield");
                            ShieldEffect.SetTurns(2);

                            M.AddBeneficialEffect(ShieldEffect);

                            break;
                        }
                        }
                    }
                }

                break;
            }

            case ("HarmfulEffect"):
            {
                foreach (MonsterScript M in Targets)
                {
                    foreach (string S in SkillEffects)
                    {
                        switch (S)
                        {
                        case ("AttackDeBuff"):
                        {
                            HarmfulEffects AttackDeBuffEffect = new HarmfulEffects();
                            AttackDeBuffEffect.SetHarmfulEffect("Attack");
                            AttackDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(AttackDeBuffEffect);

                            break;
                        }

                        case ("CritDeBuff"):
                        {
                            HarmfulEffects CritDeBuffEffect = new HarmfulEffects();
                            CritDeBuffEffect.SetHarmfulEffect("CritRate");
                            CritDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(CritDeBuffEffect);

                            break;
                        }

                        case ("DefenceDeBuff"):
                        {
                            HarmfulEffects DefenceDeBuffEffect = new HarmfulEffects();
                            DefenceDeBuffEffect.SetHarmfulEffect("Defence");
                            DefenceDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(DefenceDeBuffEffect);

                            break;
                        }

                        case ("ImmunityDeBuff"):
                        {
                            HarmfulEffects ImmunityDeBuffEffect = new HarmfulEffects();
                            ImmunityDeBuffEffect.SetHarmfulEffect("Immunity");
                            ImmunityDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(ImmunityDeBuffEffect);

                            break;
                        }

                        case ("MissDeBuff"):
                        {
                            HarmfulEffects MissDeBuffEffect = new HarmfulEffects();
                            MissDeBuffEffect.SetHarmfulEffect("Miss");
                            MissDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(MissDeBuffEffect);

                            break;
                        }

                        case ("ShieldDeBuff"):
                        {
                            HarmfulEffects ShieldDeBuffEffect = new HarmfulEffects();
                            ShieldDeBuffEffect.SetHarmfulEffect("Shield");
                            ShieldDeBuffEffect.SetTurns(2);


                            M.AddHarmfulEffects(ShieldDeBuffEffect);

                            break;
                        }
                        }
                    }
                }
                break;
            }
            }


            switch (SecondaryEffect)
            {
            case ("Damage"):
            {
                float TempDamageAmount = Mathf.Round((UsingMonster.ReturnBaseDamage() * SecondaryEffectMultipleir) + UsingMonster.ReturnBaseDamage());

                foreach (MonsterScript M in Targets)
                {
                    SecondaryEffectDamageNumber = (int)M.ApplyDamage(TempDamageAmount, UsingMonster.ReturnBeneficialEffects(), UsingMonster.ReturnHarmfulEffects());
                }

                break;
            }

            case ("Healing"):
            {
                if (MainEffect == "HarmfulEffect" || MainEffect == "Damage")
                {
                    float TempHealAmount = Mathf.Round((UsingMonster.ReturnBaseHealth() * SecondaryEffectMultipleir) + UsingMonster.ReturnBaseHealth());

                    SecondaryEffectDamageNumber = (int)UsingMonster.ApplyHeal(TempHealAmount);
                }
                else
                {
                    float TempHealAmount = Mathf.Round((UsingMonster.ReturnBaseHealth() * SecondaryEffectMultipleir) + UsingMonster.ReturnBaseHealth());

                    foreach (MonsterScript M in Targets)
                    {
                        SecondaryEffectDamageNumber = (int)M.ApplyHeal(TempHealAmount);
                    }
                }

                break;
            }

            case ("HarmfulEffect"):
            {
                foreach (MonsterScript M in Targets)
                {
                    foreach (string S in SkillEffects)
                    {
                        switch (S)
                        {
                        case ("AttackDeBuff"):
                        {
                            HarmfulEffects AttackDeBuffEffect = new HarmfulEffects();
                            AttackDeBuffEffect.SetHarmfulEffect("Attack");
                            AttackDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(AttackDeBuffEffect);

                            break;
                        }

                        case ("CritDeBuff"):
                        {
                            HarmfulEffects CritDeBuffEffect = new HarmfulEffects();
                            CritDeBuffEffect.SetHarmfulEffect("CritRate");
                            CritDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(CritDeBuffEffect);

                            break;
                        }

                        case ("DefenceDeBuff"):
                        {
                            HarmfulEffects DefenceDeBuffEffect = new HarmfulEffects();
                            DefenceDeBuffEffect.SetHarmfulEffect("Defence");
                            DefenceDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(DefenceDeBuffEffect);

                            break;
                        }

                        case ("ImmunityDeBuff"):
                        {
                            HarmfulEffects ImmunityDeBuffEffect = new HarmfulEffects();
                            ImmunityDeBuffEffect.SetHarmfulEffect("Immunity");
                            ImmunityDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(ImmunityDeBuffEffect);

                            break;
                        }

                        case ("MissDeBuff"):
                        {
                            HarmfulEffects MissDeBuffEffect = new HarmfulEffects();
                            MissDeBuffEffect.SetHarmfulEffect("Miss");
                            MissDeBuffEffect.SetTurns(2);

                            M.AddHarmfulEffects(MissDeBuffEffect);

                            break;
                        }

                        case ("ShieldDeBuff"):
                        {
                            HarmfulEffects ShieldDeBuffEffect = new HarmfulEffects();
                            ShieldDeBuffEffect.SetHarmfulEffect("Shield");
                            ShieldDeBuffEffect.SetTurns(2);


                            M.AddHarmfulEffects(ShieldDeBuffEffect);

                            break;
                        }
                        }
                    }
                }

                break;
            }

            case ("BeneficialEffect"):
            {
                if (MainEffect == "Damage")
                {
                    foreach (string S in SkillEffects)
                    {
                        switch (S)
                        {
                        case ("Accuracy"):
                        {
                            BeneficialEffects AccuracyEffect = new BeneficialEffects();
                            AccuracyEffect.SetBeneficialEffects("Accuracy");
                            AccuracyEffect.SetTurns(2);

                            UsingMonster.AddBeneficialEffect(AccuracyEffect);

                            break;
                        }

                        case ("Attack"):
                        {
                            BeneficialEffects AttackEffect = new BeneficialEffects();
                            AttackEffect.SetBeneficialEffects("Attack");
                            AttackEffect.SetTurns(2);

                            UsingMonster.AddBeneficialEffect(AttackEffect);

                            break;
                        }

                        case ("CritRate"):
                        {
                            BeneficialEffects CritRateEffect = new BeneficialEffects();
                            CritRateEffect.SetBeneficialEffects("CritRate");
                            CritRateEffect.SetTurns(2);

                            UsingMonster.AddBeneficialEffect(CritRateEffect);

                            break;
                        }

                        case ("Defence"):
                        {
                            BeneficialEffects DefenceEffect = new BeneficialEffects();
                            DefenceEffect.SetBeneficialEffects("Defence");
                            DefenceEffect.SetTurns(2);

                            UsingMonster.AddBeneficialEffect(DefenceEffect);

                            break;
                        }

                        case ("Immunity"):
                        {
                            BeneficialEffects ImmunityEffect = new BeneficialEffects();
                            ImmunityEffect.SetBeneficialEffects("Immunity");
                            ImmunityEffect.SetTurns(2);

                            UsingMonster.AddBeneficialEffect(ImmunityEffect);

                            break;
                        }

                        case ("Shield"):
                        {
                            BeneficialEffects ShieldEffect = new BeneficialEffects();
                            ShieldEffect.SetBeneficialEffects("Shield");
                            ShieldEffect.SetTurns(2);

                            UsingMonster.AddBeneficialEffect(ShieldEffect);

                            break;
                        }
                        }
                    }
                }
                else
                {
                    foreach (MonsterScript M in Targets)
                    {
                        foreach (string S in SkillEffects)
                        {
                            switch (S)
                            {
                            case ("Accuracy"):
                            {
                                BeneficialEffects AccuracyEffect = new BeneficialEffects();
                                AccuracyEffect.SetBeneficialEffects("Accuracy");
                                AccuracyEffect.SetTurns(2);

                                M.AddBeneficialEffect(AccuracyEffect);

                                break;
                            }

                            case ("Attack"):
                            {
                                BeneficialEffects AttackEffect = new BeneficialEffects();
                                AttackEffect.SetBeneficialEffects("Attack");
                                AttackEffect.SetTurns(2);

                                M.AddBeneficialEffect(AttackEffect);

                                break;
                            }

                            case ("CritRate"):
                            {
                                BeneficialEffects CritRateEffect = new BeneficialEffects();
                                CritRateEffect.SetBeneficialEffects("CritRate");
                                CritRateEffect.SetTurns(2);

                                M.AddBeneficialEffect(CritRateEffect);

                                break;
                            }

                            case ("Defence"):
                            {
                                BeneficialEffects DefenceEffect = new BeneficialEffects();
                                DefenceEffect.SetBeneficialEffects("Defence");
                                DefenceEffect.SetTurns(2);

                                M.AddBeneficialEffect(DefenceEffect);

                                break;
                            }

                            case ("Immunity"):
                            {
                                BeneficialEffects ImmunityEffect = new BeneficialEffects();
                                ImmunityEffect.SetBeneficialEffects("Immunity");
                                ImmunityEffect.SetTurns(2);

                                M.AddBeneficialEffect(ImmunityEffect);

                                break;
                            }

                            case ("Shield"):
                            {
                                BeneficialEffects ShieldEffect = new BeneficialEffects();
                                ShieldEffect.SetBeneficialEffects("Shield");
                                ShieldEffect.SetTurns(2);

                                M.AddBeneficialEffect(ShieldEffect);

                                break;
                            }
                            }
                        }
                    }
                }

                break;
            }
            }
        }

        CurrentCoolDown = MaxCoolDown;
        return(TempDamageReturn);
    }
Example #2
0
    // this function is the skill that heals the target monster by the certain amount that is put in
    // this is a overide function that takes it base component from the parent class
    // parameters :
    // the first parameter is the mosnster that will be using the skill
    // the second parameter is the target monster that is going to be healed
    public override void SkillAction(MonsterScript ThisMonster, MonsterScript TargetMonster)
    {
        float TempHeal = HealAmount + (HealAmount * HealMultiplier);

        TargetMonster.ApplyHeal(TempHeal);
    }