public TDCOrb(bool mIsBroken, int mHealth, TDCRender mRenderComponent, TDCIDCaller mIDCallerComponent) { _isBroken = mIsBroken; _health = mHealth; _renderComponent = mRenderComponent; _idCallerComponent = mIDCallerComponent; mRenderComponent.OnDraw += Draw; }
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; }
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; }
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; }
public void RecieveCall(TDCIDCaller mCaller, int mEffect) { if (OnCallRecieved != null) OnCallRecieved.Invoke(mEffect); }