• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revisão1973 (tree)
Hora2017-04-23 02:31:03
Autorumethyl

Mensagem de Log

UserMode::POSSESSED_CANCEL

Mudança Sumário

Diff

--- trunk/include/data/user_data_class.php (revision 1972)
+++ trunk/include/data/user_data_class.php (revision 1973)
@@ -9,9 +9,10 @@
99
1010 //-- 定数リスト (User/Mode) --//
1111 class UserMode {
12- const DEAD = 'dead';
13- const SUICIDE = 'suicide';
14- const REVIVE = 'revive';
15- const LOST = 'lost';
16- const POSSESSED_RESET = 'possessed_reset';
12+ const DEAD = 'dead';
13+ const SUICIDE = 'suicide';
14+ const REVIVE = 'revive';
15+ const LOST = 'lost';
16+ const POSSESSED_CANCEL = 'possessed_cancel';
17+ const POSSESSED_RESET = 'possessed_reset';
1718 }
--- trunk/include/role/anti_voodoo.php (revision 1972)
+++ trunk/include/role/anti_voodoo.php (revision 1973)
@@ -24,7 +24,7 @@
2424 $wolf = $this->GetWolfVoter();
2525 if (count($stack) > 0) {
2626 foreach ($stack as $id) {
27- DB::$USER->ByID($id)->possessed_cancel = true;
27+ DB::$USER->ByID($id)->Flag()->On(UserMode::POSSESSED_CANCEL);
2828 }
2929 } elseif (RoleUser::IsPossessed($user) && ! $user->IsSame($user->GetVirtual())) {
3030 if (! RoleUser::IsPossessedTarget($user)) {
@@ -32,7 +32,7 @@
3232 }
3333 $user->Flag()->On(UserMode::POSSESSED_RESET);
3434 } elseif ($wolf->IsRole('possessed_wolf') && $wolf->IsSame($user)) {
35- $wolf->possessed_cancel = true;
35+ $wolf->Flag()->On(UserMode::POSSESSED_CANCEL);
3636 } else {
3737 return;
3838 }
--- trunk/include/role/mage.php (revision 1972)
+++ trunk/include/role/mage.php (revision 1973)
@@ -110,7 +110,9 @@
110110 //占い結果取得 (憑依キャンセル判定 → 呪殺対象判定 → 占い判定)
111111 protected function GetMageResult(User $user) {
112112 $this->MagePossessedCancel($user);
113- if ($this->IsMageKill($user)) $this->AddStack($user->id, 'mage_kill');
113+ if ($this->IsMageKill($user)) {
114+ $this->AddStack($user->id, 'mage_kill');
115+ }
114116 return $this->DistinguishMage($user);
115117 }
116118
@@ -117,7 +119,7 @@
117119 //憑依キャンセル判定
118120 final protected function MagePossessedCancel(User $user) {
119121 if (RoleUser::IsPossessedTarget($user)) {
120- $user->possessed_cancel = true;
122+ $user->Flag()->On(UserMode::POSSESSED_CANCEL);
121123 }
122124 }
123125
--- trunk/include/role/poison_cat.php (revision 1972)
+++ trunk/include/role/poison_cat.php (revision 1973)
@@ -219,7 +219,7 @@
219219 final protected function RevivePossessedCancel(User $user) {
220220 if (RoleUser::IsPossessedTarget($user)) {
221221 $user->Flag()->Off(UserMode::POSSESSED_RESET);
222- $user->possessed_cancel = true;
222+ $user->Flag()->On(UserMode::POSSESSED_CANCEL);
223223 }
224224 }
225225
--- trunk/include/role/possessed_wolf.php (revision 1972)
+++ trunk/include/role/possessed_wolf.php (revision 1973)
@@ -49,21 +49,23 @@
4949 $user = DB::$USER->ByID($id); //憑依者
5050 $target = DB::$USER->ByID($target_id); //憑依予定先
5151 $virtual = $user->GetVirtual(); //現在の憑依先
52- if (! isset($user->possessed_cancel)) $user->possessed_cancel = null;
5352
54- // 憑依成立している恋人なら、後追いが発生していないか確認する
55- if ($user->IsOff(UserMode::POSSESSED_RESET) &&
56- ! $user->possessed_cancel && $user->IsRole('lovers')) {
53+ //憑依成立している恋人なら、後追いが発生していないか確認する
54+ if ($user->IsOff(UserMode::POSSESSED_RESET) && $user->IsOff(UserMode::POSSESSED_CANCEL) &&
55+ $user->IsRole('lovers')) {
5756 if (is_null($followed_list)) {
5857 $followed_list = RoleLoader::Load('lovers')->Followed(false, true);
5958 }
6059
61- if (in_array($user->id, $followed_list)) $user->possessed_cancel = true;
60+ if (in_array($user->id, $followed_list)) {
61+ $user->Flag()->On(UserMode::POSSESSED_CANCEL);
62+ }
6263 }
6364
64- if ($user->IsDead(true)) { //憑依者死亡
65+ //憑依者死亡 > 憑依リセット > 憑依失敗 > 憑依成功
66+ if ($user->IsDead(true)) {
6567 if (isset($target->id)) $this->PossessedCancelWolfKill($target);
66- } elseif ($user->IsOn(UserMode::POSSESSED_RESET)) { //憑依リセット
68+ } elseif ($user->IsOn(UserMode::POSSESSED_RESET)) {
6769 if (isset($target->id)) $this->PossessedCancelWolfKill($target);
6870 if (! $user->IsSame($virtual)) { //憑依中なら元の体に戻される
6971 //憑依先のリセット処理
@@ -77,10 +79,10 @@
7779 DB::$ROOM->ResultDead($user->handle_name, DeadReason::REVIVE_SUCCESS);
7880 }
7981 continue;
80- } elseif ($user->possessed_cancel || $target->IsOn(UserMode::REVIVE)) { //憑依失敗
82+ } elseif ($user->IsOn(UserMode::POSSESSED_CANCEL) || $target->IsOn(UserMode::REVIVE)) {
8183 $this->PossessedCancelWolfKill($target);
8284 continue;
83- } else { //憑依成功
85+ } else {
8486 if ($user->IsRole('possessed_wolf')) {
8587 $target->Flag()->Off(UserMode::DEAD); //死亡フラグをリセット
8688 DB::$USER->Kill($target->id, DeadReason::POSSESSED_TARGETED); //憑依先の死亡処理
--- trunk/include/role/reverse_assassin.php (revision 1972)
+++ trunk/include/role/reverse_assassin.php (revision 1973)
@@ -49,11 +49,11 @@
4949 //憑依予定者が居たらキャンセル
5050 if (array_key_exists($user->id, $this->GetStack($role))) {
5151 $user->Flag()->Off(UserMode::POSSESSED_RESET);
52- $user->possessed_cancel = true;
52+ $user->Flag()->On(UserMode::POSSESSED_CANCEL);
5353 } elseif ($this->InStack($user->id, $role)) {
5454 //憑依中の犬神に憑依しようとした憑狼を検出
5555 $stack = $this->GetStackKey($role, $user->id);
56- DB::$USER->ByID($stack[0])->possessed_cancel = true;
56+ DB::$USER->ByID($stack[0])->Flag()->On(UserMode::POSSESSED_CANCEL);
5757 }
5858
5959 //特殊ケースなのでベタに処理
--- trunk/include/role/voodoo_killer.php (revision 1972)
+++ trunk/include/role/voodoo_killer.php (revision 1973)
@@ -27,9 +27,10 @@
2727 }
2828
2929 //-- 憑依妨害判定 --//
30- if (count($stack = $this->GetStackKey('possessed', $user->id)) > 0) {
30+ $stack = $this->GetStackKey('possessed', $user->id);
31+ if (count($stack) > 0) {
3132 foreach ($stack as $id) {
32- DB::$USER->ByID($id)->possessed_cancel = true;
33+ DB::$USER->ByID($id)->Flag()->On(UserMode::POSSESSED_CANCEL);
3334 }
3435 $this->AddSuccess($user->id, $this->role . '_success');
3536 }
Show on old repository browser