diff --git a/hwe/sammo/Command/Nation/event_극병연구.php b/hwe/sammo/Command/Nation/event_극병연구.php new file mode 100644 index 00000000..fd67938b --- /dev/null +++ b/hwe/sammo/Command/Nation/event_극병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 23; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [100000, 100000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_대검병연구.php b/hwe/sammo/Command/Nation/event_대검병연구.php new file mode 100644 index 00000000..b8c9bd05 --- /dev/null +++ b/hwe/sammo/Command/Nation/event_대검병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 11; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [50000, 50000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_무희연구.php b/hwe/sammo/Command/Nation/event_무희연구.php new file mode 100644 index 00000000..fe543599 --- /dev/null +++ b/hwe/sammo/Command/Nation/event_무희연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 23; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [100000, 100000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_산저병연구.php b/hwe/sammo/Command/Nation/event_산저병연구.php new file mode 100644 index 00000000..1efb37aa --- /dev/null +++ b/hwe/sammo/Command/Nation/event_산저병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 11; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [50000, 50000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_상병연구.php b/hwe/sammo/Command/Nation/event_상병연구.php new file mode 100644 index 00000000..e6af1aea --- /dev/null +++ b/hwe/sammo/Command/Nation/event_상병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 23; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [100000, 100000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_원융노병연구.php b/hwe/sammo/Command/Nation/event_원융노병연구.php new file mode 100644 index 00000000..e9d17ed9 --- /dev/null +++ b/hwe/sammo/Command/Nation/event_원융노병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 23; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [100000, 100000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_음귀병연구.php b/hwe/sammo/Command/Nation/event_음귀병연구.php new file mode 100644 index 00000000..bd405a97 --- /dev/null +++ b/hwe/sammo/Command/Nation/event_음귀병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 11; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [50000, 50000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_화륜차연구.php b/hwe/sammo/Command/Nation/event_화륜차연구.php new file mode 100644 index 00000000..ad8eb54b --- /dev/null +++ b/hwe/sammo/Command/Nation/event_화륜차연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 23; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [100000, 100000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/Nation/event_화시병연구.php b/hwe/sammo/Command/Nation/event_화시병연구.php new file mode 100644 index 00000000..45cc4323 --- /dev/null +++ b/hwe/sammo/Command/Nation/event_화시병연구.php @@ -0,0 +1,88 @@ +setNation(['gold','rice','aux']); + $this->fullConditionConstraints=[]; + + $name = static::$actionName; + + $this->minConditionConstraints = [ + ConstraintHelper::OccupiedCity(), + ConstraintHelper::BeChief(), + ConstraintHelper::ReqNationAuxValue(static::$auxType->value, 0, "<", 1, "{$name}가 이미 완료되었습니다."), + ]; + } + + public function getPreReqTurn():int{ + return 11; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function getCost():array{ + return [50000, 50000]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + $general = $this->generalObj; + $nationID = $general->getNationID(); + + $actionName = static::$actionName; + + $aux = $this->nation['aux']; + $aux[static::$auxType->value] = 1; + [$reqGold, $reqRice] = $this->getCost(); + + $logger = $general->getLogger(); + + $general->addExperience(5 * ($this->getPreReqTurn() + 1)); + $general->addDedication(5 * ($this->getPreReqTurn() + 1)); + + $generalName = $general->getName(); + $josaYi = JosaUtil::pick($generalName, '이'); + + $db->update('nation', [ + 'gold' => $db->sqleval('gold - %i', $reqGold), + 'rice' => $db->sqleval('rice - %i', $reqRice), + 'aux' => Json::encode($aux), + ], 'nation=%i', $nationID); + + $logger->pushGeneralActionLog("{$actionName} 완료"); + $logger->pushGeneralHistoryLog("{$actionName} 완료"); + $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$actionName} 완료"); + + $general->increaseInheritancePoint(InheritanceKey::active_action, 1); + StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg ?? []); + $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); + $general->applyDB($db); + + return true; + } +} \ No newline at end of file diff --git a/hwe/scenario/unit/event_more_crewtype.php b/hwe/scenario/unit/event_more_crewtype.php index a1591e22..cf5c54c5 100644 --- a/hwe/scenario/unit/event_more_crewtype.php +++ b/hwe/scenario/unit/event_more_crewtype.php @@ -440,7 +440,7 @@ class GameUnitConst extends GameUnitConstBase [ 91500, self::T_SIEGE, '화륜차', 300, 0, 5, 0, 0, 40, 5, - [new ReqTech(5000), new ReqNationAux(NationAuxKey::did_특성초토화, '>=', 1), new ReqChief()], + [new ReqTech(5000), new ReqNationAux(NationAuxKey::did_특성초토화, '>=', 1), new ReqChief(), new ReqNationAux(NationAuxKey::can_화륜차사용, '==', 1)], [self::T_FOOTMAN=>1.25, self::T_ARCHER=>1.25, self::T_CAVALRY=>1.25, self::T_WIZARD=>1.25, self::T_CASTLE=>1.25, 1106=>1.112], [self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2, 1106=>1.067], ['불타는 바퀴로 적진을 붕괴시킵니다.'],