… | |
… | |
999 | const_iv (WILL_APPLY_DOOR) |
999 | const_iv (WILL_APPLY_DOOR) |
1000 | const_iv (WILL_APPLY_FOOD) |
1000 | const_iv (WILL_APPLY_FOOD) |
1001 | |
1001 | |
1002 | const_iv (SAVE_MODE) |
1002 | const_iv (SAVE_MODE) |
1003 | const_iv (SAVE_DIR_MODE) |
1003 | const_iv (SAVE_DIR_MODE) |
|
|
1004 | |
|
|
1005 | const_iv (M_PAPER) |
|
|
1006 | const_iv (M_IRON) |
|
|
1007 | const_iv (M_GLASS) |
|
|
1008 | const_iv (M_LEATHER) |
|
|
1009 | const_iv (M_WOOD) |
|
|
1010 | const_iv (M_ORGANIC) |
|
|
1011 | const_iv (M_STONE) |
|
|
1012 | const_iv (M_CLOTH) |
|
|
1013 | const_iv (M_ADAMANT) |
|
|
1014 | const_iv (M_LIQUID) |
|
|
1015 | const_iv (M_SOFT_METAL) |
|
|
1016 | const_iv (M_BONE) |
|
|
1017 | const_iv (M_ICE) |
|
|
1018 | const_iv (M_SPECIAL) |
1004 | }; |
1019 | }; |
1005 | |
1020 | |
1006 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
1021 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
1007 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
1022 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
1008 | |
1023 | |
… | |
… | |
1276 | attacktype = 0 |
1291 | attacktype = 0 |
1277 | CODE: |
1292 | CODE: |
1278 | RETVAL = obj->attacktype; |
1293 | RETVAL = obj->attacktype; |
1279 | OUTPUT: RETVAL |
1294 | OUTPUT: RETVAL |
1280 | |
1295 | |
|
|
1296 | # missing in plug-in api, of course |
1281 | void |
1297 | void |
1282 | set_food (object *obj, int food) |
1298 | set_food (object *obj, int food) |
1283 | CODE: |
1299 | CODE: |
1284 | obj->stats.food = food; |
1300 | obj->stats.food = food; |
1285 | |
1301 | |
… | |
… | |
1319 | |
1335 | |
1320 | void cf_object_free (object *op) |
1336 | void cf_object_free (object *op) |
1321 | |
1337 | |
1322 | object *cf_object_present_archname_inside (object *op, char *whatstr) |
1338 | object *cf_object_present_archname_inside (object *op, char *whatstr) |
1323 | |
1339 | |
1324 | int cf_object_transfer (object *op, int x, int y, int r, object *orig) |
1340 | int cf_object_transfer (object *op, int x, int y, int r = 0, object_ornull *orig = 0) |
1325 | |
1341 | |
1326 | int cf_object_change_map (object *op, int x, int y, mapstruct *map) |
1342 | int cf_object_change_map (object *op, int x, int y, mapstruct *map) |
1327 | |
1343 | |
1328 | object *cf_object_clone (object *op, int clonetype = 0) |
1344 | object *cf_object_clone (object *op, int clonetype = 0) |
1329 | |
1345 | |
… | |
… | |
1434 | base_name (object *ob, int plural) |
1450 | base_name (object *ob, int plural) |
1435 | CODE: |
1451 | CODE: |
1436 | RETVAL = cf_query_base_name (ob, plural); |
1452 | RETVAL = cf_query_base_name (ob, plural); |
1437 | OUTPUT: RETVAL |
1453 | OUTPUT: RETVAL |
1438 | |
1454 | |
|
|
1455 | living * |
|
|
1456 | stats (object *ob) |
|
|
1457 | CODE: |
|
|
1458 | RETVAL = &ob->stats; |
|
|
1459 | OUTPUT: RETVAL |
|
|
1460 | |
1439 | |
1461 | |
1440 | MODULE = cf PACKAGE = cf::object::player PREFIX = cf_player_ |
1462 | MODULE = cf PACKAGE = cf::object::player PREFIX = cf_player_ |
1441 | |
1463 | |
1442 | player *player (object *op) |
1464 | player *player (object *op) |
1443 | CODE: |
1465 | CODE: |
… | |
… | |
1491 | |
1513 | |
1492 | player *next (player *pl) |
1514 | player *next (player *pl) |
1493 | CODE: |
1515 | CODE: |
1494 | RETVAL = pl->next; |
1516 | RETVAL = pl->next; |
1495 | OUTPUT: RETVAL |
1517 | OUTPUT: RETVAL |
|
|
1518 | |
|
|
1519 | void get_savebed (player *pl) |
|
|
1520 | ALIAS: |
|
|
1521 | savebed = 0 |
|
|
1522 | PPCODE: |
|
|
1523 | EXTEND (SP, 3); |
|
|
1524 | PUSHs (sv_2mortal (newSVpv (pl->savebed_map, 0))); |
|
|
1525 | PUSHs (sv_2mortal (newSViv (pl->bed_x))); |
|
|
1526 | PUSHs (sv_2mortal (newSViv (pl->bed_y))); |
|
|
1527 | |
|
|
1528 | void set_savebed (player *pl, char *map_path, int x, int y) |
|
|
1529 | CODE: |
|
|
1530 | strcpy (pl->savebed_map, map_path); |
|
|
1531 | pl->bed_x = x; |
|
|
1532 | pl->bed_y = y; |
1496 | |
1533 | |
1497 | void |
1534 | void |
1498 | list () |
1535 | list () |
1499 | PPCODE: |
1536 | PPCODE: |
1500 | { |
1537 | { |
1501 | player *pl; |
1538 | player *pl; |
1502 | for (pl = first_player; pl; pl = pl->next) |
1539 | for (pl = first_player; pl; pl = pl->next) |
1503 | XPUSHs (newSVcfapi (CFAPI_PPLAYER, pl)); |
1540 | XPUSHs (newSVcfapi (CFAPI_PPLAYER, pl)); |
1504 | } |
1541 | } |
|
|
1542 | |
|
|
1543 | living * |
|
|
1544 | orig_stats (player *pl) |
|
|
1545 | CODE: |
|
|
1546 | RETVAL = &pl->orig_stats; |
|
|
1547 | OUTPUT: RETVAL |
|
|
1548 | |
|
|
1549 | living * |
|
|
1550 | last_stats (player *pl) |
|
|
1551 | CODE: |
|
|
1552 | RETVAL = &pl->last_stats; |
|
|
1553 | OUTPUT: RETVAL |
1505 | |
1554 | |
1506 | |
1555 | |
1507 | MODULE = cf PACKAGE = cf::map PREFIX = cf_map_ |
1556 | MODULE = cf PACKAGE = cf::map PREFIX = cf_map_ |
1508 | |
1557 | |
1509 | SV * |
1558 | SV * |
… | |
… | |
1539 | ALIAS: map = 0 |
1588 | ALIAS: map = 0 |
1540 | |
1589 | |
1541 | mapstruct *cf_map_get_first () |
1590 | mapstruct *cf_map_get_first () |
1542 | PROTOTYPE: |
1591 | PROTOTYPE: |
1543 | ALIAS: first = 0 |
1592 | ALIAS: first = 0 |
|
|
1593 | |
|
|
1594 | # whoever "designed" the plug-in api should have wasted |
|
|
1595 | # his/her time with staying away form the project - would have |
|
|
1596 | # saved others a lot of time, without doubt. |
|
|
1597 | void set_path (mapstruct *where, char *path) |
|
|
1598 | CODE: |
|
|
1599 | strcpy (where->path, path); |
|
|
1600 | |
|
|
1601 | bool unique (mapstruct *map) |
|
|
1602 | CODE: |
|
|
1603 | RETVAL = map->unique; |
|
|
1604 | OUTPUT: |
|
|
1605 | RETVAL |
|
|
1606 | |
|
|
1607 | void set_unique (mapstruct *map, bool unique) |
|
|
1608 | CODE: |
|
|
1609 | map->unique = unique; |
1544 | |
1610 | |
1545 | object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags) |
1611 | object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags) |
1546 | |
1612 | |
1547 | object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) |
1613 | object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) |
1548 | |
1614 | |
… | |
… | |
1662 | } |
1728 | } |
1663 | } |
1729 | } |
1664 | } |
1730 | } |
1665 | } |
1731 | } |
1666 | |
1732 | |
|
|
1733 | |
1667 | MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_ |
1734 | MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_ |
1668 | |
1735 | |
1669 | archetype *cf_archetype_get_first() |
1736 | archetype *cf_archetype_get_first() |
1670 | PROTOTYPE: |
1737 | PROTOTYPE: |
1671 | ALIAS: first = 0 |
1738 | ALIAS: first = 0 |
… | |
… | |
1723 | |
1790 | |
1724 | const char *cf_region_get_message (region *reg) |
1791 | const char *cf_region_get_message (region *reg) |
1725 | ALIAS: message = 0 |
1792 | ALIAS: message = 0 |
1726 | |
1793 | |
1727 | |
1794 | |
|
|
1795 | MODULE = cf PACKAGE = cf::living PREFIX = cf_living_ |
|
|
1796 | |
|
|
1797 | double |
|
|
1798 | exp (living *liv, double new_val = 0.) |
|
|
1799 | PROTOTYPE: $;$ |
|
|
1800 | ALIAS: |
|
|
1801 | Str = 1 |
|
|
1802 | Dex = 2 |
|
|
1803 | Con = 3 |
|
|
1804 | Wis = 4 |
|
|
1805 | Cha = 5 |
|
|
1806 | Int = 6 |
|
|
1807 | Pow = 7 |
|
|
1808 | wc = 8 |
|
|
1809 | ac = 9 |
|
|
1810 | hp = 10 |
|
|
1811 | maxhp = 11 |
|
|
1812 | sp = 12 |
|
|
1813 | maxsp = 13 |
|
|
1814 | grace = 14 |
|
|
1815 | maxgrace = 15 |
|
|
1816 | food = 16 |
|
|
1817 | dam = 17 |
|
|
1818 | luck = 18 |
|
|
1819 | CODE: |
|
|
1820 | # define LIVING_ACC(acc,idx) case idx: RETVAL = liv->acc; if (items > 1) liv->acc = new_val; break |
|
|
1821 | switch (ix) |
|
|
1822 | { |
|
|
1823 | LIVING_ACC (exp , 0); |
|
|
1824 | LIVING_ACC (Str , 1); |
|
|
1825 | LIVING_ACC (Dex , 2); |
|
|
1826 | LIVING_ACC (Con , 3); |
|
|
1827 | LIVING_ACC (Wis , 4); |
|
|
1828 | LIVING_ACC (Cha , 5); |
|
|
1829 | LIVING_ACC (Int , 6); |
|
|
1830 | LIVING_ACC (Pow , 7); |
|
|
1831 | LIVING_ACC (wc , 8); |
|
|
1832 | LIVING_ACC (ac , 9); |
|
|
1833 | LIVING_ACC (hp , 10); |
|
|
1834 | LIVING_ACC (maxhp , 11); |
|
|
1835 | LIVING_ACC (sp , 12); |
|
|
1836 | LIVING_ACC (maxsp , 13); |
|
|
1837 | LIVING_ACC (grace , 14); |
|
|
1838 | LIVING_ACC (maxgrace, 15); |
|
|
1839 | LIVING_ACC (food , 16); |
|
|
1840 | LIVING_ACC (dam , 17); |
|
|
1841 | LIVING_ACC (luck , 18); |
|
|
1842 | } |
|
|
1843 | # undef LIVING_ACC |
|
|
1844 | OUTPUT: |
|
|
1845 | RETVAL |
|
|
1846 | |