… | |
… | |
86 | cf::NDI_RED |
86 | cf::NDI_RED |
87 | ); |
87 | ); |
88 | # kill them. |
88 | # kill them. |
89 | # reminds me of the famous badness 10000 syndrome... |
89 | # reminds me of the famous badness 10000 syndrome... |
90 | $ob->stats->hp (-10000); #] if they survive this they deserved to live |
90 | $ob->stats->hp (-10000); #] if they survive this they deserved to live |
91 | $pl->killer ("cave-in"); |
91 | $pl->killer ("a cave-in"); |
92 | } else { |
92 | } else { |
93 | $ob->message ( |
93 | $ob->message ( |
94 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
94 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
95 | . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " |
95 | . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " |
96 | . "Better use a savebed next time, much worse things could have happened... " |
96 | . "Better use a savebed next time, much worse things could have happened... " |
… | |
… | |
357 | |
357 | |
358 | $ob->set_animation (2); |
358 | $ob->set_animation (2); |
359 | $ob->add_statbonus; |
359 | $ob->add_statbonus; |
360 | |
360 | |
361 | while () { |
361 | while () { |
362 | $ns->send_msg (-1, "chargen-race-title", ucfirst $pl->title); |
362 | $ns->send_msg ("chargen-race-title", ucfirst $pl->title, -1); |
363 | my $msg = $ob->msg; |
363 | my $msg = $ob->msg; |
364 | $msg =~ s/(?<=\S)\n(?=\S)/ /g; |
364 | $msg =~ s/(?<=\S)\n(?=\S)/ /g; |
365 | $ns->send_msg (cf::NDI_BLUE, "chargen-race-description", $msg); |
365 | $ns->send_msg ("chargen-race-description", $msg, cf::NDI_BLUE); |
366 | |
366 | |
367 | my $res = query $ns, cf::CS_QUERY_SINGLECHAR, |
367 | my $res = query $ns, cf::CS_QUERY_SINGLECHAR, |
368 | "Now choose a character.\nPress any key to change outlook.\nPress `d' when you're pleased.\n"; |
368 | "Now choose a character.\nPress any key to change outlook.\nPress `d' when you're pleased.\n"; |
369 | |
369 | |
370 | last if $res =~ /[dD]/; |
370 | last if $res =~ /[dD]/; |
… | |
… | |
481 | |
481 | |
482 | our $SCHEDULE_INTERVAL = 10; # time the player scheduler sleeps between runs |
482 | our $SCHEDULE_INTERVAL = 10; # time the player scheduler sleeps between runs |
483 | our $SAVE_TIMEOUT = 20; # save players every n seconds |
483 | our $SAVE_TIMEOUT = 20; # save players every n seconds |
484 | |
484 | |
485 | our $SCHEDULER = cf::async_ext { |
485 | our $SCHEDULER = cf::async_ext { |
486 | my $schedule_interval = Coro::Event->timer (after => 1, interval => $SCHEDULE_INTERVAL); |
486 | my $schedule_interval = Coro::Event->timer (after => 1); |
487 | while () { |
487 | while () { |
|
|
488 | $schedule_interval->interval ($SCHEDULE_INTERVAL); |
488 | $schedule_interval->next; |
489 | $schedule_interval->next; |
489 | |
490 | |
490 | # this weird form of iteration over values is used because |
491 | # this weird form of iteration over values is used because |
491 | # the hash changes underneath us frequently, and for |
492 | # the hash changes underneath us frequently, and for |
492 | # keeps a direct reference to the value without (in 5.8 perls) |
493 | # keeps a direct reference to the value without (in 5.8 perls) |