아이템 전량 구현, 말, 무기, 책 준비

This commit is contained in:
2019-05-13 02:44:01 +09:00
parent 91b5a1e44a
commit 85409263c8
24 changed files with 340 additions and 50 deletions
+10 -26
View File
@@ -272,41 +272,25 @@ function getPersonalityClass(?string $type){
throw new \InvalidArgumentException("{$type}은 올바른 성격 클래스가 아님");
}
function getItemClass(int $itemCode){
//XXX: 임시 구현임
//iAction이 필요한 것만 반환
static $basePath = __NAMESPACE__.'\\ActionItem\\';
$itemPath = [
1=>'che_환약_치료',
5=>'che_이추_계략',
6=>'che_향낭_계략',
7=>'che_오석산_치료',
8=>'che_무후행군_치료',
9=>'che_도소연명_치료',
10=>'che_칠엽청점_치료',
11=>'che_정력견혈_치료',
21=>'che_육도_계략',
22=>'che_삼략_계략',
23=>'che_청낭서_의술',
24=>'che_태평청령_의술',
];
$itemClass = $itemPath[$itemCode]??null;
function getItemClass(?string $itemClass){
if($itemClass === null){
return null;
}
static $basePath = __NAMESPACE__.'\\ActionItem\\';
$classPath = ($basePath.$itemClass);
if(class_exists($classPath)){
return $classPath;
}
throw new \InvalidArgumentException("{$itemCode}, {$itemClass}는 올바른 성격 클래스가 아님");
throw new \InvalidArgumentException("{$itemClass}는 올바른 성격 클래스가 아님");
}
function buildItemClass(?string $itemClass):BaseItem{
$class = getGeneralCommandClass($itemClass);
return new $class();
}
function getGeneralSpecialDomesticClass(?string $type){
@@ -894,7 +878,7 @@ function getItemName($item) : ?string {
return $itemname;
}
function getItemInfo(?int $item):?string{
function getItemInfo(?int $item):?array{
$itemInfo = [
1=>['환약(치료)', '[군사] 턴 실행 전 부상 회복. 1회용'],
2=>['수극(저격)', '[전투] 전투 개시 전 20% 확률로 저격 시도. 1회용'],