Project1

标题: 为什么是OFF不是ON [打印本页]

作者: Green-Grox    时间: 2015-1-19 22:30
标题: 为什么是OFF不是ON
  1. class From_moment
  2.   def at_the_moment
  3.     m_abcdef = $moment.values
  4.     m_a = m_abcdef[0]
  5.     m_b = m_abcdef[1]
  6.     m_c = m_abcdef[2]
  7.     m_d = m_abcdef[3]
  8.     m_e = m_abcdef[4]
  9.     m_a2 = 1 if m_a == 1
  10.     m_b2 = 2 if m_b == 2
  11.     m_c2 = 3 if m_c == 3
  12.     m_d2 = 4 if m_d == 4
  13.     moment_2 = [0,0,0,0]
  14.     moment_2[0] = 1 if m_a2 == 1
  15.     moment_2[1] = 2 if m_b2 == 2
  16.     moment_2[2] = 3 if m_c2 == 3
  17.     moment_2[3] = 4 if m_d2 == 4
  18.     m_a3 = moment_2.include?(1)
  19.     m_b3 = moment_2.include?(2)
  20.     m_c3 = moment_2.include?(3)
  21.     m_d3 = moment_2.include?(4)
  22.     moment_3 = 0
  23.     moment_3 += 1 if m_a3 == true
  24.     moment_3 += 1 if m_b3 == true
  25.     moment_3 += 1 if m_c3 == true
  26.     if m_e == true
  27.       moment_3 += 1 if m_d3 == true
  28.     elsif m_e == false
  29.       moment_3 += 1
  30.     end
  31.     $game_switches[40] = true if moment_3 == 4
  32.     $game_switches[40] = false if moment_3 != 4
  33.   end
  34. end
复制代码
然后在事件的脚本中,输入这个使用:
$moment =
{""=>1,""=>2,""=>3,""=>4,""=>true}
aaa_a = From_moment.new
aaa_a.at_the_moment
按我的思路第40个开关应该是ON啊……怎么是OFF
作者: 喵呜喵5    时间: 2015-1-19 22:45
$moment = [1,2,3,4,true]




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1