Пример #1
0
 public Move(string this_name, string this_description, int this_level_learned, PokemonTypes.Types this_type, MoveCategoriesList this_category,
             ContestTypesList this_contest_type, int this_pp_cost, int this_power, float this_accuracy, bool this_recoil, float this_recoil_damage,
             bool this_high_crit_chance, bool this_flinch, bool this_makes_contact, bool this_affected_by_protect,
             bool this_affected_by_magic_coat, bool this_affected_by_snatch, bool this_affected_by_kings_rock, List <StatusEffect> this_status_effects,
             Sprite this_icon, float this_range, int this_damage, float this_cool_down, float this_cooling_down)
 {
     moveName            = this_name;
     description         = this_description;
     levelLearned        = this_level_learned;
     type                = this_type;
     category            = this_category;
     contestCategory     = this_contest_type;
     ppCost              = this_pp_cost;
     power               = this_power;
     accuracy            = this_accuracy;
     recoil              = this_recoil;
     recoilDamage        = this_recoil_damage;
     highCritChance      = this_high_crit_chance;
     flinch              = this_flinch;
     makesContact        = this_makes_contact;
     affectedByProtect   = this_affected_by_protect;
     affectedByMagicCoat = this_affected_by_magic_coat;
     affectedBySnatch    = this_affected_by_snatch;
     affectedByKingsRock = this_affected_by_kings_rock;
     StatusEffects       = this_status_effects;
     icon                = this_icon;
     range               = this_range;
     damage              = this_damage;
     coolDown            = this_cool_down;
     coolingDown         = this_cooling_down;
 }
Пример #2
0
 public Move()
 {
     aoe                 = false;
     selfTargeting       = false;
     allyTargeting       = false;
     moveName            = "";
     description         = "";
     levelLearned        = 0;
     type                = PokemonTypes.Types.NORMAL;
     category            = MoveCategoriesList.PHYSICAL;
     contestCategory     = ContestTypesList.BEAUTY;
     ppCost              = 0;
     power               = 0;
     accuracy            = 0.0f;
     recoil              = false;
     recoilDamage        = 0.0f;
     highCritChance      = false;
     flinch              = false;
     makesContact        = false;
     affectedByProtect   = false;
     affectedByMagicCoat = false;
     affectedBySnatch    = false;
     affectedByKingsRock = false;
     StatusEffects       = new List <StatusEffect>();
     range               = 1.0f;
     coolDown            = 1.0f;
     disabled            = false;
 }
Пример #3
0
 public int CalculateSpecialAttackDamage(int movePower, bool critHit, PokemonTypes.Types moveType, int level, int attackersSPATK, int targetsSPDEF,
                                         PokemonTypes.Types attackersType01, PokemonTypes.Types attackersType02, PokemonTypes.Types targetType01,
                                         PokemonTypes.Types targetType02)
 {
     baseDamage = movePower;
     SetModifier(moveType, attackersType01, attackersType02, targetType01, targetType02, critHit);
     return((int)((((2 * level + 10) / (float)250) * ((float)attackersSPATK / (float)targetsSPDEF) * baseDamage + 2) * modifier));
 }
Пример #4
0
 private float DetermineSTAB02(PokemonTypes.Types moveType, PokemonTypes.Types pokemonType02)
 {
     if (moveType == pokemonType02)
     {
         return(1.5f);
     }
     else
     {
         return(1.0f);
     }
 }
