특기 획득 구조 변경
This commit is contained in:
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class None implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class None extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 0;
|
||||
protected $name = '-';
|
||||
protected $info = '';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 0;
|
||||
static $type = [
|
||||
SpecialityConst::DISABLED
|
||||
SpecialityHelper::DISABLED
|
||||
];
|
||||
|
||||
}
|
||||
@@ -2,16 +2,15 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_거상 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_거상 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 999;
|
||||
protected $name = '거상';
|
||||
protected $info = '<비활성화>';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 0;
|
||||
static $type = [];
|
||||
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_경작 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_경작 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 1;
|
||||
protected $name = '경작';
|
||||
protected $info = '[내정] 농지 개간 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_귀모 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_귀모 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 31;
|
||||
protected $name = '귀모';
|
||||
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_PERCENT;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_PERCENT;
|
||||
static $selectWeight = 2.5;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_발명 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_발명 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 3;
|
||||
protected $name = '발명';
|
||||
protected $info = '[내정] 기술 연구 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_상재 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_상재 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 2;
|
||||
protected $name = '상재';
|
||||
protected $info = '[내정] 상업 투자 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_수비 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_수비 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 11;
|
||||
protected $name = '수비';
|
||||
protected $info = '[내정] 수비 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_인덕 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_인덕 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 20;
|
||||
protected $name = '인덕';
|
||||
protected $info = '[내정] 주민 선정·정착 장려 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP
|
||||
SpecialityHelper::STAT_LEADERSHIP
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_축성 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_축성 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 10;
|
||||
protected $name = '축성';
|
||||
protected $info = '[내정] 기술 연구 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialDomestic;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class che_통찰 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_통찰 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 12;
|
||||
protected $name = '통찰';
|
||||
protected $info = '[내정] 치안 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class None implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class None extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 0;
|
||||
protected $name = '-';
|
||||
protected $info = '';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 0;
|
||||
static $type = [
|
||||
SpecialityConst::DISABLED
|
||||
SpecialityHelper::DISABLED
|
||||
];
|
||||
|
||||
}
|
||||
@@ -2,25 +2,24 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
use sammo\WarUnitTriggerCaller;
|
||||
use sammo\WarUnitTrigger\che_격노시도;
|
||||
use sammo\WarUnitTrigger\che_격노발동;
|
||||
|
||||
class che_격노 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_격노 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 74;
|
||||
protected $name = '격노';
|
||||
protected $info = '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
|
||||
@@ -2,24 +2,23 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
use sammo\WarUnitTriggerCaller;
|
||||
use sammo\BaseWarUnitTrigger;
|
||||
use sammo\WarUnitTrigger\WarActivateSkills;
|
||||
|
||||
class che_견고 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_견고 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 62;
|
||||
protected $name = '견고';
|
||||
protected $info = '[전투] 상대 필살 불가, 상대 계략 시도시 성공 확률 -10%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
|
||||
@@ -2,24 +2,23 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\GameUnitConst;
|
||||
use \sammo\WarUnit;
|
||||
use \sammo\WarUnitCity;
|
||||
|
||||
class che_공성 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_공성 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 53;
|
||||
protected $name = '공성';
|
||||
protected $info = '[군사] 차병 계통 징·모병비 -10%<br>[전투] 성벽 공격 시 대미지 +100%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_SIEGE,
|
||||
SpecialityConst::STAT_STRENGTH | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_SIEGE,
|
||||
SpecialityConst::STAT_INTEL | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_SIEGE,
|
||||
SpecialityHelper::STAT_LEADERSHIP | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_SIEGE,
|
||||
SpecialityHelper::STAT_STRENGTH | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_SIEGE,
|
||||
SpecialityHelper::STAT_INTEL | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_SIEGE,
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
use \sammo\GameUnitConst;
|
||||
|
||||
class che_궁병 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_궁병 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 51;
|
||||
protected $name = '궁병';
|
||||
protected $info = '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_ARCHER,
|
||||
SpecialityConst::STAT_STRENGTH | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_ARCHER
|
||||
SpecialityHelper::STAT_LEADERSHIP | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_ARCHER,
|
||||
SpecialityHelper::STAT_STRENGTH | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_ARCHER
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\GameUnitConst;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_귀병 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_귀병 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 40;
|
||||
protected $name = '귀병';
|
||||
protected $info = '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL | SpecialityConst::ARMY_WIZARD | SpecialityConst::REQ_DEXTERITY
|
||||
SpecialityHelper::STAT_INTEL | SpecialityHelper::ARMY_WIZARD | SpecialityHelper::REQ_DEXTERITY
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\GameUnitConst;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_기병 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_기병 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 52;
|
||||
protected $name = '기병';
|
||||
protected $info = '[군사] 기병 계통 징·모병비 -10%<br>[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_CAVALRY,
|
||||
SpecialityConst::STAT_STRENGTH | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_CAVALRY
|
||||
SpecialityHelper::STAT_LEADERSHIP | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_CAVALRY,
|
||||
SpecialityHelper::STAT_STRENGTH | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_CAVALRY
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,24 +2,23 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
use \sammo\BaseWarUnitTrigger;
|
||||
use \sammo\WarUnitTriggerCaller;
|
||||
use sammo\WarUnitTrigger\WarActivateSkills;
|
||||
|
||||
class che_돌격 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_돌격 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 60;
|
||||
protected $name = '돌격';
|
||||
protected $info = '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_무쌍 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_무쌍 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 61;
|
||||
protected $name = '무쌍';
|
||||
protected $info = '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
use sammo\WarUnitTriggerCaller;
|
||||
use \sammo\BaseWarUnitTrigger;
|
||||
@@ -10,17 +10,16 @@ use \sammo\WarUnitTrigger\WarActivateSkills;
|
||||
use \sammo\WarUnitTrigger\che_반계시도;
|
||||
use \sammo\WarUnitTrigger\che_반계발동;
|
||||
|
||||
class che_반계 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_반계 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 45;
|
||||
protected $name = '반계';
|
||||
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL,
|
||||
SpecialityHelper::STAT_INTEL,
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\GameUnitConst;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_보병 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_보병 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 50;
|
||||
protected $name = '보병';
|
||||
protected $info = '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_FOOTMAN,
|
||||
SpecialityConst::STAT_STRENGTH | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_FOOTMAN
|
||||
SpecialityHelper::STAT_LEADERSHIP | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_FOOTMAN,
|
||||
SpecialityHelper::STAT_STRENGTH | SpecialityHelper::REQ_DEXTERITY | SpecialityHelper::ARMY_FOOTMAN
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_신산 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_신산 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 41;
|
||||
protected $name = '신산';
|
||||
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL,
|
||||
SpecialityHelper::STAT_INTEL,
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_신중 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_신중 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 44;
|
||||
protected $name = '신중';
|
||||
protected $info = '[전투] 계략 성공 확률 100%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL,
|
||||
SpecialityHelper::STAT_INTEL,
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -2,24 +2,23 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
use sammo\WarUnitTriggerCaller;
|
||||
use \sammo\WarUnitTrigger\che_위압시도;
|
||||
use \sammo\WarUnitTrigger\che_위압발동;
|
||||
|
||||
class che_위압 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_위압 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 63;
|
||||
protected $name = '위압';
|
||||
protected $info = '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH
|
||||
];
|
||||
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use sammo\BaseGeneralTrigger;
|
||||
use sammo\SpecialityConst;
|
||||
use sammo\SpecialityHelper;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
use \sammo\GeneralTriggerCaller;
|
||||
@@ -11,19 +11,18 @@ use sammo\WarUnitTrigger\che_전투치료발동;
|
||||
use sammo\WarUnitTrigger\che_전투치료시도;
|
||||
use sammo\WarUnitTriggerCaller;
|
||||
|
||||
class che_의술 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_의술 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 73;
|
||||
protected $name = '의술';
|
||||
protected $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_PERCENT;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_PERCENT;
|
||||
static $selectWeight = 2;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
|
||||
@@ -2,25 +2,24 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
use sammo\WarUnitTriggerCaller;
|
||||
use \sammo\WarUnitTrigger\che_저격시도;
|
||||
use \sammo\WarUnitTrigger\che_저격발동;
|
||||
|
||||
class che_저격 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_저격 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 70;
|
||||
protected $name = '저격';
|
||||
protected $info = '[전투] 전투 개시 시 1/3 확률로 저격 발동';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_집중 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_집중 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 43;
|
||||
protected $name = '집중';
|
||||
protected $info = '[전투] 계략 성공 시 대미지 +50%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL,
|
||||
SpecialityHelper::STAT_INTEL,
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_징병 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_징병 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 72;
|
||||
protected $name = '징병';
|
||||
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +15%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_척사 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_척사 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 75;
|
||||
protected $name = '척사';
|
||||
protected $info = '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_필살 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_필살 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 71;
|
||||
protected $name = '필살';
|
||||
protected $info = '[전투] 필살 확률 +20%p';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||
static $selectWeight = 1;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_LEADERSHIP,
|
||||
SpecialityConst::STAT_STRENGTH,
|
||||
SpecialityConst::STAT_INTEL
|
||||
SpecialityHelper::STAT_LEADERSHIP,
|
||||
SpecialityHelper::STAT_STRENGTH,
|
||||
SpecialityHelper::STAT_INTEL
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
namespace sammo\ActionSpecialWar;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
use \sammo\WarUnit;
|
||||
|
||||
class che_환술 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_환술 extends \sammo\BaseSpecial{
|
||||
|
||||
protected $id = 42;
|
||||
protected $name = '환술';
|
||||
protected $info = '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%';
|
||||
|
||||
static $selectWeightType = SpecialityConst::WEIGHT_PERCENT;
|
||||
static $selectWeightType = SpecialityHelper::WEIGHT_PERCENT;
|
||||
static $selectWeight = 5;
|
||||
static $type = [
|
||||
SpecialityConst::STAT_INTEL,
|
||||
SpecialityHelper::STAT_INTEL,
|
||||
];
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
abstract class BaseSpecial implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
protected $id = 0;
|
||||
protected $name = '-';
|
||||
protected $info = '';
|
||||
|
||||
/** @var int */
|
||||
static $selectWeightType;
|
||||
/** @var int */
|
||||
static $selectWeight;
|
||||
/** @var int[] */
|
||||
static $type;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class ReqGeneralCrewMargin extends Constraint{
|
||||
$reqCrewType = GameUnitConst::byID($this->arg);
|
||||
|
||||
//XXX: 왜 General -> obj -> General 변환을 하고 있나?
|
||||
$generalObj = new General($this->general, null, null, null, false);
|
||||
$generalObj = new General($this->general, null, null, null, null, false);
|
||||
|
||||
if($reqCrewType->id != $generalObj->getCrewTypeObj()->id){
|
||||
return true;
|
||||
|
||||
@@ -148,25 +148,33 @@ class GameConstBase
|
||||
/** @var array 기본 국가 성향 */
|
||||
public static $neutralNationType = 'che_중립';
|
||||
|
||||
/** @var array 기본 내정 특기 */
|
||||
/** @var string 기본 내정 특기 */
|
||||
public static $defaultSpecialDomestic = 'None';
|
||||
/** @var array 선택 가능한 장수 내정 특기 */
|
||||
public static $availableSpecialDomestic = [
|
||||
'che_경작', 'che_상재', 'che_발명', 'che_축성', 'che_수비', 'che_통찰', 'che_인덕', 'che_귀모',
|
||||
];
|
||||
/** @var array 선택할 수 없으나 게임 내에 유효한 장수 내정 특기 */
|
||||
public static $optionalSpecialDomestic = [
|
||||
'None',
|
||||
];
|
||||
|
||||
/** @var array 기본 전투 특기 */
|
||||
/** @var string 기본 전투 특기 */
|
||||
public static $defaultSpecialWar = 'None';
|
||||
/** @var array 선택 가능한 장수 내정 특기 */
|
||||
/** @var array 선택 가능한 장수 전투 특기 */
|
||||
public static $availableSpecialWar = [
|
||||
'che_귀병', 'che_신산', 'che_환술', 'che_집중', 'che_신중', 'che_반계',
|
||||
'che_보병', 'che_궁병', 'che_기병', 'che_공성',
|
||||
'che_돌격', 'che_무쌍', 'che_견고', 'che_위압',
|
||||
'che_저격', 'che_필살', 'che_징병', 'che_의술', 'che_격노', 'che_척사',
|
||||
];
|
||||
/** @var array 선택할 수 없으나 게임 내에 유효한 장수 전투 특기 */
|
||||
public static $optionalSpecialWar = [
|
||||
'None',
|
||||
];
|
||||
|
||||
|
||||
/** @var array 기본 성향(공용) */
|
||||
/** @var string 기본 성향(공용) */
|
||||
public static $neutralPersonality = 'None';
|
||||
/** @var array 선택 가능한 성향 */
|
||||
public static $availablePersonality = [
|
||||
@@ -174,9 +182,8 @@ class GameConstBase
|
||||
'che_패권', 'che_의협', 'che_대의', 'che_왕좌'
|
||||
];
|
||||
/** @var array 존재하는 모든 성향 */
|
||||
public static $allPersonality = [
|
||||
'che_안전', 'che_유지', 'che_재간', 'che_출세', 'che_할거', 'che_정복',
|
||||
'che_패권', 'che_의협', 'che_대의', 'che_왕좌', 'che_은둔', 'None'
|
||||
public static $optionalPersonality = [
|
||||
'che_은둔', 'None'
|
||||
];
|
||||
|
||||
public static $allItems = [
|
||||
|
||||
@@ -83,10 +83,13 @@ class General implements iAction{
|
||||
* @param int $month 게임 월
|
||||
* @param bool $fullConstruct iAction, 및 ActionLogger 초기화 여부, false인 경우 no, name, city, nation, officer_level 정도로 초기화 가능
|
||||
*/
|
||||
public function __construct(array $raw, ?array $rawRank, ?array $city, ?int $year, ?int $month, bool $fullConstruct=true){
|
||||
public function __construct(array $raw, ?array $rawRank, ?array $city, ?array $nation, ?int $year, ?int $month, bool $fullConstruct=true){
|
||||
//TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함.
|
||||
|
||||
$staticNation = getNationStaticInfo($raw['nation']);
|
||||
if($nation === null){
|
||||
$nation = getNationStaticInfo($raw['nation']);
|
||||
}
|
||||
|
||||
$this->raw = $raw;
|
||||
$this->rawCity = $city;
|
||||
|
||||
@@ -107,8 +110,8 @@ class General implements iAction{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->nationType = buildNationTypeClass($staticNation['type']);
|
||||
$this->officerLevelObj = new TriggerOfficerLevel($this->raw, $staticNation['level']);
|
||||
$this->nationType = buildNationTypeClass($nation['type']);
|
||||
$this->officerLevelObj = new TriggerOfficerLevel($this->raw, $nation['level']);
|
||||
|
||||
$this->specialDomesticObj = buildGeneralSpecialDomesticClass($raw['special']);
|
||||
$this->specialWarObj = buildGeneralSpecialWarClass($raw['special2']);
|
||||
|
||||
@@ -7,7 +7,7 @@ use \sammo\CityHelper;
|
||||
use \sammo\GameUnitConst;
|
||||
use \sammo\CityConst;
|
||||
use \sammo\GameConst;
|
||||
use \sammo\SpecialityConst;
|
||||
use \sammo\SpecialityHelper;
|
||||
|
||||
class NPC{
|
||||
|
||||
@@ -101,17 +101,17 @@ class NPC{
|
||||
$this->charWar = GameConst::$defaultSpecialWar;
|
||||
|
||||
if($char === '랜덤전특'){
|
||||
$this->charWar = SpecialityConst::pickSpecialWar($general);
|
||||
$this->charWar = SpecialityHelper::pickSpecialWar($general);
|
||||
}
|
||||
else if($char === '랜덤내특'){
|
||||
$this->charDomestic = SpecialityConst::pickSpecialDomestic($general);
|
||||
$this->charDomestic = SpecialityHelper::pickSpecialDomestic($general);
|
||||
}
|
||||
else if($char === '랜덤'){
|
||||
if(Util::randBool(2/3)){
|
||||
$this->charWar = SpecialityConst::pickSpecialWar($general);
|
||||
$this->charWar = SpecialityHelper::pickSpecialWar($general);
|
||||
}
|
||||
else{
|
||||
$this->charDomestic = SpecialityConst::pickSpecialDomestic($general);
|
||||
$this->charDomestic = SpecialityHelper::pickSpecialDomestic($general);
|
||||
}
|
||||
}
|
||||
else if($char === null){
|
||||
@@ -120,12 +120,10 @@ class NPC{
|
||||
//TODO: 내특, 전특 구분 필요
|
||||
|
||||
try{
|
||||
$domesticClass = \sammo\getGeneralSpecialDomesticClass($char);
|
||||
$this->charDomestic = Util::getClassName($domesticClass);
|
||||
$this->charDomestic = SpecialityHelper::getDomesticClassByName($char);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
$warClass = \sammo\getGeneralSpecialWarClass($char);
|
||||
$this->charWar = Util::getClassName($warClass);
|
||||
$this->charWar = SpecialityHelper::getWarClassByName($char);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
//TODO: 나중에는 각 내특, 전특이 클래스로 가야함
|
||||
class SpecialityConst{
|
||||
//const GENERIC = 0x0;
|
||||
const DISABLED = 0x1;
|
||||
|
||||
const STAT_LEADERSHIP = 0x2;
|
||||
const STAT_STRENGTH = 0x4;
|
||||
const STAT_INTEL = 0x8;
|
||||
|
||||
const ARMY_FOOTMAN = 0x100;
|
||||
const ARMY_ARCHER = 0x200;
|
||||
const ARMY_CAVALRY = 0x400;
|
||||
const ARMY_WIZARD = 0x800;
|
||||
const ARMY_SIEGE = 0x1000;
|
||||
|
||||
const REQ_DEXTERITY = 0x4000;
|
||||
|
||||
const WEIGHT_NORM = 1;
|
||||
const WEIGHT_PERCENT = 2;
|
||||
|
||||
private $invDomestic = null;
|
||||
private $invWar = null;
|
||||
|
||||
private function __construct(){
|
||||
}
|
||||
|
||||
//음수 : 절대값 %, 양수 : 상대적 비중
|
||||
const DOMESTIC = [
|
||||
'che_경작' => ['경작', 1, [self::STAT_INTEL]],
|
||||
'che_상재' => ['상재', 1, [self::STAT_INTEL]],
|
||||
'che_발명' => ['발명', 1, [self::STAT_INTEL]],
|
||||
|
||||
'che_축성' => ['축성', 1, [self::STAT_STRENGTH]],
|
||||
'che_수비' => ['수비', 1, [self::STAT_STRENGTH]],
|
||||
'che_통찰' => ['통찰', 1, [self::STAT_STRENGTH]],
|
||||
|
||||
'che_인덕' => ['인덕', 1, [self::STAT_LEADERSHIP]],
|
||||
|
||||
'che_귀모' => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
];
|
||||
|
||||
const WAR = [
|
||||
'che_귀병' => ['귀병', 1, [self::STAT_INTEL | self::ARMY_WIZARD | self::REQ_DEXTERITY]],
|
||||
|
||||
'che_신산' => ['신산', 1, [self::STAT_INTEL]],
|
||||
'che_환술' => ['환술', -5, [self::STAT_INTEL]],
|
||||
'che_집중' => ['집중', 1, [self::STAT_INTEL]],
|
||||
'che_신중' => ['신중', 1, [self::STAT_INTEL]],
|
||||
'che_반계' => ['반계', 1, [self::STAT_INTEL]],
|
||||
|
||||
'che_보병' => ['보병', 1, [
|
||||
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_FOOTMAN,
|
||||
self::STAT_STRENGTH | self::REQ_DEXTERITY | self::ARMY_FOOTMAN
|
||||
]],
|
||||
'che_궁병' => ['궁병', 1, [
|
||||
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_ARCHER,
|
||||
self::STAT_STRENGTH | self::REQ_DEXTERITY | self::ARMY_ARCHER
|
||||
]],
|
||||
'che_기병' => ['기병', 1, [
|
||||
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_CAVALRY,
|
||||
self::STAT_STRENGTH | self::REQ_DEXTERITY | self::ARMY_CAVALRY
|
||||
]],
|
||||
'che_공성' => ['공성', 1, [
|
||||
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_SIEGE,
|
||||
self::STAT_STRENGTH | self::REQ_DEXTERITY | self::ARMY_SIEGE,
|
||||
self::STAT_INTEL | self::REQ_DEXTERITY | self::ARMY_SIEGE
|
||||
]],
|
||||
|
||||
'che_돌격' => ['돌격', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH]],
|
||||
'che_무쌍' => ['무쌍', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH]],
|
||||
'che_견고' => ['견고', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH]],
|
||||
'che_위압' => ['위압', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH]],
|
||||
|
||||
'che_저격' => ['저격', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
'che_필살' => ['필살', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
'che_징병' => ['징병', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
'che_의술' => ['의술', -2, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
'che_격노' => ['격노', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
'che_척사' => ['척사', 1, [self::STAT_LEADERSHIP, self::STAT_STRENGTH, self::STAT_INTEL]],
|
||||
];
|
||||
|
||||
public static function getInvDomestic(string $name){
|
||||
if(static::$invDomestic !== null){
|
||||
return static::$invDomestic[$name]??null;
|
||||
}
|
||||
|
||||
$invDomestic = [];
|
||||
foreach(static::DOMESTIC as $key=>$val){
|
||||
$nameKey = $val[0];
|
||||
$val[0] = $key;
|
||||
$invDomestic[$nameKey] = $val;
|
||||
}
|
||||
static::$invDomestic = $invDomestic;
|
||||
|
||||
return static::$invDomestic[$name]??null;
|
||||
}
|
||||
|
||||
public static function getInvWar(string $name){
|
||||
if(static::$invWar !== null){
|
||||
return static::$invWar[$name]??null;
|
||||
}
|
||||
|
||||
$invWar = [];
|
||||
foreach(static::WAR as $key=>$val){
|
||||
$nameKey = $val[0];
|
||||
$val[0] = $key;
|
||||
$invWar[$nameKey] = $val;
|
||||
}
|
||||
static::$invWar = $invWar;
|
||||
|
||||
return static::$invWar[$name]??null;
|
||||
}
|
||||
|
||||
private static function calcCondGeneric(array $general) : int {
|
||||
$myCond = 0;
|
||||
|
||||
$leadership = $general['leadership']??50;
|
||||
$strength = $general['strength']??50;
|
||||
$intel = $general['intel']??50;
|
||||
|
||||
if ($leadership * 0.95 > $strength && $leadership * 0.95 > $intel) {
|
||||
$myCond |= self::STAT_LEADERSHIP;
|
||||
}
|
||||
else if($strength >= $intel){
|
||||
$myCond |= self::STAT_STRENGTH;
|
||||
}
|
||||
else {
|
||||
$myCond |= self::STAT_INTEL;
|
||||
}
|
||||
|
||||
return $myCond;
|
||||
}
|
||||
|
||||
private static function calcCondDexterity(array $general) : int {
|
||||
$dex = [
|
||||
static::ARMY_FOOTMAN => $general['dex1']??0,
|
||||
static::ARMY_ARCHER => $general['dex2']??0,
|
||||
static::ARMY_CAVALRY => $general['dex3']??0,
|
||||
static::ARMY_WIZARD => $general['dex4']??0,
|
||||
static::ARMY_SIEGE => $general['dex5']??0,
|
||||
];
|
||||
|
||||
$dexSum = array_sum($dex);
|
||||
$dexBase = Util::round(sqrt($dexSum) / 4);
|
||||
|
||||
if(Util::randBool(0.8)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(mt_rand(0, 99) < $dexBase){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!$dexSum){
|
||||
return array_rand($dex);
|
||||
}
|
||||
|
||||
return array_keys($dex, max($dex))[0];
|
||||
}
|
||||
|
||||
public static function pickSpecialDomestic(array $general) : string{
|
||||
$pAbs = [];
|
||||
$pRel = [];
|
||||
|
||||
$myCond = static::calcCondGeneric($general);
|
||||
|
||||
foreach(self::DOMESTIC as $id=>list($name, $weight, $conds)){
|
||||
$valid = false;
|
||||
foreach($conds as $cond){
|
||||
if($cond === ($cond & $myCond)){
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$valid){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if($weight < 0){
|
||||
$pAbs[$id] = -$weight;
|
||||
}
|
||||
else{
|
||||
$pRel[$id] = $weight;
|
||||
}
|
||||
}
|
||||
|
||||
if($pAbs){
|
||||
if($pRel){
|
||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||
}
|
||||
$id = Util::choiceRandomUsingWeight($pAbs);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
$id = Util::choiceRandomUsingWeight($pRel);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
|
||||
throw new MustNotBeReachedException();
|
||||
}
|
||||
|
||||
public static function pickSpecialWar(array $general) : string{
|
||||
$reqDex = [];
|
||||
$pAbs = [];
|
||||
$pRel = [];
|
||||
|
||||
$myCond = static::calcCondGeneric($general);
|
||||
$myCond |= static::calcCondDexterity($general);
|
||||
|
||||
foreach(self::WAR as $id=>list($name, $weight, $conds)){
|
||||
$valid = false;
|
||||
foreach($conds as $cond){
|
||||
if($cond === ($cond & $myCond)){
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$valid){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($cond & self::REQ_DEXTERITY){
|
||||
$reqDex[$id] = $weight;
|
||||
}
|
||||
else if($weight < 0){
|
||||
$pAbs[$id] = -$weight;
|
||||
}
|
||||
else{
|
||||
$pRel[$id] = $weight;
|
||||
}
|
||||
}
|
||||
|
||||
if($reqDex){
|
||||
return Util::choiceRandomUsingWeight($reqDex);
|
||||
}
|
||||
|
||||
if($pAbs){
|
||||
if($pRel){
|
||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||
}
|
||||
|
||||
$id = Util::choiceRandomUsingWeight($pAbs);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
$id = Util::choiceRandomUsingWeight($pRel);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
|
||||
throw new MustNotBeReachedException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class SpecialityHelper{
|
||||
//const GENERIC = 0x0;
|
||||
const DISABLED = 0x1;
|
||||
|
||||
const STAT_LEADERSHIP = 0x2;
|
||||
const STAT_STRENGTH = 0x4;
|
||||
const STAT_INTEL = 0x8;
|
||||
|
||||
const ARMY_FOOTMAN = 0x100;
|
||||
const ARMY_ARCHER = 0x200;
|
||||
const ARMY_CAVALRY = 0x400;
|
||||
const ARMY_WIZARD = 0x800;
|
||||
const ARMY_SIEGE = 0x1000;
|
||||
|
||||
const REQ_DEXTERITY = 0x4000;
|
||||
|
||||
const WEIGHT_NORM = 1;
|
||||
const WEIGHT_PERCENT = 2;
|
||||
|
||||
static $domesticInv = null;
|
||||
static $warInv = null;
|
||||
|
||||
private function __construct(){
|
||||
}
|
||||
|
||||
public static function getDomesticClassByName(?string $type):string{
|
||||
if($type === null || $type === ''){
|
||||
$type = GameConst::$defaultSpecialDomestic;
|
||||
}
|
||||
|
||||
if(static::$domesticInv){
|
||||
if(!key_exists($type, static::$domesticInv)){
|
||||
throw new \InvalidArgumentException('올바르지 않은 특기명:',$type);
|
||||
}
|
||||
return static::$domesticInv[$type];
|
||||
}
|
||||
|
||||
$cache = [];
|
||||
foreach(static::getSpecialDomesticList(false) as $className=>$classObj){
|
||||
$cache[$classObj->getName()] = $className;
|
||||
}
|
||||
static::$domesticInv = $cache;
|
||||
return $cache[$type];
|
||||
}
|
||||
|
||||
public static function getWarClassByName(?string $type):string{
|
||||
if($type === null || $type === ''){
|
||||
$type = GameConst::$defaultSpecialWar;
|
||||
}
|
||||
|
||||
if(static::$warInv){
|
||||
if(!key_exists($type, static::$warInv)){
|
||||
throw new \InvalidArgumentException('올바르지 않은 특기명:',$type);
|
||||
}
|
||||
return static::$warInv[$type];
|
||||
}
|
||||
|
||||
$cache = [];
|
||||
foreach(static::getSpecialWarList(false) as $className=>$classObj){
|
||||
$cache[$classObj->getName()] = $className;
|
||||
}
|
||||
static::$warInv = $cache;
|
||||
return $cache[$type];
|
||||
}
|
||||
|
||||
private static function calcCondGeneric(array $general) : int {
|
||||
$myCond = 0;
|
||||
|
||||
$leadership = $general['leadership']??50;
|
||||
$strength = $general['strength']??50;
|
||||
$intel = $general['intel']??50;
|
||||
|
||||
if ($leadership * 0.95 > $strength && $leadership * 0.95 > $intel) {
|
||||
$myCond |= self::STAT_LEADERSHIP;
|
||||
}
|
||||
else if($strength >= $intel){
|
||||
$myCond |= self::STAT_STRENGTH;
|
||||
}
|
||||
else {
|
||||
$myCond |= self::STAT_INTEL;
|
||||
}
|
||||
|
||||
return $myCond;
|
||||
}
|
||||
|
||||
private static function calcCondDexterity(array $general) : int {
|
||||
$dex = [
|
||||
static::ARMY_FOOTMAN => $general['dex1']??0,
|
||||
static::ARMY_ARCHER => $general['dex2']??0,
|
||||
static::ARMY_CAVALRY => $general['dex3']??0,
|
||||
static::ARMY_WIZARD => $general['dex4']??0,
|
||||
static::ARMY_SIEGE => $general['dex5']??0,
|
||||
];
|
||||
|
||||
$dexSum = array_sum($dex);
|
||||
$dexBase = Util::round(sqrt($dexSum) / 4);
|
||||
|
||||
if(Util::randBool(0.8)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(mt_rand(0, 99) < $dexBase){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!$dexSum){
|
||||
return array_rand($dex);
|
||||
}
|
||||
|
||||
return array_keys($dex, max($dex))[0];
|
||||
}
|
||||
|
||||
/** @return BaseSpecial[] */
|
||||
public static function getSpecialDomesticList(bool $onlyAvailable=true):array{
|
||||
$result = [];
|
||||
if(!$onlyAvailable){
|
||||
$specialObj = buildGeneralSpecialDomesticClass(GameConst::$defaultSpecialDomestic);
|
||||
$result[GameConst::$defaultSpecialDomestic] = $specialObj;
|
||||
}
|
||||
|
||||
foreach(GameConst::$availableSpecialDomestic as $specialID){
|
||||
$specialObj = buildGeneralSpecialDomesticClass($specialID);
|
||||
$result[$specialID] = $specialObj;
|
||||
}
|
||||
|
||||
if(!$onlyAvailable){
|
||||
foreach(GameConst::$availableSpecialDomestic as $specialID){
|
||||
$specialObj = buildGeneralSpecialDomesticClass($specialID);
|
||||
$result[$specialID] = $specialObj;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/** @return BaseSpecial[] */
|
||||
public static function getSpecialWarList(bool $onlyAvailable=true):array{
|
||||
$result = [];
|
||||
if(!$onlyAvailable){
|
||||
$specialObj = buildGeneralSpecialDomesticClass(GameConst::$defaultSpecialDomestic);
|
||||
$result[GameConst::$defaultSpecialDomestic] = $specialObj;
|
||||
}
|
||||
|
||||
foreach(GameConst::$availableSpecialDomestic as $specialID){
|
||||
$specialObj = buildGeneralSpecialDomesticClass($specialID);
|
||||
$result[$specialID] = $specialObj;
|
||||
}
|
||||
|
||||
if(!$onlyAvailable){
|
||||
foreach(GameConst::$availableSpecialDomestic as $specialID){
|
||||
$specialObj = buildGeneralSpecialDomesticClass($specialID);
|
||||
$result[$specialID] = $specialObj;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function pickSpecialDomestic(array $general) : string{
|
||||
$pAbs = [];
|
||||
$pRel = [];
|
||||
|
||||
$myCond = static::calcCondGeneric($general);
|
||||
|
||||
foreach(static::getSpecialDomesticList() as $specialID=>$specialObj){
|
||||
$conds = $specialObj::$type;
|
||||
$name = $specialObj->getName();
|
||||
$weightType = $specialObj::$selectWeightType;
|
||||
$weight = $specialObj::$selectWeight;
|
||||
|
||||
$valid = false;
|
||||
foreach($conds as $cond){
|
||||
if($cond === ($cond & $myCond)){
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$valid){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if($weightType === static::WEIGHT_PERCENT){
|
||||
$pAbs[$specialID] = $weight;
|
||||
}
|
||||
else{
|
||||
$pRel[$specialID] = $weight;
|
||||
}
|
||||
}
|
||||
|
||||
if($pAbs){
|
||||
if($pRel){
|
||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||
}
|
||||
$id = Util::choiceRandomUsingWeight($pAbs);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
$id = Util::choiceRandomUsingWeight($pRel);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
|
||||
throw new MustNotBeReachedException();
|
||||
}
|
||||
|
||||
public static function pickSpecialWar(array $general) : string{
|
||||
$reqDex = [];
|
||||
$pAbs = [];
|
||||
$pRel = [];
|
||||
|
||||
$myCond = static::calcCondGeneric($general);
|
||||
$myCond |= static::calcCondDexterity($general);
|
||||
|
||||
foreach(static::getSpecialWarList() as $specialID=>$specialObj){
|
||||
$conds = $specialObj::$type;
|
||||
$name = $specialObj->getName();
|
||||
$weightType = $specialObj::$selectWeightType;
|
||||
$weight = $specialObj::$selectWeight;
|
||||
|
||||
$valid = false;
|
||||
foreach($conds as $cond){
|
||||
if($cond === ($cond & $myCond)){
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$valid){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if($cond & self::REQ_DEXTERITY){
|
||||
$reqDex[$specialID] = $weight;
|
||||
}
|
||||
else if($weightType === static::WEIGHT_PERCENT){
|
||||
$pAbs[$specialID] = $weight;
|
||||
}
|
||||
else{
|
||||
$pRel[$specialID] = $weight;
|
||||
}
|
||||
}
|
||||
|
||||
if($reqDex){
|
||||
return Util::choiceRandomUsingWeight($reqDex);
|
||||
}
|
||||
|
||||
if($pAbs){
|
||||
if($pRel){
|
||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||
}
|
||||
$id = Util::choiceRandomUsingWeight($pAbs);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
$id = Util::choiceRandomUsingWeight($pRel);
|
||||
if($id){
|
||||
return $id;
|
||||
}
|
||||
|
||||
throw new MustNotBeReachedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user