… | |
… | |
103 | cf::NDI_RED |
103 | cf::NDI_RED |
104 | ); |
104 | ); |
105 | # kill them. |
105 | # kill them. |
106 | # reminds me of the famous badness 10000 syndrome... |
106 | # reminds me of the famous badness 10000 syndrome... |
107 | $ob->stats->hp (-10000); #] if they survive this they deserved to live |
107 | $ob->stats->hp (-10000); #] if they survive this they deserved to live |
|
|
108 | my $killer = cf::arch::get "killer_login"; |
108 | $pl->killer ("a cave-in"); |
109 | $pl->killer ($killer); |
|
|
110 | $killer->destroy; |
109 | } else { |
111 | } else { |
110 | ($map, $x, $y) = $pl->savebed; |
112 | ($map, $x, $y) = $pl->savebed; |
111 | |
113 | |
112 | $ob->message ( |
114 | $ob->message ( |
113 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
115 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
… | |
… | |
398 | |
400 | |
399 | $pl->chargen_race_next; |
401 | $pl->chargen_race_next; |
400 | Coro::Timer::sleep 0.2; |
402 | Coro::Timer::sleep 0.2; |
401 | } |
403 | } |
402 | |
404 | |
|
|
405 | # create the playerdir, if necessary, as chargen_race_done did it before |
|
|
406 | # presumably because of unique maps |
|
|
407 | aio_mkdir playerdir $pl, 0770; |
403 | $pl->chargen_race_done; |
408 | $pl->chargen_race_done; |
404 | |
409 | |
405 | while () { |
410 | while () { |
406 | my $res = query $ns, cf::CS_QUERY_SINGLECHAR, |
411 | my $res = query $ns, cf::CS_QUERY_SINGLECHAR, |
407 | "Now choose a gender.\nPress 'f' to become female, and 'm' to become male.\n"; |
412 | "Now choose a gender.\nPress 'f' to become female, and 'm' to become male.\n"; |
… | |
… | |
465 | |
470 | |
466 | # update respawn position |
471 | # update respawn position |
467 | $pl->savebed ($bed->map->path, $bed->x, $bed->y); |
472 | $pl->savebed ($bed->map->path, $bed->x, $bed->y); |
468 | cf::async { $pl->save }; |
473 | cf::async { $pl->save }; |
469 | |
474 | |
|
|
475 | my $killer = cf::arch::get "killer_logout"; |
470 | $pl->killer ("left"); |
476 | $pl->killer ($killer); |
|
|
477 | $killer->destroy; |
471 | $ob->check_score; |
478 | $ob->check_score; |
472 | |
479 | |
473 | $ob->reply (undef, "In the future, you will wake up here when you die."); |
480 | $ob->reply (undef, "In the future, you will wake up here when you die."); |
474 | |
481 | |
475 | $pl->ns->query (cf::CS_QUERY_SINGLECHAR, "Do you want to continue playing (y/n)?", sub { |
482 | $pl->ns->query (cf::CS_QUERY_SINGLECHAR, "Do you want to continue playing (y/n)?", sub { |
… | |
… | |
549 | $pl->destroy; # destroys $ob |
556 | $pl->destroy; # destroys $ob |
550 | } else { |
557 | } else { |
551 | my $a_ = $pl->refcnt;#d# |
558 | my $a_ = $pl->refcnt;#d# |
552 | my $b_ = $ob->refcnt;#d# |
559 | my $b_ = $ob->refcnt;#d# |
553 | |
560 | |
554 | warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref ob $ob_ref (C pl $a_ ob $b_)\n";#d# |
561 | warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref/3 ob $ob_ref/3 (C pl $a_/1 ob $b_/2)\n";#d# |
555 | } |
562 | } |
556 | } |
563 | } |
557 | } |
564 | } |
558 | }; |
565 | }; |
559 | warn $@ if $@; |
566 | warn $@ if $@; |
560 | Coro::cede; |
567 | cf::cede_to_tick; |
561 | }; |
568 | }; |
562 | } |
569 | } |
563 | }; |
570 | }; |
564 | |
571 | |
565 | $SCHEDULER->prio (1); |
572 | $SCHEDULER->prio (1); |