public void Update() { //NOTE: Create a general way to halt turns in battle in place of these hardcoded event check //Update battle events if there are any if (BattleEventManager.Instance.HasBattleEvents == true) { BattleEventManager.Instance.UpdateBattleEvents(); } //If a turn just ended, update the current state if (State == BattleState.TurnEnd) { //Don't start the next turn until all Battle Events are finished if (BattleEventManager.Instance.HasBattleEvents == false) { TurnStart(); } } if (State == BattleState.Turn) { EntityTurn.TurnUpdate(); } Mario.Update(); Partner?.Update(); for (int i = 0; i < MaxEnemies; i++) { Enemies[i]?.Update(); } }
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(); }