… | |
… | |
404 | inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; } |
404 | inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; } |
405 | |
405 | |
406 | template<int N> |
406 | template<int N> |
407 | inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); } |
407 | inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); } |
408 | |
408 | |
409 | inline void sv_to (SV *sv, rangetype &v) { v = (rangetype) SvIV (sv); } |
|
|
410 | inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); } |
409 | inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); } |
411 | inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); } |
410 | inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); } |
412 | inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); } |
411 | inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); } |
413 | inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); } |
412 | inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); } |
414 | |
413 | |
… | |
… | |
1135 | const_iv (Map0Cmd) const_iv (Map1Cmd) const_iv (Map1aCmd) |
1134 | const_iv (Map0Cmd) const_iv (Map1Cmd) const_iv (Map1aCmd) |
1136 | |
1135 | |
1137 | const_iv (MAP_CLIENT_X) const_iv (MAP_CLIENT_Y) |
1136 | const_iv (MAP_CLIENT_X) const_iv (MAP_CLIENT_Y) |
1138 | |
1137 | |
1139 | const_iv (MAX_TIME) |
1138 | const_iv (MAX_TIME) |
|
|
1139 | |
|
|
1140 | const_iv (NUM_BODY_LOCATIONS) |
|
|
1141 | const_iv (body_range) const_iv (body_shield) const_iv (body_combat) |
|
|
1142 | const_iv (body_arm) const_iv (body_torso) const_iv (body_head) |
|
|
1143 | const_iv (body_neck) const_iv (body_skill) const_iv (body_finger) |
|
|
1144 | const_iv (body_shoulder) const_iv (body_foot) const_iv (body_hand) |
|
|
1145 | const_iv (body_wrist) const_iv (body_waist) |
1140 | |
1146 | |
1141 | const_iv (PLAYER) const_iv (TRANSPORT) const_iv (ROD) const_iv (TREASURE) |
1147 | const_iv (PLAYER) const_iv (TRANSPORT) const_iv (ROD) const_iv (TREASURE) |
1142 | const_iv (POTION) const_iv (FOOD) const_iv (POISON) const_iv (BOOK) |
1148 | const_iv (POTION) const_iv (FOOD) const_iv (POISON) const_iv (BOOK) |
1143 | const_iv (CLOCK) const_iv (ARROW) const_iv (BOW) const_iv (WEAPON) |
1149 | const_iv (CLOCK) const_iv (ARROW) const_iv (BOW) const_iv (WEAPON) |
1144 | const_iv (ARMOUR) const_iv (PEDESTAL) const_iv (ALTAR) const_iv (LOCKED_DOOR) |
1150 | const_iv (ARMOUR) const_iv (PEDESTAL) const_iv (ALTAR) const_iv (LOCKED_DOOR) |
… | |
… | |
1404 | default: croak ("cf::rndm requires none, one or two parameters."); break; |
1410 | default: croak ("cf::rndm requires none, one or two parameters."); break; |
1405 | } |
1411 | } |
1406 | OUTPUT: |
1412 | OUTPUT: |
1407 | RETVAL |
1413 | RETVAL |
1408 | |
1414 | |
|
|
1415 | NV clamp (NV value, NV min_value, NV max_value) |
|
|
1416 | CODE: |
|
|
1417 | RETVAL = clamp (value, min_value, max_value); |
|
|
1418 | OUTPUT: |
|
|
1419 | RETVAL |
|
|
1420 | |
|
|
1421 | NV lerp (NV value, NV min_in, NV max_in, NV min_out, NV max_out) |
|
|
1422 | CODE: |
|
|
1423 | RETVAL = lerp (value, min_in, max_in, min_out, max_out); |
|
|
1424 | OUTPUT: |
|
|
1425 | RETVAL |
|
|
1426 | |
|
|
1427 | void cede_to_tick () |
|
|
1428 | CODE: |
|
|
1429 | coroapi::cede_to_tick (); |
|
|
1430 | |
1409 | void server_tick () |
1431 | void server_tick () |
1410 | CODE: |
1432 | CODE: |
1411 | runtime = SvNVx (sv_runtime); |
1433 | runtime = SvNVx (sv_runtime); |
1412 | server_tick (); |
1434 | server_tick (); |
1413 | |
1435 | |
… | |
… | |
1462 | } |
1484 | } |
1463 | OUTPUT: RETVAL |
1485 | OUTPUT: RETVAL |
1464 | |
1486 | |
1465 | void abort () |
1487 | void abort () |
1466 | |
1488 | |
|
|
1489 | void reset_signals () |
|
|
1490 | |
1467 | void fork_abort (octet_string cause = "cf::fork_abort") |
1491 | void fork_abort (octet_string cause = "cf::fork_abort") |
1468 | |
1492 | |
1469 | void cleanup (octet_string cause, bool make_core = false) |
1493 | void cleanup (octet_string cause, bool make_core = false) |
1470 | |
1494 | |
1471 | void emergency_save () |
1495 | void emergency_save () |
… | |
… | |
1605 | object *actives (U32 index) |
1629 | object *actives (U32 index) |
1606 | CODE: |
1630 | CODE: |
1607 | RETVAL = index < actives.size () ? actives [index] : 0; |
1631 | RETVAL = index < actives.size () ? actives [index] : 0; |
1608 | OUTPUT: RETVAL |
1632 | OUTPUT: RETVAL |
1609 | |
1633 | |
|
|
1634 | const char *slot_save_name (U32 slot) |
|
|
1635 | ALIAS: |
|
|
1636 | slot_use_name = 1 |
|
|
1637 | slot_nonuse_name = 2 |
|
|
1638 | CODE: |
|
|
1639 | { |
|
|
1640 | if (slot >= NUM_BODY_LOCATIONS) |
|
|
1641 | croak ("body slot index out of range"); |
|
|
1642 | |
|
|
1643 | switch (ix) |
|
|
1644 | { |
|
|
1645 | case 0: RETVAL = body_locations[slot].save_name; break; |
|
|
1646 | case 1: RETVAL = body_locations[slot].use_name; break; |
|
|
1647 | case 2: RETVAL = body_locations[slot].nonuse_name; break; |
|
|
1648 | } |
|
|
1649 | } |
|
|
1650 | OUTPUT: |
|
|
1651 | RETVAL |
|
|
1652 | |
1610 | # missing properties |
1653 | # missing properties |
1611 | |
1654 | |
1612 | object *head (object *op) |
1655 | object *head (object *op) |
1613 | PROTOTYPE: $ |
1656 | PROTOTYPE: $ |
1614 | CODE: |
1657 | CODE: |
… | |
… | |
1639 | int |
1682 | int |
1640 | num_animations (object *op) |
1683 | num_animations (object *op) |
1641 | CODE: |
1684 | CODE: |
1642 | RETVAL = NUM_ANIMATIONS (op); |
1685 | RETVAL = NUM_ANIMATIONS (op); |
1643 | OUTPUT: RETVAL |
1686 | OUTPUT: RETVAL |
|
|
1687 | |
|
|
1688 | int slot_info (object *op, UV slot, int value = 0) |
|
|
1689 | ALIAS: |
|
|
1690 | slot_used = 1 |
|
|
1691 | CODE: |
|
|
1692 | { |
|
|
1693 | if (slot >= NUM_BODY_LOCATIONS) |
|
|
1694 | croak ("body slot index out of range"); |
|
|
1695 | |
|
|
1696 | RETVAL = ix ? op->slot[slot].used : op->slot[slot].info; |
|
|
1697 | |
|
|
1698 | if (items > 2) |
|
|
1699 | if (ix) |
|
|
1700 | op->slot[slot].used = value; |
|
|
1701 | else |
|
|
1702 | op->slot[slot].info = value; |
|
|
1703 | } |
|
|
1704 | OUTPUT: |
|
|
1705 | RETVAL |
1644 | |
1706 | |
1645 | object *find_best_object_match (object *op, utf8_string match) |
1707 | object *find_best_object_match (object *op, utf8_string match) |
1646 | |
1708 | |
1647 | object *find_marked_object (object *op) |
1709 | object *find_marked_object (object *op) |
1648 | |
1710 | |
… | |
… | |
1997 | if (SV **elem = av_fetch ((AV *)palette, idx [offs], 0)) |
2059 | if (SV **elem = av_fetch ((AV *)palette, idx [offs], 0)) |
1998 | { |
2060 | { |
1999 | object *ob = get_archetype (SvPVutf8_nolen (*elem)); |
2061 | object *ob = get_archetype (SvPVutf8_nolen (*elem)); |
2000 | ob->flag [FLAG_NO_MAP_SAVE] = true; |
2062 | ob->flag [FLAG_NO_MAP_SAVE] = true; |
2001 | THIS->insert (ob, x, y, 0, INS_ABOVE_FLOOR_ONLY); |
2063 | THIS->insert (ob, x, y, 0, INS_ABOVE_FLOOR_ONLY); |
|
|
2064 | |
|
|
2065 | if (ob->randomitems) |
|
|
2066 | { |
|
|
2067 | if (!ob->above) |
|
|
2068 | { |
|
|
2069 | ob->create_treasure (ob->randomitems); |
|
|
2070 | |
|
|
2071 | for (object *op = ob->above; op; op = op->above) |
|
|
2072 | op->flag [FLAG_NO_MAP_SAVE] = true; |
|
|
2073 | } |
|
|
2074 | |
|
|
2075 | ob->randomitems = 0; |
|
|
2076 | } |
2002 | } |
2077 | } |
2003 | } |
2078 | } |
2004 | } |
2079 | } |
2005 | |
2080 | |
2006 | skip_space: ; |
2081 | skip_space: ; |