phan 1차
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
|
||||
class None implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class None extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '-';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_덕가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_덕가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '덕가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_도가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_도가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '도가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_도적 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_도적 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '도적';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_명가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_명가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '명가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_묵가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_묵가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '묵가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_법가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_법가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '법가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_병가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_병가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '병가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_불가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_불가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '불가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_오두미도 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_오두미도 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '오두미도';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_유가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_유가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '유가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_음양가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_음양가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '음양가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -4,8 +4,7 @@ use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\Util;
|
||||
|
||||
class che_종횡가 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_종횡가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '종횡가';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_중립 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_중립 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '-';
|
||||
protected $info = '';
|
||||
|
||||
@@ -3,8 +3,7 @@ namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_태평도 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
class che_태평도 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '태평도';
|
||||
protected $info = '';
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
abstract class BaseNation implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
protected $name = '-';
|
||||
protected $info = '';
|
||||
static $pros = '';
|
||||
static $cons = '';
|
||||
}
|
||||
@@ -285,7 +285,7 @@ class che_화계 extends Command\GeneralCommand{
|
||||
$this->affectDestCity($injuryCount);
|
||||
|
||||
$itemObj = $general->getItem();
|
||||
if($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj::$consumable){
|
||||
if($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj->isConsumableNow('GeneralCommand', '계략')){
|
||||
$itemName = $itemObj->getName();
|
||||
$itemRawName = $itemObj->getRawName();
|
||||
$josaUl = JosaUtil::pick($itemRawName, '을');
|
||||
|
||||
+19
-2
@@ -3332,8 +3332,24 @@ class GeneralAI
|
||||
|
||||
$picked = false;
|
||||
foreach(Util::range(5) as $idx){
|
||||
|
||||
/** @var General */
|
||||
$randGeneral = Util::choiceRandom($this->npcWarGenerals);
|
||||
if($this->npcWarGenerals){
|
||||
$randGeneral = Util::choiceRandom($this->npcWarGenerals);
|
||||
}
|
||||
else if($this->npcCivilGenerals){
|
||||
$randGeneral = Util::choiceRandom($this->npcCivilGenerals);
|
||||
}
|
||||
else if($this->userWarGenerals){
|
||||
$randGeneral = Util::choiceRandom($this->userWarGenerals);
|
||||
}
|
||||
else if($this->userCivilGenerals){
|
||||
$randGeneral = Util::choiceRandom($this->userCivilGenerals);
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
|
||||
if($randGeneral->getVar('officer_level') != 1){
|
||||
continue;
|
||||
}
|
||||
@@ -3357,10 +3373,11 @@ class GeneralAI
|
||||
break;
|
||||
}
|
||||
|
||||
if(!$picked){
|
||||
if(!$picked || !$randGeneral){
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var General $randGeneral */
|
||||
$randGeneral->setVar('officer_level', $chiefLevel);
|
||||
$randGeneral->setVar('officer_city', 0);
|
||||
$randGeneral->applyDB($db);
|
||||
|
||||
@@ -473,4 +473,12 @@ class Message
|
||||
], 'id=%i', $this->id);
|
||||
|
||||
}
|
||||
|
||||
public function agreeMessage(int $receiverID, string &$reason):int{
|
||||
throw new NotInheritedMethodException();
|
||||
}
|
||||
|
||||
public function declineMessage(int $receiverID, string &$reason):int{
|
||||
throw new NotInheritedMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ class Scenario{
|
||||
|
||||
private $history;
|
||||
|
||||
/** @var \sammo\Scenario\Nation[] */
|
||||
private $nations;
|
||||
/** @var \sammo\Scenario\Nation[] */
|
||||
private $nationsInv;
|
||||
|
||||
private $diplomacy;
|
||||
@@ -125,7 +127,7 @@ class Scenario{
|
||||
) = $rawGeneral;
|
||||
|
||||
if(key_exists($nationName, $this->nationsInv)){
|
||||
$nationID = $this->nationsInv[$nationName]->id;;
|
||||
$nationID = $this->nationsInv[$nationName]->getID();
|
||||
}
|
||||
else if(key_exists($nationName, $this->nations)){
|
||||
$nationID = (int)$nationName;
|
||||
@@ -167,7 +169,7 @@ class Scenario{
|
||||
) = $rawGeneral;
|
||||
|
||||
if(key_exists($nationName, $this->nationsInv)){
|
||||
$nationID = $this->nationsInv[$nationName]->id;;
|
||||
$nationID = $this->nationsInv[$nationName]->getID();
|
||||
}
|
||||
else if(key_exists($nationName, $this->nations)){
|
||||
$nationID = (int)$nationName;
|
||||
|
||||
@@ -18,6 +18,7 @@ class WarUnit{
|
||||
|
||||
protected $currPhase = 0;
|
||||
protected $prePhase = 0;
|
||||
protected $bonusPhase = 0;
|
||||
|
||||
protected $atmosBonus = 0;
|
||||
protected $trainBonus = 0;
|
||||
@@ -166,7 +167,8 @@ class WarUnit{
|
||||
}
|
||||
|
||||
function getMaxPhase():int{
|
||||
return $this->getCrewType()->speed;
|
||||
$phase = $this->getCrewType()->speed;
|
||||
return $phase + $this->bonusPhase;
|
||||
}
|
||||
|
||||
function setPrePhase(int $phase){
|
||||
@@ -177,6 +179,10 @@ class WarUnit{
|
||||
$this->currPhase += 1;
|
||||
}
|
||||
|
||||
function addBonusPhase(int $cnt){
|
||||
$this->bonusPhase += $cnt;
|
||||
}
|
||||
|
||||
function setOppose(?WarUnit $oppose){
|
||||
$this->oppose = $oppose;
|
||||
$this->killedCurr = 0;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
namespace sammo;
|
||||
|
||||
class WarUnitGeneral extends WarUnit{
|
||||
protected $bonusPhase = 0;
|
||||
|
||||
function __construct(General $general, array $rawNation, bool $isAttacker){
|
||||
$this->general = $general;
|
||||
$this->raw = $general->getRaw();
|
||||
@@ -56,10 +54,6 @@ class WarUnitGeneral extends WarUnit{
|
||||
}
|
||||
}
|
||||
|
||||
function addBonusPhase(int $cnt){
|
||||
$this->bonusPhase += $cnt;
|
||||
}
|
||||
|
||||
function getMaxPhase():int{
|
||||
$phase = $this->getCrewType()->speed;
|
||||
$phase = $this->general->onCalcStat($this->general, 'initWarPhase', $phase);
|
||||
|
||||
Reference in New Issue
Block a user