From b3db97f4a833eac29424292df7d2bcb079069cc1 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 30 May 2020 16:31:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=A4=91=ED=8A=B9=EA=B8=B0=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_time_event.php | 2 + hwe/join_post.php | 2 +- hwe/sammo/ActionItem/event_전투특기_격노.php | 28 ++++++ hwe/sammo/ActionItem/event_전투특기_공성.php | 34 ++++++++ hwe/sammo/ActionItem/event_전투특기_궁병.php | 33 +++++++ hwe/sammo/ActionItem/event_전투특기_귀병.php | 33 +++++++ hwe/sammo/ActionItem/event_전투특기_기병.php | 33 +++++++ hwe/sammo/ActionItem/event_전투특기_돌격.php | 40 +++++++++ hwe/sammo/ActionItem/event_전투특기_무쌍.php | 28 ++++++ hwe/sammo/ActionItem/event_전투특기_반계.php | 37 ++++++++ hwe/sammo/ActionItem/event_전투특기_보병.php | 34 ++++++++ hwe/sammo/ActionItem/event_전투특기_신산.php | 35 ++++++++ hwe/sammo/ActionItem/event_전투특기_신중.php | 24 ++++++ hwe/sammo/ActionItem/event_전투특기_위압.php | 30 +++++++ hwe/sammo/ActionItem/event_전투특기_의술.php | 37 ++++++++ hwe/sammo/ActionItem/event_전투특기_저격.php | 27 ++++++ hwe/sammo/ActionItem/event_전투특기_집중.php | 24 ++++++ hwe/sammo/ActionItem/event_전투특기_징병.php | 32 +++++++ hwe/sammo/ActionItem/event_전투특기_척사.php | 25 ++++++ hwe/sammo/ActionItem/event_전투특기_필살.php | 32 +++++++ hwe/sammo/ActionItem/event_전투특기_환술.php | 27 ++++++ hwe/sammo/Command/General/che_인재탐색.php | 2 +- hwe/sammo/Event/Action/ChangeCity.php | 12 ++- hwe/sammo/Event/Action/CreateManyNPC.php | 2 +- hwe/sammo/Scenario/NPC.php | 8 +- hwe/scenario/default.json | 4 +- hwe/scenario/scenario_902.json | 91 ++++++++++++++++++++ 27 files changed, 709 insertions(+), 7 deletions(-) create mode 100644 hwe/sammo/ActionItem/event_전투특기_격노.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_공성.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_궁병.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_귀병.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_기병.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_돌격.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_무쌍.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_반계.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_보병.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_신산.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_신중.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_위압.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_의술.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_저격.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_집중.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_징병.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_척사.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_필살.php create mode 100644 hwe/sammo/ActionItem/event_전투특기_환술.php create mode 100644 hwe/scenario/scenario_902.json diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 0da4a28a..a419f5dd 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -78,6 +78,7 @@ function processGoldIncome() { // 실지급률 $ratio = $realoutcome / $originoutcome; } + $nation['gold'] = Util::valueFit($nation['gold'], GameConst::$basegold); $adminLog[] = StringUtil::padStringAlignRight((string)$nation['name'],12," ") ." // 세금 : ".StringUtil::padStringAlignRight((string)$income,6," ") ." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ") @@ -355,6 +356,7 @@ function processRiceIncome() { // 실지급률 $ratio = $realoutcome / $originoutcome; } + $nation['rice'] = Util::valueFit($nation['rice'], GameConst::$baserice); $adminLog[] = StringUtil::padStringAlignRight($nation['name'],12," ") ." // 세곡 : ".StringUtil::padStringAlignRight((string)$income,6," ") ." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ") diff --git a/hwe/join_post.php b/hwe/join_post.php index a16f9efd..3e343c27 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -169,7 +169,7 @@ if ($genius) { 'dex5'=>0 ]); } else { - $specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/4 - $relYear / 2), 3) + $age; + $specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/6 - $relYear / 2), 3) + $age; $special2 = GameConst::$defaultSpecialWar; } //내특 diff --git a/hwe/sammo/ActionItem/event_전투특기_격노.php b/hwe/sammo/ActionItem/event_전투특기_격노.php new file mode 100644 index 00000000..ee95b3a2 --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_격노.php @@ -0,0 +1,28 @@ +[전투] 성벽 공격 시 대미지 +100%'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + if(in_array($turnType, ['징병', '모병'])){ + if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_SIEGE) return $value * 0.9; + } + + return $value; + } + + public function getWarPowerMultiplier(WarUnit $unit):array{ + if($unit->getOppose() instanceof WarUnitCity){ + return [2, 1]; + } + return [1, 1]; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_궁병.php b/hwe/sammo/ActionItem/event_전투특기_궁병.php new file mode 100644 index 00000000..86fb4b1a --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_궁병.php @@ -0,0 +1,33 @@ +[전투] 회피 확률 +20%p'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + if(in_array($turnType, ['징병', '모병'])){ + if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_ARCHER) return $value * 0.9; + } + + return $value; + } + + public function onCalcStat(General $general, string $statName, $value, $aux=null){ + if($statName === 'warAvoidRatio'){ + return $value + 0.2; + } + return $value; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_귀병.php b/hwe/sammo/ActionItem/event_전투특기_귀병.php new file mode 100644 index 00000000..d3a68acf --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_귀병.php @@ -0,0 +1,33 @@ +[전투] 계략 성공 확률 +20%p'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + if(in_array($turnType, ['징병', '모병'])){ + if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_WIZARD) return $value * 0.9; + } + + return $value; + } + + public function onCalcStat(General $general, string $statName, $value, $aux=null){ + if($statName === 'warMagicSuccessProb'){ + return $value + 0.2; + } + return $value; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_기병.php b/hwe/sammo/ActionItem/event_전투특기_기병.php new file mode 100644 index 00000000..93606ec8 --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_기병.php @@ -0,0 +1,33 @@ +[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + if(in_array($turnType, ['징병', '모병'])){ + if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_CAVALRY) return $value * 0.9; + } + + return $value; + } + + public function getWarPowerMultiplier(WarUnit $unit):array{ + if($unit->isAttacker()){ + return [1.2, 1]; + } + return [1.1, 1]; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_돌격.php b/hwe/sammo/ActionItem/event_전투특기_돌격.php new file mode 100644 index 00000000..1a812075 --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_돌격.php @@ -0,0 +1,40 @@ +isAttacker()){ + return [1.1, 1]; + } + return [1, 1]; + } + + public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ + return new WarUnitTriggerCaller( + (new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '회피불가'))->setPriority(BaseWarUnitTrigger::PRIORITY_BEGIN + 200) + ); + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_무쌍.php b/hwe/sammo/ActionItem/event_전투특기_무쌍.php new file mode 100644 index 00000000..cd594f34 --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_무쌍.php @@ -0,0 +1,28 @@ +[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + if(in_array($turnType, ['징병', '모병'])){ + if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_FOOTMAN) return $value * 0.9; + } + + return $value; + } + + public function getWarPowerMultiplier(WarUnit $unit):array{ + if($unit->isAttacker()){ + return [1, 0.9]; + } + return [1, 0.8]; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_신산.php b/hwe/sammo/ActionItem/event_전투특기_신산.php new file mode 100644 index 00000000..c634360a --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_신산.php @@ -0,0 +1,35 @@ +[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + if($turnType == '계략'){ + if($varType == 'success') return $value + 0.1; + } + + return $value; + } + + public function onCalcStat(General $general, string $statName, $value, $aux=null){ + if($statName === 'warMagicTrialProb'){ + return $value + 0.2; + } + if($statName === 'warMagicSuccessProb'){ + return $value + 0.2; + } + return $value; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_신중.php b/hwe/sammo/ActionItem/event_전투특기_신중.php new file mode 100644 index 00000000..7ccc75ca --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_신중.php @@ -0,0 +1,24 @@ +getPhase() != 0){ + return null; + } + return new WarUnitTriggerCaller( + new che_위압시도($unit), + new che_위압발동($unit) + ); + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_의술.php b/hwe/sammo/ActionItem/event_전투특기_의술.php new file mode 100644 index 00000000..4d1e6f1f --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_의술.php @@ -0,0 +1,37 @@ +[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'; + protected $cost = 100; + protected $buyable = true; + protected $consumable = false; + + public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{ + return new GeneralTriggerCaller( + new GeneralTrigger\che_도시치료($general) + ); + } + + public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller + { + return new WarUnitTriggerCaller( + new che_전투치료시도($unit), + new che_전투치료발동($unit) + ); + } +} diff --git a/hwe/sammo/ActionItem/event_전투특기_저격.php b/hwe/sammo/ActionItem/event_전투특기_저격.php new file mode 100644 index 00000000..b7dab2b8 --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_저격.php @@ -0,0 +1,27 @@ +getOppose()->getCrewType(); + if($opposeCrewType->reqCities || $opposeCrewType->reqRegions){ + return [1.1, 0.9]; + } + return [1, 1]; + } +} \ No newline at end of file diff --git a/hwe/sammo/ActionItem/event_전투특기_필살.php b/hwe/sammo/ActionItem/event_전투특기_필살.php new file mode 100644 index 00000000..bdedf046 --- /dev/null +++ b/hwe/sammo/ActionItem/event_전투특기_필살.php @@ -0,0 +1,32 @@ +setExpDed($avgGen['exp'], $avgGen['ded']); $newNPC->setSpecYear( Util::round((GameConst::$retirementYear - $age) / 12) + $age, - Util::round((GameConst::$retirementYear - $age) / 3) + $age + Util::round((GameConst::$retirementYear - $age) / 6) + $age ); $newNPC->setDex( $dexVal[0], diff --git a/hwe/sammo/Event/Action/ChangeCity.php b/hwe/sammo/Event/Action/ChangeCity.php index 97cb627e..3d2dfdb3 100644 --- a/hwe/sammo/Event/Action/ChangeCity.php +++ b/hwe/sammo/Event/Action/ChangeCity.php @@ -12,7 +12,8 @@ class ChangeCity extends \sammo\Event\Action{ 'secu'=>true, 'trust'=>true, 'def'=>true, - 'wall'=>true + 'wall'=>true, + 'trade'=>true, ]; const REGEXP_PERCENT = '/^(\d+(\.\d+)?)%$/';// 123.5% [1]=float const REGEXP_MATH = '/^([\+\-\/\*])(\d+(\.\d+)?)$/'; //+30 [1]=기호, [2]=float @@ -53,6 +54,15 @@ class ChangeCity extends \sammo\Event\Action{ $queries['trust'] = $this->genSQLTrust($value); continue; } + if($key == 'trade'){ + if($value === null){ + $queries['trade'] = null; + } + else{ + $queries['trade'] = Util::valueFit((float)$value, 95, 105); + } + continue; + } $queries[$key] = $this->genSQLGeneric($key, $value); } diff --git a/hwe/sammo/Event/Action/CreateManyNPC.php b/hwe/sammo/Event/Action/CreateManyNPC.php index 47d7aeea..93c015db 100644 --- a/hwe/sammo/Event/Action/CreateManyNPC.php +++ b/hwe/sammo/Event/Action/CreateManyNPC.php @@ -74,7 +74,7 @@ class CreateManyNPC extends \sammo\Event\Action{ $newNPC->setExpDed(0, 0); $newNPC->setSpecYear( Util::round((GameConst::$retirementYear - $age) / 12) + $age, - Util::round((GameConst::$retirementYear - $age) / 3) + $age + Util::round((GameConst::$retirementYear - $age) / 6) + $age ); $newNPC->build($env); diff --git a/hwe/sammo/Scenario/NPC.php b/hwe/sammo/Scenario/NPC.php index 3ce630b2..c0edc641 100644 --- a/hwe/sammo/Scenario/NPC.php +++ b/hwe/sammo/Scenario/NPC.php @@ -123,7 +123,13 @@ class NPC{ $this->charDomestic = SpecialityHelper::getDomesticClassByName($char); } catch (\Exception $e) { - $this->charWar = SpecialityHelper::getWarClassByName($char); + try{ + $this->charWar = SpecialityHelper::getWarClassByName($char); + } + catch (\Exception $e){ + + } + } } } diff --git a/hwe/scenario/default.json b/hwe/scenario/default.json index 40a724c6..74a6e290 100644 --- a/hwe/scenario/default.json +++ b/hwe/scenario/default.json @@ -3,8 +3,8 @@ "total":150, "min":10, "max":75, - "npcTotal":155, - "npcMax":75, + "npcTotal":148, + "npcMax":73, "npcMin":10, "chiefMin":65 }, diff --git a/hwe/scenario/scenario_902.json b/hwe/scenario/scenario_902.json new file mode 100644 index 00000000..6d8121d6 --- /dev/null +++ b/hwe/scenario/scenario_902.json @@ -0,0 +1,91 @@ +{ + "title":"【공백지】 천지비급", + "startYear":180, + "map":{ + "mapName":"miniche_b" + }, + "history":[ + ], + "const": { + "expandCityPopIncreaseAmount": 80000, + "expandCityDevelIncreaseAmount": 1350, + "expandCityWallIncreaseAmount": 1600, + "defaultMaxGeneral":300, + "joinRuinedNPCProp":0, + "availableSpecialWar":[ + "che_귀병", "che_신산", "che_환술", "che_집중", "che_신중", "che_반계", + "che_보병", "che_궁병", "che_기병", "che_공성", + "che_돌격", "che_무쌍", "che_위압", + "che_저격", "che_필살", "che_징병", "che_의술", "che_격노", "che_척사" + ], + "allItems":{ + "horse":{ + "che_명마_01_노기":0, "che_명마_02_조랑":0, "che_명마_03_노새":0, + "che_명마_04_나귀":0, "che_명마_05_갈색마":0, "che_명마_06_흑색마":0, + + "che_명마_07_백마":2, "che_명마_07_기주마":2, + "che_명마_08_양주마":2, "che_명마_09_과하마":2, + "che_명마_10_대완마":2, "che_명마_11_서량마":2, + "che_명마_12_사륜거":2, "che_명마_13_절영":1, "che_명마_13_적로":1, + "che_명마_14_적란마":1, "che_명마_14_조황비전":1, "che_명마_15_한혈마":1, "che_명마_15_적토마":1 + }, + "weapon":{ + "che_무기_01_단도":0, "che_무기_02_단궁":0, "che_무기_03_단극":0, + "che_무기_04_목검":0, "che_무기_05_죽창":0, "che_무기_06_소부":0, + + "che_무기_07_동추":1, "che_무기_07_철편":1, "che_무기_07_철쇄":1, "che_무기_07_맥궁":1, + "che_무기_08_유성추":1, "che_무기_08_철질여골":1, "che_무기_09_쌍철극":1, "che_무기_09_동호비궁":1, + "che_무기_10_삼첨도":1, "che_무기_10_대부":1, "che_무기_11_고정도":1, "che_무기_11_이광궁":1, + "che_무기_12_철척사모":1, "che_무기_12_칠성검":1, "che_무기_13_사모":1, "che_무기_13_양유기궁":1, + "che_무기_14_언월도":1, "che_무기_14_방천화극":1, "che_무기_15_청홍검":1, "che_무기_15_의천검":1 + }, + "book":{ + "che_서적_01_효경전":0, "che_서적_02_회남자":0, "che_서적_03_변도론":0, + "che_서적_04_건상역주":0, "che_서적_05_여씨춘추":0, "che_서적_06_사민월령":0, + + "che_서적_07_위료자":1, "che_서적_07_사마법":1, "che_서적_07_한서":1, "che_서적_07_논어":1, + "che_서적_08_전론":1, "che_서적_08_사기":1, "che_서적_09_장자":1, "che_서적_09_역경":1, + "che_서적_10_시경":1, "che_서적_10_구국론":1, "che_서적_11_상군서":1, "che_서적_11_춘추전":1, + "che_서적_12_산해경":1, "che_서적_12_맹덕신서":1, "che_서적_13_관자":1, "che_서적_13_병법24편":1, + "che_서적_14_한비자":1, "che_서적_14_오자병법":1, "che_서적_15_노자":1, "che_서적_15_손자병법":1 + }, + "item":{ + "che_치료_환약":0, "che_저격_수극":0, "che_사기_탁주":0, + "che_훈련_청주":0, "che_계략_이추":0, "che_계략_향낭":0, + + "event_전투특기_격노":0, "event_전투특기_공성":0, "event_전투특기_궁병":0, + "event_전투특기_귀병":0, "event_전투특기_기병":0, "event_전투특기_돌격":0, "event_전투특기_무쌍":0, + "event_전투특기_반계":0, "event_전투특기_보병":0, "event_전투특기_신산":0, "event_전투특기_신중":0, + "event_전투특기_위압":0, "event_전투특기_의술":0, "event_전투특기_저격":0, "event_전투특기_집중":0, + "event_전투특기_징병":0, "event_전투특기_척사":0, "event_전투특기_필살":0, "event_전투특기_환술":0 + } + } + }, + "initialEvents":[ + [ + true, + ["CreateManyNPC", 250] + ] + ], + "events":[ + [ + ["Date", "==", null, 12], + ["CreateManyNPC", 10], + ["DeleteEvent"] + ], + [ + ["Date", "==", 182, 1], + ["ChangeCity", "occupied", { + "trade":100 + }], + ["DeleteEvent"] + ], + [ + ["Date", "==", 182, 7], + ["ChangeCity", "occupied", { + "trade":100 + }], + ["DeleteEvent"] + ] + ] +} \ No newline at end of file