Exemplo n.º 1
0
        public bool IsPassable(CPos p1, CPos p2, MobileInfo mi, uint movementClass)
        {
            if (p1.Layer != 0 || p2.Layer != 0)
            {
                return(true);
            }

            if (mi.Subterranean || mi.Jumpjet)
            {
                return(true);
            }
            return(domainIndexes[movementClass].IsPassable(p1, p2));
        }
Exemplo n.º 2
0
        bool ValidTransitionCell(CPos cell, MobileInfo mi)
        {
            var terrainType = map.GetTerrainInfo(cell).Type;

            if (!mi.SubterraneanTransitionTerrainTypes.Contains(terrainType) && mi.SubterraneanTransitionTerrainTypes.Any())
            {
                return(false);
            }

            if (mi.SubterraneanTransitionOnRamps)
            {
                return(true);
            }

            var tile = map.Tiles[cell];
            var ti   = map.Rules.TileSet.GetTileInfo(tile);

            return(ti != null || ti.RampType == 0);
        }
Exemplo n.º 3
0
 internal WorldMovementInfo(World world, MobileInfo info)
 {
     World        = world;
     TerrainInfos = info.TilesetTerrainInfo[world.Map.Rules.TileSet];
 }
Exemplo n.º 4
0
 bool ICustomMovementLayer.EnabledForActor(ActorInfo ai, MobileInfo mi)
 {
     return(mi.Subterranean);
 }
Exemplo n.º 5
0
 int ICustomMovementLayer.EntryMovementCost(ActorInfo ai, MobileInfo mi, CPos cell)
 {
     return(ValidTransitionCell(cell, mi) ? mi.SubterraneanTransitionCost : int.MaxValue);
 }
Exemplo n.º 6
0
 int ICustomMovementLayer.ExitMovementCost(ActorInfo ai, MobileInfo mi, CPos cell)
 {
     return(portals.Contains(cell) ? 0 : int.MaxValue);
 }
Exemplo n.º 7
0
 bool ICustomMovementLayer.EnabledForActor(ActorInfo ai, MobileInfo mi)
 {
     return(enabled);
 }