1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001-2005,2007 by Chachkoff Yann |
|
|
6 | * Copyright (©) 2006,2007 by Marc Lehmann <cf@schmorp.de> |
5 | * Copyright (©) 2006,2007 by Marc Lehmann <cf@schmorp.de> |
7 | * |
6 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
7 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * it under the terms of the GNU General Public License as published by |
8 | * the terms of the Affero GNU General Public License as published by the |
10 | * the Free Software Foundation, either version 3 of the License, or |
9 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * (at your option) any later version. |
10 | * option) any later version. |
12 | * |
11 | * |
13 | * This program is distributed in the hope that it will be useful, |
12 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
15 | * GNU General Public License for more details. |
17 | * |
16 | * |
18 | * You should have received a copy of the GNU General Public License |
17 | * You should have received a copy of the Affero GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | * and the GNU General Public License along with this program. If not, see |
|
|
19 | * <http://www.gnu.org/licenses/>. |
20 | * |
20 | * |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #include "autoconf.h" |
24 | #include "autoconf.h" |
… | |
… | |
71 | static int tick_pending; |
71 | static int tick_pending; |
72 | |
72 | |
73 | global gbl_ev; |
73 | global gbl_ev; |
74 | static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map; |
74 | static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map; |
75 | static SV *sv_runtime, *sv_tick_start, *sv_next_tick, *sv_now; |
75 | static SV *sv_runtime, *sv_tick_start, *sv_next_tick, *sv_now; |
|
|
76 | static AV *av_reflect; |
76 | |
77 | |
77 | bitset<NUM_EVENT_TYPES> ev_want_event; |
78 | bitset<NUM_EVENT_TYPES> ev_want_event; |
78 | bitset<NUM_TYPES> ev_want_type; |
79 | bitset<NUM_TYPES> ev_want_type; |
79 | |
80 | |
80 | static HV |
81 | static HV |
… | |
… | |
88 | *stash_cf_arch_wrap, |
89 | *stash_cf_arch_wrap, |
89 | *stash_cf_party_wrap, |
90 | *stash_cf_party_wrap, |
90 | *stash_cf_region_wrap, |
91 | *stash_cf_region_wrap, |
91 | *stash_cf_living_wrap; |
92 | *stash_cf_living_wrap; |
92 | |
93 | |
|
|
94 | static SV |
|
|
95 | *cv_cf_do_invoke, |
|
|
96 | *cv_cf__can_merge, |
|
|
97 | *cv_cf_client_send_msg, |
|
|
98 | *cv_cf_tick, |
|
|
99 | *cv_cf_match_match; |
|
|
100 | |
93 | #ifndef newSVpv_utf8 |
101 | #ifndef newSVpv_utf8 |
94 | static inline SV * |
102 | static inline SV * |
95 | newSVpv_utf8 (const char *s) |
103 | newSVpv_utf8 (const char *s) |
96 | { |
104 | { |
97 | if (!s) |
105 | if (!s) |
… | |
… | |
317 | fprintf (stderr, "P %p\n", pl); |
325 | fprintf (stderr, "P %p\n", pl); |
318 | |
326 | |
319 | for_all_clients (ns) |
327 | for_all_clients (ns) |
320 | if (find_backref (ptr, ns)) |
328 | if (find_backref (ptr, ns)) |
321 | fprintf (stderr, "C %p\n", ns); |
329 | fprintf (stderr, "C %p\n", ns); |
322 | |
|
|
323 | } |
330 | } |
324 | |
331 | |
325 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
332 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
326 | |
333 | |
327 | static SV * |
334 | static SV * |
… | |
… | |
919 | XPUSHs (sv_2mortal (newSVdt_va (ap, dt))); |
926 | XPUSHs (sv_2mortal (newSVdt_va (ap, dt))); |
920 | } |
927 | } |
921 | |
928 | |
922 | va_end (ap); |
929 | va_end (ap); |
923 | |
930 | |
924 | CALL_CALL ("cf::do_invoke", G_SCALAR); |
931 | CALL_CALL (cv_cf_do_invoke, G_SCALAR); |
925 | count = count > 0 ? POPi : 0; |
932 | count = count > 0 ? POPi : 0; |
926 | |
933 | |
927 | CALL_END; |
934 | CALL_END; |
928 | |
935 | |
929 | return count; |
936 | return count; |
… | |
… | |
970 | |
977 | |
971 | dSP; |
978 | dSP; |
972 | |
979 | |
973 | PUSHMARK (SP); |
980 | PUSHMARK (SP); |
974 | PUTBACK; |
981 | PUTBACK; |
975 | call_pv ("cf::tick", G_DISCARD | G_VOID); |
982 | call_pvsv (cv_cf_tick, G_DISCARD | G_VOID); |
976 | |
983 | |
977 | SvNV_set (sv_next_tick, get_next_tick ()); SvNOK_only (sv_next_tick); |
984 | SvNV_set (sv_next_tick, get_next_tick ()); SvNOK_only (sv_next_tick); |
978 | } |
985 | } |
979 | |
986 | |
980 | void |
987 | void |
… | |
… | |
1010 | CALL_BEGIN (4); |
1017 | CALL_BEGIN (4); |
1011 | CALL_ARG (ns); |
1018 | CALL_ARG (ns); |
1012 | CALL_ARG (type); |
1019 | CALL_ARG (type); |
1013 | CALL_ARG_SV (newSVpv_utf8 (msg)); |
1020 | CALL_ARG_SV (newSVpv_utf8 (msg)); |
1014 | CALL_ARG (color); |
1021 | CALL_ARG (color); |
1015 | CALL_CALL ("cf::client::send_msg", G_VOID); |
1022 | CALL_CALL (cv_cf_client_send_msg, G_VOID); |
1016 | CALL_END; |
1023 | CALL_END; |
1017 | } |
1024 | } |
1018 | |
1025 | |
1019 | int |
1026 | int |
1020 | cfperl_can_merge (object *ob1, object *ob2) |
1027 | cfperl_can_merge (object *ob1, object *ob2) |
… | |
… | |
1022 | int can; |
1029 | int can; |
1023 | |
1030 | |
1024 | CALL_BEGIN (2); |
1031 | CALL_BEGIN (2); |
1025 | CALL_ARG (ob1); |
1032 | CALL_ARG (ob1); |
1026 | CALL_ARG (ob2); |
1033 | CALL_ARG (ob2); |
1027 | CALL_CALL ("cf::_can_merge", G_SCALAR); |
1034 | CALL_CALL (cv_cf__can_merge, G_SCALAR); |
1028 | can = count && SvTRUE (TOPs); |
1035 | can = count && SvTRUE (TOPs); |
1029 | CALL_END; |
1036 | CALL_END; |
1030 | |
1037 | |
1031 | return can; |
1038 | return can; |
|
|
1039 | } |
|
|
1040 | |
|
|
1041 | void |
|
|
1042 | cfperl_mapscript_activate (object *ob, int state, object *activator, object *originator) |
|
|
1043 | { |
|
|
1044 | CALL_BEGIN (4); |
|
|
1045 | CALL_ARG (ob); |
|
|
1046 | CALL_ARG (state); |
|
|
1047 | CALL_ARG (activator); |
|
|
1048 | CALL_ARG (originator); |
|
|
1049 | CALL_CALL ("cf::mapscript::activate", G_VOID); |
|
|
1050 | CALL_END; |
1032 | } |
1051 | } |
1033 | |
1052 | |
1034 | player * |
1053 | player * |
1035 | player::find (const char *name) |
1054 | player::find (const char *name) |
1036 | { |
1055 | { |
… | |
… | |
1176 | CALL_CALL ("cf::_log_backtrace", G_VOID); |
1195 | CALL_CALL ("cf::_log_backtrace", G_VOID); |
1177 | CALL_END; |
1196 | CALL_END; |
1178 | #endif |
1197 | #endif |
1179 | } |
1198 | } |
1180 | |
1199 | |
|
|
1200 | bool |
|
|
1201 | is_match_expr (const char *expr) |
|
|
1202 | { |
|
|
1203 | return !strncmp (expr, "match ", sizeof ("match ") - 1); |
|
|
1204 | } |
|
|
1205 | |
|
|
1206 | bool |
|
|
1207 | match (const char *expr, object *ob, object *self, object *source, object *originator) |
|
|
1208 | { |
|
|
1209 | if (!strncmp (expr, "match ", sizeof ("match ") - 1)) |
|
|
1210 | expr += sizeof ("match ") - 1; |
|
|
1211 | |
|
|
1212 | CALL_BEGIN (5); |
|
|
1213 | CALL_ARG (expr); |
|
|
1214 | CALL_ARG (ob); |
|
|
1215 | CALL_ARG (self); |
|
|
1216 | CALL_ARG (source); |
|
|
1217 | CALL_ARG (originator); |
|
|
1218 | CALL_CALL (cv_cf_match_match, G_SCALAR); |
|
|
1219 | |
|
|
1220 | bool matched = count && SvTRUE (TOPs); |
|
|
1221 | |
|
|
1222 | CALL_END; |
|
|
1223 | |
|
|
1224 | return matched; |
|
|
1225 | } |
|
|
1226 | |
1181 | ///////////////////////////////////////////////////////////////////////////// |
1227 | ///////////////////////////////////////////////////////////////////////////// |
1182 | |
1228 | |
1183 | struct EVAPI *evapi::GEVAPI; |
1229 | struct EVAPI *evapi::GEVAPI; |
1184 | struct CoroAPI *coroapi::GCoroAPI; |
1230 | struct CoroAPI *coroapi::GCoroAPI; |
1185 | |
1231 | |
… | |
… | |
1217 | if (active) start (); |
1263 | if (active) start (); |
1218 | } |
1264 | } |
1219 | } |
1265 | } |
1220 | |
1266 | |
1221 | static void |
1267 | static void |
1222 | _connect_to_perl () |
1268 | _connect_to_perl_1 () |
1223 | { |
1269 | { |
1224 | stash_cf = gv_stashpv ("cf", 1); |
1270 | stash_cf = gv_stashpv ("cf", 1); |
1225 | |
1271 | |
1226 | stash_cf_object_wrap = gv_stashpv ("cf::object::wrap", 1); |
1272 | stash_cf_object_wrap = gv_stashpv ("cf::object::wrap", 1); |
1227 | stash_cf_object_player_wrap = gv_stashpv ("cf::object::player::wrap", 1); |
1273 | stash_cf_object_player_wrap = gv_stashpv ("cf::object::player::wrap", 1); |
… | |
… | |
1246 | cb_client = get_av ("cf::CB_CLIENT", 1); |
1292 | cb_client = get_av ("cf::CB_CLIENT", 1); |
1247 | cb_type = get_av ("cf::CB_TYPE" , 1); |
1293 | cb_type = get_av ("cf::CB_TYPE" , 1); |
1248 | cb_map = get_av ("cf::CB_MAP" , 1); |
1294 | cb_map = get_av ("cf::CB_MAP" , 1); |
1249 | } |
1295 | } |
1250 | |
1296 | |
|
|
1297 | static void |
|
|
1298 | _connect_to_perl_2 () |
|
|
1299 | { |
|
|
1300 | cv_cf_do_invoke = (SV *)get_cv ("cf::do_invoke" , 0); assert (cv_cf_do_invoke); |
|
|
1301 | cv_cf__can_merge = (SV *)get_cv ("cf::_can_merge" , 0); assert (cv_cf__can_merge); |
|
|
1302 | cv_cf_client_send_msg = (SV *)get_cv ("cf::client::send_msg", 0); assert (cv_cf_client_send_msg); |
|
|
1303 | cv_cf_tick = (SV *)get_cv ("cf::tick" , 0); assert (cv_cf_tick); |
|
|
1304 | cv_cf_match_match = (SV *)get_cv ("cf::match::match" , 0); assert (cv_cf_match_match); |
|
|
1305 | } |
|
|
1306 | |
1251 | MODULE = cf PACKAGE = cf PREFIX = cf_ |
1307 | MODULE = cf PACKAGE = cf PREFIX = cf_ |
1252 | |
1308 | |
1253 | BOOT: |
1309 | BOOT: |
1254 | { |
1310 | { |
1255 | I_EV_API (PACKAGE); evapi::GEVAPI = GEVAPI; |
1311 | I_EV_API (PACKAGE); evapi::GEVAPI = GEVAPI; |
1256 | I_CORO_API (PACKAGE); coroapi::GCoroAPI = GCoroAPI; |
1312 | I_CORO_API (PACKAGE); coroapi::GCoroAPI = GCoroAPI; |
1257 | |
1313 | |
1258 | _connect_to_perl (); |
1314 | _connect_to_perl_1 (); |
1259 | |
1315 | |
1260 | newCONSTSUB (stash_cf, "VERSION", newSVpv (VERSION, sizeof (VERSION) - 1)); |
1316 | newCONSTSUB (stash_cf, "VERSION", newSVpv (VERSION, sizeof (VERSION) - 1)); |
1261 | |
1317 | |
1262 | //{ |
1318 | //{ |
1263 | // require_pv ("Time::HiRes"); |
1319 | // require_pv ("Time::HiRes"); |
… | |
… | |
1307 | const_iv (MOOD_FLOOR) const_iv (EXIT) const_iv (ENCOUNTER) const_iv (SHOP_FLOOR) |
1363 | const_iv (MOOD_FLOOR) const_iv (EXIT) const_iv (ENCOUNTER) const_iv (SHOP_FLOOR) |
1308 | const_iv (SHOP_MAT) const_iv (RING) const_iv (FLOOR) const_iv (FLESH) |
1364 | const_iv (SHOP_MAT) const_iv (RING) const_iv (FLOOR) const_iv (FLESH) |
1309 | const_iv (INORGANIC) const_iv (SKILL_TOOL) const_iv (LIGHTER) const_iv (BUILDABLE_WALL) |
1365 | const_iv (INORGANIC) const_iv (SKILL_TOOL) const_iv (LIGHTER) const_iv (BUILDABLE_WALL) |
1310 | const_iv (MISC_OBJECT) const_iv (LAMP) const_iv (DUPLICATOR) const_iv (SPELLBOOK) |
1366 | const_iv (MISC_OBJECT) const_iv (LAMP) const_iv (DUPLICATOR) const_iv (SPELLBOOK) |
1311 | const_iv (CLOAK) const_iv (SPINNER) const_iv (GATE) const_iv (BUTTON) |
1367 | const_iv (CLOAK) const_iv (SPINNER) const_iv (GATE) const_iv (BUTTON) |
1312 | const_iv (CF_HANDLE) const_iv (HOLE) const_iv (TRAPDOOR) const_iv (SIGN) |
1368 | const_iv (T_HANDLE) const_iv (HOLE) const_iv (TRAPDOOR) const_iv (SIGN) |
1313 | const_iv (BOOTS) const_iv (GLOVES) const_iv (SPELL) const_iv (SPELL_EFFECT) |
1369 | const_iv (BOOTS) const_iv (GLOVES) const_iv (SPELL) const_iv (SPELL_EFFECT) |
1314 | const_iv (CONVERTER) const_iv (BRACERS) const_iv (POISONING) const_iv (SAVEBED) |
1370 | const_iv (CONVERTER) const_iv (BRACERS) const_iv (POISONING) const_iv (SAVEBED) |
1315 | const_iv (WAND) const_iv (SCROLL) const_iv (DIRECTOR) const_iv (GIRDLE) |
1371 | const_iv (WAND) const_iv (SCROLL) const_iv (DIRECTOR) const_iv (GIRDLE) |
1316 | const_iv (FORCE) const_iv (POTION_EFFECT) const_iv (EVENT_CONNECTOR) const_iv (CLOSE_CON) |
1372 | const_iv (FORCE) const_iv (POTION_EFFECT) const_iv (EVENT_CONNECTOR) const_iv (CLOSE_CON) |
1317 | const_iv (CONTAINER) const_iv (ARMOUR_IMPROVER) const_iv (WEAPON_IMPROVER) const_iv (SKILLSCROLL) |
1373 | const_iv (CONTAINER) const_iv (ARMOUR_IMPROVER) const_iv (WEAPON_IMPROVER) const_iv (SKILLSCROLL) |
1318 | const_iv (DEEP_SWAMP) const_iv (IDENTIFY_ALTAR) const_iv (MENU) const_iv (RUNE) |
1374 | const_iv (DEEP_SWAMP) const_iv (IDENTIFY_ALTAR) const_iv (MENU) const_iv (RUNE) |
1319 | const_iv (TRAP) const_iv (POWER_CRYSTAL) const_iv (CORPSE) const_iv (DISEASE) |
1375 | const_iv (TRAP) const_iv (POWER_CRYSTAL) const_iv (CORPSE) const_iv (DISEASE) |
1320 | const_iv (SYMPTOM) const_iv (BUILDER) const_iv (MATERIAL) const_iv (ITEM_TRANSFORMER) |
1376 | const_iv (SYMPTOM) const_iv (BUILDER) const_iv (MATERIAL) const_iv (ITEM_TRANSFORMER) |
|
|
1377 | const_iv (MAPSCRIPT) const_iv (SAFE_GROUND) |
1321 | |
1378 | |
1322 | const_iv (NUM_TYPES) const_iv (NUM_SUBTYPES) |
1379 | const_iv (NUM_TYPES) const_iv (NUM_SUBTYPES) |
1323 | |
1380 | |
1324 | const_iv (ST_BD_BUILD) const_iv (ST_BD_REMOVE) |
1381 | const_iv (ST_BD_BUILD) const_iv (ST_BD_REMOVE) |
1325 | const_iv (ST_MAT_FLOOR) const_iv (ST_MAT_WALL) const_iv (ST_MAT_ITEM) |
1382 | const_iv (ST_MAT_FLOOR) const_iv (ST_MAT_WALL) const_iv (ST_MAT_ITEM) |
… | |
… | |
1534 | av_push (event, newSVpv ((char *)eiv->name + eiv->skip, 0)); |
1591 | av_push (event, newSVpv ((char *)eiv->name + eiv->skip, 0)); |
1535 | av_push (event, newSViv (eiv->klass)); |
1592 | av_push (event, newSViv (eiv->klass)); |
1536 | av_store (av, eiv->iv, newRV_noinc ((SV *)event)); |
1593 | av_store (av, eiv->iv, newRV_noinc ((SV *)event)); |
1537 | newCONSTSUB (stash_cf, (char *)eiv->name, newSViv (eiv->iv)); |
1594 | newCONSTSUB (stash_cf, (char *)eiv->name, newSViv (eiv->iv)); |
1538 | } |
1595 | } |
|
|
1596 | |
|
|
1597 | // used by autogenerated BOOT sections from genacc |
|
|
1598 | av_reflect = get_av ("cf::REFLECT", 1); |
1539 | } |
1599 | } |
1540 | |
1600 | |
1541 | void _gv_clear (SV *gv) |
1601 | void _gv_clear (SV *gv) |
1542 | CODE: |
1602 | CODE: |
1543 | assert (SvTYPE (gv) == SVt_PVGV); |
1603 | assert (SvTYPE (gv) == SVt_PVGV); |
… | |
… | |
1550 | f (GvGP (gv)->gp_cv); |
1610 | f (GvGP (gv)->gp_cv); |
1551 | GvCVGEN (gv) = 0; |
1611 | GvCVGEN (gv) = 0; |
1552 | GvMULTI_off (gv); |
1612 | GvMULTI_off (gv); |
1553 | # undef f |
1613 | # undef f |
1554 | |
1614 | |
1555 | void _connect_to_perl () |
1615 | void _connect_to_perl_1 () |
|
|
1616 | |
|
|
1617 | void _connect_to_perl_2 () |
1556 | |
1618 | |
1557 | void _recalc_want () |
1619 | void _recalc_want () |
1558 | |
1620 | |
1559 | # not used by default anymore |
1621 | # not used by default anymore |
1560 | void _global_reattach () |
1622 | void _global_reattach () |
… | |
… | |
2131 | |
2193 | |
2132 | int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) |
2194 | int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) |
2133 | |
2195 | |
2134 | int calc_skill_exp (object *who, object *op, object *skill); |
2196 | int calc_skill_exp (object *who, object *op, object *skill); |
2135 | |
2197 | |
2136 | void push_button (object *op); |
2198 | void push_button (object *op, object *originator); |
2137 | |
2199 | |
2138 | void use_trigger (object *op); |
2200 | void use_trigger (object *op, object *originator); |
2139 | |
|
|
2140 | void add_button_link (object *button, maptile *map, int connected); |
|
|
2141 | |
|
|
2142 | void remove_button_link (object *op); |
|
|
2143 | |
2201 | |
2144 | void handle_apply_yield (object *op); |
2202 | void handle_apply_yield (object *op); |
|
|
2203 | |
|
|
2204 | int convert_item (object *item, object *converter); |
2145 | |
2205 | |
2146 | |
2206 | |
2147 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
2207 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
2148 | |
2208 | |
2149 | # no clean way to get an object from an archetype - stupid idiotic |
2209 | # no clean way to get an object from an archetype - stupid idiotic |
… | |
… | |
2355 | void |
2415 | void |
2356 | adjust_daylight () |
2416 | adjust_daylight () |
2357 | CODE: |
2417 | CODE: |
2358 | maptile::adjust_daylight (); |
2418 | maptile::adjust_daylight (); |
2359 | |
2419 | |
|
|
2420 | int |
|
|
2421 | outdoor_darkness (int darkness = 0) |
|
|
2422 | CODE: |
|
|
2423 | RETVAL = maptile::outdoor_darkness; |
|
|
2424 | if (items) |
|
|
2425 | maptile::outdoor_darkness = darkness; |
|
|
2426 | OUTPUT: |
|
|
2427 | RETVAL |
|
|
2428 | |
2360 | void |
2429 | void |
2361 | maptile::instantiate () |
2430 | maptile::instantiate () |
2362 | |
2431 | |
2363 | maptile *new () |
2432 | maptile *new () |
2364 | PROTOTYPE: |
2433 | PROTOTYPE: |
… | |
… | |
2472 | } |
2541 | } |
2473 | |
2542 | |
2474 | int out_of_map (maptile *map, int x, int y) |
2543 | int out_of_map (maptile *map, int x, int y) |
2475 | |
2544 | |
2476 | void |
2545 | void |
2477 | trigger (maptile *map, long connection, bool state = true) |
2546 | find_link (maptile *map, shstr_tmp connection) |
2478 | CODE: |
|
|
2479 | activate_connection (map, connection, state); |
|
|
2480 | |
|
|
2481 | void |
|
|
2482 | get_connection (maptile *map, long connection) |
|
|
2483 | PPCODE: |
2547 | PPCODE: |
2484 | oblinkpt *obp = get_connection_links (map, connection); |
2548 | if (oblinkpt *obp = map->find_link (connection)) |
2485 | if (obp) |
|
|
2486 | for (objectlink *ol = obp->link; ol; ol = ol->next) |
2549 | for (objectlink *ol = obp->link; ol; ol = ol->next) |
2487 | XPUSHs (sv_2mortal (to_sv ((object *)ol->ob))); |
2550 | XPUSHs (sv_2mortal (to_sv ((object *)ol->ob))); |
2488 | |
2551 | |
2489 | void |
2552 | void |
2490 | get_map_flags (maptile *map, int x, int y) |
2553 | get_map_flags (maptile *map, int x, int y) |
… | |
… | |
2579 | case 6: RETVAL = newSVuv (ms.move_on ); break; |
2642 | case 6: RETVAL = newSVuv (ms.move_on ); break; |
2580 | case 7: RETVAL = newSVuv (ms.move_off ); break; |
2643 | case 7: RETVAL = newSVuv (ms.move_off ); break; |
2581 | } |
2644 | } |
2582 | } |
2645 | } |
2583 | OUTPUT: RETVAL |
2646 | OUTPUT: RETVAL |
2584 | |
|
|
2585 | void fix_walls (maptile *map, int x, int y) |
|
|
2586 | |
|
|
2587 | void fix_walls_around (maptile *map, int x, int y) |
|
|
2588 | |
2647 | |
2589 | # worst xs function of my life |
2648 | # worst xs function of my life |
2590 | bool |
2649 | bool |
2591 | _create_random_map (\ |
2650 | _create_random_map (\ |
2592 | maptile *self,\ |
2651 | maptile *self,\ |