Beispiel #1
0
    public void ScaryFaceEffect()
    {
        if (!GameManager.instance.isServer)
        {
            return;
        }

        Collider[] cols = Physics.OverlapSphere(gameObject.transform.position, range);

        for (int i = 0; i < cols.Length; i++)
        {
            if (cols[i].gameObject == components.pokemon.enemy)
            {
                PokemonComponents targetComponents = cols[i].GetComponent <PokemonComponents>();

                if (!targetComponents.buffsDebuffs.Debuffs.Contains(speedDown))
                {
                    targetComponents.buffsDebuffs.Debuffs.Add(speedDown);
                    targetComponents.stats.AdjSpeed(speedDown.percentage);

                    Networking.StatModMessage(targetComponents.pokemon, this, StatType.SPEED, false);
                }
            }
        }
    }
    public void GrowlStart()
    {
        components.pokemon.CannotMove();
        growl.Play();
        components.audioS.PlayOneShot(soundEffect);

        if (!GameManager.instance.isServer)
        {
            return;
        }

        Collider[] cols = Physics.OverlapSphere(gameObject.transform.position, range);

        for (int i = 0; i < cols.Length; i++)
        {
            if (cols[i].gameObject == components.pokemon.enemy)
            {
                PokemonComponents targetComponents = cols[i].GetComponent <PokemonComponents>();

                if (!targetComponents.buffsDebuffs.Debuffs.Contains(attackDown))
                {
                    targetComponents.buffsDebuffs.Debuffs.Add(attackDown);
                    targetComponents.stats.AdjCurAtk(-(int)((float)targetComponents.stats.curATK * attackDown.percentage));

                    Networking.StatModMessage(targetComponents.pokemon, this, StatType.ATTACK, false);
                }
            }
        }
    }
    public void FireFangDamage()
    {
        if (!GameManager.instance.isServer)
        {
            return;
        }

        Collider[] cols = Physics.OverlapSphere(col.transform.position, range);

        for (int i = 0; i < cols.Length; i++)
        {
            if (cols[i].gameObject == components.pokemon.enemy)
            {
                PokemonComponents targetComponents = cols[i].GetComponent <PokemonComponents>();

                if (Random.Range(0.00f, 1.00f) > 0.90f)                         //10% CHANCE
                {
                    targetComponents.conditions.Flinch(true);

                    Networking.FlinchMessage(targetComponents.pokemon, this);
                }
                if (Random.Range(0.00f, 1.00f) > 0.90f)                         //10% CHANCE
                {
                    targetComponents.conditions.Burn(true);

                    Networking.BurnMessage(targetComponents.pokemon, this);
                }

                Calculations.DealDamage(components.pokemon, targetComponents.pokemon, this);
            }
        }
    }
    void OnParticleCollision(GameObject target)
    {
        if (!GameManager.instance.isServer)
        {
            return;
        }

        PokemonComponents components = target.GetComponent <PokemonComponents>();

        if (!components.conditions.partiallyTrapped)
        {
            components.conditions.partiallyTrapped = true;
            components.conditions.PartiallyTrapped("Fire Spin");
        }
    }
Beispiel #5
0
    [Server] void OnCollisionStay(Collision col)
    {
        if (!causeDamage)
        {
            return;
        }

        if (col.gameObject.CompareTag("Pokemon"))
        {
            PokemonComponents components = col.gameObject.GetComponent <PokemonComponents>();

            if (components.pokemon.inBattle)
            {
                components.hpPP.AdjCurHP(-damageOverTime, false);
            }
        }
    }
Beispiel #6
0
    void OnParticleCollision(GameObject target)
    {
        if (!GameManager.instance.isServer)
        {
            return;
        }

        PokemonComponents components = target.GetComponent <PokemonComponents>();

        Calculations.DealDamage(move.components.pokemon, components.pokemon, move);

        if (Random.Range(0.00f, 1.00f) > 0.90f)         //10% chance
        {
            components.conditions.burned = true;

            Networking.BurnMessage(components.pokemon, move);
        }
    }
Beispiel #7
0
    void OnParticleCollision(GameObject target)
    {
        if (!GameManager.instance.isServer || target != move.components.pokemon.enemy)
        {
            return;
        }

        PokemonComponents components = target.GetComponent <PokemonComponents>();

        Calculations.DealDamage(move.components.pokemon, components.pokemon, move);

        if (Random.Range(0.00f, 1.00f) > 0.90f)         //10% chance
        {
            if (components.pokemon.networkID == DarkRiftAPI.id)
            {
                components.pokemon.hud.playerPokemonPortrait.ModifyStatusCondition(PlayerPokemonPortrait.statusCondition.Burn, true);
            }

            components.conditions.burned = true;

            Networking.BurnMessage(components.pokemon, move);
        }
    }
 void Awake()
 {
     components = GetComponent <PokemonComponents>();
     Buffs      = new List <Buff>();
     Debuffs    = new List <Debuff>();
 }
