public TDCWielderRenderAI(TDCWielder mWielderComponent, TDCRender mRenderComponent, TDCRenderDirectionAI mRenderDirectionAIComponent)
        {
            _wielderComponent = mWielderComponent;
            _renderDirectionAIComponent = mRenderDirectionAIComponent;

            mRenderComponent.OnDraw += RenderSheated;
        }
 public static TDCSwitch SwitchTexture(TDCRender mRenderComponent, bool mIsOff, string mOffTexture, string mOnTexture)
 {
     return new TDCSwitch(mRenderComponent, mIsOff)
            {
                OffTextureName = mOffTexture,
                OnTextureName = mOnTexture
            };
 }
        public static TDCSwitch Switch(TDCRender mRenderComponent, bool mIsOff, string mTilesetName = "onofftiles", string mOffLabel = "off", string mOnLabel = "on")
        {
            var result = new TDCSwitch(mRenderComponent, mIsOff);

            result.SetOffTextureRect(Assets.GetTileset(mTilesetName).GetTextureRect(mOffLabel));
            result.SetOnTextureRect(Assets.GetTileset(mTilesetName).GetTextureRect(mOnLabel));

            return result;
        }
Exemple #4
0
        public TDCSwitch(TDCRender mRenderComponent, bool mIsOff = false, int mSpriteIndex = 0)
        {
            IsOff = mIsOff;
            _renderComponent = mRenderComponent;
            _spriteIndex = mSpriteIndex;

            OnlyOnTags = new List<string>();
            OnlyOffTags = new List<string>();
        }
Exemple #5
0
        public TDCOrb(bool mIsBroken, int mHealth, TDCRender mRenderComponent, TDCIDCaller mIDCallerComponent)
        {
            _isBroken = mIsBroken;
            _health = mHealth;
            _renderComponent = mRenderComponent;
            _idCallerComponent = mIDCallerComponent;

            mRenderComponent.OnDraw += Draw;
        }
Exemple #6
0
        public TDCEgg(TDCRender mRenderComponent, int mTurnsToHatch, bool mFriendly = false)
        {
            _renderComponent = mRenderComponent;

            TurnsToHatch = mTurnsToHatch;
            Friendly = mFriendly;

            _renderComponent.OnDraw += Draw;
        }
Exemple #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;
        }
        public TDCRenderDirectionAI(TDCRender mRenderComponent, TDCDirection mDirectionComponent, string mTilesetName, string mPrefix = "", string mSuffix = "")
        {
            _renderComponent = mRenderComponent;
            _directionComponent = mDirectionComponent;
            TilesetName = mTilesetName;
            Prefix = mPrefix;
            Suffix = mSuffix;

            _renderComponent.OnDraw += () => _renderComponent.GetSprites().ForEach(x => x.TextureRect = Assets.GetTileset(TilesetName).GetTextureRect(Prefix + _directionComponent.DirectionString + Suffix));
        }
        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 TDCWeaponSlot(TDCSpecialSquare mSpecialSquareComponent, TDCRender mRenderComponent)
 {
     _renderComponent = mRenderComponent;
     mSpecialSquareComponent.OnMoveToAllowed += SpecialSquareMove;
 }
Exemple #11
0
 public static void AttachCrackedOverlay(TDCRender mRenderComponent, int mX)
 {
     mRenderComponent.AddSprite(Assets.GetTileset("brokenoverlaytiles").GetSprite(mX, 0,
                                                                                Assets.GetTexture(@"environment\crackedoverlay")));
 }
Exemple #12
0
 public static void AttachBrokenOverlay(TDCRender mRenderComponent)
 {
     mRenderComponent.AddSprite(Assets.GetTileset("brokenoverlaytiles").GetSprite(Utils.Random.Next(0, 3),
                                                                                Utils.Random.Next(0, 3),
                                                                                Assets.GetTexture(@"environment\brokenoverlay")));
 }
