Beispiel #1
0
 public override void RespondToCollision(Character good)
 {
     GoodCharacter goodChar = (GoodCharacter)good;
     if (goodChar.Expirience < ParamExpirience)
     {
         int damage = rnd.Next(ParamRandomExpirience, 2*ParamRandomExpirience);
         if (this.Health-damage <= 0)
         {
             this.Health = 0;
             this.IsDead = true;
         }
         this.Health -= damage;
     }
     else if (goodChar.Expirience< 2*ParamExpirience)
     {
         int damage = rnd.Next(2*ParamRandomExpirience, 3*ParamRandomExpirience);
         if (this.Health - damage <= 0)
         {
             this.Health = 0;
             this.IsDead = true;
         }
         this.Health -= damage;
     }
     else
     {
         int damage = rnd.Next(3*ParamRandomExpirience, 4*ParamRandomExpirience);
         if (this.Health - damage <= 0)
         {
             this.Health = 0;
             this.IsDead = true;
         }
         this.Health -= damage;
     }
 }
Beispiel #2
0
 public abstract void RespondToCollision(Character type);
Beispiel #3
0
 public override void RespondToCollision(Character evil)
 {
     int damage = rnd.Next(ParamRandomDamage, 2*ParamRandomDamage);
     ChangeState(damage);
     if (this.Health <= 0)
     {
         this.Health = 0;
         this.IsDead = true;
     }
 }