From ede1d8956988f75f2f4bbee8d85a8d4aae047983 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 6 Jun 2019 03:34:47 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9A=8C=ED=94=BC=EC=8B=9C=EB=8F=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80,=20spl=5Fobject=5Fhash=EB=A5=BC=20spl=5Fobje?= =?UTF-8?q?ct=5Fid=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/ObjectTrigger.php | 4 +-- hwe/sammo/WarUnitTrigger/che_회피시도.php | 33 +++++++++++++++++++++++ src/sammo/KVStorage.php | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 hwe/sammo/WarUnitTrigger/che_회피시도.php diff --git a/hwe/sammo/ObjectTrigger.php b/hwe/sammo/ObjectTrigger.php index 70c58db4..0a402678 100644 --- a/hwe/sammo/ObjectTrigger.php +++ b/hwe/sammo/ObjectTrigger.php @@ -18,8 +18,8 @@ abstract class ObjectTrigger{ abstract public function action(?array $env=null, $arg=null):?array; public function getUniqueID():string{ $priority = static::$priority; - $hash = spl_object_hash($this->object); + $objID = spl_object_id($this->object); $fqn = static::class; - return "{$priority}_{$fqn}_{$hash}"; + return "{$priority}_{$fqn}_{$objID}"; } } \ No newline at end of file diff --git a/hwe/sammo/WarUnitTrigger/che_회피시도.php b/hwe/sammo/WarUnitTrigger/che_회피시도.php new file mode 100644 index 00000000..b808bab4 --- /dev/null +++ b/hwe/sammo/WarUnitTrigger/che_회피시도.php @@ -0,0 +1,33 @@ +hasActivatedSkill('특수')){ + return true; + } + if($self->hasActivatedSkill('회피불가')){ + return true; + } + + if(!Util::randBool($self->getComputedAvoidRatio())){ + return true; + } + + $this->activateSkill('특수', '회피시도', '회피'); + + + return true; + } +} \ No newline at end of file diff --git a/src/sammo/KVStorage.php b/src/sammo/KVStorage.php index 8f7eabbd..70e6b666 100644 --- a/src/sammo/KVStorage.php +++ b/src/sammo/KVStorage.php @@ -10,7 +10,7 @@ class KVStorage{ static private $storageList = []; static public function getStorage(\MeekroDB $db, string $storNamespace, string $tableName='storage'):self{ - $obj_id = spl_object_hash($db); + $obj_id = spl_object_id($db); $fullKey = $obj_id.','.$storNamespace.','.$tableName; if(key_exists($fullKey, static::$storageList)){ return static::$storageList[$fullKey];