… | |
… | |
2395 | } |
2395 | } |
2396 | |
2396 | |
2397 | void |
2397 | void |
2398 | maptile::create_region_treasure () |
2398 | maptile::create_region_treasure () |
2399 | CODE: |
2399 | CODE: |
2400 | { |
|
|
2401 | for (int x = 0; x < THIS->width; ++x) |
2400 | for (int x = 0; x < THIS->width; ++x) |
2402 | for (int y = 0; y < THIS->height; ++y) |
2401 | for (int y = 0; y < THIS->height; ++y) |
2403 | { |
2402 | { |
2404 | region *rgn = THIS->region (x, y); |
2403 | region *rgn = THIS->region (x, y); |
2405 | |
2404 | |
2406 | //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D |
2405 | //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D |
2407 | if (object *op = THIS->at (x, y).top) |
2406 | if (object *op = THIS->at (x, y).top) |
2408 | if (rgn->treasure && rndm () < rgn->treasure_density) |
2407 | if (rgn->treasure && rndm () < rgn->treasure_density) |
2409 | create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty); |
2408 | create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty); |
2410 | } |
2409 | } |
2411 | } |
|
|
2412 | |
2410 | |
2413 | int out_of_map (maptile *map, int x, int y) |
2411 | int out_of_map (maptile *map, int x, int y) |
2414 | |
2412 | |
2415 | void |
2413 | void |
2416 | trigger (maptile *map, long connection, bool state = true) |
2414 | trigger (maptile *map, long connection, bool state = true) |