Files
core/hwe/sammo/Event/Action/NewYear.php
T
Hide_D 7b1a9157e1 feat, refac: 매달 실행되는 함수 마저 구현
- NewYear: 새해(AddAge 일부)
- AssignGeneralSpeciality: 특히 부여(AddAge 일부)
- RaiseDisaster
- RandomizeCityTradeRate
- ResetOfficeLock: 구 updateQuaterly
2023-03-12 17:02:30 +09:00

31 lines
676 B
PHP

<?php
namespace sammo\Event\Action;
use sammo\ActionLogger;
use sammo\DB;
class NewYear extends \sammo\Event\Action
{
public function run(array $env)
{
$year = $env['year'];
$month = $env['month'];
$logger = new ActionLogger(0, 0, $year, $month, false);
$logger->pushGlobalActionLog("<C>{$year}</>년이 되었습니다.");
$logger->flush(); //TODO: globalAction류는 전역에서 관리하는것이 좋을 듯.
$db = DB::db();
//나이와 호봉 증가
$db->update('general', [
'age' => $db->sqleval('age+1'),
], true);
$db->update('general', [
'belong' => $db->sqleval('belong+1')
], 'nation != 0');
}
}