Beispiel #9
0
 void Awake()
 {
     components = GetComponent <PokemonComponents>();
 }
Beispiel #10
0
 void Awake()
 {
     components = transform.root.GetComponent <PokemonComponents>();
 }
Beispiel #11
0
    public static void DeserialisePokemonData(object data, ushort senderID, Trainer trainer)
    {
        if (data is DarkRiftReader)
        {
            using (DarkRiftReader reader = (DarkRiftReader)data)
            {
                string[]    strings     = reader.ReadStrings();
                int[]       ints        = reader.ReadInt32s();
                PokemonData pokemonData = new PokemonData(strings[0], strings[1], strings[2], ints[0], ints[1], ints[2], ints[3], ints[4], ints[5], ints[6], ints[7], ints[8], ints[9], ints[10],
                                                          ints[11], ints[12], ints[13], ints[14], ints[15], ints[16], ints[17], ints[18], ints[19], ints[20], ints[21], ints[22], ints[23], ints[24], ints[25], ints[26], ints[27], ints[28],
                                                          ints[29], ints[30], ints[31], ints[32], reader.ReadBoolean());

                double[] doubles = reader.ReadDoubles();


                GameObject clone = Object.Instantiate(Resources.Load("Prefabs/Pokemon/" + pokemonData.pokemonName), new Vector3((float)doubles[0], (float)doubles[1], (float)doubles[2]),
                                                      Quaternion.identity) as GameObject;
                PokemonComponents components = clone.GetComponent <PokemonComponents>();

                components.pokemon.trainerName  = strings[3];
                components.pokemon.networkID    = senderID;
                components.pokemon.nickname     = pokemonData.nickname;
                components.pokemon.fromTrade    = pokemonData.fromTrade;
                components.pokemon.level        = pokemonData.level;
                components.pokemon.gender       = (Genders)pokemonData.gender;
                components.pokemon.nature       = (Natures)pokemonData.nature;
                components.hpPP.curMaxHP        = pokemonData.curMaxHP;
                components.hpPP.curMaxPP        = pokemonData.curMaxPP;
                components.stats.curMaxATK      = pokemonData.curMaxATK;
                components.stats.curMaxDEF      = pokemonData.curMaxDEF;
                components.stats.curMaxSPATK    = pokemonData.curMaxSPATK;
                components.stats.curMaxSPDEF    = pokemonData.curMaxSPDEF;
                components.stats.curMaxSPD      = pokemonData.curMaxSPD;
                components.hpPP.curHP           = pokemonData.curHP;
                components.hpPP.curPP           = pokemonData.curPP;
                components.stats.curATK         = pokemonData.curATK;
                components.stats.curDEF         = pokemonData.curDEF;
                components.stats.curSPATK       = pokemonData.curSPATK;
                components.stats.curSPDEF       = pokemonData.curSPDEF;
                components.stats.curSPD         = pokemonData.curSPD;
                components.hpPP.hpEV            = pokemonData.hpEV;
                components.hpPP.ppEV            = pokemonData.ppEV;
                components.stats.atkEV          = pokemonData.atkEV;
                components.stats.defEV          = pokemonData.defEV;
                components.stats.spatkEV        = pokemonData.spatkEV;
                components.stats.spdefEV        = pokemonData.spdefEV;
                components.stats.spdEV          = pokemonData.spdEV;
                components.hpPP.hpIV            = pokemonData.hpIV;
                components.hpPP.ppIV            = pokemonData.ppIV;
                components.stats.atkIV          = pokemonData.atkIV;
                components.stats.defIV          = pokemonData.defIV;
                components.stats.spatkIV        = pokemonData.spatkIV;
                components.stats.spdefIV        = pokemonData.spdefIV;
                components.stats.spdIV          = pokemonData.spdIV;
                components.pokemon.curEXP       = pokemonData.curEXP;
                components.pokemon.equippedItem = pokemonData.equippedItem;
                components.pokemon.id           = pokemonData.id;

                trainer.AssignPokemon(components.pokemon);

                components.pokemon.SetupExistingPokemon();
            }
        }
        else
        {
            Debug.LogError("Should have recieved a DarkRiftReciever but didn't! (Got: " + data.GetType() + ")");
        }
    }