From e97e702c2ec66ccffa05f147ebb892959455bcfd Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 28 Apr 2018 23:55:22 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=80=EC=83=81=20=EB=AA=A8=EB=93=9C=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91.=20=EB=9E=9C=EB=8D=A4=20=ED=8A=B9=EC=84=B1?= =?UTF-8?q?=20=EC=84=B8=ED=8C=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Scenario/NPC.php | 58 +++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/hwe/sammo/Scenario/NPC.php b/hwe/sammo/Scenario/NPC.php index 84bc208b..1a587779 100644 --- a/hwe/sammo/Scenario/NPC.php +++ b/hwe/sammo/Scenario/NPC.php @@ -53,16 +53,37 @@ class NPC{ $this->ego = $ego; $this->text = $text; - $char = \sammo\SpecCall($char); - if($char < 40){ - $this->charDomestic = $char; + $general = [ + 'leader'=>$leadership, + 'power'=>$power, + 'intel'=>$intel + ]; + + if($char === '랜덤전특'){ + $this->charWar = \sammo\Engine\SpecialityConst::pickSpecialWar($general); + } + else if($char === '랜덤내특'){ + $this->charDomestic = \sammo\Engine\SpecialityConst::pickSpecialDomestic($general); + } + else if($char === '랜덤'){ + if(Util::randBool(2/3)){ + $this->charWar = \sammo\Engine\SpecialityConst::pickSpecialWar($general); + } + else{ + $this->charDomestic = \sammo\Engine\SpecialityConst::pickSpecialDomestic($general); + } } else{ - $this->charWar = $char; - } + $char = \sammo\SpecCall($char); + if($char < 40){ + $this->charDomestic = $char; + } + else{ + $this->charWar = $char; + } + } } - public function build($env=[]){ //scenario에 life==1인 경우 수명 제한이 없어지는 모양. $nationID = $this->nationID; @@ -70,10 +91,7 @@ class NPC{ $nationID = 0; }; - $affinity = $this->affinity; - if(Util::array_get($env['fiction'],false) || $affinity === 0){ - $affinity = mt_rand(1, 150); - } + $isFictionMode = (Util::array_get($env['fiction'], 0)!=0); $year = $env['year']; $month = $env['month']; @@ -93,13 +111,27 @@ class NPC{ \sammo\pushWorldHistory(["●1월:$name(이)가 성인이 되어 등장했습니다."], $year, $month); } - if($this->ego == null){ + if($this->ego == null || $isFictionMode){ $ego = mt_rand(0, 9);//TODO: 나중에 성격을 따로 분리할 경우 클래스를 참조. } else{ $ego = \sammo\CharCall($this->ego); } + $affinity = $this->affinity; + + $charWar = $this->charWar; + $charDomestic = $this->charDomestic; + + if($affinity === 0 || $isFictionMode){ + $affinity = mt_rand(1, 150); + } + + if($isFictionMode){ + $charWar = 0; + $charDomestic = 0; + } + $name = 'ⓝ'.$this->name; $pictureID = $this->pictureID; @@ -167,9 +199,9 @@ class NPC{ 'age'=>$age, 'belong'=>1, 'personal'=>$ego, - 'special'=>$this->charDomestic, + 'special'=>$charDomestic, 'specage'=>$specage, - 'special2'=>$this->charWar, + 'special2'=>$charWar, 'specage2'=>$specage2, 'npcmsg'=>$this->text, 'makelimit'=>0,