… | |
… | |
217 | default: |
217 | default: |
218 | if (op->env != NULL) |
218 | if (op->env != NULL) |
219 | { |
219 | { |
220 | CLEAR_FLAG (op, FLAG_APPLIED); |
220 | CLEAR_FLAG (op, FLAG_APPLIED); |
221 | change_abil (op->env, op); |
221 | change_abil (op->env, op); |
222 | fix_player (op->env); |
222 | op->env->update_stats (); |
223 | } |
223 | } |
224 | } |
224 | } |
225 | |
225 | |
226 | op->destroy (); |
226 | op->destroy (); |
227 | } |
227 | } |
… | |
… | |
235 | CLEAR_FLAG (op, FLAG_APPLIED); |
235 | CLEAR_FLAG (op, FLAG_APPLIED); |
236 | |
236 | |
237 | if (op->env != NULL) |
237 | if (op->env != NULL) |
238 | { |
238 | { |
239 | change_abil (op->env, op); |
239 | change_abil (op->env, op); |
240 | fix_player (op->env); |
240 | op->env->update_stats (); |
241 | } |
241 | } |
242 | |
242 | |
243 | op->destroy (); |
243 | op->destroy (); |
244 | } |
244 | } |
245 | |
245 | |
… | |
… | |
258 | * will not do anything. |
258 | * will not do anything. |
259 | */ |
259 | */ |
260 | if (op->env->type == PLAYER) |
260 | if (op->env->type == PLAYER) |
261 | { |
261 | { |
262 | CLEAR_FLAG (op, FLAG_APPLIED); |
262 | CLEAR_FLAG (op, FLAG_APPLIED); |
263 | fix_player (op->env); |
263 | op->env->update_stats (); |
264 | new_draw_info (NDI_UNIQUE, 0, op->env, "You feel much better now."); |
264 | new_draw_info (NDI_UNIQUE, 0, op->env, "You feel much better now."); |
265 | } |
265 | } |
266 | |
266 | |
267 | op->destroy (); |
267 | op->destroy (); |
268 | return; |
268 | return; |
… | |
… | |
1059 | player = op->above; |
1059 | player = op->above; |
1060 | |
1060 | |
1061 | for (walk = op->inv; walk != NULL; walk = walk->below) |
1061 | for (walk = op->inv; walk != NULL; walk = walk->below) |
1062 | apply_changes_to_player (player, walk); |
1062 | apply_changes_to_player (player, walk); |
1063 | |
1063 | |
1064 | fix_player (player); |
1064 | player->update_stats (); |
1065 | |
1065 | |
1066 | esrv_send_inventory (op->above, op->above); |
1066 | esrv_send_inventory (op->above, op->above); |
1067 | esrv_update_item (UPD_FACE, op->above, op->above); |
1067 | esrv_update_item (UPD_FACE, op->above, op->above); |
1068 | |
1068 | |
1069 | /* update players death & WoR home-position */ |
1069 | /* update players death & WoR home-position */ |
… | |
… | |
1076 | } |
1076 | } |
1077 | else |
1077 | else |
1078 | LOG (llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", &EXIT_PATH (op)); |
1078 | LOG (llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", &EXIT_PATH (op)); |
1079 | |
1079 | |
1080 | enter_exit (op->above, op); |
1080 | enter_exit (op->above, op); |
1081 | save_player (player, 1); |
1081 | player->contr->save (); |
1082 | } |
1082 | } |
1083 | } |
1083 | } |
1084 | |
1084 | |
1085 | /* firewalls fire other spells. |
1085 | /* firewalls fire other spells. |
1086 | * The direction of the wall is stored in op->stats.sp. |
1086 | * The direction of the wall is stored in op->stats.sp. |
… | |
… | |
1330 | unless hp was zero to start with, in which case it is infinite.*/ |
1330 | unless hp was zero to start with, in which case it is infinite.*/ |
1331 | |
1331 | |
1332 | void |
1332 | void |
1333 | move_marker (object *op) |
1333 | move_marker (object *op) |
1334 | { |
1334 | { |
|
|
1335 | if (object *tmp = op->ms ().player ()) |
|
|
1336 | { |
1335 | object *tmp, *tmp2; |
1337 | object *tmp2; |
1336 | |
1338 | |
1337 | for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
|
|
1338 | { |
|
|
1339 | if (tmp->type == PLAYER) |
|
|
1340 | { /* we've got someone to MARK */ |
|
|
1341 | |
|
|
1342 | /* remove an old force with a slaying field == op->name */ |
1339 | /* remove an old force with a slaying field == op->name */ |
1343 | for (tmp2 = tmp->inv; tmp2 != NULL; tmp2 = tmp2->below) |
1340 | for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) |
1344 | { |
|
|
1345 | if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->name)) |
1341 | if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->name)) |
1346 | break; |
|
|
1347 | } |
1342 | { |
1348 | |
|
|
1349 | if (tmp2) |
|
|
1350 | tmp2->destroy (); |
1343 | tmp2->destroy (); |
|
|
1344 | break; |
|
|
1345 | } |
1351 | |
1346 | |
1352 | /* cycle through his inventory to look for the MARK we want to |
1347 | /* cycle through his inventory to look for the MARK we want to |
1353 | * place |
1348 | * place |
1354 | */ |
1349 | */ |
1355 | for (tmp2 = tmp->inv; tmp2 != NULL; tmp2 = tmp2->below) |
1350 | for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) |
1356 | { |
|
|
1357 | if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->slaying)) |
1351 | if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->slaying)) |
1358 | break; |
1352 | break; |
1359 | } |
|
|
1360 | |
1353 | |
1361 | /* if we didn't find our own MARK */ |
1354 | /* if we didn't find our own MARK */ |
1362 | if (tmp2 == NULL) |
1355 | if (tmp2 == NULL) |
1363 | { |
1356 | { |
1364 | object *force = get_archetype (FORCE_NAME); |
1357 | object *force = get_archetype (FORCE_NAME); |
1365 | |
1358 | |
|
|
1359 | force->speed = 0; |
|
|
1360 | if (op->stats.food) |
|
|
1361 | { |
1366 | force->speed = 0; |
1362 | force->speed = 0.01; |
|
|
1363 | force->speed_left = -op->stats.food; |
|
|
1364 | } |
|
|
1365 | update_ob_speed (force); |
|
|
1366 | /* put in the lock code */ |
|
|
1367 | force->slaying = op->slaying; |
|
|
1368 | |
|
|
1369 | if (op->lore) |
|
|
1370 | force->lore = op->lore; |
|
|
1371 | |
|
|
1372 | insert_ob_in_ob (force, tmp); |
|
|
1373 | if (op->msg) |
|
|
1374 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, tmp, op->msg); |
|
|
1375 | |
|
|
1376 | if (op->stats.hp > 0) |
|
|
1377 | { |
|
|
1378 | op->stats.hp--; |
1367 | if (op->stats.food) |
1379 | if (op->stats.hp == 0) |
1368 | { |
1380 | { |
1369 | force->speed = 0.01; |
1381 | /* marker expires--granted mark number limit */ |
1370 | force->speed_left = -op->stats.food; |
1382 | op->destroy (); |
|
|
1383 | return; |
1371 | } |
1384 | } |
1372 | update_ob_speed (force); |
|
|
1373 | /* put in the lock code */ |
|
|
1374 | force->slaying = op->slaying; |
|
|
1375 | |
|
|
1376 | if (op->lore) |
|
|
1377 | force->lore = op->lore; |
|
|
1378 | |
|
|
1379 | insert_ob_in_ob (force, tmp); |
|
|
1380 | if (op->msg) |
|
|
1381 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, tmp, op->msg); |
|
|
1382 | |
|
|
1383 | if (op->stats.hp > 0) |
|
|
1384 | { |
|
|
1385 | op->stats.hp--; |
|
|
1386 | if (op->stats.hp == 0) |
|
|
1387 | { |
|
|
1388 | /* marker expires--granted mark number limit */ |
|
|
1389 | op->destroy (); |
|
|
1390 | return; |
|
|
1391 | } |
|
|
1392 | } |
1385 | } |
1393 | } /* if tmp2 == NULL */ |
1386 | } |
1394 | } /* if tmp->type == PLAYER */ |
1387 | } |
1395 | } /* For all objects on this space */ |
|
|
1396 | } |
1388 | } |
1397 | |
1389 | |
1398 | int |
1390 | int |
1399 | process_object (object *op) |
1391 | process_object (object *op) |
1400 | { |
1392 | { |
… | |
… | |
1484 | return 0; |
1476 | return 0; |
1485 | |
1477 | |
1486 | case THROWN_OBJ: |
1478 | case THROWN_OBJ: |
1487 | case ARROW: |
1479 | case ARROW: |
1488 | move_arrow (op); |
1480 | move_arrow (op); |
1489 | return 0; |
|
|
1490 | |
|
|
1491 | case LIGHTNING: /* It now moves twice as fast */ |
|
|
1492 | move_bolt (op); |
|
|
1493 | return 0; |
1481 | return 0; |
1494 | |
1482 | |
1495 | case DOOR: |
1483 | case DOOR: |
1496 | remove_door (op); |
1484 | remove_door (op); |
1497 | return 0; |
1485 | return 0; |