… | |
… | |
1433 | |
1433 | |
1434 | if ((ab->move_type && trap->move_on) || ab->move_type == 0) |
1434 | if ((ab->move_type && trap->move_on) || ab->move_type == 0) |
1435 | { |
1435 | { |
1436 | if (!sound_was_played) |
1436 | if (!sound_was_played) |
1437 | { |
1437 | { |
1438 | play_sound_map (trap->map, trap->x, trap->y, SOUND_FALL_HOLE); |
1438 | trap->play_sound (sound_find ("fall_hole")); |
1439 | sound_was_played = 1; |
1439 | sound_was_played = 1; |
1440 | } |
1440 | } |
|
|
1441 | |
1441 | new_draw_info (NDI_UNIQUE, 0, ab, "You fall into a trapdoor!"); |
1442 | new_draw_info (NDI_UNIQUE, 0, ab, "You fall into a trapdoor!"); |
1442 | transfer_ob (ab, (int) EXIT_X (trap), (int) EXIT_Y (trap), 0, ab); |
1443 | transfer_ob (ab, (int) EXIT_X (trap), (int) EXIT_Y (trap), 0, ab); |
1443 | } |
1444 | } |
1444 | } |
1445 | } |
1445 | goto leave; |
1446 | goto leave; |
… | |
… | |
1478 | * Processing will happen if the head runs into the pit |
1479 | * Processing will happen if the head runs into the pit |
1479 | */ |
1480 | */ |
1480 | if (victim->head) |
1481 | if (victim->head) |
1481 | goto leave; |
1482 | goto leave; |
1482 | |
1483 | |
1483 | play_sound_map (victim->map, victim->x, victim->y, SOUND_FALL_HOLE); |
1484 | victim->play_sound (sound_find ("fall_hole")); |
1484 | new_draw_info (NDI_UNIQUE, 0, victim, "You fall through the hole!\n"); |
1485 | new_draw_info (NDI_UNIQUE, 0, victim, "You fall through the hole!\n"); |
1485 | transfer_ob (victim, EXIT_X (trap), EXIT_Y (trap), 1, victim); |
1486 | transfer_ob (victim, EXIT_X (trap), EXIT_Y (trap), 1, victim); |
1486 | goto leave; |
1487 | goto leave; |
1487 | |
1488 | |
1488 | case EXIT: |
1489 | case EXIT: |
… | |
… | |
1678 | return; |
1679 | return; |
1679 | } |
1680 | } |
1680 | return; |
1681 | return; |
1681 | } |
1682 | } |
1682 | |
1683 | |
1683 | play_sound_player_only (op->contr, SOUND_LEARN_SPELL, 0, 0); |
1684 | op->contr->play_sound (sound_find ("learn_spell")); |
|
|
1685 | |
1684 | tmp = spell->clone (); |
1686 | tmp = spell->clone (); |
1685 | insert_ob_in_ob (tmp, op); |
1687 | insert_ob_in_ob (tmp, op); |
1686 | |
1688 | |
1687 | if (special_prayer) |
1689 | if (special_prayer) |
1688 | SET_FLAG (tmp, FLAG_STARTEQUIP); |
1690 | SET_FLAG (tmp, FLAG_STARTEQUIP); |
… | |
… | |
1842 | if (!QUERY_FLAG (tmp, FLAG_STARTEQUIP)) |
1844 | if (!QUERY_FLAG (tmp, FLAG_STARTEQUIP)) |
1843 | change_exp (op, calc_skill_exp (op, tmp, skop), skop->skill, 0); |
1845 | change_exp (op, calc_skill_exp (op, tmp, skop), skop->skill, 0); |
1844 | } |
1846 | } |
1845 | else |
1847 | else |
1846 | { |
1848 | { |
1847 | play_sound_player_only (op->contr, SOUND_FUMBLE_SPELL, 0, 0); |
1849 | op->contr->play_sound (sound_find ("fumble_spell")); |
1848 | new_draw_info (NDI_UNIQUE, 0, op, "You fail to learn the spell. H<Wis (priests) or Int (wizards) governs the chance of learning a prayer or spell.>\n"); |
1850 | new_draw_info (NDI_UNIQUE, 0, op, "You fail to learn the spell. H<Wis (priests) or Int (wizards) governs the chance of learning a prayer or spell.>\n"); |
1849 | } |
1851 | } |
1850 | |
1852 | |
1851 | decrease_ob (tmp); |
1853 | decrease_ob (tmp); |
1852 | } |
1854 | } |
… | |
… | |
2215 | extern void |
2217 | extern void |
2216 | apply_poison (object *op, object *tmp) |
2218 | apply_poison (object *op, object *tmp) |
2217 | { |
2219 | { |
2218 | if (op->type == PLAYER) |
2220 | if (op->type == PLAYER) |
2219 | { |
2221 | { |
2220 | play_sound_player_only (op->contr, SOUND_DRINK_POISON, 0, 0); |
2222 | op->contr->play_sound (sound_find ("drink_poison")); |
2221 | new_draw_info (NDI_UNIQUE, 0, op, "Yech! That tasted poisonous!"); |
2223 | new_draw_info (NDI_UNIQUE, 0, op, "Yech! That tasted poisonous!"); |
2222 | strcpy (op->contr->killer, "poisonous booze"); |
2224 | strcpy (op->contr->killer, "poisonous booze"); |
2223 | } |
2225 | } |
2224 | |
2226 | |
2225 | if (tmp->stats.hp > 0) |
2227 | if (tmp->stats.hp > 0) |
… | |
… | |
2359 | |
2361 | |
2360 | switch (tmp->type) |
2362 | switch (tmp->type) |
2361 | { |
2363 | { |
2362 | case CF_HANDLE: |
2364 | case CF_HANDLE: |
2363 | new_draw_info (NDI_UNIQUE, 0, op, "You turn the handle."); |
2365 | new_draw_info (NDI_UNIQUE, 0, op, "You turn the handle."); |
2364 | play_sound_map (op->map, op->x, op->y, SOUND_TURN_HANDLE); |
2366 | op->play_sound (sound_find ("turn_handle")); |
2365 | tmp->value = tmp->value ? 0 : 1; |
2367 | tmp->value = tmp->value ? 0 : 1; |
2366 | SET_ANIMATION (tmp, tmp->value); |
2368 | SET_ANIMATION (tmp, tmp->value); |
2367 | update_object (tmp, UP_OBJ_FACE); |
2369 | update_object (tmp, UP_OBJ_FACE); |
2368 | push_button (tmp); |
2370 | push_button (tmp); |
2369 | return 1; |
2371 | return 1; |
2370 | |
2372 | |
2371 | case TRIGGER: |
2373 | case TRIGGER: |
2372 | if (check_trigger (tmp, op)) |
2374 | if (check_trigger (tmp, op)) |
2373 | { |
2375 | { |
2374 | new_draw_info (NDI_UNIQUE, 0, op, "You turn the handle."); |
2376 | new_draw_info (NDI_UNIQUE, 0, op, "You turn the handle."); |
2375 | play_sound_map (tmp->map, tmp->x, tmp->y, SOUND_TURN_HANDLE); |
2377 | op->play_sound (sound_find ("turn_handle")); |
2376 | } |
2378 | } |
2377 | else |
2379 | else |
2378 | new_draw_info (NDI_UNIQUE, 0, op, "The handle doesn't move."); |
2380 | new_draw_info (NDI_UNIQUE, 0, op, "The handle doesn't move."); |
2379 | |
2381 | |
2380 | return 1; |
2382 | return 1; |
… | |
… | |
2513 | |
2515 | |
2514 | get_tod (&tod); |
2516 | get_tod (&tod); |
2515 | sprintf (buf, "It is %d minute%s past %d o'clock %s", |
2517 | sprintf (buf, "It is %d minute%s past %d o'clock %s", |
2516 | tod.minute + 1, ((tod.minute + 1 < 2) ? "" : "s"), |
2518 | tod.minute + 1, ((tod.minute + 1 < 2) ? "" : "s"), |
2517 | ((tod.hour % 14 == 0) ? 14 : ((tod.hour) % 14)), ((tod.hour >= 14) ? "pm" : "am")); |
2519 | ((tod.hour % 14 == 0) ? 14 : ((tod.hour) % 14)), ((tod.hour >= 14) ? "pm" : "am")); |
2518 | play_sound_player_only (op->contr, SOUND_CLOCK, 0, 0); |
2520 | op->play_sound (sound_find ("sound_clock")); |
2519 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
2521 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
2520 | return 1; |
2522 | return 1; |
2521 | } |
2523 | } |
2522 | else |
2524 | else |
2523 | return 0; |
2525 | return 0; |