private void Attack_Button_Click(object sender, RoutedEventArgs e) { CombatMethods.Attack(StoredCombatants.Hero, StoredCombatants.Enemy); UpdateHPAndMP(); PrintCombatLog(); if (StoredCombatants.Enemy.HP <= 0) { CombatMethods.EndCombat(StoredCombatants.Hero, StoredCombatants.Enemy); CharacterMenu characterMenu = new CharacterMenu(StoredCombatants.Hero); characterMenu.Show(); Close(); } StoredCombatants.Enemy.EnemyTurn(StoredCombatants.Hero, StoredCombatants.Enemy); UpdateHPAndMP(); PrintCombatLog(); if (StoredCombatants.Hero.HP <= 0) { CombatMethods.GameOver(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Character_Menu = ((RPG.Windows.CharacterMenu)(target)); return; case 2: this.nameLabel = ((System.Windows.Controls.Label)(target)); return; case 3: this.levelLabel = ((System.Windows.Controls.Label)(target)); return; case 4: this.classLabel = ((System.Windows.Controls.Label)(target)); return; case 5: this.experienceLabel = ((System.Windows.Controls.Label)(target)); return; case 6: this.healthLabel = ((System.Windows.Controls.Label)(target)); return; case 7: this.mpLabel = ((System.Windows.Controls.Label)(target)); return; case 8: this.HP_Bar = ((System.Windows.Controls.ProgressBar)(target)); return; case 9: this.MP_Bar = ((System.Windows.Controls.ProgressBar)(target)); return; case 10: this.strengthLabel = ((System.Windows.Controls.Label)(target)); return; case 11: this.agilityLabel = ((System.Windows.Controls.Label)(target)); return; case 12: this.defenseLabel = ((System.Windows.Controls.Label)(target)); return; case 13: this.intelligenceLabel = ((System.Windows.Controls.Label)(target)); return; case 14: this.atkpwrLabel = ((System.Windows.Controls.Label)(target)); return; case 15: this.splpwrLabel = ((System.Windows.Controls.Label)(target)); return; case 16: this.magicDefenseLabel = ((System.Windows.Controls.Label)(target)); return; case 17: this.critLabel = ((System.Windows.Controls.Label)(target)); return; case 18: this.dodgeLabel = ((System.Windows.Controls.Label)(target)); return; case 19: this.ClassImage = ((System.Windows.Controls.Image)(target)); return; case 20: this.explore_Button = ((System.Windows.Controls.Grid)(target)); return; case 21: #line 58 "..\..\..\..\Windows\CharacterWindows\CharacterMenu.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Explore_Click); #line default #line hidden return; case 22: this.shop_Button = ((System.Windows.Controls.Button)(target)); return; case 23: this.goldLabel = ((System.Windows.Controls.Label)(target)); return; case 24: this.skillPtsLabel = ((System.Windows.Controls.Label)(target)); return; case 25: this.HeroBorder = ((System.Windows.Controls.Border)(target)); return; case 26: this.HeroBorder_Copy = ((System.Windows.Controls.Border)(target)); return; case 27: this.HeroBorder_Copy1 = ((System.Windows.Controls.Border)(target)); return; } this._contentLoaded = true; }