void block(object sender, PlayerActionsEventArgs args) { Player player = sender as Player; int Hp = args.hp; log(player.name + " has blocked hit, remaining hp: " + Hp); }
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); }