예제 #1
0
파일: Form1.cs 프로젝트: Dicrit/FightClub
        void block(object sender, PlayerActionsEventArgs args)
        {
            Player player = sender as Player;
            int    Hp     = args.hp;

            log(player.name + " has blocked hit, remaining hp: " + Hp);
        }
예제 #2
0
파일: Form1.cs 프로젝트: Dicrit/FightClub
        void wound(object sender, PlayerActionsEventArgs args)
        {
            Player player = sender as Player;
            int    Hp     = args.hp;

            if (Hp < 0)
            {
                Hp = 0;         //Prevent Progress bar error when value < 0.
            }
            if (sender == game.player1)
            {
                player1name.Text      = args.name + ":" + Hp;
                player1progress.Value = Hp;
            }
            else
            {
                player2name.Text      = args.name + ":" + Hp;
                player2progress.Value = Hp;
            }
            log(player.name + " has been wounded, remaining hp: " + Hp);
        }