;name;;이; 사망했습니다.'; static protected $messages = null; static protected $scenarioNPCMessages = null; static protected $utilNPCMessages = null; protected static function getMessageList():array{ return [ ';name;;이; 역병에 걸려 죽고 말았습니다.', ';name;;이; 요절하고 말았습니다.', ';name;;이; 거리에서 갑자기 객사하고 말았습니다.', ';name;;이; 안타깝게도 번개에 맞아 죽고 말았습니다.', ';name;;이; 고리대금에 시달리다가 자살하고 말았습니다.', ';name;;이; 일확천금에 놀라 심장마비로 죽고 말았습니다.', ';name;;이; 산속에서 호랑이에게 물려 죽고 말았습니다.', ';name;;이; 산책중 곰에게 할퀴어 죽고 말았습니다.', ';name;;이; 수영을 하다 익사하고 말았습니다.', ';name;;이; 황제를 모독하다가 처형당하고 말았습니다.', ';name;;이; 이튿날 침실에서 죽은채로발견되었습니다.', ';name;;이; 색에 빠져 기력이 쇠진해 죽고말았습니다.', ';name;;이; 미녀를 보고 심장마비로 죽고말았습니다.', ';name;;이; 우울증에 걸려 자살하고 말았습니다.', ';name;;이; 천하 정세를 비관하며 분신하고 말았습니다.', ';name;;이; 어떤 관심도 못받고 쓸쓸히 죽고말았습니다.', ';name;;이; 유산 상속 문제로 다투다가 살해당했습니다.', ';name;;이; 누군가의 사주로 자객에게 암살당했습니다.', ';name;;이; 바람난 배우자에게 독살당하고 말았습니다.', ';name;;이; 농약을 술인줄 알고 마셔 죽고말았습니다.', ';name;;이; 아무 이유 없이 죽고말았습니다.', ';name;;이; 전재산을 잃고 화병으로 죽고말았습니다.', ';name;;이; 단식운동을 하다가 굶어 죽고말았습니다.', ';name;;이; 귀신에게 홀려 시름 앓다가 죽고말았습니다.', ';name;;이; 사람들에게 집단으로 맞아서 죽고말았습니다.', ';name;;이; 갑자기 성벽에서 뛰어내려 죽고말았습니다.', ';name;;이; 농사중 호미에 머리를 맞아 죽고말았습니다.', ';name;;이; 저세상이 궁금하다며 자살하고 말았습니다.', '운좋기로 소문난 ;name;;이; 불운하게도 죽고말았습니다.', ';name;;이; 무리하게 단련을 하다가 죽고말았습니다.', ';name;;이; 생활고를 비관하며 자살하고 말았습니다.', ';name;;이; 평생 결혼도 못해보고 죽고 말았습니다.', ';name;;이; 과식하다 배가 터져 죽고 말았습니다.', ';name;;이; 웃다가 숨이 넘어가 죽고 말았습니다.', ';name;;이; 추녀를 보고 놀라서 죽고 말았습니다.', ';name;;이; 물에 빠진 사람을 구하려다 같이 죽고 말았습니다.', ';name;;이; 독살을 준비하다 독에 걸려 죽고 말았습니다.', ';name;;이; 뒷간에서 너무 힘을 주다가 죽고 말았습니다.', ';name;;이; 돌팔이 의사에게 치료받다가 죽고 말았습니다.', ';name;;이; 남의 보약을 훔쳐먹다 부작용으로 죽고 말았습니다.', '희대의 사기꾼 ;name;;이; 사망했습니다.', '희대의 호색한 ;name;;이; 사망했습니다.', ]; } protected static function getScenarioNPCMessageList():array{ return [ static::$defaultMessage, ]; } protected static function getUtilNPCMessageList():array{ return [ ';name;;이; 푸대접에 실망하여 떠났습니다.', ';name;;이; 갑자기 화를 내며 떠났습니다.', ';name;;이; 의견차이를 좁히지 못하고 떠났습니다.', ';name;;이; 판단 착오였다며 떠났습니다.', ';name;;이; 생활고가 나아지지 않는다며 떠났습니다.', ';name;;이; 기대가 너무 컸다며 떠났습니다.', ';name;;이; 아무 이유 없이 떠났습니다.', ';name;;이; 자기 목적은 달성했다며 떠났습니다.', ';name;;이; 자기가 없어도 될것 같다며 떠났습니다.', ';name;;이; 처자식이 그립다며 떠났습니다.', ]; } protected static function initMessageList():void{ static::$messages = static::getMessageList(); static::$scenarioNPCMessages = static::getScenarioNPCMessageList(); static::$utilNPCMessages = static::getUtilNPCMessageList(); } function __construct(General $general) { if(static::$messages === null){ static::initMessageList(); } $this->general = $general; $this->name = $general->getName(); $this->npc = $general->getVar('npc'); if($general->getVar('owner') > 0 && $general->getVar('startage') - $general->getVar('age') > 1){ $this->realName = $general->getVar('owner_name'); } } public function getText():string{ $name = $this->name; $npc = $this->npc; if($npc == 0){ $text = Util::choiceRandom(static::$messages??[]); } else if($npc == 2 || $npc == 6){ $text = Util::choiceRandom(static::$scenarioNPCMessages??[]); } else if($npc == 3 || $npc == 4){ $text = Util::choiceRandom(static::$utilNPCMessages??[]); } else{ $text = static::$defaultMessage; } if($this->realName){ $text = str_replace(';name;', ";{$name};({$this->realName})", $text); } else{ $text = str_replace(';name;', ";{$name};", $text); } return JosaUtil::batch($text); } }