game,feat: 새 도구 아이템 추가, 아이템 효과에 필요한 기능 추가 #206

Merged
Hide_D merged 25 commits from items_add into devel 2022-02-22 00:50:13 +09:00
97 changed files with 989 additions and 190 deletions
+5 -3
View File
@@ -1937,8 +1937,8 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
$prob = Util::valueFit($prob, null, 1 / 4); //최대치 감소
$result = false;
$prob /= sqrt(2);
$moreProb = pow(2, 1 / 4);
$prob /= sqrt(7);
$moreProb = pow(10, 1 / 4);
if ($general->getAuxVar('inheritRandomUnique') && $availableBuyUnique) {
//포인트로 랜덤 유니크 획득
@@ -2415,7 +2415,9 @@ function SabotageInjury(array $cityGeneralList, string $reason): int
foreach ($cityGeneralList as $general) {
/** @var General $general */
if (!Util::randBool(0.3)) {
$injuryProb = 0.3;
$injuryProb = $general->onCalcStat($general, 'injuryProb', $injuryProb);
if (!Util::randBool($injuryProb)) {
continue;
}
$general->getLogger()->pushGeneralActionLog($text);
+5 -5
View File
@@ -673,17 +673,17 @@ function updateNationState()
continue;
}
$score = $nationGen->getVar('belong') + 5;
$score = $nationGen->getVar('belong') + 10;
if ($nationGen->getVar('officer_level') == 12) {
$score += 100; //NOTE: 꼬우면 군주하세요.
$score += 60;
} else if ($nationGen->getVar('officer_level') == 11) {
$score += 50;
$score += 30;
} else if ($nationGen->getVar('officer_level') > 4) {
$score += 35;
$score += 15;
}
$score *= $trialCnt;
$score *= 2**$trialCnt;
$uniqueLotteryWeightList[$nationGen->getID()] = [$nationGen, $score];
}
-1
View File
@@ -5,7 +5,6 @@ use \sammo\General;
class None extends \sammo\BaseItem{
protected $id = 0;
protected $name = '-';
protected $info = null;
protected $cost = 0;
@@ -0,0 +1,23 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
class che_간파_노군입산부 extends \sammo\BaseItem{
protected $rawName = '노군입산부';
protected $name = '노군입산부(간파)';
protected $info = '[전투] 상대 회피 확률 -30%p, 상대 필살 확률 -10%p';
protected $cost = 200;
protected $consumable = false;
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
if($statName === 'warAvoidRatio'){
return $value - 0.30;
}
if($statName === 'warCriticalRatio'){
return $value - 0.10;
}
return $value;
}
}
@@ -0,0 +1,25 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
use \sammo\WarUnit;
use sammo\WarUnitTriggerCaller;
use sammo\WarUnitTrigger\che_격노시도;
use sammo\WarUnitTrigger\che_격노발동;
class che_격노_구정신단경 extends \sammo\BaseItem{
protected $rawName = '구정신단경';
protected $name = '구정신단경(격노)';
protected $info = '[전투] 상대방 필살 시 격노(필살) 발동, 회피 시도시 25% 확률로 격노 발동, 공격 시 일정 확률로 진노(1페이즈 추가)';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_격노시도($unit, che_격노시도::TYPE_ITEM),
new che_격노발동($unit)
);
}
}
+1 -2
View File
@@ -5,7 +5,6 @@ use \sammo\General;
class che_계략_삼략 extends \sammo\BaseItem{
protected $id = 22;
protected $rawName = '삼략';
protected $name = '삼략(계략)';
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p<br>[전투] 계략 시도 확률 +10%p, 계략 성공 확률 +10%p';
@@ -16,7 +15,7 @@ class che_계략_삼략 extends \sammo\BaseItem{
if($turnType == '계략'){
if($varType == 'success') return $value + 0.2;
}
return $value;
}
+1 -2
View File
@@ -5,7 +5,6 @@ use \sammo\General;
class che_계략_육도 extends \sammo\BaseItem{
protected $id = 21;
protected $rawName = '육도';
protected $name = '육도(계략)';
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p<br>[전투] 계략 시도 확률 +10%p, 계략 성공 확률 +10%p';
@@ -16,7 +15,7 @@ class che_계략_육도 extends \sammo\BaseItem{
if($turnType == '계략'){
if($varType == 'success') return $value + 0.2;
}
return $value;
}
+1 -2
View File
@@ -5,7 +5,6 @@ use \sammo\General;
class che_계략_이추 extends \sammo\BaseItem{
protected $id = 5;
protected $rawName = '이추';
protected $name = '이추(계략)';
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
@@ -18,7 +17,7 @@ class che_계략_이추 extends \sammo\BaseItem{
if($turnType == '계략'){
if($varType == 'success') return $value + 0.2;
}
return $value;
}
+1 -2
View File
@@ -5,7 +5,6 @@ use \sammo\General;
class che_계략_향낭 extends \sammo\BaseItem{
protected $id = 5;
protected $rawName = '항냥';
protected $name = '항냥(계략)';
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +50%p';
@@ -18,7 +17,7 @@ class che_계략_향낭 extends \sammo\BaseItem{
if($turnType == '계략'){
if($varType == 'success') return $value + 0.5;
}
return $value;
}
@@ -0,0 +1,24 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
use \sammo\GameUnitConst;
use \sammo\WarUnit;
use \sammo\WarUnitCity;
class che_공성_묵자 extends \sammo\BaseItem{
protected $rawName = '묵자';
protected $name = '묵자(공성)';
protected $info = '[전투] 성벽 공격 시 대미지 +50%';
protected $cost = 200;
protected $consumable = false;
public function getWarPowerMultiplier(WarUnit $unit):array{
if($unit->getOppose() instanceof WarUnitCity){
return [1.5, 1];
}
return [1, 1];
}
}
@@ -0,0 +1,21 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\Util;
class che_내정_납금박산로 extends \sammo\BaseItem{
protected $rawName = '납금박산로';
protected $name = '납금박산로(내정)';
protected $info = '[내정] 내정 성공률 +20%p';
protected $cost = 200;
protected $consumable = false;
public function onCalcStrategic(string $turnType, string $varType, $value){
if(in_array($turnType, ['상업', '농업', '기술', '성벽', '수비', '치안', '민심', '인구'])){
if($varType == 'success') return $value + 0.2;
}
return $value;
}
}
@@ -0,0 +1,32 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
class che_농성_위공자병법 extends \sammo\BaseItem{
protected $rawName = '위공자병법';
protected $name = '위공자병법(농성)';
protected $info = '[계략] 장수 주둔 도시 화계·탈취·파괴·선동 : 성공률 -30%p<br>[전투] 상대 계략 시도 확률 -10%p, 상대 계략 성공 확률 -10%p';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'sabotageDefence'){
return $value + 0.3;
}
return $value;
}
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
{
if($statName === 'warMagicTrialProb'){
return $value - 0.1;
}
if($statName === 'warMagicSuccessProb'){
return $value - 0.1;
}
return $value;
}
}
@@ -0,0 +1,32 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
class che_농성_주서음부 extends \sammo\BaseItem{
protected $rawName = '주서음부';
protected $name = '주서음부(농성)';
protected $info = '[계략] 장수 주둔 도시 화계·탈취·파괴·선동 : 성공률 -30%p<br>[전투] 상대 계략 시도 확률 -10%p, 상대 계략 성공 확률 -10%p';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'sabotageDefence'){
return $value + 0.3;
}
return $value;
}
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
{
if($statName === 'warMagicTrialProb'){
return $value - 0.1;
}
if($statName === 'warMagicSuccessProb'){
return $value - 0.1;
}
return $value;
}
}
@@ -0,0 +1,28 @@
<?php
namespace sammo\ActionItem;
use sammo\DB;
use sammo\GameConst;
use \sammo\iAction;
use \sammo\General;
use sammo\KVStorage;
use sammo\Util;
class che_능력치_무력_두강주 extends \sammo\BaseItem{
protected $rawName = '두강주';
protected $name = '두강주(무력)';
protected $info = '[능력치] 무력 +5 +(5년마다 +1)';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'strength'){
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
$relYear = $year - $startYear;
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
}
return $value;
}
}
@@ -0,0 +1,28 @@
<?php
namespace sammo\ActionItem;
use sammo\DB;
use sammo\GameConst;
use \sammo\iAction;
use \sammo\General;
use sammo\KVStorage;
use sammo\Util;
class che_능력치_지력_이강주 extends \sammo\BaseItem{
protected $rawName = '이강주';
protected $name = '이강주(지력)';
protected $info = '[능력치] 지력 +5 +(5년마다 +1)';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'intel'){
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
$relYear = $year - $startYear;
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
}
return $value;
}
}
@@ -0,0 +1,28 @@
<?php
namespace sammo\ActionItem;
use sammo\DB;
use sammo\GameConst;
use \sammo\iAction;
use \sammo\General;
use sammo\KVStorage;
use sammo\Util;
class che_능력치_통솔_보령압주 extends \sammo\BaseItem{
protected $rawName = '보령압주';
protected $name = '보령압주(통솔)';
protected $info = '[능력치] 통솔 +5 +(5년마다 +1)';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'leadership'){
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
$relYear = $year - $startYear;
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
}
return $value;
}
}
@@ -10,7 +10,7 @@ class che_명마_12_옥란백용구 extends \sammo\BaseStatItem{
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 남은 병력에 따라 회피 확률 증가. 최대 +30%p";
$this->info .= "<br>[전투] 남은 병력이 적을수록 회피 확률 증가. 최대 +30%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux = null)
@@ -0,0 +1,20 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
class che_명성_구석 extends \sammo\BaseItem{
protected $rawName = '구석';
protected $name = '구석(명성)';
protected $info = '명성 +15%';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName == 'experience'){
return $value * 1.15;
}
return $value;
}
}
+12 -3
View File
@@ -12,10 +12,9 @@ use \sammo\WarUnitTrigger\che_반계발동;
class che_반계_백우선 extends \sammo\BaseItem{
protected $id = 45;
protected $rawName = '백우선';
protected $name = '백우선(반계)';
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 20% 확률로 되돌림';
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 30% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%), 소모 군량 +10%';
protected $cost = 200;
protected $consumable = false;
@@ -27,9 +26,19 @@ class che_반계_백우선 extends \sammo\BaseItem{
return $value - $debuff;
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName == 'killRice'){
return $value * 1.1;
}
if($statName === 'warMagicSuccessDamage' && $aux === '반목'){
return $value + 0.4;
}
return $value;
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, 0.2),
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, 0.3),
new che_반계발동($unit)
);
}
@@ -12,7 +12,6 @@ use \sammo\WarUnitTrigger\che_반계발동;
class che_반계_파초선 extends \sammo\BaseItem{
protected $id = 45;
protected $rawName = '파초선';
protected $name = '파초선(반계)';
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 20% 확률로 되돌림';
@@ -0,0 +1,23 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저지발동;
use sammo\WarUnitTrigger\WarActivateSkills;
use sammo\WarUnitTriggerCaller;
class che_반계저지_박혁론 extends \sammo\BaseItem{
protected $rawName = '박혁론';
protected $name = '박혁론(반계저지)';
protected $info = '[전투] 상대의 계략 되돌림 불가';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '반계불가'),
);
}
}
@@ -0,0 +1,58 @@
<?php
namespace sammo\ActionItem;
use sammo\DB;
use \sammo\iAction;
use \sammo\General;
use sammo\KVStorage;
use sammo\Util;
class che_보물_도기 extends \sammo\BaseItem
{
protected $rawName = '도기';
protected $name = '도기(보물)';
protected $info = '[개인] 판매 시 국고에 금, 쌀 중 하나를 추가 (+10,000, 5년마다 +10,000)';
protected $cost = 200;
protected $consumable = false;
public function onArbitraryAction(General $general, string $actionType, ?string $phase = null, $aux = null): ?array
{
if ($aux === null){
return $aux;
}
if ($actionType !== '장비매매') {
return $aux;
}
if ($phase !== '판매') {
return $aux;
}
if (($aux['itemCode']??'') !== Util::getClassNameFromObj($this)){
return $aux;
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
$relYear = $year - $startYear;
$score = 10000 * (1 + Util::valueFit(intdiv($relYear, 5), 0));
[$resName, $resKey] = Util::choiceRandom([
['금', 'gold'],
['쌀', 'rice']
]);
$db->update('nation', [
$resKey => $db->sqleval('%b + %i', $resKey, $score)
]);
$score = Util::round($score);
$scoreText = number_format($score, 0);
$logger = $general->getLogger();
$logger->pushGeneralActionLog("국고에 {$resName} <C>{$scoreText}</>을 보충합니다.");
return $aux;
}
}
@@ -15,13 +15,20 @@ use sammo\WarUnitTrigger\WarActivateSkills;
class che_부적_태현청생부 extends \sammo\BaseItem
{
protected $id = 9;
protected $rawName = '태현청생부';
protected $name = '태현청생부(부적)';
protected $info = '[전투] 저격 불가, 부상 없음';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux = null)
{
if($statName === 'injuryProb'){
return $value -= 1;
}
return $value;
}
public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
{
return new WarUnitTriggerCaller(
@@ -0,0 +1,31 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\Util;
use sammo\WarUnit;
use sammo\WarUnitTrigger\전투력보정;
use sammo\WarUnitTriggerCaller;
class che_불굴_상편 extends \sammo\BaseItem
{
protected $rawName = '상편';
protected $name = '상편(불굴)';
protected $info = '[전투] 남은 병력이 적을수록 공격력 증가. 최대 +50%';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
{
$leadership = $unit->getGeneral()->getLeadership();
$crew = $unit->getGeneral()->getVar('crew');
$crewRatio = Util::valueFit($crew / ($leadership * 100), 0, 1);
return new WarUnitTriggerCaller(
new 전투력보정($unit, 1 + 0.5 * (1 - $crewRatio))
);
}
}
@@ -5,7 +5,6 @@ use \sammo\General;
class che_사기_두강주 extends \sammo\BaseItem{
protected $id = 15;
protected $rawName = '두강주';
protected $name = '두강주(사기)';
protected $info = '[전투] 사기 보정 +10';
@@ -18,4 +17,6 @@ class che_사기_두강주 extends \sammo\BaseItem{
}
return $value;
}
}
}
//NOTE: 구버전
@@ -5,7 +5,6 @@ use \sammo\General;
class che_사기_보령압주 extends \sammo\BaseItem{
protected $id = 16;
protected $rawName = '보령압주';
protected $name = '보령압주(사기)';
protected $info = '[전투] 사기 보정 +10';
@@ -18,4 +17,6 @@ class che_사기_보령압주 extends \sammo\BaseItem{
}
return $value;
}
}
}
//NOTE: 구버전
@@ -5,7 +5,6 @@ use \sammo\General;
class che_사기_의적주 extends \sammo\BaseItem{
protected $id = 14;
protected $rawName = '의적주';
protected $name = '의적주(사기)';
protected $info = '[전투] 사기 보정 +10';
@@ -5,16 +5,15 @@ use \sammo\General;
class che_사기_초선화 extends \sammo\BaseItem{
protected $id = 20;
protected $rawName = '초선화';
protected $name = '초선화(사기)';
protected $info = '[전투] 사기 보정 +14';
protected $info = '[전투] 사기 보정 +15';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 14;
return $value + 15;
}
return $value;
}
@@ -5,16 +5,15 @@ use \sammo\General;
class che_사기_춘화첩 extends \sammo\BaseItem{
protected $id = 19;
protected $rawName = '춘화첩';
protected $name = '춘화첩(사기)';
protected $info = '[전투] 사기 보정 +14';
protected $info = '[전투] 사기 보정 +15';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 14;
return $value + 15;
}
return $value;
}
@@ -9,7 +9,6 @@ use \sammo\WarUnitTrigger\능력치변경;
class che_사기_탁주 extends \sammo\BaseItem{
protected $id = 3;
protected $rawName = '탁주';
protected $name = '탁주(사기)';
protected $info = '[전투] 사기 +6. 1회용';
@@ -0,0 +1,28 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\전투력보정;
use sammo\WarUnitTriggerCaller;
class che_상성보정_과실주 extends \sammo\BaseItem{
protected $rawName = '과실주';
protected $name = '과실주(상성)';
protected $info = '[전투] 유리한 병종 전투시 공격력 +10%, 피해 -10%';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
{
$oppose = $unit->getOppose();
$attackCoef = $unit->getCrewType()->getAttackCoef($oppose->getCrewType());
if($attackCoef <= 1){
return null;
}
return new WarUnitTriggerCaller(
new 전투력보정($unit, 1.1, 0.9)
);
}
}
@@ -0,0 +1,20 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
class che_숙련_동작 extends \sammo\BaseItem{
protected $rawName = '동작';
protected $name = '동작(숙련)';
protected $info = '숙련 +15%';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName == 'addDex'){
return $value * 1.15;
}
return $value;
}
}
@@ -0,0 +1,24 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_약탈발동;
use sammo\WarUnitTrigger\che_약탈시도;
use sammo\WarUnitTriggerCaller;
class che_약탈_옥벽 extends \sammo\BaseItem{
protected $rawName = '옥벽';
protected $name = '옥벽(약탈)';
protected $info = '[전투] 새로운 상대와 전투 시 20% 확률로 상대 금, 쌀 10% 약탈';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_약탈시도($unit, che_약탈시도::TYPE_ITEM, 0.2, 0.1),
new che_약탈발동($unit, che_약탈발동::TYPE_ITEM)
);
}
}
@@ -0,0 +1,25 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
use \sammo\WarUnit;
use sammo\WarUnitTriggerCaller;
use \sammo\WarUnitTrigger\che_위압시도;
use \sammo\WarUnitTrigger\che_위압발동;
class che_위압_조목삭 extends \sammo\BaseItem{
protected $rawName = '조목삭';
protected $name = '조목삭(위압)';
protected $info = '[전투] 첫 페이즈 위압 발동(적 공격, 회피 불가, 사기 5 감소)';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_위압시도($unit),
new che_위압발동($unit)
);
}
}
@@ -11,7 +11,6 @@ use sammo\WarUnitTrigger\che_전투치료시도;
class che_의술_상한잡병론 extends \sammo\BaseItem{
protected $id = 24;
protected $rawName = '상한잡병론';
protected $name = '상한잡병론(의술)';
protected $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 40% 확률로 치료 발동(아군 피해 1/3 감소, 부상 회복)';
@@ -29,7 +28,7 @@ class che_의술_상한잡병론 extends \sammo\BaseItem{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
}
}
@@ -0,0 +1,34 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
use sammo\WarUnitTrigger\che_전투치료발동;
use sammo\WarUnitTrigger\che_전투치료시도;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitTriggerCaller;
class che_의술_정력견혈산 extends \sammo\BaseItem{
protected $rawName = '정력견혈산';
protected $name = '정력견혈산(의술)';
protected $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 40% 확률로 치료 발동(아군 피해 1/3 감소, 부상 회복)';
protected $cost = 200;
protected $consumable = false;
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
return new GeneralTriggerCaller(
new GeneralTrigger\che_도시치료($general)
);
}
public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller
{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
}
}
@@ -11,7 +11,6 @@ use sammo\WarUnitTriggerCaller;
class che_의술_청낭서 extends \sammo\BaseItem{
protected $id = 23;
protected $rawName = '청낭서';
protected $name = '청낭서(의술)';
protected $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 40% 확률로 치료 발동(아군 피해 1/3 감소, 부상 회복)';
@@ -29,7 +28,7 @@ class che_의술_청낭서 extends \sammo\BaseItem{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
}
}
@@ -11,7 +11,6 @@ use sammo\WarUnitTrigger\che_전투치료시도;
class che_의술_태평청령 extends \sammo\BaseItem{
protected $id = 24;
protected $rawName = '태평청령';
protected $name = '태평청령(의술)';
protected $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 40% 확률로 치료 발동(아군 피해 1/3 감소, 부상 회복)';
@@ -29,7 +28,7 @@ class che_의술_태평청령 extends \sammo\BaseItem{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*303),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
}
}
@@ -12,7 +12,6 @@ use \sammo\WarUnitTrigger\che_저격발동;
class che_저격_매화수전 extends \sammo\BaseItem{
protected $id = 70;
protected $rawName = '매화수전';
protected $name = '매화수전(저격)';
protected $info = '[전투] 새로운 상대와 전투 시 50% 확률로 저격 발동, 성공 시 사기+20';
@@ -12,7 +12,6 @@ use \sammo\WarUnitTrigger\che_저격발동;
class che_저격_비도 extends \sammo\BaseItem{
protected $id = 70;
protected $rawName = '비도';
protected $name = '비도(저격)';
protected $info = '[전투] 새로운 상대와 전투 시 50% 확률로 저격 발동, 성공 시 사기+20';
@@ -10,7 +10,6 @@ use \sammo\BaseWarUnitTrigger;
class che_저격_수극 extends \sammo\BaseItem{
protected $id = 2;
protected $rawName = '수극';
protected $name = '수극(저격)';
protected $info = '[전투] 전투 개시 전 50% 확률로 저격 시도. 1회용';
@@ -0,0 +1,34 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use sammo\Util;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저지발동;
use sammo\WarUnitTrigger\WarActivateSkills;
use sammo\WarUnitTriggerCaller;
class che_저지_삼황내문 extends \sammo\BaseItem{
protected $rawName = '삼황내문';
protected $name = '삼황내문(저지)';
protected $info = '[전투] 수비 시 첫 페이즈 저지, 50% 확률로 2 페이즈 저지';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
if($unit->isAttacker()){
return null;
}
if($unit->getPhase() >= 2){
return null;
}
if($unit->getPhase() == 1 && Util::randBool(0.5)){
return null;
}
return new WarUnitTriggerCaller(
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, true, '특수', '저지'),
new che_저지발동($unit)
);
}
}
@@ -0,0 +1,21 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\Util;
class che_전략_평만지장도 extends \sammo\BaseItem{
protected $rawName = '평만지장도';
protected $name = '평만지장도(전략)';
protected $info = '[전략] 국가전략 사용시 재사용 대기 기간 -15%';
protected $cost = 200;
protected $consumable = false;
public function onCalcStrategic(string $turnType, string $varType, $value){
if($varType == 'delay'){
return Util::round($value * 0.85);
}
return $value;
}
}
@@ -0,0 +1,22 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\Util;
class che_조달_주판 extends \sammo\BaseItem{
protected $rawName = '주판';
protected $name = '주판(조달)';
protected $info = '[내정] 물자조달 성공 확률 +20%p, 물자조달 획득량 +100%p';
protected $cost = 200;
protected $consumable = false;
public function onCalcStrategic(string $turnType, string $varType, $value){
if($turnType === '조달'){
if($varType == 'success') return $value + 0.2;
if($varType == 'score') return $value * 2;
}
return $value;
}
}
@@ -0,0 +1,22 @@
<?php
namespace sammo\ActionItem;
use \sammo\General;
class che_집중_전국책 extends \sammo\BaseItem
{
protected $rawName = '전국책';
protected $name = '전국책(집중)';
protected $info = '[전투] 계략 성공 시 대미지 +30%';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux = null)
{
if ($statName === 'warMagicSuccessDamage') {
return $value * 1.3;
}
return $value;
}
}
@@ -0,0 +1,30 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
use \sammo\WarUnit;
class che_징병_낙주 extends \sammo\BaseItem{
protected $rawName = '낙주';
protected $name = '낙주(징병)';
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +15%';
protected $cost = 200;
protected $consumable = false;
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost') return $value * 0.5;
}
return $value;
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'leadership'){
return $value + $general->getVar('leadership') * 0.15;
}
return $value;
}
}
@@ -0,0 +1,23 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
use \sammo\WarUnit;
class che_척사_오악진형도 extends \sammo\BaseItem{
protected $rawName = '오악진형도';
protected $name = '오악진형도(척사)';
protected $info = '[전투] 지역·도시 병종 상대로 대미지 +15%, 아군 피해 -15%';
protected $cost = 200;
protected $consumable = false;
public function getWarPowerMultiplier(WarUnit $unit):array{
$opposeCrewType = $unit->getOppose()->getCrewType();
if($opposeCrewType->reqCities || $opposeCrewType->reqRegions){
return [1.15, 0.85];
}
return [1, 1];
}
}
@@ -7,7 +7,6 @@ use \sammo\GeneralTriggerCaller;
class che_치료_도소연명 extends \sammo\BaseItem{
protected $id = 9;
protected $rawName = '도소연명';
protected $name = '도소연명(치료)';
protected $info = '[군사] 턴 실행 전 부상 회복.';
@@ -7,7 +7,6 @@ use \sammo\GeneralTriggerCaller;
class che_치료_무후행군 extends \sammo\BaseItem{
protected $id = 8;
protected $rawName = '무후행군';
protected $name = '무후행군(치료)';
protected $info = '[군사] 턴 실행 전 부상 회복.';
@@ -7,7 +7,6 @@ use \sammo\GeneralTriggerCaller;
class che_치료_오석산 extends \sammo\BaseItem{
protected $id = 7;
protected $rawName = '오석산';
protected $name = '오석산(치료)';
protected $info = '[군사] 턴 실행 전 부상 회복.';
@@ -7,7 +7,6 @@ use \sammo\GeneralTriggerCaller;
class che_치료_정력견혈 extends \sammo\BaseItem{
protected $id = 11;
protected $rawName = '정력견혈';
protected $name = '정력견혈(치료)';
protected $info = '[군사] 턴 실행 전 부상 회복.';
@@ -7,7 +7,6 @@ use \sammo\GeneralTriggerCaller;
class che_치료_칠엽청점 extends \sammo\BaseItem{
protected $id = 10;
protected $rawName = '칠엽청점';
protected $name = '칠엽청점(치료)';
protected $info = '[군사] 턴 실행 전 부상 회복.';
@@ -7,7 +7,6 @@ use \sammo\GeneralTriggerCaller;
class che_치료_환약 extends \sammo\BaseItem{
protected $id = 1;
protected $rawName = '환약';
protected $name = '환약(치료)';
protected $info = '[군사] 턴 실행 전 부상 회복. 1회용';
@@ -0,0 +1,20 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
class che_필살_둔갑천서 extends \sammo\BaseItem{
protected $rawName = '둔갑천서';
protected $name = '둔갑천서(필살)';
protected $info = '[전투] 필살 확률 +25%p';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'warCriticalRatio'){
return $value + 0.25;
}
return $value;
}
}
@@ -5,7 +5,6 @@ use \sammo\General;
class che_행동_서촉지형도 extends \sammo\BaseItem{
protected $id = 22;
protected $rawName = '서촉지형도';
protected $name = '서촉지형도(행동)';
protected $info = '[전투] 공격 시 페이즈 + 2';
@@ -0,0 +1,25 @@
<?php
namespace sammo\ActionItem;
use \sammo\General;
class che_환술_논어집해 extends \sammo\BaseItem
{
protected $rawName = '논어집해';
protected $name = '논어집해(환술)';
protected $info = '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +20%';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux = null)
{
if ($statName === 'warMagicSuccessProb') {
return $value + 0.1;
}
if ($statName === 'warMagicSuccessDamage') {
return $value * 1.2;
}
return $value;
}
}
@@ -5,7 +5,6 @@ use \sammo\General;
class che_회피_둔갑천서 extends \sammo\BaseItem{
protected $id = 26;
protected $rawName = '둔갑천서';
protected $name = '둔갑천서(회피)';
protected $info = '[전투] 회피 확률 +20%p';
@@ -18,4 +17,6 @@ class che_회피_둔갑천서 extends \sammo\BaseItem{
}
return $value;
}
}
}
//NOTE: 구버전
@@ -5,7 +5,6 @@ use \sammo\General;
class che_회피_태평요술 extends \sammo\BaseItem{
protected $id = 25;
protected $rawName = '태평요술';
protected $name = '태평요술(회피)';
protected $info = '[전투] 회피 확률 +20%p';
@@ -14,7 +13,7 @@ class che_회피_태평요술 extends \sammo\BaseItem{
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'warAvoidRatio'){
return $value + 0.2;
return $value + 0.20;
}
return $value;
}
@@ -5,7 +5,6 @@ use \sammo\General;
class che_훈련_과실주 extends \sammo\BaseItem{
protected $id = 12;
protected $rawName = '과실주';
protected $name = '과실주(훈련)';
protected $info = '[전투] 훈련 보정 +10';
@@ -18,4 +17,6 @@ class che_훈련_과실주 extends \sammo\BaseItem{
}
return $value;
}
}
}
//NOTE: 구버전
@@ -5,16 +5,15 @@ use \sammo\General;
class che_훈련_단결도 extends \sammo\BaseItem{
protected $id = 18;
protected $rawName = '단결도';
protected $name = '단결도(훈련)';
protected $info = '[전투] 훈련 보정 +14';
protected $info = '[전투] 훈련 보정 +15';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusTrain'){
return $value + 14;
return $value + 15;
}
return $value;
}
@@ -5,7 +5,6 @@ use \sammo\General;
class che_훈련_이강주 extends \sammo\BaseItem{
protected $id = 13;
protected $rawName = '이강주';
protected $name = '이강주(훈련)';
protected $info = '[전투] 훈련 보정 +10';
@@ -18,4 +17,6 @@ class che_훈련_이강주 extends \sammo\BaseItem{
}
return $value;
}
}
}
//NOTE: 구버전
@@ -5,16 +5,15 @@ use \sammo\General;
class che_훈련_철벽서 extends \sammo\BaseItem{
protected $id = 17;
protected $rawName = '철벽서';
protected $name = '철벽서(훈련)';
protected $info = '[전투] 훈련 보정 +14';
protected $info = '[전투] 훈련 보정 +15';
protected $cost = 200;
protected $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusTrain'){
return $value + 14;
return $value + 15;
}
return $value;
}
@@ -9,7 +9,6 @@ use \sammo\WarUnitTrigger\능력치변경;
class che_훈련_청주 extends \sammo\BaseItem{
protected $id = 4;
protected $rawName = '청주';
protected $name = '청주(훈련)';
protected $info = '[전투] 훈련 +6. 1회용';
-1
View File
@@ -10,7 +10,6 @@ use sammo\WarUnitTrigger\che_격노발동;
class event_빼빼로 extends \sammo\BaseItem{
protected $id = 75;
protected $rawName = '빼빼로';
protected $name = '빼빼로';
protected $info = '1의 상징입니다.<br>통솔 +1, 무력 +1, 지력 +1';
@@ -10,10 +10,9 @@ use sammo\WarUnitTrigger\che_격노발동;
class event_전투특기_격노 extends \sammo\BaseItem{
protected $id = 74;
protected $rawName = '비급';
protected $name = '비급(격노)';
protected $info = '[전투] 상대방 필살 시 격노(필살) 발동, 회피 시도시 25% 확률로 격노 발동, 공격 시 일정 확률로 진노(1페이즈 추가)';
protected $info = '[전투] 상대방 필살 시 격노(필살) 발동, 회피 시도시 25% 확률로 격노 발동, 공격 시 일정 확률로 진노(1페이즈 추가), 격노마다 대미지 20% 추가 중첩';
protected $cost = 100;
protected $buyable = true;
protected $consumable = false;
@@ -9,7 +9,6 @@ use sammo\WarUnitTriggerCaller;
class event_전투특기_견고 extends \sammo\BaseItem{
protected $id = 74;
protected $rawName = '비급';
protected $name = '비급(견고)';
protected $info = '[전투] 상대 필살 확률 -20%p, 상대 계략 시도시 성공 확률 -10%p, 부상 없음, 아군 피해 -10%';
@@ -9,7 +9,6 @@ use \sammo\WarUnitCity;
class event_전투특기_공성 extends \sammo\BaseItem{
protected $id = 53;
protected $rawName = '비급';
protected $name = '비급(공성)';
protected $info = '[군사] 차병 계통 징·모병비 -10%<br>[전투] 성벽 공격 시 대미지 +100%,<br>공격시 상대 병종에/수비시 자신 병종 숙련에 차병 숙련을 가산';
@@ -22,7 +21,7 @@ class event_전투특기_공성 extends \sammo\BaseItem{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_SIEGE) return $value * 0.9;
}
return $value;
}
@@ -8,7 +8,6 @@ use \sammo\GameUnitConst;
class event_전투특기_궁병 extends \sammo\BaseItem{
protected $id = 51;
protected $rawName = '비급';
protected $name = '비급(궁병)';
protected $info = '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p,<br>공격시 상대 병종에/수비시 자신 병종 숙련에 궁병 숙련을 가산';
@@ -21,7 +20,7 @@ class event_전투특기_궁병 extends \sammo\BaseItem{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_ARCHER) return $value * 0.9;
}
return $value;
}
@@ -8,7 +8,6 @@ use \sammo\WarUnit;
class event_전투특기_귀병 extends \sammo\BaseItem{
protected $id = 40;
protected $rawName = '비급';
protected $name = '비급(귀병)';
protected $info = '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p,<br>공격시 상대 병종에/수비시 자신 병종 숙련에 귀병 숙련을 가산';
@@ -21,7 +20,7 @@ class event_전투특기_귀병 extends \sammo\BaseItem{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_WIZARD) return $value * 0.9;
}
return $value;
}
@@ -8,7 +8,6 @@ use \sammo\WarUnit;
class event_전투특기_기병 extends \sammo\BaseItem{
protected $id = 52;
protected $rawName = '비급';
protected $name = '비급(기병)';
protected $info = '[군사] 기병 계통 징·모병비 -10%<br>[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%,<br>공격시 상대 병종에/수비시 자신 병종 숙련에 기병 숙련을 가산';
@@ -21,7 +20,7 @@ class event_전투특기_기병 extends \sammo\BaseItem{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_CAVALRY) return $value * 0.9;
}
return $value;
}
@@ -11,7 +11,6 @@ use \sammo\WarUnitTrigger\che_돌격지속;
class event_전투특기_돌격 extends \sammo\BaseItem{
protected $id = 60;
protected $rawName = '비급';
protected $name = '비급(돌격)';
protected $info = '[전투] 공격 시 대등/유리한 병종에게는 퇴각 전까지 전투, 공격 시 페이즈 + 2, 공격 시 대미지 +5%';
@@ -8,7 +8,6 @@ use \sammo\Util;
class event_전투특기_무쌍 extends \sammo\BaseItem{
protected $id = 61;
protected $rawName = '비급';
protected $name = '비급(무쌍)';
protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
@@ -12,7 +12,6 @@ use \sammo\WarUnitTrigger\che_반계발동;
class event_전투특기_반계 extends \sammo\BaseItem{
protected $id = 45;
protected $rawName = '비급';
protected $name = '비급(반계)';
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +150%)';
@@ -8,7 +8,6 @@ use \sammo\WarUnit;
class event_전투특기_보병 extends \sammo\BaseItem{
protected $id = 50;
protected $rawName = '비급';
protected $name = '비급(보병)';
protected $info = '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%,<br>공격시 상대 병종에/수비시 자신 병종 숙련에 보병 숙련을 가산';
@@ -22,7 +21,7 @@ class event_전투특기_보병 extends \sammo\BaseItem{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_FOOTMAN) return $value * 0.9;
}
return $value;
}
@@ -7,7 +7,6 @@ use \sammo\WarUnit;
class event_전투특기_신산 extends \sammo\BaseItem{
protected $id = 41;
protected $rawName = '비급';
protected $name = '비급(신산)';
protected $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p';
@@ -20,7 +19,7 @@ class event_전투특기_신산 extends \sammo\BaseItem{
if($turnType == '계략'){
if($varType == 'success') return $value + 0.1;
}
return $value;
}
@@ -7,7 +7,6 @@ use \sammo\WarUnit;
class event_전투특기_신중 extends \sammo\BaseItem{
protected $id = 44;
protected $rawName = '비급';
protected $name = '비급(신중)';
protected $info = '[전투] 계략 성공 확률 100%';
@@ -10,7 +10,6 @@ use \sammo\WarUnitTrigger\che_위압발동;
class event_전투특기_위압 extends \sammo\BaseItem{
protected $id = 63;
protected $rawName = '비급';
protected $name = '비급(위압)';
protected $info = '[전투] 첫 페이즈 위압 발동(적 공격, 회피 불가, 사기 5 감소)';
@@ -13,7 +13,6 @@ use sammo\WarUnitTriggerCaller;
class event_전투특기_의술 extends \sammo\BaseItem{
protected $id = 73;
protected $rawName = '비급';
protected $name = '비급(의술)';
protected $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 40% 확률로 치료 발동(아군 피해 1/3 감소, 부상 회복)';
@@ -10,7 +10,6 @@ use \sammo\WarUnitTrigger\che_저격발동;
class event_전투특기_저격 extends \sammo\BaseItem{
protected $id = 70;
protected $rawName = '비급';
protected $name = '비급(저격)';
protected $info = '[전투] 새로운 상대와 전투 시 50% 확률로 저격 발동, 성공 시 사기+20';
@@ -7,7 +7,6 @@ use \sammo\WarUnit;
class event_전투특기_집중 extends \sammo\BaseItem{
protected $id = 43;
protected $rawName = '비급';
protected $name = '비급(집중)';
protected $info = '[전투] 계략 성공 시 대미지 +50%';
@@ -7,10 +7,9 @@ use \sammo\WarUnit;
class event_전투특기_징병 extends \sammo\BaseItem{
protected $id = 72;
protected $rawName = '비급';
protected $name = '비급(징병)';
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +15%';
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +25%';
protected $cost = 100;
protected $buyable = true;
protected $consumable = false;
@@ -20,13 +19,13 @@ class event_전투특기_징병 extends \sammo\BaseItem{
if(in_array($turnType, ['징병', '모병'])){
if($varType == 'cost') return $value * 0.5;
}
return $value;
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'leadership'){
return $value *= 1.15;
return $value + $general->getVar('leadership') * 0.25;
}
return $value;
}
@@ -7,7 +7,6 @@ use \sammo\WarUnit;
class event_전투특기_척사 extends \sammo\BaseItem{
protected $id = 75;
protected $rawName = '비급';
protected $name = '비급(척사)';
protected $info = '[전투] 지역·도시 병종 상대로 대미지 +20%, 아군 피해 -20%';
@@ -9,7 +9,6 @@ use sammo\WarUnitTrigger\che_필살강화_회피불가;
class event_전투특기_필살 extends \sammo\BaseItem{
protected $id = 71;
protected $rawName = '비급';
protected $name = '비급(필살)';
protected $info = '[전투] 필살 확률 +30%p, 필살 발동시 대상 회피 불가';
@@ -7,7 +7,6 @@ use \sammo\WarUnit;
class event_전투특기_환술 extends \sammo\BaseItem{
protected $id = 42;
protected $rawName = '비급';
protected $name = '비급(환술)';
protected $info = '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%';
+1 -2
View File
@@ -7,7 +7,6 @@ use \sammo\General;
class BaseItem implements iAction{
use \sammo\DefaultAction;
protected $id = 0;
protected $rawName = '-';
protected $name = '-';
protected $info = '';
@@ -30,7 +29,7 @@ class BaseItem implements iAction{
}
return static::class;
}
function getCost(){
return $this->cost;
}
+11 -4
View File
@@ -79,13 +79,20 @@ class che_물자조달 extends Command\GeneralCommand{
$score *= getDomesticExpLevelBonus($general->getVar('explevel'));
$score *= Util::randRange(0.8, 1.2);
$successRatio = 0.1;
$failRatio = 0.3;
$successRatio = $general->onCalcDomestic('조달', 'success', $successRatio);
$failRatio = $general->onCalcDomestic('조달', 'fail', $failRatio);
$normalRatio = 1 - $failRatio - $successRatio;
$pick = Util::choiceRandomUsingWeight([
'fail'=>0.3,
'success'=>0.1,
'normal'=>0.6
'fail'=>$failRatio,
'success'=>$successRatio,
'normal'=>$normalRatio
]);
$score *= CriticalScoreEx($pick);
$score = $general->onCalcDomestic('조달', 'score', $score);
$score = Util::round($score);
$scoreText = number_format($score, 0);
+23 -78
View File
@@ -173,11 +173,13 @@ class che_장비매매 extends Command\GeneralCommand
if ($buying) {
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 구입했습니다. <1>$date</>");
$general->increaseVarWithLimit('gold', -$cost, 0);
$general->setVar($itemType, $itemCode);
$general->setItem($itemType, $itemCode);
$general->onArbitraryAction($general, '장비매매', '구매', ['itemCode' => $itemCode]);
} else {
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 판매했습니다. <1>$date</>");
$general->increaseVarWithLimit('gold', $cost / 2);
$general->deleteItem($itemType);
$general->onArbitraryAction($general, '장비매매', '판매', ['itemCode' => $itemCode]);
$general->setItem($itemType, null);
}
$exp = 10;
@@ -209,96 +211,39 @@ class che_장비매매 extends Command\GeneralCommand
continue;
}
$values[] = [
'id'=>$itemCode,
'name'=>$item->getName(),
'reqSecu'=>$item->getReqSecu(),
'cost'=>$item->getCost(),
'info'=>$item->getInfo(),
'isBuyable'=>$item->isBuyable(),//항상 true지만, 일관성을 위해
'id' => $itemCode,
'name' => $item->getName(),
'reqSecu' => $item->getReqSecu(),
'cost' => $item->getCost(),
'info' => $item->getInfo(),
'isBuyable' => $item->isBuyable(), //항상 true지만, 일관성을 위해
];
}
$itemList[$itemType] = [
'typeName'=>$typeName,
'values'=>$values
'typeName' => $typeName,
'values' => $values
];
}
$ownItem = [];
foreach($general->getItems() as $itemType => $item){
foreach ($general->getItems() as $itemType => $item) {
$ownItem[$itemType] = [
'id'=>$item->getRawClassName(),
'name'=>$item->getName(),
'reqSecu'=>$item->getReqSecu(),
'cost'=>$item->getCost(),
'info'=>$item->getInfo(),
'isBuyable'=>$item->isBuyable(),
'id' => $item->getRawClassName(),
'name' => $item->getName(),
'reqSecu' => $item->getReqSecu(),
'cost' => $item->getCost(),
'info' => $item->getInfo(),
'isBuyable' => $item->isBuyable(),
];
}
return [
'procRes' => [
'citySecu'=>$citySecu,
'gold'=>$general->getVar('gold'),
'itemList'=>$itemList,
'ownItem'=>$ownItem,
'citySecu' => $citySecu,
'gold' => $general->getVar('gold'),
'itemList' => $itemList,
'ownItem' => $ownItem,
]
];
}
public function getForm(): string
{
$form = [];
$db = DB::db();
$citySecu = $db->queryFirstField('SELECT secu FROM city WHERE city = %i', $this->generalObj->getCityID());
$gold = $this->generalObj->getVar('gold');
ob_start();
?>
<script>
function updateItemType() {
$('#itemType').val($('#itemCode option:selected').data('item_type'));
}
$(function() {
$('#customSubmit').click(function() {
updateItemType();
submitAction();
});
});
</script>
<input type="hidden" class="formInput" name="itemType" id="itemType" value="item">
장비를 구입하거나 매각합니다.<br>
현재 구입 불가능한 것은 <font color=red>붉은색</font>으로 표시됩니다.<br>
현재 도시 치안 : <?= $citySecu ?> &nbsp;&nbsp;&nbsp;현재 자금 : <?= $gold ?><br>
장비 : <select class='formInput' name="itemCode" id="itemCode" onchange='updateItemType();' size='1' style='color:white;background-color:black;'>
<?php foreach (GameConst::$allItems as $itemType => $itemCategories) :
//매각
$typeName = static::$itemMap[$itemType];
?>
<option value='None' data-item_type='<?= $itemType ?>' style='color:skyblue'>_____<?= $typeName ?>매각(반값)____</option>
<?php foreach ($itemCategories as $itemCode => $cnt) :
if ($cnt > 0) {
continue;
}
$itemClass = buildItemClass($itemCode);
if (!$itemClass->isBuyable()) {
continue;
}
$itemName = $itemClass->getName();
$reqSecu = $itemClass->getReqSecu();
$reqGold = $itemClass->getCost();
$css = '';
if ($reqSecu > $citySecu) {
$css = 'color:red;';
}
?>
<option value='<?= $itemCode ?>' data-item_type='<?= $itemType ?>' style='<?= $css ?>'><?= $itemName ?> 가격: <?= $reqGold ?></option>
<?php endforeach; ?>
<?php endforeach; ?>
</select>
<input type=button id="customSubmit" value="<?= $this->getName() ?>"><br>
<?php
return ob_get_clean();
}
}
+3
View File
@@ -76,6 +76,7 @@ class che_화계 extends Command\GeneralCommand
$destNationID = $destNation['nation'];
$maxGenScore = 0;
$probCorrection = 0;
foreach ($destCityGeneralList as $destGeneral) {
/** @var General $destGeneral */
if ($destGeneral->getNationID() != $destNationID) {
@@ -92,9 +93,11 @@ class che_화계 extends Command\GeneralCommand
throw new \sammo\MustNotBeReachedException();
}
$maxGenScore = max($maxGenScore, $genScore);
$probCorrection = $destGeneral->onCalcStat($destGeneral, 'sabotageDefence', $probCorrection);
}
$prob = $maxGenScore / GameConst::$sabotageProbCoefByStat;
$prob += $probCorrection;
$prob += $destCity['secu'] / $destCity['secu_max'] / 5; //최대 20%p
$prob += $destCity['supply'] ? 0.1 : 0;
+4
View File
@@ -46,4 +46,8 @@ trait DefaultAction{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return null;
}
public function onArbitraryAction(General $general, string $actionType, ?string $phase=null, $aux=null): null|array{
return $aux;
}
}
+16 -8
View File
@@ -251,17 +251,25 @@ class GameConstBase
'che_치료_환약' => 0, 'che_저격_수극' => 0, 'che_사기_탁주' => 0,
'che_훈련_청주' => 0, 'che_계략_이추' => 0, 'che_계략_향낭' => 0,
'che_의술_청낭서' => 1, 'che_의술_태평청령' => 1, 'che_의술_상한잡병론' => 1,
'che_부적_태현청생부' => 1,
'che_저격_매화수전' => 1, 'che_저격_비도' => 1,
'che_의술_정력견혈산' => 1, 'che_의술_청낭서' => 1, 'che_의술_태평청령' => 1, 'che_의술_상한잡병론' => 1,
'che_보물_도기' => 1, 'che_조달_주판' => 1,
'che_내정_납금박산로' => 1, 'che_전략_평만지장도' => 1, 'che_숙련_동작' => 1, 'che_명성_구석' => 1,
'che_척사_오악진형도' => 1, 'che_격노_구정신단경' => 1, 'che_징병_낙주' => 1,
'che_저격_매화수전' => 1, 'che_저격_비도'=>1, 'che_위압_조목삭' => 1, 'che_공성_묵자' => 1,
'che_집중_전국책' => 1, 'che_환술_논어집해' => 1,
'che_반계저지_박혁론' => 1, 'che_부적_태현청생부' => 1, 'che_저지_삼황내문' => 1,
'che_행동_서촉지형도' => 1, 'che_간파_노군입산부' => 1, 'che_불굴_상편' => 1,
'che_약탈_옥벽' => 1,
'che_농성_주서음부' => 1, 'che_농성_위공자병법' => 1,
'che_계략_육도' => 1, 'che_계략_삼략' => 1,
'che_반계_백우선' => 1,
'che_행동_서촉지형도' => 1,
'che_훈련_과실주' => 1, 'che_훈련_이강주' => 1, 'che_사기_두강주' => 1, 'che_사기_보령압주' => 1,
'che_상성보정_과실주' => 1,
'che_능력치_지력_이강주' => 1, 'che_능력치_무력_두강주' => 1, 'che_능력치_통솔_보령압주' => 1,
'che_훈련_철벽서' => 1, 'che_훈련_단결도' => 1, 'che_사기_춘화첩' => 1, 'che_사기_초선화' => 1,
'che_회피_태평요술' => 1, 'che_회피_둔갑천서' => 1,
'che_회피_태평요술' => 1, 'che_필살_둔갑천서' => 1,
]
];
+21
View File
@@ -183,6 +183,7 @@ class General implements iAction
{
if ($itemCode === null) {
$this->deleteItem($itemKey);
return;
}
$this->setVar($itemKey, $itemCode);
@@ -536,6 +537,7 @@ class General implements iAction
}
$dexType = "dex{$armType}";
$exp = $this->onCalcStat($this, 'addDex', $exp, ['armType'=>$armType]);
$this->increaseVar($dexType, $exp);
}
@@ -1009,6 +1011,25 @@ class General implements iAction
return $amount;
}
public function onArbitraryAction(General $general, string $actionType, ?string $phase=null, $aux=null): null|array{
foreach (array_merge([
$this->nationType,
$this->officerLevelObj,
$this->specialDomesticObj,
$this->specialWarObj,
$this->personalityObj,
$this->getCrewTypeObj(),
$this->inheritBuffObj,
], $this->itemObjs) as $iObj) {
if (!$iObj) {
continue;
}
/** @var iAction $iObj */
$aux = $iObj->onArbitraryAction($general, $actionType, $phase, $aux);
}
return $aux;
}
public function getWarPowerMultiplier(WarUnit $unit): array
{
//xxx:$unit
+1 -1
View File
@@ -4144,7 +4144,7 @@ class GeneralAI
$wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
$income = $riceIncome + $wallIncome;
$outcome = getOutcome(100, $dedicationList);
$outcome = Util::valueFit(getOutcome(100, $dedicationList), 1);
$bill = intval($income / $outcome * 90); // 수입의 90% 만 지급
if ($nation['rice'] + $income - $outcome > $this->nationPolicy->reqNationRice * 2) {
@@ -22,6 +22,9 @@ class che_반계시도 extends BaseWarUnitTrigger{
if(!$oppose->hasActivatedSkill('계략')){
return true;
}
if($self->hasActivatedSkill('반계불가')){
return true;
}
if(!Util::randBool($this->prob)){
return true;
@@ -0,0 +1,59 @@
<?php
namespace sammo\WarUnitTrigger;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitGeneral;
use sammo\WarUnitCity;
use sammo\WarUnit;
use sammo\GameUnitDetail;
use sammo\Util;
use sammo\ObjectTrigger;
use sammo\ActionLogger;
use sammo\GameConst;
class che_약탈발동 extends BaseWarUnitTrigger
{
protected $priority = ObjectTrigger::PRIORITY_POST + 400;
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv): bool
{
if (!$self->hasActivatedSkill('약탈')) {
return true;
}
if ($selfEnv['약탈발동'] ?? false) {
return true;
}
$selfEnv['약탈발동'] = true;
$general = $self->getGeneral();
if (!($oppose instanceof WarUnitGeneral)) {
return true;
}
$general->increaseVarWithLimit('atmos', $selfEnv['addAtmos'], 0, GameConst::$maxAtmosByWar);
$opposeGeneral = $oppose->getGeneral();
$theftGold = $opposeGeneral->getVar('gold') * $selfEnv['theftRatio'];
$theftRice = $opposeGeneral->getVar('rice') * $selfEnv['theftRatio'];
$opposeGeneral->increaseVarWithLimit('gold', -$theftGold, 0);
$opposeGeneral->increaseVarWithLimit('rice', -$theftRice, 0);
$general->increaseVar('gold', $theftGold);
$general->increaseVar('rice', $theftRice);
$self->getLogger()->pushGeneralActionLog("상대를 <C>약탈</>했다!", ActionLogger::PLAIN);
$self->getLogger()->pushGeneralBattleDetailLog("상대에게서 금 {$theftGold}, 쌀 {$theftRice} 만큼을 <C>약탈</>했다!", ActionLogger::PLAIN);
$oppose->getLogger()->pushGeneralActionLog("상대에게 <R>약탈</>당했다!", ActionLogger::PLAIN);
$oppose->getLogger()->pushGeneralBattleDetailLog("상대에게 금 {$theftGold}, 쌀 {$theftRice} 만큼을 <R>약탈</>당했다!", ActionLogger::PLAIN);
$this->processConsumableItem();
return true;
}
}
@@ -0,0 +1,47 @@
<?php
namespace sammo\WarUnitTrigger;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitGeneral;
use sammo\WarUnitCity;
use sammo\WarUnit;
use sammo\GameUnitDetail;
use sammo\ObjectTrigger;
use sammo\Util;
class che_약탈시도 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_PRE + 400;
protected $ratio;
protected $theftRatio;
public function __construct(WarUnit $unit, int $raiseType, float $ratio, float $theftRatio){
$this->object = $unit;
$this->raiseType = $raiseType;
$this->ratio = $ratio;
$this->theftRatio = $theftRatio;
}
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
if($self->getPhase() !== 0 && $oppose->getPhase() !== 0){
return true;
}
if(!($oppose instanceof WarUnitGeneral)){
return true;
}
if($self->hasActivatedSkill('약탈')){
return true;
}
if($self->hasActivatedSkill('약탈불가')){
return true;
}
if(!Util::randBool($this->ratio)){
return true;
}
$self->activateSkill('약탈');
$selfEnv['theftRatio'] = $this->theftRatio;
return true;
}
}
@@ -0,0 +1,25 @@
<?php
namespace sammo\WarUnitTrigger;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitGeneral;
use sammo\WarUnitCity;
use sammo\WarUnit;
use sammo\GameUnitDetail;
use sammo\ObjectTrigger;
class 전투력보정 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BEGIN;
public function __construct(WarUnit $unit, protected int|float $attackerWarPowerMultiplier, protected int|float $defenderWarPowerMultiplier = 1){
$this->object = $unit;
}
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
$self->multiplyWarPowerMultiply($this->attackerWarPowerMultiplier);
$oppose->multiplyWarPowerMultiply($this->defenderWarPowerMultiplier);
$this->processConsumableItem();
return true;
}
}
+2
View File
@@ -18,4 +18,6 @@ interface iAction{
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller;
//NOTE: getBattleEndSkillTriggerList도 필요한가?
public function onArbitraryAction(General $general, string $actionType, ?string $phase=null, ?array $aux=null): null|array;
}