public void ConstructMagePlayerSucceeds() { StatisticsService statService = new StatisticsService(); IPlayer mage = new MageDecorator(new BasicPlayer(), statService, "Magic Shield", 15); Assert.IsNotNull(mage); Assert.IsTrue(mage.Attack() == 10); Assert.IsTrue(mage.Defend() == 25); Assert.IsTrue(statService.SpellsCast == 1); Assert.IsTrue(statService.WeaponStikes == 0); }
public void ConstructWarriorMagePlayerSucceeds() { StatisticsService statService = new StatisticsService(); IPlayer player = new BasicPlayer(); IPlayer mage = new MageDecorator(player, statService, "Magic Shield", 15); IPlayer warriorMage = new WarriorDecorator(mage, statService, "Flame Sword", 15); Assert.IsNotNull(warriorMage); Assert.IsTrue(warriorMage.Attack() == 25); Assert.IsTrue(warriorMage.Defend() == 25); Assert.IsTrue(statService.SpellsCast == 1); Assert.IsTrue(statService.WeaponStikes == 1); }
public void PaintWorld(WorldLayer layer) { if (ShowSkeletonOthers) { var players = Hud.Game.Players.Where(player => !player.IsMe && player.HeroClassDefinition.HeroClass == HeroClass.Necromancer && player.CoordinateKnown && Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && (player.HeadStone == null)); var OtherActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId != Hud.Game.Me.SummonerId && SkeletonActorSNOs.Contains(EachActor.SnoActor.Sno)); foreach (var player in players) { var IsActive = player.Powers.BuffIsActive(SkeletonSkillSNO, 0); foreach (var OtherActor in OtherActors) { if (OtherActor.SummonerAcdDynamicId == player.SummonerId) { SkeletonOtherDecorator.Paint(layer, OtherActor, OtherActor.FloorCoordinate, Label_SkeletonOthers); if (IsActive) { SkeletonActiveDecorator.Paint(layer, OtherActor, OtherActor.FloorCoordinate, Label_SkeletonOthers); } } } } } if (ShowSimulacrumOthers) { var players = Hud.Game.Players.Where(player => !player.IsMe && player.HeroClassDefinition.HeroClass == HeroClass.Necromancer && player.CoordinateKnown && Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && (player.HeadStone == null)); var OtherActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId != Hud.Game.Me.SummonerId && SimulacrumActorSNOs.Contains(EachActor.SnoActor.Sno)); foreach (var player in players) { var IsActive = player.Powers.BuffIsActive(SimulacrumSkillSNO, 0); foreach (var OtherActor in OtherActors) { if (OtherActor.SummonerAcdDynamicId == player.SummonerId) { SimulacrumOtherDecorator.Paint(layer, OtherActor, OtherActor.FloorCoordinate, Label_SimulacrumOthers); } } } } if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Necromancer) { return; } // For Skeleton Melee, only when equipping the skill var skill = Hud.Game.Me.Powers.UsedSkills.FirstOrDefault(s => s.SnoPower.Sno == Hud.Sno.SnoPowers.Necromancer_CommandSkeletons.Sno); if (skill != null) { var activeSkeleton = Hud.Game.Me.Powers.BuffIsActive(SkeletonSkillSNO, 0); var SkeletonActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && SkeletonActorSNOs.Contains(EachActor.SnoActor.Sno)); if (ShowSkeleton) { SkeletonCount = SkeletonActors.Count(); foreach (var EachActor in SkeletonActors) { SkeletonDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, null); if (activeSkeleton) { SkeletonActiveDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Skeleton); } } } if (activeSkeleton || skill.Rune == 3) { IAttribute attr; switch (skill.Rune) { case 0: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_A; break; case 1: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_B; break; case 2: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_C; break; case 3: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_D; break; case 4: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_E; break; default: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_None; break; } var TargetonScreen = false; foreach (IMonster monster in Hud.Game.AliveMonsters) { if (monster.GetAttributeValueAsUInt(attr, Hud.Sno.SnoPowers.Necromancer_CommandSkeletons.Sno, 2) == 1) { TargetonScreen = true; if (ActiveTarget == null) { ActiveTarget = monster; if (Hud.Game.Me.Powers.BuffIsActive(476584, 0)) { ResetRinger(false); StartRinger(); } } else if (ActiveTarget != monster) { ActiveTarget = monster; if (Hud.Game.Me.Powers.BuffIsActive(476584, 0)) { ResetRinger(true); StartRinger(); } } var TargetisElite = (monster.IsElite && monster.SummonerAcdDynamicId == 0 && monster.Rarity != ActorRarity.RareMinion); if (TargetisElite) { SkeletonTargetEliteDecorator.Paint(layer, null, monster.FloorCoordinate, null); } else if (!TargetOnEliteOnly) { SkeletonTargetDecorator.Paint(layer, null, monster.FloorCoordinate, null); } break; } } if (Hud.Game.Me.Powers.BuffIsActive(476584, 0)) { if (SkeletonCount == 0) { ResetRinger(true); StartRinger(); } if (!TargetonScreen) { ActiveTarget = null; ResetRinger(false); } } } else { ResetRinger(true); } } else { SkeletonCount = 0; } // For Skeleton Mages, only when equipping the skill if (ShowMage && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == MageSkillSNO) != null) { var MageActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && MageActorSNOs.Contains(EachActor.SnoActor.Sno)); MageCount = MageActors.Count(); foreach (var EachActor in MageActors) { MageDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Mage); } } else { MageCount = 0; } // For Golem, only when equipping the skill if (ShowGolem && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == GolemSkillSNO) != null) { var GolemActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && GolemActorSNOs.Contains(EachActor.SnoActor.Sno)); foreach (var EachActor in GolemActors) { GolemDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Golem); } } // For Simulacrum, only when equipping the skill if (ShowSimulacrum && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == SimulacrumSkillSNO) != null) { var SimulacrumActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && SimulacrumActorSNOs.Contains(EachActor.SnoActor.Sno)); foreach (var EachActor in SimulacrumActors) { SimulacrumDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Simulacrum); } } // For Revive, only when equipping the skill if (ShowRevive && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == ReviveSkillSNO) != null) { var ReviveActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && EachActor.SnoActor.Sno.ToString().Contains("_p6_necro_revive")); ReviveCount = ReviveActors.Count(); foreach (var EachActor in ReviveActors) { ReviveDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Revive); } } else { ReviveCount = 0; } }