• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Révision2773 (tree)
l'heure2021-08-16 05:35:30
Auteurumethyl

Message de Log

Number::Odd()

Change Summary

Modification

--- trunk/include/functions.php (revision 2772)
+++ trunk/include/functions.php (revision 2773)
@@ -328,6 +328,11 @@
328328 public static function Even($number, $limit = null) {
329329 return self::Multiple($number, 2, 0, $limit);
330330 }
331+
332+ //奇数
333+ public static function Odd($number, $limit = null) {
334+ return self::Multiple($number, 2, 1, $limit);
335+ }
331336 }
332337
333338 //-- Switch (bool) 関連 --//
--- trunk/include/role/bishop_priest.php (revision 2772)
+++ trunk/include/role/bishop_priest.php (revision 2773)
@@ -11,7 +11,7 @@
1111 }
1212
1313 protected function IgnoreSetPriest() {
14- return DB::$ROOM->date < 1 || DB::$ROOM->date % 2 == 1;
14+ return Number::Odd(DB::$ROOM->date, 1);
1515 }
1616
1717 protected function GetPriestType() {
--- trunk/include/role/high_priest.php (revision 2772)
+++ trunk/include/role/high_priest.php (revision 2773)
@@ -19,7 +19,7 @@
1919 }
2020
2121 protected function GetPriestType() {
22- return DB::$ROOM->date % 2 == 1 ? 'human_side' : 'dead';
22+ return Number::Odd(DB::$ROOM->date) ? 'human_side' : 'dead';
2323 }
2424
2525 protected function IgnorePriest() {
@@ -27,6 +27,6 @@
2727 }
2828
2929 protected function GetPriestRole() {
30- return DB::$ROOM->date % 2 == 1 ? 'priest' : 'bishop_priest';
30+ return Number::Odd(DB::$ROOM->date) ? 'priest' : 'bishop_priest';
3131 }
3232 }
--- trunk/include/role/priest.php (revision 2772)
+++ trunk/include/role/priest.php (revision 2773)
@@ -6,7 +6,7 @@
66 */
77 class Role_priest extends Role {
88 protected function IgnoreResult() {
9- return DB::$ROOM->date < 3 || DB::$ROOM->date % 2 == 1;
9+ return Number::Odd(DB::$ROOM->date, 3);
1010 }
1111
1212 protected function OutputAddResult() {
--- trunk/include/role/priest_jealousy.php (revision 2772)
+++ trunk/include/role/priest_jealousy.php (revision 2773)
@@ -3,7 +3,7 @@
33 ◆恋司祭 (priest_jealousy)
44 ○仕様
55 ・役職表示:司祭
6- ・司祭:恋人
6+ ・司祭:恋人 (偶数日 / 4日目以降)
77 */
88 class Role_priest_jealousy extends Role {
99 public $mix_in = ['priest'];
@@ -10,7 +10,7 @@
1010 public $display_role = 'priest';
1111
1212 protected function IgnoreResult() {
13- return DB::$ROOM->date < 3 || DB::$ROOM->date % 2 == 1;
13+ return Number::Odd(DB::$ROOM->date, 3);
1414 }
1515
1616 protected function OutputAddResult() {
--- trunk/include/role/priest_tengu.php (revision 2772)
+++ trunk/include/role/priest_tengu.php (revision 2773)
@@ -9,7 +9,7 @@
99 public $mix_in = ['mage', 'chicken', 'priest'];
1010
1111 protected function IgnoreResult() {
12- return DB::$ROOM->date < 2 || DB::$ROOM->date % 2 == 1;
12+ return Number::Odd(DB::$ROOM->date, 3);
1313 }
1414
1515 protected function OutputAddResult() {
Afficher sur ancien navigateur de dépôt.