Beispiel #1
0
    // this function is an overide of the parent class function that will have all of the base components of the parent function
    // this function will apply the effects of the skills to the target.
    // parameters :
    // the first parameter is the monster that will be using this skill
    // the second parameter is the monster that will be having the effects applied to them
    public override void SkillAction(MonsterScript ThisMonster, MonsterScript TargetMonster)
    {
        switch (SkillEffect)
        {
        case (EffectType.BeneficialEffect):
        {
            foreach (BeneficialEffects B in BeneficialEffectsToBeApplied)
            {
                TargetMonster.AddBeneficialEffect(B);
            }
            break;
        }

        case (EffectType.HarmfulEffect):
        {
            foreach (HarmfulEffects H in HarmfulEffectsToBeApplied)
            {
                TargetMonster.AddHarmfulEffects(H);
            }
            break;
        }
        }
    }
Beispiel #2
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);
    }