示例#1
0
        public static Entity RoachQueen(int mDirection = 0, int mSpawnTurns = 30)
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Roach, UpdateOrder = TDLOrders.Roach};

            var cRender = TDLComponentFactory.Render(@"monster\roachqueen", "roachtiles", "n", 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.BeelineNormal, TDLTags.GroundAllowedTags, TDLTags.GroundObstacleTags, TDLTags.GroundExceptionTags) {IsReverse = true};
            var cMovementTargetAI = new TDCMovementTargetAI(Instance, cMovement, cTarget, cDirection, TDLPathmaps.SideGood);
            var cRenderDirectionAI = new TDCRenderDirectionAI(cRender, cDirection, "roachtiles");
            var cPathmapper = new TDCPathmapper(Instance, TDLPathmaps.SideBad);
            var cRoachQueen = new TDCRoachQueen(false, mSpawnTurns);

            result.AddTags(TDLTags.Solid, TDLTags.SideBad, TDLTags.HitByWeapon,
                           TDLTags.RequiredKill, TDLTags.BoosterUser, TDLTags.WeightLow, TDLTags.AffectedByBrain);
            result.AddComponents(cRender, cDirection, cTarget, cHitByWeapon,
                                 cMovementTargetAI, cMovement, cRenderDirectionAI, cPathmapper, cRoachQueen);

            return result;
        }
示例#2
0
        public static Entity RoachEgg()
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Roach, UpdateOrder = TDLOrders.Roach};

            var cRender = TDLComponentFactory.Render(@"monster\roachegg", "roachtiles", "n", true);
            var cHitByWeapon = new TDCHitByWeapon(TDCHitByWeapon.HitActions.Kill);
            var cEgg = new TDCEgg(cRender, 4);
            var cPathmapper = new TDCPathmapper(Instance, TDLPathmaps.SideBad);

            result.AddTags(TDLTags.Solid, TDLTags.SideBad, TDLTags.HitByWeapon, TDLTags.RequiredKill);
            result.AddComponents(cRender, cHitByWeapon, cEgg, cPathmapper);

            return result;
        }
示例#3
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;
        }
示例#4
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;
        }
示例#5
0
        public static Entity Brain()
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Roach, UpdateOrder = TDLOrders.Roach};

            var cRender = TDLComponentFactory.Render(@"monster\brain", true);
            var cHitByWeapon = new TDCHitByWeapon(TDCHitByWeapon.HitActions.KillBrain);
            var cPathmapper = new TDCPathmapper(Instance, TDLPathmaps.SideBad);

            result.AddTags(TDLTags.Solid, TDLTags.SideBad, TDLTags.HitByWeapon,
                           TDLTags.RequiredKill, TDLTags.WeightLow, TDLTags.Brain);
            result.AddComponents(cRender, cHitByWeapon, cPathmapper);

            result.Field.TurnActions[TDLTurnActions.StartBrainCheck] += () => TDLMethods.CheckForBrains(result.Field);

            return result;
        }