ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/plugins/cfperl/cfperl.xs
(Generate patch)

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.33 by root, Thu Mar 16 21:08:20 2006 UTC vs.
Revision 1.37 by root, Fri Mar 17 01:23:48 2006 UTC

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
1281void 1297void
1282set_food (object *obj, int food) 1298set_food (object *obj, int food)
1283 CODE: 1299 CODE:
1284 obj->stats.food = food; 1300 obj->stats.food = food;
1285 1301
1319 1335
1320void cf_object_free (object *op) 1336void cf_object_free (object *op)
1321 1337
1322object *cf_object_present_archname_inside (object *op, char *whatstr) 1338object *cf_object_present_archname_inside (object *op, char *whatstr)
1323 1339
1324int cf_object_transfer (object *op, int x, int y, int r, object *orig) 1340int cf_object_transfer (object *op, int x, int y, int r = 0, object_ornull *orig = 0)
1325 1341
1326int cf_object_change_map (object *op, int x, int y, mapstruct *map) 1342int cf_object_change_map (object *op, int x, int y, mapstruct *map)
1327 1343
1328object *cf_object_clone (object *op, int clonetype = 0) 1344object *cf_object_clone (object *op, int clonetype = 0)
1329 1345
1434base_name (object *ob, int plural) 1450base_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
1455living *
1456stats (object *ob)
1457 CODE:
1458 RETVAL = &ob->stats;
1459 OUTPUT: RETVAL
1460
1439 1461
1440MODULE = cf PACKAGE = cf::object::player PREFIX = cf_player_ 1462MODULE = cf PACKAGE = cf::object::player PREFIX = cf_player_
1441 1463
1442player *player (object *op) 1464player *player (object *op)
1443 CODE: 1465 CODE:
1491 1513
1492player *next (player *pl) 1514player *next (player *pl)
1493 CODE: 1515 CODE:
1494 RETVAL = pl->next; 1516 RETVAL = pl->next;
1495 OUTPUT: RETVAL 1517 OUTPUT: RETVAL
1518
1519void 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
1528void 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
1497void 1534void
1498list () 1535list ()
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
1543living *
1544orig_stats (player *pl)
1545 CODE:
1546 RETVAL = &pl->orig_stats;
1547 OUTPUT: RETVAL
1548
1549living *
1550last_stats (player *pl)
1551 CODE:
1552 RETVAL = &pl->last_stats;
1553 OUTPUT: RETVAL
1505 1554
1506 1555
1507MODULE = cf PACKAGE = cf::map PREFIX = cf_map_ 1556MODULE = cf PACKAGE = cf::map PREFIX = cf_map_
1508 1557
1509SV * 1558SV *
1539 ALIAS: map = 0 1588 ALIAS: map = 0
1540 1589
1541mapstruct *cf_map_get_first () 1590mapstruct *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.
1597void set_path (mapstruct *where, char *path)
1598 CODE:
1599 strcpy (where->path, path);
1600
1601bool unique (mapstruct *map)
1602 CODE:
1603 RETVAL = map->unique;
1604 OUTPUT:
1605 RETVAL
1606
1607void set_unique (mapstruct *map, bool unique)
1608 CODE:
1609 map->unique = unique;
1544 1610
1545object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags) 1611object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags)
1546 1612
1547object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) 1613object *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
1667MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_ 1734MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_
1668 1735
1669archetype *cf_archetype_get_first() 1736archetype *cf_archetype_get_first()
1670 PROTOTYPE: 1737 PROTOTYPE:
1671 ALIAS: first = 0 1738 ALIAS: first = 0
1723 1790
1724const char *cf_region_get_message (region *reg) 1791const char *cf_region_get_message (region *reg)
1725 ALIAS: message = 0 1792 ALIAS: message = 0
1726 1793
1727 1794
1795MODULE = cf PACKAGE = cf::living PREFIX = cf_living_
1796
1797double
1798exp (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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines