00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef _MAP_H
00016 #define _MAP_H
00017
00018
00019
00020
00021
00022
00023
00024 #define MAX_MECHS_PER_MAP 250
00025
00026
00027 #define MAP_UP 0
00028 #define MAP_DOWN 1
00029 #define MAP_RIGHT 2
00030 #define MAP_LEFT 3
00031
00032
00033 #define MAPX 1000
00034 #define MAPY 1000
00035 #define MAP_NAME_SIZE 30
00036 #define NUM_MAP_LINKS 4
00037 #define DEFAULT_MAP_WIDTH 21
00038 #define DEFAULT_MAP_HEIGHT 11
00039 #define MAP_DISPLAY_WIDTH 21
00040 #define MAP_DISPLAY_HEIGHT 14
00041 #define MAX_ELEV 9
00042 #define GRASSLAND ' '
00043 #define HEAVY_FOREST '"'
00044 #define LIGHT_FOREST '`'
00045 #define WATER '~'
00046 #define HIGHWATER '?'
00047 #define ROUGH '%'
00048 #define MOUNTAINS '^'
00049 #define ROAD '#'
00050 #define BUILDING '@'
00051 #define FIRE '&'
00052 #define TFIRE '>'
00053 #define SMOKE ':'
00054 #define WALL '='
00055
00056 #define BRIDGE '/'
00057 #define SNOW '+'
00058 #define ICE '-'
00059
00060 #define UNKNOWN_TERRAIN '$'
00061
00062
00063
00064
00065 #define MAPFLAG_MAPO 1
00066 #define MAPFLAG_SPEC 2
00067 #define MAPFLAG_VACUUM 4
00068 #define MAPFLAG_FIRES 8
00069 #define MAPFLAG_UNDERGROUND 16
00070
00071 #define MAPFLAG_DARK 32
00072 #define MAPFLAG_BRIDGESCS 64
00073 #define MAPFLAG_NOBRIDGIFY 128
00074 #define MAPFLAG_NOFRIENDLYFIRE 256
00075
00076 #define TYPE_FIRE 0
00077 #define TYPE_SMOKE 1
00078 #define TYPE_DEC 2
00079 #define TYPE_LAST_DEC 2
00080 #define TYPE_MINE 3
00081 #define TYPE_BUILD 4
00082 #define TYPE_LEAVE 5
00083 #define TYPE_ENTRANCE 6
00084
00085 #define TYPE_LINKED 7
00086 #define TYPE_BITS 8
00087 #define TYPE_B_LZ 9
00088 #define NUM_MAPOBJTYPES 10
00089
00090 #define BUILDFLAG_CS 1
00091 #define BUILDFLAG_CSI 2
00092 #define BUILDFLAG_DSS 4
00093 #define BUILDFLAG_NOB 8
00094 #define BUILDFLAG_HID 16
00095
00096 #define MapIsCS(map) (map->buildflag & BUILDFLAG_CSI)
00097 #define BuildIsCS(map) (map->buildflag & BUILDFLAG_CS)
00098 #define BuildIsHidden(map) (map->buildflag & (BUILDFLAG_DSS|BUILDFLAG_HID))
00099 #define BuildIsSafe(map) (map->buildflag & BUILDFLAG_NOB)
00100 #define BuildIsInvis(map) (map->buildflag & BUILDFLAG_HID)
00101
00102 #define MapUnderSpecialRules(map) ((map)->flags & MAPFLAG_SPEC)
00103 #define MapGravityMod(map) (map)->grav
00104 #define MapGravity MapGravityMod
00105 #define MapIsVacuum(map) ((map)->flags & MAPFLAG_VACUUM)
00106 #define MapTemperature(map) (map)->temp
00107 #define MapCloudbase(map) (map)->cloudbase
00108 #define MapIsUnderground(map) ((map)->flags & MAPFLAG_UNDERGROUND)
00109 #define MapIsDark(map) ((map)->flags & MAPFLAG_DARK)
00110 #define MapBridgesCS(map) ((map)->flags & MAPFLAG_BRIDGESCS)
00111 #define MapNoBridgify(map) ((map)->flags & MAPFLAG_NOBRIDGIFY)
00112 #define MapNoFriendlyFire(map) ((map)->flags & MAPFLAG_NOFRIENDLYFIRE)
00113
00114 typedef struct mapobj_struct {
00115 short x, y;
00116 dbref obj;
00117 char type;
00118 char datac;
00119 short datas;
00120 int datai;
00121 struct mapobj_struct *next;
00122 } mapobj;
00123
00124 #define MECHMAPFLAG_MOVED 1
00125
00126 #define MECHLOSFLAG_SEEN 0x0001
00127 #define MECHLOSFLAG_SEESP 0x0002
00128 #define MECHLOSFLAG_SEESS 0x0004
00129 #define MECHLOSFLAG_SEEC2 0x0008
00130 #define MECHLOSFLAG_MNTN 0x0010
00131
00132 #define MECHLOSFLAG_WOOD 0x0020
00133 #define MECHLOSFLAG_WOOD2 0x0040
00134 #define MECHLOSFLAG_WOOD3 0x0080
00135 #define MECHLOSFLAG_WOOD4 0x0100
00136 #define MECHLOSBYTES_WOOD 4
00137 #define MECHLOSMAX_WOOD 16
00138
00139 #define MECHLOSFLAG_WATER 0x0200
00140 #define MECHLOSFLAG_WATER2 0x0400
00141 #define MECHLOSFLAG_WATER3 0x0800
00142 #define MECHLOSBYTES_WATER 3
00143 #define MECHLOSMAX_WATER 8
00144
00145 #define MECHLOSFLAG_PARTIAL 0x1000
00146
00147 #define MECHLOSFLAG_FIRE 0x2000
00148 #define MECHLOSFLAG_SMOKE 0x4000
00149 #define MECHLOSFLAG_BLOCK 0x8000
00150
00151
00152 typedef struct {
00153 dbref mynum;
00154 unsigned char **map;
00155 char mapname[MAP_NAME_SIZE + 1];
00156
00157 short map_width;
00158 short map_height;
00159
00160 char temp;
00161 unsigned char grav;
00162 short cloudbase;
00163 char unused_char;
00164 char mapvis;
00165
00166 short maxvis;
00167 char maplight;
00168 short winddir, windspeed;
00169
00170
00171 int flags;
00172
00173 mapobj *mapobj[NUM_MAPOBJTYPES];
00174 short cf, cfmax;
00175 dbref onmap;
00176 char buildflag;
00177
00178 unsigned char first_free;
00179 dbref *mechsOnMap;
00180 unsigned short **LOSinfo;
00181
00182
00183
00184 char *mechflags;
00185 short moves;
00186 short movemod;
00187 int sensorflags;
00188 } MAP;
00189
00190
00191 #define NAVIGATE_LINES 13
00192
00193 #include "p.map.bits.h"
00194 #include "p.map.h"
00195 #include "p.map.obj.h"
00196 #include "p.map.dynamic.h"
00197
00198 extern void newfreemap(dbref key, void **data, int selector);
00199 extern void map_update(dbref obj, void *data);
00200
00201 #define set_buildflag(a,b) silly_atr_set((a), A_BUILDFLAG, tprintf("%d", (b)))
00202 #define get_buildflag(a) atoi(silly_atr_get((a), A_BUILDFLAG))
00203 #define set_buildcf(a,b) silly_atr_set((a), A_BUILDCF, tprintf("%d %d", (b), (b)))
00204 #endif