コード例 #1
0
        public override void OnBattleStart()
        {
            base.OnBattleStart();

            //Set battle position
            Vector2 battlepos = BattleManager.Instance.EnemyStartPos + new Vector2(BattleManager.Instance.PositionXDiff * BattleIndex, 0);

            if (HeightState == Enumerations.HeightStates.Airborne)
            {
                battlepos.Y -= BattleManager.Instance.AirborneY;
            }
            else if (HeightState == Enumerations.HeightStates.Ceiling)
            {
                battlepos.Y -= BattleManager.Instance.CeilingY;
            }

            SetBattlePosition(battlepos);
            Position = BattlePosition;

            //Equip the held Badge, if one is held
            if (HeldCollectible?.CollectibleType == Enumerations.CollectibleTypes.Badge)
            {
                Badge heldBadge = (Badge)HeldCollectible;
                heldBadge.Equip(this);
            }

            //Check if the enemy has an entry in the Tattle table
            //If so, mark it to show its HP
            if (TattleDatabase.HasTattleDescription(Name) == true)
            {
                this.AddShowHPProperty();
            }
        }
コード例 #2
0
        public override void OnEnteredBattle()
        {
            //The Mini-Yux's BattlePosition is set by the Yux, so do everything aside from that

            //Equip the held Badge, if one is held
            if (HeldCollectible?.CollectibleType == Enumerations.CollectibleTypes.Badge)
            {
                Badge heldBadge = (Badge)HeldCollectible;
                heldBadge.Equip(this);
            }

            //Check if the enemy has an entry in the Tattle table
            //If so, mark it to show its HP
            if (TattleDatabase.HasTattleDescription(Name) == true)
            {
                this.AddShowHPProperty();
            }
        }
コード例 #3
0
        /// <summary>
        /// Sets the held Collectible for the enemy. Enemies in TTYD can hold Items and Badges.
        /// <para>If setting a Badge, this will unequip the current Badge from the enemy, provided the held Collectible is a Badge, and equip the new Badge.</para>
        /// </summary>
        /// <param name="heldCollectible">The Collectible to hold.</param>
        public void SetHeldCollectible(Collectible heldCollectible)
        {
            //Unequip the current badge held, if one is held
            if (HeldCollectible?.CollectibleType == Enumerations.CollectibleTypes.Badge)
            {
                Badge heldBadge = (Badge)HeldCollectible;
                heldBadge.UnEquip();
            }

            //Set the collectible
            HeldCollectible = heldCollectible;

            //Equip the held Badge, if one is held
            if (HeldCollectible?.CollectibleType == Enumerations.CollectibleTypes.Badge)
            {
                Badge heldBadge = (Badge)HeldCollectible;
                heldBadge.Equip(this);
            }
        }
コード例 #4
0
        public override void OnBattleStart()
        {
            base.OnBattleStart();

            //Equip the held Badge, if one is held
            if (HeldCollectible?.CollectibleType == Enumerations.CollectibleTypes.Badge)
            {
                Badge heldBadge = (Badge)HeldCollectible;
                if (heldBadge.AffectedType == BadgeGlobals.AffectedTypes.Self || heldBadge.AffectedType == BadgeGlobals.AffectedTypes.Both)
                {
                    heldBadge.Equip(this);
                }
            }

            //Check if the enemy has an entry in the Tattle table
            //If so, mark it to show its HP
            if (TattleDatabase.HasTattleDescription(Name) == true)
            {
                this.AddShowHPProperty();
            }
        }