Ejemplo n.º 1
0
 public BombSquadSequence(MoveAction moveAction, int bombCount) : base(moveAction)
 {
     BombCount = bombCount;
 }
 public OuttaSightSecondHalfSequence(MoveAction moveAction, float alphaVal) : base(moveAction)
 {
     AlphaVal = alphaVal;
 }
Ejemplo n.º 3
0
 public MiniEggSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public DiveKickSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public StarSpiritMoveSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 6
0
 //Mega Smash adds 4 damage
 public MegaSmashSequence(MoveAction moveAction) : base(moveAction, 4)
 {
 }
 public DisguiseSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 8
0
 public TidalWaveSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 9
0
 public ArtAttackSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 10
0
 public PowerLiftSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Determines if the BattleEntity gets affected by the Confused status, if it has it.
        /// If the BattleEntity is affected, it may perform a different action or target different entities with its original one.
        /// </summary>
        /// <param name="action">The BattleAction originally used.</param>
        /// <param name="targets">The original set of BattleEntities to target</param>
        /// <returns>An ActionHolder with a new BattleAction to perform or a different target list if the entity was affected by Confused.
        /// If not affected, the originals of each will be returned.</returns>
        private BattleGlobals.ActionHolder HandleConfusion(MoveAction action, params BattleEntity[] targets)
        {
            MoveAction actualAction = action;

            BattleEntity[] actualTargets = targets;

            //Check for Confusion's effects and change actions or targets depending on what happens
            int percent = EntityProperties.GetAdditionalProperty <int>(AdditionalProperty.ConfusionPercent);

            //See if Confusion should take effect
            if (UtilityGlobals.TestRandomCondition(percent) == true)
            {
                Debug.Log($"{Name} is affected by Confusion and will do something unpredictable!");

                //int changeAction = 0;
                //Check if the action can target entities to see if we should change targets
                //if (actualAction.MoveProperties.TargetsEntity == true)
                //{
                //    //Get the opposite type of entities to target
                //    //Items targets enemies, but attacks target allies
                //    EntityTypes oppositeType = actualAction.MoveProperties.EntityType;
                //    if (oppositeType == EntityTypes.Player) oppositeType = EntityTypes.Enemy;
                //    else if (oppositeType == EntityTypes.Enemy) oppositeType = EntityTypes.Player;
                //}

                int changeTargets = 0;

                //Don't give a chance to change targets if the action doesn't have targets
                //NOTE: This means we'll need to handle changing actions first, as not all actions target something
                if (targets != null && targets.Length > 0)
                {
                    changeTargets = GeneralGlobals.Randomizer.Next(0, 2);
                }

                //NOTE: Find a way to make it so we can control what happens based on the type of action.
                //For example, if Tattle was used, it doesn't target anyone else.
                //If you use a Healing item, it uses it on the opposing side, whereas if you use an attack it uses it on an ally.

                //Change to an ally

                /*Steps:
                 * 1. If the action hits the first entity, find the adjacent allies. If not, find all allies
                 * 2. Filter by heights based on what the action can hit
                 * 3. Filter out dead allies
                 * 4. If the action hits everyone, go with the remaining list. Otherwise, choose a random ally to attack
                 * 5. If there are no allies to attack after all the filtering, make the entity do nothing*/
                if (changeTargets == 1)
                {
                    List <BattleEntity> allies = new List <BattleEntity>();

                    //If this action targets only the first player/enemy, look for adjacent allies
                    if (actualAction.MoveProperties.SelectionType == TargetSelectionMenu.EntitySelectionType.First)
                    {
                        Debug.Log($"{Name} is looking for valid adjacent allies to attack!");

                        //Find adjacent allies and filter out all non-ally entities
                        BattleManager.Instance.GetAdjacentEntities(allies, this);
                        allies.RemoveAll((adjacent) => adjacent.EntityType != EntityType);
                    }
                    else
                    {
                        //Find all allies
                        BattleManager.Instance.GetEntityAllies(allies, this);
                    }

                    //Filter by heights
                    BattleManager.Instance.FilterEntitiesByHeights(allies, actualAction.MoveProperties.HeightsAffected);

                    //Filter dead entities
                    BattleManager.Instance.FilterDeadEntities(allies);

                    //Choose a random ally to attack if the action only targets one entity
                    if (allies.Count > 0 && actualAction.MoveProperties.SelectionType != TargetSelectionMenu.EntitySelectionType.All)
                    {
                        int          randTarget = GeneralGlobals.Randomizer.Next(0, allies.Count);
                        BattleEntity target     = allies[randTarget];
                        allies.Clear();
                        allies.Add(target);

                        Debug.Log($"{Name} is choosing to attack ally {allies[0].Name} in Confusion!");
                    }

                    //If you can't attack any allies, do nothing
                    if (allies.Count == 0)
                    {
                        actualAction = new NoAction();

                        Debug.Log($"{Name} did nothing as there either are no allies to attack or they're not in range!");
                    }
                    else
                    {
                        //Set the actual targets to be the set of allies
                        actualTargets = allies.ToArray();

                        //Disable action commands when attacking allies from Confusion, if the action has an Action Command
                        if (actualAction.HasActionCommand == true)
                        {
                            actualAction.EnableActionCommand = false;
                        }
                    }
                }
            }

            return(new BattleGlobals.ActionHolder(actualAction, actualTargets));
        }
Ejemplo n.º 12
0
 public VeilSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 13
0
 public TattleSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public RefreshSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public PowerBounceSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public ShellShieldSequence(MoveAction moveAction, int maxShellHP) : base(moveAction)
 {
     ShellMaxHP = maxShellHP;
 }
Ejemplo n.º 17
0
 public MultibounceSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 18
0
 public CrystalStarMoveSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public ChangePartnerSequence(MoveAction moveAction, BattlePartner newPartner) : base(moveAction)
 {
     NewPartner = newPartner;
 }
Ejemplo n.º 20
0
 public HammerSequence(MoveAction moveAction, int finalDamageAddition) : base(moveAction)
 {
     FinalDamageAddition = finalDamageAddition;
 }
Ejemplo n.º 21
0
 public LickSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 22
0
 public KissyKissySequence(MoveAction moveAction, int numAttacks) : base(moveAction)
 {
     MaxAttacks = NumAttacks = numAttacks;
 }
 public ShellTossSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public RockSpitSequence(MoveAction moveAction, BattleEntity entityUsed) : base(moveAction)
 {
     EntityUsed = entityUsed;
 }
Ejemplo n.º 25
0
 public VeilSecondHalfSequence(MoveAction moveAction, float scaleVal) : base(moveAction)
 {
     ScaleVal = scaleVal;
 }
Ejemplo n.º 26
0
 public JumpSequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 27
0
 public RunAwaySequence(MoveAction moveAction) : base(moveAction)
 {
 }
Ejemplo n.º 28
0
 public ElectroDashSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public GulpSequence(MoveAction moveAction) : base(moveAction)
 {
 }
 public OuttaSightSequence(MoveAction moveAction) : base(moveAction)
 {
 }