… | |
… | |
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 * |
… | |
… | |
1723 | |
1772 | |
1724 | const char *cf_region_get_message (region *reg) |
1773 | const char *cf_region_get_message (region *reg) |
1725 | ALIAS: message = 0 |
1774 | ALIAS: message = 0 |
1726 | |
1775 | |
1727 | |
1776 | |
|
|
1777 | MODULE = cf PACKAGE = cf::living PREFIX = cf_living_ |
|
|
1778 | |
|
|
1779 | double |
|
|
1780 | exp (living *liv, double new_val = 0.) |
|
|
1781 | PROTOTYPE: $;$ |
|
|
1782 | ALIAS: |
|
|
1783 | Str = 1 |
|
|
1784 | Dex = 2 |
|
|
1785 | Con = 3 |
|
|
1786 | Wis = 4 |
|
|
1787 | Cha = 5 |
|
|
1788 | Int = 6 |
|
|
1789 | Pow = 7 |
|
|
1790 | wc = 8 |
|
|
1791 | ac = 9 |
|
|
1792 | hp = 10 |
|
|
1793 | maxhp = 11 |
|
|
1794 | sp = 12 |
|
|
1795 | maxsp = 13 |
|
|
1796 | grace = 14 |
|
|
1797 | maxgrace = 15 |
|
|
1798 | food = 16 |
|
|
1799 | dam = 17 |
|
|
1800 | luck = 18 |
|
|
1801 | CODE: |
|
|
1802 | # define LIVING_ACC(acc,idx) case idx: RETVAL = liv->acc; if (items > 1) liv->acc = new_val; break |
|
|
1803 | switch (ix) |
|
|
1804 | { |
|
|
1805 | LIVING_ACC (exp , 0); |
|
|
1806 | LIVING_ACC (Str , 1); |
|
|
1807 | LIVING_ACC (Dex , 2); |
|
|
1808 | LIVING_ACC (Con , 3); |
|
|
1809 | LIVING_ACC (Wis , 4); |
|
|
1810 | LIVING_ACC (Cha , 5); |
|
|
1811 | LIVING_ACC (Int , 6); |
|
|
1812 | LIVING_ACC (Pow , 7); |
|
|
1813 | LIVING_ACC (wc , 8); |
|
|
1814 | LIVING_ACC (ac , 9); |
|
|
1815 | LIVING_ACC (hp , 10); |
|
|
1816 | LIVING_ACC (maxhp , 11); |
|
|
1817 | LIVING_ACC (sp , 12); |
|
|
1818 | LIVING_ACC (maxsp , 13); |
|
|
1819 | LIVING_ACC (grace , 14); |
|
|
1820 | LIVING_ACC (maxgrace, 15); |
|
|
1821 | LIVING_ACC (food , 16); |
|
|
1822 | LIVING_ACC (dam , 17); |
|
|
1823 | LIVING_ACC (luck , 18); |
|
|
1824 | } |
|
|
1825 | # undef LIVING_ACC |
|
|
1826 | OUTPUT: |
|
|
1827 | RETVAL |
|
|
1828 | |