예제 #1
0
        public override int Execute(LogicLevel level)
        {
            LogicBuilding allianceCastle = level.GetGameObjectManagerAt(0).GetAllianceCastle();

            if (allianceCastle != null)
            {
                LogicBunkerComponent bunkerComponent = allianceCastle.GetBunkerComponent();

                if (bunkerComponent != null && bunkerComponent.GetRequestCooldownTime() == 0)
                {
                    LogicAvatar homeOwnerAvatar = level.GetHomeOwnerAvatar();

                    homeOwnerAvatar.GetChangeListener().RequestAllianceUnits(allianceCastle.GetUpgradeLevel(),
                                                                             bunkerComponent.GetUsedCapacity(),
                                                                             bunkerComponent.GetMaxCapacity(),
                                                                             homeOwnerAvatar.GetAllianceCastleUsedSpellCapacity(),
                                                                             homeOwnerAvatar.GetAllianceCastleTotalSpellCapacity(),
                                                                             this.m_message);

                    bunkerComponent.StartRequestCooldownTime();

                    return(0);
                }
            }

            return(-1);
        }