Пример #1
0
 // ----------------------------------------------------
 // The codes below specify are virtual methods of Players.
 // A new character can be created by overriden those method to customize player's behavior
 /// <summary>
 /// normal player get hurt behavior
 /// </summary>
 /// <param name="harmPhase"></param>
 /// <param name="game"></param>
 /// <returns></returns>
 public virtual PhaseList harm(HarmPhase harmPhase, IGame game)
 {
     health -= harmPhase.harm;
     if (health <= 0)
     {
         return(new PhaseList(new AskForHelpPhase(this, harmPhase)));
     }
     return(new PhaseList());
 }
Пример #2
0
 /// <summary>
 /// override of Player.harm()
 /// </summary>
 /// <param name="harmPhase"> this is the phase of harm</param>
 /// <param name="game  ">this is the game</param>
 /// <returns></returns>
 public override PhaseList harm(HarmPhase harmPhase, IGame game)
 {
     if (harmPhase == null)
     {
         throw new EmptyException(Legends_of_the_Three_Kingdoms.Properties.Resources.harmPhase_null);
     }
     else if (game == null)
     {
         throw new EmptyException(Legends_of_the_Three_Kingdoms.Properties.Resources.game_null);
     }
     this.health -= harmPhase.harm;
     this.handCards.Add(harmPhase.card);
     if (health < 0)
     {
         return(new PhaseList(new AskForHelpPhase(this, harmPhase)));
     }
     return(new PhaseList());
 }
Пример #3
0
 /// <summary>
 /// create ask for help phase
 /// </summary>
 /// <param name="player"></param>
 public AskForHelpPhase(Player player, HarmPhase harm) : base(player)
 {
     harmSource = harm;
 }
Пример #4
0
 public DeadPhase(Player player, HarmPhase harmSource) : base(player)
 {
     this.harmSource = harmSource;
 }