Пример #5
0
    /*
     * public int CalculateConfusionDamage(int level, int attack, int defense){
     *      baseDamage = 40;
     *      return (int)(((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2);
     * }
     *
     * public int CalculateDefenseCurlDamage(Move usedMove, int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                                    BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD){
     *      baseDamage = usedMove.power * 2;
     *      SetModifier(usedMove.type, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateSkyAttackDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                                  BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 140;
     *      SetModifier(BasePokemon.TypesList.FLYING, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateSolarBeamDamage(int level, int spAttack, int spDefense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                                  BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 120;
     *      SetModifier(BasePokemon.TypesList.GRASS, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)spAttack / (float)spDefense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateSkullBashDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                                  BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 130;
     *      SetModifier(BasePokemon.TypesList.NORMAL, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateRazorWindDamage(int level, int spAttack, int spDefense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                                  BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 80;
     *      SetModifier(BasePokemon.TypesList.NORMAL, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)spAttack / (float)spDefense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateFlyDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                                  BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 90;
     *      SetModifier(BasePokemon.TypesList.FLYING, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateBounceDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                            BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 85;
     *      SetModifier(BasePokemon.TypesList.FLYING, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculateSkyDropDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                            BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 60;
     *      SetModifier(BasePokemon.TypesList.FLYING, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     * public int CalculateDigDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                            BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 80;
     *      SetModifier(BasePokemon.TypesList.GROUND, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     * public int CalculateDiveDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                            BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 80;
     *      SetModifier(BasePokemon.TypesList.WATER, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     * public int CalculateShadowForceDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                            BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 120;
     *      SetModifier(BasePokemon.TypesList.GHOST, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     *
     * public int CalculatePhantomForceDamage(int level, int attack, int defense, BasePokemon.TypesList attackersType01, BasePokemon.TypesList attackersType02,
     *                            BasePokemon.TypesList targetType01, BasePokemon.TypesList targetType02, int attackersBaseSPD, Move usedMove){
     *      baseDamage = 90;
     *      SetModifier(BasePokemon.TypesList.GHOST, attackersType01, attackersType02, targetType01, targetType02, attackersBaseSPD, usedMove);
     *      return (int)((((2 * level + 10) / (float)250) * ((float)attack / (float)defense) * baseDamage + 2) * modifier);
     * }
     */


    private void SetModifier(PokemonTypes.Types moveType, PokemonTypes.Types attackersType01, PokemonTypes.Types attackersType02, PokemonTypes.Types targetType01,
                             PokemonTypes.Types targetType02, bool critHit)
    {
        //Other is dependant on equipped items, abilities, and field advantages.
        stab1 = DetermineSTAB01(moveType, attackersType01);
        stab2 = DetermineSTAB02(moveType, attackersType02);
        te1   = DetermineTypeEffectiveness01(moveType, targetType01);
        te2   = DetermineTypeEffectiveness02(moveType, targetType02);
        if (critHit)
        {
            crit = 1.5f;
        }
        else
        {
            crit = 1.0f;
        }
        modifier = ((stab1 * stab2) * (te1 * te2) * crit * /*other*/ Random.Range(0.85f, 1.0f));
    }
