| 948 | } |
| 949 | |
| 950 | void |
| 951 | fall_asleep(int how_long, boolean wakeup_msg) |
| 952 | { |
| 953 | stop_occupation(); |
| 954 | nomul(how_long); |
| 955 | gm.multi_reason = "sleeping"; |
| 956 | #if 0 /* this was broken; the fix for 'how_long' will result in changed |
| 957 | * behavior for sounds that don't go through You_hear() so needs |
| 958 | * testing */ |
| 959 | /* You_hear() produces "You dream that you hear ..." when sleeping; |
| 960 | other sound messages will either honor or ignore Deaf */ |
| 961 | if (wakeup_msg && gm.multi == how_long) { |
| 962 | /* caller can follow with a direct call to Hear_again() if |
| 963 | there's a need to override this when wakeup_msg is true */ |
| 964 | /* 5.0: how_long is negative so wasn't actually incrementing the |
| 965 | deafness timeout when it used to be passed as-is */ |
| 966 | incr_itimeout(&HDeaf, abs(how_long)); |
| 967 | disp.botl = TRUE; |
| 968 | ga.afternmv = Hear_again; /* this won't give any messages */ |
| 969 | } |
| 970 | #endif |
| 971 | /* early wakeup from combat won't be possible until next monster turn */ |
| 972 | u.usleep = svm.moves; |
| 973 | gn.nomovemsg = wakeup_msg ? "You wake up." : You_can_move_again; |
| 974 | } |
| 975 | |
| 976 | /* Attach an egg hatch timeout to the given egg. |
| 977 | * when = Time to hatch, usually only passed if re-creating an |
no test coverage detected