コード例 #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;

            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,
                                        matchedSequence.Select(context.GetTargetTile), matchedSequence.Select(x => x.GetActionStateX()));

            res.Graphics = new CubeGraphic
            {
                Position  = res.Position,
                DrawFaces = CubeFaces.All,
                Outter    = true,
                Scale     = new Vector3(0.2f),
                Texture   = context.GetTexture(matchedSequence.First(), putOnWall: false)
            };
            return(res);
        }
コード例 #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)
        {
            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()));
        }
コード例 #6
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
        {

            IConstrain constrain = null;
            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,
                matchedSequence.Select(context.GetTargetTile), matchedSequence.Select(x => x.GetActionStateX()));

            res.Graphics = new CubeGraphic
            {
                Position = res.Position,
                DrawFaces = CubeFaces.All,
                Outter = true,
                Scale = new Vector3(0.2f),
                Texture = context.GetTexture(matchedSequence.First(), putOnWall:false) 
            };
            return res;
        }
コード例 #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);
        }
コード例 #8
0
 public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence)
 {
     return(new DecorationItem(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), context.FloorTextures[matchedSequence[0].Decoration - 1]));
 }
コード例 #9
0
 public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
 {
     return new DecorationItem(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), context.FloorTextures[matchedSequence[0].Decoration - 1]);
 }