• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Révision2777 (tree)
l'heure2021-08-16 19:01:33
Auteurumethyl

Message de Log

OptionManager::IsSealMessage()

Change Summary

Modification

--- trunk/include/game_vote_functions.php (revision 2776)
+++ trunk/include/game_vote_functions.php (revision 2777)
@@ -1461,10 +1461,6 @@
14611461
14621462 //陰陽師・厄神の成功結果登録
14631463 private static function SaveSuccess() {
1464- if (DB::$ROOM->IsOption('seal_message')) {
1465- return;
1466- }
1467-
14681464 $stack = [
14691465 'voodoo_killer' => RoleVoteSuccess::VOODOO_KILLER,
14701466 'anti_voodoo' => RoleVoteSuccess::ANTI_VOODOO
--- trunk/include/html/role/role_html_class.php (revision 2776)
+++ trunk/include/html/role/role_html_class.php (revision 2777)
@@ -105,6 +105,13 @@
105105
106106 //能力発動結果表示
107107 public static function OutputResult($action) {
108+ if (OptionManager::IsSealMessage($action)) {
109+ if (DB::$ROOM->IsTest()) {
110+ //Text::p($action, '◆Seal Message');
111+ }
112+ return;
113+ }
114+
108115 $header = null;
109116 $footer = 'result_';
110117 $limit = false;
--- trunk/include/option/option_class.php (revision 2776)
+++ trunk/include/option/option_class.php (revision 2777)
@@ -173,13 +173,23 @@
173173 return RoomScene::NIGHT;
174174 }
175175
176- //-- wish_role --//
176+ //-- 個別オプション判定 --//
177177 //希望役職リスト取得
178178 public static function GetWishRoleList() {
179179 return OptionLoader::Load('wish_role')->GetWishRole();
180180 }
181181
182- //-- private --//
182+ //天啓封印対象判定
183+ public static function IsSealMessage($type) {
184+ $option = 'seal_message';
185+ if (self::CanLoad($option)) {
186+ return OptionLoader::Load($option)->IsSealMessage($type);
187+ } else {
188+ return false;
189+ }
190+ }
191+
192+ //-- 共通処理 --//
183193 //オプションロード可能判定
184194 private static function CanLoad($option) {
185195 return DB::$ROOM->IsOption($option) && OptionLoader::LoadFile($option);
--- trunk/include/option/seal_message.php (revision 2776)
+++ trunk/include/option/seal_message.php (revision 2777)
@@ -1,6 +1,8 @@
11 <?php
22 /*
33 ◆天啓封印 (seal_message)
4+ ○仕様
5+ ・システムメッセージ:出力・閲覧封印
46 */
57 class Option_seal_message extends OptionCheckbox {
68 public $group = OptionGroup::GAME;
@@ -12,4 +14,32 @@
1214 public function GetExplain() {
1315 return '一部の個人通知メッセージが表示されなくなります';
1416 }
17+
18+ //天啓封印対象判定
19+ /*
20+ ・解呪成功 (陰陽師)
21+ ・護衛成功 (夢守人・護衛能力者)
22+ ・狩り成功 (狩り能力者)
23+ ・護衛貫通付加 (一寸法師)
24+ ・厄払い成功 (厄神)
25+ ・妖狐襲撃 (人狼)
26+ ・襲撃回避 (鋭狼)
27+ ・蘇生結果 (蘇生能力者)
28+ */
29+ public function IsSealMessage($type) {
30+ switch ($type) {
31+ case RoleAbility::VOODOO_KILLER:
32+ case RoleAbility::GUARD:
33+ case RoleAbility::HUNTED:
34+ case RoleAbility::PENETRATION:
35+ case RoleAbility::ANTI_VOODOO:
36+ case RoleAbility::FOX:
37+ case RoleAbility::SHARP_WOLF:
38+ case RoleAbility::REVIVE:
39+ return true;
40+
41+ default:
42+ return false;
43+ }
44+ }
1545 }
--- trunk/include/role/anti_voodoo.php (revision 2776)
+++ trunk/include/role/anti_voodoo.php (revision 2777)
@@ -13,7 +13,7 @@
1313 }
1414
1515 protected function IgnoreResult() {
16- return DB::$ROOM->date < 3 || DB::$ROOM->IsOption('seal_message');
16+ return DB::$ROOM->date < 3;
1717 }
1818
1919 public function OutputAction() {
@@ -44,12 +44,12 @@
4444
4545 //厄払い成立判定
4646 public function IsGuard($id) {
47- if (! $this->InStack($id)) {
47+ if ($this->InStack($id)) {
48+ $this->AddSuccess($id, RoleVoteSuccess::ANTI_VOODOO);
49+ return true;
50+ } else {
4851 return false;
4952 }
50-
51- $this->AddSuccess($id, RoleVoteSuccess::ANTI_VOODOO);
52- return true;
5353 }
5454
5555 //成功結果登録
--- trunk/include/role/dream_eater_mad.php (revision 2776)
+++ trunk/include/role/dream_eater_mad.php (revision 2777)
@@ -19,9 +19,7 @@
1919 $actor = $this->GetActor();
2020 if ($user->IsLiveRole('dummy_guard', true)) { //対象が夢守人なら返り討ちに合う
2121 DB::$USER->Kill($actor->id, DeadReason::HUNTED);
22- if (false === DB::$ROOM->IsOption('seal_message')) { //狩りメッセージを登録
23- DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $actor->handle_name, $user->id);
24- }
22+ DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $actor->handle_name, $user->id);
2523 return;
2624 }
2725
--- trunk/include/role/dummy_guard.php (revision 2776)
+++ trunk/include/role/dummy_guard.php (revision 2777)
@@ -2,7 +2,7 @@
22 /*
33 ◆夢守人 (dummy_guard)
44 ○仕様
5- ・狩り:獏・妖精系
5+ ・狩り:獏・妖精系 (天啓封印あり)
66 */
77 RoleLoader::LoadFile('guard');
88 class Role_dummy_guard extends Role_guard {
@@ -26,9 +26,8 @@
2626 }
2727
2828 $flag = true;
29- if (false === DB::$ROOM->IsOption('seal_message')) { //狩りメッセージを登録
30- DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $user->handle_name, $actor->id);
31- }
29+ //狩りメッセージを登録
30+ DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $user->handle_name, $actor->id);
3231 }
3332
3433 if (true === $flag) {
@@ -52,9 +51,8 @@
5251 $list[$user->id] = $target;
5352 }
5453
55- if (false === DB::$ROOM->IsOption('seal_message')) { //常時護衛成功メッセージだけが出る
56- DB::$ROOM->StoreAbility(RoleAbility::GUARD, 'success', $target->GetName(), $user->id);
57- }
54+ //常時護衛成功メッセージだけが出る
55+ DB::$ROOM->StoreAbility(RoleAbility::GUARD, 'success', $target->GetName(), $user->id);
5856 }
5957 }
6058
@@ -63,9 +61,7 @@
6361 foreach ($list as $id => $target) {
6462 DB::$USER->Kill($target->id, DeadReason::HUNTED);
6563 //憑依能力者は対象外なので仮想ユーザを引く必要なし
66- if (false === DB::$ROOM->IsOption('seal_message')) { //狩りメッセージを登録
67- DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $target->handle_name, $id);
68- }
64+ DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $target->handle_name, $id);
6965 }
7066 }
7167
--- trunk/include/role/fox.php (revision 2776)
+++ trunk/include/role/fox.php (revision 2777)
@@ -41,8 +41,7 @@
4141 }
4242
4343 protected function IgnoreResult() {
44- return false === $this->ResistWolfEatFox() || DB::$ROOM->date < 2 ||
45- DB::$ROOM->IsOption('seal_message');
44+ return DB::$ROOM->date < 2 || false === $this->ResistWolfEatFox();
4645 }
4746
4847 //妖狐人狼襲撃耐性判定
--- trunk/include/role/gatekeeper_guard.php (revision 2776)
+++ trunk/include/role/gatekeeper_guard.php (revision 2777)
@@ -34,9 +34,6 @@
3434 }
3535
3636 //護衛成功メッセージを登録
37- if (DB::$ROOM->IsOption('seal_message')) {
38- return true;
39- }
4037 $handle_name = DB::$USER->ByVirtual($id)->handle_name;
4138 foreach ($guard_stack as $user) {
4239 if (RoleUser::GuardSuccess($user, $id)) {
--- trunk/include/role/guard.php (revision 2776)
+++ trunk/include/role/guard.php (revision 2777)
@@ -18,7 +18,7 @@
1818 }
1919
2020 protected function IgnoreResult() {
21- return DB::$ROOM->date < 3 || DB::$ROOM->IsOption('seal_message');
21+ return DB::$ROOM->date < 3;
2222 }
2323
2424 protected function OutputAddResult() {
@@ -104,10 +104,6 @@
104104 }
105105
106106 $this->AddSuccess($actor->id, RoleVoteSuccess::GUARD); //成功者を登録
107- if (DB::$ROOM->IsOption('seal_message')) {
108- continue;
109- }
110-
111107 if (RoleUser::GuardSuccess($actor, $user->id)) {
112108 DB::$ROOM->StoreAbility($this->result, 'success', $user->GetName(), $actor->id);
113109 }
@@ -191,9 +187,7 @@
191187 //狩り処理
192188 protected function HuntKill(User $user) {
193189 DB::$USER->Kill($user->id, DeadReason::HUNTED);
194- if (false === DB::$ROOM->IsOption('seal_message')) { //狩りメッセージを登録
195- DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $user->GetName(), $this->GetID());
196- }
190+ DB::$ROOM->StoreAbility(RoleAbility::HUNTED, 'hunted', $user->GetName(), $this->GetID());
197191 }
198192
199193 //護衛制限判定 (司祭系 > 暗殺者系・人形遣い系 > 上位能力者・身代わり能力者)
--- trunk/include/role/poison_cat.php (revision 2776)
+++ trunk/include/role/poison_cat.php (revision 2777)
@@ -27,7 +27,7 @@
2727 }
2828
2929 protected function IgnoreResult() {
30- return DB::$ROOM->date < 3 || DB::$ROOM->IsOpenCast() || DB::$ROOM->IsOption('seal_message');
30+ return DB::$ROOM->date < 3 || DB::$ROOM->IsOpenCast();
3131 }
3232
3333 //蘇生結果表示 (Mixin 用)
@@ -84,10 +84,6 @@
8484 DB::$ROOM->StoreDead(DB::$USER->GetHandleName($target->uname), DeadReason::REVIVE_FAILED);
8585 }
8686
87- if (DB::$ROOM->IsOption('seal_message')) { //蘇生結果を登録 (天啓封印ならスキップ)
88- return;
89- }
90-
9187 //蘇生結果は憑依を追跡しない
9288 DB::$ROOM->StoreAbility(RoleAbility::REVIVE, $result, $target->handle_name, $this->GetID());
9389 }
--- trunk/include/role/revive_fox.php (revision 2776)
+++ trunk/include/role/revive_fox.php (revision 2777)
@@ -15,7 +15,7 @@
1515 }
1616
1717 protected function OutputAddResult() {
18- if (DB::$ROOM->date < 3 || DB::$ROOM->IsOption('seal_message')) {
18+ if (DB::$ROOM->date < 3) {
1919 return;
2020 }
2121 RoleHTML::OutputResult(RoleAbility::REVIVE);
--- trunk/include/role/sharp_wolf.php (revision 2776)
+++ trunk/include/role/sharp_wolf.php (revision 2777)
@@ -10,7 +10,7 @@
1010 public $result = RoleAbility::SHARP_WOLF;
1111
1212 protected function IgnoreResult() {
13- return DB::$ROOM->date < 2 || DB::$ROOM->IsOption('seal_message');
13+ return DB::$ROOM->date < 2;
1414 }
1515
1616 public function WolfEatAction(User $user) {
@@ -18,10 +18,8 @@
1818 return false;
1919 }
2020
21- if (false === DB::$ROOM->IsOption('seal_message')) {
22- $id = $this->GetWolfVoter()->id;
23- DB::$ROOM->StoreAbility($this->result, 'wolf_avoid', $user->GetName(), $id);
24- }
21+ $id = $this->GetWolfVoter()->id;
22+ DB::$ROOM->StoreAbility($this->result, 'wolf_avoid', $user->GetName(), $id);
2523 return true;
2624 }
2725 }
--- trunk/include/role/voodoo_killer.php (revision 2776)
+++ trunk/include/role/voodoo_killer.php (revision 2777)
@@ -10,7 +10,7 @@
1010 public $result = RoleAbility::VOODOO_KILLER;
1111
1212 protected function IgnoreResult() {
13- return DB::$ROOM->date < 2 || DB::$ROOM->IsOption('seal_message');
13+ return DB::$ROOM->date < 2;
1414 }
1515
1616 public function OutputAction() {
--- trunk/include/role/wanderer_guard.php (revision 2776)
+++ trunk/include/role/wanderer_guard.php (revision 2777)
@@ -2,7 +2,7 @@
22 /*
33 ◆一寸法師 (wanderer_guard)
44 ○仕様
5- ・能力結果:護衛貫通追加
5+ ・能力結果:護衛貫通付加 (天啓封印あり)
66 ・人狼襲撃失敗カウンター:護衛貫通
77 */
88 RoleLoader::LoadFile('guard');
@@ -22,9 +22,7 @@
2222
2323 $target = DB::$USER->ByID($vote_data[$this->action][$user->id]);
2424 $target->AddRole('penetration');
25- if (false === DB::$ROOM->IsOption('seal_message')) {
26- DB::$ROOM->StoreAbility($result, 'penetration', $target->GetName(), $user->GetID());
27- }
25+ DB::$ROOM->StoreAbility($result, 'penetration', $target->GetName(), $user->GetID());
2826 }
2927 }
3028 }
--- trunk/include/role/wolf.php (revision 2776)
+++ trunk/include/role/wolf.php (revision 2777)
@@ -6,7 +6,7 @@
66 ・仲間表示:人狼枠(憑依追跡)・囁き狂人・無意識枠
77 ・仲間襲撃:不可
88 ・護衛カウンター:なし
9- ・襲撃失敗判定:人狼系・妖狐
9+ ・襲撃失敗判定:人狼系・妖狐 (天啓封印あり)
1010 ・襲撃失敗:なし
1111 ・妖狐襲撃:なし
1212 ・人狼襲撃死因:人狼襲撃
@@ -273,12 +273,11 @@
273273 return false;
274274 }
275275
276- //人狼襲撃無効判定
276+ //人狼襲撃無効判定 (スキップ判定 > 人狼襲撃 > 妖狐襲撃 > 襲撃成功)
277277 final public function DisableWolfEat(User $user) {
278- //スキップ判定 > 人狼襲撃 > 妖狐襲撃
279278 if ($this->IgnoreDisableWolfEat()) {
280279 return false;
281- } elseif ($user->IsMainGroup(CampGroup::WOLF)) { //人狼系判定 (例:銀狼出現)
280+ } elseif ($user->IsMainGroup(CampGroup::WOLF)) { //人狼系判定 (例:銀狼襲撃)
282281 $this->WolfEatWolfAction($user);
283282 $user->wolf_eat = true; //襲撃は成功扱い
284283 return $this->WolfEatFailed('WOLF', true);
@@ -290,10 +289,8 @@
290289 $this->WolfEatFoxAction($user); //妖狐襲撃処理
291290 $filter->WolfEatFoxCounter($this->GetWolfVoter()); //妖狐襲撃カウンター処理
292291
293- //人狼襲撃メッセージを登録
294- if (false === DB::$ROOM->IsOption('seal_message')) {
295- DB::$ROOM->StoreAbility(RoleAbility::FOX, 'targeted', null, $user->id);
296- }
292+ //人狼襲撃メッセージを登録 (天啓封印あり)
293+ DB::$ROOM->StoreAbility(RoleAbility::FOX, 'targeted', null, $user->id);
297294 $user->wolf_eat = true; //襲撃は成功扱い
298295 return $this->WolfEatFailed('FOX', true);
299296 } else {
--- trunk/include/room_class.php (revision 2776)
+++ trunk/include/room_class.php (revision 2777)
@@ -484,6 +484,13 @@
484484
485485 //能力発動結果登録
486486 public function StoreAbility($type, $result, $target = null, $user_no = null) {
487+ if (OptionManager::IsSealMessage($type)) {
488+ if ($this->IsTest()) {
489+ Text::p("{$type}: {$result}: {$target}: {$user_no}", '★SealMessage');
490+ }
491+ return true;
492+ }
493+
487494 $date = $this->date;
488495 if ($this->IsTest()) {
489496 Text::p("{$type}: {$result}: {$target}: {$user_no}", '★ResultAbility');
Afficher sur ancien navigateur de dépôt.