• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2413 (tree)
Time2019-11-04 09:15:12
Authorumethyl

Log Message

Role::Whisper()

Change Summary

Incremental Difference

--- trunk/include/role/blinder.php (revision 2412)
+++ trunk/include/role/blinder.php (revision 2413)
@@ -8,7 +8,7 @@
88 class Role_blinder extends Role {
99 //発言フィルタ
1010 public function FilterTalk(User $user, &$name, &$voice, &$str) {
11- if ($this->IgnoreTalk() || ! DB::$ROOM->IsDay() || $this->GetViewer()->IsSame($user)) {
11+ if ($this->IgnoreTalk() || false === DB::$ROOM->IsDay() || $this->GetViewer()->IsSame($user)) {
1212 return;
1313 }
1414 $name = '';
--- trunk/include/role/earplug.php (revision 2412)
+++ trunk/include/role/earplug.php (revision 2413)
@@ -13,15 +13,19 @@
1313 public $mix_in = ['blinder'];
1414
1515 public function FilterTalk(User $user, &$name, &$voice, &$str) {
16- if (! $this->IgnoreTalk()) $this->ShiftVoice($voice, $str, false);
16+ if (false === $this->IgnoreTalk()) {
17+ $this->ShiftVoice($voice, $str, false);
18+ }
1719 }
1820
1921 public function AddIgnoreTalk() {
20- return ! DB::$ROOM->IsPlaying() ||
22+ return false === DB::$ROOM->IsPlaying() ||
2123 (DB::$ROOM->IsOn(RoomMode::LOG) && DB::$ROOM->IsEvent($this->role) && ! DB::$ROOM->IsDay());
2224 }
2325
2426 public function FilterWhisper(&$voice, &$str) {
25- if (! $this->IgnoreTalk()) $this->ShiftVoice($voice, $str, false);
27+ if (false === $this->IgnoreTalk()) {
28+ $this->ShiftVoice($voice, $str, false);
29+ }
2630 }
2731 }
--- trunk/include/role/speaker.php (revision 2412)
+++ trunk/include/role/speaker.php (revision 2413)
@@ -13,14 +13,18 @@
1313 public $mix_in = ['blinder'];
1414
1515 public function FilterTalk(User $user, &$name, &$voice, &$str) {
16- if (! $this->IgnoreTalk()) $this->ShiftVoice($voice, $str);
16+ if (false === $this->IgnoreTalk()) {
17+ $this->ShiftVoice($voice, $str);
18+ }
1719 }
1820
1921 public function AddIgnoreTalk() {
20- return ! DB::$ROOM->IsPlaying();
22+ return false === DB::$ROOM->IsPlaying();
2123 }
2224
2325 public function FilterWhisper(&$voice, &$str) {
24- if (! $this->IgnoreTalk()) $this->ShiftVoice($voice, $str);
26+ if (false === $this->IgnoreTalk()) {
27+ $this->ShiftVoice($voice, $str);
28+ }
2529 }
2630 }
--- trunk/include/role/strong_voice.php (revision 2412)
+++ trunk/include/role/strong_voice.php (revision 2413)
@@ -14,8 +14,12 @@
1414
1515 //声量シフト
1616 protected function ShiftVoice(&$voice, &$str, $up = true) {
17- if (($key = array_search($voice, $this->voice_list)) === false) return;
18- if ($up) {
17+ $key = array_search($voice, $this->voice_list);
18+ if (false === $key) {
19+ return;
20+ }
21+
22+ if (true === $up) {
1923 if (++$key >= count($this->voice_list)) {
2024 $str = RoleTalkMessage::HOWLING;
2125 return;
--- trunk/include/talk/talk_class.php (revision 2412)
+++ trunk/include/talk/talk_class.php (revision 2413)
@@ -688,7 +688,9 @@
688688 }
689689
690690 foreach (RoleLoader::LoadType('talk_whisper') as $filter) {
691- if ($filter->Whisper($this, $talk)) return true;
691+ if ($filter->Whisper($this, $talk)) {
692+ return true;
693+ }
692694 }
693695 return false;
694696
@@ -701,33 +703,45 @@
701703 }
702704
703705 foreach (RoleLoader::LoadType('talk_whisper') as $filter) {
704- if ($filter->Whisper($this, $talk)) return true;
706+ if ($filter->Whisper($this, $talk)) {
707+ return true;
708+ }
705709 }
706710 return false;
707711
708712 case TalkLocation::MAD: //囁き狂人
709713 foreach (RoleLoader::LoadUser($actor, 'talk_whisper') as $filter) {
710- if ($filter->Whisper($this, $talk)) return true;
714+ if ($filter->Whisper($this, $talk)) {
715+ return true;
716+ }
711717 }
712718 return false;
713719
714720 case TalkLocation::FOX: //妖狐
715721 foreach (RoleLoader::LoadUser(DB::$SELF, 'talk_fox') as $filter) {
716- if ($filter->Whisper($this, $talk)) return true;
722+ if ($filter->Whisper($this, $talk)) {
723+ return true;
724+ }
717725 }
718726
719727 foreach (RoleLoader::LoadUser($actor, 'talk_whisper') as $filter) {
720- if ($filter->Whisper($this, $talk)) return true;
728+ if ($filter->Whisper($this, $talk)) {
729+ return true;
730+ }
721731 }
722732 return false;
723733
724734 case TalkLocation::MONOLOGUE: //独り言
725735 foreach (RoleLoader::LoadUser($actor, 'talk_self') as $filter) {
726- if ($filter->Whisper($this, $talk)) return true;
736+ if ($filter->Whisper($this, $talk)) {
737+ return true;
738+ }
727739 }
728740
729741 foreach (RoleLoader::LoadUser($this->actor, 'talk_ringing') as $filter) {
730- if ($filter->Whisper($this, $talk)) return true;
742+ if ($filter->Whisper($this, $talk)) {
743+ return true;
744+ }
731745 }
732746 return false;
733747 }
Show on old repository browser