public Excalibur(GameSessionViewModel gsm, GameSessionView gsv) { this.Damage = 15.6; this.Name = "Excalibur"; this.Collected = false; this.Equipped = false; this.ID = gsm._gameData.itemID += 1; this.Value = 7593; this.ItemStackCount += 1; this.SpecialObject = false; this.PicturePath = "/Images/sword-icon.png"; this.PictureSource = gsv.getPictureSource(this.PicturePath); this.CanEquip = true; // this.LevelRequirement = 5; this.LevelRequirement = 2; /*if (gsm.Player.Level > 7) * { * this.CanEquip = true; * } * else * { * this.CanEquip = false; * }*/ this.Consumable = false; this.Collected = true; }
public void TestCreateGameSession() { GameSessionViewModel gameSession = new GameSessionViewModel(); Assert.IsNotNull(gameSession.CurrentPlayer); Assert.AreEqual("Home", gameSession.CurrentLocation.Name); }
public Bandit(bool isBoss, GameSessionViewModel _gameSessionViewModel, GameSessionView GSV) : base(_gameSessionViewModel, GSV) { // // Can possibly move most of this stuff into the enemy class constructor // this.Level = _level; this.IsAlive = true; double newHealth = Level + (Level * 2.6); this.Health = newHealth; this.MaxHealth = newHealth; GSV.EnemyHealthDisplay.Value = newHealth; GSV.EnemyHealthDisplay.Maximum = newHealth; Random lvlRan = new Random(); this.Level = lvlRan.Next(15, 18); Random ran = new Random(); this.GoldDrop = ran.Next(10, 19); this._imageString = "Bandit.png"; Random ranXPDrop = new Random(); this.XPDrop = ranXPDrop.Next(20, 35); this.Name = "Bandit"; this.BaseAttack = this.BaseAttack += (this.Level / 100) + .75; _gameSessionViewModel.CurrentEnemyID += 1; this.ID = _gameSessionViewModel.CurrentEnemyID; // // if passed isBoss bool value is true, then set the property to true, otherwise set the property to false // isBoss = true ? IsBoss = isBoss : IsBoss = isBoss; }
/// <summary> /// create view model with data set /// </summary> private void InstantiateAndShowView() { // // instantiate the view model and initialize the data set // _gameSessionViewModel = new GameSessionViewModel( _player, GameData.InitialMessages(), GameData.GameMapData(), GameData.StartingLocation() ); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); PlayerSetupView playerSetupView = new PlayerSetupView(_player); playerSetupView.DataContext = _player; playerSetupView.Show(); // // dialog window is initially hidden to mitigate issue with // main window closing after dialog window closes // // commented out because the player setup window is disabled //_playerSetupView.Close(); }
public void collectItem(GameSessionViewModel gsm, Item itemObject) { bool contains = false; for (int item = 0; item < gsm.Player.Inventory.Count; item++) { if (gsm.Player.Inventory[item].Name == this.Name) { contains = true; itemObject = gsm.Player.Inventory[item]; } else if (gsm.Player.Inventory[item].Name != this.Name) { contains = false; } } if (contains) { itemObject.ItemStackCount += 1; this.Collected = true; } else if (contains == false) { gsm.Player.Inventory.Add(this); } }
public BlackKnight(bool isBoss, GameSessionViewModel _gameSessionViewModel, GameSessionView GSV) : base(_gameSessionViewModel, GSV) { this.Level = _level; double newHealth = Level + (Level * 2.6); this.Health = newHealth; this.IsAlive = true; this.MaxHealth = newHealth; GSV.EnemyHealthDisplay.Maximum = newHealth; GSV.EnemyHealthDisplay.Value = newHealth; this.BaseAttack = this.BaseAttack += (this.Level / 100) + .50; Random ranXPDrop = new Random(); this.XPDrop = ranXPDrop.Next(35, 60); Random goldRan = new Random(); this.GoldDrop = goldRan.Next(8, 14); this._imageString = "warrior-black.png"; this.Name = "Black Knight"; _gameSessionViewModel.CurrentEnemyID += 1; this.ID = _gameSessionViewModel.CurrentEnemyID; RubySword rubySword = new RubySword(_gameSessionViewModel, GSV); rubySword.Damage = 45; this.ItemDrop.Add(rubySword); // // if passed isBoss bool value is true, then set the property to true, otherwise set the property to false // isBoss = true ? IsBoss = isBoss : IsBoss = isBoss; }
//<summary> //initialize create View Model with data set //<summary> private void InstantiateAndShowView() { // // instantiate the view model and initialize the data set // _gameSessionViewModel = new GameSessionViewModel( _player, GameData.GameMap(), GameData.InitialGameMapLocation() ); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); // //dialog window is initially hidden to mitigate issue with main window closing after dialog window closes // _playerSetupView.Close(); }
public Enemy(GameSessionViewModel _gameSessionViewModel, GameSessionView _gameSessionView) { this.gameSessionViewModel = _gameSessionViewModel; this.gameSessionView = _gameSessionView; // // When switching between enemies, it starts each timer and never stops, so the damage being done // to player keeps piling on and soon the player gets one-tapped // /* * if (_gameSessionViewModel.CurrentLocation.MultiAttackLocation && _gameSessionViewModel.Player.currentlyAttacking.AttackingPlayer == false) * { * * startAttackingPlayer(); * AttackingPlayer = true; * } * else if (SelectedToFight == true && AttackingPlayer == false) * { * AttackingPlayer = true; * startAttackingPlayer(); * }*/ /*if (AttackingPlayer == true) * { * startAttackingPlayer(); * }*/ }
public HttpResponseMessage GetGameSessionsForGame([FromUri] int gameId) { var gameSessionsList = new List <GameSessionViewModel>(); var userId = HttpContext.Current.User.Identity.GetUserId <int>(); var gameSessions = gameSessionEntityService.GetAll().Where(x => x.TrackedEntityStatus != TrackedEntityStatus.Deleted && x.GameId == gameId).ToList(); foreach (var gameSession in gameSessions) { var gameSessionView = new GameSessionViewModel(gameSession); gameSessionView.Game = gameEntityService.GetById(gameSession.GameId); gameSessionView.CreatedByUserName = userEntityService.GetById(gameSession.CreatedByUserId).UserName; gameSessionView.GameSystem = gameEntityService.GetById(gameSession.GameId).GameSystem; gameSessionView.GameState = gameSession.GameSessionState.GetType().GetMember(gameSession.GameSessionState.ToString()) .First() .GetCustomAttribute <DisplayAttribute>() .Name; gameSessionsList.Add(gameSessionView); } if (gameSessions != null) { return(Request.CreateResponse(HttpStatusCode.OK, gameSessionsList)); } return(Request.CreateResponse(HttpStatusCode.NotFound, "Game Sessions do not exist")); }
public void Rewarder(GameSessionViewModel gsm, Enemy enemy) { gsm.PlayerXP += enemy.XPDrop; gsm.PlayerGold += enemy.GoldDrop; //gsm.MinPlayerXP = gsm.Player.XP; //gsm.MaxPlayerXP = gsm.Player.MaxLevelXPRange; }
public void playerLevelUp(GameSessionViewModel gsm, GameSessionView gsv) { gsm.PlayerLevel += 1; gsm.MinPlayerXP = gsm.Player.XP; gsv.playerStatsWindow.PlayerXPBar.Value = gsm.PlayerXP; gsv.playerStatsWindow.PlayerXPBar.Minimum = gsm.PlayerXP; gsv.playerStatsWindow.PlayerXPBar.Maximum = gsm.MaxPlayerXP; }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel(_player, _messages, GameData.GameMapData(), GameData.InitialGameMapLocation()); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel(_player); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
public Enemy(GameSessionViewModel _gameSessionViewModel, GameSessionView _gameSessionView) { this.gameSessionViewModel = _gameSessionViewModel; this.gameSessionView = _gameSessionView; // // When switching between enemies, it starts each timer and never stops, so the damage being done // to player keeps piling on and soon the player gets one-tapped // }
public void potionUsedWithCooldown(GameSessionViewModel gsm) { if (BeingUsed == false) { healingCooldown.Tick += new EventHandler(potionUsed); healingCooldown.Interval = new TimeSpan(0, 0, 2); healingCooldown.Start(); } }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel(_player, _gameMap, _currentLocation); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
public void TestPlayerMovesHomeAndIsComplelelyHealOnKilled() { GameSessionViewModel gameSession = new GameSessionViewModel(); gameSession.CurrentPlayer.TakeDamage(999); Assert.AreEqual("Home", gameSession.CurrentLocation.Name); Assert.AreEqual(gameSession.CurrentPlayer.Level * 10, gameSession.CurrentPlayer.CurrentHitPoints); }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel(_player, _spells, _spellComponentList); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
public MainWindow() { InitializeComponent(); _gameSessionVM = new GameSessionViewModel(); _gameSessionVM.OnMessageRaised += _gameSessionVM_OnMessageRaised; DataContext = _gameSessionVM; }
private void ShowGameView() { _gameSessionViewModel = new GameSessionViewModel(_player, _masterGameMap, _buttonVisibility); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); _playerEntryAndSetupView.Close(); }
public void InstantiateAndShowView() { // // instantiate the view model and initialize the data set // _gameSessionViewModel = new GameSessionViewModel(_player, _messages); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
/// <summary> /// Initiate the view /// </summary> private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel(_player, _messages, _gameMap, _gameSessionViewModel); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); //_playerSetupView.Close(); }
/// <summary> /// Create view model with data set /// </summary> private void InstantiateAndShowView() { //INSTANTIATE the view model and INITIALIZE the data set _gameSessionViewModel = new GameSessionViewModel(_player, _messages); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); _playerSetupView.Close(); }
public BasicHealingPotion(GameSessionViewModel gsm) { this.viewModel = gsm; this.HealingIncrement = 3.5; this.Name = "Basic Healing Potion"; this.Consumable = true; this.CanEquip = false; this.Value = 35; this.ItemStackCount += 1; gsm._gameData.itemID += 1; this.ConsumableUsed = false; }
/// <summary> /// create view model with data set /// </summary> private void InstantiateAndShowView() { // instatiate the view model and initialize the data set _gameSessionViewModel = new GameSessionViewModel(_player, _messages); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); _playerSetupView.Close(); }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel( _player, _gameMap, _initialLocationCoordinates ); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
public void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel( _player, GameData.InitialMessages()); GameSessionView gameSessionView = new GameSessionView { DataContext = _gameSessionViewModel }; gameSessionView.Show(); }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel(_player, GameData.InitialMessages(), GameData.GameMap(), GameData.InitialGameMapLocation(), _currentEnemies ); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); }
private void InstantiateAndShowView() { _gameSessionViewModel = new GameSessionViewModel( _player, GameData.InitialMesseges() ); GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel); gameSessionView.DataContext = _gameSessionViewModel; gameSessionView.Show(); _playerSetUpView.Close(); }
protected override void OnStartup(StartupEventArgs e) { IDialogService dialogService = new DialogService(MainWindow); dialogService.Register <PlayerInfoViewModel, PlayerInfoView>(); dialogService.Register <WorldMapViewModel, WorldMapView>(); dialogService.Register <InventarViewModel, InventarView>(); var viewModel = new GameSessionViewModel(dialogService); var view = new MainWindow { DataContext = viewModel }; view.ShowDialog(); }