00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "obj_column.h"
00021
00022 #include "lev_data.h"
00023 #include "globals.h"
00024 #include "obj_cube.h"
00025 #include "obj_column_def.h"
00026 #include "obj_slabs.h"
00027 #include "obj_things.h"
00028 #include "graffiti.h"
00029
00030 static void (*custom_columns_gen [])(struct COLUMN_REC *clm_recs[9],
00031 unsigned char *,unsigned char *, unsigned char **)={
00032 create_columns_slb_rock,create_columns_slb_gold,
00033 create_columns_slb_fulldirt,create_columns_slb_earth,
00034 create_columns_slb_torchdirt,
00035 create_columns_slb_walldrape,create_columns_slb_walltorch,
00036 create_columns_slb_wallwtwins,create_columns_slb_wallwwoman,
00037 create_columns_slb_wallpairshr,
00038 create_columns_slb_path,create_columns_slb_claimed,
00039 create_columns_slb_lava,create_columns_slb_water,
00040 create_columns_slb_portal,create_columns_slb_treasure,
00041 create_columns_slb_library,create_columns_slb_prison,
00042 create_columns_slb_torture,create_columns_slb_training,
00043 create_columns_slb_dungheart,create_columns_slb_workshop,
00044 create_columns_slb_scavenger,create_columns_slb_temple,
00045 create_columns_slb_graveyard,create_columns_slb_hatchery,
00046 create_columns_slb_lair,create_columns_slb_barracks,
00047 create_columns_slb_doorwood,create_columns_slb_doorbrace,
00048 create_columns_slb_dooriron,create_columns_slb_doormagic,
00049 create_columns_slb_bridge,create_columns_slb_gems,
00050 create_columns_slb_guardpost,
00051 create_columns_slb_thingems_path,create_columns_slb_rock_gndlev,
00052 create_columns_slb_rockcaped_pathcave,create_columns_slb_rockcaped_claimcave,
00053 create_columns_slb_skulls_on_lava,create_columns_slb_skulls_on_path,
00054 create_columns_slb_skulls_on_claimed,create_columns_slb_wall_force_relief_splatbody,
00055 };
00056
00057 const char * custom_columns_fullnames[]={
00058 "Standard Rock","Standard Gold",
00059 "Unaffected Earth","Standard Earth",
00060 SLB_TORCHDIRT_LTEXT,
00061 SLB_WALLDRAPE_LTEXT,SLB_WALLTORCH_LTEXT,
00062 SLB_WALLWTWINS_LTEXT,SLB_WALLWWOMAN_LTEXT,
00063 SLB_WALLPAIRSHR_LTEXT,
00064 "Standard Path",SLB_CLAIMED_LTEXT,
00065 "Standard Lava","Standard Water",
00066 SLB_PORTAL_LTEXT,SLB_TREASURE_LTEXT,
00067 SLB_LIBRARY_LTEXT,SLB_PRISON_LTEXT,
00068 SLB_TORTURE_LTEXT,SLB_TRAINING_LTEXT,
00069 SLB_DUNGHEART_LTEXT,SLB_WORKSHOP_LTEXT,
00070 SLB_SCAVENGER_LTEXT,SLB_TEMPLE_LTEXT,
00071 SLB_GRAVEYARD_LTEXT,SLB_HATCHERY_LTEXT,
00072 SLB_LAIR_LTEXT,SLB_BARRACKS_LTEXT,
00073 SLB_DOORWOOD_LTEXT,SLB_DOORBRACE_LTEXT,
00074 SLB_DOORIRON_LTEXT,SLB_DOORMAGIC_LTEXT,
00075 SLB_BRIDGE_LTEXT,"Standard Gems",
00076 SLB_GUARDPOST_LTEXT,
00077 "Thin gems on path","Ground level rock",
00078 "Rock with cave","Rock w/claimed cave",
00079 "Skulls on Lava","Skulls on Path",
00080 "Skulls on Claimed","Wall w/body splat",
00081 };
00082
00083 const unsigned short dir_rot_000[]={
00084 IDIR_NW,IDIR_NORTH,IDIR_NE,IDIR_WEST,IDIR_CENTR,IDIR_EAST,
00085 IDIR_SW,IDIR_SOUTH,IDIR_SE, };
00086
00087 const unsigned short dir_rot_090[]={
00088 IDIR_NE,IDIR_EAST,IDIR_SE,IDIR_NORTH,IDIR_CENTR,IDIR_SOUTH,
00089 IDIR_NW,IDIR_WEST,IDIR_SW, };
00090
00091 const unsigned short dir_rot_180[]={
00092 IDIR_SE,IDIR_SOUTH,IDIR_SW,IDIR_EAST,IDIR_CENTR,IDIR_WEST,
00093 IDIR_NE,IDIR_NORTH,IDIR_NW, };
00094
00095 const unsigned short dir_rot_270[]={
00096 IDIR_SW,IDIR_WEST,IDIR_NW,IDIR_SOUTH,IDIR_CENTR,IDIR_NORTH,
00097 IDIR_SE,IDIR_EAST,IDIR_NE, };
00098
00099 short fill_reinforced_corner=true;
00100 short frail_columns_near_short=true;
00101 short frail_columns_near_tall=true;
00102
00103
00104
00105
00106 char *get_custom_column_fullname(unsigned short idx)
00107 {
00108 int types_count=sizeof(custom_columns_fullnames)/sizeof(char *);
00109 if (idx<types_count)
00110 return (char *)custom_columns_fullnames[idx];
00111 else
00112 return "unknown(?!)";
00113 }
00114
00115
00116
00117
00118 short fill_custom_column_data(unsigned short idx,struct COLUMN_REC *clm_recs[9],
00119 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00120 {
00121 custom_columns_gen[idx](clm_recs,surr_slb,surr_own,surr_tng);
00122 }
00123
00124
00125
00126
00127 void create_columns_for_slab(struct COLUMN_REC *clm_recs[9],struct LEVOPTIONS *optns,
00128 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00129 {
00130 unsigned short slab=surr_slb[IDIR_CENTR];
00131 frail_columns_near_short=((optns->frail_columns&1)==1);
00132 frail_columns_near_tall=((optns->frail_columns&2)==2);
00133 switch (slab)
00134 {
00135 case SLAB_TYPE_ROCK:
00136 if (optns->unaffected_rock)
00137 create_columns_slb_unaffected_rock(clm_recs,surr_slb,surr_own,surr_tng);
00138 else
00139 create_columns_slb_rock(clm_recs,surr_slb,surr_own,surr_tng);
00140 break;
00141 case SLAB_TYPE_GOLD:
00142 create_columns_slb_gold(clm_recs,surr_slb,surr_own,surr_tng);
00143 break;
00144 case SLAB_TYPE_EARTH:
00145 create_columns_slb_earth(clm_recs,surr_slb,surr_own,surr_tng);
00146 break;
00147 case SLAB_TYPE_TORCHDIRT:
00148 create_columns_slb_torchdirt(clm_recs,surr_slb,surr_own,surr_tng);
00149 break;
00150 case SLAB_TYPE_WALLDRAPE:
00151 fill_reinforced_corner=optns->fill_reinforced_corner;
00152 create_columns_slb_walldrape(clm_recs,surr_slb,surr_own,surr_tng);
00153 break;
00154 case SLAB_TYPE_WALLTORCH:
00155 fill_reinforced_corner=optns->fill_reinforced_corner;
00156 create_columns_slb_walltorch(clm_recs,surr_slb,surr_own,surr_tng);
00157 break;
00158 case SLAB_TYPE_WALLWTWINS:
00159 fill_reinforced_corner=optns->fill_reinforced_corner;
00160 create_columns_slb_wallwtwins(clm_recs,surr_slb,surr_own,surr_tng);
00161 break;
00162 case SLAB_TYPE_WALLWWOMAN:
00163 fill_reinforced_corner=optns->fill_reinforced_corner;
00164 create_columns_slb_wallwwoman(clm_recs,surr_slb,surr_own,surr_tng);
00165 break;
00166 case SLAB_TYPE_WALLPAIRSHR:
00167 fill_reinforced_corner=optns->fill_reinforced_corner;
00168 create_columns_slb_wallpairshr(clm_recs,surr_slb,surr_own,surr_tng);
00169 break;
00170 case SLAB_TYPE_PATH:
00171 create_columns_slb_path(clm_recs,surr_slb,surr_own,surr_tng);
00172 break;
00173 case SLAB_TYPE_CLAIMED:
00174 create_columns_slb_claimed(clm_recs,surr_slb,surr_own,surr_tng);
00175 break;
00176 case SLAB_TYPE_LAVA:
00177 create_columns_slb_lava(clm_recs,surr_slb,surr_own,surr_tng);
00178 break;
00179 case SLAB_TYPE_WATER:
00180 create_columns_slb_water(clm_recs,surr_slb,surr_own,surr_tng);
00181 break;
00182 case SLAB_TYPE_PORTAL:
00183 create_columns_slb_portal(clm_recs,surr_slb,surr_own,surr_tng);
00184 break;
00185 case SLAB_TYPE_TREASURE:
00186 create_columns_slb_treasure(clm_recs,surr_slb,surr_own,surr_tng);
00187 break;
00188 case SLAB_TYPE_LIBRARY:
00189 create_columns_slb_library(clm_recs,surr_slb,surr_own,surr_tng);
00190 break;
00191 case SLAB_TYPE_PRISONCASE:
00192 create_columns_slb_prison(clm_recs,surr_slb,surr_own,surr_tng);
00193 break;
00194 case SLAB_TYPE_TORTURE:
00195 create_columns_slb_torture(clm_recs,surr_slb,surr_own,surr_tng);
00196 break;
00197 case SLAB_TYPE_TRAINING:
00198 create_columns_slb_training(clm_recs,surr_slb,surr_own,surr_tng);
00199 break;
00200 case SLAB_TYPE_DUNGHEART:
00201 create_columns_slb_dungheart(clm_recs,surr_slb,surr_own,surr_tng);
00202 break;
00203 case SLAB_TYPE_WORKSHOP:
00204 create_columns_slb_workshop(clm_recs,surr_slb,surr_own,surr_tng);
00205 break;
00206 case SLAB_TYPE_SCAVENGER:
00207 create_columns_slb_scavenger(clm_recs,surr_slb,surr_own,surr_tng);
00208 break;
00209 case SLAB_TYPE_TEMPLE:
00210 create_columns_slb_temple(clm_recs,surr_slb,surr_own,surr_tng);
00211 break;
00212 case SLAB_TYPE_GRAVEYARD:
00213 create_columns_slb_graveyard(clm_recs,surr_slb,surr_own,surr_tng);
00214 break;
00215 case SLAB_TYPE_HATCHERY:
00216 create_columns_slb_hatchery(clm_recs,surr_slb,surr_own,surr_tng);
00217 break;
00218 case SLAB_TYPE_LAIR:
00219 create_columns_slb_lair(clm_recs,surr_slb,surr_own,surr_tng);
00220 break;
00221 case SLAB_TYPE_BARRACKS:
00222 create_columns_slb_barracks(clm_recs,surr_slb,surr_own,surr_tng);
00223 break;
00224 case SLAB_TYPE_DOORWOOD1:
00225 case SLAB_TYPE_DOORWOOD2:
00226 create_columns_slb_doorwood(clm_recs,surr_slb,surr_own,surr_tng);
00227 break;
00228 case SLAB_TYPE_DOORBRACE1:
00229 case SLAB_TYPE_DOORBRACE2:
00230 create_columns_slb_doorbrace(clm_recs,surr_slb,surr_own,surr_tng);
00231 break;
00232 case SLAB_TYPE_DOORIRON1:
00233 case SLAB_TYPE_DOORIRON2:
00234 create_columns_slb_dooriron(clm_recs,surr_slb,surr_own,surr_tng);
00235 break;
00236 case SLAB_TYPE_DOORMAGIC1:
00237 case SLAB_TYPE_DOORMAGIC2:
00238 create_columns_slb_doormagic(clm_recs,surr_slb,surr_own,surr_tng);
00239 break;
00240 case SLAB_TYPE_BRIDGE:
00241 create_columns_slb_bridge(clm_recs,surr_slb,surr_own,surr_tng);
00242 break;
00243 case SLAB_TYPE_GEMS:
00244 if (optns->unaffected_gems)
00245 create_columns_slb_unaffected_gems(clm_recs,surr_slb,surr_own,surr_tng);
00246 else
00247 create_columns_slb_gems(clm_recs,surr_slb,surr_own,surr_tng);
00248 break;
00249 case SLAB_TYPE_GUARDPOST:
00250 create_columns_slb_guardpost(clm_recs,surr_slb,surr_own,surr_tng);
00251 break;
00252 default:
00253 create_columns_slb_path(clm_recs,surr_slb,surr_own,surr_tng);
00254 break;
00255 }
00256 }
00257
00258
00259
00260
00261 short surrnd_not_enemy(unsigned char *surr_own, short direction)
00262 {
00263 if ((surr_own[IDIR_CENTR]==surr_own[direction%9])
00264 ||((surr_own[direction%9])>=PLAYER_UNSET))
00265 return true;
00266 return false;
00267 }
00268
00269
00270
00271
00272 unsigned char *surr_tng_find(unsigned char **surr_tng,unsigned char type_idx)
00273 {
00274 unsigned char *thing=surr_tng[IDIR_CENTR];
00275 if (thing!=NULL)
00276 {
00277 if (get_thing_type(thing)==type_idx)
00278 return thing;
00279 }
00280 int i;
00281 for (i=0;i<9;i++)
00282 {
00283 thing=surr_tng[i];
00284 if (thing!=NULL)
00285 {
00286 if (get_thing_type(thing)==type_idx)
00287 return thing;
00288 }
00289 }
00290 return NULL;
00291 }
00292
00293 void create_columns_slb_unaffected_rock(struct COLUMN_REC *clm_recs[9],
00294 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00295 {
00296 int i,k;
00297 for (i=0;i<3;i++)
00298 for (k=0;k<3;k++)
00299 {
00300 fill_column_rock(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
00301 }
00302 }
00303
00304 void create_columns_slb_rock(struct COLUMN_REC *clm_recs[9],
00305 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00306 {
00307 create_columns_slb_unaffected_rock(clm_recs,surr_slb,surr_own,surr_tng);
00308
00309 modify_frail_columns(clm_recs,surr_slb,surr_own,surr_tng);
00310 }
00311
00312 void create_columns_slb_gold(struct COLUMN_REC *clm_recs[9],
00313 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00314 {
00315 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
00316 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
00317 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
00318
00319 fill_column_gold(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
00320
00321
00322 int i;
00323 for (i=0;i<4;i++)
00324 {
00325 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER) || (surr_slb[dir_b[i]]==SLAB_TYPE_WATER))
00326 fill_column_gold_nearwater(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00327 else
00328 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA) || (surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
00329 fill_column_gold_nearlava(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00330 else
00331 fill_column_gold(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00332 }
00333
00334 for (i=0;i<4;i++)
00335 {
00336 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER))
00337 fill_column_gold_nearwater(clm_recs[dir_a[i]],surr_own[IDIR_CENTR]);
00338 else
00339 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA))
00340 fill_column_gold_nearlava(clm_recs[dir_a[i]],surr_own[IDIR_CENTR]);
00341 else
00342 fill_column_gold(clm_recs[dir_a[i]],surr_own[IDIR_CENTR]);
00343 }
00344
00345 modify_frail_columns(clm_recs,surr_slb,surr_own,surr_tng);
00346 }
00347
00348
00349
00350
00351
00352 void create_columns_slb_fulldirt(struct COLUMN_REC *clm_recs[9],
00353 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00354 {
00355
00356 fill_column_earth(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
00357
00358 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
00359 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
00360 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
00361 int i;
00362
00363
00364 for (i=0;i<4;i++)
00365 {
00366 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER)||(surr_slb[dir_b[i]]==SLAB_TYPE_WATER))
00367 {
00368 fill_column_earth_nearwater(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00369 } else
00370 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA)||(surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
00371 {
00372 fill_column_earth_nearlava(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00373 } else
00374 {
00375 fill_column_earth(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00376 }
00377 }
00378
00379 for (i=0;i<4;i++)
00380 {
00381 if (surr_slb[dir_a[i]]==SLAB_TYPE_WATER)
00382 fill_column_earth_nearwater(clm_recs[dir_a[i]],surr_own[IDIR_CENTR]);
00383 else
00384 if (surr_slb[dir_a[i]]==SLAB_TYPE_LAVA)
00385 fill_column_earth_nearlava(clm_recs[dir_a[i]],surr_own[IDIR_CENTR]);
00386 else
00387 fill_column_earth(clm_recs[dir_a[i]],surr_own[IDIR_CENTR]);
00388 }
00389 }
00390
00391 void create_columns_slb_earth(struct COLUMN_REC *clm_recs[9],
00392 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00393 {
00394
00395 create_columns_slb_fulldirt(clm_recs,surr_slb,surr_own,surr_tng);
00396
00397 modify_frail_columns(clm_recs,surr_slb,surr_own,surr_tng);
00398 }
00399
00400 void create_columns_slb_torchdirt(struct COLUMN_REC *clm_recs[9],
00401 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00402 {
00403 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
00404
00405 create_columns_slb_earth(clm_recs,surr_slb,surr_own,surr_tng);
00406
00407 int i;
00408 short has_torches=false;
00409 for (i=0;i<4;i++)
00410 {
00411
00412
00413 unsigned char *thing=surr_tng[dir_a[i]];
00414 if ((thing!=NULL)&&(is_torch(thing)))
00415 {
00416
00417 unsigned short height=get_thing_subtile_h(thing);
00418 if (get_thing_subtpos_h(thing)>127) height++;
00419 clm_recs[dir_a[i]]->c[height%8]=0x018;
00420 has_torches=true;
00421 }
00422 }
00423 if (!has_torches)
00424 modify_frail_columns(clm_recs,surr_slb,surr_own,surr_tng);
00425 }
00426
00427 void create_columns_slb_skulls_on_lava(struct COLUMN_REC *clm_recs[9],
00428 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00429 {
00430 create_columns_slb_lava(clm_recs,surr_slb,surr_own,surr_tng);
00431 place_column_wall_lair_b(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
00432 }
00433
00434 void create_columns_slb_skulls_on_path(struct COLUMN_REC *clm_recs[9],
00435 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00436 {
00437 create_columns_slb_path(clm_recs,surr_slb,surr_own,surr_tng);
00438 place_column_wall_lair_b(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
00439 }
00440
00441 void create_columns_slb_skulls_on_claimed(struct COLUMN_REC *clm_recs[9],
00442 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00443 {
00444 create_columns_slb_claimed(clm_recs,surr_slb,surr_own,surr_tng);
00445 place_column_wall_lair_b(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
00446 }
00447
00448
00449
00450
00451 void create_columns_slb_wallbrick(struct COLUMN_REC *clm_recs[9], short *allow_relief,
00452 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00453 {
00454
00455 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
00456 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
00457 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
00458 int i;
00459
00460 for (i=0;i<9;i++)
00461 allow_relief[i]=true;
00462
00463
00464
00465 fill_column_wall_centr(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
00466
00467
00468 for (i=0;i<4;i++)
00469 {
00470
00471 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER) || (surr_slb[dir_b[i]]==SLAB_TYPE_WATER))
00472 fill_column_wallground_nearwater(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00473 else
00474 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA) || (surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
00475 fill_column_wallground_nearlava(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00476 else
00477 fill_column_earthground(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00478
00479 if (((slab_is_wall(surr_slb[dir_a[i]])&&surrnd_not_enemy(surr_own,dir_a[i]))
00480 &&((slab_is_short(surr_slb[dir_b[i]]))||(!surrnd_not_enemy(surr_own,dir_b[i]))))
00481 ||((slab_is_wall(surr_slb[dir_b[i]])&&surrnd_not_enemy(surr_own,dir_b[i]))
00482 &&((slab_is_short(surr_slb[dir_a[i]]))||(!surrnd_not_enemy(surr_own,dir_a[i])))))
00483 {
00484
00485
00486 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER) || (surr_slb[dir_b[i]]==SLAB_TYPE_WATER) ||
00487 (surr_slb[dir_a[i]]==SLAB_TYPE_LAVA) || (surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
00488 place_column_wall_redsmbrick(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00489 else
00490 place_column_wall_redsmbrick_dkbtm(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00491 } else
00492
00493 if (((slab_is_wall(surr_slb[dir_a[i]])&&surrnd_not_enemy(surr_own,dir_a[i]))
00494 &&((slab_is_door(surr_slb[dir_b[i]]))||(!surrnd_not_enemy(surr_own,dir_b[i]))))
00495 ||((slab_is_wall(surr_slb[dir_b[i]])&&surrnd_not_enemy(surr_own,dir_b[i]))
00496 &&((slab_is_door(surr_slb[dir_a[i]]))||(!surrnd_not_enemy(surr_own,dir_a[i])))))
00497 {
00498 place_column_wall_redsmbrick_dkbtm(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00499 if (slab_is_door(surr_slb[dir_a[i]]))
00500 allow_relief[dir_a[i]]=false;
00501 if (slab_is_door(surr_slb[dir_b[i]]))
00502 allow_relief[dir_b[i]]=false;
00503 } else
00504
00505 if ((slab_is_tall_unclmabl(surr_slb[dir_a[i]])&&slab_is_tall_unclmabl(surr_slb[dir_b[i]]))
00506 ||(((slab_is_tall(surr_slb[dir_a[i]])&&surrnd_not_enemy(surr_own,dir_a[i]))
00507 &&(slab_is_tall(surr_slb[dir_b[i]])&& surrnd_not_enemy(surr_own,dir_b[i])))))
00508 {
00509 if ((fill_reinforced_corner)&&(slab_is_short(surr_slb[dir_c[i]]))
00510 &&(!(surr_slb[dir_c[i]]==SLAB_TYPE_PATH)))
00511 {
00512 if (fill_reinforced_corner==1)
00513 place_column_wall_cobblestones(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00514 else
00515 place_column_wall_cobblestones_mk(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00516 } else
00517 {
00518 fill_column_earth(clm_recs[dir_c[i]],surr_own[IDIR_CENTR]);
00519 }
00520 allow_relief[dir_a[i]]=false;
00521 allow_relief[dir_b[i]]=false;
00522 } else
00523
00524 {
00525 place_column_wall_cobblestones(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00526 allow_relief[dir_a[i]]=false;
00527 allow_relief[dir_b[i]]=false;
00528 allow_relief[dir_c[i]]=false;
00529 }
00530 }
00531
00532 for (i=0;i<4;i++)
00533 {
00534
00535 if (surr_slb[dir_a[i]]==SLAB_TYPE_WATER)
00536 fill_column_wallground_nearwater(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
00537 else
00538 if (surr_slb[dir_a[i]]==SLAB_TYPE_LAVA)
00539 fill_column_wallground_nearlava(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
00540 else
00541 fill_column_earthground(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
00542 }
00543
00544
00545 if ((slab_is_wall(surr_slb[IDIR_NORTH])&&surrnd_not_enemy(surr_own,IDIR_NORTH))
00546 ||slab_is_tall_unclmabl(surr_slb[IDIR_NORTH]))
00547 {
00548 fill_column_earth(clm_recs[IDIR_NORTH],surr_own[IDIR_CENTR]);
00549 allow_relief[IDIR_NORTH]=false;
00550 } else
00551 if ((surr_slb[IDIR_NORTH]==SLAB_TYPE_WATER)||(surr_slb[IDIR_NORTH]==SLAB_TYPE_LAVA))
00552 {
00553 if (allow_relief[IDIR_NORTH])
00554 place_column_wall_cobblestones(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
00555 else
00556 place_column_wall_redsmbrick(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
00557 allow_relief[IDIR_NORTH]=false;
00558 } else
00559 if (allow_relief[IDIR_NE])
00560 {
00561 place_column_wall_redsmbrick_c(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
00562 } else
00563 {
00564 place_column_wall_redsmbrick_b(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
00565 }
00566
00567 if ((slab_is_wall(surr_slb[IDIR_EAST])&&surrnd_not_enemy(surr_own,IDIR_EAST))
00568 ||slab_is_tall_unclmabl(surr_slb[IDIR_EAST]))
00569 {
00570 fill_column_earth(clm_recs[IDIR_EAST],surr_own[IDIR_CENTR]);
00571 allow_relief[IDIR_EAST]=false;
00572 } else
00573 if ((surr_slb[IDIR_EAST]==SLAB_TYPE_WATER)||(surr_slb[IDIR_EAST]==SLAB_TYPE_LAVA))
00574 {
00575 if (allow_relief[IDIR_EAST])
00576 place_column_wall_cobblestones(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
00577 else
00578 place_column_wall_redsmbrick(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
00579 allow_relief[IDIR_EAST]=false;
00580 } else
00581 if (allow_relief[IDIR_SE])
00582 {
00583 place_column_wall_redsmbrick_c(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
00584 } else
00585 {
00586 place_column_wall_redsmbrick_b(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
00587 }
00588
00589 if ((slab_is_wall(surr_slb[IDIR_SOUTH])&&surrnd_not_enemy(surr_own,IDIR_SOUTH))
00590 ||slab_is_tall_unclmabl(surr_slb[IDIR_SOUTH]))
00591 {
00592 fill_column_earth(clm_recs[IDIR_SOUTH],surr_own[IDIR_CENTR]);
00593 allow_relief[IDIR_SOUTH]=false;
00594 } else
00595 if ((surr_slb[IDIR_SOUTH]==SLAB_TYPE_WATER)||(surr_slb[IDIR_SOUTH]==SLAB_TYPE_LAVA))
00596 {
00597 if (allow_relief[IDIR_SOUTH])
00598 place_column_wall_cobblestones(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
00599 else
00600 place_column_wall_redsmbrick(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
00601 allow_relief[IDIR_SOUTH]=false;
00602 } else
00603 if (allow_relief[IDIR_SW])
00604 {
00605 place_column_wall_redsmbrick_b(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
00606 } else
00607 {
00608 place_column_wall_redsmbrick_c(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
00609 }
00610
00611 if ((slab_is_wall(surr_slb[IDIR_WEST])&&surrnd_not_enemy(surr_own,IDIR_WEST))
00612 ||slab_is_tall_unclmabl(surr_slb[IDIR_WEST]))
00613 {
00614 fill_column_earth(clm_recs[IDIR_WEST],surr_own[IDIR_CENTR]);
00615 allow_relief[IDIR_WEST]=false;
00616 } else
00617 if ((surr_slb[IDIR_WEST]==SLAB_TYPE_WATER)||(surr_slb[IDIR_WEST]==SLAB_TYPE_LAVA))
00618 {
00619 if (allow_relief[IDIR_WEST])
00620 place_column_wall_cobblestones(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
00621 else
00622 place_column_wall_redsmbrick(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
00623 allow_relief[IDIR_WEST]=false;
00624 } else
00625 if (allow_relief[IDIR_NW])
00626 {
00627 place_column_wall_redsmbrick_b(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
00628 } else
00629 {
00630 place_column_wall_redsmbrick_c(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
00631 }
00632
00633 }
00634
00635
00636
00637
00638
00639 void fill_columns_slb_roomrelief(struct COLUMN_REC *clm_recs[9], short *allow_relief,
00640 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00641 {
00642 const unsigned short dir_a[]={IDIR_NW, IDIR_NW, IDIR_NE, IDIR_SW};
00643 const unsigned short dir_b[]={IDIR_WEST, IDIR_NORTH,IDIR_EAST, IDIR_SOUTH};
00644 const unsigned short dir_c[]={IDIR_SW, IDIR_NE, IDIR_SE, IDIR_SE};
00645 const unsigned short dir_d[]={IDIR_NORTH,IDIR_WEST, IDIR_NORTH,IDIR_WEST,};
00646 const unsigned short dir_e[]={IDIR_SOUTH,IDIR_EAST, IDIR_SOUTH,IDIR_EAST,};
00647 int i;
00648 for (i=0;i<4;i++)
00649 {
00650 unsigned short slab=surr_slb[dir_b[i]];
00651 if ((allow_relief[dir_b[i]])&&(slab_is_room(slab)))
00652 {
00653
00654 short corner=false;
00655 short edge=false;
00656
00657 if (((!slab_is_short(surr_slb[dir_d[i]]))&&(surrnd_not_enemy(surr_own,dir_d[i])))
00658 ||((!slab_is_short(surr_slb[dir_e[i]]))&&(surrnd_not_enemy(surr_own,dir_e[i]))))
00659 edge=true;
00660
00661 if ((!slab_is_room(surr_slb[dir_a[i]]))||(!slab_is_room(surr_slb[dir_c[i]])))
00662 corner=true;
00663 if (fill_side_columns_room_relief(clm_recs[dir_a[i]],clm_recs[dir_b[i]],
00664 clm_recs[dir_c[i]],slab,surr_own[IDIR_CENTR],corner,edge))
00665 allow_relief[dir_b[i]]=false;
00666 }
00667 }
00668 }
00669
00670
00671
00672
00673
00674
00675
00676 short fill_side_columns_room_relief(struct COLUMN_REC *clm_reca,struct COLUMN_REC *clm_recb,
00677 struct COLUMN_REC *clm_recc,unsigned short room_slab,unsigned char owner, short corner, short edge)
00678 {
00679
00680
00681 switch (room_slab)
00682 {
00683 case SLAB_TYPE_PORTAL:
00684 place_column_wall_portal_a(clm_reca,owner);
00685 place_column_wall_portal_b(clm_recb,owner);
00686 place_column_wall_portal_a(clm_recc,owner);
00687 return true;
00688 case SLAB_TYPE_TREASURE:
00689 fill_column_wall_drapebrick_a(clm_reca,owner);
00690 fill_column_wall_drapebrick_b(clm_recb,owner);
00691 fill_column_wall_drapebrick_c(clm_recc,owner);
00692 if (!corner)
00693 {
00694 place_column_wall_treasure_a(clm_reca,owner);
00695 place_column_wall_treasure_b(clm_recb,owner);
00696 place_column_wall_treasure_c(clm_recc,owner);
00697 }
00698 return true;
00699 case SLAB_TYPE_LIBRARY:
00700 fill_column_wall_drapebrick_a(clm_reca,owner);
00701 fill_column_wall_drapebrick_b(clm_recb,owner);
00702 fill_column_wall_drapebrick_c(clm_recc,owner);
00703 if (corner)
00704 {
00705
00706 } else
00707 {
00708 place_column_wall_library_a(clm_reca,owner);
00709 place_column_wall_library_b(clm_recb,owner);
00710 place_column_wall_library_c(clm_recc,owner);
00711 }
00712 return true;
00713 case SLAB_TYPE_PRISONCASE:
00714 if (corner)
00715 {
00716 fill_column_wall_drapebrick_a(clm_reca,owner);
00717 fill_column_wall_drapebrick_b(clm_recb,owner);
00718 fill_column_wall_drapebrick_c(clm_recc,owner);
00719
00720 } else
00721 {
00722 place_column_wall_prison_a(clm_reca,owner);
00723 place_column_wall_prison_b(clm_recb,owner);
00724 place_column_wall_prison_c(clm_recc,owner);
00725 }
00726 return true;
00727 case SLAB_TYPE_TORTURE:
00728 place_column_wall_torture_a(clm_reca,owner);
00729 place_column_wall_torture_b(clm_recb,owner);
00730 place_column_wall_torture_c(clm_recc,owner);
00731 return true;
00732 case SLAB_TYPE_TRAINING:
00733 fill_column_wall_drapebrick_a(clm_reca,owner);
00734 fill_column_wall_drapebrick_b(clm_recb,owner);
00735 fill_column_wall_drapebrick_c(clm_recc,owner);
00736 if (corner)
00737 {
00738
00739 } else
00740 {
00741 place_column_wall_training_a(clm_reca,owner);
00742 place_column_wall_training_b(clm_recb,owner);
00743 place_column_wall_training_c(clm_recc,owner);
00744 }
00745 return true;
00746 case SLAB_TYPE_WORKSHOP:
00747 if (corner)
00748 {
00749 fill_column_wall_drapebrick_a(clm_reca,owner);
00750 fill_column_wall_drapebrick_b(clm_recb,owner);
00751 fill_column_wall_drapebrick_c(clm_recc,owner);
00752
00753 } else
00754 {
00755 place_column_wall_workshop_a(clm_reca,owner);
00756 place_column_wall_workshop_b(clm_recb,owner);
00757 place_column_wall_workshop_c(clm_recc,owner);
00758 }
00759 return true;
00760 case SLAB_TYPE_SCAVENGER:
00761 fill_column_wall_drapebrick_a(clm_reca,owner);
00762 fill_column_wall_drapebrick_b(clm_recb,owner);
00763 fill_column_wall_drapebrick_c(clm_recc,owner);
00764 if (corner)
00765 {
00766
00767 } else
00768 {
00769 place_column_wall_scavenger_a(clm_reca,owner);
00770 place_column_wall_scavenger_b(clm_recb,owner);
00771 place_column_wall_scavenger_c(clm_recc,owner);
00772 }
00773 return true;
00774 case SLAB_TYPE_TEMPLE:
00775 if (corner)
00776 {
00777 fill_column_wall_drapebrick_a(clm_reca,owner);
00778 fill_column_wall_drapebrick_b(clm_recb,owner);
00779 fill_column_wall_drapebrick_c(clm_recc,owner);
00780
00781 } else
00782 {
00783 place_column_wall_temple_a(clm_reca,owner);
00784 place_column_wall_temple_b(clm_recb,owner);
00785 place_column_wall_temple_c(clm_recc,owner);
00786 }
00787 return true;
00788 case SLAB_TYPE_GRAVEYARD:
00789 fill_column_wall_drapebrick_a(clm_reca,owner);
00790 place_column_wall_graveyard_a(clm_reca,owner);
00791 fill_column_wall_drapebrick_b(clm_recb,owner);
00792 place_column_wall_graveyard_b(clm_recb,owner);
00793 fill_column_wall_drapebrick_c(clm_recc,owner);
00794 place_column_wall_graveyard_c(clm_recc,owner);
00795 return true;
00796 case SLAB_TYPE_HATCHERY:
00797 fill_column_wall_drapebrick_a(clm_reca,owner);
00798 fill_column_wall_drapebrick_b(clm_recb,owner);
00799 fill_column_wall_drapebrick_c(clm_recc,owner);
00800 if (corner)
00801 {
00802
00803 } else
00804 {
00805 place_column_wall_hatchery_a(clm_reca,owner);
00806 place_column_wall_hatchery_b(clm_recb,owner);
00807 place_column_wall_hatchery_c(clm_recc,owner);
00808 }
00809 return true;
00810 case SLAB_TYPE_LAIR:
00811 if (corner)
00812 {
00813 place_column_wall_laircrnr_a(clm_reca,owner);
00814 place_column_wall_laircrnr_b(clm_recb,owner);
00815 place_column_wall_laircrnr_c(clm_recc,owner);
00816 } else
00817 {
00818 place_column_wall_lair_a(clm_reca,owner);
00819 place_column_wall_lair_b(clm_recb,owner);
00820 place_column_wall_lair_c(clm_recc,owner);
00821 }
00822 return true;
00823 case SLAB_TYPE_BARRACKS:
00824 if (corner)
00825 {
00826 fill_column_wall_drapebrick_a(clm_reca,owner);
00827 fill_column_wall_drapebrick_b(clm_recb,owner);
00828 fill_column_wall_drapebrick_c(clm_recc,owner);
00829
00830 } else
00831 {
00832 place_column_wall_barracks_a(clm_reca,owner);
00833 place_column_wall_barracks_b(clm_recb,owner);
00834 place_column_wall_barracks_c(clm_recc,owner);
00835 }
00836 return true;
00837 case SLAB_TYPE_DUNGHEART:
00838 if (corner)
00839 {
00840 fill_column_wall_drapebrick_a(clm_reca,owner);
00841 fill_column_wall_drapebrick_b(clm_recb,owner);
00842 fill_column_wall_drapebrick_c(clm_recc,owner);
00843 }
00844 return true;
00845 case SLAB_TYPE_BRIDGE:
00846 case SLAB_TYPE_GUARDPOST:
00847 default:
00848 return false;
00849 }
00850 }
00851
00852
00853
00854
00855 void create_columns_slb_wall_force_relief_splatbody(struct COLUMN_REC *clm_recs[9],
00856 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00857 {
00858 const unsigned short dir_a[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
00859 const unsigned short dir_b[]={IDIR_WEST, IDIR_NORTH,IDIR_EAST, IDIR_SOUTH};
00860
00861 int i;
00862 for (i=0;i<4;i++)
00863 {
00864 fill_column_wall_cobblestones(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
00865 fill_column_wall_redsmbrick_b(clm_recs[dir_b[i]], surr_own[IDIR_CENTR]);
00866 }
00867 fill_column_wall_centr(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
00868
00869 const unsigned short *dir;
00870 short draw_oposite;
00871 if (slab_is_short(surr_slb[IDIR_WEST]) && slab_is_short(surr_slb[IDIR_NORTH]))
00872 {
00873 dir=dir_rot_000;
00874 draw_oposite=false;
00875 } else
00876 if (slab_is_short(surr_slb[IDIR_EAST]) && slab_is_short(surr_slb[IDIR_SOUTH]))
00877 {
00878 dir=dir_rot_180;
00879 draw_oposite=false;
00880 } else
00881 if (slab_is_short(surr_slb[IDIR_EAST]) && slab_is_short(surr_slb[IDIR_WEST]))
00882 {
00883 dir=dir_rot_090;
00884 draw_oposite=true;
00885 } else
00886 if (slab_is_short(surr_slb[IDIR_NORTH]) && slab_is_short(surr_slb[IDIR_SOUTH]))
00887 {
00888 dir=dir_rot_000;
00889 draw_oposite=true;
00890 } else
00891 if (slab_is_short(surr_slb[IDIR_EAST]) || slab_is_short(surr_slb[IDIR_SOUTH]))
00892 {
00893 dir=dir_rot_180;
00894 draw_oposite=false;
00895 } else
00896
00897 {
00898 dir=dir_rot_000;
00899 draw_oposite=false;
00900 }
00901
00902 if (draw_oposite)
00903 {
00904 place_column_wall_torture_a(clm_recs[dir[0]],surr_own[IDIR_CENTR]);
00905 place_column_wall_torture_b(clm_recs[dir[1]],surr_own[IDIR_CENTR]);
00906 place_column_wall_torture_c(clm_recs[dir[2]],surr_own[IDIR_CENTR]);
00907 place_column_wall_torture_a(clm_recs[dir[6]],surr_own[IDIR_CENTR]);
00908 place_column_wall_torture_b(clm_recs[dir[7]],surr_own[IDIR_CENTR]);
00909 place_column_wall_torture_c(clm_recs[dir[8]],surr_own[IDIR_CENTR]);
00910 } else
00911 {
00912 if (dir==dir_rot_180)
00913 {
00914 place_column_wall_torture_b(clm_recs[dir[1]],surr_own[IDIR_CENTR]);
00915 place_column_wall_torture_b(clm_recs[dir[3]],surr_own[IDIR_CENTR]);
00916 place_column_wall_torture_a(clm_recs[dir[2]],surr_own[IDIR_CENTR]);
00917 place_column_wall_torture_c(clm_recs[dir[0]],surr_own[IDIR_CENTR]);
00918 place_column_wall_torture_a(clm_recs[dir[6]],surr_own[IDIR_CENTR]);
00919 } else
00920 {
00921 place_column_wall_torture_b(clm_recs[dir[1]],surr_own[IDIR_CENTR]);
00922 place_column_wall_torture_b(clm_recs[dir[3]],surr_own[IDIR_CENTR]);
00923 place_column_wall_torture_c(clm_recs[dir[2]],surr_own[IDIR_CENTR]);
00924 place_column_wall_torture_a(clm_recs[dir[0]],surr_own[IDIR_CENTR]);
00925 place_column_wall_torture_c(clm_recs[dir[6]],surr_own[IDIR_CENTR]);
00926 }
00927 }
00928 }
00929
00930
00931
00932
00933 void create_columns_slb_walldrape(struct COLUMN_REC *clm_recs[9],
00934 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00935 {
00936
00937
00938 short allow_relief[9];
00939 create_columns_slb_wallbrick(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
00940 fill_columns_slb_roomrelief(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
00941
00942 const unsigned short dir_a[]={IDIR_NW, IDIR_NW, IDIR_NE, IDIR_SW};
00943 const unsigned short dir_b[]={IDIR_WEST, IDIR_NORTH,IDIR_EAST, IDIR_SOUTH};
00944 const unsigned short dir_c[]={IDIR_SW, IDIR_NE, IDIR_SE, IDIR_SE};
00945 int i;
00946 for (i=0;i<4;i++)
00947 {
00948 if (allow_relief[dir_b[i]])
00949 {
00950 fill_column_wall_drapebrick_a(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
00951 fill_column_wall_drapebrick_b(clm_recs[dir_b[i]], surr_own[IDIR_CENTR]);
00952 fill_column_wall_drapebrick_c(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
00953 }
00954 }
00955 }
00956
00957
00958
00959
00960 void create_columns_slb_walltorch(struct COLUMN_REC *clm_recs[9],
00961 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00962 {
00963 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
00964
00965 short allow_relief[9];
00966 create_columns_slb_wallbrick(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
00967
00968 int i;
00969 for (i=0;i<4;i++)
00970 {
00971 unsigned char *thing=surr_tng[dir_a[i]];
00972 if ((thing!=NULL)&&(is_torch(thing)))
00973 {
00974
00975 unsigned short height=get_thing_subtile_h(thing);
00976 if (get_thing_subtpos_h(thing)>127) height++;
00977 clm_recs[dir_a[i]]->c[height%8]=0x077;
00978 allow_relief[dir_a[i]]=false;
00979 }
00980 }
00981 fill_columns_slb_roomrelief(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
00982 }
00983
00984 void create_columns_slb_wallwtwins(struct COLUMN_REC *clm_recs[9],
00985 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
00986 {
00987
00988
00989 short allow_relief[9];
00990 create_columns_slb_wallbrick(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
00991 fill_columns_slb_roomrelief(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
00992
00993 if (allow_relief[IDIR_NORTH])
00994 {
00995 fill_column_wall_twinsbrick_a(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
00996 fill_column_wall_twinsbrick_b(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
00997 fill_column_wall_twinsbrick_c(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
00998 }
00999 if (allow_relief[IDIR_SOUTH])
01000 {
01001 fill_column_wall_twinsbrick_a(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
01002 fill_column_wall_twinsbrick_b(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
01003 fill_column_wall_twinsbrick_c(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
01004 }
01005 if (allow_relief[IDIR_EAST])
01006 {
01007 fill_column_wall_twinsbrick_a(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
01008 fill_column_wall_twinsbrick_b(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
01009 fill_column_wall_twinsbrick_c(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
01010 }
01011 if (allow_relief[IDIR_WEST])
01012 {
01013 fill_column_wall_twinsbrick_a(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
01014 fill_column_wall_twinsbrick_b(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
01015 fill_column_wall_twinsbrick_c(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
01016 }
01017 }
01018 void create_columns_slb_wallwwoman(struct COLUMN_REC *clm_recs[9],
01019 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01020 {
01021
01022
01023 short allow_relief[9];
01024 create_columns_slb_wallbrick(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
01025 fill_columns_slb_roomrelief(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
01026
01027 if (allow_relief[IDIR_NORTH])
01028 {
01029 fill_column_wall_womanbrick_a(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
01030 fill_column_wall_womanbrick_b(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
01031 fill_column_wall_womanbrick_c(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
01032 }
01033 if (allow_relief[IDIR_SOUTH])
01034 {
01035 fill_column_wall_womanbrick_a(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
01036 fill_column_wall_womanbrick_b(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
01037 fill_column_wall_womanbrick_c(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
01038 }
01039 if (allow_relief[IDIR_EAST])
01040 {
01041 fill_column_wall_womanbrick_a(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
01042 fill_column_wall_womanbrick_b(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
01043 fill_column_wall_womanbrick_c(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
01044 }
01045 if (allow_relief[IDIR_WEST])
01046 {
01047 fill_column_wall_womanbrick_a(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
01048 fill_column_wall_womanbrick_b(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
01049 fill_column_wall_womanbrick_c(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
01050 }
01051 }
01052
01053 void create_columns_slb_wallpairshr(struct COLUMN_REC *clm_recs[9],
01054 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01055 {
01056
01057
01058 short allow_relief[9];
01059 create_columns_slb_wallbrick(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
01060 fill_columns_slb_roomrelief(clm_recs,allow_relief,surr_slb,surr_own,surr_tng);
01061
01062 if (allow_relief[IDIR_NORTH])
01063 {
01064 fill_column_wall_pairshrbrick_a(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
01065 fill_column_wall_pairshrbrick_b(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
01066 fill_column_wall_pairshrbrick_c(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
01067 }
01068 if (allow_relief[IDIR_SOUTH])
01069 {
01070 fill_column_wall_pairshrbrick_a(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
01071 fill_column_wall_pairshrbrick_b(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
01072 fill_column_wall_pairshrbrick_c(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
01073 }
01074 if (allow_relief[IDIR_EAST])
01075 {
01076 fill_column_wall_pairshrbrick_a(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
01077 fill_column_wall_pairshrbrick_b(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
01078 fill_column_wall_pairshrbrick_c(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
01079 }
01080 if (allow_relief[IDIR_WEST])
01081 {
01082 fill_column_wall_pairshrbrick_a(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
01083 fill_column_wall_pairshrbrick_b(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
01084 fill_column_wall_pairshrbrick_c(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
01085 }
01086 }
01087
01088 void create_columns_slb_path(struct COLUMN_REC *clm_recs[9],
01089 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01090 {
01091 int i,k;
01092 for (i=0;i<3;i++)
01093 for (k=0;k<3;k++)
01094 {
01095 fill_column_path(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
01096 }
01097 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x02e, 0x02f);
01098 }
01099
01100 void create_columns_slb_claimed(struct COLUMN_REC *clm_recs[9],
01101 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01102 {
01103 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
01104 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
01105 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
01106
01107
01108 fill_column_claimedgnd_centr(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
01109
01110
01111 int i;
01112 for (i=0;i<4;i++)
01113 {
01114 fill_column_rec_sim(clm_recs[dir_c[i]], 0, 0x0ce,
01115 0x07f, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01116
01117 if (slab_is_claimedgnd(surr_slb[dir_a[i]])&&surrnd_not_enemy(surr_own,dir_a[i])&&
01118 slab_is_claimedgnd(surr_slb[dir_b[i]])&&surrnd_not_enemy(surr_own,dir_b[i]))
01119 {
01120 clm_recs[dir_c[i]]->c[0]=0x07e +rnd(3);
01121 } else
01122 if (slab_is_claimedgnd(surr_slb[dir_a[i]])&&surrnd_not_enemy(surr_own,dir_a[i]))
01123 {
01124 switch (dir_c[i])
01125 {
01126 case IDIR_NW:
01127 clm_recs[dir_c[i]]->c[0]=0x082;
01128 break;
01129 case IDIR_NE:
01130 clm_recs[dir_c[i]]->c[0]=0x085;
01131 break;
01132 case IDIR_SW:
01133 clm_recs[dir_c[i]]->c[0]=0x084;
01134 break;
01135 case IDIR_SE:
01136 clm_recs[dir_c[i]]->c[0]=0x087;
01137 break;
01138 }
01139 } else
01140 if (slab_is_claimedgnd(surr_slb[dir_b[i]])&&surrnd_not_enemy(surr_own,dir_b[i]))
01141 {
01142 switch (dir_c[i])
01143 {
01144 case IDIR_NW:
01145 clm_recs[dir_c[i]]->c[0]=0x084;
01146 break;
01147 case IDIR_SW:
01148 clm_recs[dir_c[i]]->c[0]=0x087;
01149 break;
01150 case IDIR_NE:
01151 clm_recs[dir_c[i]]->c[0]=0x082;
01152 break;
01153 case IDIR_SE:
01154 clm_recs[dir_c[i]]->c[0]=0x085;
01155 break;
01156 }
01157 } else
01158 {
01159 switch (dir_c[i])
01160 {
01161 case IDIR_NW:
01162 clm_recs[dir_c[i]]->c[0]=0x081;
01163 break;
01164 case IDIR_NE:
01165 clm_recs[dir_c[i]]->c[0]=0x083;
01166 break;
01167 case IDIR_SW:
01168 clm_recs[dir_c[i]]->c[0]=0x086;
01169 break;
01170 case IDIR_SE:
01171 clm_recs[dir_c[i]]->c[0]=0x088;
01172 break;
01173 }
01174 }
01175 }
01176
01177
01178 for (i=0;i<4;i++)
01179 {
01180 fill_column_rec_sim(clm_recs[dir_a[i]], 0, 0x0ce,
01181 0x07f, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01182
01183 if (slab_is_claimedgnd(surr_slb[dir_a[i]])&&surrnd_not_enemy(surr_own,dir_a[i]))
01184 {
01185 clm_recs[dir_a[i]]->c[0]=0x07e +rnd(3);
01186 } else
01187 {
01188 switch (dir_a[i])
01189 {
01190 case IDIR_SOUTH:
01191 clm_recs[dir_a[i]]->c[0]=0x087;
01192 break;
01193 case IDIR_WEST:
01194 clm_recs[dir_a[i]]->c[0]=0x084;
01195 break;
01196 case IDIR_NORTH:
01197 clm_recs[dir_a[i]]->c[0]=0x082;
01198 break;
01199 case IDIR_EAST:
01200 clm_recs[dir_a[i]]->c[0]=0x085;
01201 break;
01202 }
01203 }
01204 }
01205
01206 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x094, 0x093);
01207 }
01208
01209 void create_columns_slb_lava(struct COLUMN_REC *clm_recs[9],
01210 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01211 {
01212 int i,k;
01213 for (i=0;i<3;i++)
01214 for (k=0;k<3;k++)
01215 {
01216 fill_column_lava(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
01217 }
01218 }
01219
01220 void create_columns_slb_water(struct COLUMN_REC *clm_recs[9],
01221 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01222 {
01223 int i,k;
01224 for (i=0;i<3;i++)
01225 for (k=0;k<3;k++)
01226 {
01227 fill_column_water(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
01228 }
01229 }
01230
01231 void create_columns_slb_unaffected_gems(struct COLUMN_REC *clm_recs[9],
01232 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01233 {
01234
01235 int i,k;
01236 for (i=0;i<3;i++)
01237 for (k=0;k<3;k++)
01238 {
01239 fill_column_gem(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
01240 }
01241 }
01242
01243 void create_columns_slb_gems(struct COLUMN_REC *clm_recs[9],
01244 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01245 {
01246 create_columns_slb_unaffected_gems(clm_recs,surr_slb,surr_own,surr_tng);
01247
01248 modify_frail_columns(clm_recs,surr_slb,surr_own,surr_tng);
01249 }
01250
01251 void create_columns_slb_thingems_path(struct COLUMN_REC *clm_recs[9],
01252 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01253 {
01254 int i,k;
01255 for (i=0;i<3;i++)
01256 for (k=0;k<3;k++)
01257 {
01258 fill_column_path(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
01259 }
01260 fill_column_gem(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01261 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x02e, 0x02f);
01262 }
01263
01264 void create_columns_slb_portal(struct COLUMN_REC *clm_recs[9],
01265 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01266 {
01267 create_columns_slb_room(create_columns_slb_portal_floor,create_columns_slb_portal_edge,
01268 create_columns_slb_portal_corner,create_columns_slb_portal_inside,create_columns_slb_portal_floor,
01269 clm_recs,surr_slb,surr_own,surr_tng);
01270 }
01271
01272 void create_columns_slb_treasure(struct COLUMN_REC *clm_recs[9],
01273 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01274 {
01275 create_columns_slb_room(create_columns_slb_treasure_floor,create_columns_slb_treasure_edge,
01276 create_columns_slb_treasure_corner,create_columns_slb_treasure_inside,create_columns_slb_treasure_floor,
01277 clm_recs,surr_slb,surr_own,surr_tng);
01278 }
01279
01280 void create_columns_slb_library(struct COLUMN_REC *clm_recs[9],
01281 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01282 {
01283 create_columns_slb_room(create_columns_slb_library_floor,create_columns_slb_library_edge,
01284 create_columns_slb_library_corner,create_columns_slb_library_inside,create_columns_slb_library_floor,
01285 clm_recs,surr_slb,surr_own,surr_tng);
01286 }
01287
01288 void create_columns_slb_prison(struct COLUMN_REC *clm_recs[9],
01289 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01290 {
01291 create_columns_slb_room(create_columns_slb_prison_floor,create_columns_slb_prison_edge,
01292 create_columns_slb_prison_corner,create_columns_slb_prison_inside,create_columns_slb_prison_floor,
01293 clm_recs,surr_slb,surr_own,surr_tng);
01294 }
01295
01296 void create_columns_slb_torture(struct COLUMN_REC *clm_recs[9],
01297 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01298 {
01299 create_columns_slb_room(create_columns_slb_torture_floor,create_columns_slb_torture_edge,
01300 create_columns_slb_torture_corner,create_columns_slb_torture_inside,create_columns_slb_torture_floor,
01301 clm_recs,surr_slb,surr_own,surr_tng);
01302 }
01303
01304 void create_columns_slb_training(struct COLUMN_REC *clm_recs[9],
01305 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01306 {
01307 create_columns_slb_room(create_columns_slb_training_floor,create_columns_slb_training_edge,
01308 create_columns_slb_training_corner,create_columns_slb_training_inside,create_columns_slb_training_floor,
01309 clm_recs,surr_slb,surr_own,surr_tng);
01310 }
01311
01312 void create_columns_slb_dungheart(struct COLUMN_REC *clm_recs[9],
01313 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01314 {
01315
01316
01317 create_columns_slb_room(create_columns_slb_dungheart_nearinsd,create_columns_slb_dungheart_edge,
01318 create_columns_slb_dungheart_corner,create_columns_slb_dungheart_inside,create_columns_slb_dungheart_nearinsd,
01319 clm_recs,surr_slb,surr_own,surr_tng);
01320 }
01321
01322 void create_columns_slb_workshop(struct COLUMN_REC *clm_recs[9],
01323 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01324 {
01325 create_columns_slb_room(create_columns_slb_workshop_floor,create_columns_slb_workshop_edge,
01326 create_columns_slb_workshop_corner,create_columns_slb_workshop_inside,create_columns_slb_workshop_floor,
01327 clm_recs,surr_slb,surr_own,surr_tng);
01328 }
01329
01330 void create_columns_slb_scavenger(struct COLUMN_REC *clm_recs[9],
01331 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01332 {
01333 create_columns_slb_room(create_columns_slb_scavenger_floor,create_columns_slb_scavenger_edge,
01334 create_columns_slb_scavenger_corner,create_columns_slb_scavenger_inside,create_columns_slb_scavenger_floor,
01335 clm_recs,surr_slb,surr_own,surr_tng);
01336 }
01337
01338 void create_columns_slb_temple(struct COLUMN_REC *clm_recs[9],
01339 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01340 {
01341 create_columns_slb_room(create_columns_slb_temple_floor,create_columns_slb_temple_edge,
01342 create_columns_slb_temple_corner,create_columns_slb_temple_inside,create_columns_slb_temple_edge,
01343 clm_recs,surr_slb,surr_own,surr_tng);
01344 }
01345
01346 void create_columns_slb_graveyard(struct COLUMN_REC *clm_recs[9],
01347 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01348 {
01349 create_columns_slb_room(create_columns_slb_graveyard_floor,create_columns_slb_graveyard_edge,
01350 create_columns_slb_graveyard_corner,create_columns_slb_graveyard_inside,create_columns_slb_graveyard_floor,
01351 clm_recs,surr_slb,surr_own,surr_tng);
01352 }
01353
01354 void create_columns_slb_hatchery(struct COLUMN_REC *clm_recs[9],
01355 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01356 {
01357 create_columns_slb_room(create_columns_slb_hatchery_floor,create_columns_slb_hatchery_edge,
01358 create_columns_slb_hatchery_corner,create_columns_slb_hatchery_inside,create_columns_slb_hatchery_floor,
01359 clm_recs,surr_slb,surr_own,surr_tng);
01360 }
01361
01362 void create_columns_slb_lair(struct COLUMN_REC *clm_recs[9],
01363 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01364 {
01365 create_columns_slb_room(create_columns_slb_lair_floor,create_columns_slb_lair_edge,
01366 create_columns_slb_lair_corner,create_columns_slb_lair_inside,create_columns_slb_lair_floor,
01367 clm_recs,surr_slb,surr_own,surr_tng);
01368 }
01369
01370 void create_columns_slb_barracks(struct COLUMN_REC *clm_recs[9],
01371 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01372 {
01373 create_columns_slb_room(create_columns_slb_barracks_floor,create_columns_slb_barracks_edge,
01374 create_columns_slb_barracks_corner,create_columns_slb_barracks_inside,create_columns_slb_barracks_floor,
01375 clm_recs,surr_slb,surr_own,surr_tng);
01376 }
01377
01378 void create_columns_slb_door_floor(struct COLUMN_REC *clm_recs[9],
01379 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01380 {
01381 fill_column_rec_sim(clm_recs[IDIR_NW], 0, CUBE_PATH_SMOOTH3,
01382 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01383 fill_column_rec_sim(clm_recs[IDIR_NORTH], 0, 0x0b3,
01384 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01385 fill_column_rec_sim(clm_recs[IDIR_NE], 0, 0x0b5,
01386 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01387 fill_column_rec_sim(clm_recs[IDIR_WEST], 0, 0x0b3,
01388 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01389 fill_column_rec_sim(clm_recs[IDIR_CENTR], 0, 0x0b1,
01390 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01391 fill_column_rec_sim(clm_recs[IDIR_EAST], 0, 0x0ba,
01392 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01393 fill_column_rec_sim(clm_recs[IDIR_SW], 0, 0x0b8,
01394 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01395 fill_column_rec_sim(clm_recs[IDIR_SOUTH], 0, 0x0ba,
01396 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01397 fill_column_rec_sim(clm_recs[IDIR_SE], 0, CUBE_PATH_SMOOTH3,
01398 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01399 }
01400
01401 void create_columns_slb_doorwood(struct COLUMN_REC *clm_recs[9],
01402 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01403 {
01404 create_columns_slb_door_floor(clm_recs,surr_slb,surr_own,surr_tng);
01405 unsigned char *thing=surr_tng_find(surr_tng,THING_TYPE_DOOR);
01406 short orient=DOOR_ORIENT_NSPASS;
01407 if (thing!=NULL) orient=get_door_orientation(thing);
01408 if (orient==DOOR_ORIENT_NSPASS)
01409 {
01410 place_column_doorwood_a(clm_recs[IDIR_WEST],surr_own[IDIR_CENTR]);
01411 place_column_doorwood_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01412 place_column_doorwood_c(clm_recs[IDIR_EAST],surr_own[IDIR_CENTR]);
01413 } else
01414 {
01415 place_column_doorwood_a(clm_recs[IDIR_NORTH],surr_own[IDIR_CENTR]);
01416 place_column_doorwood_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01417 place_column_doorwood_c(clm_recs[IDIR_SOUTH],surr_own[IDIR_CENTR]);
01418 }
01419 }
01420
01421 void create_columns_slb_doorbrace(struct COLUMN_REC *clm_recs[9],
01422 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01423 {
01424 create_columns_slb_door_floor(clm_recs,surr_slb,surr_own,surr_tng);
01425 unsigned char *thing=surr_tng_find(surr_tng,THING_TYPE_DOOR);
01426 short orient=DOOR_ORIENT_NSPASS;
01427 if (thing!=NULL) orient=get_door_orientation(thing);
01428 if (orient==DOOR_ORIENT_NSPASS)
01429 {
01430 place_column_doorbrace_a(clm_recs[IDIR_WEST],surr_own[IDIR_CENTR]);
01431 place_column_doorbrace_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01432 place_column_doorbrace_c(clm_recs[IDIR_EAST],surr_own[IDIR_CENTR]);
01433 } else
01434 {
01435 place_column_doorbrace_a(clm_recs[IDIR_NORTH],surr_own[IDIR_CENTR]);
01436 place_column_doorbrace_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01437 place_column_doorbrace_c(clm_recs[IDIR_SOUTH],surr_own[IDIR_CENTR]);
01438 }
01439 }
01440
01441 void create_columns_slb_dooriron(struct COLUMN_REC *clm_recs[9],
01442 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01443 {
01444 create_columns_slb_door_floor(clm_recs,surr_slb,surr_own,surr_tng);
01445 unsigned char *thing=surr_tng_find(surr_tng,THING_TYPE_DOOR);
01446 short orient=DOOR_ORIENT_NSPASS;
01447 if (thing!=NULL) orient=get_door_orientation(thing);
01448 if (orient==DOOR_ORIENT_NSPASS)
01449 {
01450 place_column_dooriron_a(clm_recs[IDIR_WEST],surr_own[IDIR_CENTR]);
01451 place_column_dooriron_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01452 place_column_dooriron_c(clm_recs[IDIR_EAST],surr_own[IDIR_CENTR]);
01453 } else
01454 {
01455 place_column_dooriron_a(clm_recs[IDIR_NORTH],surr_own[IDIR_CENTR]);
01456 place_column_dooriron_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01457 place_column_dooriron_c(clm_recs[IDIR_SOUTH],surr_own[IDIR_CENTR]);
01458 }
01459 }
01460
01461 void create_columns_slb_doormagic(struct COLUMN_REC *clm_recs[9],
01462 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01463 {
01464 create_columns_slb_door_floor(clm_recs,surr_slb,surr_own,surr_tng);
01465 unsigned char *thing=surr_tng_find(surr_tng,THING_TYPE_DOOR);
01466 short orient=DOOR_ORIENT_NSPASS;
01467 if (thing!=NULL) orient=get_door_orientation(thing);
01468 if (orient==DOOR_ORIENT_NSPASS)
01469 {
01470 place_column_doormagic_a(clm_recs[IDIR_WEST],surr_own[IDIR_CENTR]);
01471 place_column_doormagic_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01472 place_column_doormagic_c(clm_recs[IDIR_EAST],surr_own[IDIR_CENTR]);
01473 } else
01474 {
01475 place_column_doormagic_a(clm_recs[IDIR_NORTH],surr_own[IDIR_CENTR]);
01476 place_column_doormagic_b(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
01477 place_column_doormagic_c(clm_recs[IDIR_SOUTH],surr_own[IDIR_CENTR]);
01478 }
01479 }
01480
01481
01482
01483
01484
01485
01486 void modify_frail_columns(struct COLUMN_REC *clm_recs[9],
01487 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01488 {
01489 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
01490 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
01491 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
01492
01493 int base_prob=33;
01494 if (slab_is_tall_unclmabl(surr_slb[IDIR_WEST])||slab_is_tall_unclmabl(surr_slb[IDIR_NORTH])||
01495 slab_is_tall_unclmabl(surr_slb[IDIR_EAST])||slab_is_tall_unclmabl(surr_slb[IDIR_SOUTH]))
01496 base_prob=66;
01497 int i;
01498
01499 for (i=0;i<4;i++)
01500 {
01501
01502 if (slab_is_short_unclmabl(surr_slb[dir_a[i]]) &&
01503 slab_is_short_unclmabl(surr_slb[dir_b[i]]) && (frail_columns_near_short))
01504 {
01505 if ((surr_slb[dir_a[i]]==SLAB_TYPE_PATH)&&(surr_slb[dir_b[i]]==SLAB_TYPE_PATH)&&
01506 slab_is_tall(surr_slb[dir_c[i]]))
01507 {
01508
01509
01510 } else
01511 if ((surr_slb[dir_a[i]]==SLAB_TYPE_PATH)||(surr_slb[dir_b[i]]==SLAB_TYPE_PATH))
01512 {
01513 if (rnd(100)<base_prob)
01514 fill_column_path(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01515 } else
01516 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER)&&(surr_slb[dir_b[i]]==SLAB_TYPE_WATER))
01517 {
01518 if (rnd(100)<base_prob+33)
01519 fill_column_water(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01520 } else
01521 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA)&&(surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
01522 {
01523 if (rnd(100)<base_prob+33)
01524 fill_column_lava(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01525 }
01526 } else
01527
01528
01529 if (slab_is_tall_unclmabl(surr_slb[dir_a[i]]) &&
01530 slab_is_tall_unclmabl(surr_slb[dir_b[i]]) && (frail_columns_near_tall))
01531 {
01532
01533 if ((surr_slb[IDIR_CENTR]!=SLAB_TYPE_EARTH)&&(surr_slb[IDIR_CENTR]!=SLAB_TYPE_TORCHDIRT)&&
01534 ((surr_slb[dir_a[i]]==SLAB_TYPE_EARTH)||(surr_slb[dir_a[i]]==SLAB_TYPE_TORCHDIRT))&&
01535 ((surr_slb[dir_b[i]]==SLAB_TYPE_EARTH)||(surr_slb[dir_b[i]]==SLAB_TYPE_TORCHDIRT)))
01536 {
01537 if (rnd(100)<base_prob)
01538 fill_column_earth(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01539 }
01540 }
01541 }
01542 }
01543
01544
01545
01546
01547
01548 short modify_liquid_surrounding(struct COLUMN_REC *clm_recs[9],unsigned char *surr_slb,
01549 short liq_level,unsigned short water_cube,unsigned short lava_cube)
01550 {
01551 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
01552 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
01553 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
01554
01555 if ((liq_level<0)||(liq_level>7)) return false;
01556 if (surr_slb==NULL) return false;
01557 short result=false;
01558 int i;
01559
01560 for (i=0;i<4;i++)
01561 {
01562 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER)||(surr_slb[dir_b[i]]==SLAB_TYPE_WATER))
01563 {
01564 clm_recs[dir_c[i]]->c[liq_level]=water_cube;
01565 result=true;
01566 } else
01567 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA)||(surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
01568 {
01569 clm_recs[dir_c[i]]->c[liq_level]=lava_cube;
01570 result=true;
01571 }
01572 }
01573
01574 for (i=0;i<4;i++)
01575 {
01576 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER))
01577 {
01578 clm_recs[dir_a[i]]->c[liq_level]=water_cube;
01579 result=true;
01580 } else
01581 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA))
01582 {
01583 clm_recs[dir_a[i]]->c[liq_level]=lava_cube;
01584 result=true;
01585 }
01586 }
01587 return result;
01588 }
01589
01590
01591
01592
01593
01594
01595
01596 short modify_liquid_surrounding_advncd(struct COLUMN_REC *clm_recs[9],
01597 const unsigned char *surr_slb,const unsigned char *surr_own,
01598 const short liq_level,const unsigned short *water_cube,const unsigned short *lava_cube)
01599 {
01600 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
01601 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
01602 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
01603 unsigned short slab=surr_slb[IDIR_CENTR];
01604 unsigned char ownr=surr_own[IDIR_CENTR];
01605
01606 if ((liq_level<0)||(liq_level>7)) return false;
01607 if (surr_slb==NULL) return false;
01608 short result=false;
01609 int i;
01610
01611 for (i=0;i<4;i++)
01612 {
01613 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER)||(surr_slb[dir_b[i]]==SLAB_TYPE_WATER))
01614 {
01615 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
01616 clm_recs[dir_c[i]]->c[liq_level]=water_cube[dir_b[i]];
01617 else
01618 if ((surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
01619 clm_recs[dir_c[i]]->c[liq_level]=water_cube[dir_a[i]];
01620 else
01621 clm_recs[dir_c[i]]->c[liq_level]=water_cube[dir_c[i]];
01622 result=true;
01623 } else
01624 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA)||(surr_slb[dir_b[i]]==SLAB_TYPE_LAVA))
01625 {
01626 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
01627 clm_recs[dir_c[i]]->c[liq_level]=lava_cube[dir_b[i]];
01628 else
01629 if ((surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
01630 clm_recs[dir_c[i]]->c[liq_level]=lava_cube[dir_a[i]];
01631 else
01632 clm_recs[dir_c[i]]->c[liq_level]=lava_cube[dir_c[i]];
01633 result=true;
01634 }
01635 }
01636
01637 for (i=0;i<4;i++)
01638 {
01639 if ((surr_slb[dir_a[i]]==SLAB_TYPE_WATER))
01640 {
01641 clm_recs[dir_a[i]]->c[liq_level]=water_cube[dir_a[i]];
01642 result=true;
01643 } else
01644 if ((surr_slb[dir_a[i]]==SLAB_TYPE_LAVA))
01645 {
01646 clm_recs[dir_a[i]]->c[liq_level]=lava_cube[dir_a[i]];
01647 result=true;
01648 }
01649 }
01650 return result;
01651 }
01652
01653
01654
01655
01656
01657 unsigned short *get_room_corner_direction_indices(unsigned char *surr_slb,unsigned char *surr_own)
01658 {
01659 unsigned short slab=surr_slb[IDIR_CENTR];
01660 unsigned char ownr=surr_own[IDIR_CENTR];
01661 if (((surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01662 (surr_slb[IDIR_SE]==slab)&&(surr_own[IDIR_SE]==ownr) &&
01663 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr)))
01664 return (unsigned short *)dir_rot_000;
01665 if (((surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01666 (surr_slb[IDIR_SW]==slab)&&(surr_own[IDIR_SW]==ownr) &&
01667 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr)))
01668 return (unsigned short *)dir_rot_090;
01669 if (((surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01670 (surr_slb[IDIR_NW]==slab)&&(surr_own[IDIR_NW]==ownr) &&
01671 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr)))
01672 return (unsigned short *)dir_rot_180;
01673 if (((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01674 (surr_slb[IDIR_NE]==slab)&&(surr_own[IDIR_NE]==ownr) &&
01675 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr)))
01676 return (unsigned short *)dir_rot_270;
01677 if (((surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01678 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr)))
01679 return (unsigned short *)dir_rot_000;
01680 if (((surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01681 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr)))
01682 return (unsigned short *)dir_rot_090;
01683 if (((surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01684 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr)))
01685 return (unsigned short *)dir_rot_180;
01686 if (((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01687 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr)))
01688 return (unsigned short *)dir_rot_270;
01689 return (unsigned short *)dir_rot_000;
01690 }
01691
01692
01693
01694
01695
01696 unsigned short *get_room_edge_direction_indices(unsigned char *surr_slb,unsigned char *surr_own)
01697 {
01698 unsigned short slab=surr_slb[IDIR_CENTR];
01699 unsigned char ownr=surr_own[IDIR_CENTR];
01700
01701 if (((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01702 (surr_slb[IDIR_NE]==slab)&&(surr_own[IDIR_NE]==ownr) &&
01703 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01704 (surr_slb[IDIR_SE]==slab)&&(surr_own[IDIR_SE]==ownr) &&
01705 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr)))
01706 return (unsigned short *)dir_rot_000;
01707 if (((surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01708 (surr_slb[IDIR_SE]==slab)&&(surr_own[IDIR_SE]==ownr) &&
01709 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01710 (surr_slb[IDIR_SW]==slab)&&(surr_own[IDIR_SW]==ownr) &&
01711 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr)))
01712 return (unsigned short *)dir_rot_090;
01713 if (((surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01714 (surr_slb[IDIR_SW]==slab)&&(surr_own[IDIR_SW]==ownr) &&
01715 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01716 (surr_slb[IDIR_NW]==slab)&&(surr_own[IDIR_NW]==ownr) &&
01717 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr)))
01718 return (unsigned short *)dir_rot_180;
01719 if (((surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01720 (surr_slb[IDIR_NW]==slab)&&(surr_own[IDIR_NW]==ownr) &&
01721 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01722 (surr_slb[IDIR_NE]==slab)&&(surr_own[IDIR_NE]==ownr) &&
01723 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr)))
01724 return (unsigned short *)dir_rot_270;
01725
01726 if (((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01727 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01728 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr)))
01729 return (unsigned short *)dir_rot_000;
01730 if (((surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01731 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01732 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr)))
01733 return (unsigned short *)dir_rot_090;
01734 if (((surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01735 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01736 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr)))
01737 return (unsigned short *)dir_rot_180;
01738 if (((surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01739 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01740 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr)))
01741 return (unsigned short *)dir_rot_270;
01742
01743 return (unsigned short *)dir_rot_000;
01744 }
01745
01746 void create_columns_slb_room(cr_clm_func cr_floor,cr_clm_func cr_edge,
01747 cr_clm_func cr_corner,cr_clm_func cr_inside,cr_clm_func cr_nearinsd,
01748 struct COLUMN_REC *clm_recs[9], unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01749 {
01750 unsigned short slab=surr_slb[IDIR_CENTR];
01751 unsigned char ownr=surr_own[IDIR_CENTR];
01752
01753 if ((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01754 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01755 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01756 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr))
01757 {
01758 if ((surr_slb[IDIR_NE]==slab)&&(surr_own[IDIR_NE]==ownr) &&
01759 (surr_slb[IDIR_SE]==slab)&&(surr_own[IDIR_SE]==ownr) &&
01760 (surr_slb[IDIR_SW]==slab)&&(surr_own[IDIR_SW]==ownr) &&
01761 (surr_slb[IDIR_NW]==slab)&&(surr_own[IDIR_NW]==ownr))
01762 {
01763 cr_inside(clm_recs,surr_slb,surr_own,surr_tng);
01764 } else
01765 {
01766
01767
01768 cr_nearinsd(clm_recs,surr_slb,surr_own,surr_tng);
01769 }
01770 return;
01771 }
01772
01773 if (((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01774 (surr_slb[IDIR_NE]==slab)&&(surr_own[IDIR_NE]==ownr) &&
01775 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01776 (surr_slb[IDIR_SE]==slab)&&(surr_own[IDIR_SE]==ownr) &&
01777 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr)) ||
01778 ((surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01779 (surr_slb[IDIR_SE]==slab)&&(surr_own[IDIR_SE]==ownr) &&
01780 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01781 (surr_slb[IDIR_SW]==slab)&&(surr_own[IDIR_SW]==ownr) &&
01782 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr)) ||
01783 ((surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01784 (surr_slb[IDIR_SW]==slab)&&(surr_own[IDIR_SW]==ownr) &&
01785 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01786 (surr_slb[IDIR_NW]==slab)&&(surr_own[IDIR_NW]==ownr) &&
01787 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr)) ||
01788 ((surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01789 (surr_slb[IDIR_NW]==slab)&&(surr_own[IDIR_NW]==ownr) &&
01790 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01791 (surr_slb[IDIR_NE]==slab)&&(surr_own[IDIR_NE]==ownr) &&
01792 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr)))
01793 {
01794 cr_edge(clm_recs,surr_slb,surr_own,surr_tng);
01795 return;
01796 }
01797
01798
01799 if (((surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01800
01801 (surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01802 ((surr_slb[IDIR_SOUTH]!=slab)||(surr_own[IDIR_SOUTH]!=ownr)) &&
01803 ((surr_slb[IDIR_WEST]!=slab)||(surr_own[IDIR_WEST]!=ownr))) ||
01804
01805 ((surr_slb[IDIR_EAST]==slab)&&(surr_own[IDIR_EAST]==ownr) &&
01806
01807 (surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01808 ((surr_slb[IDIR_NORTH]!=slab)||(surr_own[IDIR_NORTH]!=ownr)) &&
01809 ((surr_slb[IDIR_WEST]!=slab)||(surr_own[IDIR_WEST]!=ownr))) ||
01810
01811 ((surr_slb[IDIR_SOUTH]==slab)&&(surr_own[IDIR_SOUTH]==ownr) &&
01812
01813 (surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01814 ((surr_slb[IDIR_NORTH]!=slab)||(surr_own[IDIR_NORTH]!=ownr)) &&
01815 ((surr_slb[IDIR_EAST]!=slab)||(surr_own[IDIR_EAST]!=ownr))) ||
01816
01817 ((surr_slb[IDIR_WEST]==slab)&&(surr_own[IDIR_WEST]==ownr) &&
01818
01819 (surr_slb[IDIR_NORTH]==slab)&&(surr_own[IDIR_NORTH]==ownr) &&
01820 ((surr_slb[IDIR_SOUTH]!=slab)||(surr_own[IDIR_SOUTH]!=ownr)) &&
01821 ((surr_slb[IDIR_EAST]!=slab)||(surr_own[IDIR_EAST]!=ownr))))
01822 {
01823 cr_corner(clm_recs,surr_slb,surr_own,surr_tng);
01824 return;
01825 }
01826
01827 cr_floor(clm_recs,surr_slb,surr_own,surr_tng);
01828 }
01829
01830 void create_columns_slb_library_floor(struct COLUMN_REC *clm_recs[9],
01831 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01832 {
01833 int i,k;
01834 for (i=0;i<3;i++)
01835 for (k=0;k<3;k++)
01836 {
01837 fill_column_rec_sim(clm_recs[k*3+i], 0, 0x0f8,
01838 0x0ae +rnd(2), 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01839 }
01840 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x0bb, 0x0ba);
01841 }
01842
01843 void create_columns_slb_library_edge(struct COLUMN_REC *clm_recs[9],
01844 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01845 {
01846
01847 create_columns_slb_library_floor(clm_recs,surr_slb,surr_own,surr_tng);
01848 }
01849
01850 void create_columns_slb_library_corner(struct COLUMN_REC *clm_recs[9],
01851 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01852 {
01853 create_columns_slb_library_floor(clm_recs,surr_slb,surr_own,surr_tng);
01854 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
01855 fill_column_library_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
01856 }
01857
01858 void create_columns_slb_library_inside(struct COLUMN_REC *clm_recs[9],
01859 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01860 {
01861 create_columns_slb_library_floor(clm_recs,surr_slb,surr_own,surr_tng);
01862 place_column_library_bookcase_a(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
01863 place_column_library_bookcase_b(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
01864 place_column_library_bookcase_c(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
01865 }
01866
01867 void create_columns_slb_dungheart_floor(struct COLUMN_REC *clm_recs[9],
01868 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01869 {
01870 int i,k;
01871 for (i=0;i<3;i++)
01872 for (k=0;k<3;k++)
01873 {
01874 fill_column_dungheart_floor(clm_recs[k*3+i], surr_own[IDIR_CENTR]);
01875 }
01876 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x0a4, 0x0a3);
01877 }
01878
01879 void create_columns_slb_dungheart_edge(struct COLUMN_REC *clm_recs[9],
01880 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01881 {
01882 create_columns_slb_dungheart_floor(clm_recs,surr_slb,surr_own,surr_tng);
01883 unsigned short *dir=get_room_edge_direction_indices(surr_slb,surr_own);
01884 fill_column_dungheart_inside(clm_recs[dir[IDIR_NE]], surr_own[IDIR_CENTR]);
01885 fill_column_dungheart_inside(clm_recs[dir[IDIR_EAST]], surr_own[IDIR_CENTR]);
01886 fill_column_dungheart_inside(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
01887 place_column_univ_stair(clm_recs[dir[IDIR_NORTH]], surr_own[IDIR_CENTR]);
01888 place_column_univ_stair(clm_recs[dir[IDIR_CENTR]], surr_own[IDIR_CENTR]);
01889 place_column_univ_stair(clm_recs[dir[IDIR_SOUTH]], surr_own[IDIR_CENTR]);
01890 }
01891
01892 void create_columns_slb_dungheart_corner(struct COLUMN_REC *clm_recs[9],
01893 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01894 {
01895 create_columns_slb_dungheart_floor(clm_recs,surr_slb,surr_own,surr_tng);
01896 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
01897 fill_column_dungheart_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
01898 place_column_dungheart_raise(clm_recs[dir[IDIR_EAST]], surr_own[IDIR_CENTR]);
01899 place_column_dungheart_raise(clm_recs[dir[IDIR_NE]], surr_own[IDIR_CENTR]);
01900 place_column_dungheart_raise(clm_recs[dir[IDIR_SOUTH]], surr_own[IDIR_CENTR]);
01901 place_column_dungheart_raise(clm_recs[dir[IDIR_SW]], surr_own[IDIR_CENTR]);
01902 fill_column_rec_sim(clm_recs[dir[IDIR_CENTR]], 0, CUBE_PATH_SMOOTH3,
01903 0x080, 0x180, 0x0, 0x0, 0x0, 0, 0, 0);
01904 }
01905
01906 void create_columns_slb_dungheart_inside(struct COLUMN_REC *clm_recs[9],
01907 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01908 {
01909 int i,k;
01910 for (i=0;i<3;i++)
01911 for (k=0;k<3;k++)
01912 {
01913 fill_column_dungheart_inside(clm_recs[k*3+i], surr_own[IDIR_CENTR]);
01914 }
01915 }
01916
01917 void create_columns_slb_dungheart_nearinsd(struct COLUMN_REC *clm_recs[9],
01918 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01919 {
01920 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
01921 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
01922 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
01923 create_columns_slb_dungheart_floor(clm_recs,surr_slb,surr_own,surr_tng);
01924
01925 place_column_univ_stair(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
01926 int i;
01927 unsigned short slab=surr_slb[IDIR_CENTR];
01928 unsigned char ownr=surr_own[IDIR_CENTR];
01929
01930 for (i=0;i<4;i++)
01931 {
01932 if (((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr)) ||
01933 ((surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr)))
01934 {
01935 short i_op=(i+2)%4;
01936 if (((surr_slb[dir_a[i_op]]!=slab)||(surr_own[dir_a[i_op]]!=ownr)) ||
01937 ((surr_slb[dir_b[i_op]]!=slab)||(surr_own[dir_a[i_op]]!=ownr)))
01938 place_column_dungheart_raise(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01939 else
01940 fill_column_dungheart_inside(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01941 }
01942 }
01943
01944 for (i=0;i<4;i++)
01945 {
01946 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
01947 {
01948 short i_op=(i+2)%4;
01949 if ((surr_slb[dir_a[i_op]]!=slab)||(surr_own[dir_a[i_op]]!=ownr))
01950 place_column_dungheart_raise(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
01951 else
01952 fill_column_dungheart_inside(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
01953 }
01954 }
01955 }
01956
01957 void create_columns_slb_portal_floor(struct COLUMN_REC *clm_recs[9],
01958 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01959 {
01960 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
01961 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
01962 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
01963 unsigned short slab=surr_slb[IDIR_CENTR];
01964 unsigned char ownr=surr_own[IDIR_CENTR];
01965
01966 fill_column_portal_floor(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
01967
01968 int i;
01969 for (i=0;i<4;i++)
01970 {
01971 if (((surr_slb[dir_a[i]]!=slab)||(surr_own[dir_a[i]]!=ownr)) ||
01972 ((surr_slb[dir_b[i]]!=slab)||(surr_own[dir_b[i]]!=ownr)))
01973 fill_column_portal_edge(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01974 else
01975 fill_column_portal_floor(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
01976 }
01977
01978 for (i=0;i<4;i++)
01979 {
01980 if (((surr_slb[dir_a[i]]!=slab)||(surr_own[dir_a[i]]!=ownr)))
01981 fill_column_portal_edge(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
01982 else
01983 fill_column_portal_floor(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
01984 }
01985 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x13b, 0x15f);
01986 }
01987
01988 void create_columns_slb_portal_edge(struct COLUMN_REC *clm_recs[9],
01989 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
01990 {
01991 create_columns_slb_portal_floor(clm_recs,surr_slb,surr_own,surr_tng);
01992 unsigned short *dir=get_room_edge_direction_indices(surr_slb,surr_own);
01993 fill_column_portal_step(clm_recs[dir[IDIR_NE]], surr_own[IDIR_CENTR]);
01994 fill_column_portal_step(clm_recs[dir[IDIR_EAST]], surr_own[IDIR_CENTR]);
01995 fill_column_portal_step(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
01996 }
01997
01998 void create_columns_slb_portal_corner(struct COLUMN_REC *clm_recs[9],
01999 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02000 {
02001 create_columns_slb_portal_floor(clm_recs,surr_slb,surr_own,surr_tng);
02002 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02003 fill_column_portal_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02004 }
02005
02006 void create_columns_slb_portal_inside(struct COLUMN_REC *clm_recs[9],
02007 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02008 {
02009 int i;
02010 for (i=0;i<9;i++)
02011 fill_column_rec_sim(clm_recs[i], 0, 0x0,
02012 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x089+i, 0);
02013 fill_column_portal_inside_cntr(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
02014 }
02015
02016 void create_columns_slb_temple_floor(struct COLUMN_REC *clm_recs[9],
02017 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02018 {
02019 int i,k;
02020 for (i=0;i<3;i++)
02021 for (k=0;k<3;k++)
02022 {
02023 fill_column_temple_floor(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02024 }
02025 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x075, 0x076);
02026 }
02027
02028 void create_columns_slb_temple_edge(struct COLUMN_REC *clm_recs[9],
02029 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02030 {
02031 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
02032 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
02033 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
02034 const unsigned short dir_d[]={IDIR_SOUTH, IDIR_WEST, IDIR_NORTH, IDIR_EAST};
02035 const unsigned short dir_e[]={IDIR_EAST, IDIR_SOUTH, IDIR_WEST, IDIR_NORTH};
02036 unsigned short slab=surr_slb[IDIR_CENTR];
02037 unsigned char ownr=surr_own[IDIR_CENTR];
02038
02039
02040 create_columns_slb_temple_floor(clm_recs,surr_slb,surr_own, surr_tng);
02041
02042 int i;
02043 for (i=0;i<4;i++)
02044 {
02045 if (((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr) &&
02046 (surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr)) &&
02047 ((surr_slb[dir_d[i]]==slab)&&(surr_own[dir_d[i]]==ownr) ||
02048 (surr_slb[dir_e[i]]==slab)&&(surr_own[dir_e[i]]==ownr)))
02049 place_column_temple_edge(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
02050 }
02051
02052 for (i=0;i<4;i++)
02053 {
02054 if (((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr) &&
02055 (surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr)) &&
02056 ((surr_slb[dir_d[i]]==slab)&&(surr_own[dir_d[i]]==ownr)))
02057 place_column_temple_edge(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
02058 }
02059 }
02060
02061 void create_columns_slb_temple_corner(struct COLUMN_REC *clm_recs[9],
02062 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02063 {
02064 create_columns_slb_temple_floor(clm_recs,surr_slb,surr_own, surr_tng);
02065 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02066 place_column_temple_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02067 place_column_temple_corner(clm_recs[dir[IDIR_CENTR]], surr_own[IDIR_CENTR]);
02068 }
02069
02070 void create_columns_slb_temple_inside(struct COLUMN_REC *clm_recs[9],
02071 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02072 {
02073 int i;
02074 for (i=0;i<9;i++)
02075 fill_column_rec_sim(clm_recs[i], 0, 0x177,
02076 CUBE_PATH_SMOOTH1 +rnd(5), 0x126 +i, 0x0, 0x0, 0x0, 0, 0, 0);
02077 }
02078
02079 void create_columns_slb_hatchery_floor(struct COLUMN_REC *clm_recs[9],
02080 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02081 {
02082 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
02083 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
02084 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
02085 unsigned short slab=surr_slb[IDIR_CENTR];
02086 unsigned char ownr=surr_own[IDIR_CENTR];
02087
02088 fill_column_hatchery_inside(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
02089
02090 int i;
02091 for (i=0;i<4;i++)
02092 {
02093 if (((surr_slb[dir_a[i]]!=slab)||(surr_own[dir_a[i]]!=ownr)) ||
02094 ((surr_slb[dir_b[i]]!=slab)||(surr_own[dir_b[i]]!=ownr)))
02095 fill_column_hatchery_edge(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
02096 else
02097 fill_column_hatchery_inside(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
02098 }
02099
02100 for (i=0;i<4;i++)
02101 {
02102 if (((surr_slb[dir_a[i]]!=slab)||(surr_own[dir_a[i]]!=ownr)))
02103 fill_column_hatchery_edge(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
02104 else
02105 fill_column_hatchery_inside(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
02106 }
02107
02108 unsigned short *water_cube=malloc(9*sizeof(unsigned short));
02109 unsigned short *lava_cube =malloc(9*sizeof(unsigned short));
02110 for (i=0;i<9;i++)
02111 water_cube[i]=0x159;
02112 lava_cube[IDIR_NW]=0x15e;
02113 lava_cube[IDIR_NE]=0x15d;
02114 lava_cube[IDIR_SW]=0x15c;
02115 lava_cube[IDIR_SE]=0x15e;
02116 lava_cube[IDIR_NORTH]=0x15d;
02117 lava_cube[IDIR_EAST]=0x15d;
02118 lava_cube[IDIR_SOUTH]=0x15c;
02119 lava_cube[IDIR_WEST]=rnd(2)?0x15c:0x13c;
02120 modify_liquid_surrounding_advncd(clm_recs,surr_slb,surr_own, 0,water_cube,lava_cube);
02121 free(water_cube);
02122 free(lava_cube);
02123 }
02124
02125 void create_columns_slb_hatchery_edge(struct COLUMN_REC *clm_recs[9],
02126 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02127 {
02128 create_columns_slb_hatchery_floor(clm_recs,surr_slb,surr_own,surr_tng);
02129 }
02130
02131 void create_columns_slb_hatchery_corner(struct COLUMN_REC *clm_recs[9],
02132 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02133 {
02134 create_columns_slb_hatchery_floor(clm_recs,surr_slb,surr_own,surr_tng);
02135 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02136 fill_column_hatchery_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02137 }
02138
02139 void create_columns_slb_hatchery_inside(struct COLUMN_REC *clm_recs[9],
02140 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02141 {
02142 int i;
02143 for (i=0;i<9;i++)
02144 fill_column_hatchery_inside(clm_recs[i], surr_own[IDIR_CENTR]);
02145 }
02146
02147 void create_columns_slb_lair_floor(struct COLUMN_REC *clm_recs[9],
02148 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02149 {
02150 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
02151 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
02152 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
02153 unsigned short slab=surr_slb[IDIR_CENTR];
02154 unsigned char ownr=surr_own[IDIR_CENTR];
02155
02156 fill_column_lair_inside(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
02157
02158 int i;
02159 for (i=0;i<4;i++)
02160 {
02161 fill_column_lair_inside(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
02162
02163 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr)&&
02164 (surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
02165 {
02166 clm_recs[dir_c[i]]->c[0]=CUBE_LAIR_INSIDE;
02167 } else
02168 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
02169 {
02170 switch (dir_c[i])
02171 {
02172 case IDIR_NW:
02173 clm_recs[dir_c[i]]->c[0]=0x01f;
02174 break;
02175 case IDIR_NE:
02176 clm_recs[dir_c[i]]->c[0]=0x022;
02177 break;
02178 case IDIR_SW:
02179 clm_recs[dir_c[i]]->c[0]=0x021;
02180 break;
02181 case IDIR_SE:
02182 clm_recs[dir_c[i]]->c[0]=0x024;
02183 break;
02184 }
02185 } else
02186 if ((surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
02187 {
02188 switch (dir_c[i])
02189 {
02190 case IDIR_NW:
02191 clm_recs[dir_c[i]]->c[0]=0x021;
02192 break;
02193 case IDIR_SW:
02194 clm_recs[dir_c[i]]->c[0]=0x024;
02195 break;
02196 case IDIR_NE:
02197 clm_recs[dir_c[i]]->c[0]=0x01f;
02198 break;
02199 case IDIR_SE:
02200 clm_recs[dir_c[i]]->c[0]=0x022;
02201 break;
02202 }
02203 } else
02204 {
02205 switch (dir_c[i])
02206 {
02207 case IDIR_NW:
02208 clm_recs[dir_c[i]]->c[0]=0x01e;
02209 break;
02210 case IDIR_NE:
02211 clm_recs[dir_c[i]]->c[0]=0x020;
02212 break;
02213 case IDIR_SW:
02214 clm_recs[dir_c[i]]->c[0]=0x023;
02215 break;
02216 case IDIR_SE:
02217 clm_recs[dir_c[i]]->c[0]=0x025;
02218 break;
02219 }
02220 }
02221 }
02222
02223 for (i=0;i<4;i++)
02224 {
02225 fill_column_lair_inside(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
02226
02227 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
02228 {
02229 clm_recs[dir_a[i]]->c[0]=CUBE_LAIR_INSIDE;
02230 } else
02231 {
02232 switch (dir_a[i])
02233 {
02234 case IDIR_SOUTH:
02235 clm_recs[dir_a[i]]->c[0]=0x024;
02236 break;
02237 case IDIR_WEST:
02238 clm_recs[dir_a[i]]->c[0]=0x021;
02239 break;
02240 case IDIR_NORTH:
02241 clm_recs[dir_a[i]]->c[0]=0x01f;
02242 break;
02243 case IDIR_EAST:
02244 clm_recs[dir_a[i]]->c[0]=0x022;
02245 break;
02246 }
02247 }
02248 }
02249
02250
02251 }
02252
02253 void create_columns_slb_lair_edge(struct COLUMN_REC *clm_recs[9],
02254 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02255 {
02256 create_columns_slb_lair_floor(clm_recs,surr_slb,surr_own,surr_tng);
02257 }
02258
02259 void create_columns_slb_lair_corner(struct COLUMN_REC *clm_recs[9],
02260 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02261 {
02262 create_columns_slb_lair_floor(clm_recs,surr_slb,surr_own,surr_tng);
02263 }
02264
02265 void create_columns_slb_lair_inside(struct COLUMN_REC *clm_recs[9],
02266 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02267 {
02268 int i;
02269 for (i=0;i<9;i++)
02270 fill_column_lair_inside(clm_recs[i], surr_own[IDIR_CENTR]);
02271 }
02272
02273 void create_columns_slb_graveyard_floor(struct COLUMN_REC *clm_recs[9],
02274 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02275 {
02276 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
02277 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
02278 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
02279 unsigned short slab=surr_slb[IDIR_CENTR];
02280 unsigned char ownr=surr_own[IDIR_CENTR];
02281
02282 fill_column_graveyard_inside(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
02283
02284 int i;
02285 for (i=0;i<4;i++)
02286 {
02287 fill_column_graveyard_inside(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
02288
02289 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr)&&
02290 (surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
02291 {
02292 clm_recs[dir_c[i]]->c[0]=0x142;
02293 } else
02294 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
02295 {
02296 switch (dir_c[i])
02297 {
02298 case IDIR_NW:
02299 clm_recs[dir_c[i]]->c[0]=0x144;
02300 break;
02301 case IDIR_NE:
02302 clm_recs[dir_c[i]]->c[0]=0x147;
02303 break;
02304 case IDIR_SW:
02305 clm_recs[dir_c[i]]->c[0]=0x146;
02306 break;
02307 case IDIR_SE:
02308 clm_recs[dir_c[i]]->c[0]=0x149;
02309 break;
02310 }
02311 } else
02312 if ((surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
02313 {
02314 switch (dir_c[i])
02315 {
02316 case IDIR_NW:
02317 clm_recs[dir_c[i]]->c[0]=0x146;
02318 break;
02319 case IDIR_SW:
02320 clm_recs[dir_c[i]]->c[0]=0x149;
02321 break;
02322 case IDIR_NE:
02323 clm_recs[dir_c[i]]->c[0]=0x144;
02324 break;
02325 case IDIR_SE:
02326 clm_recs[dir_c[i]]->c[0]=0x147;
02327 break;
02328 }
02329 } else
02330 {
02331 switch (dir_c[i])
02332 {
02333 case IDIR_NW:
02334 clm_recs[dir_c[i]]->c[0]=0x143;
02335 break;
02336 case IDIR_NE:
02337 clm_recs[dir_c[i]]->c[0]=0x145;
02338 break;
02339 case IDIR_SW:
02340 clm_recs[dir_c[i]]->c[0]=0x148;
02341 break;
02342 case IDIR_SE:
02343 clm_recs[dir_c[i]]->c[0]=0x14a;
02344 break;
02345 }
02346 }
02347 }
02348
02349 for (i=0;i<4;i++)
02350 {
02351 fill_column_graveyard_inside(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
02352
02353 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
02354 {
02355 clm_recs[dir_a[i]]->c[0]=0x142;
02356 } else
02357 {
02358 switch (dir_a[i])
02359 {
02360 case IDIR_SOUTH:
02361 clm_recs[dir_a[i]]->c[0]=0x149;
02362 break;
02363 case IDIR_WEST:
02364 clm_recs[dir_a[i]]->c[0]=0x146;
02365 break;
02366 case IDIR_NORTH:
02367 clm_recs[dir_a[i]]->c[0]=0x144;
02368 break;
02369 case IDIR_EAST:
02370 clm_recs[dir_a[i]]->c[0]=0x147;
02371 break;
02372 }
02373 }
02374 }
02375
02376
02377 }
02378
02379 void create_columns_slb_graveyard_edge(struct COLUMN_REC *clm_recs[9],
02380 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02381 {
02382 create_columns_slb_graveyard_floor(clm_recs,surr_slb,surr_own,surr_tng);
02383 }
02384
02385 void create_columns_slb_graveyard_corner(struct COLUMN_REC *clm_recs[9],
02386 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02387 {
02388 create_columns_slb_graveyard_floor(clm_recs,surr_slb,surr_own,surr_tng);
02389 }
02390
02391 void create_columns_slb_graveyard_inside(struct COLUMN_REC *clm_recs[9],
02392 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02393 {
02394 int i;
02395 for (i=0;i<9;i++)
02396 fill_column_graveyard_inside(clm_recs[i], surr_own[IDIR_CENTR]);
02397 }
02398
02399 void create_columns_slb_barracks_floor(struct COLUMN_REC *clm_recs[9],
02400 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02401 {
02402 int i;
02403 for (i=0;i<9;i++)
02404 fill_column_barracks_floor(clm_recs[i], surr_own[IDIR_CENTR]);
02405 }
02406
02407 void create_columns_slb_barracks_edge(struct COLUMN_REC *clm_recs[9],
02408 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02409 {
02410 create_columns_slb_barracks_floor(clm_recs,surr_slb,surr_own,surr_tng);
02411 }
02412
02413 void create_columns_slb_barracks_corner(struct COLUMN_REC *clm_recs[9],
02414 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02415 {
02416 create_columns_slb_barracks_floor(clm_recs,surr_slb,surr_own,surr_tng);
02417 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02418 fill_column_barracks_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02419 }
02420
02421 void create_columns_slb_barracks_inside(struct COLUMN_REC *clm_recs[9],
02422 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02423 {
02424 int i;
02425 for (i=0;i<9;i++)
02426 {
02427 fill_column_barracks_floor(clm_recs[i], surr_own[IDIR_CENTR]);
02428 place_column_barracks_raise(clm_recs[i], surr_own[IDIR_CENTR]);
02429 }
02430 }
02431
02432 void create_columns_slb_training_floor(struct COLUMN_REC *clm_recs[9],
02433 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02434 {
02435 int i,k;
02436 for (i=0;i<3;i++)
02437 for (k=0;k<3;k++)
02438 {
02439 fill_column_training_floor(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02440 }
02441 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x0fe, 0x0fd);
02442 }
02443
02444 void create_columns_slb_training_edge(struct COLUMN_REC *clm_recs[9],
02445 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02446 {
02447 create_columns_slb_training_floor(clm_recs,surr_slb,surr_own,surr_tng);
02448 }
02449
02450 void create_columns_slb_training_corner(struct COLUMN_REC *clm_recs[9],
02451 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02452 {
02453 create_columns_slb_training_floor(clm_recs,surr_slb,surr_own,surr_tng);
02454 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02455 fill_column_training_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02456 }
02457
02458 void create_columns_slb_training_inside(struct COLUMN_REC *clm_recs[9],
02459 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02460 {
02461 create_columns_slb_training_floor(clm_recs,surr_slb,surr_own,surr_tng);
02462 }
02463
02464 void create_columns_slb_treasure_floor(struct COLUMN_REC *clm_recs[9],
02465 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02466 {
02467 int i,k;
02468 for (i=0;i<3;i++)
02469 for (k=0;k<3;k++)
02470 {
02471 fill_column_treasure_floor(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02472 }
02473 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x0a4, 0x0a3);
02474 }
02475
02476 void create_columns_slb_treasure_edge(struct COLUMN_REC *clm_recs[9],
02477 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02478 {
02479 create_columns_slb_treasure_floor(clm_recs,surr_slb,surr_own,surr_tng);
02480 }
02481
02482 void create_columns_slb_treasure_corner(struct COLUMN_REC *clm_recs[9],
02483 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02484 {
02485 create_columns_slb_treasure_floor(clm_recs,surr_slb,surr_own,surr_tng);
02486 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02487 fill_column_treasure_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02488 }
02489
02490 void create_columns_slb_treasure_inside(struct COLUMN_REC *clm_recs[9],
02491 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02492 {
02493 create_columns_slb_treasure_floor(clm_recs,surr_slb,surr_own,surr_tng);
02494 }
02495
02496 void create_columns_slb_workshop_floor(struct COLUMN_REC *clm_recs[9],
02497 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02498 {
02499 int i,k;
02500 for (i=0;i<3;i++)
02501 for (k=0;k<3;k++)
02502 {
02503 fill_column_workshop_floor(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02504 }
02505 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x109, 0x108);
02506 }
02507
02508 void create_columns_slb_workshop_edge(struct COLUMN_REC *clm_recs[9],
02509 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02510 {
02511 create_columns_slb_workshop_floor(clm_recs,surr_slb,surr_own,surr_tng);
02512 }
02513
02514 void create_columns_slb_workshop_corner(struct COLUMN_REC *clm_recs[9],
02515 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02516 {
02517 create_columns_slb_workshop_floor(clm_recs,surr_slb,surr_own,surr_tng);
02518 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02519 fill_column_workshop_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02520 }
02521
02522 void create_columns_slb_workshop_inside(struct COLUMN_REC *clm_recs[9],
02523 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02524 {
02525 create_columns_slb_workshop_floor(clm_recs,surr_slb,surr_own,surr_tng);
02526
02527 int i,k;
02528 for (i=0;i<3;i++)
02529 for (k=0;k<3;k++)
02530 {
02531 clm_recs[k*3+i]->c[0]=0x107 +rnd(3);
02532 }
02533 }
02534
02535 void create_columns_slb_scavenger_floor(struct COLUMN_REC *clm_recs[9],
02536 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02537 {
02538 int i,k;
02539 for (i=0;i<3;i++)
02540 for (k=0;k<3;k++)
02541 {
02542 fill_column_scavenger_floor(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02543 }
02544 fill_column_scavenger_inside_cntr(clm_recs[IDIR_CENTR],surr_own[IDIR_CENTR]);
02545 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x11b, 0x11a);
02546 }
02547
02548 void create_columns_slb_scavenger_edge(struct COLUMN_REC *clm_recs[9],
02549 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02550 {
02551 create_columns_slb_scavenger_floor(clm_recs,surr_slb,surr_own,surr_tng);
02552 }
02553
02554 void create_columns_slb_scavenger_corner(struct COLUMN_REC *clm_recs[9],
02555 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02556 {
02557 create_columns_slb_scavenger_floor(clm_recs,surr_slb,surr_own,surr_tng);
02558 unsigned short *dir=get_room_corner_direction_indices(surr_slb,surr_own);
02559 fill_column_scavenger_pillar(clm_recs[dir[IDIR_SE]], surr_own[IDIR_CENTR]);
02560 }
02561
02562 void create_columns_slb_scavenger_inside(struct COLUMN_REC *clm_recs[9],
02563 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02564 {
02565 create_columns_slb_scavenger_floor(clm_recs,surr_slb,surr_own,surr_tng);
02566 }
02567
02568 void create_columns_slb_prison_floor(struct COLUMN_REC *clm_recs[9],
02569 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02570 {
02571 const unsigned short dir_a[]={IDIR_WEST, IDIR_NORTH, IDIR_EAST, IDIR_SOUTH};
02572 const unsigned short dir_b[]={IDIR_NORTH, IDIR_EAST, IDIR_SOUTH, IDIR_WEST};
02573 const unsigned short dir_c[]={IDIR_NW, IDIR_NE, IDIR_SE, IDIR_SW};
02574 unsigned short slab=surr_slb[IDIR_CENTR];
02575 unsigned char ownr=surr_own[IDIR_CENTR];
02576
02577 fill_column_prison_inside(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
02578
02579 int i;
02580 for (i=0;i<4;i++)
02581 {
02582 fill_column_prison_inside(clm_recs[dir_c[i]], surr_own[IDIR_CENTR]);
02583
02584 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr)&&
02585 (surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
02586 {
02587 clm_recs[dir_c[i]]->c[0]=0x0c8;
02588 } else
02589 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
02590 {
02591 switch (dir_c[i])
02592 {
02593 case IDIR_NW:
02594 clm_recs[dir_c[i]]->c[0]=0x0ca;
02595 break;
02596 case IDIR_NE:
02597 clm_recs[dir_c[i]]->c[0]=0x0cd;
02598 break;
02599 case IDIR_SW:
02600 clm_recs[dir_c[i]]->c[0]=0x0cc;
02601 break;
02602 case IDIR_SE:
02603 clm_recs[dir_c[i]]->c[0]=0x0cf;
02604 break;
02605 }
02606 } else
02607 if ((surr_slb[dir_b[i]]==slab)&&(surr_own[dir_b[i]]==ownr))
02608 {
02609 switch (dir_c[i])
02610 {
02611 case IDIR_NW:
02612 clm_recs[dir_c[i]]->c[0]=0x0cc;
02613 break;
02614 case IDIR_SW:
02615 clm_recs[dir_c[i]]->c[0]=0x0cf;
02616 break;
02617 case IDIR_NE:
02618 clm_recs[dir_c[i]]->c[0]=0x0ca;
02619 break;
02620 case IDIR_SE:
02621 clm_recs[dir_c[i]]->c[0]=0x0cd;
02622 break;
02623 }
02624 } else
02625 {
02626 switch (dir_c[i])
02627 {
02628 case IDIR_NW:
02629 clm_recs[dir_c[i]]->c[0]=0x0c9;
02630 break;
02631 case IDIR_NE:
02632 clm_recs[dir_c[i]]->c[0]=0x0cb;
02633 break;
02634 case IDIR_SW:
02635 clm_recs[dir_c[i]]->c[0]=0x0ce;
02636 break;
02637 case IDIR_SE:
02638 clm_recs[dir_c[i]]->c[0]=0x0d0;
02639 break;
02640 }
02641 }
02642 }
02643
02644 for (i=0;i<4;i++)
02645 {
02646 fill_column_prison_inside(clm_recs[dir_a[i]], surr_own[IDIR_CENTR]);
02647
02648 if ((surr_slb[dir_a[i]]==slab)&&(surr_own[dir_a[i]]==ownr))
02649 {
02650 clm_recs[dir_a[i]]->c[0]=0x0c8;
02651 } else
02652 {
02653 switch (dir_a[i])
02654 {
02655 case IDIR_SOUTH:
02656 clm_recs[dir_a[i]]->c[0]=0x0cf;
02657 break;
02658 case IDIR_WEST:
02659 clm_recs[dir_a[i]]->c[0]=0x0cc;
02660 break;
02661 case IDIR_NORTH:
02662 clm_recs[dir_a[i]]->c[0]=0x0ca;
02663 break;
02664 case IDIR_EAST:
02665 clm_recs[dir_a[i]]->c[0]=0x0cd;
02666 break;
02667 }
02668 }
02669 }
02670
02671 unsigned short *water_cube=malloc(9*sizeof(unsigned short));
02672 unsigned short *lava_cube =malloc(9*sizeof(unsigned short));
02673 water_cube[IDIR_NW]=0x0d9;
02674 water_cube[IDIR_NE]=0x0db;
02675 water_cube[IDIR_SW]=0x0de;
02676 water_cube[IDIR_SE]=0x0e0;
02677 water_cube[IDIR_NORTH]=0x0da;
02678 water_cube[IDIR_EAST]= 0x0dd;
02679 water_cube[IDIR_SOUTH]=0x0df;
02680 water_cube[IDIR_WEST]= 0x0dc;
02681 lava_cube[IDIR_NW]=0x0d1;
02682 lava_cube[IDIR_NE]=0x0d3;
02683 lava_cube[IDIR_SW]=0x0d6;
02684 lava_cube[IDIR_SE]=0x0d8;
02685 lava_cube[IDIR_NORTH]=0x0d2;
02686 lava_cube[IDIR_EAST]= 0x0d5;
02687 lava_cube[IDIR_SOUTH]=0x0d7;
02688 lava_cube[IDIR_WEST]= 0x0d4;
02689 modify_liquid_surrounding_advncd(clm_recs,surr_slb,surr_own, 0,water_cube,lava_cube);
02690 free(water_cube);
02691 free(lava_cube);
02692 }
02693
02694 void create_columns_slb_prison_edge(struct COLUMN_REC *clm_recs[9],
02695 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02696 {
02697 create_columns_slb_prison_floor(clm_recs,surr_slb,surr_own,surr_tng);
02698 }
02699
02700 void create_columns_slb_prison_corner(struct COLUMN_REC *clm_recs[9],
02701 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02702 {
02703 create_columns_slb_prison_floor(clm_recs,surr_slb,surr_own,surr_tng);
02704 }
02705
02706 void create_columns_slb_prison_inside(struct COLUMN_REC *clm_recs[9],
02707 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02708 {
02709 int i;
02710 for (i=0;i<9;i++)
02711 fill_column_prison_inside(clm_recs[i], surr_own[IDIR_CENTR]);
02712 }
02713
02714 void create_columns_slb_torture_floor(struct COLUMN_REC *clm_recs[9],
02715 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02716 {
02717 create_columns_slb_prison_floor(clm_recs,surr_slb,surr_own,surr_tng);
02718 clm_recs[IDIR_CENTR]->c[0]=CUBE_FLOOR_TORTCIRC;
02719 }
02720
02721 void create_columns_slb_torture_edge(struct COLUMN_REC *clm_recs[9],
02722 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02723 {
02724 create_columns_slb_torture_floor(clm_recs,surr_slb,surr_own,surr_tng);
02725 }
02726
02727 void create_columns_slb_torture_corner(struct COLUMN_REC *clm_recs[9],
02728 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02729 {
02730 create_columns_slb_torture_floor(clm_recs,surr_slb,surr_own,surr_tng);
02731 }
02732
02733 void create_columns_slb_torture_inside(struct COLUMN_REC *clm_recs[9],
02734 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02735 {
02736 create_columns_slb_prison_inside(clm_recs,surr_slb,surr_own,surr_tng);
02737 clm_recs[IDIR_CENTR]->c[0]=CUBE_FLOOR_TORTCIRC;
02738 }
02739
02740 void create_columns_slb_guardpost(struct COLUMN_REC *clm_recs[9],
02741 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02742 {
02743 fill_column_guardpost_floor_c(clm_recs[IDIR_NORTH], surr_own[IDIR_CENTR]);
02744 fill_column_guardpost_floor_a(clm_recs[IDIR_NE], surr_own[IDIR_CENTR]);
02745 fill_column_guardpost_floor_c(clm_recs[IDIR_EAST], surr_own[IDIR_CENTR]);
02746 fill_column_guardpost_floor_b(clm_recs[IDIR_SE], surr_own[IDIR_CENTR]);
02747 fill_column_guardpost_floor_c(clm_recs[IDIR_SOUTH], surr_own[IDIR_CENTR]);
02748 fill_column_guardpost_floor_a(clm_recs[IDIR_SW], surr_own[IDIR_CENTR]);
02749 fill_column_guardpost_floor_c(clm_recs[IDIR_WEST], surr_own[IDIR_CENTR]);
02750 fill_column_guardpost_floor_b(clm_recs[IDIR_NW], surr_own[IDIR_CENTR]);
02751 fill_column_guardpost_floor_c(clm_recs[IDIR_CENTR], surr_own[IDIR_CENTR]);
02752 }
02753
02754 void create_columns_slb_bridge(struct COLUMN_REC *clm_recs[9],
02755 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02756 {
02757 int i;
02758 for (i=0;i<9;i++)
02759 fill_column_bridge_inside(clm_recs[i], surr_own[IDIR_CENTR]);
02760 }
02761
02762 void create_columns_slb_rock_gndlev(struct COLUMN_REC *clm_recs[9],
02763 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02764 {
02765 int i,k;
02766 for (i=0;i<3;i++)
02767 for (k=0;k<3;k++)
02768 {
02769 fill_column_rock_gndlev(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02770 }
02771 }
02772
02773 void create_columns_slb_rockcaped_pathcave(struct COLUMN_REC *clm_recs[9],
02774 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02775 {
02776 int i,k;
02777 for (i=0;i<3;i++)
02778 for (k=0;k<3;k++)
02779 {
02780 fill_column_path(clm_recs[k*3+i],surr_own[IDIR_CENTR]);
02781 clm_recs[k*3+i]->c[4]=CUBE_ROCK1;
02782 clm_recs[k*3+i]->solid=compute_clm_rec_solid(clm_recs[k*3+i]);
02783 clm_recs[k*3+i]->height=compute_clm_rec_height(clm_recs[k*3+i]);
02784 }
02785 modify_liquid_surrounding(clm_recs, surr_slb, 0, 0x02e, 0x02f);
02786 }
02787
02788 void create_columns_slb_rockcaped_claimcave(struct COLUMN_REC *clm_recs[9],
02789 unsigned char *surr_slb,unsigned char *surr_own, unsigned char **surr_tng)
02790 {
02791 create_columns_slb_claimed(clm_recs,surr_slb,surr_own,surr_tng);
02792 int i,k;
02793 for (i=0;i<3;i++)
02794 for (k=0;k<3;k++)
02795 {
02796 clm_recs[k*3+i]->c[4]=CUBE_ROCK1;
02797 clm_recs[k*3+i]->solid=compute_clm_rec_solid(clm_recs[k*3+i]);
02798 clm_recs[k*3+i]->height=compute_clm_rec_height(clm_recs[k*3+i]);
02799 }
02800 }