Пример #6
0
    public void MoveResults()
    {
        int pokemon = GetComponent <PhotonView>().viewID;

        if (!aoe)
        {
            if (hit)
            {
                if (selfTargeting)
                {
                    target = gameObject;
                }
                if (category == MoveCategoriesList.PHYSICAL || category == MoveCategoriesList.SPECIAL)
                {
                    target.GetComponent <PhotonView>().RPC("AdjustHP", PhotonTargets.AllBuffered, -damage, "current", pokemon, critHit);
                    foreach (StatusEffect effect in StatusEffects)
                    {
                        target.GetComponent <PhotonView>().RPC("AddStatusEffect", PhotonTargets.AllBuffered, effect.buffOrDebuff, effect.percentage,
                                                               effect.duration, pokemon);
                    }
                }
                if (category == MoveCategoriesList.STATUS)
                {
                    foreach (StatusEffect effect in StatusEffects)
                    {
                        target.GetComponent <PhotonView>().RPC("AddStatusEffect", PhotonTargets.AllBuffered, effect.buffOrDebuff, effect.percentage,
                                                               effect.duration, pokemon);
                    }
                }
            }
            if (!targetPokemon.isCaptured)
            {
                target.GetComponent <PhotonView>().RPC("IncreaseHate", PhotonTargets.AllBuffered, pokemon, 10);
            }
        }
        if (aoe)
        {
            foreach (GameObject thisTarget in Targets)
            {
                if (!allyTargeting && !selfTargeting)
                {
                    if (thisTarget != gameObject)                   //Also add something here to check if target's a team member.
                    {
                        if (Vector3.Distance(thisPokemon.gameObject.transform.position, thisTarget.transform.position) <= range)
                        {
                            target               = thisTarget;
                            targetPokemon        = target.GetComponent <Pokemon>();
                            targetDefense        = targetPokemon.curDEF;
                            targetSpecialDefense = targetPokemon.curSPDEF;
                            targetEva            = targetPokemon.evasion;
                            targetTypeOne        = targetPokemon.typeOne;
                            targetTypeTwo        = targetPokemon.typeTwo;
                            if (category == MoveCategoriesList.PHYSICAL || category == MoveCategoriesList.SPECIAL)
                            {
                                damage = dmgCalc.CalculateAttackDamage(power, critHit, type, level, attack, targetDefense, typeOne, typeTwo, targetTypeOne,
                                                                       targetTypeTwo);
                                target.GetComponent <PhotonView>().RPC("AdjustHP", PhotonTargets.AllBuffered, -damage, "current", pokemon, critHit);
                                foreach (StatusEffect effect in StatusEffects)
                                {
                                    target.GetComponent <PhotonView>().RPC("AddStatusEffect", PhotonTargets.AllBuffered, effect.buffOrDebuff, effect.percentage,
                                                                           effect.duration, pokemon);
                                }
                            }
                            if (category == MoveCategoriesList.STATUS)
                            {
                                foreach (StatusEffect effect in StatusEffects)
                                {
                                    target.GetComponent <PhotonView>().RPC("AddStatusEffect", PhotonTargets.AllBuffered, effect.buffOrDebuff, effect.percentage,
                                                                           effect.duration, pokemon);
                                }
                            }
                        }
                    }
                    if (!targetPokemon.isCaptured)
                    {
                        target.GetComponent <PhotonView>().RPC("IncreaseHate", PhotonTargets.AllBuffered, pokemon, 10);
                    }
                }
                if (allyTargeting || selfTargeting)
                {
                    if (thisTarget == gameObject)                   //Also add something here to check if target's a team member.
                    {
                        if (Vector3.Distance(thisPokemon.gameObject.transform.position, thisTarget.transform.position) <= range)
                        {
                            target               = thisTarget;
                            targetPokemon        = target.GetComponent <Pokemon>();
                            targetDefense        = targetPokemon.curDEF;
                            targetSpecialDefense = targetPokemon.curSPDEF;
                            targetEva            = targetPokemon.evasion;
                            targetTypeOne        = targetPokemon.typeOne;
                            targetTypeTwo        = targetPokemon.typeTwo;
                            if (category == MoveCategoriesList.PHYSICAL || category == MoveCategoriesList.SPECIAL)
                            {
                                damage = dmgCalc.CalculateAttackDamage(power, critHit, type, level, attack, targetDefense, typeOne, typeTwo, targetTypeOne,
                                                                       targetTypeTwo);
                                target.GetComponent <PhotonView>().RPC("AdjustHP", PhotonTargets.AllBuffered, -damage, "current", pokemon, critHit);
                                foreach (StatusEffect effect in StatusEffects)
                                {
                                    target.GetComponent <PhotonView>().RPC("AddStatusEffect", PhotonTargets.AllBuffered, effect.buffOrDebuff, effect.percentage,
                                                                           effect.duration, pokemon);
                                }
                            }
                            if (category == MoveCategoriesList.STATUS)
                            {
                                foreach (StatusEffect effect in StatusEffects)
                                {
                                    target.GetComponent <PhotonView>().RPC("AddStatusEffect", PhotonTargets.AllBuffered, effect.buffOrDebuff, effect.percentage,
                                                                           effect.duration, pokemon);
                                }
                            }
                        }
                    }
                    if (!targetPokemon.isCaptured)
                    {
                        target.GetComponent <PhotonView>().RPC("IncreaseHate", PhotonTargets.AllBuffered, pokemon, 10);
                    }
                }
            }
        }
        thisPokemon.lastMoveUsed = this;
        coolingDown = coolDown;
        GetComponent <PhotonView>().RPC("AdjustPP", PhotonTargets.AllBuffered, -ppCost, "current", pokemon);
    }
