//Initialisiert sämtliche Daten die dieses Évent benötigt und holt sich die texturen und charactere aus dem loadContentHelper public void InitializeData() { StaticEnemies = new List<GUIElement>(); int groupCount = 0; int enemyCount = 0; //Jeder Character erhält seine Initialisierung. Die AttackAnimations werden auf Inaktiv gesetzt, //Die Positio der Charactere wird festgelegt, sämtliche Icons die ein Character benötigt werden geladen foreach (PartyMember partyMember in this.fightCadre) { if (groupCount == 0) { partyMember.AttackAnimation.active = false; partyMember.Position = characterPosition_1; this.fightCadre.ElementAt<Character>(0).LoadContent(partyMember.StandardAnimation, partyMember.Position); partyMember1 = partyMember; BleedIconCharacter1 = LoadContentHelper.BleedIcon; BlessedIconCharacter1 = LoadContentHelper.BlessedIcon; BurnedIconCharacter1 = LoadContentHelper.BurnIcon; HasHaloIconCharacter1 = LoadContentHelper.HaloIcon; MindblownIconCharacter1 = LoadContentHelper.MindblownIcon; PoisenedIconCharacter1 = LoadContentHelper.PoisenIcon; BleedIconCharacter1.PositionX = (int)partyMember1.Position.X + 25; BleedIconCharacter1.PositionY = (int)partyMember1.Position.Y; BlessedIconCharacter1.PositionX = (int)partyMember1.Position.X + 25; BlessedIconCharacter1.PositionY = (int)partyMember1.Position.Y; BurnedIconCharacter1.PositionX = (int)partyMember1.Position.X + 25; BurnedIconCharacter1.PositionY = (int)partyMember1.Position.Y; HasHaloIconCharacter1.PositionX = (int)partyMember1.Position.X + 25; HasHaloIconCharacter1.PositionY = (int)partyMember1.Position.Y; MindblownIconCharacter1.PositionX = (int)partyMember1.Position.X + 25; MindblownIconCharacter1.PositionY = (int)partyMember1.Position.Y; PoisenedIconCharacter1.PositionX = (int)partyMember1.Position.X + 25; PoisenedIconCharacter1.PositionY = (int)partyMember1.Position.Y; } if (groupCount == 1) { partyMember.AttackAnimation.active = false; partyMember.Position = characterPosition_2; this.fightCadre.ElementAt<Character>(1).LoadContent(partyMember.StandardAnimation, partyMember.Position); partyMember2 = partyMember; BleedIconCharacter2 = LoadContentHelper.BleedIcon2; BlessedIconCharacter2 = LoadContentHelper.BlessedIcon2; BurnedIconCharacter2 = LoadContentHelper.BurnIcon2; HasHaloIconCharacter2 = LoadContentHelper.HaloIcon2; MindblownIconCharacter2 = LoadContentHelper.MindblownIcon2; PoisenedIconCharacter2 = LoadContentHelper.PoisenIcon2; BleedIconCharacter2.PositionX = (int)partyMember2.Position.X + 25; BleedIconCharacter2.PositionY = (int)partyMember2.Position.Y; BlessedIconCharacter2.PositionX = (int)partyMember2.Position.X + 25; BlessedIconCharacter2.PositionY = (int)partyMember2.Position.Y; BurnedIconCharacter2.PositionX = (int)partyMember2.Position.X + 25; BurnedIconCharacter2.PositionY = (int)partyMember2.Position.Y; HasHaloIconCharacter2.PositionX = (int)partyMember2.Position.X + 25; HasHaloIconCharacter2.PositionY = (int)partyMember2.Position.Y; MindblownIconCharacter2.PositionX = (int)partyMember2.Position.X + 25; MindblownIconCharacter2.PositionY = (int)partyMember2.Position.Y; PoisenedIconCharacter2.PositionX = (int)partyMember2.Position.X + 25; PoisenedIconCharacter2.PositionY = (int)partyMember2.Position.Y; } if (groupCount == 2) { partyMember.AttackAnimation.active = false; partyMember.Position = characterPosition_3; this.fightCadre.ElementAt<Character>(2).LoadContent(partyMember.StandardAnimation, partyMember.Position); partyMember3 = partyMember; BleedIconCharacter3 = LoadContentHelper.BleedIcon3; BlessedIconCharacter3 = LoadContentHelper.BlessedIcon3; BurnedIconCharacter3 = LoadContentHelper.BurnIcon3; HasHaloIconCharacter3 = LoadContentHelper.HaloIcon3; MindblownIconCharacter3 = LoadContentHelper.MindblownIcon3; PoisenedIconCharacter3 = LoadContentHelper.PoisenIcon3; BleedIconCharacter3.PositionX = (int)partyMember3.Position.X + 25; BleedIconCharacter3.PositionY = (int)partyMember3.Position.Y; BlessedIconCharacter3.PositionX = (int)partyMember3.Position.X + 25; BlessedIconCharacter3.PositionY = (int)partyMember3.Position.Y; BurnedIconCharacter3.PositionX = (int)partyMember3.Position.X + 25; BurnedIconCharacter3.PositionY = (int)partyMember3.Position.Y; HasHaloIconCharacter3.PositionX = (int)partyMember3.Position.X + 25; HasHaloIconCharacter3.PositionY = (int)partyMember3.Position.Y; MindblownIconCharacter3.PositionX = (int)partyMember3.Position.X + 25; MindblownIconCharacter3.PositionY = (int)partyMember3.Position.Y; PoisenedIconCharacter3.PositionX = (int)partyMember3.Position.X + 25; PoisenedIconCharacter3.PositionY = (int)partyMember3.Position.Y; } if (groupCount == 3) { partyMember.AttackAnimation.active = false; partyMember.Position = characterPosition_4; this.fightCadre.ElementAt<Character>(3).LoadContent(partyMember.StandardAnimation, partyMember.Position); partyMember4 = partyMember; BleedIconCharacter4 = LoadContentHelper.BleedIcon4; BlessedIconCharacter4 = LoadContentHelper.BlessedIcon4; BurnedIconCharacter4 = LoadContentHelper.BurnIcon4; HasHaloIconCharacter4 = LoadContentHelper.HaloIcon4; MindblownIconCharacter4 = LoadContentHelper.MindblownIcon4; PoisenedIconCharacter4 = LoadContentHelper.PoisenIcon4; BleedIconCharacter4.PositionX = (int)partyMember4.Position.X + 25; BleedIconCharacter4.PositionY = (int)partyMember4.Position.Y; BlessedIconCharacter4.PositionX = (int)partyMember4.Position.X + 25; BlessedIconCharacter4.PositionY = (int)partyMember4.Position.Y; BurnedIconCharacter4.PositionX = (int)partyMember4.Position.X + 25; BurnedIconCharacter4.PositionY = (int)partyMember4.Position.Y; HasHaloIconCharacter4.PositionX = (int)partyMember4.Position.X + 25; HasHaloIconCharacter4.PositionY = (int)partyMember4.Position.Y; MindblownIconCharacter4.PositionX = (int)partyMember4.Position.X + 25; MindblownIconCharacter4.PositionY = (int)partyMember4.Position.Y; PoisenedIconCharacter4.PositionX = (int)partyMember4.Position.X + 25; PoisenedIconCharacter4.PositionY = (int)partyMember4.Position.Y; } groupCount++; } foreach (Enemy enemy in this.Enemies) { // Sobald der Gegner eine Animation bestizt wird dies erkannt und die Animationen werden geladen if (enemy.isAnimated) { if (enemyCount == 0) { enemy.AttackAnimation.active = false; enemy.Position = enemyPosition_1; enemy.LoadContent(enemy.StandardAnimation, enemy.Position); enemy1 = enemy; BleedIconEnemy1 = LoadContentHelper.BleedIcon5; BlessedIconEnemy1 = LoadContentHelper.BlessedIcon5; BurnedIconEnemy1 = LoadContentHelper.BurnIcon5; HasHaloIconEnemy1 = LoadContentHelper.HaloIcon5; MindblownIconEnemy1 = LoadContentHelper.MindblownIcon5; PoisenedIconEnemy1 = LoadContentHelper.PoisenIcon5; BleedIconEnemy1.PositionX = (int)enemy1.Position.X - 65; BleedIconEnemy1.PositionY = (int)enemy1.Position.Y; BlessedIconEnemy1.PositionX = (int)enemy1.Position.X - 65; BlessedIconEnemy1.PositionY = (int)enemy1.Position.Y; BurnedIconEnemy1.PositionX = (int)enemy1.Position.X - 65; BurnedIconEnemy1.PositionY = (int)enemy1.Position.Y; HasHaloIconEnemy1.PositionX = (int)enemy1.Position.X - 65; HasHaloIconEnemy1.PositionY = (int)enemy1.Position.Y; MindblownIconEnemy1.PositionX = (int)enemy1.Position.X - 65; MindblownIconEnemy1.PositionY = (int)enemy1.Position.Y; PoisenedIconEnemy1.PositionX = (int)enemy1.Position.X - 65; PoisenedIconEnemy1.PositionY = (int)enemy1.Position.Y; } if (enemyCount == 1) { enemy.AttackAnimation.active = false; enemy.Position = enemyPosition_2; this.Enemies.ElementAt<Character>(1).LoadContent(enemy.StandardAnimation, enemy.Position); enemy2 = enemy; BleedIconEnemy2 = LoadContentHelper.BleedIcon6; BlessedIconEnemy2 = LoadContentHelper.BlessedIcon6; BurnedIconEnemy2 = LoadContentHelper.BurnIcon6; HasHaloIconEnemy2 = LoadContentHelper.HaloIcon6; MindblownIconEnemy2 = LoadContentHelper.MindblownIcon6; PoisenedIconEnemy2 = LoadContentHelper.PoisenIcon6; BleedIconEnemy2.PositionX = (int)enemy2.Position.X - 65; BleedIconEnemy2.PositionY = (int)enemy2.Position.Y; BlessedIconEnemy2.PositionX = (int)enemy2.Position.X - 65; BlessedIconEnemy2.PositionY = (int)enemy2.Position.Y; BurnedIconEnemy2.PositionX = (int)enemy2.Position.X - 65; BurnedIconEnemy2.PositionY = (int)enemy2.Position.Y; HasHaloIconEnemy2.PositionX = (int)enemy2.Position.X - 65; HasHaloIconEnemy2.PositionY = (int)enemy2.Position.Y; MindblownIconEnemy2.PositionX = (int)enemy2.Position.X - 65; MindblownIconEnemy2.PositionY = (int)enemy2.Position.Y; PoisenedIconEnemy2.PositionX = (int)enemy2.Position.X - 65; PoisenedIconEnemy2.PositionY = (int)enemy2.Position.Y; } if (enemyCount == 2) { enemy.AttackAnimation.active = false; enemy.Position = enemyPosition_3; this.Enemies.ElementAt<Character>(2).LoadContent(enemy.StandardAnimation, enemy.Position); enemy3 = enemy; BleedIconEnemy3 = LoadContentHelper.BleedIcon7; BlessedIconEnemy3 = LoadContentHelper.BlessedIcon7; BurnedIconEnemy3 = LoadContentHelper.BurnIcon7; HasHaloIconEnemy3 = LoadContentHelper.HaloIcon7; MindblownIconEnemy3 = LoadContentHelper.MindblownIcon7; PoisenedIconEnemy3 = LoadContentHelper.PoisenIcon7; BleedIconEnemy3.PositionX = (int)enemy3.Position.X - 65; BleedIconEnemy3.PositionY = (int)enemy3.Position.Y; BlessedIconEnemy3.PositionX = (int)enemy3.Position.X - 65; BlessedIconEnemy3.PositionY = (int)enemy3.Position.Y; BurnedIconEnemy3.PositionX = (int)enemy3.Position.X - 65; BurnedIconEnemy3.PositionY = (int)enemy3.Position.Y; HasHaloIconEnemy3.PositionX = (int)enemy3.Position.X - 65; HasHaloIconEnemy3.PositionY = (int)enemy3.Position.Y; MindblownIconEnemy3.PositionX = (int)enemy3.Position.X - 65; MindblownIconEnemy3.PositionY = (int)enemy3.Position.Y; PoisenedIconEnemy3.PositionX = (int)enemy3.Position.X - 65; PoisenedIconEnemy3.PositionY = (int)enemy3.Position.Y; } if (enemyCount == 3) { enemy.AttackAnimation.active = false; enemy.Position = enemyPosition_4; this.Enemies.ElementAt<Character>(3).LoadContent(enemy.StandardAnimation, enemy.Position); enemy4 = enemy; BleedIconEnemy4 = LoadContentHelper.BleedIcon8; BlessedIconEnemy4 = LoadContentHelper.BlessedIcon8; BurnedIconEnemy4 = LoadContentHelper.BurnIcon8; HasHaloIconEnemy4 = LoadContentHelper.HaloIcon8; MindblownIconEnemy4 = LoadContentHelper.MindblownIcon8; PoisenedIconEnemy4 = LoadContentHelper.PoisenIcon8; BleedIconEnemy4.PositionX = (int)enemy4.Position.X - 65; BleedIconEnemy4.PositionY = (int)enemy4.Position.Y; BlessedIconEnemy4.PositionX = (int)enemy4.Position.X - 65; BlessedIconEnemy4.PositionY = (int)enemy4.Position.Y; BurnedIconEnemy4.PositionX = (int)enemy4.Position.X - 65; BurnedIconEnemy4.PositionY = (int)enemy4.Position.Y; HasHaloIconEnemy4.PositionX = (int)enemy4.Position.X - 65; HasHaloIconEnemy4.PositionY = (int)enemy4.Position.Y; MindblownIconEnemy4.PositionX = (int)enemy4.Position.X - 65; MindblownIconEnemy4.PositionY = (int)enemy4.Position.Y; PoisenedIconEnemy4.PositionX = (int)enemy4.Position.X - 65; PoisenedIconEnemy4.PositionY = (int)enemy4.Position.Y; } enemyCount++; } // Wenn der Gegner erstellt wird und es keine Animation für den Gegner gibt wird dem entsprechend nur ein Bild des gegeners geladen else { if (enemyCount == 0) { enemy.AttackAnimation.active = false; foreach (GUIElement staticEnemy in LoadContentHelper.AllStaticEnemies) { if (staticEnemy.AssetName == enemy.StaticEnemy.AssetName) { staticBoss = staticEnemy; staticBoss.PositionX = (int)staticBossPosition.X; staticBoss.PositionY = (int)staticBossPosition.Y; StaticEnemies.Add(staticBoss); BleedIconEnemy1 = LoadContentHelper.BleedIcon5; BlessedIconEnemy1 = LoadContentHelper.BlessedIcon5; BurnedIconEnemy1 = LoadContentHelper.BurnIcon5; HasHaloIconEnemy1 = LoadContentHelper.HaloIcon5; MindblownIconEnemy1 = LoadContentHelper.MindblownIcon5; PoisenedIconEnemy1 = LoadContentHelper.PoisenIcon5; BleedIconEnemy1.PositionX = (int)staticBossPosition.X - 30; BleedIconEnemy1.PositionY = (int)staticBossPosition.Y; BlessedIconEnemy1.PositionX = (int)staticBossPosition.X - 30; BlessedIconEnemy1.PositionY = (int)staticBossPosition.Y; BurnedIconEnemy1.PositionX = (int)staticBossPosition.X - 30; BurnedIconEnemy1.PositionY = (int)staticBossPosition.Y; HasHaloIconEnemy1.PositionX = (int)staticBossPosition.X - 30; HasHaloIconEnemy1.PositionY = (int)staticBossPosition.Y; MindblownIconEnemy1.PositionX = (int)staticBossPosition.X - 30; MindblownIconEnemy1.PositionY = (int)staticBossPosition.Y; PoisenedIconEnemy1.PositionX = (int)staticBossPosition.X - 30; PoisenedIconEnemy1.PositionY = (int)staticBossPosition.Y; } } enemy1 = enemy; } if (enemyCount == 1) { enemy.AttackAnimation.active = false; foreach (GUIElement staticEnemy in LoadContentHelper.AllStaticEnemies) { if (staticEnemy.AssetName == enemy.StaticEnemy.AssetName) { staticMinion_1 = staticEnemy; staticMinion_1.PositionX = (int)staticMinionPosition_1.X; staticMinion_1.PositionY = (int)staticMinionPosition_1.Y; StaticEnemies.Add(staticMinion_1); BleedIconEnemy2 = LoadContentHelper.BleedIcon6; BlessedIconEnemy2 = LoadContentHelper.BlessedIcon6; BurnedIconEnemy2 = LoadContentHelper.BurnIcon6; HasHaloIconEnemy2 = LoadContentHelper.HaloIcon6; MindblownIconEnemy2 = LoadContentHelper.MindblownIcon6; PoisenedIconEnemy2 = LoadContentHelper.PoisenIcon6; BleedIconEnemy2.PositionX = (int)staticMinionPosition_1.X - 65; BleedIconEnemy2.PositionY = (int)staticMinionPosition_1.Y; BlessedIconEnemy2.PositionX = (int)staticMinionPosition_1.X - 65; BlessedIconEnemy2.PositionY = (int)staticMinionPosition_1.Y; BurnedIconEnemy2.PositionX = (int)staticMinionPosition_1.X - 65; BurnedIconEnemy2.PositionY = (int)staticMinionPosition_1.Y; HasHaloIconEnemy2.PositionX = (int)staticMinionPosition_1.X - 65; HasHaloIconEnemy2.PositionY = (int)staticMinionPosition_1.Y; MindblownIconEnemy2.PositionX = (int)staticMinionPosition_1.X - 65; MindblownIconEnemy2.PositionY = (int)staticMinionPosition_1.Y; PoisenedIconEnemy2.PositionX = (int)staticMinionPosition_1.X - 65; PoisenedIconEnemy2.PositionY = (int)staticMinionPosition_1.Y; } } } if (enemyCount == 2) { enemy.AttackAnimation.active = false; foreach (GUIElement staticEnemy in LoadContentHelper.AllStaticEnemies) { if (staticEnemy.AssetName == enemy.StaticEnemy.AssetName) { staticMinion_2 = staticEnemy; staticMinion_2.PositionX = (int)staticMinionPosition_2.X; staticMinion_2.PositionY = (int)staticMinionPosition_2.Y; StaticEnemies.Add(staticMinion_2); BleedIconEnemy3 = LoadContentHelper.BleedIcon7; BlessedIconEnemy3 = LoadContentHelper.BlessedIcon7; BurnedIconEnemy3 = LoadContentHelper.BurnIcon7; HasHaloIconEnemy3 = LoadContentHelper.HaloIcon7; MindblownIconEnemy3 = LoadContentHelper.MindblownIcon7; PoisenedIconEnemy3 = LoadContentHelper.PoisenIcon7; BleedIconEnemy3.PositionX = (int)staticMinionPosition_2.X - 65; BleedIconEnemy3.PositionY = (int)staticMinionPosition_2.Y; BlessedIconEnemy3.PositionX = (int)staticMinionPosition_2.X - 65; BlessedIconEnemy3.PositionY = (int)staticMinionPosition_2.Y; BurnedIconEnemy3.PositionX = (int)staticMinionPosition_2.X - 65; BurnedIconEnemy3.PositionY = (int)staticMinionPosition_2.Y; HasHaloIconEnemy3.PositionX = (int)staticMinionPosition_2.X - 65; HasHaloIconEnemy3.PositionY = (int)staticMinionPosition_2.Y; MindblownIconEnemy3.PositionX = (int)staticMinionPosition_2.X - 65; MindblownIconEnemy3.PositionY = (int)staticMinionPosition_2.Y; PoisenedIconEnemy3.PositionX = (int)staticMinionPosition_2.X - 65; PoisenedIconEnemy3.PositionY = (int)staticMinionPosition_2.Y; } } } if (enemyCount == 3) { foreach (GUIElement staticEnemy in LoadContentHelper.AllStaticEnemies) { enemy.AttackAnimation.active = false; if (staticEnemy.AssetName == enemy.StaticEnemy.AssetName) { staticMinion_3 = staticEnemy; staticMinion_3.PositionX = (int)staticMinionPosition_3.X; staticMinion_3.PositionY = (int)staticMinionPosition_3.Y; StaticEnemies.Add(staticMinion_3); BleedIconEnemy4 = LoadContentHelper.BleedIcon8; BlessedIconEnemy4 = LoadContentHelper.BlessedIcon8; BurnedIconEnemy4 = LoadContentHelper.BurnIcon8; HasHaloIconEnemy4 = LoadContentHelper.HaloIcon8; MindblownIconEnemy4 = LoadContentHelper.MindblownIcon8; PoisenedIconEnemy4 = LoadContentHelper.PoisenIcon8; BleedIconEnemy4.PositionX = (int)staticMinionPosition_3.X - 65; BleedIconEnemy4.PositionY = (int)staticMinionPosition_3.Y; BlessedIconEnemy4.PositionX = (int)staticMinionPosition_3.X - 65; BlessedIconEnemy4.PositionY = (int)staticMinionPosition_3.Y; BurnedIconEnemy4.PositionX = (int)staticMinionPosition_3.X - 65; BurnedIconEnemy4.PositionY = (int)staticMinionPosition_3.Y; HasHaloIconEnemy4.PositionX = (int)staticMinionPosition_3.X - 65; HasHaloIconEnemy4.PositionY = (int)staticMinionPosition_3.Y; MindblownIconEnemy4.PositionX = (int)staticMinionPosition_3.X - 65; MindblownIconEnemy4.PositionY = (int)staticMinionPosition_3.Y; PoisenedIconEnemy4.PositionX = (int)staticMinionPosition_3.X - 65; PoisenedIconEnemy4.PositionY = (int)staticMinionPosition_3.Y; } } } enemyCount++; } } //Die Counter die zum Zählen der charactere und Skills sind werdeen auf 0 gesetzt int skillCounter = 0; int charCounter = 0; int enemieCounter = 0; //Nun werden alle Namen und Skills der Charactere Initialisiert. Diese werden später als Targets und Skills verwendet, //die ein Spieler auswählen kann um Skills zu wirken und das hierfür notwendige Ziel zu wähen. foreach (Character character in this.fightCadre) { if (character.GetType() == typeof(PartyMember) || character.GetType() == typeof(Player)) { if (charCounter == 0) { this.Character1Name = new TextElement(LoadContentHelper.AwesomeFont, character.Name, (int)this.targetPosition_1.X, (int)this.targetPosition_1.Y, true, LoadContentHelper.MouseIntersect); this.Character1Name.tclickEvent += this.onClickTarget; PartyNames.Add(Character1Name); foreach (Skill skill in character.Skills) { if (skillCounter == 0) { this.character1skill1 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_1.X, (int)this.skillPosition_1.Y, true, LoadContentHelper.MouseIntersect); this.character1skill1.tclickEvent += this.OnClickSkill; Character_1_Skills.Add(character1skill1); } if (skillCounter == 1) { this.character1skill2 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_2.X, (int)this.skillPosition_2.Y, true, LoadContentHelper.MouseIntersect); this.character1skill2.tclickEvent += this.OnClickSkill; Character_1_Skills.Add(character1skill2); } if (skillCounter == 2) { this.character1skill3 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_3.X, (int)this.skillPosition_3.Y, true, LoadContentHelper.MouseIntersect); this.character1skill3.tclickEvent += this.OnClickSkill; Character_1_Skills.Add(character1skill3); } if (skillCounter == 3) { this.character1skill4 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_4.X, (int)this.skillPosition_4.Y, true, LoadContentHelper.MouseIntersect); this.character1skill4.tclickEvent += this.OnClickSkill; Character_1_Skills.Add(character1skill4); } skillCounter++; } } if (charCounter == 1) { this.Character2Name = new TextElement(LoadContentHelper.AwesomeFont, character.Name, (int)this.targetPosition_2.X, (int)this.targetPosition_2.Y, true, LoadContentHelper.MouseIntersect); this.Character2Name.tclickEvent += this.onClickTarget; PartyNames.Add(Character2Name); foreach (Skill skill in character.Skills) { if (skillCounter == 0) { this.character2skill1 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_1.X, (int)this.skillPosition_1.Y, true, LoadContentHelper.MouseIntersect); this.character2skill1.tclickEvent += this.OnClickSkill; Character_2_Skills.Add(character2skill1); } if (skillCounter == 1) { this.character2skill2 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_2.X, (int)this.skillPosition_2.Y, true, LoadContentHelper.MouseIntersect); this.character2skill2.tclickEvent += this.OnClickSkill; Character_2_Skills.Add(character2skill2); } if (skillCounter == 2) { this.character2skill3 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_3.X, (int)this.skillPosition_3.Y, true, LoadContentHelper.MouseIntersect); this.character2skill3.tclickEvent += this.OnClickSkill; Character_2_Skills.Add(character2skill3); } if (skillCounter == 3) { this.character2skill4 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_4.X, (int)this.skillPosition_4.Y, true, LoadContentHelper.MouseIntersect); this.character2skill4.tclickEvent += this.OnClickSkill; Character_2_Skills.Add(character2skill4); } skillCounter++; } } if (charCounter == 2) { this.Character3Name = new TextElement(LoadContentHelper.AwesomeFont, character.Name, (int)this.targetPosition_3.X, (int)this.targetPosition_3.Y, true, LoadContentHelper.MouseIntersect); this.Character3Name.tclickEvent += this.onClickTarget; PartyNames.Add(Character3Name); foreach (Skill skill in character.Skills) { if (skillCounter == 0) { this.character3skill1 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_1.X, (int)this.skillPosition_1.Y, true, LoadContentHelper.MouseIntersect); this.character3skill1.tclickEvent += this.OnClickSkill; Character_3_Skills.Add(character3skill1); } if (skillCounter == 1) { this.character3skill2 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_2.X, (int)this.skillPosition_2.Y, true, LoadContentHelper.MouseIntersect); this.character3skill2.tclickEvent += this.OnClickSkill; Character_3_Skills.Add(character3skill2); } if (skillCounter == 2) { this.character3skill3 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_3.X, (int)this.skillPosition_3.Y, true, LoadContentHelper.MouseIntersect); this.character3skill3.tclickEvent += this.OnClickSkill; Character_3_Skills.Add(character3skill3); } if (skillCounter == 3) { this.character3skill4 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_4.X, (int)this.skillPosition_4.Y, true, LoadContentHelper.MouseIntersect); this.character3skill4.tclickEvent += this.OnClickSkill; Character_3_Skills.Add(character3skill4); } skillCounter++; } } if (charCounter == 3) { this.Character4Name = new TextElement(LoadContentHelper.AwesomeFont, character.Name, (int)this.targetPosition_4.X, (int)this.targetPosition_4.Y, true, LoadContentHelper.MouseIntersect); this.Character4Name.tclickEvent += this.onClickTarget; PartyNames.Add(Character4Name); foreach (Skill skill in character.Skills) { if (skillCounter == 0) { this.character4skill1 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_1.X, (int)this.skillPosition_1.Y, true, LoadContentHelper.MouseIntersect); this.character4skill1.tclickEvent += this.OnClickSkill; Character_4_Skills.Add(character4skill1); } if (skillCounter == 1) { this.character4skill2 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_2.X, (int)this.skillPosition_2.Y, true, LoadContentHelper.MouseIntersect); this.character4skill2.tclickEvent += this.OnClickSkill; Character_4_Skills.Add(character4skill2); } if (skillCounter == 2) { this.character4skill3 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_3.X, (int)this.skillPosition_3.Y, true, LoadContentHelper.MouseIntersect); this.character4skill3.tclickEvent += this.OnClickSkill; Character_4_Skills.Add(character4skill3); } if (skillCounter == 3) { this.character4skill4 = new TextElement(LoadContentHelper.AwesomeFont, skill.Name, (int)this.skillPosition_4.X, (int)this.skillPosition_4.Y, true, LoadContentHelper.MouseIntersect); this.character4skill4.tclickEvent += this.OnClickSkill; Character_4_Skills.Add(character4skill4); } skillCounter++; } } skillCounter = 0; charCounter++; } } foreach (Enemy enemy in this.Enemies) { if (enemieCounter == 0) { this.enemy1Name = new TextElement(LoadContentHelper.AwesomeFont, enemy.Name, (int)this.targetPosition_1.X, (int)this.targetPosition_1.Y, true, LoadContentHelper.MouseIntersect); this.enemy1Name.tclickEvent += this.onClickTarget; EnemyNames.Add(enemy1Name); } if (enemieCounter == 1) { this.enemy2Name = new TextElement(LoadContentHelper.AwesomeFont, enemy.Name, (int)this.targetPosition_2.X, (int)this.targetPosition_2.Y, true, LoadContentHelper.MouseIntersect); this.enemy2Name.tclickEvent += this.onClickTarget; EnemyNames.Add(enemy2Name); } if (enemieCounter == 2) { this.enemy3Name = new TextElement(LoadContentHelper.AwesomeFont, enemy.Name, (int)this.targetPosition_3.X, (int)this.targetPosition_3.Y, true, LoadContentHelper.MouseIntersect); this.enemy3Name.tclickEvent += this.onClickTarget; EnemyNames.Add(enemy3Name); } if (enemieCounter == 3) { this.enemy4Name = new TextElement(LoadContentHelper.AwesomeFont, enemy.Name, (int)this.targetPosition_4.X, (int)this.targetPosition_4.Y, true, LoadContentHelper.MouseIntersect); this.enemy4Name.tclickEvent += this.onClickTarget; EnemyNames.Add(enemy4Name); } enemieCounter++; } //Die anderen Notwendigen Variablen werden zugewiesen wie SoundEffects, Events usw. Click = LoadContentHelper.Click; Punch = LoadContentHelper.Punch; Heal = LoadContentHelper.Heal; GameOver = new GameOverEvent(LoadContentHelper.NickTheme); battleEvaluation = new BattleEvaluationEvent(FightCadre, LoadContentHelper.NickTheme); CharacterStatBox = LoadContentHelper.CharacterStatBox; AttackHintBox = LoadContentHelper.AttackHintBox; AttackHintBox.PositionX = 0; AttackHintBox.PositionY = 10; skillBox = LoadContentHelper.SkillBox; skillBox.PositionX = 0; skillBox.PositionY = 458; CharacterStatBox.PositionX = 140; CharacterStatBox.PositionY = 30; this.attackSkill = new TextElement(LoadContentHelper.AwesomeFont, "Angriff", (int)this.attackSkillPosition.X, (int)this.attackSkillPosition.Y, true, LoadContentHelper.MouseIntersect); this.attackSkill.tclickEvent += OnClickSkill; this.restSkill = new TextElement(LoadContentHelper.AwesomeFont, "Ausruhen", (int)this.restSkillPosition.X, (int)this.restSkillPosition.Y, true, LoadContentHelper.MouseIntersect); this.restSkill.tclickEvent += OnClickSkill; Back = new TextElement(LoadContentHelper.AwesomeFont, "Zurück",(int)skillPosition_3.X, (int)skillPosition_3.Y, true, LoadContentHelper.MouseIntersect); Back.tclickEvent += OnClickElement; EnemyNames.Add(Back); //Die Heal und Hit Animationen werden Initialisiert hitAnimationStandard = LoadContentHelper.hitAnimation1; Hit1 = new Skill("PhysicalHit", 0, null, null, null, null); Hit1.LoadContent(hitAnimationStandard, new Vector2(0, 0)); hitAnimationStandard.active = false; healAnimationStandard = LoadContentHelper.healAnimation1; Heal1 = new Skill("Heal", 0, null, null, null, null); Heal1.LoadContent(healAnimationStandard, new Vector2(0, 0)); healAnimationStandard.active = false; hitAnimation2 = LoadContentHelper.hitAnimation2; Hit2 = new Skill("PhysicalHit", 0, null, null, null, null); Hit2.LoadContent(hitAnimation2, new Vector2(0, 0)); hitAnimation2.active = false; healAnimation2 = LoadContentHelper.healAnimation2; Heal2 = new Skill("Heal", 0, null, null, null, null); Heal2.LoadContent(healAnimation2, new Vector2(0, 0)); healAnimation2.active = false; hitAnimation3 = LoadContentHelper.hitAnimation3; Hit3 = new Skill("PhysicalHit", 0, null, null, null, null); Hit3.LoadContent(hitAnimation3, new Vector2(0, 0)); hitAnimation3.active = false; healAnimation3 = LoadContentHelper.healAnimation3; Heal3 = new Skill("Heal", 0, null, null, null, null); Heal3.LoadContent(healAnimation3, new Vector2(0, 0)); healAnimation3.active = false; hitAnimation4 = LoadContentHelper.hitAnimation4; Hit4 = new Skill("PhysicalHit", 0, null, null, null, null); Hit4.LoadContent(hitAnimation4, new Vector2(0, 0)); hitAnimation4.active = false; healAnimation4 = LoadContentHelper.healAnimation4; Heal4 = new Skill("Heal", 0, null, null, null, null); Heal4.LoadContent(healAnimation4, new Vector2(0, 0)); healAnimation4.active = false; //Attack und Rest Skills werden zu den SkillListen der Charactere hinzugefügt Character_1_Skills.Add(attackSkill); Character_1_Skills.Add(restSkill); Character_2_Skills.Add(attackSkill); Character_2_Skills.Add(restSkill); Character_3_Skills.Add(attackSkill); Character_3_Skills.Add(restSkill); Character_4_Skills.Add(attackSkill); Character_4_Skills.Add(restSkill); // Die Pfeile zum anzeigen des aktiven Characters werden initialisiert und die Position wird festgelegt if (partyMember1 != null) { ActivePartymember1Arrow = LoadContentHelper.activePartyMemberArrow1; ActivePartymember1Arrow.PositionX = (int)partyMember1.Position.X - 60; ActivePartymember1Arrow.PositionY = (int)partyMember1.Position.Y - 10; } if (partyMember2 != null) { ActivePartymember2Arrow = LoadContentHelper.activePartyMemberArrow2; ActivePartymember2Arrow.PositionX = (int)partyMember2.Position.X - 60; ActivePartymember2Arrow.PositionY = (int)partyMember2.Position.Y - 10; } if (partyMember3 != null) { ActivePartymember3Arrow = LoadContentHelper.activePartyMemberArrow3; ActivePartymember3Arrow.PositionX = (int)partyMember3.Position.X - 60; ActivePartymember3Arrow.PositionY = (int)partyMember3.Position.Y - 10; } if (partyMember4 != null) { ActivePartymember4Arrow = LoadContentHelper.activePartyMemberArrow4; ActivePartymember4Arrow.PositionX = (int)partyMember4.Position.X - 60; ActivePartymember4Arrow.PositionY = (int)partyMember4.Position.Y - 10; } if (enemy1 != null) { ActiveEnemy1Arrow = LoadContentHelper.activeEnemyArrow1; ActiveEnemy1Arrow.PositionX = (int)enemy1.Position.X + 45; ActiveEnemy1Arrow.PositionY = (int)enemy1.Position.Y - 10; } if (enemy2 != null) { ActiveEnemy2Arrow = LoadContentHelper.activeEnemyArrow2; ActiveEnemy2Arrow.PositionX = (int)enemy2.Position.X + 45; ActiveEnemy2Arrow.PositionY = (int)enemy2.Position.Y - 10; } if (enemy3 != null) { ActiveEnemy3Arrow = LoadContentHelper.activeEnemyArrow3; ActiveEnemy3Arrow.PositionX = (int)enemy3.Position.X + 45; ActiveEnemy3Arrow.PositionY = (int)enemy3.Position.Y - 10; } if (enemy4 != null) { ActiveEnemy4Arrow = LoadContentHelper.activeEnemyArrow4; ActiveEnemy4Arrow.PositionX = (int)enemy4.Position.X + 45; ActiveEnemy4Arrow.PositionY = (int)enemy4.Position.Y - 10; } //FightCader wird der Liste FightClub hinzugefügt foreach (Character character in this.fightCadre) { this.FightClub.Add(character); } //Enemies wird der Liste FightClub hinzugefügt foreach (Character character in this.Enemies) { this.FightClub.Add(character); } //Der BackgroundPath wird mit den vorhanden Backgrounds des LoadContentHelpers verglichen, //und der richtige Hintergrund wird zugewiesen foreach (GUIElement background in LoadContentHelper.AllBackgrounds) { if (background.AssetName == BackgroundPath) { this.Background = background; } } // FightClub Member werden nach dem Initiative wert sortiert this.FightClub = this.FightClub.OrderBy(character => character.GetInitiative()).ToList(); activeChar = FightClub.ElementAt<Character>(0); }
//Startet einen neuen Zug und weist den nächsten Character zu private void StartNextTurn() { foreach(Character character in FightClub) { if(character.Life == 0) { character.Statuseffects.RemoveAll(effect => effect.GetType() != typeof(Blessing)); } } if (activeCharCounter == FightClub.Count - 1) { activeCharCounter = 0; activeChar = FightClub.ElementAt<Character>(activeCharCounter); } else if (activeCharCounter != FightClub.Count - 1) { activeCharCounter++; activeChar = FightClub.ElementAt<Character>(activeCharCounter); } activeChar.IsBlessed = false; activeChar.IsMindBlown = false; this.ExecuteStatuseffects(activeChar); if (this.activeChar.Life <= 0 && this.activeChar.IsBlessed) { this.activeChar.IsBlessed = false; this.activeChar.Life = 1; } SkipCharacterChecker(); skillClicked = false; targetClicked = true; activeTarget = null; activeSkill = null; enemyHitDone = false; }
//Führt aus was beim Klick auf einen Skill passieren soll private void OnClickSkill(String skillName) { Click.Play(1.0f, 0.0f, 0.0f); // Liste der Ziele auf die der Skill ausgeführt werden soll List<Character> targets = new List<Character>(); Hit1.LoadContent(hitAnimationStandard, new Vector2(-60, 0)); Heal1.LoadContent(healAnimationStandard, new Vector2(-60, 0)); //Skill wird überprüft foreach (Skill skill in this.activeChar.Skills) { if (skillName == skill.Name) { this.activeSkill = skill; if (skill.Manacosts < activeChar.Mana) { notEnoughMana = false; //Damit anstelle der Skills die möglichen Ziele gezeichnet werden, wird skillClicked auf true gesetzt und targetClicked auf false this.skillClicked = true; this.targetClicked = false; this.activeSkill = skill; //Wenn der Skill auf einzelne Charaktere zielt wird das ausgeführt if (skill.Target.ToLower() == "Single".ToLower()) { //Wenn der Skill sich auf PartyMember bezieht soll singleTarget True gesetzt werden if (skill.AreaOfEffect.ToLower() == "Party".ToLower()) { this.singleTargetParty = true; } // Sonst wird über prüft ob der Skill für einen Gegner bestimmt ist wenn ja dann soll singleTargetEnemies True gesetzt werden else if (skill.AreaOfEffect.ToLower() == "Enemy".ToLower()) { this.singleTargetEnemies = true; } } else if (skill.Target.ToLower() == "Group".ToLower()) { //Wenn der Skill sich auf eine Gruppe bezieht wird der skill ausgeführt dabei wird differenziert zwischen party und enemys if (skill.AreaOfEffect.ToLower() == "Party".ToLower()) { foreach (Character character in fightCadre) { targets.Add(character); } skill.Execute(this.activeChar, targets); LoadAnimatedSkillsFromPartymember(targets, Character1Name.SkillName); if (activeChar.Name == Character1Name.SkillName) { activeChar.LoadContent(partyMember1.AttackAnimation, partyMember1.Position); partyMember1.AttackAnimation.active = true; } else if (activeChar.Name == Character2Name.SkillName) { activeChar.LoadContent(partyMember2.AttackAnimation, partyMember2.Position); partyMember2.AttackAnimation.active = true; } else if (activeChar.Name == Character3Name.SkillName) { activeChar.LoadContent(partyMember3.AttackAnimation, partyMember3.Position); partyMember3.AttackAnimation.active = true; } else if (activeChar.Name == Character4Name.SkillName) { activeChar.LoadContent(partyMember4.AttackAnimation, partyMember4.Position); partyMember4.AttackAnimation.active = true; } //healAnimationStandard.active = true; targets.Clear(); this.targetClicked = true; skillClicked = true; activeTarget = activeChar; } else if (skill.AreaOfEffect.ToLower() == "Enemy".ToLower()) { foreach (Enemy enemy in this.Enemies) { targets.Add(enemy); } skill.Execute(this.activeChar, targets); LoadAnimatedSkillsFromPartymember(targets, enemy1Name.SkillName); if (activeChar.Name == Character1Name.SkillName) { activeChar.LoadContent(partyMember1.AttackAnimation, partyMember1.Position); partyMember1.AttackAnimation.active = true; } else if (activeChar.Name == Character2Name.SkillName) { activeChar.LoadContent(partyMember2.AttackAnimation, partyMember2.Position); partyMember2.AttackAnimation.active = true; } else if (activeChar.Name == Character3Name.SkillName) { activeChar.LoadContent(partyMember3.AttackAnimation, partyMember3.Position); partyMember3.AttackAnimation.active = true; } else if (activeChar.Name == Character4Name.SkillName) { activeChar.LoadContent(partyMember4.AttackAnimation, partyMember4.Position); partyMember4.AttackAnimation.active = true; } activeTarget = targets.ElementAt(0); targets.Clear(); this.targetClicked = true; skillClicked = true; } } break; } } else { this.activeSkill = skill; notEnoughMana = true; } } if (skillName == "Ausruhen") { notEnoughMana = false; activeTarget = activeChar; activeSkill = activeChar.RestSkill; if (Character1Name != null) { if (activeChar.Name == Character1Name.SkillName) { Heal1.LoadContent(healAnimationStandard, partyMember1.Position); } } if (Character2Name != null) { if (activeChar.Name == Character2Name.SkillName) { Heal1.LoadContent(healAnimationStandard, partyMember2.Position); } } if (Character3Name != null) { if (activeChar.Name == Character3Name.SkillName) { Heal1.LoadContent(healAnimationStandard, partyMember3.Position); } } if (Character4Name != null) { if (activeChar.Name == Character4Name.SkillName) { Heal1.LoadContent(healAnimationStandard, partyMember4.Position); } } Heal.Play(); healAnimationStandard.active = true; this.activeChar.RestSkill.Execute(activeChar, new List<Character> { activeChar }); targetClicked = true; } if (skillName == "Angriff") { //Damit anstelle der Skills die möglichen Ziele gezeichnet werden, wird skillClicked auf true gesetzt und targetClicked auf false this.skillClicked = true; this.targetClicked = false; notEnoughMana = false; activeSkill = this.activeChar.AttackSkill; this.singleTargetEnemies = true; } }
//führt die Logik aus wie beispielsweise die Steuerung oder das Abspielen der Animationen public void Update(GameTime gameTime) { if (firstStart) { MediaPlayer.Play(song); InitializeData(); firstStart = false; foreach (PartyMember member in FightCadre) { battleEvaluation.OldCharacterExp.Add(member.Exp); battleEvaluation.OldCharacterLevel.Add(member.Level); } } if (!enemy1.isAnimated && enemy1.Life == 0) { enemy1.DeathAnimation.Done = true; } if (fightCadre.All(member => member.Life == 0) && FightCadre.All(member => member.DeathAnimation.Done) && haveToLoose) { this.isOver = true; firstStart = true; foreach(PartyMember member in FightCadre) { member.SetFightAttributes(); } } else if (fightCadre.All(member => member.Life == 0) && FightCadre.All(member => member.DeathAnimation.Done) && !haveToLoose) { GameOver.Update(); firstStart = true; foreach (PartyMember member in FightCadre) { member.SetFightAttributes(); } } else if(Enemies.All(enemy => enemy.Life == 0) && Enemies.All(enemy => enemy.DeathAnimation.Done)) { foreach (PartyMember member in FightCadre) { member.SetFightAttributes(); } BattleEvaluation.UpdateFightCadre(this.fightCadre); if (Evaluate) { EvaluationHelperClass.EvaluateExp(this.FightCadre, this.Enemies); Evaluate = false; } battleEvaluation.Update(); isOver = battleEvaluation.EndBattle; } else { BattleControls(); Background.Update(); CharacterStatBox.Update(); skillBox.Update(); AttackHintBox.Update(); UpdateIcons(); if (partyMember1 != null) { ActivePartymember1Arrow.Update(); } if (partyMember2 != null) { ActivePartymember2Arrow.Update(); } if (partyMember3 != null) { ActivePartymember3Arrow.Update(); } if (partyMember4 != null) { ActivePartymember4Arrow.Update(); } if (enemy1 != null) { ActiveEnemy1Arrow.Update(); } if (enemy2 != null) { ActiveEnemy2Arrow.Update(); } if (enemy3 != null) { ActiveEnemy3Arrow.Update(); } if (enemy4 != null) { ActiveEnemy4Arrow.Update(); } isOver = BattleEvaluation.EndBattle; controls.Update(); Heal1.Update(gameTime); Hit1.Update(gameTime); Heal2.Update(gameTime); Hit2.Update(gameTime); Heal3.Update(gameTime); Hit3.Update(gameTime); Heal4.Update(gameTime); Hit4.Update(gameTime); UpdateAnimatedSkills(); //Die KI wird ausgeführt wenn es sich bei dem Aktiven Character um einen Gegner handelt if (activeChar.GetType() == typeof(Enemy)) { if (fightCadre.Any(member => member.Life != 0)) { if (!enemyHitDone) { Hit1.LoadContent(hitAnimationStandard, new Vector2(-60, 0)); Heal1.LoadContent(healAnimationStandard, new Vector2(-60, 0)); ((Enemy)this.activeChar).PerformAI(this.fightCadre.Cast<Character>().ToList(), this.Enemies.Cast<Character>().ToList()); activeSkill = ((Enemy)activeChar).SkillToPerform; activeTarget = ((Enemy)activeChar).Targets.ElementAt(0); LoadAnimatedSkillsFromEnemies(((Enemy)activeChar).Targets, ((Enemy)activeChar).TargetName); if (((Enemy)activeChar).isAnimated) { if (enemy1Name != null) { if (activeChar.Name == enemy1Name.SkillName) { activeChar.LoadContent(enemy1.AttackAnimation, enemy1.Position); enemy1.AttackAnimation.active = true; } } if (enemy2Name != null) { if (activeChar.Name == enemy2Name.SkillName) { activeChar.LoadContent(enemy2.AttackAnimation, enemy2.Position); enemy2.AttackAnimation.active = true; } } if (enemy3Name != null) { if (activeChar.Name == enemy3Name.SkillName) { activeChar.LoadContent(enemy3.AttackAnimation, enemy3.Position); enemy3.AttackAnimation.active = true; } } if (enemy4Name != null) { if (activeChar.Name == enemy4Name.SkillName) { activeChar.LoadContent(enemy4.AttackAnimation, enemy4.Position); enemy4.AttackAnimation.active = true; } } } else { Punch.Play(); if (activeTarget.GetType() == typeof(Enemy)) { healAnimationStandard.active = true; } else if (activeTarget.GetType() == typeof(PartyMember) || activeTarget.GetType() == typeof(Player)) { hitAnimationStandard.active = true; } AllowDeathAnimation = true; } } enemyHitDone = true; ((Enemy)activeChar).Targets.Clear(); } } //führt ein Update der Animationen und Texte aus wenn es sich bei dem aktiven Character um ein Gruppenmitglied handelt else { if (fightCadre.Any(member => member.Life != 0)) { if (!skillClicked && !activeChar.AttackAnimation.active && !healAnimationStandard.Done && !healAnimationStandard.active && !hitAnimationStandard.Done) { for (countFightCadre = 0; countFightCadre < this.fightCadre.Count - 1; countFightCadre++) { if (this.fightCadre.ElementAt(countFightCadre) == this.activeChar) break; } if (countFightCadre == 0) { if (!this.skillClicked) { if (character1skill1 != null) { this.character1skill1.Update(); } if (character1skill2 != null) { this.character1skill2.Update(); } if (character1skill3 != null) { this.character1skill3.Update(); } if (character1skill4 != null) { this.character1skill4.Update(); } } countFightCadre = 0; } if (countFightCadre == 1) { if (!this.skillClicked) { if (character2skill1 != null) { this.character2skill1.Update(); } if (character2skill2 != null) { this.character2skill2.Update(); } if (character2skill3 != null) { this.character2skill3.Update(); } if (character2skill4 != null) { this.character2skill4.Update(); } } countFightCadre = 0; } if (countFightCadre == 2) { if (!this.skillClicked) { if (character3skill1 != null) { this.character3skill1.Update(); } if (character3skill2 != null) { this.character3skill2.Update(); } if (character3skill3 != null) { this.character3skill3.Update(); } if (character3skill4 != null) { this.character3skill4.Update(); } } countFightCadre = 0; } if (countFightCadre == 3) { if (!this.skillClicked) { if (character4skill1 != null) { this.character4skill1.Update(); } if (character4skill2 != null) { this.character4skill2.Update(); } if (character4skill3 != null) { this.character4skill3.Update(); } if (character4skill4 != null) { this.character4skill4.Update(); } } countFightCadre = 0; } this.attackSkill.Update(); this.restSkill.Update(); } } if (!targetClicked) { Back.Update(); if (singleTargetParty) { if (Character1Name != null) { if (partyMember1.Life != 0) { this.Character1Name.Update(); } } if (Character2Name != null) { if (partyMember2.Life != 0) { this.Character2Name.Update(); } } if (Character3Name != null) { if (partyMember3.Life != 0) { this.Character3Name.Update(); } } if (Character4Name != null) { if (partyMember4.Life != 0); { this.Character4Name.Update(); } } } else if (singleTargetEnemies) { if (enemy1Name != null) { if (enemy1.Life != 0) { this.enemy1Name.Update(); } } if (enemy2Name != null) { if (enemy2.Life != 0) { this.enemy2Name.Update(); } } if (enemy3Name != null) { if (enemy3.Life != 0) { this.enemy3Name.Update(); } } if (enemy4Name != null) { if (enemy4.Life != 0) { this.enemy4Name.Update(); } } } } } } //Wechselt die Frames der befreundeten Animationen foreach (Character chars in this.fightCadre) { chars.Update(gameTime); } //Wechselt die Frames der Gegnerischen Animation foreach (Character chars in this.Enemies) { chars.Update(gameTime); } foreach (GUIElement staticEnemy in StaticEnemies) { staticEnemy.Update(); } UpdateDeathAnimations(); }
//Setzen der Skills Attacke und Ausruhen public void SetStandardSkills(Skill atk, Skill res) { this.AttackSkill = atk; this.RestSkill = res; }
//Hinzufügen eines Skills public void AddSkill(Skill newSkill) { this.Skills.Add(newSkill); }