1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_player_c = |
|
|
4 | * "$Id: player.C,v 1.18 2006/09/10 15:59:57 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The author can be reached via e-mail to crossfire-devel@real-time.com |
21 | The author can be reached via e-mail to <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | #include <global.h> |
24 | #include <global.h> |
31 | #ifndef WIN32 /* ---win32 remove headers */ |
25 | #ifndef WIN32 /* ---win32 remove headers */ |
32 | # include <pwd.h> |
26 | # include <pwd.h> |
… | |
… | |
285 | p->peaceful = 1; /* default peaceful */ |
279 | p->peaceful = 1; /* default peaceful */ |
286 | p->do_los = 1; |
280 | p->do_los = 1; |
287 | p->explore = 0; |
281 | p->explore = 0; |
288 | p->no_shout = 0; /* default can shout */ |
282 | p->no_shout = 0; /* default can shout */ |
289 | |
283 | |
290 | strncpy (p->title, op->arch->clone.name, sizeof (p->title) - 1); |
284 | assign (p->title, op->arch->clone.name); |
291 | p->title[sizeof (p->title) - 1] = '\0'; |
|
|
292 | op->race = op->arch->clone.race; |
285 | op->race = op->arch->clone.race; |
293 | |
286 | |
294 | CLEAR_FLAG (op, FLAG_READY_SKILL); |
287 | CLEAR_FLAG (op, FLAG_READY_SKILL); |
295 | |
288 | |
296 | /* we need to clear these to -1 and not zero - otherwise, |
289 | /* we need to clear these to -1 and not zero - otherwise, |
… | |
… | |
756 | * the map is null or not swapped out. |
749 | * the map is null or not swapped out. |
757 | */ |
750 | */ |
758 | op->map = NULL; |
751 | op->map = NULL; |
759 | } |
752 | } |
760 | |
753 | |
761 | |
|
|
762 | int |
754 | int |
763 | receive_play_again (object *op, char key) |
755 | receive_play_again (object *op, char key) |
764 | { |
756 | { |
765 | if (key == 'q' || key == 'Q') |
757 | if (key == 'q' || key == 'Q') |
766 | { |
758 | { |
… | |
… | |
771 | else if (key == 'a' || key == 'A') |
763 | else if (key == 'a' || key == 'A') |
772 | { |
764 | { |
773 | player *pl = op->contr; |
765 | player *pl = op->contr; |
774 | shstr name = op->name; |
766 | shstr name = op->name; |
775 | |
767 | |
776 | remove_friendly_object (op); |
768 | op->contr = 0; |
777 | free_object (op); |
769 | op->type = 0; |
|
|
770 | op->free (1); |
778 | pl = get_player (pl); |
771 | pl = get_player (pl); |
779 | op = pl->ob; |
772 | op = pl->ob; |
780 | add_friendly_object (op); |
773 | add_friendly_object (op); |
781 | op->contr->password[0] = '~'; |
774 | op->contr->password[0] = '~'; |
782 | op->name = op->name_pl = 0; |
775 | op->name = op->name_pl = 0; |
… | |
… | |
785 | get_name (op); |
778 | get_name (op); |
786 | op->name = op->name_pl = name; |
779 | op->name = op->name_pl = name; |
787 | set_first_map (op); |
780 | set_first_map (op); |
788 | } |
781 | } |
789 | else |
782 | else |
790 | { |
|
|
791 | /* user pressed something else so just ask again... */ |
783 | /* user pressed something else so just ask again... */ |
792 | play_again (op); |
784 | play_again (op); |
793 | } |
785 | |
794 | return 0; |
786 | return 0; |
795 | } |
787 | } |
796 | |
788 | |
797 | void |
789 | void |
798 | confirm_password (object *op) |
790 | confirm_password (object *op) |
… | |
… | |
1001 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, ""); |
993 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, ""); |
1002 | return 1; |
994 | return 1; |
1003 | } |
995 | } |
1004 | switch (key) |
996 | switch (key) |
1005 | { |
997 | { |
1006 | case 'n': |
998 | case 'n': |
1007 | case 'N': |
999 | case 'N': |
1008 | { |
1000 | { |
1009 | SET_FLAG (op, FLAG_WIZ); |
1001 | SET_FLAG (op, FLAG_WIZ); |
1010 | if (op->map == NULL) |
1002 | if (op->map == NULL) |
1011 | { |
1003 | { |
1012 | LOG (llevError, "Map == NULL in state 2\n"); |
1004 | LOG (llevError, "Map == NULL in state 2\n"); |
1013 | break; |
1005 | break; |
1014 | } |
1006 | } |
1015 | |
1007 | |
1016 | #if 0 |
1008 | #if 0 |
1017 | /* So that enter_exit will put us at startx/starty */ |
1009 | /* So that enter_exit will put us at startx/starty */ |
1018 | op->x = -1; |
1010 | op->x = -1; |
1019 | |
1011 | |
1020 | enter_exit (op, NULL); |
1012 | enter_exit (op, NULL); |
1021 | #endif |
1013 | #endif |
1022 | SET_ANIMATION (op, 2); /* So player faces south */ |
1014 | SET_ANIMATION (op, 2); /* So player faces south */ |
1023 | /* Enter exit adds a player otherwise */ |
1015 | /* Enter exit adds a player otherwise */ |
1024 | add_statbonus (op); |
1016 | add_statbonus (op); |
1025 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, |
1017 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, |
1026 | "Now choose a character.\nPress any key to change outlook.\nPress `d' when you're pleased.\n"); |
1018 | "Now choose a character.\nPress any key to change outlook.\nPress `d' when you're pleased.\n"); |
1027 | op->contr->state = ST_CHANGE_CLASS; |
1019 | op->contr->state = ST_CHANGE_CLASS; |
1028 | if (op->msg) |
1020 | if (op->msg) |
1029 | new_draw_info (NDI_BLUE, 0, op, op->msg); |
1021 | new_draw_info (NDI_BLUE, 0, op, op->msg); |
1030 | return 0; |
|
|
1031 | } |
|
|
1032 | case 'y': |
|
|
1033 | case 'Y': |
|
|
1034 | roll_stats (op); |
|
|
1035 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, ""); |
|
|
1036 | return 1; |
|
|
1037 | |
|
|
1038 | case 'q': |
|
|
1039 | case 'Q': |
|
|
1040 | play_again (op); |
|
|
1041 | return 1; |
|
|
1042 | |
|
|
1043 | default: |
|
|
1044 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, "Yes, No, Quit or 1-6. Roll again?"); |
|
|
1045 | return 0; |
1022 | return 0; |
|
|
1023 | } |
|
|
1024 | case 'y': |
|
|
1025 | case 'Y': |
|
|
1026 | roll_stats (op); |
|
|
1027 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, ""); |
|
|
1028 | return 1; |
|
|
1029 | |
|
|
1030 | case 'q': |
|
|
1031 | case 'Q': |
|
|
1032 | play_again (op); |
|
|
1033 | return 1; |
|
|
1034 | |
|
|
1035 | default: |
|
|
1036 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, "Yes, No, Quit or 1-6. Roll again?"); |
|
|
1037 | return 0; |
1046 | } |
1038 | } |
1047 | return 0; |
1039 | return 0; |
1048 | } |
1040 | } |
1049 | |
1041 | |
1050 | /* This function takes the key that is passed, and does the |
1042 | /* This function takes the key that is passed, and does the |
… | |
… | |
1141 | op->name = op->name_pl = name; |
1133 | op->name = op->name_pl = name; |
1142 | op->x = x; |
1134 | op->x = x; |
1143 | op->y = y; |
1135 | op->y = y; |
1144 | SET_ANIMATION (op, 2); /* So player faces south */ |
1136 | SET_ANIMATION (op, 2); /* So player faces south */ |
1145 | insert_ob_in_map (op, op->map, op, 0); |
1137 | insert_ob_in_map (op, op->map, op, 0); |
1146 | strncpy (op->contr->title, op->arch->clone.name, sizeof (op->contr->title) - 1); |
1138 | assign (op->contr->title, op->arch->clone.name); |
1147 | op->contr->title[sizeof (op->contr->title) - 1] = '\0'; |
|
|
1148 | add_statbonus (op); |
1139 | add_statbonus (op); |
1149 | tmp_loop = allowed_class (op); |
1140 | tmp_loop = allowed_class (op); |
1150 | } |
1141 | } |
|
|
1142 | |
1151 | update_object (op, UP_OBJ_FACE); |
1143 | update_object (op, UP_OBJ_FACE); |
1152 | esrv_update_item (UPD_FACE, op, op); |
1144 | esrv_update_item (UPD_FACE, op, op); |
1153 | fix_player (op); |
1145 | fix_player (op); |
1154 | op->stats.hp = op->stats.maxhp; |
1146 | op->stats.hp = op->stats.maxhp; |
1155 | op->stats.sp = op->stats.maxsp; |
1147 | op->stats.sp = op->stats.maxsp; |
1156 | op->stats.grace = 0; |
1148 | op->stats.grace = 0; |
|
|
1149 | |
1157 | if (op->msg) |
1150 | if (op->msg) |
1158 | new_draw_info (NDI_BLUE, 0, op, op->msg); |
1151 | new_draw_info (NDI_BLUE, 0, op, op->msg); |
|
|
1152 | |
1159 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, "Press any key for the next race.\nPress `d' to play this race.\n"); |
1153 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, "Press any key for the next race.\nPress `d' to play this race.\n"); |
1160 | return 0; |
1154 | return 0; |
1161 | } |
1155 | } |
1162 | |
1156 | |
1163 | int |
1157 | int |
… | |
… | |
1202 | delete_map (mp); |
1196 | delete_map (mp); |
1203 | } |
1197 | } |
1204 | |
1198 | |
1205 | delete_character (op->name, 1); |
1199 | delete_character (op->name, 1); |
1206 | } |
1200 | } |
|
|
1201 | |
1207 | play_again (op); |
1202 | play_again (op); |
1208 | return 1; |
1203 | return 1; |
1209 | } |
1204 | } |
1210 | |
1205 | |
1211 | void |
1206 | void |
… | |
… | |
1312 | /* high not bit set? We're using the old autopickup model */ |
1307 | /* high not bit set? We're using the old autopickup model */ |
1313 | if (!(op->contr->mode & PU_NEWMODE)) |
1308 | if (!(op->contr->mode & PU_NEWMODE)) |
1314 | { |
1309 | { |
1315 | switch (op->contr->mode) |
1310 | switch (op->contr->mode) |
1316 | { |
1311 | { |
1317 | case 0: |
1312 | case 0: |
1318 | return 1; /* don't pick up */ |
1313 | return 1; /* don't pick up */ |
1319 | case 1: |
1314 | case 1: |
|
|
1315 | pick_up (op, tmp); |
|
|
1316 | return 1; |
|
|
1317 | case 2: |
|
|
1318 | pick_up (op, tmp); |
|
|
1319 | return 0; |
|
|
1320 | case 3: |
|
|
1321 | return 0; /* stop before pickup */ |
|
|
1322 | case 4: |
|
|
1323 | pick_up (op, tmp); |
|
|
1324 | break; |
|
|
1325 | case 5: |
|
|
1326 | pick_up (op, tmp); |
|
|
1327 | stop = 1; |
|
|
1328 | break; |
|
|
1329 | case 6: |
|
|
1330 | if (QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED)) |
1320 | pick_up (op, tmp); |
1331 | pick_up (op, tmp); |
1321 | return 1; |
1332 | break; |
|
|
1333 | |
1322 | case 2: |
1334 | case 7: |
|
|
1335 | if (tmp->type == MONEY || tmp->type == GEM) |
1323 | pick_up (op, tmp); |
1336 | pick_up (op, tmp); |
1324 | return 0; |
1337 | break; |
1325 | case 3: |
1338 | |
1326 | return 0; /* stop before pickup */ |
1339 | default: |
1327 | case 4: |
1340 | /* use value density */ |
|
|
1341 | if (!QUERY_FLAG (tmp, FLAG_UNPAID) |
|
|
1342 | && (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1))) >= op->contr->mode) |
1328 | pick_up (op, tmp); |
1343 | pick_up (op, tmp); |
1329 | break; |
|
|
1330 | case 5: |
|
|
1331 | pick_up (op, tmp); |
|
|
1332 | stop = 1; |
|
|
1333 | break; |
|
|
1334 | case 6: |
|
|
1335 | if (QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED)) |
|
|
1336 | pick_up (op, tmp); |
|
|
1337 | break; |
|
|
1338 | |
|
|
1339 | case 7: |
|
|
1340 | if (tmp->type == MONEY || tmp->type == GEM) |
|
|
1341 | pick_up (op, tmp); |
|
|
1342 | break; |
|
|
1343 | |
|
|
1344 | default: |
|
|
1345 | /* use value density */ |
|
|
1346 | if (!QUERY_FLAG (tmp, FLAG_UNPAID) |
|
|
1347 | && (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1))) >= op->contr->mode) |
|
|
1348 | pick_up (op, tmp); |
|
|
1349 | } |
1344 | } |
1350 | } |
1345 | } |
1351 | else |
1346 | else |
1352 | { /* old model */ |
1347 | { /* old model */ |
1353 | /* NEW pickup handling */ |
1348 | /* NEW pickup handling */ |
… | |
… | |
2125 | if (action_makes_visible (op)) |
2120 | if (action_makes_visible (op)) |
2126 | make_visible (op); |
2121 | make_visible (op); |
2127 | |
2122 | |
2128 | switch (op->contr->shoottype) |
2123 | switch (op->contr->shoottype) |
2129 | { |
2124 | { |
2130 | case range_none: |
2125 | case range_none: |
2131 | return; |
2126 | return; |
2132 | |
2127 | |
2133 | case range_bow: |
2128 | case range_bow: |
2134 | player_fire_bow (op, dir); |
2129 | player_fire_bow (op, dir); |
2135 | return; |
2130 | return; |
2136 | |
2131 | |
2137 | case range_magic: /* Casting spells */ |
2132 | case range_magic: /* Casting spells */ |
2138 | spellcost = (cast_spell (op, op, dir, op->contr->ranges[range_magic], op->contr->spellparam[0] ? op->contr->spellparam : NULL)); |
2133 | spellcost = (cast_spell (op, op, dir, op->contr->ranges[range_magic], op->contr->spellparam[0] ? op->contr->spellparam : 0)); |
2139 | return; |
2134 | return; |
2140 | |
2135 | |
2141 | case range_misc: |
2136 | case range_misc: |
2142 | fire_misc_object (op, dir); |
2137 | fire_misc_object (op, dir); |
2143 | return; |
2138 | return; |
2144 | |
2139 | |
2145 | case range_golem: /* Control summoned monsters from scrolls */ |
2140 | case range_golem: /* Control summoned monsters from scrolls */ |
2146 | if (op->contr->ranges[range_golem] == NULL || op->contr->golem_count != op->contr->ranges[range_golem]->count) |
2141 | if (op->contr->ranges[range_golem] == NULL || op->contr->golem_count != op->contr->ranges[range_golem]->count) |
2147 | { |
2142 | { |
2148 | op->contr->ranges[range_golem] = NULL; |
2143 | op->contr->ranges[range_golem] = NULL; |
2149 | op->contr->shoottype = range_none; |
2144 | op->contr->shoottype = range_none; |
2150 | op->contr->golem_count = 0; |
2145 | op->contr->golem_count = 0; |
2151 | } |
2146 | } |
2152 | else |
2147 | else |
2153 | control_golem (op->contr->ranges[range_golem], dir); |
2148 | control_golem (op->contr->ranges[range_golem], dir); |
2154 | return; |
2149 | return; |
2155 | |
2150 | |
2156 | case range_skill: |
2151 | case range_skill: |
2157 | if (!op->chosen_skill) |
2152 | if (!op->chosen_skill) |
2158 | { |
2153 | { |
2159 | if (op->type == PLAYER) |
2154 | if (op->type == PLAYER) |
2160 | new_draw_info (NDI_UNIQUE, 0, op, "You have no applicable skill to use."); |
2155 | new_draw_info (NDI_UNIQUE, 0, op, "You have no applicable skill to use."); |
2161 | return; |
2156 | return; |
2162 | } |
2157 | } |
2163 | (void) do_skill (op, op, op->chosen_skill, dir, NULL); |
2158 | (void) do_skill (op, op, op->chosen_skill, dir, NULL); |
2164 | return; |
2159 | return; |
2165 | case range_builder: |
2160 | case range_builder: |
2166 | apply_map_builder (op, dir); |
2161 | apply_map_builder (op, dir); |
2167 | return; |
2162 | return; |
2168 | default: |
2163 | default: |
2169 | new_draw_info (NDI_UNIQUE, 0, op, "Illegal shoot type."); |
2164 | new_draw_info (NDI_UNIQUE, 0, op, "Illegal shoot type."); |
2170 | return; |
2165 | return; |
2171 | } |
2166 | } |
2172 | } |
2167 | } |
2173 | |
2168 | |
2174 | |
2169 | |
2175 | |
2170 | |
… | |
… | |
2982 | { |
2977 | { |
2983 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "You have been defeated in combat!"); |
2978 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "You have been defeated in combat!"); |
2984 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "Local medics have saved your life..."); |
2979 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "Local medics have saved your life..."); |
2985 | |
2980 | |
2986 | /* restore player */ |
2981 | /* restore player */ |
2987 | at = find_archetype ("poisoning"); |
2982 | at = archetype::find ("poisoning"); |
2988 | tmp = present_arch_in_ob (at, op); |
2983 | tmp = present_arch_in_ob (at, op); |
2989 | if (tmp) |
2984 | if (tmp) |
2990 | { |
2985 | { |
2991 | remove_ob (tmp); |
2986 | remove_ob (tmp); |
2992 | free_object (tmp); |
2987 | free_object (tmp); |
2993 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
2988 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
2994 | } |
2989 | } |
2995 | |
2990 | |
2996 | at = find_archetype ("confusion"); |
2991 | at = archetype::find ("confusion"); |
2997 | tmp = present_arch_in_ob (at, op); |
2992 | tmp = present_arch_in_ob (at, op); |
2998 | if (tmp) |
2993 | if (tmp) |
2999 | { |
2994 | { |
3000 | remove_ob (tmp); |
2995 | remove_ob (tmp); |
3001 | free_object (tmp); |
2996 | free_object (tmp); |
… | |
… | |
3006 | op->stats.hp = op->stats.maxhp; |
3001 | op->stats.hp = op->stats.maxhp; |
3007 | if (op->stats.food <= 0) |
3002 | if (op->stats.food <= 0) |
3008 | op->stats.food = 999; |
3003 | op->stats.food = 999; |
3009 | |
3004 | |
3010 | /* create a bodypart-trophy to make the winner happy */ |
3005 | /* create a bodypart-trophy to make the winner happy */ |
3011 | tmp = arch_to_object (find_archetype ("finger")); |
3006 | tmp = arch_to_object (archetype::find ("finger")); |
3012 | if (tmp != NULL) |
3007 | if (tmp != NULL) |
3013 | { |
3008 | { |
3014 | sprintf (buf, "%s's finger", &op->name); |
3009 | sprintf (buf, "%s's finger", &op->name); |
3015 | tmp->name = buf; |
3010 | tmp->name = buf; |
3016 | sprintf (buf, " This finger has been cut off %s\n" |
3011 | sprintf (buf, " This finger has been cut off %s\n" |
… | |
… | |
3113 | lost_a_stat = 1; |
3108 | lost_a_stat = 1; |
3114 | } |
3109 | } |
3115 | else |
3110 | else |
3116 | { |
3111 | { |
3117 | /* deplete a stat */ |
3112 | /* deplete a stat */ |
3118 | archetype *deparch = find_archetype ("depletion"); |
3113 | archetype *deparch = archetype::find ("depletion"); |
3119 | object *dep; |
3114 | object *dep; |
3120 | |
3115 | |
3121 | dep = present_arch_in_ob (deparch, op); |
3116 | dep = present_arch_in_ob (deparch, op); |
3122 | if (!dep) |
3117 | if (!dep) |
3123 | { |
3118 | { |
… | |
… | |
3193 | new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you" " feel a holy presence protecting you from losing yourself completely."); |
3188 | new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you" " feel a holy presence protecting you from losing yourself completely."); |
3194 | |
3189 | |
3195 | /* Put a gravestone up where the character 'almost' died. List the |
3190 | /* Put a gravestone up where the character 'almost' died. List the |
3196 | * exp loss on the stone. |
3191 | * exp loss on the stone. |
3197 | */ |
3192 | */ |
3198 | tmp = arch_to_object (find_archetype ("gravestone")); |
3193 | tmp = arch_to_object (archetype::find ("gravestone")); |
3199 | sprintf (buf, "%s's gravestone", &op->name); |
3194 | sprintf (buf, "%s's gravestone", &op->name); |
3200 | tmp->name = buf; |
3195 | tmp->name = buf; |
3201 | sprintf (buf, "%s's gravestones", &op->name); |
3196 | sprintf (buf, "%s's gravestones", &op->name); |
3202 | tmp->name_pl = buf; |
3197 | tmp->name_pl = buf; |
3203 | sprintf (buf, "RIP\nHere rests the hero %s the %s,\n" "who was killed\n" "by %s.\n", &op->name, op->contr->title, op->contr->killer); |
3198 | sprintf (buf, "RIP\nHere rests the hero %s the %s,\n" "who was killed\n" "by %s.\n", &op->name, op->contr->title, op->contr->killer); |
… | |
… | |
3214 | |
3209 | |
3215 | /**************************************/ |
3210 | /**************************************/ |
3216 | |
3211 | |
3217 | /* remove any poisoning and confusion the character may be suffering. */ |
3212 | /* remove any poisoning and confusion the character may be suffering. */ |
3218 | /* restore player */ |
3213 | /* restore player */ |
3219 | at = find_archetype ("poisoning"); |
3214 | at = archetype::find ("poisoning"); |
3220 | tmp = present_arch_in_ob (at, op); |
3215 | tmp = present_arch_in_ob (at, op); |
3221 | if (tmp) |
3216 | if (tmp) |
3222 | { |
3217 | { |
3223 | remove_ob (tmp); |
3218 | remove_ob (tmp); |
3224 | free_object (tmp); |
3219 | free_object (tmp); |
3225 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
3220 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
3226 | } |
3221 | } |
3227 | |
3222 | |
3228 | at = find_archetype ("confusion"); |
3223 | at = archetype::find ("confusion"); |
3229 | tmp = present_arch_in_ob (at, op); |
3224 | tmp = present_arch_in_ob (at, op); |
3230 | if (tmp) |
3225 | if (tmp) |
3231 | { |
3226 | { |
3232 | remove_ob (tmp); |
3227 | remove_ob (tmp); |
3233 | free_object (tmp); |
3228 | free_object (tmp); |
… | |
… | |
3296 | } |
3291 | } |
3297 | insert_ob_in_ob (force, op); |
3292 | insert_ob_in_ob (force, op); |
3298 | fix_player (op); |
3293 | fix_player (op); |
3299 | |
3294 | |
3300 | } |
3295 | } |
3301 | |
|
|
3302 | /**************************************/ |
|
|
3303 | /* */ |
|
|
3304 | /* Repaint the characters inv, and */ |
|
|
3305 | /* stats, and show a nasty message ;) */ |
|
|
3306 | /* */ |
|
|
3307 | |
|
|
3308 | /**************************************/ |
|
|
3309 | |
3296 | |
3310 | new_draw_info (NDI_UNIQUE, 0, op, "YOU HAVE DIED."); |
3297 | new_draw_info (NDI_UNIQUE, 0, op, "YOU HAVE DIED."); |
3311 | return; |
3298 | return; |
3312 | } /* NOT_PERMADETH */ |
3299 | } /* NOT_PERMADETH */ |
3313 | else |
3300 | else |
… | |
… | |
3357 | op->map = map; |
3344 | op->map = map; |
3358 | /* please see resurrection.c: peterm */ |
3345 | /* please see resurrection.c: peterm */ |
3359 | dead_player (op); |
3346 | dead_player (op); |
3360 | } |
3347 | } |
3361 | else |
3348 | else |
3362 | { |
|
|
3363 | delete_character (op->name, 1); |
3349 | delete_character (op->name, 1); |
3364 | } |
3350 | } |
3365 | } |
3351 | |
3366 | play_again (op); |
3352 | play_again (op); |
3367 | |
3353 | |
3368 | /* peterm: added to create a corpse at deathsite. */ |
3354 | /* peterm: added to create a corpse at deathsite. */ |
3369 | tmp = arch_to_object (find_archetype ("corpse_pl")); |
3355 | tmp = arch_to_object (archetype::find ("corpse_pl")); |
3370 | sprintf (buf, "%s", &op->name); |
3356 | sprintf (buf, "%s", &op->name); |
3371 | tmp->name = tmp->name_pl = buf; |
3357 | tmp->name = tmp->name_pl = buf; |
3372 | tmp->level = op->level; |
3358 | tmp->level = op->level; |
3373 | tmp->x = x; |
3359 | tmp->x = x; |
3374 | tmp->y = y; |
3360 | tmp->y = y; |