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];