Exemple #1
0
        private readonly PokemonOutward[] pokemons; //onBoardOnly

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 为了节约流量,只在用户第一次进入房间的时候给出teams/pms/weather信息
        /// </summary>
        internal Turn(TeamOutward[] teams, PokemonOutward[] pms, Weather weather)
        {
            Teams = teams;
              pokemons = pms;
              Weather = weather;
              Events = new List<GameEvent>();
        }
Exemple #2
0
        internal OnboardPokemon(Pokemon pokemon, int x)
        {
            this.pokemon = pokemon;
              conditions = new ConditionsDictionary();
              Owner = pokemon.Owner;

              Type1 = pokemon.PokemonType.Type1;
              Type2 = pokemon.PokemonType.Type2;
              Gender = pokemon.Gender;
              Ability = pokemon.Ability;
              Base = new SixD(pokemon.Base);
              Iv = new SixD(pokemon.Iv);
              Ev = new SixD(pokemon.Ev);
              Static = new SixD(pokemon.Static);
              Lv5D = new SixD();
              Moves = new Move[4] { pokemon.Moves[0], pokemon.Moves[1], pokemon.Moves[2], pokemon.Moves[3] };

              Position = new Position(pokemon.TeamId,x);

              //幻影new完后覆盖属性
              Outward = new PokemonOutward(this, pokemon.Hp);
              Outward.Name = pokemon.Name;
              Outward.Gender = Gender;
              Outward.ImageId = pokemon.PokemonType.Id;
        }
Exemple #3
0
 public void ContinueTurn()
 {
     TeamOutward[] t = new TeamOutward[game.Teams.Length];
       for (int i = 0; i < t.Length; i++) t[i] = game.Teams[i].GetOutward();
       PokemonOutward[] p = new PokemonOutward[game.Board.Pokemons.Count];
       for (int i = 0; i < p.Length; i++) p[i] = game.Board.Pokemons[i].GetOutward();
       lastTurn = turn;
       turn = new Turn(t, p, game.Board.Weather);
 }
Exemple #4
0
 internal SimPokemon(Pokemon pokemon, PokemonOutward outward)
 {
     this.pokemon = pokemon;
       Outward = outward;
       //Owner = pokemon.Owner;
       Position = outward.Position;
       Moves = new Move[4] { pokemon.Moves[0], pokemon.Moves[1], pokemon.Moves[2], pokemon.Moves[3] };
       IsActive = true;
       foreach (Move m in Moves)
     if (m != null && m.PP.Value > 0) CanUseMove = true;
       CanStruggle = !CanUseMove;
       CanSwitch = true;
 }
Exemple #5
0
        internal BoardOutward(GameSettings settings)
        {
            this.settings = settings;
              teams = new ObservableCollection<PokemonOutward>[settings.TeamCount];
              Teams = new ReadOnlyObservableCollection<PokemonOutward>[settings.TeamCount];
              pokemons = new List<PokemonOutward>();
              weather = Data.Weather.Normal;
              Terrain = settings.Terrain;

              var empty = new PokemonOutward[settings.XBound];
              for (int i = 0; i < settings.TeamCount; i++)
              {
            teams[i] = new ObservableCollection<PokemonOutward>(empty);
            Teams[i] = new ReadOnlyObservableCollection<PokemonOutward>(teams[i]);
              }

              listeners = new List<IBoardEvent>();
        }
Exemple #6
0
 public void AbilityChanged(PokemonOutward pokemon, Ability from, Ability to)
 {
     foreach (IBoardEvent l in listeners)
     l.AbilityChanged(pokemon, from, to);
 }
Exemple #7
0
 public void ShowAbility(PokemonOutward pokemon, Ability ability)
 {
     foreach (IBoardEvent l in listeners)
     l.ShowAbility(pokemon, ability);
 }
Exemple #8
0
 public void Sendout(PokemonOutward pm)
 {
     pokemon = pm;
       if (pokemon != null)
       {
     pokemon.AddListener(this);
     if (pokemon.Gender == PokemonGender.Female)
       main.Source = DataService.Image.GetPokemonFemaleFront(pokemon.ImageId);
     else main.Source = DataService.Image.GetPokemonMaleFront(pokemon.ImageId);
       }
 }
Exemple #9
0
 void IPokemonEvent.Withdrawn()
 {
     pokemon.RemoveListener(this);
       pokemon = null;
 }
Exemple #10
0
 public SendOut(int playerId, PokemonOutward pokemon)
 {
     PlayerId = playerId;
       Pokemon = pokemon;
 }
Exemple #11
0
 //粉色条
 void IBoardEvent.ShowAbility(PokemonOutward pm, Ability ability)
 {
 }
Exemple #12
0
 //粉色条
 void IBoardEvent.AbilityChanged(PokemonOutward pm, Ability from, Ability to)
 {
 }