feat,refac: increaseInheritancePointRaw 추가
- ownerID만으로 처리 가능
This commit is contained in:
@@ -220,7 +220,7 @@ class InheritancePointManager
|
|||||||
$inheritStor->setValue($key, [$value, $aux]);
|
$inheritStor->setValue($key, [$value, $aux]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function increaseInheritancePoint(General $general, InheritanceKey $key, $value, $aux = null)
|
public function increaseInheritancePointRaw(int $ownerID, InheritanceKey $key, $value, $aux = null)
|
||||||
{
|
{
|
||||||
if (!is_int($value) && !is_float($value)) {
|
if (!is_int($value) && !is_float($value)) {
|
||||||
throw new \InvalidArgumentException("{$value}는 숫자가 아님");
|
throw new \InvalidArgumentException("{$value}는 숫자가 아님");
|
||||||
@@ -234,15 +234,6 @@ class InheritancePointManager
|
|||||||
throw new \InvalidArgumentException("{$key->value}는 직접 저장형 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key->value}는 직접 저장형 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ownerID = $general->getVar('owner');
|
|
||||||
if (!$ownerID) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($general->getVar('npc') >= 2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
if ($gameStor->isunited != 0) {
|
if ($gameStor->isunited != 0) {
|
||||||
return;
|
return;
|
||||||
@@ -259,6 +250,21 @@ class InheritancePointManager
|
|||||||
$inheritStor->setValue($key->value, [$newValue, $aux]);
|
$inheritStor->setValue($key->value, [$newValue, $aux]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function increaseInheritancePoint(General $general, InheritanceKey $key, $value, $aux = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
$ownerID = $general->getVar('owner');
|
||||||
|
if (!$ownerID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($general->getVar('npc') >= 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->increaseInheritancePointRaw($ownerID, $key, $value, $aux);
|
||||||
|
}
|
||||||
|
|
||||||
public function clearInheritancePoint(?int $ownerID)
|
public function clearInheritancePoint(?int $ownerID)
|
||||||
{
|
{
|
||||||
if (!$ownerID) {
|
if (!$ownerID) {
|
||||||
|
|||||||
Reference in New Issue
Block a user