public void CharacterCannotBeAddedToArenaWhenFloorNotBuilt() { var a = new Arena(); var c = new Character(); c.SetName("YoMomma"); a.AddCharacterToArena(c); }
public void CannotEquipEquipmentIfCharacterDoesNotHaveEnoughFreeSlots() { var c = new Character(); var e = new TestHelpers.TestWeapon(); e.AddSlotType(new Hand()); e.AddSlotType(new Hand()); e.AddSlotType(new Hand()); Assert.IsFalse(c.CanEquipEquipment(e)); }
public void CharacterCanBeAddedToArena() { var a = new Arena(); a.BuildArenaFloor(5); var c = new Character(); c.SetName("YoMomma"); a.AddCharacterToArena(c); Assert.IsTrue(a.Characters.Exists(i => i.Name == "YoMomma")); }
public void CharacterCanPerformAttackActionWhenWithinRange() { var c = new Character(); c.SetCharacterLocation(0, 0); var o = new Character(); o.SetCharacterLocation(1, 1); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); var s = new TestHelpers.TestAttack(); Assert.IsTrue(s.CanBePerformed(c, o)); }
public void CharacterCannotPerformAttackWhenOutOfRange() { var c = new Character(); c.SetCharacterLocation(0, 0); var o = new Character(); o.SetCharacterLocation(10, 10); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); var s = new TestHelpers.TestAttack(); Assert.IsFalse(s.CanBePerformed(c, o)); }
public void initialize(GameLogic.CharacterInstance characterInstance, GameLogic.Character character) { this.CharacterInstance = characterInstance; this.Character = character; if ((characterInstance == null) && (character == null)) { this.UpgradeButton.gameObject.SetActive(false); this.ProgressBar.gameObject.SetActive(true); this.ProgressBar.setNormalizedValue(0f); this.HeroButton.interactable = false; this.Bg.material = this.m_greyscaleMaterial; this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "avatar_hero001"); this.Icon.material = this.m_greyscaleMaterial; this.LevelIcon.material = this.m_greyscaleMaterial; this.LevelText.text = string.Empty; } else if (characterInstance != null) { this.UpgradeButton.gameObject.SetActive(true); this.ProgressBar.gameObject.SetActive(false); this.HeroButton.interactable = true; this.Bg.material = null; this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", characterInstance.Character.AvatarSpriteId); this.Icon.material = null; this.LevelIcon.material = null; this.LevelText.text = characterInstance.Rank.ToString(); } else { this.UpgradeButton.gameObject.SetActive(false); this.ProgressBar.gameObject.SetActive(true); this.HeroButton.interactable = true; this.Bg.material = this.m_greyscaleMaterial; this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", character.AvatarSpriteId); this.Icon.material = this.m_greyscaleMaterial; this.LevelIcon.material = this.m_greyscaleMaterial; this.LevelText.text = string.Empty; } }
public void EquipEquipmentUpdatesCharacterEquipmentSlotsToUsed() { var c = new Character(); var e = new TestHelpers.TestWeapon(); e.AddSlotType(new Hand()); c.EquipEquipment(e); Assert.IsTrue(c.Slots.Exists(x => !x.SlotFree && x.SlotEquipmentName == e.Name)); }
public void EquipEquipmentAddsEquipmentToCharactersEquipment() { var c = new Character(); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); Assert.IsTrue(c.CharacterEquipment.Exists(x => x == e)); }
public void CharacterLocationCanBeSet() { var c = new Character(); c.SetCharacterLocation(1, 2); Assert.IsTrue(c.CharacterLocation.XCoord == 1 && c.CharacterLocation.YCoord == 2); }
public void CanEquipEquipmentIfCharacterHasFreeSlots() { var c = new Character(); var e = new TestHelpers.TestWeapon(); Assert.IsTrue(c.CanEquipEquipment(e)); }
public void UnEquipEquipmentRemovesEquipmentFromCharactersEquipment() { var c = new Character(); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); c.UnEquipEquipment(e); Assert.IsFalse(c.CharacterEquipment.Exists(x => x == e)); }
public void UnEquipEquipmentFreesCharactersEquipmentSlots() { var c = new Character(); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); c.UnEquipEquipment(e); Assert.IsFalse(c.Slots.Exists(x => !x.SlotFree || x.SlotEquipmentName == e.Name)); }
public void PlayerHasAvailableActionsFromEquippedEquipment() { var c = new Character(); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); var e2 = new TestHelpers.TestWeapon2(); c.EquipEquipment(e2); Assert.IsTrue(c.AvailableActions.Exists(i => i.Name == "Test Attack") && c.AvailableActions.Exists(i => i.Name == "Test Attack2")); }
public void PlayerAvailableActionsAreDistinct() { var c = new Character(); var e = new TestHelpers.TestWeapon(); c.EquipEquipment(e); c.EquipEquipment(e); Assert.IsTrue(c.AvailableActions.FindAll(i => i.Name == "Test Attack").Count == 1); }
public void EquipEquipmentWhenCharacterDoesNotHaveEnoughFreeSlotsThrowsException() { var c = new Character(); var e = new TestHelpers.TestWeapon(); e.AddSlotType(new Hand()); e.AddSlotType(new Hand()); e.AddSlotType(new Hand()); c.EquipEquipment(e); }