… | |
… | |
168 | } |
168 | } |
169 | |
169 | |
170 | void |
170 | void |
171 | attachable::do_destroy () |
171 | attachable::do_destroy () |
172 | { |
172 | { |
173 | invoke (EVENT_ATTACHABLE_DESTROY, DT_END); |
173 | INVOKE_ATTACHABLE (DESTROY, this); |
174 | |
174 | |
175 | if (cb) |
175 | if (cb) |
176 | { |
176 | { |
177 | SvREFCNT_dec (cb); |
177 | SvREFCNT_dec (cb); |
178 | cb = 0; |
178 | cb = 0; |
… | |
… | |
655 | void |
655 | void |
656 | attachable::instantiate () |
656 | attachable::instantiate () |
657 | { |
657 | { |
658 | if (attach) |
658 | if (attach) |
659 | { |
659 | { |
660 | invoke (EVENT_ATTACHABLE_INSTANTIATE, ARG_STRING (attach), DT_END); |
660 | INVOKE_ATTACHABLE (INSTANTIATE, this, ARG_STRING (attach)); |
661 | attach = 0; |
661 | attach = 0; |
662 | } |
662 | } |
663 | } |
663 | } |
664 | |
664 | |
665 | void |
665 | void |
666 | attachable::reattach () |
666 | attachable::reattach () |
667 | { |
667 | { |
668 | optimise (); |
668 | optimise (); |
669 | //TODO: check for _attachment's, very important for restarts |
669 | //TODO: check for _attachment's, very important for restarts |
670 | invoke (EVENT_ATTACHABLE_REATTACH, DT_END); |
670 | INVOKE_ATTACHABLE (REATTACH, this); |
671 | } |
671 | } |
672 | |
672 | |
673 | static event_klass klass_of[NUM_EVENT_TYPES] = { |
673 | static event_klass klass_of[NUM_EVENT_TYPES] = { |
674 | # define def(type,name) KLASS_ ## type, |
674 | # define def(type,name) KLASS_ ## type, |
675 | # include "eventinc.h" |
675 | # include "eventinc.h" |
… | |
… | |
823 | } |
823 | } |
824 | } |
824 | } |
825 | } |
825 | } |
826 | |
826 | |
827 | bool |
827 | bool |
828 | attachable::vinvoke (event_type event, va_list &ap) |
828 | attachable::invoke (event_type event, ...) |
829 | { |
829 | { |
830 | data_type dt; |
830 | data_type dt; |
831 | |
831 | |
832 | // callback call ordering should be: |
832 | // callback call ordering should be: |
833 | // 1. per-object callback |
833 | // 1. per-object callback |
… | |
… | |
839 | gather_callbacks (callbacks, event); |
839 | gather_callbacks (callbacks, event); |
840 | |
840 | |
841 | // short-circuit processing if no callbacks found/defined |
841 | // short-circuit processing if no callbacks found/defined |
842 | if (!callbacks) |
842 | if (!callbacks) |
843 | return 0; |
843 | return 0; |
|
|
844 | |
|
|
845 | va_list ap; |
|
|
846 | va_start (ap, event); |
844 | |
847 | |
845 | CALL_BEGIN (3); |
848 | CALL_BEGIN (3); |
846 | CALL_ARG_SV (newSViv (event)); // only used for debugging nowadays |
849 | CALL_ARG_SV (newSViv (event)); // only used for debugging nowadays |
847 | CALL_ARG_SV (newRV_noinc ((SV *)callbacks)); |
850 | CALL_ARG_SV (newRV_noinc ((SV *)callbacks)); |
848 | |
851 | |
… | |
… | |
922 | cfperl_cleanup (int make_core) |
925 | cfperl_cleanup (int make_core) |
923 | { |
926 | { |
924 | CALL_BEGIN (1); |
927 | CALL_BEGIN (1); |
925 | CALL_ARG (make_core); |
928 | CALL_ARG (make_core); |
926 | CALL_CALL ("cf::post_cleanup", G_VOID); |
929 | CALL_CALL ("cf::post_cleanup", G_VOID); |
|
|
930 | CALL_END; |
|
|
931 | } |
|
|
932 | |
|
|
933 | void |
|
|
934 | cfperl_make_book (object *book, int level) |
|
|
935 | { |
|
|
936 | CALL_BEGIN (2); |
|
|
937 | CALL_ARG (book); |
|
|
938 | CALL_ARG (level); |
|
|
939 | CALL_CALL ("ext::books::make_book", G_VOID); |
927 | CALL_END; |
940 | CALL_END; |
928 | } |
941 | } |
929 | |
942 | |
930 | maptile * |
943 | maptile * |
931 | maptile::find_sync (const char *path, maptile *origin) |
944 | maptile::find_sync (const char *path, maptile *origin) |
… | |
… | |
1274 | const_iv (UPD_LOCATION) const_iv (UPD_FLAGS) const_iv (UPD_WEIGHT) const_iv (UPD_FACE) |
1287 | const_iv (UPD_LOCATION) const_iv (UPD_FLAGS) const_iv (UPD_WEIGHT) const_iv (UPD_FACE) |
1275 | const_iv (UPD_NAME) const_iv (UPD_ANIM) const_iv (UPD_ANIMSPEED) const_iv (UPD_NROF) |
1288 | const_iv (UPD_NAME) const_iv (UPD_ANIM) const_iv (UPD_ANIMSPEED) const_iv (UPD_NROF) |
1276 | |
1289 | |
1277 | const_iv (UPD_SP_MANA) const_iv (UPD_SP_GRACE) const_iv (UPD_SP_DAMAGE) |
1290 | const_iv (UPD_SP_MANA) const_iv (UPD_SP_GRACE) const_iv (UPD_SP_DAMAGE) |
1278 | |
1291 | |
|
|
1292 | const_iv (SP_RAISE_DEAD) |
|
|
1293 | const_iv (SP_RUNE) |
|
|
1294 | const_iv (SP_MAKE_MARK) |
|
|
1295 | const_iv (SP_BOLT) |
|
|
1296 | const_iv (SP_BULLET) |
|
|
1297 | const_iv (SP_EXPLOSION) |
|
|
1298 | const_iv (SP_CONE) |
|
|
1299 | const_iv (SP_BOMB) |
|
|
1300 | const_iv (SP_WONDER) |
|
|
1301 | const_iv (SP_SMITE) |
|
|
1302 | const_iv (SP_MAGIC_MISSILE) |
|
|
1303 | const_iv (SP_SUMMON_GOLEM) |
|
|
1304 | const_iv (SP_DIMENSION_DOOR) |
|
|
1305 | const_iv (SP_MAGIC_MAPPING) |
|
|
1306 | const_iv (SP_MAGIC_WALL) |
|
|
1307 | const_iv (SP_DESTRUCTION) |
|
|
1308 | const_iv (SP_PERCEIVE_SELF) |
|
|
1309 | const_iv (SP_WORD_OF_RECALL) |
|
|
1310 | const_iv (SP_INVISIBLE) |
|
|
1311 | const_iv (SP_PROBE) |
|
|
1312 | const_iv (SP_HEALING) |
|
|
1313 | const_iv (SP_CREATE_FOOD) |
|
|
1314 | const_iv (SP_EARTH_TO_DUST) |
|
|
1315 | const_iv (SP_CHANGE_ABILITY) |
|
|
1316 | const_iv (SP_BLESS) |
|
|
1317 | const_iv (SP_CURSE) |
|
|
1318 | const_iv (SP_SUMMON_MONSTER) |
|
|
1319 | const_iv (SP_CHARGING) |
|
|
1320 | const_iv (SP_POLYMORPH) |
|
|
1321 | const_iv (SP_ALCHEMY) |
|
|
1322 | const_iv (SP_REMOVE_CURSE) |
|
|
1323 | const_iv (SP_IDENTIFY) |
|
|
1324 | const_iv (SP_DETECTION) |
|
|
1325 | const_iv (SP_MOOD_CHANGE) |
|
|
1326 | const_iv (SP_MOVING_BALL) |
|
|
1327 | const_iv (SP_SWARM) |
|
|
1328 | const_iv (SP_CHANGE_MANA) |
|
|
1329 | const_iv (SP_DISPEL_RUNE) |
|
|
1330 | const_iv (SP_CREATE_MISSILE) |
|
|
1331 | const_iv (SP_CONSECRATE) |
|
|
1332 | const_iv (SP_ANIMATE_WEAPON) |
|
|
1333 | const_iv (SP_LIGHT) |
|
|
1334 | const_iv (SP_CHANGE_MAP_LIGHT) |
|
|
1335 | const_iv (SP_FAERY_FIRE) |
|
|
1336 | const_iv (SP_CAUSE_DISEASE) |
|
|
1337 | const_iv (SP_AURA) |
|
|
1338 | const_iv (SP_TOWN_PORTAL) |
|
|
1339 | const_iv (SP_PARTY_SPELL) |
|
|
1340 | |
1279 | const_iv (F_APPLIED) const_iv (F_LOCATION) const_iv (F_UNPAID) const_iv (F_MAGIC) |
1341 | const_iv (F_APPLIED) const_iv (F_LOCATION) const_iv (F_UNPAID) const_iv (F_MAGIC) |
1280 | const_iv (F_CURSED) const_iv (F_DAMNED) const_iv (F_OPEN) const_iv (F_NOPICK) |
1342 | const_iv (F_CURSED) const_iv (F_DAMNED) const_iv (F_OPEN) const_iv (F_NOPICK) |
1281 | const_iv (F_LOCKED) |
1343 | const_iv (F_LOCKED) |
1282 | |
1344 | |
1283 | const_iv (F_BUY) const_iv (F_SHOP) const_iv (F_SELL) |
1345 | const_iv (F_BUY) const_iv (F_SHOP) const_iv (F_SELL) |
… | |
… | |
1941 | void check_score (object *op) |
2003 | void check_score (object *op) |
1942 | |
2004 | |
1943 | void message (object *op, utf8_string txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
2005 | void message (object *op, utf8_string txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
1944 | CODE: |
2006 | CODE: |
1945 | new_draw_info (flags, 0, op, txt); |
2007 | new_draw_info (flags, 0, op, txt); |
1946 | |
|
|
1947 | object *cf_player_send_inventory (object *op) |
|
|
1948 | |
|
|
1949 | octet_string cf_player_get_ip (object *op) |
|
|
1950 | ALIAS: ip = 0 |
|
|
1951 | |
|
|
1952 | object *cf_player_get_marked_item (object *op) |
|
|
1953 | ALIAS: marked_item = 0 |
|
|
1954 | |
|
|
1955 | void cf_player_set_marked_item (object *op, object *ob) |
|
|
1956 | |
|
|
1957 | partylist *cf_player_get_party (object *op) |
|
|
1958 | ALIAS: party = 0 |
|
|
1959 | |
|
|
1960 | void cf_player_set_party (object *op, partylist *party) |
|
|
1961 | |
2008 | |
1962 | void kill_player (object *op) |
2009 | void kill_player (object *op) |
1963 | |
2010 | |
1964 | void esrv_update_item (object *op, int what, object *item) |
2011 | void esrv_update_item (object *op, int what, object *item) |
1965 | C_ARGS: what, op, item |
2012 | C_ARGS: what, op, item |
… | |
… | |
2351 | rmp.decoroptions = decoroptions; |
2398 | rmp.decoroptions = decoroptions; |
2352 | rmp.orientation = orientation; |
2399 | rmp.orientation = orientation; |
2353 | rmp.origin_y = origin_y; |
2400 | rmp.origin_y = origin_y; |
2354 | rmp.origin_x = origin_x; |
2401 | rmp.origin_x = origin_x; |
2355 | rmp.random_seed = random_seed; |
2402 | rmp.random_seed = random_seed; |
2356 | rmp.total_map_hp = total_map_hp; |
2403 | rmp.total_map_hp = (uint64_t) total_map_hp; |
2357 | rmp.map_layout_style = map_layout_style; |
2404 | rmp.map_layout_style = map_layout_style; |
2358 | rmp.treasureoptions = treasureoptions; |
2405 | rmp.treasureoptions = treasureoptions; |
2359 | rmp.symmetry_used = symmetry_used; |
2406 | rmp.symmetry_used = symmetry_used; |
2360 | rmp.region = region; |
2407 | rmp.region = region; |
2361 | rmp.custom = custom; |
2408 | rmp.custom = custom; |
… | |
… | |
2376 | archetype *first() |
2423 | archetype *first() |
2377 | PROTOTYPE: |
2424 | PROTOTYPE: |
2378 | CODE: |
2425 | CODE: |
2379 | RETVAL = first_archetype; |
2426 | RETVAL = first_archetype; |
2380 | OUTPUT: RETVAL |
2427 | OUTPUT: RETVAL |
|
|
2428 | |
|
|
2429 | object *instantiate (archetype *arch) |
|
|
2430 | CODE: |
|
|
2431 | RETVAL = arch_to_object (arch); |
|
|
2432 | OUTPUT: |
|
|
2433 | RETVAL |
2381 | |
2434 | |
2382 | INCLUDE: $PERL $srcdir/genacc archetype ../include/object.h | |
2435 | INCLUDE: $PERL $srcdir/genacc archetype ../include/object.h | |
2383 | |
2436 | |
2384 | MODULE = cf PACKAGE = cf::party |
2437 | MODULE = cf PACKAGE = cf::party |
2385 | |
2438 | |