Exemplo n.º 1
0
            public static void NewInteractionUT9()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 5, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                //Update HealthState for Last Stand to kick in on Danger
                mario.TakeDamage(Enumerations.Elements.Normal, 0, false);

                Badge badge = new LastStandBadge();

                badge?.Equip(mario);

                InteractionParamHolder param = new InteractionParamHolder(goomba, mario, 80, Enumerations.Elements.Water, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);

                badge?.UnEquip();
            }
Exemplo n.º 2
0
            public static void NewInteractionUT7()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 50, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                goomba.EntityProperties.AddPhysAttribute(Enumerations.PhysicalAttributes.Fiery);
                goomba.EntityProperties.AddWeakness(Enumerations.Elements.Ice, new WeaknessHolder(WeaknessTypes.PlusDamage, 2));

                Badge badge = new IcePowerBadge();

                badge?.Equip(mario);

                InteractionParamHolder param = new InteractionParamHolder(mario, goomba, 3, Enumerations.Elements.Normal, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);

                badge?.UnEquip();
            }
Exemplo n.º 3
0
            public static void NewInteractionUT8()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 5, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                mario.EntityProperties.AddWeakness(Enumerations.Elements.Normal, new WeaknessHolder(WeaknessTypes.KO, 4));
                goomba.EntityProperties.AfflictStatus(new PaybackStatus(5), true);

                Badge badge = new DoublePainBadge();

                goomba.SetHeldCollectible(badge);
                goomba.OnBattleStart();

                InteractionParamHolder param = new InteractionParamHolder(mario, goomba, 4, Enumerations.Elements.Water, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);

                badge?.UnEquip();
                goomba.SetHeldCollectible(null);
            }
Exemplo n.º 4
0
            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();
            }
Exemplo n.º 5
0
            public static void NewInteractionUT1()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 50, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                InteractionParamHolder param = new InteractionParamHolder(mario, goomba, 5, Enumerations.Elements.Normal, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);
            }
Exemplo n.º 6
0
            public static void NoSkillsTestDoubleDisable()
            {
                Goomba         goomba  = new Goomba();
                HammermanBadge hmBadge = new HammermanBadge();

                goomba.EntityProperties.AfflictStatus(new NoSkillsStatus(Enumerations.MoveCategories.Jump, 3));
                Debug.Assert(goomba.EntityProperties.IsMoveCategoryDisabled(Enumerations.MoveCategories.Jump));

                hmBadge.Equip(goomba);
                Debug.Assert(goomba.EntityProperties.IsMoveCategoryDisabled(Enumerations.MoveCategories.Jump));

                goomba.EntityProperties.RemoveStatus(Enumerations.StatusTypes.NoSkills);
                Debug.Assert(goomba.EntityProperties.IsMoveCategoryDisabled(Enumerations.MoveCategories.Jump));

                hmBadge.UnEquip();
                Debug.Assert(goomba.EntityProperties.IsMoveCategoryDisabled(Enumerations.MoveCategories.Jump) == false);
            }
Exemplo n.º 7
0
            public static void NewInteractionUT5()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 50, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                goomba.EntityProperties.AddPhysAttribute(Enumerations.PhysicalAttributes.Electrified);
                goomba.EntityProperties.AddPayback(new StatusGlobals.PaybackHolder(StatusGlobals.PaybackTypes.Half, Enumerations.Elements.Poison, new StatusChanceHolder(100d, new PoisonStatus(5))));

                InteractionParamHolder param = new InteractionParamHolder(mario, goomba, 10, Enumerations.Elements.Normal, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);
            }
Exemplo n.º 8
0
            public static void PaybackInteractionUT1()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 5, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                mario.EntityProperties.AfflictStatus(new HoldFastStatus(3));

                Debug.Assert(mario.EntityProperties.HasPayback());

                InteractionParamHolder paramHolder = new InteractionParamHolder(goomba, mario, 0, Enumerations.Elements.Normal, true,
                                                                                Enumerations.ContactTypes.Latch, Enumerations.ContactProperties.None, null, Enumerations.DamageEffects.None, false,
                                                                                Enumerations.DefensiveActionTypes.Guard | Enumerations.DefensiveActionTypes.Superguard);

                InteractionResult interaction = Interactions.GetDamageInteraction(paramHolder);

                PrintInteractionResult(interaction);

                Debug.Assert(interaction.AttackerResult.TotalDamage == 1);
                Debug.Assert(interaction.VictimResult.TotalDamage == 0);
            }
