Ejemplo n.º 1
0
        public TDCOremites(TDCSpecialSquare mSpecialSquareComponent)
        {
            _specialSquareComponent = mSpecialSquareComponent;

            _specialSquareComponent.OnMoveFromAllowed += SpecialSquareFrom;
            _specialSquareComponent.OnMoveToAllowed += SpecialSquareTo;
        }
Ejemplo n.º 2
0
        public TDCOrthogonalSquare(TDCSpecialSquare mSpecialSquareComponent, TDCSwitch mSwitchComponent)
        {
            _switchComponent = mSwitchComponent;

            mSpecialSquareComponent.OnMoveFromAllowed += SpecialSquareMove;
            mSpecialSquareComponent.OnMoveToAllowed += SpecialSquareMove;
        }
Ejemplo n.º 3
0
        public TDCTrapdoor(bool mIsOnWater, bool mIsBroken, TDCSpecialSquare mSpecialSquareComponent, TDCSwitch mSwitchComponent)
        {
            _isOnWater = mIsOnWater;
            _isBroken = mIsBroken;
            _switchComponent = mSwitchComponent;

            mSpecialSquareComponent.OnMoveFromAllowed += SpecialSquareMove;
        }
Ejemplo n.º 4
0
        public TDCBooster(TDCDirection mDirectionComponent, TDCSwitch mSwitchComponent, TDCSpecialSquare mSpecialSquareComponent)
        {
            _directionComponent = mDirectionComponent;
            _switchComponent = mSwitchComponent;
            _specialSquareComponent = mSpecialSquareComponent;

            _specialSquareComponent.OnMoveFromAllowed += SpecialSquareFrom;
        }
Ejemplo n.º 5
0
        public TDCArrow(TDCSpecialSquare mSpecialSquareComponent, TDCDirection mDirectionComponent, TDCSwitch mSwitchComponent)
        {
            _directionComponent = mDirectionComponent;
            _switchComponent = mSwitchComponent;

            mSpecialSquareComponent.OnMoveFromAllowed += SpecialSquareMove;
            mSpecialSquareComponent.OnMoveToAllowed += SpecialSquareMove;
        }
Ejemplo n.º 6
0
        public TDCHotTile(TDCSpecialSquare mSpecialSquareComponent, int mTurnsToBurn)
        {
            _specialSquareComponent = mSpecialSquareComponent;
            _onMeEntities = new List<Entity>();
            _onMeTurnsToBurn = new List<int>();
            _turnsToBurn = mTurnsToBurn;

            _specialSquareComponent.OnMoveFromAllowed += SpecialSquareFrom;
            _specialSquareComponent.OnMoveToAllowed += SpecialSquareTo;
        }
Ejemplo n.º 7
0
        public TDCTunnel(TDCRender mRenderComponent, TDCDirection mDirectionComponent, TDCSpecialSquare mSpecialSquareComponent)
        {
            _renderComponent = mRenderComponent;
            _directionComponent = mDirectionComponent;
            _specialSquareComponent = mSpecialSquareComponent;

            _renderComponent.OnDraw += Draw;
            _specialSquareComponent.OnMoveFromAllowed += SpecialSquareFrom;
            _specialSquareComponent.OnMoveToAllowed += SpecialSquareTo;
        }
Ejemplo n.º 8
0
        public TDCPressurePlate(PressurePlateType mPressurePlateType, TDCRender mRenderComponent, TDCFloodFiller mFloodFillerComponent,
                                TDCIDCaller mIDCallerComponent, TDCSpecialSquare mSpecialSquareComponent, string mTriggeredLabel, string mUntriggeredLabel)
        {
            _pressurePlateType = mPressurePlateType;
            _renderComponent = mRenderComponent;
            _floodFillerComponent = mFloodFillerComponent;
            _idCallerComponent = mIDCallerComponent;
            _specialSquareComponent = mSpecialSquareComponent;
            _triggeredLabel = mTriggeredLabel;
            _unTriggeredLabel = mUntriggeredLabel;

            _renderComponent.OnDraw += Draw;
            _specialSquareComponent.OnMoveToAllowed += SpecialSquareBehavior;
        }
Ejemplo n.º 9
0
        public static Entity Arrow(int mDirection = 0, bool mIsOff = false, List<int> mIDs = default(List<int>))
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow, UpdateOrder = TDLOrders.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"environment\arrow", "onoffdirtiles", "on_n");
            var cDirection = new TDCDirection(mDirection);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Arrow);
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = new TDCSwitch(cRender, mIsOff);
            cSwitch.SetOffTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("off_" + cDirection.DirectionString));
            cSwitch.SetOnTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("on_" + cDirection.DirectionString));
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cArrow = new TDCArrow(cSpecialSquare, cDirection, cSwitch);

            cSwitch.OnlyOnTags.Add(TDLTags.GroundPathmapObstacle);

            result.AddTags(TDLTags.Arrow);
            result.AddComponents(cRender, cDirection, cSpecialSquare, cID, cSwitch, cIDSwitchAI, cArrow);

            return result;
        }
Ejemplo n.º 10
0
        public static Entity Trapdoor(bool mIsOff = false, List<int> mIDs = default(List<int>), bool mIsOnWater = false, bool mIsBroken = false)
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Trapdoor, UpdateOrder = TDLOrders.Trapdoor};

            var trapdoorTexture = @"environment\trapdoor";
            if (mIsOnWater) trapdoorTexture = @"environment\watertrapdoor";

            var cRender = TDLComponentFactory.Render(trapdoorTexture, "onofftiles", "on");
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = TDLComponentFactory.Switch(cRender, mIsOff);
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cTrapdoor = new TDCTrapdoor(mIsOnWater, mIsBroken, cSpecialSquare, cSwitch);

            if (mIsBroken) TDLMethods.AttachCrackedOverlay(cRender, 0);

            result.AddTags(TDLTags.GroundWalkable, TDLTags.Trapdoor);
            result.AddComponents(cRender, cID, cSwitch, cIDSwitchAI, cSpecialSquare, cTrapdoor);

            return result;
        }
