コード例 #1
0
 public KoopatrolFlippedBehavior(BattleEntity entity, int flippedTurns, Enumerations.DamageEffects flippedOnEffects, int defenseLoss,
                                 StatusGlobals.PaybackHolder paybackRemoved, Enumerations.PhysicalAttributes attributeRemoved)
     : base(entity, flippedTurns, flippedOnEffects, defenseLoss)
 {
     PaybackRemoved   = paybackRemoved;
     AttributeRemoved = attributeRemoved;
 }
コード例 #2
0
        public override BattleGlobals.DefensiveActionHolder HandleSuccess(int damage, StatusChanceHolder[] statusEffects, DamageEffects damageEffects)
        {
            int newDamage = 0;

            StatusChanceHolder[] newStatuses = FilterStatuses(statusEffects);

            BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Damage,
                                                                       new BattleManager.BattleState[] { BattleManager.BattleState.Turn },
                                                                       new WaitForAnimBattleEvent(User, AnimationGlobals.PlayerBattleAnimations.SuperguardName, true));

            BattleObjManager.Instance.AddBattleObject(new ActionCommandVFX(ActionCommand.CommandRank.Great, User.Position, new Vector2(-15, -15)));
            SoundManager.Instance.PlaySound(SoundManager.Sound.ActionCommandSuccess);

            StatusGlobals.PaybackHolder paybackData =
                new StatusGlobals.PaybackHolder(StatusGlobals.PaybackTypes.Constant, PhysicalAttributes.None, Elements.Normal,
                                                new ContactTypes[] { ContactTypes.SideDirect, ContactTypes.TopDirect },
                                                new ContactProperties[] { ContactProperties.None, ContactProperties.Protected, ContactProperties.WeaponDirect },
                                                ContactResult.Failure, ContactResult.Failure, 1, null);

            return(new BattleGlobals.DefensiveActionHolder(newDamage, newStatuses, DamageEffects.None, DefensiveActionType, paybackData));
        }
コード例 #3
0
        protected override void SequenceMainBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //If, for whatever reason, a Duplighost isn't using this move, then just continue
                if (DuplighostRef == null)
                {
                    Debug.LogWarning($"{User.Name} is not a Duplighost, so nothing will happen!");
                    ChangeSequenceBranch(SequenceBranch.End);
                    break;
                }

                BattleEntity entityDisguised = EntitiesAffected[0];

                //Copy the animations of the entity
                DuplighostRef.CopyEntityAnimations(entityDisguised.AnimManager);

                //See which Partner the Duplighost is disguised as
                BattlePartner partnerDisguised = entityDisguised as BattlePartner;
                if (partnerDisguised != null)
                {
                    DuplighostRef.PartnerTypeDisguise = partnerDisguised.PartnerType;

                    //If disguising as Watt, add Electrified, Watt's light source, and Watt's Payback
                    if (DuplighostRef.PartnerTypeDisguise == Enumerations.PartnerTypes.Watt)
                    {
                        DuplighostRef.EntityProperties.AddPhysAttribute(Enumerations.PhysicalAttributes.Electrified);
                        DuplighostRef.EntityProperties.AddAdditionalProperty(Enumerations.AdditionalProperty.LightSource,
                                                                             partnerDisguised.EntityProperties.GetAdditionalProperty <double>(Enumerations.AdditionalProperty.LightSource));

                        //Copy Watt's Payback
                        Watt watt = partnerDisguised as Watt;

                        StatusGlobals.PaybackHolder wattPayback = watt.ElectricPayback;
                        DuplighostRef.PaybackCopied = wattPayback;
                        DuplighostRef.EntityProperties.AddPayback(wattPayback);
                    }
                    //Do an Easter Egg by replicating PM's glitchy behavior when Duplighosts disguise as Goompa
                    //Kill off the Duplighost, and set Mario to its position
                    else if (DuplighostRef.PartnerTypeDisguise == Enumerations.PartnerTypes.Goompa)
                    {
                        //Make sure Mario is in battle (he should be!)
                        if (User.BManager.Mario != null)
                        {
                            User.BManager.Mario.Position = DuplighostRef.Position;
                        }

                        DuplighostRef.Die();
                    }
                }

                //If copying a Flippable BattleEntity, copy its Flippable behavior
                IFlippableEntity flippableEnt = entityDisguised as IFlippableEntity;
                if (flippableEnt != null)
                {
                    DuplighostRef.FlippableBehavior = flippableEnt.FlippedBehavior.CopyBehavior(DuplighostRef);
                }

                //Copy its Defense and height state
                DuplighostRef.BattleStats.BaseDefense = entityDisguised.BattleStats.BaseDefense;

                //Handle marking that it's airborne
                if (entityDisguised.HeightState == Enumerations.HeightStates.Airborne)
                {
                    DuplighostRef.ChangeHeightState(entityDisguised.HeightState);
                    DuplighostRef.SetBattlePosition(DuplighostRef.BattlePosition - new Vector2(0f, BattleGlobals.AirborneY));
                    DuplighostRef.Position = DuplighostRef.BattlePosition;
                }

                CurSequenceAction = new WaitSeqAction(DisguiseWaitDur);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #4
0
 public ContactResultInfo(StatusGlobals.PaybackHolder paybackHolder, Enumerations.ContactResult contactResult)
 {
     Paybackholder = paybackHolder;
     ContactResult = contactResult;
 }