Exemple #13
0
        public static Entity Player(int mDirection = 0)
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Roach, UpdateOrder = TDLOrders.Player};

            var outline1 = new TDCRenderSpriteOutline("humanoidtiles", @"humanoid\body\yellow", "n");
            var outline2 = new TDCRenderSpriteOutline("humanoidtiles", @"humanoid\hands\pink", "n");
            var outline3 = new TDCRenderSpriteOutline("humanoidtiles", @"humanoid\head\pink", "n");

            var cRender = new TDCRender(outline1, outline2, outline3) {IsLerped = true};
            var cDirection = new TDCDirection(mDirection);
            var cTarget = new TDCTarget();
            var cHitByWeapon = new TDCHitByWeapon(TDCHitByWeapon.HitActions.Kill);
            var cMovement = new TDCMovement(TDCMovement.MovementType.Direct, TDLTags.GroundAllowedTags, TDLTags.GroundObstacleTags, TDLTags.GroundExceptionTags);
            var cRenderDirectionAI = new TDCRenderDirectionAI(cRender, cDirection, "humanoidtiles");
            var cWielder = new TDCWielder(cMovement, cDirection);
            var cPathmapper = new TDCPathmapper(Instance, TDLPathmaps.SideGood);
            var cPlayer = new TDCPlayer(Game, cMovement, cDirection, cWielder);
            var cRoomSwitch = new TDCRoomSwitch(Game, cMovement);
            var cWielderRenderAI = new TDCWielderRenderAI(cWielder, cRender, cRenderDirectionAI);

            result.AddTags(TDLTags.Solid, TDLTags.Humanoid, TDLTags.SideGood, TDLTags.HitByWeapon,
                           TDLTags.Player, TDLTags.TunnelUser, TDLTags.WeightLow, TDLTags.BoosterUser);
            result.AddComponents(cRender, cDirection, cTarget, cHitByWeapon, cPlayer, cMovement, cRenderDirectionAI,
                                 cWielder, cPathmapper, cRoomSwitch, cWielderRenderAI);

            cWielder.SetWeapon(ReallyBigSword());

            /*cMovement.OnMovementFail += () =>
                                        {
                                            // This is only to prevent wall bump sounds if using a tunnel or a booster
                                            var x = cMovement.TargetX;
                                            var y = cMovement.TargetY;

                                            if (result.Field.HasEntityByTag(result.X, result.Y, TDLTags.Tunnel)) return;
                                            if (result.Field.HasEntityByTag(result.X, result.Y, TDLTags.Booster)) return;

                                            if (result.Field.HasEntityByTag(x, y, TDLTags.Wall)) TDLSounds.Play("SoundWallBump");
                                            else if (result.Field.HasEntityByTag(x, y, TDLTags.Pit)) TDLSounds.Play("SoundPitBump");
                                        };*/

            return result;
        }
Exemple #14
0
        public static Entity Guard(int mDirection = 0)
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Roach, UpdateOrder = TDLOrders.Guard};

            var outline1 = new TDCRenderSpriteOutline("humanoidtiles", @"humanoid\body\red", "n");
            var outline2 = new TDCRenderSpriteOutline("humanoidtiles", @"humanoid\hands\pink", "n");
            var outline3 = new TDCRenderSpriteOutline("humanoidtiles", @"humanoid\head\pink", "n");

            var cRender = new TDCRender(outline1, outline2, outline3) {IsLerped = true};
            var cDirection = new TDCDirection(mDirection);
            var cTarget = new TDCTarget(TDLTags.MonsterTargetTags);
            var cHitByWeapon = new TDCHitByWeapon(TDCHitByWeapon.HitActions.Kill);
            var cMovement = new TDCMovement(TDCMovement.MovementType.FlexibleNormal, TDLTags.GroundAllowedTags, TDLTags.GroundObstacleTags, TDLTags.GroundExceptionTags);
            var cRenderDirectionAI = new TDCRenderDirectionAI(cRender, cDirection, "humanoidtiles");
            var cWielder = new TDCWielder(cMovement, cDirection);
            var cWielderTargetAI = new TDCWielderTargetAI(cTarget, cMovement, cDirection, cWielder);
            var cMovementTargetAI = new TDCMovementTargetAI(Instance, cMovement, cTarget, cDirection, TDLPathmaps.SideGood, false, true);
            var cPathmapper = new TDCPathmapper(Instance, TDLPathmaps.SideBad);
            var cWielderRenderAI = new TDCWielderRenderAI(cWielder, cRender, cRenderDirectionAI);

            result.AddTags(TDLTags.Solid, TDLTags.Humanoid, TDLTags.SideBad, TDLTags.HitByWeapon,
                           TDLTags.WeightLow, TDLTags.BoosterUser, TDLTags.RequiredKill, TDLTags.Guard);
            result.AddComponents(cRender, cDirection, cTarget, cHitByWeapon,
                                 cWielderTargetAI, cMovementTargetAI, cMovement, cRenderDirectionAI, cWielder, cPathmapper,
                                 cWielderRenderAI);

            cWielder.SetWeapon(WoodenSword());

            return result;
        }