Beispiel #1
0
 private void ReCalPokemonData()
 {
     MainPokemonType = race.pokemonMainType;
     SecondPokemonType = race.pokemonSecondType;
     PhysicPower = PokemonCalculation.CalCombatBasePower(
         race.phyPower,
         basestats.PhysicPower,
         IV.PhysicPower,
         nature.PhysicPowerAffect,
         StatModifiers.ActualCorrection[StatModifiers.PhysicPower]
     );
     PhysicDefence = PokemonCalculation.CalCombatBasePower(
         race.phyDefence,
         basestats.PhysicDefence,
         IV.PhysicDefence,
         nature.PhysicDefenceAffect,
         StatModifiers.ActualCorrection[StatModifiers.PhysicDefence]
     );
     EnergyPower = PokemonCalculation.CalCombatBasePower(
         race.energyPower,
         basestats.EnergyPower,
         IV.EnergyPower,
         nature.EnergyPowerEffect,
         StatModifiers.ActualCorrection[StatModifiers.EnergyPower]
     );
     EnergyDefence = PokemonCalculation.CalCombatBasePower(
         race.energyDefence,
         basestats.EnergyDefence,
         IV.EnergyDefence,
         nature.EnergyDefenceEffect,
         StatModifiers.ActualCorrection[StatModifiers.EnergyDefence]
     );
     Speed = PokemonCalculation.CalCombatBasePower(
         race.speed,
         basestats.Speed,
         IV.Speed,
         nature.SpeedAffect,
         StatModifiers.ActualCorrection[StatModifiers.Speed]
     );
     if(entity != null)
         entity.ReplaceBattlePokemonData(this);
     var playData = Contexts.sharedInstance.game.playerData.scriptableObject;
     Contexts.sharedInstance.game.ReplacePlayerData(playData);
 }
        public override bool CanAction(BattlePokemonData pokemon)
        {
            DebugHelper.LogFormat("{0}混乱了", pokemon.Ename);
            bool flag = RandomService.game.Int(0, 3) >= 1;

            if (!flag)
            {
                DebugHelper.LogFormat("{0}混乱了,进攻失败,并对自己造成了伤害", pokemon.Ename);


                int damage = PokemonCalculation.CalDamage(pokemon, pokemon, DefaultSkill);
                pokemon.curHealth -= damage;
                if (pokemon.curHealth < 0)
                {
                    pokemon.curHealth = 0;
                }
            }

            return(flag);
        }
Beispiel #3
0
    private IEnumerator InitPokemonData()
    {
        yield return new WaitWhile
        (() =>
            {
                return ResourceController.Instance.allSkillDic.Count<612;
            }
        );   
        curHealth = Health = PokemonCalculation.CalFullHealth(
            race.health, basestats.Health, IV.Health);
        if(Health<=0)
        {
            curHealth = Health = 1;
        }
        
        skills = new List<int>(pokemon.skillList);
        skillPPs = new List<int>();       
        skillPPs = skills
            .Select(
                x => ResourceController.Instance.allSkillDic[x].FullPP)
            .ToList();

        ReCalPokemonData();
    }