diff --git a/hwe/sammo/ActionSpecialWar/che_의술.php b/hwe/sammo/ActionSpecialWar/che_의술.php index ca601c3c..d7861634 100644 --- a/hwe/sammo/ActionSpecialWar/che_의술.php +++ b/hwe/sammo/ActionSpecialWar/che_의술.php @@ -1,6 +1,9 @@ object = $general; + } +} diff --git a/hwe/sammo/BaseWarUnitTrigger.php b/hwe/sammo/BaseWarUnitTrigger.php new file mode 100644 index 00000000..4086bdff --- /dev/null +++ b/hwe/sammo/BaseWarUnitTrigger.php @@ -0,0 +1,9 @@ +object = $unit; + } +} diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index 871b4d0d..7a771cad 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -52,12 +52,13 @@ class General implements iAction{ $specialDomesticClass = getGeneralSpecialDomesticClass($raw['special']); $this->specialDomesticObj = new $specialDomesticClass; - $specialWarClass = getGeneralSpecialWarClass($raw['special']); + $specialWarClass = getGeneralSpecialWarClass($raw['special2']); $this->specialWarObj = new $specialWarClass; - //TODO: $specialWarClass 설정 $personalityClass = getPersonalityClass($raw['personal']); $this->personalityObj = new $personalityClass; + + //TODO: $specialItemClass 설정 } function clearActivatedSkill(){ diff --git a/hwe/sammo/GeneralTrigger.php b/hwe/sammo/GeneralTrigger.php deleted file mode 100644 index 161881ad..00000000 --- a/hwe/sammo/GeneralTrigger.php +++ /dev/null @@ -1,6 +0,0 @@ -object; + $logger = $general->getLogger(); + + if($general->getVar('injury') > 0){ + $general->updateVar('injury', 0); + $general->activateSkill('pre.부상경감', 'pre.치료'); + $logger->pushGeneralActionLog('의술을 펼쳐 스스로 치료합니다!', ActionLogger::PLAIN); + } + + $db = DB::db(); + + $patients = $db->queryAllLists( + 'SELECT no,name,nation FROM general WHERE city=%i AND injury > 10 AND no != %i', + $general->getVar('city'), + $general->getVar('no') + ); + + if(!$patients){ + return $env; + } + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $cureList = []; + + foreach($patients as [$patientID, $patientName, $patientNationID]){ + if (!Util::randBool(0.5)) { + continue; + } + + $cureList[] = $patientID; + $patientLogger = new ActionLogger($patientID, $patientNationID, $logger->getYear(), $logger->getMonth()); + $patientLogger->pushGeneralActionLog("{$generalName}{$josaYi} 의술로써 치료해줍니다!", ActionLogger::PLAIN); + $patientLogger->flush(); + } + + if(!$cureList){ + return $env; + } + + + if(count($cureList) == 1){ + $josaUl = JosaUtil::pick($patientName, "을"); + $logger->pushGeneralActionLog("의술을 펼쳐 도시의 장수 {$patientName}{$josaUl} 치료합니다!", ActionLogger::PLAIN); + } + else{ + $otherCount = count($cureList) - 1; + $logger->pushGeneralActionLog("의술을 펼쳐 도시의 장수들 {$patientName} 외 {$otherCount}명을 치료합니다!", ActionLogger::PLAIN); + } + + $db->update('general', [ + 'injury'=>0 + ], 'no IN %li', $cureList); + + return $env; + } +} \ No newline at end of file diff --git a/hwe/sammo/GeneralTriggerCaller.php b/hwe/sammo/GeneralTriggerCaller.php index 6dbd958c..402860ef 100644 --- a/hwe/sammo/GeneralTriggerCaller.php +++ b/hwe/sammo/GeneralTriggerCaller.php @@ -2,7 +2,7 @@ namespace sammo; class GeneralTriggerCaller extends TriggerCaller{ function checkValidTrigger(ObjectTrigger $trigger):bool{ - if($trigger instanceof GeneralTrigger){ + if($trigger instanceof BaseGeneralTrigger){ return true; } return false; diff --git a/hwe/sammo/WarUnitTrigger.php b/hwe/sammo/WarUnitTrigger.php deleted file mode 100644 index 19785396..00000000 --- a/hwe/sammo/WarUnitTrigger.php +++ /dev/null @@ -1,6 +0,0 @@ -