… | |
… | |
210 | attachable::destroy () |
210 | attachable::destroy () |
211 | { |
211 | { |
212 | if (destroyed ()) |
212 | if (destroyed ()) |
213 | return; |
213 | return; |
214 | |
214 | |
215 | flags |= F_DESTROYED; |
215 | attachable_flags |= F_DESTROYED; |
216 | do_destroy (); |
216 | do_destroy (); |
217 | sever_self (); |
217 | sever_self (); |
218 | } |
218 | } |
219 | |
219 | |
220 | void |
220 | void |
… | |
… | |
294 | |
294 | |
295 | attach = src.attach; |
295 | attach = src.attach; |
296 | return *this; |
296 | return *this; |
297 | } |
297 | } |
298 | |
298 | |
|
|
299 | #if 0 |
299 | template<typename T> |
300 | template<typename T> |
300 | static bool |
301 | static bool |
301 | find_backref (void *ptr, T *obj) |
302 | find_backref (void *ptr, T *obj) |
302 | { |
303 | { |
303 | char *s = (char *)obj; |
304 | char *s = (char *)obj; |
… | |
… | |
311 | |
312 | |
312 | return false; |
313 | return false; |
313 | } |
314 | } |
314 | |
315 | |
315 | // for debugging, find "live" objects containing this ptr |
316 | // for debugging, find "live" objects containing this ptr |
316 | void |
317 | static void |
317 | find_backref (void *ptr) |
318 | find_backref (void *ptr) |
318 | { |
319 | { |
319 | for_all_objects (op) |
320 | for_all_objects (op) |
320 | if (find_backref (ptr, op)) |
321 | if (find_backref (ptr, op)) |
321 | fprintf (stderr, "O %p %d:'%s'\n", op, op->count, &op->name); |
322 | fprintf (stderr, "O %p %d:'%s'\n", op, op->count, &op->name); |
… | |
… | |
326 | |
327 | |
327 | for_all_clients (ns) |
328 | for_all_clients (ns) |
328 | if (find_backref (ptr, ns)) |
329 | if (find_backref (ptr, ns)) |
329 | fprintf (stderr, "C %p\n", ns); |
330 | fprintf (stderr, "C %p\n", ns); |
330 | } |
331 | } |
|
|
332 | #endif |
331 | |
333 | |
332 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
334 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
333 | |
335 | |
334 | static SV * |
336 | static SV * |
335 | newSVptr (void *ptr, HV *stash, HV *hv = newHV ()) |
337 | newSVptr (void *ptr, HV *stash, HV *hv = newHV ()) |
… | |
… | |
388 | |
390 | |
389 | return sv; |
391 | return sv; |
390 | } |
392 | } |
391 | } |
393 | } |
392 | |
394 | |
|
|
395 | #if 0 // unused |
393 | static void |
396 | static void |
394 | clearSVptr (SV *sv) |
397 | clearSVptr (SV *sv) |
395 | { |
398 | { |
396 | if (SvROK (sv)) |
399 | if (SvROK (sv)) |
397 | sv = SvRV (sv); |
400 | sv = SvRV (sv); |
398 | |
401 | |
399 | hv_clear ((HV *)sv); |
402 | hv_clear ((HV *)sv); |
400 | sv_unmagic (sv, PERL_MAGIC_ext); |
403 | sv_unmagic (sv, PERL_MAGIC_ext); |
401 | } |
404 | } |
|
|
405 | #endif |
402 | |
406 | |
403 | static long |
407 | static long |
404 | SvPTR (SV *sv, const char *klass) |
408 | SvPTR (SV *sv, const char *klass) |
405 | { |
409 | { |
406 | if (!sv_derived_from (sv, klass)) |
410 | if (!sv_derived_from (sv, klass)) |
… | |
… | |
421 | return SvPTR (sv, klass); |
425 | return SvPTR (sv, klass); |
422 | else |
426 | else |
423 | return 0; |
427 | return 0; |
424 | } |
428 | } |
425 | |
429 | |
426 | inline SV *to_sv (const shstr & v) { return newSVpvn_utf8 ((const char *)v, v.length (), 1); } |
430 | static inline SV *to_sv (const shstr & v) { return newSVpvn_utf8 ((const char *)v, v.length (), 1); } |
427 | inline SV *to_sv (const char * v) { return v ? newSVpv (v, 0) : newSV (0); } |
431 | static inline SV *to_sv (const char * v) { return v ? newSVpv (v, 0) : newSV (0); } |
428 | inline SV *to_sv (bool v) { return newSViv (v); } |
432 | static inline SV *to_sv (bool v) { return newSViv (v); } |
429 | inline SV *to_sv ( signed char v) { return newSViv (v); } |
433 | static inline SV *to_sv ( signed char v) { return newSViv (v); } |
430 | inline SV *to_sv (unsigned char v) { return newSViv (v); } |
434 | static inline SV *to_sv (unsigned char v) { return newSViv (v); } |
431 | inline SV *to_sv ( signed short v) { return newSViv (v); } |
435 | static inline SV *to_sv ( signed short v) { return newSViv (v); } |
432 | inline SV *to_sv (unsigned short v) { return newSVuv (v); } |
436 | static inline SV *to_sv (unsigned short v) { return newSVuv (v); } |
433 | inline SV *to_sv ( signed int v) { return newSViv (v); } |
437 | static inline SV *to_sv ( signed int v) { return newSViv (v); } |
434 | inline SV *to_sv (unsigned int v) { return newSVuv (v); } |
438 | static inline SV *to_sv (unsigned int v) { return newSVuv (v); } |
435 | inline SV *to_sv ( signed long v) { return newSViv (v); } |
439 | static inline SV *to_sv ( signed long v) { return newSViv (v); } |
436 | inline SV *to_sv (unsigned long v) { return newSVuv (v); } |
440 | static inline SV *to_sv (unsigned long v) { return newSVuv (v); } |
437 | inline SV *to_sv ( signed long long v) { return newSVval64 (v); } |
441 | static inline SV *to_sv ( signed long long v) { return newSVval64 (v); } |
438 | inline SV *to_sv (unsigned long long v) { return newSVval64 (v); } |
442 | static inline SV *to_sv (unsigned long long v) { return newSVval64 (v); } |
439 | inline SV *to_sv (float v) { return newSVnv (v); } |
443 | static inline SV *to_sv (float v) { return newSVnv (v); } |
440 | inline SV *to_sv (double v) { return newSVnv (v); } |
444 | static inline SV *to_sv (double v) { return newSVnv (v); } |
441 | inline SV *to_sv (client * v) { return newSVattachable (v, stash_cf_client_wrap); } |
445 | static inline SV *to_sv (client * v) { return newSVattachable (v, stash_cf_client_wrap); } |
442 | inline SV *to_sv (player * v) { return newSVattachable (v, stash_cf_player_wrap); } |
446 | static inline SV *to_sv (player * v) { return newSVattachable (v, stash_cf_player_wrap); } |
443 | inline SV *to_sv (object * v) { return newSVattachable (v, v && v->type == PLAYER ? stash_cf_object_player_wrap : stash_cf_object_wrap); } |
447 | static inline SV *to_sv (object * v) { return newSVattachable (v, v && v->type == PLAYER ? stash_cf_object_player_wrap : stash_cf_object_wrap); } |
444 | inline SV *to_sv (maptile * v) { return newSVattachable (v, stash_cf_map_wrap); } |
448 | static inline SV *to_sv (maptile * v) { return newSVattachable (v, stash_cf_map_wrap); } |
445 | inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } |
449 | static inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } |
446 | inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } |
450 | static inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } |
447 | inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } |
451 | static inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } |
448 | inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } |
452 | static inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } |
449 | inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); } |
453 | static inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); } |
450 | |
454 | |
451 | inline SV *to_sv (object & v) { return to_sv (&v); } |
455 | static inline SV *to_sv (object & v) { return to_sv (&v); } |
452 | inline SV *to_sv (living & v) { return to_sv (&v); } |
456 | static inline SV *to_sv (living & v) { return to_sv (&v); } |
453 | |
457 | |
454 | inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
458 | static inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
455 | inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } |
459 | static inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } |
456 | |
460 | |
457 | inline SV *to_sv (UUID v) { return newSVpv (v.c_str (), 0); } |
461 | static inline SV *to_sv (UUID v) { return newSVpv (v.c_str (), 0); } |
458 | |
462 | |
459 | inline SV *to_sv (dynbuf * v) |
463 | static inline SV *to_sv (dynbuf * v) |
460 | { |
464 | { |
461 | SV *sv = newSV (0); |
465 | SV *sv = newSV (0); |
462 | |
466 | |
463 | sv_upgrade (sv, SVt_PV); |
467 | sv_upgrade (sv, SVt_PV); |
464 | SvGROW (sv, v->size () + 1); |
468 | SvGROW (sv, v->size () + 1); |
… | |
… | |
468 | *SvEND (sv) = 0; |
472 | *SvEND (sv) = 0; |
469 | |
473 | |
470 | return sv; |
474 | return sv; |
471 | } |
475 | } |
472 | |
476 | |
473 | inline SV *to_sv (dynbuf_text * v) |
477 | static inline SV *to_sv (dynbuf_text * v) |
474 | { |
478 | { |
475 | SV *sv = to_sv (static_cast<dynbuf *> (v)); |
479 | SV *sv = to_sv (static_cast<dynbuf *> (v)); |
476 | SvUTF8_on (sv); |
480 | SvUTF8_on (sv); |
477 | return sv; |
481 | return sv; |
478 | } |
482 | } |
479 | |
483 | |
480 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } |
484 | static inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } |
481 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
485 | static inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
482 | inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } |
486 | static inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } |
483 | inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } |
487 | static inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } |
484 | inline void sv_to (SV *sv, unsigned char &v) { v = SvIV (sv); } |
488 | static inline void sv_to (SV *sv, unsigned char &v) { v = SvIV (sv); } |
485 | inline void sv_to (SV *sv, signed short &v) { v = SvIV (sv); } |
489 | static inline void sv_to (SV *sv, signed short &v) { v = SvIV (sv); } |
486 | inline void sv_to (SV *sv, unsigned short &v) { v = SvIV (sv); } |
490 | static inline void sv_to (SV *sv, unsigned short &v) { v = SvIV (sv); } |
487 | inline void sv_to (SV *sv, signed int &v) { v = SvIV (sv); } |
491 | static inline void sv_to (SV *sv, signed int &v) { v = SvIV (sv); } |
488 | inline void sv_to (SV *sv, unsigned int &v) { v = SvUV (sv); } |
492 | static inline void sv_to (SV *sv, unsigned int &v) { v = SvUV (sv); } |
489 | inline void sv_to (SV *sv, signed long &v) { v = SvIV (sv); } |
493 | static inline void sv_to (SV *sv, signed long &v) { v = SvIV (sv); } |
490 | inline void sv_to (SV *sv, unsigned long &v) { v = SvUV (sv); } |
494 | static inline void sv_to (SV *sv, unsigned long &v) { v = SvUV (sv); } |
491 | inline void sv_to (SV *sv, signed long long &v) { v = ( signed long long)SvVAL64 (sv); } |
495 | static inline void sv_to (SV *sv, signed long long &v) { v = ( signed long long)SvVAL64 (sv); } |
492 | inline void sv_to (SV *sv, unsigned long long &v) { v = (unsigned long long)SvVAL64 (sv); } |
496 | static inline void sv_to (SV *sv, unsigned long long &v) { v = (unsigned long long)SvVAL64 (sv); } |
493 | inline void sv_to (SV *sv, float &v) { v = SvNV (sv); } |
497 | static inline void sv_to (SV *sv, float &v) { v = SvNV (sv); } |
494 | inline void sv_to (SV *sv, double &v) { v = SvNV (sv); } |
498 | static inline void sv_to (SV *sv, double &v) { v = SvNV (sv); } |
495 | inline void sv_to (SV *sv, client * &v) { v = (client *)(attachable *)SvPTR_ornull (sv, "cf::client"); } |
499 | static inline void sv_to (SV *sv, client * &v) { v = (client *)(attachable *)SvPTR_ornull (sv, "cf::client"); } |
496 | inline void sv_to (SV *sv, player * &v) { v = (player *)(attachable *)SvPTR_ornull (sv, "cf::player"); } |
500 | static inline void sv_to (SV *sv, player * &v) { v = (player *)(attachable *)SvPTR_ornull (sv, "cf::player"); } |
497 | inline void sv_to (SV *sv, object * &v) { v = (object *)(attachable *)SvPTR_ornull (sv, "cf::object"); } |
501 | static inline void sv_to (SV *sv, object * &v) { v = (object *)(attachable *)SvPTR_ornull (sv, "cf::object"); } |
498 | inline void sv_to (SV *sv, archetype * &v) { v = (archetype *)(attachable *)SvPTR_ornull (sv, "cf::arch"); } |
502 | static inline void sv_to (SV *sv, archetype * &v) { v = (archetype *)(attachable *)SvPTR_ornull (sv, "cf::arch"); } |
499 | inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)(attachable *)SvPTR_ornull (sv, "cf::map"); } |
503 | static inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)(attachable *)SvPTR_ornull (sv, "cf::map"); } |
500 | inline void sv_to (SV *sv, region * &v) { v = (region *)(attachable *)SvPTR_ornull (sv, "cf::region"); } |
504 | static inline void sv_to (SV *sv, region * &v) { v = (region *)(attachable *)SvPTR_ornull (sv, "cf::region"); } |
501 | inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } |
505 | static inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } |
502 | inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } |
506 | static inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } |
503 | inline void sv_to (SV *sv, living * &v) { v = (living *)SvPTR_ornull (sv, "cf::living"); } |
507 | static inline void sv_to (SV *sv, living * &v) { v = (living *)SvPTR_ornull (sv, "cf::living"); } |
504 | inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *)SvPTR_ornull (sv, "cf::mapspace"); } |
508 | static inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *)SvPTR_ornull (sv, "cf::mapspace"); } |
505 | inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *)SvPTR_ornull (sv, "cf::object::freezer"); } |
509 | static inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *)SvPTR_ornull (sv, "cf::object::freezer"); } |
506 | inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *)SvPTR_ornull (sv, "cf::object::thawer" ); } |
510 | static inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *)SvPTR_ornull (sv, "cf::object::thawer" ); } |
507 | |
511 | |
508 | //inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } |
512 | //static inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } |
509 | inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } |
513 | static inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } |
510 | |
514 | |
511 | template<class T> |
515 | template<class T> |
512 | inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; } |
516 | static inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; } |
513 | |
517 | |
514 | template<int N> |
518 | template<int N> |
515 | inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); } |
519 | static inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); } |
516 | |
520 | |
517 | inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); } |
521 | static inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); } |
518 | inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); } |
522 | static inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); } |
519 | inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); } |
523 | static inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); } |
520 | inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); } |
524 | static inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); } |
521 | |
525 | |
522 | inline void sv_to (SV *sv, std::string &v) |
526 | static inline void sv_to (SV *sv, std::string &v) |
523 | { |
527 | { |
524 | STRLEN len; |
528 | STRLEN len; |
525 | char *data = SvPVbyte (sv, len); |
529 | char *data = SvPVbyte (sv, len); |
526 | v.assign (data, len); |
530 | v.assign (data, len); |
527 | } |
531 | } |
528 | |
532 | |
529 | inline void sv_to (SV *sv, UUID &v) |
533 | static inline void sv_to (SV *sv, UUID &v) |
530 | { |
534 | { |
531 | if (!v.parse (SvPV_nolen (sv))) |
535 | if (!v.parse (SvPV_nolen (sv))) |
532 | croak ("unparsable uuid: %s", SvPV_nolen (sv)); |
536 | croak ("unparsable uuid: %s", SvPV_nolen (sv)); |
533 | } |
537 | } |
534 | |
538 | |
535 | inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } |
539 | static inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } |
536 | |
540 | |
537 | static SV * |
541 | static SV * |
538 | newSVdt_va (va_list &ap, data_type type) |
542 | newSVdt_va (va_list &ap, data_type type) |
539 | { |
543 | { |
540 | SV *sv; |
544 | SV *sv; |
… | |
… | |
640 | var = 0; |
644 | var = 0; |
641 | } |
645 | } |
642 | |
646 | |
643 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
647 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
644 | |
648 | |
645 | SV * |
649 | static SV * |
646 | registry (attachable *ext) |
650 | registry (attachable *ext) |
647 | { |
651 | { |
648 | if (!ext->cb) |
652 | if (!ext->cb) |
649 | ext->cb = newAV (); |
653 | ext->cb = newAV (); |
650 | |
654 | |
… | |
… | |
934 | CALL_END; |
938 | CALL_END; |
935 | |
939 | |
936 | return count; |
940 | return count; |
937 | } |
941 | } |
938 | |
942 | |
939 | SV * |
943 | static SV * |
940 | cfperl_result (int idx) |
944 | cfperl_result (int idx) |
941 | { |
945 | { |
942 | AV *av = get_av ("cf::INVOKE_RESULTS", 0); |
946 | AV *av = get_av ("cf::INVOKE_RESULTS", 0); |
943 | if (!av) |
947 | if (!av) |
944 | return &PL_sv_undef; |
948 | return &PL_sv_undef; |
… | |
… | |
1220 | bool matched = count && SvTRUE (TOPs); |
1224 | bool matched = count && SvTRUE (TOPs); |
1221 | |
1225 | |
1222 | CALL_END; |
1226 | CALL_END; |
1223 | |
1227 | |
1224 | return matched; |
1228 | return matched; |
|
|
1229 | } |
|
|
1230 | |
|
|
1231 | object * |
|
|
1232 | match_one (const char *expr, object *ob, object *self, object *source, object *originator) |
|
|
1233 | { |
|
|
1234 | if (!strncmp (expr, "match ", sizeof ("match ") - 1)) |
|
|
1235 | expr += sizeof ("match ") - 1; |
|
|
1236 | |
|
|
1237 | CALL_BEGIN (5); |
|
|
1238 | CALL_ARG (expr); |
|
|
1239 | CALL_ARG (ob); |
|
|
1240 | CALL_ARG (self); |
|
|
1241 | CALL_ARG (source); |
|
|
1242 | CALL_ARG (originator); |
|
|
1243 | CALL_CALL (cv_cf_match_match, G_ARRAY); |
|
|
1244 | |
|
|
1245 | object *one = 0; |
|
|
1246 | |
|
|
1247 | if (count) |
|
|
1248 | sv_to (TOPs, one); |
|
|
1249 | |
|
|
1250 | CALL_END; |
|
|
1251 | |
|
|
1252 | return one; |
1225 | } |
1253 | } |
1226 | |
1254 | |
1227 | ///////////////////////////////////////////////////////////////////////////// |
1255 | ///////////////////////////////////////////////////////////////////////////// |
1228 | |
1256 | |
1229 | struct EVAPI *evapi::GEVAPI; |
1257 | struct EVAPI *evapi::GEVAPI; |
… | |
… | |
1399 | const_iv (FLAG_GENERATOR) const_iv (FLAG_IS_THROWN) const_iv (FLAG_AUTO_APPLY) const_iv (FLAG_PLAYER_SOLD) |
1427 | const_iv (FLAG_GENERATOR) const_iv (FLAG_IS_THROWN) const_iv (FLAG_AUTO_APPLY) const_iv (FLAG_PLAYER_SOLD) |
1400 | const_iv (FLAG_SEE_INVISIBLE) const_iv (FLAG_CAN_ROLL) const_iv (FLAG_OVERLAY_FLOOR) const_iv (FLAG_IS_TURNABLE) |
1428 | const_iv (FLAG_SEE_INVISIBLE) const_iv (FLAG_CAN_ROLL) const_iv (FLAG_OVERLAY_FLOOR) const_iv (FLAG_IS_TURNABLE) |
1401 | const_iv (FLAG_IS_USED_UP) const_iv (FLAG_IDENTIFIED) const_iv (FLAG_REFLECTING) const_iv (FLAG_CHANGING) |
1429 | const_iv (FLAG_IS_USED_UP) const_iv (FLAG_IDENTIFIED) const_iv (FLAG_REFLECTING) const_iv (FLAG_CHANGING) |
1402 | const_iv (FLAG_SPLITTING) const_iv (FLAG_HITBACK) const_iv (FLAG_STARTEQUIP) const_iv (FLAG_BLOCKSVIEW) |
1430 | const_iv (FLAG_SPLITTING) const_iv (FLAG_HITBACK) const_iv (FLAG_STARTEQUIP) const_iv (FLAG_BLOCKSVIEW) |
1403 | const_iv (FLAG_UNDEAD) const_iv (FLAG_SCARED) const_iv (FLAG_UNAGGRESSIVE) const_iv (FLAG_REFL_MISSILE) |
1431 | const_iv (FLAG_UNDEAD) const_iv (FLAG_SCARED) const_iv (FLAG_UNAGGRESSIVE) const_iv (FLAG_REFL_MISSILE) |
1404 | const_iv (FLAG_REFL_SPELL) const_iv (FLAG_NO_MAGIC) const_iv (FLAG_NO_FIX_PLAYER) const_iv (FLAG_IS_LIGHTABLE) |
1432 | const_iv (FLAG_REFL_SPELL) const_iv (FLAG_NO_MAGIC) const_iv (FLAG_IS_LIGHTABLE) |
1405 | const_iv (FLAG_TEAR_DOWN) const_iv (FLAG_RUN_AWAY) const_iv (FLAG_PICK_UP) const_iv (FLAG_UNIQUE) |
1433 | const_iv (FLAG_TEAR_DOWN) const_iv (FLAG_RUN_AWAY) const_iv (FLAG_PICK_UP) const_iv (FLAG_UNIQUE) |
1406 | const_iv (FLAG_NO_DROP) const_iv (FLAG_WIZCAST) const_iv (FLAG_CAST_SPELL) const_iv (FLAG_USE_SCROLL) |
1434 | const_iv (FLAG_NO_DROP) const_iv (FLAG_WIZCAST) const_iv (FLAG_CAST_SPELL) const_iv (FLAG_USE_SCROLL) |
1407 | const_iv (FLAG_USE_RANGE) const_iv (FLAG_USE_BOW) const_iv (FLAG_USE_ARMOUR) const_iv (FLAG_USE_WEAPON) |
1435 | const_iv (FLAG_USE_RANGE) const_iv (FLAG_USE_BOW) const_iv (FLAG_USE_ARMOUR) const_iv (FLAG_USE_WEAPON) |
1408 | const_iv (FLAG_USE_RING) const_iv (FLAG_READY_RANGE) const_iv (FLAG_READY_BOW) const_iv (FLAG_XRAYS) |
1436 | const_iv (FLAG_USE_RING) const_iv (FLAG_READY_RANGE) const_iv (FLAG_READY_BOW) const_iv (FLAG_XRAYS) |
1409 | const_iv (FLAG_NO_APPLY) const_iv (FLAG_IS_FLOOR) const_iv (FLAG_LIFESAVE) const_iv (FLAG_NO_STRENGTH) |
1437 | const_iv (FLAG_NO_APPLY) const_iv (FLAG_IS_FLOOR) const_iv (FLAG_LIFESAVE) const_iv (FLAG_NO_STRENGTH) |
… | |
… | |
1987 | RETVAL |
2015 | RETVAL |
1988 | |
2016 | |
1989 | void |
2017 | void |
1990 | debug_trace (attachable *obj, bool on = true) |
2018 | debug_trace (attachable *obj, bool on = true) |
1991 | CODE: |
2019 | CODE: |
1992 | obj->flags &= ~attachable::F_DEBUG_TRACE; |
2020 | obj->attachable_flags &= ~attachable::F_DEBUG_TRACE; |
1993 | if (on) |
2021 | if (on) |
1994 | obj->flags |= attachable::F_DEBUG_TRACE; |
2022 | obj->attachable_flags |= attachable::F_DEBUG_TRACE; |
1995 | |
2023 | |
1996 | int mortals_size () |
2024 | int mortals_size () |
1997 | CODE: |
2025 | CODE: |
1998 | RETVAL = attachable::mortals.size (); |
2026 | RETVAL = attachable::mortals.size (); |
1999 | OUTPUT: RETVAL |
2027 | OUTPUT: RETVAL |
… | |
… | |
2140 | CODE: |
2168 | CODE: |
2141 | player_apply_below (op); |
2169 | player_apply_below (op); |
2142 | |
2170 | |
2143 | int cast_heal (object *op, object *caster, object *spell, int dir = 0) |
2171 | int cast_heal (object *op, object *caster, object *spell, int dir = 0) |
2144 | |
2172 | |
|
|
2173 | int casting_level (object *caster, object *spell) |
|
|
2174 | |
2145 | int pay_item (object *op, object *buyer) |
2175 | int pay_item (object *op, object *buyer) |
2146 | CODE: |
2176 | CODE: |
2147 | RETVAL = pay_for_item (op, buyer); |
2177 | RETVAL = pay_for_item (op, buyer); |
2148 | OUTPUT: RETVAL |
2178 | OUTPUT: RETVAL |
2149 | |
2179 | |
… | |
… | |
2191 | |
2221 | |
2192 | void player_lvl_adj (object *who, object *skill = 0) |
2222 | void player_lvl_adj (object *who, object *skill = 0) |
2193 | |
2223 | |
2194 | int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) |
2224 | int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) |
2195 | |
2225 | |
2196 | int calc_skill_exp (object *who, object *op, object *skill); |
2226 | int calc_skill_exp (object *who, object *op, object *skill) |
2197 | |
2227 | |
2198 | void push_button (object *op, object *originator); |
2228 | void push_button (object *op, object *originator) |
2199 | |
2229 | |
2200 | void use_trigger (object *op, object *originator); |
2230 | void use_trigger (object *op, object *originator) |
2201 | |
2231 | |
2202 | void handle_apply_yield (object *op); |
2232 | void handle_apply_yield (object *op) |
2203 | |
2233 | |
2204 | int convert_item (object *item, object *converter); |
2234 | int convert_item (object *item, object *converter) |
2205 | |
2235 | |
2206 | |
2236 | |
2207 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
2237 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
2208 | |
2238 | |
2209 | # no clean way to get an object from an archetype - stupid idiotic |
2239 | # no clean way to get an object from an archetype - stupid idiotic |
… | |
… | |
2222 | object *insert_ob_in_map_at (object *ob, maptile *where, object_ornull *orig, int flag, int x, int y) |
2252 | object *insert_ob_in_map_at (object *ob, maptile *where, object_ornull *orig, int flag, int x, int y) |
2223 | PROTOTYPE: $$$$$$ |
2253 | PROTOTYPE: $$$$$$ |
2224 | CODE: |
2254 | CODE: |
2225 | { |
2255 | { |
2226 | RETVAL = insert_ob_in_map_at (ob, where, orig, flag, x, y); |
2256 | RETVAL = insert_ob_in_map_at (ob, where, orig, flag, x, y); |
|
|
2257 | |
|
|
2258 | if (RETVAL->destroyed ()) |
|
|
2259 | RETVAL = 0; |
2227 | } |
2260 | } |
2228 | |
2261 | |
2229 | shstr |
2262 | shstr |
2230 | object::kv_get (shstr key) |
2263 | object::kv_get (shstr key) |
2231 | |
2264 | |