… | |
… | |
24 | #include <unistd.h> |
24 | #include <unistd.h> |
25 | |
25 | |
26 | #include "global.h" |
26 | #include "global.h" |
27 | #include "loader.h" |
27 | #include "loader.h" |
28 | #include "path.h" |
28 | #include "path.h" |
|
|
29 | |
|
|
30 | sint8 maptile::outdoor_darkness; |
29 | |
31 | |
30 | /* This rolls up wall, blocks_magic, blocks_view, etc, all into |
32 | /* This rolls up wall, blocks_magic, blocks_view, etc, all into |
31 | * one function that just returns a P_.. value (see map.h) |
33 | * one function that just returns a P_.. value (see map.h) |
32 | * it will also do map translation for tiled maps, returning |
34 | * it will also do map translation for tiled maps, returning |
33 | * new values into newmap, nx, and ny. Any and all of those |
35 | * new values into newmap, nx, and ny. Any and all of those |
… | |
… | |
963 | /* |
965 | /* |
964 | * This routine is supposed to find out the difficulty of the map. |
966 | * This routine is supposed to find out the difficulty of the map. |
965 | * difficulty does not have a lot to do with character level, |
967 | * difficulty does not have a lot to do with character level, |
966 | * but does have a lot to do with treasure on the map. |
968 | * but does have a lot to do with treasure on the map. |
967 | * |
969 | * |
968 | * Difficulty can now be set by the map creature. If the value stored |
970 | * Difficulty can now be set by the map creator. If the value stored |
969 | * in the map is zero, then use this routine. Maps should really |
971 | * in the map is zero, then use this routine. Maps should really |
970 | * have a difficulty set than using this function - human calculation |
972 | * have a difficulty set rather than using this function - human calculation |
971 | * is much better than this functions guesswork. |
973 | * is much better than this function's guesswork. |
972 | */ |
974 | */ |
973 | int |
975 | int |
974 | maptile::estimate_difficulty () const |
976 | maptile::estimate_difficulty () const |
975 | { |
977 | { |
976 | long monster_cnt = 0; |
978 | long monster_cnt = 0; |
… | |
… | |
1625 | maptile::play_sound (faceidx sound, int x, int y) const |
1627 | maptile::play_sound (faceidx sound, int x, int y) const |
1626 | { |
1628 | { |
1627 | if (!sound) |
1629 | if (!sound) |
1628 | return; |
1630 | return; |
1629 | |
1631 | |
1630 | for_all_players (pl) |
1632 | for_all_players_on_map (pl, this) |
1631 | if (pl->ob->map == this) |
|
|
1632 | if (client *ns = pl->ns) |
1633 | if (client *ns = pl->ns) |
1633 | { |
1634 | { |
1634 | int dx = x - pl->ob->x; |
1635 | int dx = x - pl->ob->x; |
1635 | int dy = y - pl->ob->y; |
1636 | int dy = y - pl->ob->y; |
1636 | |
1637 | |
1637 | int distance = idistance (dx, dy); |
1638 | int distance = idistance (dx, dy); |
1638 | |
1639 | |
1639 | if (distance <= MAX_SOUND_DISTANCE) |
1640 | if (distance <= MAX_SOUND_DISTANCE) |
1640 | ns->play_sound (sound, dx, dy); |
1641 | ns->play_sound (sound, dx, dy); |
1641 | } |
1642 | } |
1642 | } |
1643 | } |
1643 | |
1644 | |