public void PlayerVictory(bool first, bool spawn) { if (first) { Scene.ActorWait(); } SyncMessages.Clear(); int tileX = first ? 18 : 17; Actor deadMan = (Actor)Scene.Tiles[tileX][2].TempObject; if (spawn) { Scene.CreateActor(Scene.Players.ToArray()[0], "test_actor", "test_roleModel", Scene.Tiles[4][4], null, null, null); } Scene.ActorAttack(Scene.TempTileObject.Id, tileX, 2); Scene.ActorAttack(Scene.TempTileObject.Id, tileX, 2); Assert.That(!deadMan.IsAlive, Is.True, "Actor killed"); Assert.That(SyncMessages.Count, Is.EqualTo(3), "Count of syncMessages"); Assert.That(SyncMessages[2].Action, Is.EqualTo(ProjectArena.Engine.Helpers.SceneAction.EndGame)); Assert.That(Scene.Players.ToArray()[first ? 0 : 1].Status, Is.EqualTo(ProjectArena.Engine.Helpers.PlayerStatus.Victorious)); Assert.That(Scene.Players.ToArray()[first ? 1 : 0].Status, Is.EqualTo(ProjectArena.Engine.Helpers.PlayerStatus.Defeated)); Assert.That(Scene.Actors.Count, Is.EqualTo(1), "Count of actors"); }
public void AddDebuff() { _actor.BuffManager.AddBuff("test_debuff", 10, null); Assert.That(_actor.Buffs.Count, Is.EqualTo(1), "Count of Buffs"); Assert.That(_actor.DamageModel.Health, Is.EqualTo(50), "Start amount of health"); Scene.ActorWait(); Assert.That(_actor.DamageModel.Health, Is.LessThan(50), "Changed health after waiting"); }
public void DecorationCast() { Assert.That(Scene.ActorWait(), Is.True, "Actor first turn"); Assert.That(SyncMessages.Count, Is.EqualTo(1), "Amount of syncMessages first turn"); Assert.That(_decoration.DamageModel.Health, Is.EqualTo(100), "Health first turn"); Assert.That(Scene.ActorWait(), Is.True, "Actor second turn"); Assert.That(SyncMessages.Count, Is.EqualTo(4), "Amount of syncMessages second turn"); Assert.That(_decoration.DamageModel.Health, Is.EqualTo(90), "Health second turn"); Assert.That(SyncMessages[2].Action, Is.EqualTo(ProjectArena.Engine.Helpers.SceneAction.Decoration), "Decoration action"); Assert.That(Scene.TempTileObject, Is.EqualTo(Scene.Actors[0]), "Temp tile object at last"); }
public void DecorationDeath() { int i = 0; while (_decoration.DamageModel.Health > 0 && i < 500) { i++; Scene.ActorWait(); } Assert.That(i > 400, Is.False, "Cycle error"); Assert.That(SyncMessages[^ 2].Action, Is.EqualTo(ProjectArena.Engine.Helpers.SceneAction.Decoration), "Decoration action");
public void Death() { int i = 0; while (_effect.Duration > 0 && i < 100) { Scene.ActorWait(); } Assert.That(i > 400, Is.False, "Cycle error"); Assert.That((int)Scene.Actors.Find(x => SceneHelper.GetOrderByGuid(x.ExternalId) == 1).DamageModel.Health, Is.EqualTo(70), "Actor health after impact"); Assert.That(_effect.Duration, Is.LessThanOrEqualTo(0), "Effect duration"); Assert.That(_effect.IsAlive, Is.False, "Is alive"); Assert.That(SyncMessages[SyncMessages.Count() - 1].SyncInfo.DeletedEffects.Count(), Is.EqualTo(1), "Count of deleted effects"); }
public void AddDefaultBuff(int amount) { for (int i = 0; i < amount; i++) { _actor.BuffManager.AddBuff("test_buff_default", (i + 1) * 2, null); } Assert.That(_actor.Buffs.Count, Is.EqualTo(1), "Count of Buffs"); Assert.That(_actor.DamageModel.Health, Is.EqualTo(50 + (amount * 2)), "Start amount of health"); Assert.That(_actor.Strength, Is.EqualTo(10 + (amount * 2)), "Amount of strength"); Scene.ActorWait(); Assert.That(_actor.Buffs.Count, Is.EqualTo(1), "Count of Buff after waiting"); Assert.That(_actor.Buffs[0].Duration, Is.Null, "Buff duration after waiting"); Assert.That(_actor.AttackModifiers.Count, Is.EqualTo(1), "Attacker count"); Assert.That(_actor.AttackModifiers[0].SelfTag, Is.EqualTo("test_self_tag"), "Attacker self tag"); Assert.That(_actor.Armor.Count, Is.EqualTo(2), "Armor count"); Assert.That(_actor.Armor[1].TargetTag, Is.EqualTo("test_target_tag"), "Armor target tag"); }
public void AddDurationBuff() { _actor.BuffManager.AddBuff("test_buff_duration", 10, null); Buff testBuff = _actor.Buffs[0]; Assert.That(testBuff.Duration, Is.Not.Null, "Duration is setted up"); float tempDuration = (float)testBuff.Duration; int i = 0; while (testBuff.Duration > 0 && i < 100) { i++; Scene.ActorWait(); Assert.That(tempDuration, Is.GreaterThan(testBuff.Duration), "Duration diminishing"); tempDuration = (float)testBuff.Duration; } Assert.That(i > 98, Is.False, "Cycle error"); Assert.That(_actor.Buffs.Count, Is.EqualTo(0), "Count of Buff after waiting"); Assert.That(_actor.DamageModel.Health, Is.EqualTo(50), "Amount of health after end of buff"); }
public void Impact() { Scene.ActorWait(); Assert.That((int)Scene.Actors.Find(x => SceneHelper.GetOrderByGuid(x.ExternalId) == 1).DamageModel.Health, Is.EqualTo(95), "Actor health after impact"); Assert.That(_effect.Duration, Is.LessThan(2), "Effect duration"); }
public void Impact() { Scene.ActorWait(); Assert.That((int)Scene.Tiles[1][2].TempObject.DamageModel.Health, Is.EqualTo(85)); }