public static void PaybackInteractionUT2() { BattleMario mario = new BattleMario(new MarioStats(1, 5, 50, 0, 0, EquipmentGlobals.BootLevels.Super, EquipmentGlobals.HammerLevels.Normal)); KoopaTroopa koopa = new KoopaTroopa(); koopa.RaiseAttack(2); ReturnPostageBadge returnPostage = new ReturnPostageBadge(); ZapTapBadge zapTap = new ZapTapBadge(); returnPostage.Equip(mario); zapTap.Equip(mario); Debug.Assert(mario.EntityProperties.HasPayback()); Debug.Assert(mario.EntityProperties.HasPhysAttributes(true, Enumerations.PhysicalAttributes.Electrified)); int damage = new ShellTossAction(koopa).DamageProperties.Damage + koopa.BattleStats.TotalAttack; InteractionParamHolder paramHolder = new InteractionParamHolder(koopa, mario, damage, Enumerations.Elements.Normal, false, Enumerations.ContactTypes.SideDirect, Enumerations.ContactProperties.Protected, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveActionTypes.None); InteractionResult interaction = Interactions.GetDamageInteraction(paramHolder); PrintInteractionResult(interaction); returnPostage.UnEquip(); zapTap.UnEquip(); Debug.Assert(interaction.VictimResult.TotalDamage == 4); Debug.Assert(interaction.AttackerResult.TotalDamage == 2); }
public static void TestSwitchMarioPeekaboo() { BattleMario mario = new BattleMario(new MarioStats(1, 1, 1, 1, 1, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal)); KoopaTroopa koopa = new KoopaTroopa(); BattleManager manager1 = new BattleManager(); PeekabooBadge peekaboo = new PeekabooBadge(); peekaboo.Equip(mario); manager1.Initialize(new BattleGlobals.BattleProperties(BattleGlobals.BattleSettings.Normal, true), mario, null, new List <BattleEntity>() { koopa }); Debug.Assert(manager1.TotalEntityCount == 2); Debug.Assert(peekaboo.EntityEquipped == mario); Debug.Assert(peekaboo.EntityEquipped.BManager == manager1); Debug.Assert(koopa.EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.ShowHP) == 1); BattleManager manager2 = new BattleManager(); Goomba goomba = new Goomba(); manager2.Initialize(new BattleGlobals.BattleProperties(BattleGlobals.BattleSettings.Normal, true), null, null, new List <BattleEntity>() { goomba }); Debug.Assert(manager2.TotalEntityCount == 1); Debug.Assert(goomba.EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.ShowHP) == 0); manager1.RemoveEntity(mario, false); Debug.Assert(manager1.TotalEntityCount == 1); Debug.Assert(peekaboo.EntityEquipped == mario); Debug.Assert(koopa.EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.ShowHP) == 0); manager2.AddEntity(mario, null); Debug.Assert(manager2.TotalEntityCount == 2); Debug.Assert(peekaboo.EntityEquipped == mario); Debug.Assert(peekaboo.EntityEquipped.BManager == manager2); Debug.Assert(koopa.EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.ShowHP) == 0); Debug.Assert(goomba.EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.ShowHP) == 1); peekaboo.UnEquip(); manager1.CleanUp(); manager2.CleanUp(); }
public KoopaTroopaAI(KoopaTroopa koopatroopa) : base(koopatroopa) { koopaTroopa = koopatroopa; }