/// <summary> /// Target Died /// /// Process for death... /// /// Returns the count of items dropped at death /// </summary> /// <param name="Target"></param> public bool TargedDied(PlayerInfoModel Target) { // Mark Status in output BattleMessagesModel.TurnMessageSpecial = " and causes death. "; // Remove target from list... // Using a switch so in the future additional PlayerTypes can be added (Boss...) switch (Target.PlayerType) { case PlayerTypeEnum.Character: CharacterList.Remove(Target); // Add the MonsterModel to the killed list BattleScore.CharacterAtDeathList += Target.FormatOutput() + "\n"; DropItems(Target); return(true); case PlayerTypeEnum.Monster: default: MonsterList.Remove(Target); // Add one to the monsters killed count... BattleScore.MonsterSlainNumber++; // Add the MonsterModel to the killed list BattleScore.MonstersKilledList += Target.FormatOutput() + "\n"; DropItems(Target); return(true); } }
/// <summary> /// Target Died /// /// Process for death... /// /// Returns the count of items dropped at death /// </summary> /// <param name="Target"></param> public bool TargetDied(PlayerInfoModel Target) { bool found; // Mark Status in output BattleMessagesModel.TurnMessageSpecial = " and causes death. "; /*// Removing the * MapModel.RemovePlayerFromMap(Target);*/ // INFO: Teams, Hookup your Boss if you have one... // Using a switch so in the future additional PlayerTypes can be added (Boss...) switch (Target.PlayerType) { case PlayerTypeEnum.Character: // Add the Character to the killed list BattleScore.CharacterAtDeathList += Target.FormatOutput() + "\n"; BattleScore.CharacterModelDeathList.Add(Target); DropItems(Target); found = CharacterList.Remove(CharacterList.Find(m => m.Guid.Equals(Target.Guid))); found = PlayerList.Remove(PlayerList.Find(m => m.Guid.Equals(Target.Guid))); return(true); case PlayerTypeEnum.Monster: default: // Add one to the monsters killed count... BattleScore.MonsterSlainNumber++; // Add the MonsterModel to the killed list BattleScore.MonstersKilledList += Target.FormatOutput() + "\n"; BattleScore.MonsterModelDeathList.Add(Target); DropItems(Target); found = MonsterList.Remove(MonsterList.Find(m => m.Guid.Equals(Target.Guid))); found = PlayerList.Remove(PlayerList.Find(m => m.Guid.Equals(Target.Guid))); return(true); } }
/// <summary> /// Process an entity's death. /// </summary> /// <param name="target"></param> /// <returns></returns> public bool TargetDied(BattleEntityModel target) { // Mark Status in output BattleMessages.TurnMessageSpecial = target.Name + " has perished."; // Remove target from Map MapModel.RemovePlayerFromMap(target); // Using a switch so in the future additional PlayerTypes can be added (Boss...) switch (target.EntityType) { case EntityTypeEnum.Character: DropItems(target); var character = CharacterList.Where(a => a.Id == target.Id).FirstOrDefault(); CharacterList.Remove(character); EntityList.Remove(EntityList.Find(m => m.Id.Equals(target.Id))); // Add the MonsterModel to the killed list Score.CharacterAtDeathList += character.FormatOutput() + "\n"; Debug.WriteLine(BattleMessages.TurnMessageSpecial); return(true); case EntityTypeEnum.Monster: default: DropItems(target); var monster = MonsterList.Where(a => a.Id == target.Id).FirstOrDefault(); MonsterList.Remove(monster); EntityList.Remove(EntityList.Find(m => m.Id.Equals(target.Id))); // Add one to the monsters killed count... Score.MonsterSlainNumber++; // Add the MonsterModel to the killed list Score.MonstersKilledList += monster.FormatOutput() + "\n"; Debug.WriteLine(BattleMessages.TurnMessageSpecial); return(true); } }
/// <summary> /// Target Died /// /// Process for death... /// /// Returns the count of items dropped at death /// </summary> /// <param name="Target"></param> public bool TargetDied(PlayerInfoModel Target) { // Mark Status in output BattleMessagesModel.TurnMessageSpecial = " and causes death"; // Remove target from list // Using a switch so in the future additional PlayerTypes can be added (e.x: Boss...) switch (Target.PersonType) { case PersonTypeEnum.Character: CharacterList.Remove(Target); int[] CharacterLocation = GameBoardModel.GetPlayerLocation(Target); GameBoardModel.PlayerLocations[CharacterLocation[0], CharacterLocation[1]] = null; // Add the MonsterModel to the killed list BattleScore.CharacterAtDeathList += Target.FormatOutput() + "\n"; // DropItems(Target); return(true); case PersonTypeEnum.Monster: default: MonsterList.Remove(Target); // comment out (IndexOutOfRangeException) //int[] Location = GameBoard.GetPlayerLocation(Target); //GameBoard.PlayerLocations[Location[0], Location[1]] = null; // Add one to the monsters killed count... BattleScore.MonsterSlainNumber++; // Add the MonsterModel to the killed list BattleScore.MonstersKilledList += Target.FormatOutput() + "\n"; // We don't do Item drops // DropItems(Target); return(true); } }