Exemplo n.º 9
0
            public static void NewInteractionUT6()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 50, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                mario.EntityProperties.AddPayback(new StatusGlobals.PaybackHolder(StatusGlobals.PaybackTypes.Full, Enumerations.Elements.Star));
                goomba.EntityProperties.AddPhysAttribute(Enumerations.PhysicalAttributes.Electrified);
                goomba.EntityProperties.AddPayback(new StatusGlobals.PaybackHolder(StatusGlobals.PaybackTypes.Half, Enumerations.Elements.Poison, new StatusChanceHolder(100d, new PoisonStatus(5))));

                Badge dd1 = new DamageDodgeBadge();

                dd1?.Equip(mario);
                Badge dd2 = new DamageDodgeBadge();

                dd2?.Equip(mario);

                //For defensive actions; add flags in their code to make them always succeed
                //We'll need to implement the debug badge that automatically completes action commands as well as
                //make it easier to start input for action commands for debugging
                mario.OnTurnEnd();
                mario.Update();

                InteractionParamHolder param = new InteractionParamHolder(goomba, mario, 10, Enumerations.Elements.Normal, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);

                if (BattleManager.Instance.EntityTurn.PreviousAction?.MoveSequence.InSequence == false)
                {
                    BattleManager.Instance.EntityTurn.OnTurnStart();
                }

                dd1?.UnEquip();
                dd2?.UnEquip();
            }
Exemplo n.º 10
0
            public static void NewInteractionUT10()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 5, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                mario.EntityProperties.AddResistance(Enumerations.Elements.Electric, new ResistanceHolder(ResistanceTypes.Heal, 0));

                goomba.EntityProperties.AddPayback(new StatusGlobals.PaybackHolder(StatusGlobals.PaybackTypes.Half, Enumerations.Elements.Electric));
                goomba.EntityProperties.AfflictStatus(new ElectrifiedStatus(5), true);

                InteractionParamHolder param = new InteractionParamHolder(mario, goomba, 90, Enumerations.Elements.Normal, false,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);

                InteractionResult oldInteraction = Interactions.GetDamageInteractionOld(param);
                InteractionResult newInteraction = Interactions.GetDamageInteraction(param);

                Debug.Log("Old: ");
                PrintInteractionResult(oldInteraction);
                Debug.Log("New: ");
                PrintInteractionResult(newInteraction);
            }
Exemplo n.º 11
0
            public static void ElementOverrideInteractionUT1()
            {
                BattleMario mario  = new BattleMario(new MarioStats(1, 5, 50, 0, 0, EquipmentGlobals.BootLevels.Normal, EquipmentGlobals.HammerLevels.Normal));
                Goomba      goomba = new Goomba();

                IcePowerBadge icePower = new IcePowerBadge();

                icePower.Equip(mario);
                IcePowerBadge icePower2 = new IcePowerBadge();

                icePower2.Equip(mario);

                goomba.EntityProperties.AddPhysAttribute(Enumerations.PhysicalAttributes.Fiery);
                goomba.EntityProperties.AddWeakness(Enumerations.Elements.Ice, new WeaknessHolder(WeaknessTypes.PlusDamage, 1));

                Debug.Assert(goomba.EntityProperties.HasPhysAttributes(true, Enumerations.PhysicalAttributes.Fiery));
                Debug.Assert(goomba.EntityProperties.HasWeakness(Enumerations.Elements.Ice));

                ElementOverrideHolder overrideHolder = mario.EntityProperties.GetTotalElementOverride(goomba);

                Debug.Assert(overrideHolder.Element == Enumerations.Elements.Ice);
                Debug.Assert(overrideHolder.OverrideCount == 2);

                InteractionParamHolder param = new InteractionParamHolder(mario, goomba, 1, Enumerations.Elements.Ice, true,
                                                                          Enumerations.ContactTypes.TopDirect, null, Enumerations.DamageEffects.None, false, Enumerations.DefensiveMoveOverrides.None);
                InteractionResult interaction = Interactions.GetDamageInteraction(param);

                Debug.Assert(interaction.VictimResult.TotalDamage == 4);

                PrintInteractionResult(interaction);

                icePower.UnEquip();
                icePower2.UnEquip();

                ElementOverrideHolder overrideHolder2 = mario.EntityProperties.GetTotalElementOverride(goomba);

                Debug.Assert(overrideHolder2.Element == Enumerations.Elements.Invalid);
            }