Ejemplo n.º 11
0
 public TDCWeaponSlot(TDCSpecialSquare mSpecialSquareComponent, TDCRender mRenderComponent)
 {
     _renderComponent = mRenderComponent;
     mSpecialSquareComponent.OnMoveToAllowed += SpecialSquareMove;
 }
Ejemplo n.º 12
0
        public static Entity HotTile(int mTurnsToBurn = 2)
        {
            var result = new Entity(Tile) {UpdateOrder = TDLOrders.Trapdoor, Layer = TDLLayers.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"environment\hottile", "doortiles", "single");
            var cRecalculateSprites = new TDCRecalculateSprites(TDLTags.HotTile, TDLRecalculations.RecalculateDoorSprite);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cHotTile = new TDCHotTile(cSpecialSquare, mTurnsToBurn);

            result.AddTags(TDLTags.HotTile);
            result.AddComponents(cRender, cSpecialSquare, cRecalculateSprites, cHotTile);

            return result;
        }
Ejemplo n.º 13
0
        public static Entity Oremites()
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"environment\oremites", "doortiles", "single");
            var cRecalculateSprites = new TDCRecalculateSprites(TDLTags.Oremites, TDLRecalculations.RecalculateDoorSprite);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Oremites);
            var cOremites = new TDCOremites(cSpecialSquare);

            result.AddTags(TDLTags.Oremites);
            result.AddComponents(cRender, cSpecialSquare, cOremites, cRecalculateSprites);

            return result;
        }
Ejemplo n.º 14
0
        public static Entity OrthogonalSquare(bool mIsOff = false, List<int> mIDs = default(List<int>))
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow, UpdateOrder = TDLOrders.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"environment\orthogonalsquare", "onofftiles", "on");
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Arrow);
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = TDLComponentFactory.Switch(cRender, mIsOff);
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cOrthogonalSquare = new TDCOrthogonalSquare(cSpecialSquare, cSwitch);

            result.AddTags(TDLTags.OrthogonalSquare);
            result.AddComponents(cRender, cSpecialSquare, cID, cSwitch, cIDSwitchAI, cOrthogonalSquare);

            return result;
        }
Ejemplo n.º 15
0
        public static Entity Booster(int mDirection = 0, bool mIsOff = false, List<int> mIDs = default(List<int>))
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow};

            var cRender = TDLComponentFactory.Render(@"elements\booster", "onoffdirtiles", "on_n");
            var cDirection = new TDCDirection(mDirection);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = new TDCSwitch(cRender, mIsOff);
            cSwitch.SetOffTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("off_" + cDirection.DirectionString));
            cSwitch.SetOnTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("on_" + cDirection.DirectionString));
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cBooster = new TDCBooster(cDirection, cSwitch, cSpecialSquare);

            result.AddTags(TDLTags.Booster);
            result.AddComponents(cRender, cSpecialSquare, cDirection, cID, cSwitch, cIDSwitchAI, cBooster);

            return result;
        }
Ejemplo n.º 16
0
        public static Entity WeaponSlot(bool mIsOff = false, List<int> mIDs = default(List<int>), string mWeapon = "")
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow, UpdateOrder = TDLOrders.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"elements\weaponslot", "onofftiles", "on");
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = TDLComponentFactory.Switch(cRender, mIsOff);
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cWeaponSlot = new TDCWeaponSlot(cSpecialSquare, cRender);

            cRender.AddBlankSprite();

            if (mWeapon == "reallybigsword") cWeaponSlot.Weapon = ReallyBigSword();
            else if (mWeapon == "shortsword") cWeaponSlot.Weapon = ShortSword();
            else if (mWeapon == "woodensword") cWeaponSlot.Weapon = WoodenSword();

            if (cWeaponSlot.Weapon != null) cWeaponSlot.Weapon.IsOutOfField = true;
            cWeaponSlot.RecalculateWeaponSprite();

            result.AddTags(TDLTags.WeaponSlot);
            result.AddComponents(cRender, cSpecialSquare, cID, cSwitch, cIDSwitchAI, cWeaponSlot);

            return result;
        }
Ejemplo n.º 17
0
        public static Entity Tunnel(int mDirection = 0)
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow};

            var cRender = TDLComponentFactory.Render(@"elements\tunnel");
            var cDirection = new TDCDirection(mDirection);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cTunnel = new TDCTunnel(cRender, cDirection, cSpecialSquare);

            result.AddTags(TDLTags.Tunnel, TDLTags.GroundPathmapObstacle);
            result.AddComponents(cRender, cSpecialSquare, cDirection, cTunnel);

            return result;
        }
Ejemplo n.º 18
0
        public static Entity PressurePlateSingleUse(List<int> mTargetIDs = default(List<int>), List<int> mTargetEffects = default(List<int>))
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Floor, UpdateOrder = TDLOrders.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"environment\pressureplate", "pressureplatetiles", "single");
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cIDCaller = new TDCIDCaller(mTargetIDs, mTargetEffects);
            var cFloodFiller = new TDCFloodFiller(TDLTags.PressurePlateSingleUse);
            var cPressurePlate = new TDCPressurePlate(TDCPressurePlate.PressurePlateType.Single, cRender, cFloodFiller, cIDCaller, cSpecialSquare, "triggered_single", "single");

            result.AddTags(TDLTags.PressurePlateSingleUse);
            result.AddComponents(cRender, cPressurePlate, cSpecialSquare, cIDCaller, cFloodFiller);

            return result;
        }