Пример #7
0
    public void UseMove(GameObject pokemon, GameObject theTarget)
    {
        level         = thisPokemon.level;
        attack        = thisPokemon.curATK;
        specialAttack = thisPokemon.curSPATK;
        acc           = thisPokemon.accuracy;
        baseSpeed     = thisPokemon.baseSPD;
        typeOne       = thisPokemon.typeOne;
        typeTwo       = thisPokemon.typeTwo;
        hit           = false;
        critHit       = false;
        if (selfTargeting)
        {
            target = gameObject;
        }
        else
        {
            target = theTarget;
        }
        targetPokemon        = theTarget.GetComponent <Pokemon>();
        targetDefense        = targetPokemon.curDEF;
        targetSpecialDefense = targetPokemon.curSPDEF;
        targetEva            = targetPokemon.evasion;
        targetTypeOne        = targetPokemon.typeOne;
        targetTypeTwo        = targetPokemon.typeTwo;
        Collider[] TempList = Physics.OverlapSphere(pokemon.transform.position, range);
        Targets = new List <GameObject>();
        foreach (Collider col in TempList)
        {
            if (thisPokemon.Enemies.Contains(col.gameObject))
            {
                Targets.Add(col.gameObject);
            }
        }
        if (target == gameObject && !selfTargeting)
        {
            return;
        }
        else if (!thisPokemon.Enemies.Contains(target) && !selfTargeting && !allyTargeting)
        {
            return;
        }
        else
        {
            pokemon.transform.LookAt(target.transform);
            input.attacking = true;
            if (!aoe)
            {
                if (!allyTargeting && !selfTargeting)
                {
                    if (target != gameObject)                   //Also add something here to check if target's a team member.
                    {
                        if (category == MoveCategoriesList.PHYSICAL)
                        {
                            pokemon.GetComponent <Animator>().SetBool(moveName, true);
                            critHit = dmgCalc.DetermineCritical(baseSpeed, highCritChance);
                            damage  = dmgCalc.CalculateAttackDamage(power, critHit, type, level, attack, targetDefense, typeOne, typeTwo, targetTypeOne,
                                                                    targetTypeTwo);
                            chanceToHit = accuracy * (acc / targetEva);
                            float hit_or_miss = Random.Range(0.0f, 1.0f);
                            if (chanceToHit >= hit_or_miss)
                            {
                                hit = true;
                            }
                        }
                        if (category == MoveCategoriesList.SPECIAL)
                        {
                            pokemon.GetComponent <Animator>().SetBool(moveName, true);
                            critHit = dmgCalc.DetermineCritical(baseSpeed, highCritChance);
                            damage  = dmgCalc.CalculateSpecialAttackDamage(power, critHit, type, level, specialAttack, targetSpecialDefense, typeOne, typeTwo,
                                                                           targetTypeOne, targetTypeTwo);

                            chanceToHit = accuracy * (acc / targetEva);
                            float hit_or_miss = Random.Range(0.0f, 1.0f);
                            if (chanceToHit >= hit_or_miss)
                            {
                                hit = true;
                            }
                        }
                        if (category == MoveCategoriesList.STATUS)
                        {
                            pokemon.GetComponent <Animator>().SetBool(moveName, true);
                            chanceToHit = accuracy * (acc / targetEva);
                            float hit_or_miss = Random.Range(0.0f, 1.0f);
                            if (chanceToHit >= hit_or_miss)
                            {
                                hit = true;
                            }
                        }
                    }
                }
                if (allyTargeting || selfTargeting)
                {
                    if (target == gameObject)                   //Also add something here to check if target's a team member.
                    {
                        if (category == MoveCategoriesList.PHYSICAL)
                        {
                            pokemon.GetComponent <Animator>().SetBool(moveName, true);
                            damage = dmgCalc.CalculateAttackDamage(power, critHit, type, level, attack, targetDefense, typeOne, typeTwo, targetTypeOne,
                                                                   targetTypeTwo);
                            chanceToHit = accuracy * (acc / targetEva);
                            float hit_or_miss = Random.Range(0.0f, 1.0f);
                            if (chanceToHit >= hit_or_miss)
                            {
                                hit = true;
                            }
                        }
                        if (category == MoveCategoriesList.SPECIAL)
                        {
                            pokemon.GetComponent <Animator>().SetBool(moveName, true);
                            damage = dmgCalc.CalculateSpecialAttackDamage(power, critHit, type, level, specialAttack, targetSpecialDefense, typeOne, typeTwo,
                                                                          targetTypeOne, targetTypeTwo);

                            chanceToHit = accuracy * (acc / targetEva);
                            float hit_or_miss = Random.Range(0.0f, 1.0f);
                            if (chanceToHit >= hit_or_miss)
                            {
                                hit = true;
                            }
                        }
                        if (category == MoveCategoriesList.STATUS)
                        {
                            pokemon.GetComponent <Animator>().SetBool(moveName, true);
                            hit = true;
                        }
                    }
                }
            }
            if (aoe)
            {
                hit = true;
                pokemon.GetComponent <Animator>().SetBool(moveName, true);
            }
        }
    }
Пример #8
0
 private float DetermineTypeEffectiveness02(PokemonTypes.Types atkType, PokemonTypes.Types pkmnType02)
 {
     return((float)(typeToTypeDamageRatios[(int)atkType, (int)pkmnType02]));
 }