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.54 by root, Mon Jun 12 13:25:27 2006 UTC vs.
Revision 1.63 by root, Thu Jul 20 07:22:41 2006 UTC

45#include <plugin_common.h> 45#include <plugin_common.h>
46#include <sounds.h> 46#include <sounds.h>
47 47
48#include <stdarg.h> 48#include <stdarg.h>
49 49
50//#include "EventAPI.h"
50#include "perlxsi.c" 51#include "perlxsi.c"
52
53extern sint64 *levels; // the experience table
51 54
52typedef object object_ornull; 55typedef object object_ornull;
53typedef mapstruct mapstruct_ornull; 56typedef mapstruct mapstruct_ornull;
57
58typedef double val64;
59#define newSVval64 newSVnv
60#define SvVAL64 SvNV
54 61
55static f_plug_api gethook; 62static f_plug_api gethook;
56static f_plug_api registerGlobalEvent; 63static f_plug_api registerGlobalEvent;
57static f_plug_api unregisterGlobalEvent; 64static f_plug_api unregisterGlobalEvent;
58static f_plug_api systemDirectory; 65static f_plug_api systemDirectory;
85#define PUSH_PL PUSHcfapi_va(PPLAYER, player *) 92#define PUSH_PL PUSHcfapi_va(PPLAYER, player *)
86#define PUSH_MAP PUSHcfapi_va(PMAP, mapstruct *) 93#define PUSH_MAP PUSHcfapi_va(PMAP, mapstruct *)
87#define PUSH_PV PUSHcfapi_va(STRING, const char *) 94#define PUSH_PV PUSHcfapi_va(STRING, const char *)
88#define PUSH_IV PUSHs (sv_2mortal (newSViv (va_arg (args, int)))) 95#define PUSH_IV PUSHs (sv_2mortal (newSViv (va_arg (args, int))))
89 96
97extern void pay_player(object *op, uint64 amount);
98extern uint64 pay_player_arch(object *op, const char *arch, uint64 amount);
99
90////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 100//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
91 101
92// garbage collect some perl objects, if possible 102// garbage collect some perl objects, if possible
93// all objects no longer referenced and empty are 103// all objects no longer referenced and empty are
94// eligible for destruction. 104// eligible for destruction.
225 case CFAPI_INT: 235 case CFAPI_INT:
226 sv = newSViv (*va_arg (args, int *)); 236 sv = newSViv (*va_arg (args, int *));
227 break; 237 break;
228 238
229 case CFAPI_LONG: 239 case CFAPI_LONG:
230 sv = newSVnv ((double)*va_arg (args, sint64 *)); /* oh, the humanity! */ 240 sv = newSVval64 ((val64)*va_arg (args, sint64 *));
231 break; 241 break;
232 242
233 case CFAPI_DOUBLE: 243 case CFAPI_DOUBLE:
234 sv = newSVnv (*va_arg (args, double *)); 244 sv = newSVnv (*va_arg (args, double *));
235 break; 245 break;
249 sv = &PL_sv_undef; 259 sv = &PL_sv_undef;
250 else 260 else
251 switch (obj->type) 261 switch (obj->type)
252 { 262 {
253 case MAP: 263 case MAP:
254 sv = newSVptr_cached (obj, "cf::object::map"); 264 sv = newSVptr_cached (obj, "cf::object::map::wrap");
255 break; 265 break;
256 266
257 case PLAYER: 267 case PLAYER:
258 sv = newSVptr_cached (obj, "cf::object::player"); 268 sv = newSVptr_cached (obj, "cf::object::player::wrap");
259 break; 269 break;
260 270
261 default: 271 default:
262 sv = newSVptr_cached (obj, "cf::object"); 272 sv = newSVptr_cached (obj, "cf::object::wrap");
263 break; 273 break;
264 } 274 }
265 } 275 }
266 break; 276 break;
267 277
268 case CFAPI_PMAP: 278 case CFAPI_PMAP:
269 sv = newSVptr (va_arg (args, mapstruct *), "cf::map"); 279 sv = newSVptr (va_arg (args, mapstruct *), "cf::map::wrap");
270 break; 280 break;
271 281
272 case CFAPI_PPLAYER: 282 case CFAPI_PPLAYER:
273 sv = newSVptr (va_arg (args, player *), "cf::player"); 283 sv = newSVptr (va_arg (args, player *), "cf::player::wrap");
274 break; 284 break;
275 285
276 case CFAPI_PARCH: 286 case CFAPI_PARCH:
277 sv = newSVptr (va_arg (args, archetype *), "cf::arch"); 287 sv = newSVptr (va_arg (args, archetype *), "cf::arch::wrap");
278 break; 288 break;
279 289
280 case CFAPI_PPARTY: 290 case CFAPI_PPARTY:
281 sv = newSVptr (va_arg (args, partylist *), "cf::party"); 291 sv = newSVptr (va_arg (args, partylist *), "cf::party::wrap");
282 break; 292 break;
283 293
284 case CFAPI_PREGION: 294 case CFAPI_PREGION:
285 sv = newSVptr (va_arg (args, region *), "cf::region"); 295 sv = newSVptr (va_arg (args, region *), "cf::region::wrap");
286 break; 296 break;
287 297
288 default: 298 default:
289 assert (("unhandled type in newSVcfapi", 0)); 299 assert (("unhandled type in newSVcfapi", 0));
290 } 300 }
408 418
409 /* Pick the global events you want to monitor from this plugin */ 419 /* Pick the global events you want to monitor from this plugin */
410 registerGlobalEvent (NULL, EVENT_BORN, PLUGIN_NAME, globalEventListener); 420 registerGlobalEvent (NULL, EVENT_BORN, PLUGIN_NAME, globalEventListener);
411 registerGlobalEvent (NULL, EVENT_CLOCK, PLUGIN_NAME, globalEventListener); 421 registerGlobalEvent (NULL, EVENT_CLOCK, PLUGIN_NAME, globalEventListener);
412 //registerGlobalEvent (NULL, EVENT_CRASH, PLUGIN_NAME, globalEventListener); 422 //registerGlobalEvent (NULL, EVENT_CRASH, PLUGIN_NAME, globalEventListener);
423 registerGlobalEvent (NULL, EVENT_FIND_UNARMED_SKILL, PLUGIN_NAME, globalEventListener);
424 registerGlobalEvent (NULL, EVENT_PLAYER_USE_SKILL, PLUGIN_NAME, globalEventListener);
425 registerGlobalEvent (NULL, EVENT_MONSTER_USE_SKILL, PLUGIN_NAME, globalEventListener);
413 registerGlobalEvent (NULL, EVENT_PLAYER_DEATH, PLUGIN_NAME, globalEventListener); 426 registerGlobalEvent (NULL, EVENT_PLAYER_DEATH, PLUGIN_NAME, globalEventListener);
414 registerGlobalEvent (NULL, EVENT_GKILL, PLUGIN_NAME, globalEventListener); 427 registerGlobalEvent (NULL, EVENT_GKILL, PLUGIN_NAME, globalEventListener);
415 registerGlobalEvent (NULL, EVENT_LOGIN, PLUGIN_NAME, globalEventListener); 428 registerGlobalEvent (NULL, EVENT_LOGIN, PLUGIN_NAME, globalEventListener);
416 registerGlobalEvent (NULL, EVENT_LOGOUT, PLUGIN_NAME, globalEventListener); 429 registerGlobalEvent (NULL, EVENT_LOGOUT, PLUGIN_NAME, globalEventListener);
417 registerGlobalEvent (NULL, EVENT_MAPENTER, PLUGIN_NAME, globalEventListener); 430 registerGlobalEvent (NULL, EVENT_MAPENTER, PLUGIN_NAME, globalEventListener);
443 }; 456 };
444 457
445 perl = perl_alloc (); 458 perl = perl_alloc ();
446 perl_construct (perl); 459 perl_construct (perl);
447 460
461 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
462
448 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl)) 463 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl))
449 { 464 {
450 printf ("unable to initialize perl-interpreter, continuing without.\n"); 465 printf ("unable to initialize perl-interpreter, continuing without.\n");
451 466
452 perl_destruct (perl); 467 perl_destruct (perl);
486 if (sv) 501 if (sv)
487 clearSVptr (sv); 502 clearSVptr (sv);
488 503
489 rv = 0; 504 rv = 0;
490 } 505 }
506 else if (event_code == EVENT_CLOCK)
507 {
508 dSP;
509 int i, count;
510
511 clean_obj_cache ();
512
513 ENTER;
514 SAVETMPS;
515
516 // service up to 8 events per tick better would be
517 // to check for elapsed time and stop processing after
518 // 0.25 * server_tick or so
519 for (i = 9; --i; )
520 {
521 PUSHMARK (SP);
522 XPUSHs (sv_2mortal (newSViv (0)));
523 PUTBACK;
524 count = call_pv ("Event::one_event", G_SCALAR | G_EVAL);
525 SPAGAIN;
526
527 if (!count || !POPi)
528 break;
529 }
530
531 FREETMPS;
532 LEAVE;
533 }
491 else 534 else
492 { 535 {
493 dSP; 536 dSP;
494 537
495 ENTER; 538 ENTER;
543 case EVENT_KICK: 586 case EVENT_KICK:
544 PUSH_OB; 587 PUSH_OB;
545 PUSH_PV; 588 PUSH_PV;
546 break; 589 break;
547 590
591 case EVENT_FIND_UNARMED_SKILL:
592 PUSH_OB;
593 break;
594
595 case EVENT_PLAYER_USE_SKILL:
596 case EVENT_MONSTER_USE_SKILL:
597 PUSH_OB;
598 PUSH_OB;
599 PUSH_OB;
600 PUSH_IV;
601 PUSH_PV;
602 break;
603
548 case EVENT_EXTCMD: 604 case EVENT_EXTCMD:
549 PUSH_PL; 605 PUSH_PL;
550 { 606 {
551 char *buf = va_arg (args, char *); 607 char *buf = va_arg (args, char *);
552 int len = va_arg (args, int); 608 int len = va_arg (args, int);
553 PUSHs (sv_2mortal (newSVpvn (buf, len))); 609 PUSHs (sv_2mortal (newSVpvn (buf, len)));
554 } 610 }
555 break;
556
557 case EVENT_CLOCK:
558 clean_obj_cache ();
559 break; 611 break;
560 612
561 case EVENT_TELL: 613 case EVENT_TELL:
562 break; 614 break;
563 } 615 }
1127 const_iv (SOUND_CLOCK) 1179 const_iv (SOUND_CLOCK)
1128 const_iv (SOUND_TURN_HANDLE) 1180 const_iv (SOUND_TURN_HANDLE)
1129 const_iv (SOUND_FALL_HOLE) 1181 const_iv (SOUND_FALL_HOLE)
1130 const_iv (SOUND_DRINK_POISON) 1182 const_iv (SOUND_DRINK_POISON)
1131 const_iv (SOUND_CAST_SPELL_0) 1183 const_iv (SOUND_CAST_SPELL_0)
1184
1185 const_iv (PREFER_LOW)
1186 const_iv (PREFER_HIGH)
1187
1188 const_iv (ATNR_PHYSICAL)
1189 const_iv (ATNR_MAGIC)
1190 const_iv (ATNR_FIRE)
1191 const_iv (ATNR_ELECTRICITY)
1192 const_iv (ATNR_COLD)
1193 const_iv (ATNR_CONFUSION)
1194 const_iv (ATNR_ACID)
1195 const_iv (ATNR_DRAIN)
1196 const_iv (ATNR_WEAPONMAGIC)
1197 const_iv (ATNR_GHOSTHIT)
1198 const_iv (ATNR_POISON)
1199 const_iv (ATNR_SLOW)
1200 const_iv (ATNR_PARALYZE)
1201 const_iv (ATNR_TURN_UNDEAD)
1202 const_iv (ATNR_FEAR)
1203 const_iv (ATNR_CANCELLATION)
1204 const_iv (ATNR_DEPLETE)
1205 const_iv (ATNR_DEATH)
1206 const_iv (ATNR_CHAOS)
1207 const_iv (ATNR_COUNTERSPELL)
1208 const_iv (ATNR_GODPOWER)
1209 const_iv (ATNR_HOLYWORD)
1210 const_iv (ATNR_BLIND)
1211 const_iv (ATNR_INTERNAL)
1212 const_iv (ATNR_LIFE_STEALING)
1213 const_iv (ATNR_DISEASE)
1214
1215 const_iv (MAP_FLUSH)
1216 const_iv (MAP_PLAYER_UNIQUE)
1217 const_iv (MAP_BLOCK)
1218 const_iv (MAP_STYLE)
1219 const_iv (MAP_OVERLAY)
1220
1221 const_iv (MAP_IN_MEMORY)
1222 const_iv (MAP_SWAPPED)
1223 const_iv (MAP_LOADING)
1224 const_iv (MAP_SAVING)
1132 }; 1225 };
1133 1226
1134 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 1227 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
1135 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 1228 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
1136 1229
1153 const_event (CLOSE) 1246 const_event (CLOSE)
1154 const_event (TIMER) 1247 const_event (TIMER)
1155 const_event (MOVE) 1248 const_event (MOVE)
1156 1249
1157 const_event (BORN) 1250 const_event (BORN)
1158 const_event (CLOCK) 1251 //const_event (CLOCK)
1159 const_event (CRASH) 1252 const_event (CRASH)
1160 const_event (PLAYER_DEATH) 1253 const_event (PLAYER_DEATH)
1161 const_event (PLAYER_LOAD) 1254 const_event (PLAYER_LOAD)
1162 const_event (PLAYER_SAVE) 1255 const_event (PLAYER_SAVE)
1163 const_event (GKILL) 1256 const_event (GKILL)
1173 const_event (REMOVE) 1266 const_event (REMOVE)
1174 const_event (SHOUT) 1267 const_event (SHOUT)
1175 const_event (TELL) 1268 const_event (TELL)
1176 const_event (MUZZLE) 1269 const_event (MUZZLE)
1177 const_event (KICK) 1270 const_event (KICK)
1271 const_event (PLAYER_USE_SKILL)
1272 const_event (MONSTER_USE_SKILL)
1273 const_event (FIND_UNARMED_SKILL)
1178 const_event (EXTCMD) 1274 const_event (EXTCMD)
1179 //const_event (FREE_OB) 1275 //const_event (FREE_OB)
1180 }; 1276 };
1181 1277
1182 AV *av = get_av ("cf::EVENT", 1); 1278 AV *av = get_av ("cf::EVENT", 1);
1317 for (cprop = prop_table + sizeof (prop_table) / sizeof (prop_table [0]); cprop-- > prop_table; ) 1413 for (cprop = prop_table + sizeof (prop_table) / sizeof (prop_table [0]); cprop-- > prop_table; )
1318 { 1414 {
1319 hv_store (prop_type, cprop->name, strlen (cprop->name), newSViv (cprop->dtype), 0); 1415 hv_store (prop_type, cprop->name, strlen (cprop->name), newSViv (cprop->dtype), 0);
1320 hv_store (prop_idx, cprop->name, strlen (cprop->name), newSViv (cprop->idx ), 0); 1416 hv_store (prop_idx, cprop->name, strlen (cprop->name), newSViv (cprop->idx ), 0);
1321 } 1417 }
1418
1419 //I_EVENT_API (PACKAGE);
1322} 1420}
1323 1421
1324void 1422void
1325LOG (int level, char *msg) 1423LOG (int level, char *msg)
1326 PROTOTYPE: $$ 1424 PROTOTYPE: $$
1327 C_ARGS: level, "%s", msg 1425 C_ARGS: level, "%s", msg
1328 1426
1427char *path_combine (char *base, char *path)
1428 PROTOTYPE: $$
1429
1430char *path_combine_and_normalize (char *base, char *path)
1431 PROTOTYPE: $$
1432
1329char * 1433char *
1330cf_get_maps_directory (char *path) 1434cf_get_maps_directory (char *path)
1331 PROTOTYPE: $ 1435 PROTOTYPE: $
1332 ALIAS: maps_directory = 0 1436 ALIAS: maps_directory = 0
1437
1438void
1439sub_generation_inc ()
1440 CODE:
1441 PL_sub_generation++;
1333 1442
1334char * 1443char *
1335mapdir () 1444mapdir ()
1336 PROTOTYPE: 1445 PROTOTYPE:
1337 ALIAS: 1446 ALIAS:
1351 1460
1352int 1461int
1353cf_find_animation (char *text) 1462cf_find_animation (char *text)
1354 PROTOTYPE: $ 1463 PROTOTYPE: $
1355 1464
1465int random_roll(int min, int max, object *op, int goodbad);
1466
1467int
1468exp_to_level (val64 exp)
1469 CODE:
1470{
1471 int i = 0;
1472
1473 RETVAL = settings.max_level;
1474
1475 for (i = 1; i <= settings.max_level; i++)
1476 {
1477 if (levels[i] > exp)
1478 {
1479 RETVAL = i - 1;
1480 break;
1481 }
1482 }
1483}
1484 OUTPUT: RETVAL
1485
1486val64
1487level_to_min_exp (int level)
1488 CODE:
1489 if (level > settings.max_level)
1490 RETVAL = levels[settings.max_level];
1491 else if (level < 1)
1492 RETVAL = 0;
1493 else
1494 RETVAL = levels[level];
1495 OUTPUT: RETVAL
1496
1497SV *
1498resistance_to_string (int atnr)
1499 CODE:
1500 if (atnr >= 0 && atnr < NROFATTACKS)
1501 RETVAL = newSVpv (resist_plus[atnr], 0);
1502 else
1503 XSRETURN_UNDEF;
1504 OUTPUT: RETVAL
1505
1356MODULE = cf PACKAGE = cf::object PREFIX = cf_object_ 1506MODULE = cf PACKAGE = cf::object PREFIX = cf_object_
1357 1507
1358SV * 1508SV *
1359get_property (object *obj, int type, int idx) 1509get_property (object *obj, int type, int idx)
1360 CODE: 1510 CODE:
1368 { 1518 {
1369 case CFAPI_INT: 1519 case CFAPI_INT:
1370 cf_object_set_int_property (obj, idx, SvIV (newval)); 1520 cf_object_set_int_property (obj, idx, SvIV (newval));
1371 break; 1521 break;
1372 case CFAPI_LONG: 1522 case CFAPI_LONG:
1373 cf_object_set_long_property (obj, idx, SvNV (newval)); 1523 cf_object_set_long_property (obj, idx, SvVAL64 (newval));
1374 break; 1524 break;
1375 case CFAPI_DOUBLE: 1525 case CFAPI_DOUBLE:
1376 { 1526 {
1377 int unused_type; 1527 int unused_type;
1378 object_set_property (&unused_type, obj, idx, (double)SvNV (newval)); 1528 object_set_property (&unused_type, obj, idx, (double)SvNV (newval));
1456 1606
1457object *cf_object_clone (object *op, int clonetype = 0) 1607object *cf_object_clone (object *op, int clonetype = 0)
1458 1608
1459int cf_object_pay_item (object *op, object *buyer) 1609int cf_object_pay_item (object *op, object *buyer)
1460 1610
1461int cf_object_pay_amount (object *op, double amount) 1611int cf_object_pay_amount (object *op, val64 amount)
1462 1612
1463int cf_object_cast_spell (object *caster, object *ctoo, int dir, object *spell_ob, char *stringarg = 0) 1613int cf_object_cast_spell (object *caster, object *ctoo, int dir, object *spell_ob, char *stringarg = 0)
1464 1614
1465int cf_object_cast_ability (object *caster, object *ctoo, int dir, object *sp_, char *stringarg = 0) 1615int cf_object_cast_ability (object *caster, object *ctoo, int dir, object *sp_, char *stringarg = 0)
1466 1616
1503 1653
1504void cf_object_pickup (object *op, object *what) 1654void cf_object_pickup (object *op, object *what)
1505 1655
1506object *cf_create_object_by_name (const char *name) 1656object *cf_create_object_by_name (const char *name)
1507 1657
1508void change_exp (object *op, double exp, const char *skill_name = 0, int flag = 0) 1658void change_exp (object *op, val64 exp, const char *skill_name = 0, int flag = 0)
1659
1660void pay_player (object *op, val64 amount)
1661
1662val64 pay_player_arch (object *op, const char *arch, val64 amount)
1509 1663
1510void player_lvl_adj (object *who, object *skill = 0) 1664void player_lvl_adj (object *who, object *skill = 0)
1511 1665
1512int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) 1666int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL)
1667
1668int calc_skill_exp (object *who, object *op, object *skill);
1669
1670void push_button (object *op);
1671
1672void use_trigger (object *op);
1673
1674void add_button_link (object *button, mapstruct *map, int connected);
1675
1676void remove_button_link (object *op);
1677
1678void
1679cf_object_set_resistance (object *op, int rtype, int val)
1680 CODE:
1681 if (rtype >= 0 && rtype < NROFATTACKS)
1682 op->resist[rtype] = val;
1683
1513 1684
1514MODULE = cf PACKAGE = cf::object PREFIX = cf_ 1685MODULE = cf PACKAGE = cf::object PREFIX = cf_
1515 1686
1516void cf_fix_object (object *pl) 1687void cf_fix_object (object *pl)
1517 ALIAS: fix = 0 1688 ALIAS: fix = 0
1540const char *options (object *op) 1711const char *options (object *op)
1541 CODE: 1712 CODE:
1542 RETVAL = op->name; 1713 RETVAL = op->name;
1543 OUTPUT: 1714 OUTPUT:
1544 RETVAL 1715 RETVAL
1716
1717player *contr (object *op)
1718 CODE:
1719 RETVAL = op->contr;
1720 OUTPUT: RETVAL
1545 1721
1546const char *get_ob_key_value (object *op, const char *key) 1722const char *get_ob_key_value (object *op, const char *key)
1547 1723
1548bool set_ob_key_value (object *op, const char *key, const char *value = 0, int add_key = 1) 1724bool set_ob_key_value (object *op, const char *key, const char *value = 0, int add_key = 1)
1549 1725
1593 1769
1594void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) 1770void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE)
1595 1771
1596object *cf_player_send_inventory (object *op) 1772object *cf_player_send_inventory (object *op)
1597 1773
1598player *contr (object *op)
1599 CODE:
1600 RETVAL = op->contr;
1601 OUTPUT: RETVAL
1602
1603char *cf_player_get_ip (object *op) 1774char *cf_player_get_ip (object *op)
1604 ALIAS: ip = 0 1775 ALIAS: ip = 0
1605 1776
1606object *cf_player_get_marked_item (object *op) 1777object *cf_player_get_marked_item (object *op)
1607 ALIAS: marked_item = 0 1778 ALIAS: marked_item = 0
1611partylist *cf_player_get_party (object *op) 1782partylist *cf_player_get_party (object *op)
1612 ALIAS: party = 0 1783 ALIAS: party = 0
1613 1784
1614void cf_player_set_party (object *op, partylist *party) 1785void cf_player_set_party (object *op, partylist *party)
1615 1786
1616void change_skill (object *op, double exp, char *skill_name = 0, int flag = 0) 1787void change_skill (object *op, val64 exp, char *skill_name = 0, int flag = 0)
1617 1788
1618void kill_player (object *op) 1789void kill_player (object *op)
1619 1790
1620MODULE = cf PACKAGE = cf::object::map PREFIX = cf_ 1791MODULE = cf PACKAGE = cf::object::map PREFIX = cf_
1621 1792
1754 1925
1755void clean_tmp_map (mapstruct *map) 1926void clean_tmp_map (mapstruct *map)
1756 1927
1757void play_sound_map (mapstruct *map, int x, int y, int sound_num) 1928void play_sound_map (mapstruct *map, int x, int y, int sound_num)
1758 1929
1930mapstruct *tile_map (mapstruct *map, unsigned int dir)
1931 CODE:
1932 RETVAL = dir < 4 ? map->tile_map [dir] : 0;
1933 OUTPUT:
1934 RETVAL
1935
1936char *tile_path (mapstruct *map, unsigned int dir)
1937 CODE:
1938 if (dir >= 4)
1939 XSRETURN_UNDEF;
1940 RETVAL = map->tile_path [dir];
1941 OUTPUT:
1942 RETVAL
1943
1759mapstruct *cf_map_get_map (char *name) 1944mapstruct *cf_map_get_map (char *name)
1760 PROTOTYPE: $ 1945 PROTOTYPE: $
1761 ALIAS: map = 0 1946 ALIAS: map = 0
1762 1947
1948mapstruct *has_been_loaded (char *name)
1949 PROTOTYPE: $
1950
1763mapstruct *cf_map_get_first () 1951mapstruct *cf_map_get_first ()
1764 PROTOTYPE: 1952 PROTOTYPE:
1765 ALIAS: first = 0 1953 ALIAS: first = 0
1766 1954
1767# whoever "designed" the plug-in api should have wasted 1955# whoever "designed" the plug-in api should have wasted
1768# his/her time with staying away form the project - would have 1956# his/her time with staying away from the project - would have
1769# saved others a lot of time, without doubt. 1957# saved others a lot of time, without doubt.
1770void set_path (mapstruct *where, char *path) 1958void set_path (mapstruct *where, char *path)
1771 CODE: 1959 CODE:
1772 strcpy (where->path, path); 1960 strcpy (where->path, path);
1961
1962int in_memory (mapstruct *map)
1963 CODE:
1964 RETVAL = map->in_memory;
1965 OUTPUT:
1966 RETVAL
1773 1967
1774bool unique (mapstruct *map) 1968bool unique (mapstruct *map)
1775 CODE: 1969 CODE:
1776 RETVAL = map->unique; 1970 RETVAL = map->unique;
1777 OUTPUT: 1971 OUTPUT:
1985 ALIAS: message = 0 2179 ALIAS: message = 0
1986 2180
1987 2181
1988MODULE = cf PACKAGE = cf::living PREFIX = cf_living_ 2182MODULE = cf PACKAGE = cf::living PREFIX = cf_living_
1989 2183
1990double 2184val64
1991exp (living *liv, double new_val = 0.) 2185exp (living *liv, val64 new_val = 0)
1992 PROTOTYPE: $;$ 2186 PROTOTYPE: $;$
1993 ALIAS: 2187 ALIAS:
1994 Str = 1 2188 Str = 1
1995 Dex = 2 2189 Dex = 2
1996 Con = 3 2190 Con = 3

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines