コード例 #1
0
ファイル: TPCIFactory.cs プロジェクト: ggrrin/DungeonMaster
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
        {



            IConstrain constrain = null;
            Tile targetTile = null;
            Texture2D decoration = null;
            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: false);

            var res = new FloorActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile,
                new OrConstrain(new IConstrain[] { new PartyConstrain(), new TypeConstrain(typeof(Creature)), new TypeConstrain(typeof(GrabableItem)) }),
                targetTile.ToEnumerable(), matchedSequence[0].GetActionStateX().ToEnumerable());

            //TODO 14 28 actuator sends Clear message to pit(which open the pit => should be close) 
            res.Graphics = new CubeGraphic
            {
                Position = res.Position,
                DrawFaces = CubeFaces.All,
                Outter = true,
                Scale = new Vector3(0.2f),
                Texture = decoration
            };
            return res;
        }
コード例 #2
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence)
        {
            IConstrain constrain  = null;
            Tile       targetTile = null;
            Texture2D  decoration = null;

            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: false);

            if (matchedSequence[0].Data == 0)
            {
                constrain = new PartyConstrain();
            }
            else
            {
                constrain = new PartDirectionConstrain((MapDirection)(matchedSequence[0].Data - 1));
            }

            var res = new FloorActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile, constrain, targetTile.ToEnumerable(),
                                        matchedSequence[0].GetActionStateX().ToEnumerable());

            res.Graphics = new CubeGraphic
            {
                Position  = res.Position,
                DrawFaces = CubeFaces.All,
                Outter    = true,
                Scale     = new Vector3(0.2f),
                Texture   = decoration
            };
            return(res);
        }
コード例 #3
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
        {
            IConstrain constrain = null;
            Tile targetTile = null;
            Texture2D decoration = null;
            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: false);

            return new PartyPossesionActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile,
                constrain, targetTile.ToEnumerable(), matchedSequence[0].GetActionStateX().ToEnumerable());

        }
コード例 #4
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence)
        {
            IConstrain constrain  = null;
            Tile       targetTile = null;
            Texture2D  decoration = null;

            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: false);

            return(new PartyPossesionActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile,
                                              constrain, targetTile.ToEnumerable(), matchedSequence[0].GetActionStateX().ToEnumerable()));
        }
コード例 #5
0
 public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
 {
     Texture2D decoration;
     IConstrain constrain;
     Tile targetTile;
     context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: true);
     return new KeyHoleActuator(context.GetWallPosition(matchedSequence[0].TilePosition, context.WallActuatorCreator.CurrentTile),
         Enumerable.Repeat(targetTile,1), Enumerable.Repeat(matchedSequence[0].GetActionStateX(),1), constrain, destroyItem: true)
     {
         DecorationTexture = decoration
     };
 }
コード例 #6
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence)
        {
            Texture2D  decoration;
            IConstrain constrain;
            Tile       targetTile;

            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: true);
            return(new KeyHoleActuator(context.GetWallPosition(matchedSequence[0].TilePosition, context.WallActuatorCreator.CurrentTile),
                                       Enumerable.Repeat(targetTile, 1), Enumerable.Repeat(matchedSequence[0].GetActionStateX(), 1), constrain, destroyItem: true)
            {
                DecorationTexture = decoration
            });
        }
コード例 #7
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence)
        {
            IConstrain constrain  = null;
            Tile       targetTile = null;
            Texture2D  decoration = null;

            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: false);

            var res = new FloorActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile,
                                        new OrConstrain(new IConstrain[] { new PartyConstrain(), new TypeConstrain(typeof(Creature)), new TypeConstrain(typeof(GrabableItem)) }),
                                        targetTile.ToEnumerable(), matchedSequence[0].GetActionStateX().ToEnumerable());

            //TODO 14 28 actuator sends Clear message to pit(which open the pit => should be close)
            res.Graphics = new CubeGraphic
            {
                Position  = res.Position,
                DrawFaces = CubeFaces.All,
                Outter    = true,
                Scale     = new Vector3(0.2f),
                Texture   = decoration
            };
            return(res);
        }