예제 #1
0
        public TacticPerimeterDefense(Team team)
            : base(team)
        {
            Scene        scene        = Mission.Current.Scene;
            FleePosition fleePosition = Mission.Current.GetFleePositionsForSide(BattleSideEnum.Defender).FirstOrDefault <FleePosition>((Func <FleePosition, bool>)(fp => fp.GetSide() == BattleSideEnum.Defender));

            this._defendPosition = fleePosition == null ? WorldPosition.Invalid : fleePosition.GameEntity.GlobalPosition.ToWorldPosition();
            this._enemyClusters  = new List <TacticPerimeterDefense.EnemyCluster>();
            this._defenseFronts  = new List <TacticPerimeterDefense.DefenseFront>();
        }
        protected internal override void OnInit()
        {
            this.CollectNodes();
            bool flag = false;

            this._side = !(this.Side == "both") ? (!(this.Side == "attacker") ? (!(this.Side == "defender") ? BattleSideEnum.None : (flag ? BattleSideEnum.Attacker : BattleSideEnum.Defender)) : (flag ? BattleSideEnum.Defender : BattleSideEnum.Attacker)) : BattleSideEnum.None;
            if (this.GameEntity.HasTag("sally_out"))
            {
                if (!FleePosition.IsSallyOut())
                {
                    return;
                }
                Mission.Current.AddFleePosition(this);
            }
            else
            {
                Mission.Current.AddFleePosition(this);
            }
        }