아이템 구현. 장비매매 추가
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace sammo\ActionItem;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
use function sammo\isConsumable;
|
||||
use function sammo\getItemInfo;
|
||||
use function sammo\getItemCost2;
|
||||
|
||||
//XXX:임시용!
|
||||
class che_Dummy extends \sammo\BaseItem{
|
||||
|
||||
public $id;
|
||||
public $name;
|
||||
public $info;
|
||||
public $cost;
|
||||
public $consumable = false;
|
||||
|
||||
public function __construct(int $itemCode)
|
||||
{
|
||||
$this->id = $itemCode = true;
|
||||
[$this->name, $this->info] = getItemInfo($itemCode);
|
||||
$this->cost = getItemCost2($itemCode);
|
||||
$this->consumable = isConsumable($itemCode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_계략_삼략 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 22;
|
||||
public $name = '삼략(계략)';
|
||||
public $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
if($varType == 'success') return $value + 0.2;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralCommand' && $command == '계략'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_계략_육도 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 21;
|
||||
public $name = '육도(계략)';
|
||||
public $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
if($varType == 'success') return $value + 0.2;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralCommand' && $command == '계략'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_계략_이추 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 5;
|
||||
public $name = '이추(계략)';
|
||||
public $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p';
|
||||
public $cost = 1000;
|
||||
public $consumable = true;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
if($varType == 'success') return $value + 0.1;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralCommand' && $command == '계략'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_계략_향낭 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 5;
|
||||
public $name = '항냥(계략)';
|
||||
public $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
public $cost = 3000;
|
||||
public $consumable = true;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
if($varType == 'success') return $value + 0.2;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralCommand' && $command == '계략'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_의술_청낭서 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 23;
|
||||
public $name = '청낭서(의술)';
|
||||
public $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_도시치료($general)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_의술_태평청령 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 24;
|
||||
public $name = '태평청령(의술)';
|
||||
public $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_도시치료($general)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_치료_도소연명 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 9;
|
||||
public $name = '도소연명(치료)';
|
||||
public $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_아이템치료($general)
|
||||
]);
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_치료_무후행군 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 8;
|
||||
public $name = '무후행군(치료)';
|
||||
public $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_아이템치료($general)
|
||||
]);
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_치료_오석산 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 7;
|
||||
public $name = '오석산(치료)';
|
||||
public $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_아이템치료($general)
|
||||
]);
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_치료_정력견혈 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 11;
|
||||
public $name = '정력견혈(치료)';
|
||||
public $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_아이템치료($general)
|
||||
]);
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_치료_칠엽청점 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 10;
|
||||
public $name = '칠엽청점(치료)';
|
||||
public $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
public $cost = 200;
|
||||
public $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_아이템치료($general)
|
||||
]);
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\GeneralTrigger;
|
||||
|
||||
class che_치료_환약 extends \sammo\BaseItem{
|
||||
|
||||
public $id = 1;
|
||||
public $name = '환약(치료)';
|
||||
public $info = '[군사] 턴 실행 전 부상 회복. 1회용';
|
||||
public $cost = 100;
|
||||
public $consumable = true;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
new GeneralTrigger\che_아이템치료($general)
|
||||
]);
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user