Ejemplo n.º 1
0
        public TDCOrb(bool mIsBroken, int mHealth, TDCRender mRenderComponent, TDCIDCaller mIDCallerComponent)
        {
            _isBroken = mIsBroken;
            _health = mHealth;
            _renderComponent = mRenderComponent;
            _idCallerComponent = mIDCallerComponent;

            mRenderComponent.OnDraw += Draw;
        }
Ejemplo n.º 2
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.º 3
0
        public static Entity Orb(List<int> mTargetIDs = default(List<int>), List<int> mTargetEffects = default(List<int>), bool mIsBroken = false, int mHealth = 2)
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Orb};

            var cRender = TDLComponentFactory.Render(@"elements\orb", "orbtiles", "on");
            var cIDCaller = new TDCIDCaller(mTargetIDs, mTargetEffects);
            var cOrb = new TDCOrb(mIsBroken, mHealth, cRender, cIDCaller);
            var cHitByWeapon = new TDCHitByWeapon(cOrb.Struck);

            if (mIsBroken) TDLMethods.AttachCrackedOverlay(cRender, mHealth >= 2 ? 0 : 1);

            result.AddTags(TDLTags.Solid, TDLTags.HitByWeapon, TDLTags.GroundPathmapObstacle);
            result.AddComponents(cRender, cHitByWeapon, cIDCaller, cOrb);

            return result;
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
 public void RecieveCall(TDCIDCaller mCaller, int mEffect)
 {
     if (OnCallRecieved != null) OnCallRecieved.Invoke(mEffect);
 }