diff --git a/hwe/sammo/Command/General/che_등용수락.php b/hwe/sammo/Command/General/che_등용수락.php index 36f21a45..c58bc406 100644 --- a/hwe/sammo/Command/General/che_등용수락.php +++ b/hwe/sammo/Command/General/che_등용수락.php @@ -218,44 +218,4 @@ class che_등용수락 extends Command\GeneralCommand{ return true; } - - public function getForm(): string - { - $db = DB::db(); - - $destGenerals = []; - $destRawGenerals = $db->query('SELECT no,name,npc,nation FROM general WHERE npc < 2 AND no != %i AND officer_level != 12 ORDER BY npc,binary(name)',$this->generalObj->getID()); - foreach($destRawGenerals as $destGeneral){ - $destNationID = $destGeneral['nation']; - if(!key_exists($destNationID, $destGenerals)){ - $destGenerals[$destNationID] = []; - } - $destGenerals[$destNationID] = [$destGeneral]; - } - - $nationList = array_merge([0=>getNationStaticInfo(0)], getAllNationStaticInfo()); - - ob_start(); -?> -재야나 타국의 장수를 등용합니다.
-서신은 개인 메세지로 전달됩니다.
-등용할 장수를 목록에서 선택하세요.
-
- generalObj; + $db = DB::db(); + + [$nationLevel, $tech] = $db->queryFirstList('SELECT level,tech FROM nation WHERE nation=%i', $general->getNationID()); + if (!$nationLevel) { + $nationLevel = 0; + } + + if (!$tech) { + $tech = 0; + } + + $year = $this->env['year']; + $startyear = $this->env['startyear']; + $relativeYear = $year - $startyear; + + $ownCities = []; + $ownRegions = []; + + foreach (DB::db()->query('SELECT city, region from city where nation = %i', $general->getNationID()) as $city) { + $ownCities[$city['city']] = 1; + $ownRegions[$city['region']] = 1; + } + + $leadership = $general->getLeadership(); + $fullLeadership = $general->getLeadership(false); + $abil = getTechAbil($tech); + + $armCrewTypes = []; + foreach (GameUnitConst::allType() as $armType => $armName) { + $armCrewType = [ + 'armType' => $armType, + 'armName' => $armName, + 'values' => [], + ]; + + $crewTypes = []; + foreach (GameUnitConst::byType($armType) as $unit) { + $crewObj = new \stdClass; + + $crewObj->id = $unit->id; + $crewObj->reqTech = $unit->reqTech; + $crewObj->reqYear = $unit->reqYear; + + /* + if ($unit->reqTech == 0) { + $crewObj->bgcolor = 'green'; + } else { + $crewObj->bgcolor = 'limegreen'; + } + */ + + $crewObj->notAvailable = !$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech); + + $crewObj->baseRice = $general->onCalcDomestic($this->getName(), 'rice', $unit->riceWithTech($tech), ['armType' => $unit->armType]); + $crewObj->baseCost = $general->onCalcDomestic($this->getName(), 'cost', $unit->costWithTech($tech), ['armType' => $unit->armType]); + + $crewObj->name = $unit->name; + $crewObj->attack = $unit->attack + $abil; + $crewObj->defence = $unit->defence + $abil; + $crewObj->speed = $unit->speed; + $crewObj->avoid = $unit->avoid; + if ($this->env['show_img_level'] < 2) { + $crewObj->img = ServConfig::$sharedIconPath . "/default.jpg"; + } else { + $crewObj->img = ServConfig::$gameImagePath . "/crewtype" . $unit->id . ".png"; + } + + $crewObj->info = $unit->info; + + $armCrewType['values'][] = $crewObj; + } + + + $armCrewTypes[] = $armCrewType; + } + + $crew = $general->getVar('crew'); + $gold = $general->getVar('gold'); + $crewTypeObj = $general->getCrewTypeObj(); + + return [ + 'procRes' => [ + 'relYear' => $relativeYear, + 'year' => $year, + 'tech' => $tech, + 'techLevel' => getTechLevel($tech), + 'startYear' => $startyear, + 'goldCoeff' => static::$costOffset, + 'leadership' => $leadership, + 'fullLeadership' => $fullLeadership, + 'armCrewTypes' => $armCrewTypes, + 'currentCrewType' => $crewTypeObj->id, + 'crew' => $crew, + 'gold' => $gold, + ] + ]; + } + public function getJSPlugins(): array { return [ @@ -305,9 +407,6 @@ class che_징병 extends Command\GeneralCommand $crewObj->img = ServConfig::$gameImagePath . "/crewtype" . $unit->id . ".png"; } - $crewObj->baseRiceShort = round($crewObj->baseRice, 1); - $crewObj->baseCostShort = round($crewObj->baseCost, 1); - $crewObj->info = join('
', $unit->info); diff --git a/hwe/sammo/GameUnitConstBase.php b/hwe/sammo/GameUnitConstBase.php index ee322b22..744359eb 100644 --- a/hwe/sammo/GameUnitConstBase.php +++ b/hwe/sammo/GameUnitConstBase.php @@ -50,7 +50,7 @@ class GameUnitConstBase{ 0, null, null, 0, [self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2], [self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8], - ['표준적인 보병입니다.','보병은 방어특화이며, 상대가 회피하기 어렵습니다.'], + ['표준적인 보병입니다.','보병은 방어특화이며,','상대가 회피하기 어렵습니다.'], null, ['che_방어력증가5p'] ], [ diff --git a/hwe/scenario/unit/basic.php b/hwe/scenario/unit/basic.php index e3d00bbb..0fc8d7b1 100644 --- a/hwe/scenario/unit/basic.php +++ b/hwe/scenario/unit/basic.php @@ -8,8 +8,8 @@ class GameUnitConst extends GameUnitConstBase protected static $_buildData = [ [ 1000, self::T_CASTLE, '성벽', - 100, 100, 7, 0, 0, 99, 9, - 999999, null, null, 999999, + 100, 100, 7, 0, 0, 99, 9, + 999999, null, null, 999999, [],//성벽은 공격할 수 없다. [self::T_FOOTMAN=>1.2], ['성벽입니다.','생성할 수 없습니다.'], @@ -18,18 +18,18 @@ class GameUnitConst extends GameUnitConstBase [ 1100, self::T_FOOTMAN, '보병', - 100, 150, 7, 10, 0, 9, 9, - 0, null, null, 0, + 100, 150, 7, 10, 0, 9, 9, + 0, null, null, 0, [self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2], [self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8], - ['표준적인 보병입니다.','보병은 방어특화이며, 상대가 회피하기 어렵습니다.'], + ['표준적인 보병입니다.','보병은 방어특화이며,','상대가 회피하기 어렵습니다.'], null, null ], [ - 1200, self::T_ARCHER, '궁병', - 100, 100, 7, 20, 0, 10, 10, - 0, null, null, 0, + 1200, self::T_ARCHER, '궁병', + 100, 100, 7, 20, 0, 10, 10, + 0, null, null, 0, [self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8, self::T_SIEGE=>1.2], [self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2, self::T_SIEGE=>0.8], ['표준적인 궁병입니다.','궁병은 회피특화입니다.'], @@ -37,9 +37,9 @@ class GameUnitConst extends GameUnitConstBase ], [ - 1300, self::T_CAVALRY, '기병', - 150, 100, 7, 5, 0, 11, 11, - 0, null, null, 0, + 1300, self::T_CAVALRY, '기병', + 150, 100, 7, 5, 0, 11, 11, + 0, null, null, 0, [self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2], [self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8], ['표준적인 기병입니다.','기병은 공격특화입니다.'], @@ -47,18 +47,18 @@ class GameUnitConst extends GameUnitConstBase ], [ - 1400, self::T_WIZARD, '귀병', - 80, 80, 7, 5, 0.5, 9, 9, - 0, null, null, 0, + 1400, self::T_WIZARD, '귀병', + 80, 80, 7, 5, 0.5, 9, 9, + 0, null, null, 0, [self::T_SIEGE=>1.2], [self::T_SIEGE=>0.8], ['계략을 사용하는 병종입니다.'], null, null ], [ - 1405, self::T_WIZARD, '남귀병', - 60, 60, 7, 10, 0.8, 8, 8, - 1000, null, null, 0, + 1405, self::T_WIZARD, '남귀병', + 60, 60, 7, 10, 0.8, 8, 8, + 1000, null, null, 0, [self::T_SIEGE=>1.2], [self::T_SIEGE=>0.8], ['전투를 포기하고 계략에 몰두합니다.'], @@ -66,18 +66,18 @@ class GameUnitConst extends GameUnitConstBase ], [ - 1500, self::T_SIEGE, '정란', - 100, 100, 6, 0, 0, 15, 5, - 0, null, null, 3, + 1500, self::T_SIEGE, '정란', + 100, 100, 6, 0, 0, 15, 5, + 0, null, null, 3, [self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8, self::T_CASTLE=>1.8], [self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2], ['높은 구조물 위에서 공격합니다.'], ['che_성벽부상무효'], null ], [ - 1501, self::T_SIEGE, '충차', - 150, 100, 6, 0, 0, 20, 5, - 1000, null, null, 3, + 1501, self::T_SIEGE, '충차', + 150, 100, 6, 0, 0, 20, 5, + 1000, null, null, 3, [self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8, self::T_CASTLE=>2.4], [self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2], ['엄청난 위력으로 성벽을 부수어버립니다.'], diff --git a/hwe/scenario/unit/siegetank.php b/hwe/scenario/unit/siegetank.php index 7a2bc5fd..317ea88d 100644 --- a/hwe/scenario/unit/siegetank.php +++ b/hwe/scenario/unit/siegetank.php @@ -8,8 +8,8 @@ class GameUnitConst extends GameUnitConstBase protected static $_buildData = [ [ 1000, self::T_CASTLE, '성벽', - 100, 100, 7, 0, 0, 99, 9, - 999999, null, null, 999999, + 100, 100, 7, 0, 0, 99, 9, + 999999, null, null, 999999, [],//성벽은 공격할 수 없다. [self::T_FOOTMAN=>1.2], ['성벽입니다.','생성할 수 없습니다.'], @@ -17,18 +17,18 @@ class GameUnitConst extends GameUnitConstBase ], [ 1100, self::T_FOOTMAN, '보병', - 100, 150, 7, 10, 0, 18, 18, - 0, null, null, 0, + 100, 150, 7, 10, 0, 18, 18, + 0, null, null, 0, [self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8], [self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2], - ['표준적인 보병입니다.','보병은 방어특화이며, 상대가 회피하기 어렵습니다.'], + ['표준적인 보병입니다.','보병은 방어특화이며,','상대가 회피하기 어렵습니다.'], null, null ], [ - 1200, self::T_ARCHER, '궁병', - 100, 100, 7, 20, 0, 20, 20, - 0, null, null, 0, + 1200, self::T_ARCHER, '궁병', + 100, 100, 7, 20, 0, 20, 20, + 0, null, null, 0, [self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8], [self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2], ['표준적인 궁병입니다.','궁병은 회피특화입니다.'], @@ -36,9 +36,9 @@ class GameUnitConst extends GameUnitConstBase ], [ - 1300, self::T_CAVALRY, '기병', - 150, 100, 7, 5, 0, 22, 22, - 0, null, null, 0, + 1300, self::T_CAVALRY, '기병', + 150, 100, 7, 5, 0, 22, 22, + 0, null, null, 0, [self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8], [self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2], ['표준적인 기병입니다.','기병은 공격특화입니다.'], @@ -46,18 +46,18 @@ class GameUnitConst extends GameUnitConstBase ], [ - 1400, self::T_WIZARD, '귀병', - 80, 80, 7, 5, 0.5, 18, 18, - 0, null, null, 0, + 1400, self::T_WIZARD, '귀병', + 80, 80, 7, 5, 0.5, 18, 18, + 0, null, null, 0, [], [], ['계략을 사용하는 병종입니다.'], null, null ], [ - 1405, self::T_WIZARD, '남귀병', - 60, 60, 7, 10, 0.8, 16, 16, - 1000, null, null, 0, + 1405, self::T_WIZARD, '남귀병', + 60, 60, 7, 10, 0.8, 16, 16, + 1000, null, null, 0, [], [], ['전투를 포기하고 계략에 몰두합니다.'], @@ -65,36 +65,36 @@ class GameUnitConst extends GameUnitConstBase ], [ - 1500, self::T_SIEGE, '정란', - 100, 100, 6, 0, 0, 7, 3, - 0, null, null, 0, + 1500, self::T_SIEGE, '정란', + 100, 100, 6, 0, 0, 7, 3, + 0, null, null, 0, [self::T_CASTLE=>1.8], [], ['높은 구조물 위에서 공격합니다.'], ['che_성벽부상무효'], null ], [ - 1501, self::T_SIEGE, '충차', - 150, 100, 6, 0, 0, 10, 3, - 1000, null, null, 3, + 1501, self::T_SIEGE, '충차', + 150, 100, 6, 0, 0, 10, 3, + 1000, null, null, 3, [self::T_CASTLE=>2.4], [], ['엄청난 위력으로 성벽을 부수어버립니다.'], ['che_성벽부상무효'], null ], [ - 1502, self::T_SIEGE, '벽력거', - 200, 100, 6, 0, 0, 20, 4, - 3000, ['업'], null, 0, + 1502, self::T_SIEGE, '벽력거', + 200, 100, 6, 0, 0, 20, 4, + 3000, ['업'], null, 0, [self::T_CASTLE=>1.8], [], ['상대에게 돌덩이를 날립니다.'], ['che_성벽부상무효'], null ], [ - 1503, self::T_SIEGE, '목우', - 50, 200, 5, 0, 0, 15, 3, - 3000, ['성도'], null, 0, + 1503, self::T_SIEGE, '목우', + 50, 200, 5, 0, 0, 15, 3, + 3000, ['성도'], null, 0, [], [], ['상대를 저지하는 특수병기입니다.'], diff --git a/hwe/ts/processing/CrewTypeItem.vue b/hwe/ts/processing/CrewTypeItem.vue new file mode 100644 index 00000000..d02d967b --- /dev/null +++ b/hwe/ts/processing/CrewTypeItem.vue @@ -0,0 +1,129 @@ + + diff --git a/hwe/ts/processing/General/che_징병.vue b/hwe/ts/processing/General/che_징병.vue new file mode 100644 index 00000000..24fbe4a6 --- /dev/null +++ b/hwe/ts/processing/General/che_징병.vue @@ -0,0 +1,344 @@ + + + + + + \ No newline at end of file diff --git a/hwe/ts/processing/General/index.ts b/hwe/ts/processing/General/index.ts index d4f4a1f8..346fd0bd 100644 --- a/hwe/ts/processing/General/index.ts +++ b/hwe/ts/processing/General/index.ts @@ -2,6 +2,7 @@ import { default as che_건국} from "./che_건국.vue"; import { default as che_군량매매} from "./che_군량매매.vue"; import { default as che_등용} from "./che_등용.vue"; import { default as CityProcess} from "./che_이동.vue"; +import { default as che_징병} from "./che_징병.vue"; export const commandMap: Record = { che_강행: CityProcess, @@ -10,4 +11,21 @@ export const commandMap: Record = { che_등용, che_이동: CityProcess, che_출병: CityProcess, -} \ No newline at end of file + che_징병, + che_모병: che_징병, +} + +/* +- 항목들 +장수 - 선양, +장수+ - 장수대상임관 +국가+ - 임관 +장수/금쌀/분량 - 증여(포상 이식) +금쌀/분량 - 헌납(군량매매 또는 포상 수정) +도시 - 첩보, 계략(화계 등) + +고유 양식 - 숙련전환, 장비매매, 징병 + + + +*/ \ No newline at end of file diff --git a/hwe/ts/processing/Nation/index.ts b/hwe/ts/processing/Nation/index.ts index ba5ccf30..147f60e6 100644 --- a/hwe/ts/processing/Nation/index.ts +++ b/hwe/ts/processing/Nation/index.ts @@ -11,4 +11,13 @@ export const commandMap: Record = { che_몰수: GeneralAmountProcess, che_포상: GeneralAmountProcess, che_발령: GeneralCityProcess, -} \ No newline at end of file +} + +/* +- 항목들 +국가/금쌀/분량 - 물자원조 +도시 - 백성동원, 수몰, 천도, 초토화, +국가 - 불가침파기제의, 선전포고, 이호경식, 종전제의, 피장파장, 허보 +고유 양식 - 불가침제의 + +*/ \ No newline at end of file diff --git a/hwe/ts/processing/processingRes.ts b/hwe/ts/processing/processingRes.ts index 4289b92b..691ff846 100644 --- a/hwe/ts/processing/processingRes.ts +++ b/hwe/ts/processing/processingRes.ts @@ -56,4 +56,27 @@ export type procNationTypeItem = { cons: string, } -export type procNationTypeList = Record; \ No newline at end of file +export type procNationTypeList = Record; + + +export type procArmTypeItem = { + armType: number, + armName: string, + values: procCrewTypeItem[], +} + +export type procCrewTypeItem = { + id: number, + reqTech: number, + reqYear: number, + notAvailable?: boolean, + baseRice: number, + baseCost: number, + name: string, + attack: number, + defence: number, + speed: number, + avoid: number, + img: string, + info: string[], +} \ No newline at end of file