아이템 관련 버그 수정

This commit is contained in:
2019-10-09 11:34:56 +09:00
parent 48cac053fd
commit bc5574615d
18 changed files with 35 additions and 27 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ class che_계략_삼략 extends \sammo\BaseItem{
return $value;
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
+1 -1
View File
@@ -19,7 +19,7 @@ class che_계략_육도 extends \sammo\BaseItem{
return $value;
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
+1 -1
View File
@@ -21,7 +21,7 @@ class che_계략_이추 extends \sammo\BaseItem{
return $value;
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
+1 -1
View File
@@ -21,7 +21,7 @@ class che_계략_향낭 extends \sammo\BaseItem{
return $value;
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralCommand' && $command == '계략'){
return true;
}
@@ -19,7 +19,7 @@ class che_치료_도소연명 extends \sammo\BaseItem{
);
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
@@ -19,7 +19,7 @@ class che_치료_무후행군 extends \sammo\BaseItem{
);
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
@@ -19,7 +19,7 @@ class che_치료_오석산 extends \sammo\BaseItem{
);
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
@@ -19,7 +19,7 @@ class che_치료_정력견혈 extends \sammo\BaseItem{
);
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
@@ -19,7 +19,7 @@ class che_치료_칠엽청점 extends \sammo\BaseItem{
);
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
+1 -1
View File
@@ -21,7 +21,7 @@ class che_치료_환약 extends \sammo\BaseItem{
);
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
return true;
}
+1 -1
View File
@@ -34,7 +34,7 @@ class BaseItem implements iAction{
return $this->reqSecu;
}
function isValidTurnItem(string $actionType, string $command):bool{
function isConsumableNow(string $actionType, string $command):bool{
return false;
}
}
+4 -3
View File
@@ -21,10 +21,11 @@ class BaseStatItem extends BaseItem{
public function __construct(){
$nameTokens = explode('_', static::class);
$this->statValue = (int)$nameTokens[-1];
$tokenLen = count($nameTokens);
$this->statValue = (int)$nameTokens[$tokenLen-2];
assert(is_numeric($this->statValue));
$this->rawName = $nameTokens[-2];
[$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[-3]];
$this->rawName = $nameTokens[$tokenLen-1];
[$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[$tokenLen-3]];
$this->id = $this->statValue;
$this->name = sprintf('%s(+%d)',$this->rawName, $this->statValue);
+1 -1
View File
@@ -285,7 +285,7 @@ class che_화계 extends Command\GeneralCommand{
$this->affectDestCity($injuryCount);
$itemObj = $general->getItem();
if($itemObj->isValidTurnItem('GeneralCommand', '계략') && $itemObj::$consumable){
if($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj::$consumable){
$itemName = $itemObj->name;
$josaUl = JosaUtil::pick($itemName, '을');
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
+1 -1
View File
@@ -68,7 +68,7 @@ class che_포상 extends Command\NationCommand{
$this->setCity();
$this->setNation(['gold', 'rice']);
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], 1);
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], 1);
$this->setDestGeneral($destGeneral);
$this->runnableConstraints=[
+3
View File
@@ -8,6 +8,9 @@ trait DefaultAction{
}
public function getInfo():string{
if($this->info === null){
return '';
}
return $this->info;
}
+4
View File
@@ -67,6 +67,10 @@ class GameUnitDetail implements iAction{
}
public function getInfo():string{
return join("\n<br>", $this->info);
}
public function getShortName():string{
return StringUtil::subStringForWidth($this->name, 0, 4);
}
@@ -23,7 +23,7 @@ class che_아이템치료 extends BaseGeneralTrigger{
$josaUl = JosaUtil::pick($itemName, '을');
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용하여 치료합니다!", ActionLogger::PLAIN);
if($itemObj::$consumable && $itemObj->isValidTurnItem('GeneralTrigger', 'che_아이템치료')){
if($itemObj::$consumable && $itemObj->isConsumableNow('GeneralTrigger', 'che_아이템치료')){
$general->deleteItem();
}
}