Exemple #1
0
        /// <summary>
        /// Removes the Duplighost's disguise.
        /// <para>If it's already disguised, make sure to remove its disguise first before disguising as something else.</para>
        /// </summary>
        public void RemoveDisguise()
        {
            //If the Duplighost isn't disguised, there's no disguise to remove
            if (IsDisguised == false)
            {
                return;
            }

            //Revert back to original Defense and attributes
            //NOTE: We may want to copy attributes and defense back...it's hard to tell with all the modifications that could be made, though
            //This normally isn't a problem because Partners can't be inflicted with Status Effects (barring Injured) or anything else in PM
            BattleStats.BaseDefense = 0;

            //Change back to Grounded if not Grounded
            if (HeightState != HeightStates.Grounded)
            {
                ChangeHeightState(HeightStates.Grounded);

                //Move the Duplighost back down
                SetBattlePosition(BattlePosition + new Vector2(0f, BattleManager.Instance.AirborneY));
                if (PreviousAction?.MoveSequence.InSequence == false)
                {
                    Position = BattlePosition;
                }
            }

            if (PartnerTypeDisguise == PartnerTypes.Watt)
            {
                //If it copied Watt, remove Electrified, its light source, and its Payback
                EntityProperties.RemovePhysAttribute(PhysicalAttributes.Electrified);
                EntityProperties.RemoveAdditionalProperty(AdditionalProperty.LightSource);
            }

            //Remove any Payback it obtained, if it had any
            if (PaybackCopied != null)
            {
                EntityProperties.RemovePayback(PaybackCopied.Value);
                PaybackCopied = null;
            }

            //Clean up its Flippable behavior if it copied a shelled Partner
            if (FlippableBehavior != null)
            {
                if (FlippableBehavior.Flipped == true)
                {
                    FlippableBehavior.UnFlip();
                }
                FlippableBehavior.CleanUp();
                FlippableBehavior = null;
            }

            PartnerTypeDisguise = PartnerTypes.None;

            //Make the Duplighost copy back its original animations
            CopyEntityAnimations(OrigAnimations);
            AnimManager.PlayAnimation(GetIdleAnim());
        }
        public override void CleanUp()
        {
            base.CleanUp();

            FlippedBehavior?.CleanUp();
        }