#include "p.map.bits.h"#include "p.map.h"#include "p.map.obj.h"#include "p.map.dynamic.h"Include dependency graph for map.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | mapobj_struct |
| struct | MAP |
Defines | |
| #define | MAX_MECHS_PER_MAP 250 |
| #define | MAP_UP 0 |
| #define | MAP_DOWN 1 |
| #define | MAP_RIGHT 2 |
| #define | MAP_LEFT 3 |
| #define | MAPX 1000 |
| #define | MAPY 1000 |
| #define | MAP_NAME_SIZE 30 |
| #define | NUM_MAP_LINKS 4 |
| #define | DEFAULT_MAP_WIDTH 21 |
| #define | DEFAULT_MAP_HEIGHT 11 |
| #define | MAP_DISPLAY_WIDTH 21 |
| #define | MAP_DISPLAY_HEIGHT 14 |
| #define | MAX_ELEV 9 |
| #define | GRASSLAND ' ' |
| #define | HEAVY_FOREST '"' |
| #define | LIGHT_FOREST '`' |
| #define | WATER '~' |
| #define | HIGHWATER '?' |
| #define | ROUGH '%' |
| #define | MOUNTAINS '^' |
| #define | ROAD '#' |
| #define | BUILDING '@' |
| #define | FIRE '&' |
| #define | TFIRE '>' |
| #define | SMOKE ':' |
| #define | WALL '=' |
| #define | BRIDGE '/' |
| #define | SNOW '+' |
| #define | ICE '-' |
| #define | UNKNOWN_TERRAIN '$' |
| #define | MAPFLAG_MAPO 1 |
| #define | MAPFLAG_SPEC 2 |
| #define | MAPFLAG_VACUUM 4 |
| #define | MAPFLAG_FIRES 8 |
| #define | MAPFLAG_UNDERGROUND 16 |
| #define | MAPFLAG_DARK 32 |
| #define | MAPFLAG_BRIDGESCS 64 |
| #define | MAPFLAG_NOBRIDGIFY 128 |
| #define | MAPFLAG_NOFRIENDLYFIRE 256 |
| #define | TYPE_FIRE 0 |
| #define | TYPE_SMOKE 1 |
| #define | TYPE_DEC 2 |
| #define | TYPE_LAST_DEC 2 |
| #define | TYPE_MINE 3 |
| #define | TYPE_BUILD 4 |
| #define | TYPE_LEAVE 5 |
| #define | TYPE_ENTRANCE 6 |
| #define | TYPE_LINKED 7 |
| #define | TYPE_BITS 8 |
| #define | TYPE_B_LZ 9 |
| #define | NUM_MAPOBJTYPES 10 |
| #define | BUILDFLAG_CS 1 |
| #define | BUILDFLAG_CSI 2 |
| #define | BUILDFLAG_DSS 4 |
| #define | BUILDFLAG_NOB 8 |
| #define | BUILDFLAG_HID 16 |
| #define | MapIsCS(map) (map->buildflag & BUILDFLAG_CSI) |
| #define | BuildIsCS(map) (map->buildflag & BUILDFLAG_CS) |
| #define | BuildIsHidden(map) (map->buildflag & (BUILDFLAG_DSS|BUILDFLAG_HID)) |
| #define | BuildIsSafe(map) (map->buildflag & BUILDFLAG_NOB) |
| #define | BuildIsInvis(map) (map->buildflag & BUILDFLAG_HID) |
| #define | MapUnderSpecialRules(map) ((map)->flags & MAPFLAG_SPEC) |
| #define | MapGravityMod(map) (map)->grav |
| #define | MapGravity MapGravityMod |
| #define | MapIsVacuum(map) ((map)->flags & MAPFLAG_VACUUM) |
| #define | MapTemperature(map) (map)->temp |
| #define | MapCloudbase(map) (map)->cloudbase |
| #define | MapIsUnderground(map) ((map)->flags & MAPFLAG_UNDERGROUND) |
| #define | MapIsDark(map) ((map)->flags & MAPFLAG_DARK) |
| #define | MapBridgesCS(map) ((map)->flags & MAPFLAG_BRIDGESCS) |
| #define | MapNoBridgify(map) ((map)->flags & MAPFLAG_NOBRIDGIFY) |
| #define | MapNoFriendlyFire(map) ((map)->flags & MAPFLAG_NOFRIENDLYFIRE) |
| #define | MECHMAPFLAG_MOVED 1 |
| #define | MECHLOSFLAG_SEEN 0x0001 |
| #define | MECHLOSFLAG_SEESP 0x0002 |
| #define | MECHLOSFLAG_SEESS 0x0004 |
| #define | MECHLOSFLAG_SEEC2 0x0008 |
| #define | MECHLOSFLAG_MNTN 0x0010 |
| #define | MECHLOSFLAG_WOOD 0x0020 |
| #define | MECHLOSFLAG_WOOD2 0x0040 |
| #define | MECHLOSFLAG_WOOD3 0x0080 |
| #define | MECHLOSFLAG_WOOD4 0x0100 |
| #define | MECHLOSBYTES_WOOD 4 |
| #define | MECHLOSMAX_WOOD 16 |
| #define | MECHLOSFLAG_WATER 0x0200 |
| #define | MECHLOSFLAG_WATER2 0x0400 |
| #define | MECHLOSFLAG_WATER3 0x0800 |
| #define | MECHLOSBYTES_WATER 3 |
| #define | MECHLOSMAX_WATER 8 |
| #define | MECHLOSFLAG_PARTIAL 0x1000 |
| #define | MECHLOSFLAG_FIRE 0x2000 |
| #define | MECHLOSFLAG_SMOKE 0x4000 |
| #define | MECHLOSFLAG_BLOCK 0x8000 |
| #define | NAVIGATE_LINES 13 |
| #define | set_buildflag(a, b) silly_atr_set((a), A_BUILDFLAG, tprintf("%d", (b))) |
| #define | get_buildflag(a) atoi(silly_atr_get((a), A_BUILDFLAG)) |
| #define | set_buildcf(a, b) silly_atr_set((a), A_BUILDCF, tprintf("%d %d", (b), (b))) |
Typedefs | |
| typedef mapobj_struct | mapobj |
Functions | |
| void | newfreemap (dbref key, void **data, int selector) |
| void | map_update (dbref obj, void *data) |
| #define BRIDGE '/' |
Definition at line 56 of file map.h.
Referenced by break_sub(), CalculateLOSFlag(), CheckNavalHeight(), CheckVTOLHeight(), collision_check(), DropGetElevation(), DropSetElevation(), GetTerrainName_base(), growSnow(), make_bridges(), mech_dig(), mech_move_event(), mech_pickup(), mech_speed(), mech_thrash(), move_mech(), NewHexEntered(), possibly_blow_bridge(), sketch_tac_map(), terrain_speed(), and water_distance().
| #define BUILDING '@' |
Definition at line 50 of file map.h.
Referenced by aero_land(), auto_radio_command_hide(), CheckForSmoke(), DoVehicleEngineHit(), GetTerrainName_base(), HandleVTOLCrit(), mech_dig(), NewHexEntered(), and TerrainColorChar().
| #define BuildIsCS | ( | map | ) | (map->buildflag & BUILDFLAG_CS) |
| #define BuildIsHidden | ( | map | ) | (map->buildflag & (BUILDFLAG_DSS|BUILDFLAG_HID)) |
Definition at line 98 of file map.h.
Referenced by show_building_in_hex(), and steppable_base_check().
| #define BuildIsInvis | ( | map | ) | (map->buildflag & BUILDFLAG_HID) |
Definition at line 100 of file map.h.
Referenced by show_building_in_hex(), and steppable_base_check().
| #define BuildIsSafe | ( | map | ) | (map->buildflag & BUILDFLAG_NOB) |
| #define DEFAULT_MAP_HEIGHT 11 |
| #define DEFAULT_MAP_WIDTH 21 |
| #define FIRE '&' |
Definition at line 51 of file map.h.
Referenced by blast_hit_hexesf(), CalculateLOSFlag(), CheckForFire(), DestroyMech(), DS_BlastNearbyMechsAndTrees(), fiery_death(), fire_hex(), GetTerrainName_base(), growSnow(), map_addfire(), map_load(), map_savemap(), NewHexEntered(), TerrainColorChar(), and UpdateHeat().
| #define get_buildflag | ( | a | ) | atoi(silly_atr_get((a), A_BUILDFLAG)) |
| #define GRASSLAND ' ' |
Definition at line 42 of file map.h.
Referenced by aero_land(), clear_hex(), determineDamageFromHit(), DoVehicleEngineHit(), fire_dissipation_event(), fun_btmapterr(), GetTerrainName_base(), HandleVTOLCrit(), HoverTankTileCost(), ImproperLZ(), map_load(), mech_ood_event(), mech_thrash(), MechTileCost(), NewHexEntered(), and TrackedTankTileCost().
| #define HEAVY_FOREST '"' |
Definition at line 43 of file map.h.
Referenced by ai_crash(), auto_astar_generate_path(), auto_radio_command_hide(), auto_roam_generate_target_hex(), blast_hit_hexesf(), CalculateLOSFlag(), clear_hex(), determineDamageFromHit(), DS_BlastNearbyMechsAndTrees(), FindNormalBTH(), fire_hex(), GetTerrainName_base(), HoverTankTileCost(), mech_club(), mech_grabclub(), MechTileCost(), Missile_Hit(), NewHexEntered(), PhysicalAttack(), possibly_ignite(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), trace_slitelos(), and TrackedTankTileCost().
| #define HIGHWATER '?' |
Definition at line 46 of file map.h.
Referenced by ai_crash(), auto_astar_generate_path(), CalculateLOSFlag(), GetTerrainName_base(), mech_ood_event(), mech_speed(), MechFalls(), NewHexEntered(), sketch_tac_map(), and TerrainColorChar().
| #define ICE '-' |
Definition at line 58 of file map.h.
Referenced by CalculateLOSFlag(), CheckNavalHeight(), collision_check(), DropGetElevation(), DropSetElevation(), GetTerrainName_base(), growable_callback(), growSnow(), ice_growth(), ice_melt(), mech_jump(), mech_move_event(), mech_pickup(), mech_speed(), mech_stand(), meltable_callback(), move_mech(), NewHexEntered(), possible_mine_poof(), possibly_blow_ice(), terrain_speed(), TerrainColorChar(), and water_distance().
| #define LIGHT_FOREST '`' |
Definition at line 44 of file map.h.
Referenced by auto_astar_generate_path(), auto_radio_command_hide(), auto_roam_generate_target_hex(), blast_hit_hexesf(), CalculateLOSFlag(), clear_hex(), determineDamageFromHit(), DS_BlastNearbyMechsAndTrees(), FindNormalBTH(), fire_hex(), GetTerrainName_base(), HoverTankTileCost(), map_load(), mech_club(), mech_grabclub(), MechTileCost(), Missile_Hit(), NewHexEntered(), PhysicalAttack(), possibly_ignite(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), trace_slitelos(), and TrackedTankTileCost().
| #define MAP_DISPLAY_HEIGHT 14 |
| #define MAP_DISPLAY_WIDTH 21 |
| #define MAP_NAME_SIZE 30 |
| #define MapBridgesCS | ( | map | ) | ((map)->flags & MAPFLAG_BRIDGESCS) |
| #define MAPFLAG_FIRES 8 |
| #define MAPFLAG_MAPO 1 |
Definition at line 65 of file map.h.
Referenced by add_mapobj(), CheckEdgeOfMap(), del_mapobj(), del_mapobjs(), del_mapobjst(), load_update1(), and save_maps_func().
| #define MAPFLAG_SPEC 2 |
| #define MAPFLAG_UNDERGROUND 16 |
| #define MAPFLAG_VACUUM 4 |
| #define MapGravity MapGravityMod |
Definition at line 104 of file map.h.
Referenced by MechCargoMaxSpeed(), MechFalls(), and UpdateConditions().
| #define MapIsCS | ( | map | ) | (map->buildflag & BUILDFLAG_CSI) |
| #define MapIsDark | ( | map | ) | ((map)->flags & MAPFLAG_DARK) |
Definition at line 109 of file map.h.
Referenced by mech_lrsmap(), mech_navigate(), mech_range(), and mech_tacmap().
| #define MapIsUnderground | ( | map | ) | ((map)->flags & MAPFLAG_UNDERGROUND) |
Definition at line 108 of file map.h.
Referenced by aero_takeoff(), FireWeaponNumber(), mech_jump(), and reactor_explosion().
| #define MapIsVacuum | ( | map | ) | ((map)->flags & MAPFLAG_VACUUM) |
| #define MapNoBridgify | ( | map | ) | ((map)->flags & MAPFLAG_NOBRIDGIFY) |
| #define MapNoFriendlyFire | ( | map | ) | ((map)->flags & MAPFLAG_NOFRIENDLYFIRE) |
Definition at line 112 of file map.h.
Referenced by DeathFromAbove(), FireWeaponNumber(), mech_charge(), and PhysicalAttack().
| #define MapTemperature | ( | map | ) | (map)->temp |
Definition at line 106 of file map.h.
Referenced by setWeatherHeatEffects(), UpdateConditions(), and UpdateHeat().
| #define MapUnderSpecialRules | ( | map | ) | ((map)->flags & MAPFLAG_SPEC) |
Definition at line 102 of file map.h.
Referenced by MechFalls(), UpdateConditions(), and UpdateHeat().
| #define MAPX 1000 |
Definition at line 33 of file map.h.
Referenced by auto_astar_generate_path(), map_load(), map_savemap(), and map_setmapsize().
| #define MAPY 1000 |
Definition at line 34 of file map.h.
Referenced by auto_astar_generate_path(), auto_create_astar_node(), map_load(), and map_setmapsize().
| #define MAX_ELEV 9 |
| #define MAX_MECHS_PER_MAP 250 |
Definition at line 24 of file map.h.
Referenced by map_listmechs(), mech_contacts(), mech_Rsetmapindex(), nonrecursive_commlink(), show_lrs_map(), and showNetworkTargets().
| #define MECHLOSFLAG_BLOCK 0x8000 |
Definition at line 149 of file map.h.
Referenced by CalculateLOSFlag(), InLineOfSight(), InLineOfSight_NB(), mech_lites_target(), SearchLightInRange(), and update_LOSinfo().
| #define MECHLOSFLAG_FIRE 0x2000 |
| #define MECHLOSFLAG_MNTN 0x0010 |
| #define MECHLOSFLAG_PARTIAL 0x1000 |
| #define MECHLOSFLAG_SEEC2 0x0008 |
| #define MECHLOSFLAG_SEEN 0x0001 |
Definition at line 126 of file map.h.
Referenced by auto_calc_target_score(), CalculateLOSFlag(), clear_mech_from_LOS(), InLineOfSight(), mech_plos_event(), remove_mech_from_map(), and Sensor_DoWeSeeNow().
| #define MECHLOSFLAG_SEESP 0x0002 |
Definition at line 127 of file map.h.
Referenced by InLineOfSight(), mech_contacts(), Sensor_DoWeSeeNow(), Sensor_ToHitBonus(), showNetworkTargets(), and update_LOSinfo().
| #define MECHLOSFLAG_SEESS 0x0004 |
Definition at line 128 of file map.h.
Referenced by InLineOfSight(), mech_contacts(), Sensor_DoWeSeeNow(), Sensor_ToHitBonus(), showNetworkTargets(), and update_LOSinfo().
| #define MECHLOSFLAG_SMOKE 0x4000 |
| #define MECHLOSFLAG_WATER 0x0200 |
| #define MECHLOSFLAG_WOOD 0x0020 |
| #define MECHLOSMAX_WATER 8 |
| #define MECHLOSMAX_WOOD 16 |
| #define MOUNTAINS '^' |
Definition at line 48 of file map.h.
Referenced by auto_astar_generate_path(), auto_radio_command_hide(), CalculateLOSFlag(), GetTerrainName_base(), HoverTankTileCost(), MechTileCost(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), and TrackedTankTileCost().
| #define NAVIGATE_LINES 13 |
| #define NUM_MAPOBJTYPES 10 |
Definition at line 88 of file map.h.
Referenced by del_mapobjs(), find_mapobj(), fun_btlistblz(), list_mapobjs(), load_mapobjs(), map_delobj(), newfreemap(), obj_size(), and save_mapobjs().
| #define ROAD '#' |
Definition at line 49 of file map.h.
Referenced by aero_land(), DoVehicleEngineHit(), GetTerrainName_base(), HandleVTOLCrit(), ImproperLZ(), make_bridges(), mech_dig(), mech_ood_event(), mech_thrash(), NewHexEntered(), terrain_speed(), TerrainColorChar(), and water_distance().
| #define ROUGH '%' |
Definition at line 47 of file map.h.
Referenced by auto_astar_generate_path(), auto_radio_command_hide(), clear_hex(), DS_BlastNearbyMechsAndTrees(), fire_dissipation_event(), GetTerrainName_base(), HoverTankTileCost(), MechTileCost(), NewHexEntered(), terrain_speed(), TerrainColorChar(), and TrackedTankTileCost().
| #define set_buildcf | ( | a, | |||
| b | ) | silly_atr_set((a), A_BUILDCF, tprintf("%d %d", (b), (b))) |
| #define set_buildflag | ( | a, | |||
| b | ) | silly_atr_set((a), A_BUILDFLAG, tprintf("%d", (b))) |
| #define SMOKE ':' |
Definition at line 53 of file map.h.
Referenced by artillery_hit_hex(), CalculateLOSFlag(), CheckForSmoke(), GetTerrainName_base(), map_addsmoke(), map_load(), map_savemap(), meltSnowAndIce(), PhysicalAttack(), TerrainColorChar(), trace_slitelos(), and water_extinguish_inferno().
| #define SNOW '+' |
| #define TFIRE '>' |
| #define TYPE_B_LZ 9 |
Definition at line 87 of file map.h.
Referenced by fun_bthexinblz(), fun_btlistblz(), is_blocked_lz(), and map_add_block().
| #define TYPE_BITS 8 |
Definition at line 86 of file map.h.
Referenced by bit_size(), clear_hex_bits(), grab_us_an_array(), is_hangar_hex(), is_mine_hex(), list_mapobjs(), load_mapobjs(), map_save_bits(), map_setmapsize(), and save_mapobjs().
| #define TYPE_BUILD 4 |
Definition at line 81 of file map.h.
Referenced by add_links(), find_entrance_by_target(), find_entrance_by_xy(), load_mapobjs(), and recursively_updatelinks().
| #define TYPE_ENTRANCE 6 |
Definition at line 83 of file map.h.
Referenced by add_entrances(), find_entrance(), and recursively_updatelinks().
| #define TYPE_FIRE 0 |
Definition at line 76 of file map.h.
Referenced by add_decoration(), blast_hit_hexesf(), CheckForFire(), DestroyMech(), DS_BlastNearbyMechsAndTrees(), fire_dissipation_event(), fire_hex(), litemark_map(), map_addfire(), and map_savemap().
| #define TYPE_LAST_DEC 2 |
Definition at line 79 of file map.h.
Referenced by add_decoration(), del_mapobj(), and find_decorations().
| #define TYPE_LEAVE 5 |
Definition at line 82 of file map.h.
Referenced by CheckEdgeOfMap(), Leave_Hangar(), and recursively_updatelinks().
| #define TYPE_LINKED 7 |
| #define TYPE_MINE 3 |
Definition at line 80 of file map.h.
Referenced by add_mine(), explode_mines(), make_mine_explode(), map_add_mine(), map_delobj(), possible_mine_explosion(), possibly_remove_mines(), recalculate_minefields(), and show_mines_in_hex().
| #define TYPE_SMOKE 1 |
Definition at line 77 of file map.h.
Referenced by add_decoration(), artillery_hit_hex(), CheckForSmoke(), map_addsmoke(), meltSnowAndIce(), smoke_dissipation_event(), and water_extinguish_inferno().
| #define UNKNOWN_TERRAIN '$' |
Definition at line 60 of file map.h.
Referenced by get_lrshexstr(), sketch_tac_map(), and TerrainColorChar().
| #define WALL '=' |
Definition at line 54 of file map.h.
Referenced by CheckForSmoke(), GetTerrainName_base(), mech_dig(), and TerrainColorChar().
| #define WATER '~' |
Definition at line 45 of file map.h.
Referenced by ai_crash(), ai_path_score(), auto_astar_generate_path(), auto_roam_generate_target_hex(), break_sub(), break_thru_ice(), CalculateLOSFlag(), CheckNavalHeight(), collision_check(), drop_thru_ice(), FindNormalBTH(), FindPilotingSkillName(), GetTerrainName_base(), growSnow(), HoverTankTileCost(), ice_growth(), ice_melt(), mech_dig(), mech_move_event(), mech_ood_event(), mech_speed(), MechTileCost(), NewHexEntered(), sketch_tac_map(), swim_except(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), TrackedTankTileCost(), and water_distance().
| typedef struct mapobj_struct mapobj |
| void map_update | ( | dbref | obj, | |
| void * | data | |||
| ) |
Definition at line 503 of file map.c.
00504 { 00505 MAP *map = ((MAP *) data); 00506 MECH *mech; 00507 char *tmps, changemsg[LBUF_SIZE] = ""; 00508 int ma, ml, wind, wspeed, cloudbase = 200; 00509 int oldl, oldv, i, j; 00510 AUTO *au; 00511 00512 /* Changed from % 25 to % 60. %60 never hit when muxevent_tick came here and was odd. 00513 % 25 should hit when its odd or even (25 75 125... when odd 50 100 150... when even */ 00514 00515 if(!(muxevent_tick % 25)) { 00516 oldl = map->maplight; 00517 oldv = map->mapvis; 00518 if(!(tmps = silly_atr_get(obj, A_MAPVIS)) || 00519 sscanf(tmps, "%d %d %d %d %d %[^\n]", &ma, &ml, &wind, 00520 &wspeed, &cloudbase, changemsg) < 4) { 00521 ma = 30; 00522 ml = 2; 00523 wind = 0; 00524 wspeed = 0; 00525 cloudbase = 200; 00526 } 00527 map->winddir = wind; 00528 map->windspeed = wspeed; 00529 map->mapvis = BOUNDED(0, ma, 60); 00530 map->maxvis = BOUNDED(24, ma * 3, 60); 00531 map->maplight = BOUNDED(0, ml, 2); 00532 map->cloudbase = cloudbase; 00533 if(ml != oldl || ma != oldv) 00534 for(i = 0; i < map->first_free; i++) { 00535 if((j = map->mechsOnMap[i]) < 0) 00536 continue; 00537 if(!(mech = getMech(j))) 00538 continue; 00539 if(ml != oldl) 00540 sensor_light_availability_check(mech); 00541 if(strlen(changemsg) > 5) 00542 mech_notify(mech, MECHALL, changemsg); 00543 } 00544 } 00545 update_LOSinfo(obj, map); 00546 /* Fire/Smoke are event-driven -> nothing related to them done here */ 00547 }
| void newfreemap | ( | dbref | key, | |
| void ** | data, | |||
| int | selector | |||
| ) |
Definition at line 567 of file map.c.
00568 { 00569 MAP *new = *data; 00570 int i; 00571 00572 switch (selector) { 00573 case SPECIAL_ALLOC: 00574 initialize_map_empty(new, key); 00575 /* allocate default map space */ 00576 for(i = 0; i < NUM_MAPOBJTYPES; i++) 00577 new->mapobj[i] = NULL; 00578 sprintf(new->mapname, "%s", "Default Map"); 00579 break; 00580 case SPECIAL_FREE: 00581 del_mapobjs(new); 00582 if(new->map) { 00583 for(i = new->map_height - 1; i >= 0; i--) 00584 if(new->map[i]) 00585 free((char *) (new->map[i])); 00586 free((char *) (new->map)); 00587 } 00588 break; 00589 } 00590 }
1.4.7