… | |
… | |
51 | #include <perl.h> |
51 | #include <perl.h> |
52 | #include <XSUB.h> |
52 | #include <XSUB.h> |
53 | |
53 | |
54 | #include "CoroAPI.h" |
54 | #include "CoroAPI.h" |
55 | #include "perlxsi.c" |
55 | #include "perlxsi.c" |
56 | |
|
|
57 | extern sint64 *levels; // the experience table |
|
|
58 | |
56 | |
59 | typedef object_thawer &object_thawer_ref; |
57 | typedef object_thawer &object_thawer_ref; |
60 | typedef object_freezer &object_freezer_ref; |
58 | typedef object_freezer &object_freezer_ref; |
61 | |
59 | |
62 | typedef std::string std__string; |
60 | typedef std::string std__string; |
… | |
… | |
1799 | |
1797 | |
1800 | int random_roll (int min, int max, object *op, int goodbad); |
1798 | int random_roll (int min, int max, object *op, int goodbad); |
1801 | |
1799 | |
1802 | const_utf8_string cost_string_from_value(uint64 cost, int approx = 0) |
1800 | const_utf8_string cost_string_from_value(uint64 cost, int approx = 0) |
1803 | |
1801 | |
1804 | int |
|
|
1805 | exp_to_level (val64 exp) |
1802 | int exp_to_level (val64 exp) |
1806 | CODE: |
|
|
1807 | { |
|
|
1808 | int i = 0; |
|
|
1809 | |
1803 | |
1810 | RETVAL = settings.max_level; |
|
|
1811 | |
|
|
1812 | for (i = 1; i <= settings.max_level; i++) |
|
|
1813 | { |
|
|
1814 | if (levels[i] > exp) |
|
|
1815 | { |
|
|
1816 | RETVAL = i - 1; |
|
|
1817 | break; |
|
|
1818 | } |
|
|
1819 | } |
|
|
1820 | } |
|
|
1821 | OUTPUT: RETVAL |
|
|
1822 | |
|
|
1823 | val64 |
|
|
1824 | level_to_min_exp (int level) |
1804 | val64 level_to_min_exp (int level) |
1825 | CODE: |
|
|
1826 | if (level > settings.max_level) |
|
|
1827 | RETVAL = levels[settings.max_level]; |
|
|
1828 | else if (level < 1) |
|
|
1829 | RETVAL = 0; |
|
|
1830 | else |
|
|
1831 | RETVAL = levels[level]; |
|
|
1832 | OUTPUT: RETVAL |
|
|
1833 | |
1805 | |
1834 | SV * |
1806 | SV * |
1835 | resistance_to_string (int atnr) |
1807 | resistance_to_string (int atnr) |
1836 | CODE: |
1808 | CODE: |
1837 | if (atnr >= 0 && atnr < NROFATTACKS) |
1809 | if (atnr >= 0 && atnr < NROFATTACKS) |
… | |
… | |
2028 | } |
2000 | } |
2029 | OUTPUT: |
2001 | OUTPUT: |
2030 | RETVAL |
2002 | RETVAL |
2031 | |
2003 | |
2032 | object *find_best_object_match (object *op, utf8_string match) |
2004 | object *find_best_object_match (object *op, utf8_string match) |
2033 | |
|
|
2034 | object *find_marked_object (object *op) |
|
|
2035 | |
|
|
2036 | int need_identify (object *obj); |
|
|
2037 | |
2005 | |
2038 | int apply_shop_mat (object *shop_mat, object *op); |
2006 | int apply_shop_mat (object *shop_mat, object *op); |
2039 | |
2007 | |
2040 | int move (object *op, int dir, object *originator = op) |
2008 | int move (object *op, int dir, object *originator = op) |
2041 | CODE: |
2009 | CODE: |
… | |
… | |
2954 | sv_to (sv, self); |
2922 | sv_to (sv, self); |
2955 | delete self; |
2923 | delete self; |
2956 | |
2924 | |
2957 | MODULE = cf PACKAGE = cf::object::thawer |
2925 | MODULE = cf PACKAGE = cf::object::thawer |
2958 | |
2926 | |
2959 | INCLUDE: $PERL $srcdir/genacc object_thawer $srcdir/../include/cfperl.h | |
2927 | INCLUDE: $PERL $srcdir/genacc object_thawer $srcdir/../include/freezethaw.h | |
2960 | |
2928 | |
2961 | SV * |
2929 | SV * |
2962 | new_from_file (char *klass, octet_string path) |
2930 | new_from_file (char *klass, octet_string path) |
2963 | CODE: |
2931 | CODE: |
2964 | object_thawer *f = new object_thawer (path); |
2932 | object_thawer *f = new object_thawer (path); |