… | |
… | |
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 |
… | |
… | |
317 | fprintf (stderr, "P %p\n", pl); |
318 | fprintf (stderr, "P %p\n", pl); |
318 | |
319 | |
319 | for_all_clients (ns) |
320 | for_all_clients (ns) |
320 | if (find_backref (ptr, ns)) |
321 | if (find_backref (ptr, ns)) |
321 | fprintf (stderr, "C %p\n", ns); |
322 | fprintf (stderr, "C %p\n", ns); |
322 | |
|
|
323 | } |
323 | } |
324 | |
324 | |
325 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
325 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
326 | |
326 | |
327 | static SV * |
327 | static SV * |
… | |
… | |
1029 | CALL_END; |
1029 | CALL_END; |
1030 | |
1030 | |
1031 | return can; |
1031 | return can; |
1032 | } |
1032 | } |
1033 | |
1033 | |
|
|
1034 | void |
|
|
1035 | cfperl_mapscript_activate (object *ob, int state, object *activator, object *originator) |
|
|
1036 | { |
|
|
1037 | CALL_BEGIN (4); |
|
|
1038 | CALL_ARG (ob); |
|
|
1039 | CALL_ARG (state); |
|
|
1040 | CALL_ARG (activator); |
|
|
1041 | CALL_ARG (originator); |
|
|
1042 | CALL_CALL ("cf::mapscript::activate", G_VOID); |
|
|
1043 | CALL_END; |
|
|
1044 | } |
|
|
1045 | |
1034 | player * |
1046 | player * |
1035 | player::find (const char *name) |
1047 | player::find (const char *name) |
1036 | { |
1048 | { |
1037 | CALL_BEGIN (1); |
1049 | CALL_BEGIN (1); |
1038 | CALL_ARG (name); |
1050 | CALL_ARG (name); |
… | |
… | |
1244 | cb_object = get_av ("cf::CB_OBJECT", 1); |
1256 | cb_object = get_av ("cf::CB_OBJECT", 1); |
1245 | cb_player = get_av ("cf::CB_PLAYER", 1); |
1257 | cb_player = get_av ("cf::CB_PLAYER", 1); |
1246 | cb_client = get_av ("cf::CB_CLIENT", 1); |
1258 | cb_client = get_av ("cf::CB_CLIENT", 1); |
1247 | cb_type = get_av ("cf::CB_TYPE" , 1); |
1259 | cb_type = get_av ("cf::CB_TYPE" , 1); |
1248 | cb_map = get_av ("cf::CB_MAP" , 1); |
1260 | cb_map = get_av ("cf::CB_MAP" , 1); |
|
|
1261 | |
|
|
1262 | av_reflect = get_av ("cf::REFLECT" , 1); |
1249 | } |
1263 | } |
1250 | |
1264 | |
1251 | MODULE = cf PACKAGE = cf PREFIX = cf_ |
1265 | MODULE = cf PACKAGE = cf PREFIX = cf_ |
1252 | |
1266 | |
1253 | BOOT: |
1267 | BOOT: |
… | |
… | |
1316 | const_iv (FORCE) const_iv (POTION_EFFECT) const_iv (EVENT_CONNECTOR) const_iv (CLOSE_CON) |
1330 | 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) |
1331 | 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) |
1332 | 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) |
1333 | 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) |
1334 | const_iv (SYMPTOM) const_iv (BUILDER) const_iv (MATERIAL) const_iv (ITEM_TRANSFORMER) |
|
|
1335 | const_iv (MAPSCRIPT) const_iv (SAFE_GROUND) |
1321 | |
1336 | |
1322 | const_iv (NUM_TYPES) const_iv (NUM_SUBTYPES) |
1337 | const_iv (NUM_TYPES) const_iv (NUM_SUBTYPES) |
1323 | |
1338 | |
1324 | const_iv (ST_BD_BUILD) const_iv (ST_BD_REMOVE) |
1339 | 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) |
1340 | const_iv (ST_MAT_FLOOR) const_iv (ST_MAT_WALL) const_iv (ST_MAT_ITEM) |
… | |
… | |
2131 | |
2146 | |
2132 | int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) |
2147 | int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) |
2133 | |
2148 | |
2134 | int calc_skill_exp (object *who, object *op, object *skill); |
2149 | int calc_skill_exp (object *who, object *op, object *skill); |
2135 | |
2150 | |
2136 | void push_button (object *op); |
2151 | void push_button (object *op, object *originator); |
2137 | |
2152 | |
2138 | void use_trigger (object *op); |
2153 | 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 | |
2154 | |
2144 | void handle_apply_yield (object *op); |
2155 | void handle_apply_yield (object *op); |
|
|
2156 | |
|
|
2157 | int convert_item (object *item, object *converter); |
2145 | |
2158 | |
2146 | |
2159 | |
2147 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
2160 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
2148 | |
2161 | |
2149 | # no clean way to get an object from an archetype - stupid idiotic |
2162 | # no clean way to get an object from an archetype - stupid idiotic |
… | |
… | |
2355 | void |
2368 | void |
2356 | adjust_daylight () |
2369 | adjust_daylight () |
2357 | CODE: |
2370 | CODE: |
2358 | maptile::adjust_daylight (); |
2371 | maptile::adjust_daylight (); |
2359 | |
2372 | |
|
|
2373 | int |
|
|
2374 | outdoor_darkness (int darkness = 0) |
|
|
2375 | CODE: |
|
|
2376 | RETVAL = maptile::outdoor_darkness; |
|
|
2377 | if (items) |
|
|
2378 | maptile::outdoor_darkness = darkness; |
|
|
2379 | OUTPUT: |
|
|
2380 | RETVAL |
|
|
2381 | |
2360 | void |
2382 | void |
2361 | maptile::instantiate () |
2383 | maptile::instantiate () |
2362 | |
2384 | |
2363 | maptile *new () |
2385 | maptile *new () |
2364 | PROTOTYPE: |
2386 | PROTOTYPE: |
… | |
… | |
2472 | } |
2494 | } |
2473 | |
2495 | |
2474 | int out_of_map (maptile *map, int x, int y) |
2496 | int out_of_map (maptile *map, int x, int y) |
2475 | |
2497 | |
2476 | void |
2498 | void |
2477 | trigger (maptile *map, long connection, bool state = true) |
2499 | 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: |
2500 | PPCODE: |
2484 | oblinkpt *obp = get_connection_links (map, connection); |
2501 | if (oblinkpt *obp = map->find_link (connection)) |
2485 | if (obp) |
|
|
2486 | for (objectlink *ol = obp->link; ol; ol = ol->next) |
2502 | for (objectlink *ol = obp->link; ol; ol = ol->next) |
2487 | XPUSHs (sv_2mortal (to_sv ((object *)ol->ob))); |
2503 | XPUSHs (sv_2mortal (to_sv ((object *)ol->ob))); |
2488 | |
2504 | |
2489 | void |
2505 | void |
2490 | get_map_flags (maptile *map, int x, int y) |
2506 | get_map_flags (maptile *map, int x, int y) |