func_time_event 재작성, 수입관련 코드 수정

This commit is contained in:
2019-10-10 02:36:42 +09:00
parent 21f8b814e0
commit 0893bf6473
10 changed files with 576 additions and 728 deletions
+1
View File
@@ -3,6 +3,7 @@
namespace sammo;
class ActionLogger{
//TODO: global을 따로 뗴어내고, 장수 Logger를 상속해서 받는 형식으로.
protected $generalId;
protected $nationId;
protected $autoFlush;
+2 -2
View File
@@ -240,7 +240,7 @@ class che_화계 extends Command\GeneralCommand{
[$year, $month] = [$env['year'], $env['month']];
foreach($db->query(
'SELECT `no`,name,city,nation,level,leadership,horse,strength,weapon,intel,book,item,last_turn,injury,special,special2 FROM general WHERE city = %i',
'SELECT `no`,name,city,nation,level,leadership,horse,strength,weapon,intel,book,item,last_turn,injury,special,special2,injury,crew,atmos,train FROM general WHERE city = %i',
$destCityID,
$destNationID
) as $rawDestCityGeneral){
@@ -276,7 +276,7 @@ class che_화계 extends Command\GeneralCommand{
}
if(static::$injuryGeneral){
$injuryCount = \sammo\SabotageInjuryEx($destCityGeneralList, true);
$injuryCount = \sammo\SabotageInjury($destCityGeneralList, '계략');
}
else{
$injuryCount = 0;
+18 -6
View File
@@ -1863,10 +1863,16 @@ class GeneralAI{
$env = $this->env;
$nationID = $nation['nation'];
$cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID);
$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID);
$goldIncome = getGoldIncome($nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
$warIncome = getWarGoldIncome($nation['type'], $cityList);
$income = $goldIncome + $warIncome;
$outcome = getOutcome(100, $dedicationList);
$incomeList = getGoldIncome($nation['nation'], $nation['rate'], $env['gold_rate'], $nation['type']);
$income = $nation['gold'] + $incomeList[0] + $incomeList[1];
$outcome = getGoldOutcome($nation['nation'], 100); // 100%의 지급량
$bill = intval($income / $outcome * 80); // 수입의 80% 만 지급
if($bill < 20) { $bill = 20; }
@@ -1886,9 +1892,15 @@ class GeneralAI{
$nationID = $nation['nation'];
$incomeList = getRiceIncome($nation['nation'], $nation['rate'], $env['gold_rate'], $nation['type']);
$income = $nation['rice'] + $incomeList[0] + $incomeList[1];
$outcome = getRiceOutcome($nation['nation'], 100); // 100%의 지급량
$cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID);
$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID);
$riceIncome = getRiceIncome($nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
$wallIncome = getWallIncome($nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
$income = $riceIncome + $wallIncome;
$outcome = getOutcome(100, $dedicationList);
$bill = intval($income / $outcome * 80); // 수입의 80% 만 지급
if($bill < 20) { $bill = 20; }