1 | /*****************************************************************************/ |
|
|
2 | /* CrossFire, A Multiplayer game for the X Window System */ |
|
|
3 | /*****************************************************************************/ |
|
|
4 | |
|
|
5 | /* |
1 | /* |
6 | * This code is placed under the GNU General Public Licence (GPL) |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
7 | * |
3 | * |
|
|
4 | * Copyright (©) 2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
8 | * Copyright (C) 2001-2005 by Chachkoff Yann |
5 | * Copyright (©) 2001-2005,2007 by Chachkoff Yann |
9 | * Copyright (C) 2006,2007 by Marc Lehmann <cf@schmorp.de> |
6 | * Copyright (©) 2006,2007 by Marc Lehmann <cf@schmorp.de> |
10 | * |
7 | * |
11 | * This program is free software; you can redistribute it and/or modify |
8 | * Crossfire TRT is free software; you can redistribute it and/or modify it |
12 | * it under the terms of the GNU General Public License as published by |
9 | * under the terms of the GNU General Public License as published by the Free |
13 | * the Free Software Foundation; either version 2 of the License, or |
10 | * Software Foundation; either version 2 of the License, or (at your option) |
14 | * (at your option) any later version. |
11 | * any later version. |
15 | * |
12 | * |
16 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, but |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
19 | * GNU General Public License for more details. |
16 | * for more details. |
20 | * |
17 | * |
21 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License along |
22 | * along with this program; if not, write to the Free Software |
19 | * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 |
23 | * Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
|
21 | * |
|
|
22 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
24 | */ |
23 | */ |
25 | |
24 | |
26 | #include "autoconf.h" |
25 | #include "autoconf.h" |
27 | |
26 | |
28 | #define PLUGIN_NAME "perl" |
27 | #define PLUGIN_NAME "perl" |
… | |
… | |
86 | double runtime; |
85 | double runtime; |
87 | |
86 | |
88 | global gbl_ev; |
87 | global gbl_ev; |
89 | static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map; |
88 | static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map; |
90 | static SV *sv_runtime, *sv_next_tick; |
89 | static SV *sv_runtime, *sv_next_tick; |
|
|
90 | |
|
|
91 | bitset<NUM_EVENT_TYPES> ev_want_event; |
|
|
92 | bitset<NUM_TYPES> ev_want_type; |
91 | |
93 | |
92 | static HV |
94 | static HV |
93 | *stash_cf, |
95 | *stash_cf, |
94 | *stash_cf_object_wrap, |
96 | *stash_cf_object_wrap, |
95 | *stash_cf_object_player_wrap, |
97 | *stash_cf_object_player_wrap, |
… | |
… | |
167 | } |
169 | } |
168 | |
170 | |
169 | void |
171 | void |
170 | attachable::do_destroy () |
172 | attachable::do_destroy () |
171 | { |
173 | { |
172 | invoke (EVENT_ATTACHABLE_DESTROY, DT_END); |
174 | INVOKE_ATTACHABLE (DESTROY, this); |
173 | |
175 | |
174 | if (cb) |
176 | if (cb) |
175 | { |
177 | { |
176 | SvREFCNT_dec (cb); |
178 | SvREFCNT_dec (cb); |
177 | cb = 0; |
179 | cb = 0; |
… | |
… | |
654 | void |
656 | void |
655 | attachable::instantiate () |
657 | attachable::instantiate () |
656 | { |
658 | { |
657 | if (attach) |
659 | if (attach) |
658 | { |
660 | { |
659 | invoke (EVENT_ATTACHABLE_INSTANTIATE, ARG_STRING (attach), DT_END); |
661 | INVOKE_ATTACHABLE (INSTANTIATE, this, ARG_STRING (attach)); |
660 | attach = 0; |
662 | attach = 0; |
661 | } |
663 | } |
662 | } |
664 | } |
663 | |
665 | |
664 | void |
666 | void |
665 | attachable::reattach () |
667 | attachable::reattach () |
666 | { |
668 | { |
667 | optimise (); |
669 | optimise (); |
668 | //TODO: check for _attachment's, very important for restarts |
670 | //TODO: check for _attachment's, very important for restarts |
669 | invoke (EVENT_ATTACHABLE_REATTACH, DT_END); |
671 | INVOKE_ATTACHABLE (REATTACH, this); |
670 | } |
672 | } |
671 | |
673 | |
672 | static event_klass klass_of[NUM_EVENT_TYPES] = { |
674 | static event_klass klass_of[NUM_EVENT_TYPES] = { |
673 | # define def(type,name) KLASS_ ## type, |
675 | # define def(type,name) KLASS_ ## type, |
674 | # include "eventinc.h" |
676 | # include "eventinc.h" |
… | |
… | |
717 | } |
719 | } |
718 | |
720 | |
719 | void |
721 | void |
720 | global::gather_callbacks (AV *&callbacks, event_type event) const |
722 | global::gather_callbacks (AV *&callbacks, event_type event) const |
721 | { |
723 | { |
722 | ::gather_callbacks (callbacks, cb_object, event); |
724 | ::gather_callbacks (callbacks, cb_global, event); |
723 | } |
725 | } |
724 | |
726 | |
725 | void |
727 | void |
726 | object::gather_callbacks (AV *&callbacks, event_type event) const |
728 | object::gather_callbacks (AV *&callbacks, event_type event) const |
727 | { |
729 | { |
728 | if (subtype && type + subtype * NUM_SUBTYPES <= AvFILLp (cb_type)) |
730 | if (subtype && type + subtype * NUM_TYPES <= AvFILLp (cb_type)) |
729 | { |
731 | { |
730 | SV *registry = AvARRAY (cb_type)[type + subtype * NUM_SUBTYPES]; |
732 | SV *registry = AvARRAY (cb_type)[type + subtype * NUM_TYPES]; |
731 | |
733 | |
732 | if (registry && SvROK (registry) && SvTYPE (SvRV (registry)) == SVt_PVAV) |
734 | if (registry && SvROK (registry) && SvTYPE (SvRV (registry)) == SVt_PVAV) |
733 | ::gather_callbacks (callbacks, (AV *)SvRV (registry), event); |
735 | ::gather_callbacks (callbacks, (AV *)SvRV (registry), event); |
734 | } |
736 | } |
735 | |
737 | |
… | |
… | |
771 | { |
773 | { |
772 | attachable::gather_callbacks (callbacks, event); |
774 | attachable::gather_callbacks (callbacks, event); |
773 | ::gather_callbacks (callbacks, cb_map, event); |
775 | ::gather_callbacks (callbacks, cb_map, event); |
774 | } |
776 | } |
775 | |
777 | |
|
|
778 | void |
|
|
779 | _recalc_want (bitset<NUM_EVENT_TYPES> &set, AV *registry) |
|
|
780 | { |
|
|
781 | for (int event = 0; event <= AvFILLp (registry); ++event) |
|
|
782 | { |
|
|
783 | SV *cbs_ = AvARRAY (registry)[event]; |
|
|
784 | |
|
|
785 | // element must be list of callback entries |
|
|
786 | if (cbs_ && SvROK (cbs_) && SvTYPE (SvRV (cbs_)) == SVt_PVAV) |
|
|
787 | { |
|
|
788 | AV *cbs = (AV *)SvRV (cbs_); |
|
|
789 | |
|
|
790 | // no callback entries, no callbacks to call |
|
|
791 | if (AvFILLp (cbs) >= 0) |
|
|
792 | set.set (event); |
|
|
793 | } |
|
|
794 | } |
|
|
795 | } |
|
|
796 | |
|
|
797 | // very slow and inefficient way to recalculate the global want bitsets |
|
|
798 | void |
|
|
799 | _recalc_want () |
|
|
800 | { |
|
|
801 | ev_want_event.reset (); |
|
|
802 | |
|
|
803 | _recalc_want (ev_want_event, cb_global); |
|
|
804 | _recalc_want (ev_want_event, cb_attachable); |
|
|
805 | _recalc_want (ev_want_event, cb_object); |
|
|
806 | _recalc_want (ev_want_event, cb_client); |
|
|
807 | _recalc_want (ev_want_event, cb_player); |
|
|
808 | _recalc_want (ev_want_event, cb_map); |
|
|
809 | |
|
|
810 | ev_want_type.reset (); |
|
|
811 | |
|
|
812 | for (int type = 0; type <= AvFILLp (cb_type); ++type) |
|
|
813 | { |
|
|
814 | SV *cbs_ = AvARRAY (cb_type)[type]; |
|
|
815 | |
|
|
816 | // element must be list of callback entries |
|
|
817 | if (cbs_ && SvROK (cbs_) && SvTYPE (SvRV (cbs_)) == SVt_PVAV) |
|
|
818 | { |
|
|
819 | AV *cbs = (AV *)SvRV (cbs_); |
|
|
820 | |
|
|
821 | // no callback entries, no callbacks to call |
|
|
822 | if (AvFILLp (cbs) >= 0) |
|
|
823 | ev_want_type.set (type % NUM_TYPES); |
|
|
824 | } |
|
|
825 | } |
|
|
826 | } |
|
|
827 | |
776 | bool |
828 | bool |
777 | attachable::invoke (event_type event, ...) |
829 | attachable::invoke (event_type event, ...) |
778 | { |
830 | { |
779 | data_type dt; |
831 | data_type dt; |
780 | va_list ap; |
|
|
781 | |
|
|
782 | va_start (ap, event); |
|
|
783 | |
832 | |
784 | // callback call ordering should be: |
833 | // callback call ordering should be: |
785 | // 1. per-object callback |
834 | // 1. per-object callback |
786 | // 2. per-class object |
835 | // 2. per-class object |
787 | // 3. per-type callback |
836 | // 3. per-type callback |
… | |
… | |
791 | gather_callbacks (callbacks, event); |
840 | gather_callbacks (callbacks, event); |
792 | |
841 | |
793 | // short-circuit processing if no callbacks found/defined |
842 | // short-circuit processing if no callbacks found/defined |
794 | if (!callbacks) |
843 | if (!callbacks) |
795 | return 0; |
844 | return 0; |
|
|
845 | |
|
|
846 | va_list ap; |
|
|
847 | va_start (ap, event); |
796 | |
848 | |
797 | CALL_BEGIN (3); |
849 | CALL_BEGIN (3); |
798 | CALL_ARG_SV (newSViv (event)); // only used for debugging nowadays |
850 | CALL_ARG_SV (newSViv (event)); // only used for debugging nowadays |
799 | CALL_ARG_SV (newRV_noinc ((SV *)callbacks)); |
851 | CALL_ARG_SV (newRV_noinc ((SV *)callbacks)); |
800 | |
852 | |
… | |
… | |
874 | cfperl_cleanup (int make_core) |
926 | cfperl_cleanup (int make_core) |
875 | { |
927 | { |
876 | CALL_BEGIN (1); |
928 | CALL_BEGIN (1); |
877 | CALL_ARG (make_core); |
929 | CALL_ARG (make_core); |
878 | CALL_CALL ("cf::post_cleanup", G_VOID); |
930 | CALL_CALL ("cf::post_cleanup", G_VOID); |
|
|
931 | CALL_END; |
|
|
932 | } |
|
|
933 | |
|
|
934 | void |
|
|
935 | cfperl_make_book (object *book, int level) |
|
|
936 | { |
|
|
937 | CALL_BEGIN (2); |
|
|
938 | CALL_ARG (book); |
|
|
939 | CALL_ARG (level); |
|
|
940 | CALL_CALL ("ext::books::make_book", G_VOID); |
879 | CALL_END; |
941 | CALL_END; |
880 | } |
942 | } |
881 | |
943 | |
882 | maptile * |
944 | maptile * |
883 | maptile::find_sync (const char *path, maptile *origin) |
945 | maptile::find_sync (const char *path, maptile *origin) |
… | |
… | |
1171 | const_iv (CONTAINER) const_iv (ARMOUR_IMPROVER) const_iv (WEAPON_IMPROVER) const_iv (SKILLSCROLL) |
1233 | const_iv (CONTAINER) const_iv (ARMOUR_IMPROVER) const_iv (WEAPON_IMPROVER) const_iv (SKILLSCROLL) |
1172 | const_iv (DEEP_SWAMP) const_iv (IDENTIFY_ALTAR) const_iv (MENU) const_iv (RUNE) |
1234 | const_iv (DEEP_SWAMP) const_iv (IDENTIFY_ALTAR) const_iv (MENU) const_iv (RUNE) |
1173 | const_iv (TRAP) const_iv (POWER_CRYSTAL) const_iv (CORPSE) const_iv (DISEASE) |
1235 | const_iv (TRAP) const_iv (POWER_CRYSTAL) const_iv (CORPSE) const_iv (DISEASE) |
1174 | const_iv (SYMPTOM) const_iv (BUILDER) const_iv (MATERIAL) const_iv (ITEM_TRANSFORMER) |
1236 | const_iv (SYMPTOM) const_iv (BUILDER) const_iv (MATERIAL) const_iv (ITEM_TRANSFORMER) |
1175 | |
1237 | |
1176 | const_iv (NUM_SUBTYPES) |
1238 | const_iv (NUM_TYPES) const_iv (NUM_SUBTYPES) |
1177 | |
1239 | |
1178 | const_iv (ST_BD_BUILD) const_iv (ST_BD_REMOVE) |
1240 | const_iv (ST_BD_BUILD) const_iv (ST_BD_REMOVE) |
1179 | const_iv (ST_MAT_FLOOR) const_iv (ST_MAT_WALL) const_iv (ST_MAT_ITEM) |
1241 | const_iv (ST_MAT_FLOOR) const_iv (ST_MAT_WALL) const_iv (ST_MAT_ITEM) |
1180 | |
1242 | |
1181 | const_iv (AT_PHYSICAL) const_iv (AT_MAGIC) const_iv (AT_FIRE) const_iv (AT_ELECTRICITY) |
1243 | const_iv (AT_PHYSICAL) const_iv (AT_MAGIC) const_iv (AT_FIRE) const_iv (AT_ELECTRICITY) |
… | |
… | |
1189 | const_iv (WEAP_HIT) const_iv (WEAP_SLASH) const_iv (WEAP_PIERCE) const_iv (WEAP_CLEAVE) |
1251 | const_iv (WEAP_HIT) const_iv (WEAP_SLASH) const_iv (WEAP_PIERCE) const_iv (WEAP_CLEAVE) |
1190 | const_iv (WEAP_SLICE) const_iv (WEAP_STAB) const_iv (WEAP_WHIP) const_iv (WEAP_CRUSH) |
1252 | const_iv (WEAP_SLICE) const_iv (WEAP_STAB) const_iv (WEAP_WHIP) const_iv (WEAP_CRUSH) |
1191 | const_iv (WEAP_BLUD) |
1253 | const_iv (WEAP_BLUD) |
1192 | |
1254 | |
1193 | const_iv (FLAG_ALIVE) const_iv (FLAG_WIZ) const_iv (FLAG_REMOVED) const_iv (FLAG_FREED) |
1255 | const_iv (FLAG_ALIVE) const_iv (FLAG_WIZ) const_iv (FLAG_REMOVED) const_iv (FLAG_FREED) |
1194 | const_iv (FLAG_WAS_WIZ) const_iv (FLAG_APPLIED) const_iv (FLAG_UNPAID) const_iv (FLAG_USE_SHIELD) |
1256 | const_iv (FLAG_APPLIED) const_iv (FLAG_UNPAID) const_iv (FLAG_USE_SHIELD) |
1195 | const_iv (FLAG_NO_PICK) const_iv (FLAG_ANIMATE) const_iv (FLAG_MONSTER) const_iv (FLAG_FRIENDLY) |
1257 | const_iv (FLAG_NO_PICK) const_iv (FLAG_ANIMATE) const_iv (FLAG_MONSTER) const_iv (FLAG_FRIENDLY) |
1196 | const_iv (FLAG_GENERATOR) const_iv (FLAG_IS_THROWN) const_iv (FLAG_AUTO_APPLY) const_iv (FLAG_PLAYER_SOLD) |
1258 | const_iv (FLAG_GENERATOR) const_iv (FLAG_IS_THROWN) const_iv (FLAG_AUTO_APPLY) const_iv (FLAG_PLAYER_SOLD) |
1197 | const_iv (FLAG_SEE_INVISIBLE) const_iv (FLAG_CAN_ROLL) const_iv (FLAG_OVERLAY_FLOOR) const_iv (FLAG_IS_TURNABLE) |
1259 | const_iv (FLAG_SEE_INVISIBLE) const_iv (FLAG_CAN_ROLL) const_iv (FLAG_OVERLAY_FLOOR) const_iv (FLAG_IS_TURNABLE) |
1198 | const_iv (FLAG_IS_USED_UP) const_iv (FLAG_IDENTIFIED) const_iv (FLAG_REFLECTING) const_iv (FLAG_CHANGING) |
1260 | const_iv (FLAG_IS_USED_UP) const_iv (FLAG_IDENTIFIED) const_iv (FLAG_REFLECTING) const_iv (FLAG_CHANGING) |
1199 | const_iv (FLAG_SPLITTING) const_iv (FLAG_HITBACK) const_iv (FLAG_STARTEQUIP) const_iv (FLAG_BLOCKSVIEW) |
1261 | const_iv (FLAG_SPLITTING) const_iv (FLAG_HITBACK) const_iv (FLAG_STARTEQUIP) const_iv (FLAG_BLOCKSVIEW) |
… | |
… | |
1226 | const_iv (UPD_LOCATION) const_iv (UPD_FLAGS) const_iv (UPD_WEIGHT) const_iv (UPD_FACE) |
1288 | const_iv (UPD_LOCATION) const_iv (UPD_FLAGS) const_iv (UPD_WEIGHT) const_iv (UPD_FACE) |
1227 | const_iv (UPD_NAME) const_iv (UPD_ANIM) const_iv (UPD_ANIMSPEED) const_iv (UPD_NROF) |
1289 | const_iv (UPD_NAME) const_iv (UPD_ANIM) const_iv (UPD_ANIMSPEED) const_iv (UPD_NROF) |
1228 | |
1290 | |
1229 | const_iv (UPD_SP_MANA) const_iv (UPD_SP_GRACE) const_iv (UPD_SP_DAMAGE) |
1291 | const_iv (UPD_SP_MANA) const_iv (UPD_SP_GRACE) const_iv (UPD_SP_DAMAGE) |
1230 | |
1292 | |
|
|
1293 | const_iv (SP_RAISE_DEAD) |
|
|
1294 | const_iv (SP_RUNE) |
|
|
1295 | const_iv (SP_MAKE_MARK) |
|
|
1296 | const_iv (SP_BOLT) |
|
|
1297 | const_iv (SP_BULLET) |
|
|
1298 | const_iv (SP_EXPLOSION) |
|
|
1299 | const_iv (SP_CONE) |
|
|
1300 | const_iv (SP_BOMB) |
|
|
1301 | const_iv (SP_WONDER) |
|
|
1302 | const_iv (SP_SMITE) |
|
|
1303 | const_iv (SP_MAGIC_MISSILE) |
|
|
1304 | const_iv (SP_SUMMON_GOLEM) |
|
|
1305 | const_iv (SP_DIMENSION_DOOR) |
|
|
1306 | const_iv (SP_MAGIC_MAPPING) |
|
|
1307 | const_iv (SP_MAGIC_WALL) |
|
|
1308 | const_iv (SP_DESTRUCTION) |
|
|
1309 | const_iv (SP_PERCEIVE_SELF) |
|
|
1310 | const_iv (SP_WORD_OF_RECALL) |
|
|
1311 | const_iv (SP_INVISIBLE) |
|
|
1312 | const_iv (SP_PROBE) |
|
|
1313 | const_iv (SP_HEALING) |
|
|
1314 | const_iv (SP_CREATE_FOOD) |
|
|
1315 | const_iv (SP_EARTH_TO_DUST) |
|
|
1316 | const_iv (SP_CHANGE_ABILITY) |
|
|
1317 | const_iv (SP_BLESS) |
|
|
1318 | const_iv (SP_CURSE) |
|
|
1319 | const_iv (SP_SUMMON_MONSTER) |
|
|
1320 | const_iv (SP_CHARGING) |
|
|
1321 | const_iv (SP_POLYMORPH) |
|
|
1322 | const_iv (SP_ALCHEMY) |
|
|
1323 | const_iv (SP_REMOVE_CURSE) |
|
|
1324 | const_iv (SP_IDENTIFY) |
|
|
1325 | const_iv (SP_DETECTION) |
|
|
1326 | const_iv (SP_MOOD_CHANGE) |
|
|
1327 | const_iv (SP_MOVING_BALL) |
|
|
1328 | const_iv (SP_SWARM) |
|
|
1329 | const_iv (SP_CHANGE_MANA) |
|
|
1330 | const_iv (SP_DISPEL_RUNE) |
|
|
1331 | const_iv (SP_CREATE_MISSILE) |
|
|
1332 | const_iv (SP_CONSECRATE) |
|
|
1333 | const_iv (SP_ANIMATE_WEAPON) |
|
|
1334 | const_iv (SP_LIGHT) |
|
|
1335 | const_iv (SP_CHANGE_MAP_LIGHT) |
|
|
1336 | const_iv (SP_FAERY_FIRE) |
|
|
1337 | const_iv (SP_CAUSE_DISEASE) |
|
|
1338 | const_iv (SP_AURA) |
|
|
1339 | const_iv (SP_TOWN_PORTAL) |
|
|
1340 | const_iv (SP_PARTY_SPELL) |
|
|
1341 | |
1231 | const_iv (F_APPLIED) const_iv (F_LOCATION) const_iv (F_UNPAID) const_iv (F_MAGIC) |
1342 | const_iv (F_APPLIED) const_iv (F_LOCATION) const_iv (F_UNPAID) const_iv (F_MAGIC) |
1232 | const_iv (F_CURSED) const_iv (F_DAMNED) const_iv (F_OPEN) const_iv (F_NOPICK) |
1343 | const_iv (F_CURSED) const_iv (F_DAMNED) const_iv (F_OPEN) const_iv (F_NOPICK) |
1233 | const_iv (F_LOCKED) |
1344 | const_iv (F_LOCKED) |
1234 | |
1345 | |
1235 | const_iv (F_BUY) const_iv (F_SHOP) const_iv (F_SELL) |
1346 | const_iv (F_BUY) const_iv (F_SHOP) const_iv (F_SELL) |
… | |
… | |
1336 | newCONSTSUB (stash_cf, (char *)eiv->name, newSViv (eiv->iv)); |
1447 | newCONSTSUB (stash_cf, (char *)eiv->name, newSViv (eiv->iv)); |
1337 | } |
1448 | } |
1338 | } |
1449 | } |
1339 | |
1450 | |
1340 | void _connect_to_perl () |
1451 | void _connect_to_perl () |
|
|
1452 | |
|
|
1453 | void _recalc_want () |
1341 | |
1454 | |
1342 | void _global_reattach () |
1455 | void _global_reattach () |
1343 | CODE: |
1456 | CODE: |
1344 | { |
1457 | { |
1345 | // reattach to all attachable objects in the game. |
1458 | // reattach to all attachable objects in the game. |
… | |
… | |
1629 | object *actives (U32 index) |
1742 | object *actives (U32 index) |
1630 | CODE: |
1743 | CODE: |
1631 | RETVAL = index < actives.size () ? actives [index] : 0; |
1744 | RETVAL = index < actives.size () ? actives [index] : 0; |
1632 | OUTPUT: RETVAL |
1745 | OUTPUT: RETVAL |
1633 | |
1746 | |
1634 | const char *slot_save_name (U32 slot) |
1747 | const char *slot_use_name (U32 slot) |
1635 | ALIAS: |
1748 | ALIAS: |
1636 | slot_use_name = 1 |
|
|
1637 | slot_nonuse_name = 2 |
1749 | slot_nonuse_name = 1 |
1638 | CODE: |
1750 | CODE: |
1639 | { |
1751 | { |
1640 | if (slot >= NUM_BODY_LOCATIONS) |
1752 | if (slot >= NUM_BODY_LOCATIONS) |
1641 | croak ("body slot index out of range"); |
1753 | croak ("body slot index out of range"); |
1642 | |
1754 | |
1643 | switch (ix) |
1755 | switch (ix) |
1644 | { |
1756 | { |
1645 | case 0: RETVAL = body_locations[slot].save_name; break; |
|
|
1646 | case 1: RETVAL = body_locations[slot].use_name; break; |
1757 | case 0: RETVAL = body_locations[slot].use_name; break; |
1647 | case 2: RETVAL = body_locations[slot].nonuse_name; break; |
1758 | case 1: RETVAL = body_locations[slot].nonuse_name; break; |
1648 | } |
1759 | } |
1649 | } |
1760 | } |
1650 | OUTPUT: |
1761 | OUTPUT: |
1651 | RETVAL |
1762 | RETVAL |
1652 | |
1763 | |
… | |
… | |
1891 | void check_score (object *op) |
2002 | void check_score (object *op) |
1892 | |
2003 | |
1893 | void message (object *op, utf8_string txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
2004 | void message (object *op, utf8_string txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
1894 | CODE: |
2005 | CODE: |
1895 | new_draw_info (flags, 0, op, txt); |
2006 | new_draw_info (flags, 0, op, txt); |
1896 | |
|
|
1897 | object *cf_player_send_inventory (object *op) |
|
|
1898 | |
|
|
1899 | octet_string cf_player_get_ip (object *op) |
|
|
1900 | ALIAS: ip = 0 |
|
|
1901 | |
|
|
1902 | object *cf_player_get_marked_item (object *op) |
|
|
1903 | ALIAS: marked_item = 0 |
|
|
1904 | |
|
|
1905 | void cf_player_set_marked_item (object *op, object *ob) |
|
|
1906 | |
|
|
1907 | partylist *cf_player_get_party (object *op) |
|
|
1908 | ALIAS: party = 0 |
|
|
1909 | |
|
|
1910 | void cf_player_set_party (object *op, partylist *party) |
|
|
1911 | |
2007 | |
1912 | void kill_player (object *op) |
2008 | void kill_player (object *op) |
1913 | |
2009 | |
1914 | void esrv_update_item (object *op, int what, object *item) |
2010 | void esrv_update_item (object *op, int what, object *item) |
1915 | C_ARGS: what, op, item |
2011 | C_ARGS: what, op, item |
… | |
… | |
2301 | rmp.decoroptions = decoroptions; |
2397 | rmp.decoroptions = decoroptions; |
2302 | rmp.orientation = orientation; |
2398 | rmp.orientation = orientation; |
2303 | rmp.origin_y = origin_y; |
2399 | rmp.origin_y = origin_y; |
2304 | rmp.origin_x = origin_x; |
2400 | rmp.origin_x = origin_x; |
2305 | rmp.random_seed = random_seed; |
2401 | rmp.random_seed = random_seed; |
2306 | rmp.total_map_hp = total_map_hp; |
2402 | rmp.total_map_hp = (uint64_t) total_map_hp; |
2307 | rmp.map_layout_style = map_layout_style; |
2403 | rmp.map_layout_style = map_layout_style; |
2308 | rmp.treasureoptions = treasureoptions; |
2404 | rmp.treasureoptions = treasureoptions; |
2309 | rmp.symmetry_used = symmetry_used; |
2405 | rmp.symmetry_used = symmetry_used; |
2310 | rmp.region = region; |
2406 | rmp.region = region; |
2311 | rmp.custom = custom; |
2407 | rmp.custom = custom; |
… | |
… | |
2326 | archetype *first() |
2422 | archetype *first() |
2327 | PROTOTYPE: |
2423 | PROTOTYPE: |
2328 | CODE: |
2424 | CODE: |
2329 | RETVAL = first_archetype; |
2425 | RETVAL = first_archetype; |
2330 | OUTPUT: RETVAL |
2426 | OUTPUT: RETVAL |
|
|
2427 | |
|
|
2428 | object *instantiate (archetype *arch) |
|
|
2429 | CODE: |
|
|
2430 | RETVAL = arch_to_object (arch); |
|
|
2431 | OUTPUT: |
|
|
2432 | RETVAL |
2331 | |
2433 | |
2332 | INCLUDE: $PERL $srcdir/genacc archetype ../include/object.h | |
2434 | INCLUDE: $PERL $srcdir/genacc archetype ../include/object.h | |
2333 | |
2435 | |
2334 | MODULE = cf PACKAGE = cf::party |
2436 | MODULE = cf PACKAGE = cf::party |
2335 | |
2437 | |