예제 #1
0
 private void ExecMove(PokemonWrapper source, Move move, PokemonWrapper target)
 {
     eventCreator.UsingMove(source, move);
     calculator.Init(source, move, target);
     
     DoDamage(target);
     HandleEfficiency(target);
     CheckIfCritical();
     HandleStatusConditionChange(target);
 }
        public void Init(IBattlePokemon source, Move move, IBattlePokemon target)
        {
            this.source = source;
            this.move = move;
            this.target = target;

            CalculateHit();
            CalculateCritical();
            CalculateTypeModifier();
            CalculateDamage();

            if (Damage > target.HP)
                StatusCondition = StatusCondition.KO;
            else
                StatusCondition = StatusCondition.Normal;
        }
예제 #3
0
 public virtual void SetMove(ClientIdentifier id, ClientIdentifier target, Move move) { throw new InvalidOperationException("Wong operation"); }
예제 #4
0
 public void SetMove(ClientIdentifier id, ClientIdentifier target, Move move)
 {
     CurrentState.SetMove(id, target, move);
 }
예제 #5
0
 public float CalculateBaseDamage(IBattlePokemon source, IBattlePokemon target, Move move)
 {
     return 1.0f;
 }
예제 #6
0
 public float SameTypeAttackBonus(IBattlePokemon source, Move move)
 {
     return 1.0f;
 }
예제 #7
0
 public float GetTypeModifier(IBattlePokemon source, IBattlePokemon target, Move move)
 {
     return 1.0f;
 }
예제 #8
0
 public float GetHitChance(IBattlePokemon source, IBattlePokemon target, Move move)
 {
     return 0.95f;
 }
예제 #9
0
 public void Init(IBattlePokemon source, Move move, IBattlePokemon target)
 {
 }
예제 #10
0
 public MoveUsedEventArgs(Move move, PokemonWrapper source)
 {
     Move = move;
     Source = source;
 }
예제 #11
0
 public MoveCommand(ClientIdentifier source, ClientIdentifier target, Move move)
 {
     this.Move = move;
     this.Source = source;
     this.Target = target;
 }
예제 #12
0
 public void SetMove(ClientIdentifier id, ClientIdentifier target, Move move)
 {
     ValidateInput(id, move, "move");
     commands[id] = new MoveCommand(id, target, move);
     clientCnt--;
 }
예제 #13
0
 public void UsingMove(PokemonWrapper source, Move move)
 {
     MoveUsed(this, new MoveUsedEventArgs(move, source));
 }
예제 #14
0
 public void RaiseMoveUsed()
 {
     var move = new Move(new MoveData(){Name = "Name"});
     MoveUsed(this, new MoveUsedEventArgs(move, pokemon));
 }
예제 #15
0
 public float GetCriticalHitChance(Move move)
 {
     return 0.15f;
 }
예제 #16
0
 public void UsingMove(PokemonWrapper source, Move move)
 {
     throw new NotImplementedException();
 }
예제 #17
0
 public void SetIndexer_SomeValue_ThrowsExecption()
 {
     var model = MoveModelTestFactory.CreateModel(3);
     Assert.Throws<InvalidOperationException>(delegate { model[2, 0] = new Move(new MoveData()); });
 }