• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2412 (tree)
Time2019-11-04 09:00:40
Authorumethyl

Log Message

Talk:最適化

Change Summary

Incremental Difference

--- trunk/include/talk/talk_class.php (revision 2411)
+++ trunk/include/talk/talk_class.php (revision 2412)
@@ -22,7 +22,9 @@
2222 //会話取得
2323 public static function Fetch() {
2424 $builder = new TalkBuilder('talk');
25- foreach (TalkDB::Get() as $talk) $builder->Generate($talk);
25+ foreach (TalkDB::Get() as $talk) {
26+ $builder->Generate($talk);
27+ }
2628 $builder->GenerateTimeStamp();
2729 return $builder;
2830 }
@@ -34,7 +36,9 @@
3436
3537 $builder = new TalkBuilder('talk');
3638 $builder->flag->open_cast = DB::$ROOM->IsOpenCast(); //霊界公開判定
37- foreach (TalkDB::Get(true) as $talk) $builder->GenerateHeaven($talk);
39+ foreach (TalkDB::Get(true) as $talk) {
40+ $builder->GenerateHeaven($talk);
41+ }
3842 return $builder;
3943 }
4044
@@ -282,7 +286,7 @@
282286 case RoomScene::DAY:
283287 case RoomScene::NIGHT:
284288 $virtual = DB::$USER->ByVirtual($actor->id);
285- if (! $actor->IsSame($virtual)) {
289+ if (false === $actor->IsSame($virtual)) {
286290 $actor = $virtual;
287291 }
288292 break;
@@ -360,13 +364,17 @@
360364 break;
361365
362366 case RoomScene::DAY: //OP の昼限定
363- if (! DB::$ROOM->IsDate(1)) return false;
367+ if (false === DB::$ROOM->IsDate(1)) {
368+ return false;
369+ }
364370 $type = 'start_datetime'; //ゲーム開始時刻
365371 $sentence = TalkMessage::GAME_START;
366372 break;
367373
368374 case RoomScene::NIGHT:
369- if (! DB::$ROOM->IsDate(1)) return false;
375+ if (false === DB::$ROOM->IsDate(1)) {
376+ return false;
377+ }
370378 $type = 'start_datetime'; //ゲーム開始時刻
371379 $sentence = TalkMessage::GAME_START;
372380 break;
@@ -381,7 +389,9 @@
381389 }
382390
383391 $time = RoomDB::Get($type);
384- if (is_null($time)) return false;
392+ if (is_null($time)) {
393+ return false;
394+ }
385395
386396 $talk = new TalkParser();
387397 $talk->sentence = $sentence . Time::ConvertTimeStamp($time);
@@ -451,7 +461,7 @@
451461 $is_day = DB::$ROOM->IsDay();
452462 $stack = ['blinder' => $is_day, 'earplug' => $is_day, 'deep_sleep' => true];
453463 foreach ($stack as $role => $flag) {
454- if (($flag && DB::$ROOM->IsEvent($role)) || DB::$ROOM->IsOption($role)) {
464+ if ((true === $flag && DB::$ROOM->IsEvent($role)) || DB::$ROOM->IsOption($role)) {
455465 $this->actor->virtual_live = true;
456466 $this->actor->AddVirtualRole($role);
457467 }
@@ -544,15 +554,21 @@
544554 //発言透過役職判定
545555 private function IsMindReadRole(User $user, User $real) {
546556 foreach (RoleLoader::LoadUser($user, 'mind_read') as $filter) {
547- if ($filter->IsMindRead()) return true;
557+ if ($filter->IsMindRead()) {
558+ return true;
559+ }
548560 }
549561
550562 foreach (RoleLoader::LoadUser($this->actor, 'mind_read_active') as $filter) {
551- if ($filter->IsMindReadActive($user)) return true;
563+ if ($filter->IsMindReadActive($user)) {
564+ return true;
565+ }
552566 }
553567
554568 foreach (RoleLoader::LoadUser($real, 'mind_read_possessed') as $filter) {
555- if ($filter->IsMindReadPossessed($user)) return true;
569+ if ($filter->IsMindReadPossessed($user)) {
570+ return true;
571+ }
556572 }
557573
558574 return false;
Show on old repository browser