设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1434|回复: 4
打印 上一主题 下一主题

[已经过期] RM XP标题菜单脚本怎么弄

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
44 小时
注册时间
2014-12-23
帖子
31
跳转到指定楼层
1
发表于 2015-1-20 17:12:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x


改好看点咋写

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2015-1-20 17:31:44 | 只看该作者
  1. puts "好看点"
复制代码
算了我还是认真回答吧:https://rpg.blue/search.php?mod= ... 5%E8%84%9A%E6%9C%AC

点评

版主RM的QQ群是什么。  发表于 2015-1-20 18:09
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
44 小时
注册时间
2014-12-23
帖子
31
3
 楼主| 发表于 2015-1-22 10:20:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
求RM XP标题菜单脚本,默认的标题菜单太难看,只要好看一些就行。

不要告诉我搜索之类的回答,我要是能搜到答案就不用在这里问了。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
206 小时
注册时间
2014-2-8
帖子
396
4
发表于 2015-1-22 20:19:34 | 只看该作者
大概效果是什么。。。
刚接触RPG的新人们裤艾来这里!在这里能够帮助你们提高自身的能力,让大家来帮助每个人实现自己的创意、构想!
也许你只是正在看RPG教程的新人,或者是正在努力学着制作自己的RPG的制作者,或者是狂热的RPG游戏喜爱者,
但都不重要!
加入我们,我们会帮助你实现梦想,或者帮助你更好的运用RPG并且创造个人的一片天地!周末我们会不定时间开放RM技术讨论活动或者RM经验交流课!
加入我们,我们愿意与你共同创造奇迹,共同进步!
QQ群号:329443038  
或者联系QQ:573932914
我们和你站在同一线!
要求只有:常能上线
我们会用十分的热情接纳你!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
211
在线时间
845 小时
注册时间
2014-5-5
帖子
944
5
发表于 2015-1-23 12:41:58 | 只看该作者

这样的可以吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
44 小时
注册时间
2014-12-23
帖子
31
6
 楼主| 发表于 2015-1-26 17:47:01 | 只看该作者
邪月长啸 发表于 2015-1-23 12:41
这样的可以吗?

可以,求脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
211
在线时间
845 小时
注册时间
2014-5-5
帖子
944
7
发表于 2015-1-26 19:31:03 | 只看该作者
  1. #=========================================================
  2. # This is the ffx-2 Custom Menu System by Catchm.
  3. # It is a long script and includes many alterations and images attached to it.
  4. # These images can be edited, and the script can be edited, you are free to do so
  5. # credit to Catchm is the only thing needed.
  6. # this is to be copied into a new script in the script editor
  7. #
  8. # Have fun with the script!
  9. #=========================================================

  10. class Bitmap
  11. def draw_text_shadow_rect(rect, text, align = 0)
  12.   self.font.size -= 2
  13.   old_col = self.font.color.clone
  14.   # Dark shadow
  15.   self.font.color = Color.new(0,0,0, 255)
  16.   draw_text(Rect.new(rect.x+1, rect.y+1, rect.width,
  17.     rect.height), text, align)
  18.   # Small outline
  19.   self.font.color = Color.new(96,96,96,96)
  20.   draw_text(Rect.new(rect.x+1, rect.y, rect.width,
  21.     rect.height), text, align)
  22.   draw_text(Rect.new(rect.x-1, rect.y, rect.width,
  23.     rect.height), text, align)
  24.   draw_text(Rect.new(rect.x, rect.y-1, rect.width,
  25.     rect.height), text, align)
  26.   draw_text(Rect.new(rect.x, rect.y+1, rect.width,
  27.     rect.height), text, align)
  28.   # Normal text
  29.   self.font.color = old_col
  30.   draw_text(rect, text, align)
  31.   self.font.size += 2
  32. end
  33. def draw_text_shadow(x, y, wid, hei, text, align = 0)
  34.   self.font.size -= 2
  35.   old_col = self.font.color.clone
  36.   # Dark shadow
  37.   self.font.color = Color.new(0,0,0, 255)
  38.   draw_text(x+1,y+1,wid,hei,text, align)
  39.   # Small outline
  40.   self.font.color = Color.new(96,96,96,96)
  41.   draw_text(x+1,y,wid,hei,text, align)
  42.   draw_text(x+2,y,wid,hei,text, align)
  43.   draw_text(x+2,y,wid,hei,text, align)
  44.   draw_text(x,y-1,wid,hei,text, align)
  45.   draw_text(x,y+1,wid,hei,text, align)
  46.   draw_text(x,y+2,wid,hei,text, align)
  47.   # Normal
  48.   self.font.color = old_col
  49.   draw_text(x,y,wid,hei,text, align)
  50.   self.font.size += 2
  51. end
  52. def draw_text_outline(x, y, wid, hei, text, align = 0)
  53.   self.font.color = Color.new(0, 0, 0, 255)
  54.     draw_text(x + 1,y + 1,wid,hei,text, align)
  55.     draw_text(x + 1,y - 1,wid,hei,text, align)
  56.     draw_text(x - 1,y - 1,wid,hei,text, align)
  57.     draw_text(x - 1,y + 1,wid,hei,text, align)
  58.    self.font.color = Color.new(255, 255, 255, 255)
  59.     draw_text(x,y,wid,hei,text, align)
  60.   end
  61. def draw_text_outline2(x, y, wid, hei, text, align = 0)
  62.   self.font.color = Color.new(0, 0, 0, 255)
  63.     draw_text(x + 1,y + 1,wid,hei,text, align)
  64.     draw_text(x + 1,y - 1,wid,hei,text, align)
  65.     draw_text(x - 1,y - 1,wid,hei,text, align)
  66.     draw_text(x - 1,y + 1,wid,hei,text, align)
  67.    self.font.color = Color.new(255, 255, 255, 200)
  68.     draw_text(x,y,wid,hei,text, align)
  69.   end
  70.   def draw_text_outline3(x, y, wid, hei, text, align = 0)
  71.   self.font.color = Color.new(0, 0, 0, 255)
  72.     draw_text(x + 1,y + 1,wid,hei,text, align)
  73.     draw_text(x + 1,y - 1,wid,hei,text, align)
  74.     draw_text(x - 1,y - 1,wid,hei,text, align)
  75.     draw_text(x - 1,y + 1,wid,hei,text, align)
  76.    self.font.color = Color.new(192, 224, 255, 255)
  77.     draw_text(x,y,wid,hei,text, align)
  78.   end
  79.   def draw_text_outline4(x, y, wid, hei, text, align = 0)
  80.   self.font.color = Color.new(0, 0, 0, 190)
  81.     draw_text(x + 1,y + 1,wid,hei,text, align)
  82.     draw_text(x + 1,y - 1,wid,hei,text, align)
  83.     draw_text(x - 1,y - 1,wid,hei,text, align)
  84.     draw_text(x - 1,y + 1,wid,hei,text, align)
  85.    self.font.color = Color.new(255, 255, 255, 255)
  86.     draw_text(x,y,wid,hei,text, align)
  87.   end
  88. end
  89. class Window_Base < Window
  90.   #=====================================
  91.   # Gradient Bars , thanks to Acedent Prone
  92.   def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
  93.    if type == "horizontal"
  94.      width = length
  95.      height = thick
  96.      self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
  97.      self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
  98.      w = width * e1 / e2
  99.      for i in 0..height
  100.      r = c1.red + (c2.red - c1.red)   * (height -i)/height  + 0   * i/height
  101.      g = c1.green + (c2.green - c1.green) * (height -i)/height  + 0 * i/height
  102.      b = c1.blue + (c2.blue - c1.blue)  * (height -i)/height  + 0 * i/height
  103.      a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height  + 255 * i/height
  104.      self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
  105.    end
  106. elsif type == "vertical"
  107.    width = thick
  108.    height = length
  109.      self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
  110.      self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
  111.    h = height * e1 / e2
  112.    for i in 0..width
  113.      r = c1.red + (c2.red - c1.red)   * (width -i)/width  + 0   * i/width
  114.      g = c1.green + (c2.green - c1.green) * (width -i)/width  + 0 * i/width
  115.      b = c1.blue + (c2.blue - c1.blue)  * (width -i)/width  + 0 * i/width
  116.      a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width  + 255 * i/width
  117.      self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
  118.    end
  119. end
  120. end
  121. def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
  122.    if type == "horizontal"
  123.      width = length
  124.      height = thick
  125.      self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(0, 0, 0, 255))
  126.      self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
  127.      w = width * e1 / e2
  128.      for i in 0..height
  129.      r = c1.red + (c2.red - c1.red)   * (height -i)/height  + 0   * i/height
  130.      g = c1.green + (c2.green - c1.green) * (height -i)/height  + 0 * i/height
  131.      b = c1.blue + (c2.blue - c1.blue)  * (height -i)/height  + 0 * i/height
  132.      a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height  + 255 * i/height
  133.      self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
  134.    end
  135. elsif type == "vertical"
  136.    width = thick
  137.    height = length
  138.      self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
  139.      self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
  140.    h = height * e1 / e2
  141.    for i in 0..width
  142.      r = c1.red + (c2.red - c1.red)   * (width -i)/width  + 0   * i/width
  143.      g = c1.green + (c2.green - c1.green) * (width -i)/width  + 0 * i/width
  144.      b = c1.blue + (c2.blue - c1.blue)  * (width -i)/width  + 0 * i/width
  145.      a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width  + 255 * i/width
  146.      self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
  147.    end
  148. end
  149. end
  150.   #=====================================
  151.   # New definitions状态栏里的战斗图位置
  152.   def draw_battlegraphic(actor, x, y)
  153.   bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  154.   cw = bitmap.width
  155.   ch = bitmap.height
  156.   src_rect = Rect.new(0, 0, cw, ch)
  157.   self.contents.blt(x - cw / 2, y - ch+50, bitmap, src_rect)#战斗图位置
  158. end
  159. #======================================
  160.     def draw_actor_statuswindow(actor, x, y)
  161.      bitmap = RPG::Cache.picture(actor.character_name, actor.character_hue)
  162.     cw = bitmap.width / 4
  163.     ch = bitmap.height / 4
  164.     src_rect = Rect.new(0, 0, cw, ch)
  165.     self.contents.blt(x - cw / 2, y - ch , bitmap, src_rect)
  166.   end
  167.   #=====================================
  168.   def draw_actor_face(actor, x, y)
  169.   face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
  170.   fw = face.width
  171.   fh = face.height
  172.   src_rect = Rect.new(0, 0, fw, fh)
  173.   self.contents.blt(x - fw / 23, y - fh, face, src_rect)
  174. end
  175.   #=====================================
  176.   def draw_actor_name2(actor, x, y)
  177.     self.contents.font.name = $fontface
  178.     self.contents.font.color = outline_color
  179.     self.contents.draw_text(x - 1, y - 1, 120, 32, actor.name)
  180.     self.contents.draw_text(x + 1, y - 1, 120, 32, actor.name)
  181.     self.contents.draw_text(x + 1, y + 1, 120, 32, actor.name)
  182.     self.contents.draw_text(x - 1, y + 1, 120, 32, actor.name)
  183.     self.contents.font.color = normal_color
  184.     self.contents.draw_text(x, y, 120, 32, actor.name)
  185.   end
  186.   #=====================================
  187.   def draw_actor_level2(actor, x, y)
  188.     self.contents.font.name = $fontface
  189.     self.contents.font.color = outline_color
  190.     self.contents.draw_text(x - 1, y - 1, 32, 32, "Lv")
  191.     self.contents.draw_text(x - 1, y + 1, 32, 32, "Lv")
  192.     self.contents.draw_text(x + 1, y - 1, 32, 32, "Lv")
  193.     self.contents.draw_text(x + 1, y + 1, 32, 32, "Lv")
  194.     self.contents.font.color = Color.new(254, 230, 159, 255)
  195.     self.contents.draw_text(x, y, 32, 32, "Lv")
  196.     self.contents.font.color = outline_color
  197.     self.contents.draw_text(x + 31, y + 1, 24, 32, actor.level.to_s, 2)
  198.     self.contents.draw_text(x + 31, y - 1, 24, 32, actor.level.to_s, 2)
  199.     self.contents.draw_text(x + 33, y + 1, 24, 32, actor.level.to_s, 2)
  200.     self.contents.draw_text(x + 33, y - 1, 24, 32, actor.level.to_s, 2)
  201.     self.contents.font.color = normal_color
  202.     self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
  203.   end
  204.   #=====================================
  205.   def draw_actor_class2(actor, x, y)
  206.     self.contents.font.name = "Black Chancery"
  207.     self.contents.font.color = outline_color
  208.     self.contents.draw_text(x + 1, y + 1, 236, 32, actor.class_name)
  209.     self.contents.draw_text(x + 1, y - 1, 236, 32, actor.class_name)
  210.     self.contents.draw_text(x - 1, y + 1, 236, 32, actor.class_name)
  211.     self.contents.draw_text(x - 1, y - 1, 236, 32, actor.class_name)
  212.     self.contents.font.color = Color.new(238, 139, 254, 255)
  213.     self.contents.draw_text(x, y, 236, 32, actor.class_name)
  214.   end
  215.   #======================================
  216.   def draw_actor_hp2(actor, x, y, width = 144)
  217.     self.contents.font.name = "Tahoma"
  218.     # 文字列 "HP" を描画
  219.     self.contents.font.size = 24
  220.     self.contents.font.color = outline_color
  221.     self.contents.draw_text(x + 1, y + 1, 32, 32, $data_system.words.hp)
  222.     self.contents.draw_text(x + 1, y - 1, 32, 32, $data_system.words.hp)
  223.     self.contents.draw_text(x - 1, y - 1, 32, 32, $data_system.words.hp)
  224.     self.contents.draw_text(x - 1, y + 1, 32, 32, $data_system.words.hp)
  225.     self.contents.font.color = Color.new(254, 238, 189, 255)
  226.     self.contents.draw_text(x, y-5, 32, 32, $data_system.words.hp)
  227.     # MaxHP を描画するスペースがあるか計算
  228.     if width - 32 >= 108
  229.       hp_x = x + width - 108
  230.       flag = true
  231.     elsif width - 32 >= 48
  232.       hp_x = x + width - 48
  233.       flag = false
  234.     end
  235.     # HP を描画
  236.        self.contents.font.name = $fontface
  237.        self.contents.font.size = $fontsize
  238.        self.contents.font.color = outline_color
  239.        self.contents.draw_text(hp_x - 1, y - 1, 48, 32, actor.hp.to_s, 2)
  240.        self.contents.draw_text(hp_x - 1, y + 1, 48, 32, actor.hp.to_s, 2)
  241.        self.contents.draw_text(hp_x + 1, y + 1, 48, 32, actor.hp.to_s, 2)
  242.        self.contents.draw_text(hp_x + 1, y - 1, 48, 32, actor.hp.to_s, 2)
  243.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  244.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  245.     self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
  246.     # MaxHP を描画
  247.     if flag
  248.       self.contents.font.color = outline_color
  249.       self.contents.draw_text(hp_x + 60 - 1, y - 1, 48, 32, actor.maxhp.to_s)
  250.       self.contents.draw_text(hp_x + 60 - 1, y + 1, 48, 32, actor.maxhp.to_s)
  251.       self.contents.draw_text(hp_x + 60 + 1, y - 1, 48, 32, actor.maxhp.to_s)
  252.       self.contents.draw_text(hp_x + 60 + 1, y + 1, 48, 32, actor.maxhp.to_s)
  253.       self.contents.draw_text(hp_x + 48 - 1, y - 1, 12, 32, "/", 1)
  254.       self.contents.draw_text(hp_x + 48 + 1, y + 1, 12, 32, "/", 1)
  255.       self.contents.draw_text(hp_x + 48 - 1, y + 1, 12, 32, "/", 1)
  256.       self.contents.draw_text(hp_x + 48 + 1, y - 1, 12, 32, "/", 1)
  257.       self.contents.font.color = normal_color
  258.       self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  259.       self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  260.     end
  261.   end
  262.   #============================================
  263.   def draw_actor_sp2(actor, x, y, width = 144)
  264.     self.contents.font.name = "Tahoma"
  265.     # 文字列 "SP" を描画
  266.     self.contents.font.size = 24
  267.     self.contents.font.color = outline_color
  268.     self.contents.draw_text(x + 1, y + 1, 32, 32, $data_system.words.sp)
  269.     self.contents.draw_text(x + 1, y - 1, 32, 32, $data_system.words.sp)
  270.     self.contents.draw_text(x - 1, y - 1, 32, 32, $data_system.words.sp)
  271.     self.contents.draw_text(x - 1, y + 1, 32, 32, $data_system.words.sp)
  272.     self.contents.font.color = Color.new(74, 230, 51, 225)
  273.     self.contents.draw_text(x, y-5, 32, 32, $data_system.words.sp)
  274.     # MaxSP を描画するスペースがあるか計算
  275.     if width - 32 >= 108
  276.       sp_x = x + width - 108
  277.       flag = true
  278.     elsif width - 32 >= 48
  279.       sp_x = x + width - 48
  280.       flag = false
  281.     end
  282.     # SP を描画
  283.     self.contents.font.name = $fontface
  284.     self.contents.font.size = $fontsize
  285.     self.contents.font.color = outline_color
  286.     self.contents.draw_text(sp_x - 1, y - 1, 48, 32, actor.sp.to_s, 2)
  287.     self.contents.draw_text(sp_x - 1, y + 1, 48, 32, actor.sp.to_s, 2)
  288.     self.contents.draw_text(sp_x + 1, y - 1, 48, 32, actor.sp.to_s, 2)
  289.     self.contents.draw_text(sp_x + 1, y + 1, 48, 32, actor.sp.to_s, 2)
  290.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  291.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  292.     self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
  293.     # MaxSP を描画
  294.     if flag
  295.       self.contents.font.color = outline_color
  296.       self.contents.draw_text(sp_x + 60 - 1, y - 1, 48, 32, actor.maxsp.to_s)
  297.       self.contents.draw_text(sp_x + 60 - 1, y + 1, 48, 32, actor.maxsp.to_s)
  298.       self.contents.draw_text(sp_x + 60 + 1, y + 1, 48, 32, actor.maxsp.to_s)
  299.       self.contents.draw_text(sp_x + 60 + 1, y - 1, 48, 32, actor.maxsp.to_s)
  300.       self.contents.draw_text(sp_x + 48 - 1, y - 1, 12, 32, "/", 1)
  301.       self.contents.draw_text(sp_x + 48 - 1, y - 1, 12, 32, "/", 1)
  302.       self.contents.draw_text(sp_x + 48 + 1, y + 1, 12, 32, "/", 1)
  303.       self.contents.draw_text(sp_x + 48 + 1, y + 1, 12, 32, "/", 1)
  304.       self.contents.font.color = normal_color
  305.       self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  306.       self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  307.     end
  308.   end
  309.   #=========================================
  310.   def draw_actor_state2(actor, x, y, width = 120)
  311.     self.contents.font.name = $fontface
  312.     text = make_battler_state_text(actor, width, true)
  313.     self.contents.font.color = outline_color
  314.     self.contents.draw_text(x - 1, y - 1, width, 32, text)
  315.     self.contents.draw_text(x - 1, y + 1, width, 32, text)
  316.     self.contents.draw_text(x + 1, y + 1, width, 32, text)
  317.     self.contents.draw_text(x + 1, y - 1, width, 32, text)
  318.     self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
  319.     self.contents.draw_text(x, y, width, 32, text)
  320.   end
  321.     #=====================================
  322.   def draw_actor_parameter2(actor, x, y, type)
  323.     case type
  324.     when 0
  325.       parameter_name = $data_system.words.atk
  326.       parameter_value = actor.atk
  327.     when 1
  328.       parameter_name = $data_system.words.pdef
  329.       parameter_value = actor.pdef
  330.     when 2
  331.       parameter_name = "法防"
  332.       parameter_value = actor.mdef
  333.     when 3
  334.       parameter_name = $data_system.words.str
  335.       parameter_value = actor.str
  336.     when 4
  337.       parameter_name = $data_system.words.dex
  338.       parameter_value = actor.dex
  339.     when 5
  340.       parameter_name = $data_system.words.agi
  341.       parameter_value = actor.agi
  342.     when 6
  343.       parameter_name = $data_system.words.int
  344.       parameter_value = actor.int
  345.     end
  346.     self.contents.font.color = system_color
  347.     self.contents.draw_text_outline(x, y-5, 120, 32, parameter_name)#状态里数值坐标
  348.     self.contents.font.color = normal_color
  349.     self.contents.draw_text_outline(x + 130, y-5, 36, 32, parameter_value.to_s, 2)
  350.   end
  351.   #=========================================
  352.   def draw_item_name2(item, x, y)
  353.     if item == nil
  354.        self.contents.draw_text_outline(x + 28, y, 212, 32, "未装备")
  355.       return
  356.     end
  357.     bitmap = RPG::Cache.icon(item.icon_name)
  358.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  359.     self.contents.draw_text_outline(x + 28, y, 212, 32, item.name)
  360.   end
  361.    # New colour for outlining text - Black
  362.   def outline_color
  363.    return Color.new(0, 0, 0, 255)
  364. end
  365.   end
  366.   #==============================================================================
  367. # ■ Window_Selectable
  368. #------------------------------------------------------------------------------
  369. #  カーソルの移動やスクロールの機能を持つウィンドウクラスです。
  370. #==============================================================================

  371. class Window_Itemselectable < Window_Base
  372.   #--------------------------------------------------------------------------
  373.   # ● 公開インスタンス変数
  374.   #--------------------------------------------------------------------------
  375.   attr_reader   :index                    # カーソル位置
  376.   attr_reader   :help_window              # ヘルプウィンドウ
  377.   #--------------------------------------------------------------------------
  378.   # ● オブジェクト初期化
  379.   #     x      : ウィンドウの X 座標
  380.   #     y      : ウィンドウの Y 座標
  381.   #     width  : ウィンドウの幅
  382.   #     height : ウィンドウの高さ
  383.   #--------------------------------------------------------------------------
  384.   def initialize(x, y, width, height)
  385.     super(x, y, width, height)
  386.     @item_max = 1
  387.     @column_max = 1
  388.     @index = -1
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● カーソル位置の設定
  392.   #     index : 新しいカーソル位置
  393.   #--------------------------------------------------------------------------
  394.   def index=(index)
  395.     @index = index
  396.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  397.     if self.active and @help_window != nil
  398.       update_help
  399.     end
  400.     # カーソルの矩形を更新
  401.     update_cursor_rect
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 行数の取得
  405.   #--------------------------------------------------------------------------
  406.   def row_max
  407.     # 項目数と列数から行数を算出
  408.     return (@item_max + @column_max - 1) / @column_max
  409.   end
  410.   #--------------------------------------------------------------------------
  411.   # ● 先頭の行の取得
  412.   #--------------------------------------------------------------------------
  413.   def top_row
  414.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る
  415.     return self.oy / 32
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ● 先頭の行の設定
  419.   #     row : 先頭に表示する行
  420.   #--------------------------------------------------------------------------
  421.   def top_row=(row)
  422.     # row が 0 未満の場合は 0 に修正
  423.     if row < 0
  424.       row = 0
  425.     end
  426.     # row が row_max - 1 超の場合は row_max - 1 に修正
  427.     if row > row_max - 1
  428.       row = row_max - 1
  429.     end
  430.     # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする
  431.     self.oy = row * 32
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 1 ページに表示できる行数の取得
  435.   #--------------------------------------------------------------------------
  436.   def page_row_max
  437.     # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る
  438.     return (self.height - 32) / 32
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 1 ページに表示できる項目数の取得
  442.   #--------------------------------------------------------------------------
  443.   def page_item_max
  444.     # 行数 page_row_max に 列数 @column_max を掛ける
  445.     return page_row_max * @column_max
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● ヘルプウィンドウの設定
  449.   #     help_window : 新しいヘルプウィンドウ
  450.   #--------------------------------------------------------------------------
  451.   def help_window=(help_window)
  452.     @help_window = help_window
  453.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  454.     if self.active and @help_window != nil
  455.       update_help
  456.     end
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ● カーソルの矩形更新
  460.   #--------------------------------------------------------------------------
  461.   def update_cursor_rect
  462.     # カーソル位置が 0 未満の場合
  463.     if @index < 0
  464.       self.cursor_rect.empty
  465.       return
  466.     end
  467.     # 現在の行を取得
  468.     row = @index / @column_max
  469.     # 現在の行が、表示されている先頭の行より前の場合
  470.     if row < self.top_row
  471.       # 現在の行が先頭になるようにスクロール
  472.       self.top_row = row
  473.     end
  474.     # 現在の行が、表示されている最後尾の行より後ろの場合
  475.     if row > self.top_row + (self.page_row_max - 1)
  476.       # 現在の行が最後尾になるようにスクロール
  477.       self.top_row = row - (self.page_row_max - 1)
  478.     end
  479.     # カーソルの幅を計算
  480.     cursor_width = self.width / @column_max - 32
  481.     # カーソルの座標を計算
  482.     x = @index % @column_max * (cursor_width + 6) + 10
  483.     y = @index / @column_max * 32 - self.oy
  484.     # カーソルの矩形を更新
  485.     self.cursor_rect.set(x, y, cursor_width, 32)
  486.   end
  487.   #--------------------------------------------------------------------------
  488.   # ● フレーム更新
  489.   #--------------------------------------------------------------------------
  490.   def update
  491.     super
  492.     # カーソルの移動が可能な状態の場合
  493.     if self.active and @item_max > 0 and @index >= 0
  494.       # 方向ボタンの下が押された場合
  495.       if Input.repeat?(Input::DOWN)
  496.         # 列数が 1 かつ 方向ボタンの下の押下状態がリピートでない場合か、
  497.         # またはカーソル位置が(項目数 - 列数)より前の場合
  498.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  499.            @index < @item_max - @column_max
  500.           # カーソルを下に移動
  501.           $game_system.se_play($data_system.cursor_se)
  502.           @index = (@index + @column_max) % @item_max
  503.         end
  504.       end
  505.       # 方向ボタンの上が押された場合
  506.       if Input.repeat?(Input::UP)
  507.         # 列数が 1 かつ 方向ボタンの上の押下状態がリピートでない場合か、
  508.         # またはカーソル位置が列数より後ろの場合
  509.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  510.            @index >= @column_max
  511.           # カーソルを上に移動
  512.           $game_system.se_play($data_system.cursor_se)
  513.           @index = (@index - @column_max + @item_max) % @item_max
  514.         end
  515.       end
  516.       # 方向ボタンの右が押された場合
  517.       if Input.repeat?(Input::RIGHT)
  518.         # 列数が 2 以上で、カーソル位置が(項目数 - 1)より前の場合
  519.         if @column_max >= 2 and @index < @item_max - 1
  520.           # カーソルを右に移動
  521.           $game_system.se_play($data_system.cursor_se)
  522.           @index += 1
  523.         end
  524.       end
  525.       # 方向ボタンの左が押された場合
  526.       if Input.repeat?(Input::LEFT)
  527.         # 列数が 2 以上で、カーソル位置が 0 より後ろの場合
  528.         if @column_max >= 2 and @index > 0
  529.           # カーソルを左に移動
  530.           $game_system.se_play($data_system.cursor_se)
  531.           @index -= 1
  532.         end
  533.       end
  534.       # R ボタンが押された場合
  535.       if Input.repeat?(Input::R)
  536.         # 表示されている最後尾の行が、データ上の最後の行よりも前の場合
  537.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  538.           # カーソルを 1 ページ後ろに移動
  539.           $game_system.se_play($data_system.cursor_se)
  540.           @index = [@index + self.page_item_max, @item_max - 1].min
  541.           self.top_row += self.page_row_max
  542.         end
  543.       end
  544.       # L ボタンが押された場合
  545.       if Input.repeat?(Input::L)
  546.         # 表示されている先頭の行が 0 より後ろの場合
  547.         if self.top_row > 0
  548.           # カーソルを 1 ページ前に移動
  549.           $game_system.se_play($data_system.cursor_se)
  550.           @index = [@index - self.page_item_max, 0].max
  551.           self.top_row -= self.page_row_max
  552.         end
  553.       end
  554.     end
  555.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  556.     if self.active and @help_window != nil
  557.       update_help
  558.     end
  559.     # カーソルの矩形を更新
  560.     update_cursor_rect
  561.   end
  562. end
  563. #==============================================================================
  564. # ■ Window_Menuselectable
  565. #------------------------------------------------------------------------------
  566. #  カーソルの移動やスクロールの機能を持つウィンドウクラスです。
  567. #==============================================================================

  568. class Window_Menuselectable < Window_Base
  569.   #--------------------------------------------------------------------------
  570.   # ● 公開インスタンス変数
  571.   #--------------------------------------------------------------------------
  572.   attr_reader   :index                    # カーソル位置
  573.   attr_reader   :help_window              # ヘルプウィンドウ
  574.   #--------------------------------------------------------------------------
  575.   # ● オブジェクト初期化
  576.   #     x      : ウィンドウの X 座標
  577.   #     y      : ウィンドウの Y 座標
  578.   #     width  : ウィンドウの幅
  579.   #     height : ウィンドウの高さ
  580.   #--------------------------------------------------------------------------
  581.   def initialize(x, y, width, height)
  582.     super(x, y, width, height)
  583.     @item_max = 1
  584.     @column_max = 1
  585.     @index = -1
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● カーソル位置の設定
  589.   #     index : 新しいカーソル位置
  590.   #--------------------------------------------------------------------------
  591.   def index=(index)
  592.     @index = index
  593.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  594.     if self.active and @help_window != nil
  595.       update_help
  596.     end
  597.     # カーソルの矩形を更新
  598.     update_cursor_rect
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # ● 行数の取得
  602.   #--------------------------------------------------------------------------
  603.   def row_max
  604.     # 項目数と列数から行数を算出
  605.     return (@item_max + @column_max - 1) / @column_max
  606.   end
  607.   #--------------------------------------------------------------------------
  608.   # ● 先頭の行の取得
  609.   #--------------------------------------------------------------------------
  610.   def top_row
  611.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る
  612.     return self.oy / 32
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● 先頭の行の設定
  616.   #     row : 先頭に表示する行
  617.   #--------------------------------------------------------------------------
  618.   def top_row=(row)
  619.     # row が 0 未満の場合は 0 に修正
  620.     if row < 0
  621.       row = 0
  622.     end
  623.     # row が row_max - 1 超の場合は row_max - 1 に修正
  624.     if row > row_max - 1
  625.       row = row_max - 1
  626.     end
  627.     # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする
  628.     self.oy = row * 32
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # ● 1 ページに表示できる行数の取得
  632.   #--------------------------------------------------------------------------
  633.   def page_row_max
  634.     # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る
  635.     return (self.height - 32) / 32
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # ● 1 ページに表示できる項目数の取得
  639.   #--------------------------------------------------------------------------
  640.   def page_item_max
  641.     # 行数 page_row_max に 列数 @column_max を掛ける
  642.     return page_row_max * @column_max
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● ヘルプウィンドウの設定
  646.   #     help_window : 新しいヘルプウィンドウ
  647.   #--------------------------------------------------------------------------
  648.   def help_window=(help_window)
  649.     @help_window = help_window
  650.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  651.     if self.active and @help_window != nil
  652.       update_help
  653.     end
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # ● カーソルの矩形更新
  657.   #--------------------------------------------------------------------------
  658.   def update_cursor_rect
  659.     # カーソル位置が 0 未満の場合
  660.     if @index < 0
  661.       self.cursor_rect.empty
  662.       return
  663.     end
  664.     # 現在の行を取得
  665.     row = @index / @column_max
  666.     # 現在の行が、表示されている先頭の行より前の場合
  667.     if row < self.top_row
  668.       # 現在の行が先頭になるようにスクロール
  669.       self.top_row = row
  670.     end
  671.     # 現在の行が、表示されている最後尾の行より後ろの場合
  672.     if row > self.top_row + (self.page_row_max - 1)
  673.       # 現在の行が最後尾になるようにスクロール
  674.       self.top_row = row - (self.page_row_max - 1)
  675.     end
  676.     # カーソルの幅を計算
  677.     cursor_width = self.width / @column_max - 32
  678.     # カーソルの座標を計算
  679.     x = @index % @column_max * (cursor_width + 32)
  680.     y = @index / @column_max * 40 - self.oy
  681.     # カーソルの矩形を更
  682.   end
  683.   #--------------------------------------------------------------------------
  684.   # ● フレーム更新
  685.   #--------------------------------------------------------------------------
  686.   def update
  687.     super
  688.     # カーソルの移動が可能な状態の場合
  689.     if self.active and @item_max > 0 and @index >= 0
  690.       # 方向ボタンの下が押された場合
  691.       if Input.repeat?(Input::DOWN)
  692.         # 列数が 1 かつ 方向ボタンの下の押下状態がリピートでない場合か、
  693.         # またはカーソル位置が(項目数 - 列数)より前の場合
  694.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  695.            @index < @item_max - @column_max
  696.           # カーソルを下に移動
  697.           $game_system.se_play($data_system.cursor_se)
  698.           @index = (@index + @column_max) % @item_max
  699.         end
  700.       end
  701.       # 方向ボタンの上が押された場合
  702.       if Input.repeat?(Input::UP)
  703.         # 列数が 1 かつ 方向ボタンの上の押下状態がリピートでない場合か、
  704.         # またはカーソル位置が列数より後ろの場合
  705.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  706.            @index >= @column_max
  707.           # カーソルを上に移動
  708.           $game_system.se_play($data_system.cursor_se)
  709.           @index = (@index - @column_max + @item_max) % @item_max
  710.         end
  711.       end
  712.       # 方向ボタンの右が押された場合
  713.       if Input.repeat?(Input::RIGHT)
  714.         # 列数が 2 以上で、カーソル位置が(項目数 - 1)より前の場合
  715.         if @column_max >= 2 and @index < @item_max - 1
  716.           # カーソルを右に移動
  717.           $game_system.se_play($data_system.cursor_se)
  718.           @index += 1
  719.         end
  720.       end
  721.       # 方向ボタンの左が押された場合
  722.       if Input.repeat?(Input::LEFT)
  723.         # 列数が 2 以上で、カーソル位置が 0 より後ろの場合
  724.         if @column_max >= 2 and @index > 0
  725.           # カーソルを左に移動
  726.           $game_system.se_play($data_system.cursor_se)
  727.           @index -= 1
  728.         end
  729.       end
  730.       # R ボタンが押された場合
  731.       if Input.repeat?(Input::R)
  732.         # 表示されている最後尾の行が、データ上の最後の行よりも前の場合
  733.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  734.           # カーソルを 1 ページ後ろに移動
  735.           $game_system.se_play($data_system.cursor_se)
  736.           @index = [@index + self.page_item_max, @item_max - 1].min
  737.           self.top_row += self.page_row_max
  738.         end
  739.       end
  740.       # L ボタンが押された場合
  741.       if Input.repeat?(Input::L)
  742.         # 表示されている先頭の行が 0 より後ろの場合
  743.         if self.top_row > 0
  744.           # カーソルを 1 ページ前に移動
  745.           $game_system.se_play($data_system.cursor_se)
  746.           @index = [@index - self.page_item_max, 0].max
  747.           self.top_row -= self.page_row_max
  748.         end
  749.       end
  750.     end
  751.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  752.     if self.active and @help_window != nil
  753.       update_help
  754.     end
  755.     # カーソルの矩形を更新
  756.     update_cursor_rect
  757.   end
  758. end
  759. #==============================================================================
  760. # ■ Window_Menucommand
  761. #------------------------------------------------------------------------------
  762. #  一般的なコマンド選択を行うウィンドウです。
  763. #==============================================================================

  764. class Window_Menucommand < Window_Menuselectable
  765.   #--------------------------------------------------------------------------
  766.   # ● オブジェクト初期化
  767.   #     width    : ウィンドウの幅
  768.   #     commands : コマンド文字列の配列
  769.   #--------------------------------------------------------------------------
  770.   def initialize(width, commands)
  771.     # コマンドの個数からウィンドウの高さを算出
  772.     super(0, 0, width, commands.size * 32 + 32)
  773.     @item_max = commands.size
  774.     @commands = commands
  775.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  776.     self.contents.font.name = $fontface
  777.     self.contents.font.size = $fontsize
  778.     refresh
  779.     self.index = 0
  780.   end
  781.   #--------------------------------------------------------------------------
  782.   # ● リフレッシュ
  783.   #--------------------------------------------------------------------------
  784.   def refresh
  785.     self.contents.clear
  786.     for i in 0...@item_max
  787.       draw_item(i, normal_color)
  788.     end
  789.   end
  790.   #--------------------------------------------------------------------------
  791.   # ● 項目の描画
  792.   #     index : 項目番号
  793.   #     color : 文字色
  794.   #--------------------------------------------------------------------------
  795.   def draw_item(index, color)
  796.     self.contents.font.color = color
  797.     rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
  798.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  799.     self.contents.draw_text(rect, @commands[index])
  800.   end
  801.   #--------------------------------------------------------------------------
  802.   # ● 項目の無効化
  803.   #     index : 項目番号
  804.   #--------------------------------------------------------------------------
  805.   def disable_item(index)
  806.     draw_item(index, disabled_color)
  807.   end
  808. end
  809. #==============================================================================
  810. # ■ Window_Help
  811. #------------------------------------------------------------------------------
  812. #  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
  813. #==============================================================================

  814. class Window_Menuhelp < Window_Base
  815.   #--------------------------------------------------------------------------
  816.   # ● オブジェクト初期化
  817.   #--------------------------------------------------------------------------
  818.   def initialize
  819.     super(0, - 77, 640, 64)
  820.     self.contents = Bitmap.new(width - 32, height - 32)
  821.     self.contents.font.name = $fontface
  822.     self.contents.font.size = 18
  823.     self.opacity = 0
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● テキスト設定
  827.   #     text  : ウィンドウに表示する文字列
  828.   #     align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
  829.   #--------------------------------------------------------------------------
  830.   def set_text(text, align = 0)
  831.     # テキストとアラインメントの少なくとも一方が前回と違っている場合
  832.     if text != @text or align != @align
  833.       # テキストを再描画
  834.       self.contents.clear
  835.       self.contents.font.color = normal_color
  836.       self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  837.       @text = text
  838.       @align = align
  839.       @actor = nil
  840.     end
  841.     self.visible = true
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ● アクター設定
  845.   #     actor : ステータスを表示するアクター
  846.   #--------------------------------------------------------------------------
  847.   def set_actor(actor)
  848.     if actor != @actor
  849.       self.contents.clear
  850.       draw_actor_name(actor, 4, 0)
  851.       draw_actor_state(actor, 140, 0)
  852.       draw_actor_hp(actor, 284, 0)
  853.       draw_actor_sp(actor, 460, 0)
  854.       @actor = actor
  855.       @text = nil
  856.       self.visible = true
  857.     end
  858.   end
  859.   #--------------------------------------------------------------------------
  860.   # ● エネミー設定
  861.   #     enemy : 名前とステートを表示するエネミー
  862.   #--------------------------------------------------------------------------
  863.   def set_enemy(enemy)
  864.     text = enemy.name
  865.     state_text = make_battler_state_text(enemy, 112, false)
  866.     if state_text != ""
  867.       text += "  " + state_text
  868.     end
  869.     set_text(text, 1)
  870.   end
  871. end
  872. #==============================================================================
  873. # ■ Window_Gold
  874. #------------------------------------------------------------------------------
  875. #  ゴールドを表示するウィンドウです。
  876. #==============================================================================

  877. class Window_Gold < Window_Base
  878.   #--------------------------------------------------------------------------
  879.   # ● オブジェクト初期化
  880.   #--------------------------------------------------------------------------
  881.   def initialize
  882.     super(0, 0, 200, 64)
  883.     self.contents = Bitmap.new(width - 32, height - 32)
  884.     self.contents.font.name = $fontface
  885.     self.contents.font.size = 21
  886.     refresh
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● リフレッシュ
  890.   #--------------------------------------------------------------------------
  891.   def refresh
  892.     self.contents.clear
  893.     cx = contents.text_size("金币").width
  894.     self.contents.font.color = outline_color
  895.     self.contents.draw_text(60, 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
  896.     self.contents.draw_text(61, 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
  897.     self.contents.draw_text(61, 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
  898.     self.contents.draw_text(62, 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
  899.     self.contents.font.color = normal_color
  900.     self.contents.draw_text(61, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
  901.     self.contents.font.color = outline_color
  902.     self.contents.draw_text(1, 1, cx, 32, "金币", 2)
  903.     self.contents.draw_text(1, 1, cx, 32, "金币", 2)
  904.     self.contents.draw_text(1, 1, cx, 32, "金币", 2)
  905.     self.contents.draw_text(1, - 1, cx, 32, "金币", 2)
  906.     self.contents.font.color = Color.new(254, 230, 159, 255)
  907.     self.contents.draw_text(0, 0, cx, 32, "金币", 2)
  908.   end
  909. end
  910. #==============================================================================
  911. # ■ Window_PlayTime
  912. #------------------------------------------------------------------------------
  913. #  メニュー画面でプレイ時間を表示するウィンドウです。
  914. #==============================================================================

  915. class Window_PlayTime < Window_Base
  916.   #--------------------------------------------------------------------------
  917.   # ● オブジェクト初期化
  918.   #--------------------------------------------------------------------------
  919.   def initialize
  920.     super(0, 0, 200, 70)
  921.     self.contents = Bitmap.new(width - 32, height - 32)
  922.     self.contents.font.name = $fontface
  923.     self.contents.font.size = 21
  924.     self.opacity = 0
  925.     refresh
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● リフレッシュ
  929.   #--------------------------------------------------------------------------
  930.   def refresh
  931.     self.contents.clear
  932.     self.contents.font.color = outline_color
  933.     self.contents.draw_text(1, - 1, 120, 32, "时间")
  934.     self.contents.draw_text(1, 1, 120, 32, "时间")
  935.     self.contents.draw_text(-1, - 1, 120, 32, "时间")
  936.     self.contents.draw_text(-1, 1, 120, 32, "时间")
  937.     self.contents.font.color =  Color.new(254, 230, 159, 255)
  938.     self.contents.draw_text(0, 0, 120, 32, "时间")
  939.     @total_sec = Graphics.frame_count / Graphics.frame_rate
  940.     hour = @total_sec / 60 / 60
  941.     min = @total_sec / 60 % 60
  942.     sec = @total_sec % 60
  943.     text = sprintf("%02d:%02d:%02d", hour, min, sec)
  944.     self.contents.font.color = outline_color
  945.     self.contents.draw_text(39, - 1, 120, 32, text, 2)
  946.     self.contents.draw_text(39, 1, 120, 32, text, 2)
  947.     self.contents.draw_text(41, 1, 120, 32, text, 2)
  948.     self.contents.draw_text(41, -1, 120, 32, text, 2)
  949.     self.contents.font.color = normal_color
  950.     self.contents.draw_text(40, 0, 120, 32, text, 2)
  951.   end
  952.   #--------------------------------------------------------------------------
  953.   # ● フレーム更新
  954.   #--------------------------------------------------------------------------
  955.   def update
  956.     super
  957.     if Graphics.frame_count / Graphics.frame_rate != @total_sec
  958.       refresh
  959.     end
  960.   end
  961. end
  962. #==============================================================================
  963. # ■ Window_MenuStatus
  964. #------------------------------------------------------------------------------
  965. #  メニュー画面でパーティメンバーのステータスを表示するウィンドウです。
  966. #==============================================================================

  967. class Window_MenuStatus < Window_Selectable
  968.   #--------------------------------------------------------------------------
  969.   # ● オブジェクト初期化
  970.   #--------------------------------------------------------------------------
  971.   def initialize
  972.     super(0, 0, 480, 430)
  973.     self.contents = Bitmap.new(width - 32, height - 32)
  974.     self.contents.font.name = $fontface
  975.     self.contents.font.size = $fontsize
  976.     refresh
  977.     self.active = false
  978.     self.index = -1
  979.   end
  980.   #--------------------------------------------------------------------------
  981.   # ● リフレッシュ
  982.   #--------------------------------------------------------------------------
  983.   def refresh
  984.     self.contents.clear
  985.     @item_max = $game_party.actors.size
  986.     for i in 0...$game_party.actors.size
  987.       x = 100 - i * 18
  988.       y = i * 100
  989.       actor = $game_party.actors[i]
  990.       draw_actor_face(actor, x - 40, y + 80)
  991.       draw_actor_name2(actor, x + 50, y)
  992.       draw_actor_class2(actor, x + 50, y + 50)
  993.       draw_actor_level2(actor, x + 50, y + 25)
  994.       draw_actor_state2(actor, x + 155, y + 50)
  995.       draw_actor_hp2(actor, x + 140, y )
  996.       draw_actor_sp2(actor, x + 140, y + 25)
  997.       draw_actor_barz(actor, x + 140, y + 25, "horizontal", 130, 1, actor.hp, actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
  998.       draw_actor_barz(actor, x + 140, y + 50, "horizontal", 130, 1, actor.sp, actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
  999.     end
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ● カーソルの矩形更新
  1003.   #--------------------------------------------------------------------------
  1004.   def update_cursor_rect
  1005.       self.cursor_rect.empty
  1006. end
  1007. end
  1008. #==============================================================================
  1009. # ■ Window_Item
  1010. #------------------------------------------------------------------------------
  1011. #  アイテム画面、バトル画面で、所持アイテムの一覧を表示するウィンドウです。
  1012. #==============================================================================

  1013. class Window_Menuitem < Window_Itemselectable
  1014.   #--------------------------------------------------------------------------
  1015.   # ● オブジェクト初期化
  1016.   #--------------------------------------------------------------------------
  1017.   def initialize
  1018.     super(0, 500, 640, 380)
  1019.     @column_max = 2
  1020.     refresh
  1021.     self.index = 0
  1022.     self.opacity = 0
  1023.     # 戦闘中の場合はウィンドウを画面中央へ移動し、半透明にする
  1024.     if $game_temp.in_battle
  1025.       self.y = 64
  1026.       self.height = 256
  1027.       self.back_opacity = 160
  1028.     end
  1029.   end
  1030.   #--------------------------------------------------------------------------
  1031.   # ● アイテムの取得
  1032.   #--------------------------------------------------------------------------
  1033.   def item
  1034.     return @data[self.index]
  1035.   end
  1036.   #--------------------------------------------------------------------------
  1037.   # ● リフレッシュ
  1038.   #--------------------------------------------------------------------------
  1039.   def refresh
  1040.     if self.contents != nil
  1041.       self.contents.dispose
  1042.       self.contents = nil
  1043.     end
  1044.     @data = []
  1045.     # アイテムを追加
  1046.     for i in 1...$data_items.size
  1047.       if $game_party.item_number(i) > 0
  1048.         @data.push($data_items[i])
  1049.       end
  1050.     end
  1051.     # 戦闘中以外なら武器と防具も追加
  1052.     unless $game_temp.in_battle
  1053.       for i in 1...$data_weapons.size
  1054.         if $game_party.weapon_number(i) > 0
  1055.           @data.push($data_weapons[i])
  1056.         end
  1057.       end
  1058.       for i in 1...$data_armors.size
  1059.         if $game_party.armor_number(i) > 0
  1060.           @data.push($data_armors[i])
  1061.         end
  1062.       end
  1063.     end
  1064.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  1065.     @item_max = @data.size
  1066.     if @item_max > 0
  1067.       self.contents = Bitmap.new(width - 32, row_max * 32)
  1068.       self.contents.font.name = $fontface
  1069.       self.contents.font.size = $fontsize
  1070.       for i in 0...@item_max
  1071.         draw_item(i)
  1072.       end
  1073.     end
  1074.   end
  1075.   #--------------------------------------------------------------------------
  1076.   # ● 項目の描画
  1077.   #     index : 項目番号
  1078.   #--------------------------------------------------------------------------
  1079.   def draw_item(index)
  1080.     item = @data[index]
  1081.     case item
  1082.     when RPG::Item
  1083.       number = $game_party.item_number(item.id)
  1084.     when RPG::Weapon
  1085.       number = $game_party.weapon_number(item.id)
  1086.     when RPG::Armor
  1087.       number = $game_party.armor_number(item.id)
  1088.     end
  1089.     if item.is_a?(RPG::Item) and
  1090.        $game_party.item_can_use?(item.id)
  1091.       self.contents.font.color = normal_color
  1092.     else
  1093.       self.contents.font.color = Color.new(255, 255, 255, 200)
  1094.     end
  1095.     x = 4 + index % 2 * (270 + 25) + 12
  1096.     y = index / 2 * 32
  1097.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1098.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1099.     bitmap = RPG::Cache.icon(item.icon_name)
  1100.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1101.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1102.     if item.is_a?(RPG::Item) and
  1103.        $game_party.item_can_use?(item.id)
  1104.     self.contents.draw_text_outline(x + 28, y, 212, 32, item.name, 0)
  1105.     self.contents.draw_text_outline(x + 240, y, 16, 32, ":", 1)
  1106.     self.contents.draw_text_outline(x + 256, y, 24, 32, number.to_s, 2)
  1107.     else
  1108.     self.contents.draw_text_outline2(x + 28, y, 212, 32, item.name, 0)
  1109.     self.contents.draw_text_outline2(x + 240, y, 16, 32, ":", 1)
  1110.     self.contents.draw_text_outline2(x + 256, y, 24, 32, number.to_s, 2)
  1111.     end
  1112.   end
  1113.   #--------------------------------------------------------------------------
  1114.   # ● ヘルプテキスト更新
  1115.   #--------------------------------------------------------------------------
  1116.   def update_help
  1117.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  1118.   end
  1119. end
  1120. #==============================================================================
  1121. # ■ Window_Menuskill
  1122. #------------------------------------------------------------------------------
  1123. #
  1124. #==============================================================================

  1125. class Window_Menuskill < Window_Itemselectable
  1126.   #--------------------------------------------------------------------------
  1127.   # ● オブジェクト初期化
  1128.   #     actor : アクター
  1129.   #--------------------------------------------------------------------------
  1130.   def initialize(actor)
  1131.     super(- 3, 531, 640, 352)
  1132.     @actor = actor
  1133.     @column_max = 2
  1134.     refresh
  1135.     self.index = 0
  1136.     # 戦闘中の場合はウィンドウを画面中央へ移動し、半透明にする
  1137.     if $game_temp.in_battle
  1138.       self.y = 64
  1139.       self.height = 256
  1140.       self.back_opacity = 160
  1141.     end
  1142.   end
  1143.   #--------------------------------------------------------------------------
  1144.   # ● スキルの取得
  1145.   #--------------------------------------------------------------------------
  1146.   def skill
  1147.     return @data[self.index]
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ● リフレッシュ
  1151.   #--------------------------------------------------------------------------
  1152.   def refresh
  1153.     if self.contents != nil
  1154.       self.contents.dispose
  1155.       self.contents = nil
  1156.     end
  1157.     @data = []
  1158.     for i in [email protected]
  1159.       skill = $data_skills[@actor.skills[i]]
  1160.       if skill != nil
  1161.         @data.push(skill)
  1162.       end
  1163.     end
  1164.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  1165.     @item_max = @data.size
  1166.     if @item_max > 0
  1167.       self.contents = Bitmap.new(width - 32, row_max * 32)
  1168.       self.contents.font.name = $fontface
  1169.       self.contents.font.size = $fontsize
  1170.       for i in 0...@item_max
  1171.         draw_item(i)
  1172.       end
  1173.     end
  1174.   end
  1175.   #--------------------------------------------------------------------------
  1176.   # ● 項目の描画
  1177.   #     index : 項目番号
  1178.   #--------------------------------------------------------------------------
  1179.   def draw_item(index)
  1180.     skill = @data[index]
  1181.     if @actor.skill_can_use?(skill.id)
  1182.       self.contents.font.color = normal_color
  1183.     else
  1184.       self.contents.font.color = Color.new(255, 255, 255, 200)
  1185.     end
  1186.     x = 4 + index % 2 * (270 + 25) + 12
  1187.     y = index / 2 * 32
  1188.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1189.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1190.     bitmap = RPG::Cache.icon(skill.icon_name)
  1191.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1192.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1193.      if @actor.skill_can_use?(skill.id)
  1194.     self.contents.draw_text_outline(x + 28, y, 204, 32, skill.name, 0)
  1195.     self.contents.draw_text_outline(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  1196.     else
  1197.     self.contents.draw_text_outline2(x + 28, y, 204, 32, skill.name, 0)
  1198.     self.contents.draw_text_outline2(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  1199.     end
  1200.   end
  1201.   #--------------------------------------------------------------------------
  1202.   # ● ヘルプテキスト更新
  1203.   #--------------------------------------------------------------------------
  1204.   def update_help
  1205.     @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  1206.   end
  1207. end
  1208. #==============================================================================
  1209. # ■ Window_SkillStatus
  1210. #------------------------------------------------------------------------------
  1211. #  スキル画面で、スキル使用者のステータスを表示するウィンドウです。
  1212. #==============================================================================

  1213. class Window_SkillStatus < Window_Base
  1214.   #--------------------------------------------------------------------------
  1215.   # ● オブジェクト初期化
  1216.   #     actor : アクター
  1217.   #--------------------------------------------------------------------------
  1218.   def initialize(actor)
  1219.     super(630, 35, 410, 109)
  1220.     self.contents = Bitmap.new(width - 32, height - 32)
  1221.     self.contents.font.name = $fontface
  1222.     self.contents.font.size = $fontsize
  1223.     self.opacity = 0
  1224.     @actor = actor
  1225.     refresh
  1226.   end
  1227.   #--------------------------------------------------------------------------
  1228.   # ● リフレッシュ
  1229.   #--------------------------------------------------------------------------
  1230.   def refresh
  1231.     self.contents.clear
  1232.     x = 100
  1233.     y = 0
  1234.       draw_actor_face(@actor, x - 40, y + 80)
  1235.       draw_actor_name2(@actor, x + 50, y)
  1236.       draw_actor_class2(@actor, x + 50, y + 50)
  1237.       draw_actor_level2(@actor, x + 50, y + 25)
  1238.       draw_actor_state2(@actor, x + 155, y + 50)
  1239.       draw_actor_hp2(@actor, x + 140, y )
  1240.       draw_actor_sp2(@actor, x + 140, y + 25)
  1241.       draw_actor_barz(@actor, x + 140, y + 25, "horizontal", 130, 1, @actor.hp, @actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
  1242.       draw_actor_barz(@actor, x + 140, y + 50, "horizontal", 130, 1, @actor.sp, @actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
  1243.   end
  1244. end
  1245. #==============================================================================
  1246. # ■ Window_Target
  1247. #------------------------------------------------------------------------------
  1248. #  アイテム画面とスキル画面で、使用対象のアクターを選択するウィンドウです。
  1249. #==============================================================================

  1250. class Window_Target < Window_Selectable
  1251.   #--------------------------------------------------------------------------
  1252.   # ● オブジェクト初期化
  1253.   #--------------------------------------------------------------------------
  1254.   def initialize
  1255.     super(0, 0, 336, 480)
  1256.     self.contents = Bitmap.new(width - 32, height - 32)
  1257.     self.contents.font.name = $fontface
  1258.     self.contents.font.size = $fontsize
  1259.     self.z += 10
  1260.     @item_max = $game_party.actors.size
  1261.     refresh
  1262.   end
  1263.   #--------------------------------------------------------------------------
  1264.   # ● リフレッシュ
  1265.   #--------------------------------------------------------------------------
  1266.   def refresh
  1267.     self.contents.clear
  1268.     for i in 0...$game_party.actors.size
  1269.       x = 4
  1270.       y = i * 116
  1271.       actor = $game_party.actors[i]
  1272.       draw_actor_name2(actor, x, y)
  1273.       draw_actor_class2(actor, x + 144, y)
  1274.       draw_actor_level2(actor, x + 8, y + 32)
  1275.       draw_actor_state2(actor, x + 8, y + 64)
  1276.       draw_actor_hp2(actor, x + 152, y + 32)
  1277.       draw_actor_sp2(actor, x + 152, y + 64)
  1278.       draw_actor_barz(actor, x + 152, y + 57, "horizontal", 130, 1, actor.hp, actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
  1279.       draw_actor_barz(actor, x + 152, y + 89, "horizontal", 130, 1, actor.sp, actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
  1280.     end
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # ● カーソルの矩形更新
  1284.   #--------------------------------------------------------------------------
  1285.   def update_cursor_rect
  1286.     # カーソル位置 -1 は全選択、-2 以下は単独選択 (使用者自身)
  1287.     if @index <= -2
  1288.       self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
  1289.     elsif @index == -1
  1290.       self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
  1291.     else
  1292.       self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
  1293.     end
  1294.   end
  1295. end
  1296. #==============================================================================
  1297. # ■ Window_EquipRight
  1298. #------------------------------------------------------------------------------
  1299. #  装備画面で、アクターが現在装備しているアイテムを表示するウィンドウです。
  1300. #==============================================================================

  1301. class Window_EquipRight < Window_Menuselectable
  1302.   #--------------------------------------------------------------------------
  1303.   # ● オブジェクト初期化
  1304.   #     actor : アクター
  1305.   #--------------------------------------------------------------------------
  1306.   def initialize(actor)
  1307.     super(- 100, 125, 200, 350)
  1308.     self.contents = Bitmap.new(width - 32, height - 32)
  1309.     self.contents.font.name = $fontface
  1310.     self.contents.font.size = $fontsize
  1311.     self.opacity = 0
  1312.     @actor = actor
  1313.     refresh
  1314.     self.index = 0
  1315.   end
  1316.   #--------------------------------------------------------------------------
  1317.   # ● アイテムの取得
  1318.   #--------------------------------------------------------------------------
  1319.   def item
  1320.     return @data[self.index]
  1321.   end
  1322.   #--------------------------------------------------------------------------
  1323.   # ● リフレッシュ
  1324.   #--------------------------------------------------------------------------
  1325.   def refresh
  1326.     self.contents.clear
  1327.     @data = []
  1328.     @data.push($data_weapons[@actor.weapon_id])
  1329.     @data.push($data_armors[@actor.armor1_id])
  1330.     @data.push($data_armors[@actor.armor2_id])
  1331.     @data.push($data_armors[@actor.armor3_id])
  1332.     @data.push($data_armors[@actor.armor4_id])
  1333.     @item_max = @data.size
  1334.     draw_item_name2(@data[0], 0, 68 * 0)
  1335.     draw_item_name2(@data[1], 0, 68 * 1)
  1336.     draw_item_name2(@data[2], 0, 68 * 2)
  1337.     draw_item_name2(@data[3], 0, 68 * 3)
  1338.     draw_item_name2(@data[4], 0, 68 * 4 - 2)
  1339.   end
  1340.   #--------------------------------------------------------------------------
  1341.   # ● ヘルプテキスト更新
  1342.   #--------------------------------------------------------------------------
  1343.   def update_help
  1344.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  1345.   end
  1346. end
  1347. #==============================================================================
  1348. # ■ Window_EquipItem
  1349. #------------------------------------------------------------------------------
  1350. #  装備画面で、装備変更の候補となるアイテムの一覧を表示するウィンドウです。
  1351. #==============================================================================

  1352. class Window_EquipItem < Window_Selectable
  1353.   #--------------------------------------------------------------------------
  1354.   # ● オブジェクト初期化
  1355.   #     actor      : アクター
  1356.   #     equip_type : 装備部位 (0~3)
  1357.   #--------------------------------------------------------------------------
  1358.   def initialize(actor, equip_type)
  1359.     super(233, 573, 413, 224)
  1360.     @actor = actor
  1361.     @equip_type = equip_type
  1362.     @column_max = 2
  1363.     refresh
  1364.     self.active = false
  1365.     self.index = -1
  1366.     self.opacity = 0
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ● アイテムの取得
  1370.   #--------------------------------------------------------------------------
  1371.   def item
  1372.     return @data[self.index]
  1373.   end
  1374.   #--------------------------------------------------------------------------
  1375.   # ● リフレッシュ
  1376.   #--------------------------------------------------------------------------
  1377.   def refresh
  1378.     if self.contents != nil
  1379.       self.contents.dispose
  1380.       self.contents = nil
  1381.     end
  1382.     @data = []
  1383.     # 装備可能な武器を追加
  1384.     if @equip_type == 0
  1385.       weapon_set = $data_classes[@actor.class_id].weapon_set
  1386.       for i in 1...$data_weapons.size
  1387.         if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  1388.           @data.push($data_weapons[i])
  1389.         end
  1390.       end
  1391.     end
  1392.     # 装備可能な防具を追加
  1393.     if @equip_type != 0
  1394.       armor_set = $data_classes[@actor.class_id].armor_set
  1395.       for i in 1...$data_armors.size
  1396.         if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  1397.           if $data_armors[i].kind == @equip_type-1
  1398.             @data.push($data_armors[i])
  1399.           end
  1400.         end
  1401.       end
  1402.     end
  1403.     # 空白を追加
  1404.     @data.push(nil)
  1405.     # ビットマップを作成し、全項目を描画
  1406.     @item_max = @data.size
  1407.     self.contents = Bitmap.new(width - 32, row_max * 32)
  1408.     self.contents.font.name = $fontface
  1409.     self.contents.font.size = 22
  1410.     for i in 0...@item_max-1
  1411.       draw_item(i)
  1412.     end
  1413.   end
  1414.   #--------------------------------------------------------------------------
  1415.   # ● 項目の描画
  1416.   #     index : 項目番号
  1417.   #--------------------------------------------------------------------------
  1418.   def draw_item(index)
  1419.     item = @data[index]
  1420.     x = 4 + index % 2 * (176 + 16)
  1421.     y = index / 2 * 32
  1422.     case item
  1423.     when RPG::Weapon
  1424.       number = $game_party.weapon_number(item.id)
  1425.     when RPG::Armor
  1426.       number = $game_party.armor_number(item.id)
  1427.     end
  1428.     bitmap = RPG::Cache.icon(item.icon_name)
  1429.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  1430.     self.contents.font.color = normal_color
  1431.     self.contents.draw_text_shadow(x + 28, y, 212, 32, item.name, 0)
  1432.     self.contents.draw_text_shadow(x + 140, y, 16, 32, ":", 1)
  1433.     self.contents.draw_text_shadow(x + 156, y, 24, 32, number.to_s, 2)
  1434.   end
  1435.   #--------------------------------------------------------------------------
  1436.     def update_cursor_rect
  1437.     # カーソル位置が 0 未満の場合
  1438.     if @index < 0
  1439.       self.cursor_rect.empty
  1440.       return
  1441.     end
  1442.     # 現在の行を取得
  1443.     row = @index / @column_max
  1444.     # 現在の行が、表示されている先頭の行より前の場合
  1445.     if row < self.top_row
  1446.       # 現在の行が先頭になるようにスクロール
  1447.       self.top_row = row
  1448.     end
  1449.     # 現在の行が、表示されている最後尾の行より後ろの場合
  1450.     if row > self.top_row + (self.page_row_max - 1)
  1451.       # 現在の行が最後尾になるようにスクロール
  1452.       self.top_row = row - (self.page_row_max - 1)
  1453.     end
  1454.     # カーソルの幅を計算
  1455.     cursor_width = self.width / @column_max - 32
  1456.     # カーソルの座標を計算
  1457.     x = @index % @column_max * (cursor_width + 16)
  1458.     y = @index / @column_max * 32 - self.oy
  1459.     # カーソルの矩形を更新
  1460.     self.cursor_rect.set(x + 2, y, cursor_width + 15, 32)
  1461.   end
  1462.   # ● ヘルプテキスト更新
  1463.   #--------------------------------------------------------------------------
  1464.   def update_help
  1465.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  1466.   end
  1467. end
  1468. #==============================================================================
  1469. # ■ Window_Status
  1470. #------------------------------------------------------------------------------
  1471. #  ステータス画面で表示する、フル仕様のステータスウィンドウです。
  1472. #==============================================================================

  1473. class Window_Status < Window_Base
  1474.   #--------------------------------------------------------------------------
  1475.   # ● オブジェクト初期化
  1476.   #     actor : アクター
  1477.   #--------------------------------------------------------------------------
  1478.   def initialize(actor)
  1479.     super(0, 0, 418, 133)
  1480.     self.contents = Bitmap.new(width - 32, height - 32)
  1481.     self.contents.font.name = $fontface
  1482.     self.contents.font.size = $fontsize
  1483.     @actor = actor
  1484.     refresh
  1485.   end
  1486.   #--------------------------------------------------------------------------
  1487.   # ● リフレッシュ
  1488.   #--------------------------------------------------------------------------
  1489.   def refresh
  1490.     self.contents.clear
  1491.     draw_actor_face(@actor, 0, 90)
  1492.     draw_actor_name2(@actor, 90, 0)
  1493.     draw_actor_class2(@actor, 250, 0)
  1494.     draw_actor_level2(@actor, 90, 32)
  1495.     draw_actor_state2(@actor, 90, 64)
  1496.     draw_actor_hp2(@actor, 210, 32, 172)
  1497.     draw_actor_sp2(@actor, 210, 64, 172)
  1498.     draw_actor_barz(@actor, 210, 57, "horizontal", 158, 1, @actor.hp, @actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
  1499.     draw_actor_barz(@actor, 210, 89, "horizontal", 158, 1, @actor.sp, @actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
  1500.     end
  1501.   end
  1502.   #==============================================================================
  1503. # ■ Window_Status2
  1504. #------------------------------------------------------------------------------
  1505. #  ステータス画面で表示する、フル仕様のステータスウィンドウです。
  1506. #==============================================================================

  1507. class Window_Status2 < Window_Base
  1508.   #--------------------------------------------------------------------------
  1509.   # ● オブジェクト初期化
  1510.   #     actor : アクター
  1511.   #--------------------------------------------------------------------------
  1512.   def initialize(actor)
  1513.     super(0, 0, 418, 178)
  1514.     self.contents = Bitmap.new(width - 32, height - 32)
  1515.     self.contents.font.name = $fontface
  1516.     self.contents.font.size = $fontsize
  1517.     @actor = actor
  1518.     refresh
  1519.   end
  1520.   #--------------------------------------------------------------------------
  1521.   # ● リフレッシュ
  1522.   #--------------------------------------------------------------------------
  1523.   def refresh
  1524.     self.contents.clear
  1525.           self.contents.font.size = 24
  1526.     draw_actor_parameter2(@actor, 0, 10, 0)
  1527.     draw_actor_parameter2(@actor, 0, 40, 1)
  1528.     draw_actor_parameter2(@actor, 0, 70, 2)
  1529.     draw_actor_parameter2(@actor, 0, 100, 3)
  1530.     draw_actor_parameter2(@actor, 190, 20, 4)
  1531.     draw_actor_parameter2(@actor, 190, 50, 5)
  1532.     draw_actor_parameter2(@actor, 190, 80, 6)
  1533.     draw_actor_barz(@actor, 0, 37, "horizontal", 168, 1, @actor.atk, 500, Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255))
  1534.     draw_actor_barz(@actor, 0, 67, "horizontal", 168, 1, @actor.pdef, 500, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
  1535.     draw_actor_barz(@actor, 0, 97, "horizontal", 168, 1, @actor.mdef, 500, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
  1536.     draw_actor_barz(@actor, 0, 127, "horizontal", 168, 1, @actor.str, 500, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
  1537.     draw_actor_barz(@actor, 190, 47, "horizontal", 168, 1, @actor.dex, 500, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
  1538.     draw_actor_barz(@actor, 190, 77, "horizontal", 168, 1, @actor.agi, 500, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
  1539.     draw_actor_barz(@actor, 190, 107, "horizontal", 168, 1, @actor.int, 500, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
  1540.         if @new_atk != nil
  1541.         draw_actor_barz(@actor, 0, 37, "horizontal", 168, 1, @new_atk, 500, Color.new(255, 0, 0, 255), Color.new(255, 0, 0, 255))
  1542.       end
  1543.         if @new_pdef != nil
  1544.         draw_actor_barz(@actor, 0, 67, "horizontal", 168, 1, @new_pdef, 500, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
  1545.        end
  1546.         if @new_mdef != nil
  1547.         draw_actor_barz(@actor, 0, 97, "horizontal", 168, 1, @new_mdef, 500, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
  1548.       end
  1549.        if  @new_str != nil
  1550.        draw_actor_barz(@actor, 0, 127, "horizontal", 168, 1, @new_str, 500, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
  1551.       end
  1552.        if  @new_dex != nil
  1553.        draw_actor_barz(@actor, 190, 47, "horizontal", 168, 1, @new_dex, 500, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
  1554.       end
  1555.        if  @new_agi != nil
  1556.        draw_actor_barz(@actor, 190, 77, "horizontal", 168, 1, @new_agi, 500, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
  1557.      end
  1558.        if @new_int != nil
  1559.        draw_actor_barz(@actor, 190, 107, "horizontal", 168, 1, @new_int, 500, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
  1560.     end
  1561. end
  1562.     def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
  1563.     if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or
  1564.        @new_agi != new_agi or @new_int != new_int
  1565.       @new_atk = new_atk
  1566.       @new_pdef = new_pdef
  1567.       @new_mdef = new_mdef
  1568.       @new_str = new_str
  1569.       @new_dex = new_dex
  1570.       @new_agi = new_agi
  1571.       @new_int = new_int
  1572.       refresh
  1573.     end
  1574.   end
  1575. end
  1576. #==============================================================================
  1577. # ■ Window_Status3
  1578. #------------------------------------------------------------------------------
  1579. #  ステータス画面で表示する、フル仕様のステータスウィンドウです。
  1580. #==============================================================================

  1581. class Window_Status3 < Window_Base
  1582.   #--------------------------------------------------------------------------
  1583.   # ● オブジェクト初期化
  1584.   #     actor : アクター
  1585.   #--------------------------------------------------------------------------
  1586.   def initialize(actor)
  1587.     super(0, 0, 418, 229)
  1588.     self.contents = Bitmap.new(width - 32, height - 32)
  1589.     self.contents.font.name = $fontface
  1590.     self.contents.font.size = $fontsize
  1591.     @actor = actor
  1592.     refresh
  1593.   end
  1594.   #--------------------------------------------------------------------------
  1595.   # ● リフレッシュ
  1596.   #--------------------------------------------------------------------------
  1597.   def refresh
  1598.     self.contents.clear
  1599.     self.contents.font.size = 24
  1600.     self.contents.font.color = system_color
  1601.     self.contents.draw_text_outline3(150, 0, 96, 32, "身上装备")
  1602.     draw_item_name2($data_weapons[@actor.weapon_id], 15 + 16, 48)
  1603.     draw_item_name2($data_armors[@actor.armor1_id], 15 + 16, 86)
  1604.     draw_item_name2($data_armors[@actor.armor2_id], 15 + 16, 124)
  1605.     draw_item_name2($data_armors[@actor.armor3_id], 15 + 186, 68)
  1606.     draw_item_name2($data_armors[@actor.armor4_id], 15 + 186, 106)
  1607.       end
  1608.     end
  1609.     #==============================================================================
  1610. # ■ Window_Status4
  1611. #------------------------------------------------------------------------------
  1612. #  ステータス画面で表示する、フル仕様のステータスウィンドウです。
  1613. #==============================================================================

  1614. class Window_Status4 < Window_Base
  1615.   #--------------------------------------------------------------------------
  1616.   # ● オブジェクト初期化
  1617.   #     actor : アクター
  1618.   #--------------------------------------------------------------------------
  1619.   def initialize(actor)
  1620.     super(0, 0, 252, 100)
  1621.     self.contents = Bitmap.new(width - 32, height - 32)
  1622.     self.contents.font.name = $fontface
  1623.     self.contents.font.size = $fontsize
  1624.     @actor = actor
  1625.     refresh
  1626.   end
  1627.   #--------------------------------------------------------------------------
  1628.   # ● リフレッシュ
  1629.   #--------------------------------------------------------------------------
  1630.   def refresh
  1631.     self.contents.clear
  1632.     self.contents.font.size = 22
  1633.     self.contents.font.color = system_color
  1634.     self.contents.draw_text_outline3(10, 0, 80, 32, "经验值")
  1635.     self.contents.draw_text_outline3(10, 32, 80, 32, "下一级")
  1636.     self.contents.font.color = normal_color
  1637.     self.contents.draw_text_outline(10 + 80, 0, 84, 32, @actor.exp_s, 2)
  1638.     self.contents.draw_text_outline(10 + 80, 32, 84, 32, @actor.next_rest_exp_s, 2)
  1639.       end
  1640.     end
  1641.     #==============================================================================
  1642. # ■ Window_Status5
  1643. #------------------------------------------------------------------------------
  1644. #  ステータス画面で表示する、フル仕様のステータスウィンドウです。
  1645. #==============================================================================

  1646. class Window_Status5 < Window_Base
  1647.   #--------------------------------------------------------------------------
  1648.   # ● オブジェクト初期化
  1649.   #     actor : アクター
  1650.   #--------------------------------------------------------------------------
  1651.   def initialize(actor)
  1652.     super(0, 0, 300, 380)
  1653.     self.contents = Bitmap.new(width - 32, height - 32)
  1654.     self.contents.font.name = $fontface
  1655.     self.contents.font.size = $fontsize
  1656.     @actor = actor
  1657.     refresh
  1658.   end
  1659.   #--------------------------------------------------------------------------
  1660.   # ● リフレッシュ
  1661.   #--------------------------------------------------------------------------
  1662.   def refresh
  1663.     self.contents.clear
  1664.        draw_battlegraphic(@actor, 100, 300)
  1665.       end
  1666.     end
  1667.     #==============================================================================
  1668. # ■ Window_SaveFile
  1669. #------------------------------------------------------------------------------
  1670. #  セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。
  1671. #==============================================================================

  1672. class Window_SaveFile < Window_Base
  1673.   #--------------------------------------------------------------------------
  1674.   # ● 公開インスタンス変数
  1675.   #--------------------------------------------------------------------------
  1676.   attr_reader   :filename                 # ファイル名
  1677.   attr_reader   :selected                 # 選択状態
  1678.   #--------------------------------------------------------------------------
  1679.   # ● オブジェクト初期化
  1680.   #     file_index : セーブファイルのインデックス (0~3)
  1681.   #     filename   : ファイル名
  1682.   #--------------------------------------------------------------------------
  1683.   def initialize(file_index, filename)
  1684.     super(0, 64 + file_index % 4 * 104, 640, 104)
  1685.     self.contents = Bitmap.new(width - 32, height - 32)
  1686.     self.contents.font.name = $fontface
  1687.     self.contents.font.size = $fontsize
  1688.     self.opacity = 0
  1689.     @file_index = file_index
  1690.     @filename = "Save#{@file_index + 1}.rxdata"
  1691.     @time_stamp = Time.at(0)
  1692.     @file_exist = FileTest.exist?(@filename)
  1693.     if @file_exist
  1694.       file = File.open(@filename, "r")
  1695.       @time_stamp = file.mtime
  1696.       @characters = Marshal.load(file)
  1697.       @frame_count = Marshal.load(file)
  1698.       @game_system = Marshal.load(file)
  1699.       @game_switches = Marshal.load(file)
  1700.       @game_variables = Marshal.load(file)
  1701.       @total_sec = @frame_count / Graphics.frame_rate
  1702.       file.close
  1703.     end
  1704.     refresh
  1705.     @selected = false
  1706.   end
  1707.   #--------------------------------------------------------------------------
  1708.   # ● リフレッシュ
  1709.   #--------------------------------------------------------------------------
  1710.   def refresh
  1711.     self.contents.clear
  1712.     # ファイル番号を描画
  1713.     self.contents.font.color = normal_color
  1714.     name = "文件 #{@file_index + 1}"
  1715.     self.contents.draw_text_outline(4, 0, 600, 32, name)
  1716.     @name_width = contents.text_size(name).width
  1717.     # セーブファイルが存在する場合
  1718.     if @file_exist
  1719.       # キャラクターを描画
  1720.       for i in [email protected]
  1721.         bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
  1722.         cw = bitmap.rect.width / 4
  1723.         ch = bitmap.rect.height / 4
  1724.         src_rect = Rect.new(0, 0, cw, ch)
  1725.         x = 300 - @characters.size * 32 + i * 64 - cw / 2
  1726.         self.contents.blt(x, 68 - ch, bitmap, src_rect)
  1727.       end
  1728.       # プレイ時間を描画
  1729.       hour = @total_sec / 60 / 60
  1730.       min = @total_sec / 60 % 60
  1731.       sec = @total_sec % 60
  1732.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  1733.       self.contents.font.color = normal_color
  1734.       self.contents.draw_text_outline(4, 8, 600, 32, time_string, 2)
  1735.       # タイムスタンプを描画
  1736.       self.contents.font.color = normal_color
  1737.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  1738.       self.contents.draw_text_outline(4, 40, 600, 32, time_string, 2)
  1739.     end
  1740.   end
  1741.   #--------------------------------------------------------------------------
  1742.   # ● 選択状態の設定
  1743.   #     selected : 新しい選択状態 (true=選択 false=非選択)
  1744.   #--------------------------------------------------------------------------
  1745.   def selected=(selected)
  1746.     @selected = selected
  1747.     update_cursor_rect
  1748.   end
  1749.   #--------------------------------------------------------------------------
  1750.   # ● カーソルの矩形更新
  1751.   #--------------------------------------------------------------------------
  1752.   def update_cursor_rect
  1753.     if @selected
  1754.       self.cursor_rect.set(0, 0, @name_width + 8, 32)
  1755.     else
  1756.       self.cursor_rect.empty
  1757.     end
  1758.   end
  1759. end
  1760. #==============================================================================
  1761. # ■ Window_Location
  1762. #------------------------------------------------------------------------------
  1763. #  メニュー画面で歩数を表示するウィンドウです。
  1764. class Game_Map

  1765. def name
  1766. $map_infos[@map_id]
  1767. end
  1768. end

  1769. class Scene_Title
  1770. $map_infos = load_data("Data/MapInfos.rxdata")
  1771. for key in $map_infos.keys
  1772. $map_infos[key] = $map_infos[key].name
  1773. end
  1774. end


  1775. #==============================================================================
  1776. # ■ Window_Mapname
  1777. #------------------------------------------------------------------------------
  1778. #  メニュー画面でプレイ時間を表示するウィンドウです。
  1779. #==============================================================================

  1780. class Window_Mapname < Window_Base
  1781. #--------------------------------------------------------------------------
  1782. # ● オブジェクト初期化
  1783. #--------------------------------------------------------------------------
  1784. def initialize
  1785. super(0, 0, 240, 96)
  1786. self.contents = Bitmap.new(width - 52, height - 32)
  1787. self.contents.font.name = $fontface
  1788. self.contents.font.size = $fontsize
  1789. self.opacity = 0
  1790. refresh
  1791. end
  1792. #--------------------------------------------------------------------------
  1793. # ● リフレッシュ
  1794. #--------------------------------------------------------------------------
  1795. def refresh
  1796. self.contents.clear
  1797. # Map Name
  1798. #map = $game_map.name
  1799. self.contents.font.color = system_color
  1800. self.contents.font.size = 14
  1801. self.contents.draw_text(4, 0, 220, 32, "现在的位置")
  1802.   self.contents.font.size = $fontsize
  1803. self.contents.font.color = normal_color
  1804. self.contents.draw_text(110, 15, 80, 32, $game_map.name)
  1805. end
  1806. end
  1807. #==================================================
  1808. class Window_End < Window_Base

  1809. def initialize
  1810. super(0, 0, 240, 150)
  1811. self.contents = Bitmap.new(width - 52, height - 32)
  1812. self.contents.font.name = $fontface
  1813. self.contents.font.size = 30
  1814. self.opacity = 0
  1815. refresh
  1816. end
  1817. #--------------------------------------------------------------------------
  1818. # ● リフレッシュ
  1819. #--------------------------------------------------------------------------
  1820. def refresh
  1821.   self.contents.clear
  1822.   self.contents.draw_text_outline(24, 0, 240, 32, "返回标题")
  1823.   self.contents.draw_text_outline(10, 45, 240, 32, " 结束游戏")
  1824.   self.contents.draw_text_outline(25, 85, 240, 32, "取消")
  1825. end
  1826. #==========================================
  1827. end
  1828. #==============================================================================
  1829. # ■ Scene_Menu
  1830. #------------------------------------------------------------------------------
  1831. #  メニュー画面の処理を行うクラスです。
  1832. #==============================================================================

  1833. class Scene_Menu
  1834.   #--------------------------------------------------------------------------
  1835.   # ● オブジェクト初期化
  1836.   #     menu_index : コマンドのカーソル初期位置
  1837.   #--------------------------------------------------------------------------
  1838.   def initialize(menu_index = 0)
  1839.     @menu_index = menu_index
  1840.   end
  1841.   #--------------------------------------------------------------------------
  1842.   # ● メイン処理
  1843.   #--------------------------------------------------------------------------
  1844.   def main
  1845.     #========================================
  1846.     # This is setting up the background picture
  1847.     @background = Sprite.new
  1848.     @background.bitmap = RPG::Cache.picture("background")
  1849.     @background.x = 0
  1850.     @background.y = 0
  1851.     #========================================
  1852.     # This is setting up the command pictures for 'item' etc..
  1853.     @command1 = Sprite.new
  1854.     @command1.bitmap = RPG::Cache.picture("cmscommand1")
  1855.     @command1.x = 15
  1856.     @command1.y = 40
  1857.     @command1.z = 100
  1858.     #========================================
  1859.     @command2 = Sprite.new
  1860.     @command2.bitmap = RPG::Cache.picture("cmscommand2")
  1861.     @command2.x = 15
  1862.     @command2.y = 40
  1863.     @command2.z = 100
  1864.     #========================================
  1865.     @command3 = Sprite.new
  1866.     @command3.bitmap = RPG::Cache.picture("cmscommand3")
  1867.     @command3.x = 15
  1868.     @command3.y = 40
  1869.     @command3.z = 100
  1870.     #========================================
  1871.     @command4 = Sprite.new
  1872.     @command4.bitmap = RPG::Cache.picture("cmscommand4")
  1873.     @command4.x = 15
  1874.     @command4.y = 40
  1875.     @command4.z = 100
  1876.     #========================================
  1877.     @command5 = Sprite.new
  1878.     @command5.bitmap = RPG::Cache.picture("cmscommand5")
  1879.     @command5.x = 15
  1880.     @command5.y = 40
  1881.     @command5.z = 100
  1882.     #========================================
  1883.     @command6 = Sprite.new
  1884.     @command6.bitmap = RPG::Cache.picture("cmscommand6")
  1885.     @command6.x = 15
  1886.     @command6.y = 40
  1887.     @command6.z = 100
  1888.     #========================================
  1889.     # This setting up the shadows for the commands.
  1890.     @commands1 = Sprite.new
  1891.     @commands1.bitmap = RPG::Cache.picture("cmscommandshadow")
  1892.     @commands1.x = 20
  1893.     @commands1.y = 45
  1894.     @commands1.z = 1
  1895.     @commands1.opacity = 155
  1896.     @commands1.visible = false
  1897.     #========================================
  1898.     @commands2 = Sprite.new
  1899.     @commands2.bitmap = RPG::Cache.picture("cmscommandshadow")
  1900.     @commands2.x = 20
  1901.     @commands2.y = 45
  1902.     @commands2.z = 1
  1903.     @commands2.opacity = 155
  1904.     @commands2.visible = false
  1905.     #========================================
  1906.     @commands3 = Sprite.new
  1907.     @commands3.bitmap = RPG::Cache.picture("cmscommandshadow")
  1908.     @commands3.x = 20
  1909.     @commands3.y = 45
  1910.     @commands3.z = 1
  1911.     @commands3.opacity = 155
  1912.     @commands3.visible = false
  1913.     #========================================
  1914.     @commands4 = Sprite.new
  1915.     @commands4.bitmap = RPG::Cache.picture("cmscommandshadow")
  1916.     @commands4.x = 20
  1917.     @commands4.y = 45
  1918.     @commands4.z = 1
  1919.     @commands4.opacity = 155
  1920.     @commands4.visible = false
  1921.     #========================================
  1922.     @commands5 = Sprite.new
  1923.     @commands5.bitmap = RPG::Cache.picture("cmscommandshadow")
  1924.     @commands5.x = 20
  1925.     @commands5.y = 45
  1926.     @commands5.z = 1
  1927.     @commands5.opacity = 155
  1928.     @commands5.visible = false
  1929.     #========================================
  1930.     @commands6 = Sprite.new
  1931.     @commands6.bitmap = RPG::Cache.picture("cmscommandshadow")
  1932.     @commands6.x = 20
  1933.     @commands6.y = 45
  1934.     @commands6.z = 1
  1935.     @commands6.opacity = 155
  1936.     @commands6.visible = false
  1937.     #========================================
  1938.     # This is setting up the arrow cursor used in the command window..
  1939.     @arrow = Sprite.new
  1940.     @arrow.bitmap = RPG::Cache.picture("arrow4")
  1941.     @arrow.x = 18
  1942.     @arrow.y = 50
  1943.     @arrow.z = 1000
  1944.     #========================================
  1945.     # This is setting up the arrow for the status window
  1946.     @arrow_status = Sprite.new
  1947.     @arrow_status.bitmap = RPG::Cache.picture("arrow4")
  1948.     @arrow_status.x = 300
  1949.     @arrow_status.y = 30
  1950.     @arrow_status.z = 1000
  1951.     @arrow_status.visible = false
  1952.     #========================================
  1953.     # This is setting up the status windows, making them not visible for the moment..
  1954.     @status_window1 = Sprite.new
  1955.     @status_window1.bitmap = RPG::Cache.picture("status window 1")
  1956.     @status_window1.x = 690
  1957.     @status_window1.y = 5
  1958.     @status_window1.z = 100
  1959.     @status_window1.visible = false
  1960.     #========================================
  1961.     @status_window2 = Sprite.new
  1962.     @status_window2.bitmap = RPG::Cache.picture("status window 2")
  1963.     @status_window2.x = 676
  1964.     @status_window2.y = 106
  1965.     @status_window2.z = 100
  1966.     @status_window2.visible = false
  1967.     #========================================
  1968.     @status_window3 = Sprite.new
  1969.     @status_window3.bitmap = RPG::Cache.picture("status window 3")
  1970.     @status_window3.x = 659
  1971.     @status_window3.y = 206
  1972.     @status_window3.z = 100
  1973.     @status_window3.visible = false
  1974.     #========================================
  1975.     @status_window4 = Sprite.new
  1976.     @status_window4.bitmap = RPG::Cache.picture("status window 4")
  1977.     @status_window4.x = 640
  1978.     @status_window4.y = 306
  1979.     @status_window4.z = 100
  1980.     @status_window4.visible = false
  1981.     #========================================
  1982.     # The shadows are set up for the status windows..
  1983.     @status_windowshadow1 = Sprite.new
  1984.     @status_windowshadow1.bitmap = RPG::Cache.picture("blackwindow2")
  1985.     @status_windowshadow1.x = 697
  1986.     @status_windowshadow1.y = 13
  1987.     @status_windowshadow1.z = 1
  1988.     @status_windowshadow1.opacity = 155
  1989.     @status_windowshadow1.visible = false
  1990.     #========================================
  1991.     @status_windowshadow2 = Sprite.new
  1992.     @status_windowshadow2.bitmap = RPG::Cache.picture("blackwindow2")
  1993.     @status_windowshadow2.x = 681
  1994.     @status_windowshadow2.y = 112
  1995.     @status_windowshadow2.z = 1
  1996.     @status_windowshadow2.opacity = 155
  1997.     @status_windowshadow2.visible = false
  1998.     #========================================
  1999.     @status_windowshadow3 = Sprite.new
  2000.     @status_windowshadow3.bitmap = RPG::Cache.picture("blackwindow2")
  2001.     @status_windowshadow3.x = 664
  2002.     @status_windowshadow3.y = 212
  2003.     @status_windowshadow3.z = 1
  2004.     @status_windowshadow3.opacity = 155
  2005.     @status_windowshadow3.visible = false
  2006.     #========================================
  2007.     @status_windowshadow4 = Sprite.new
  2008.     @status_windowshadow4.bitmap = RPG::Cache.picture("blackwindow2")
  2009.     @status_windowshadow4.x = 645
  2010.     @status_windowshadow4.y = 312
  2011.     @status_windowshadow4.z = 1
  2012.     @status_windowshadow4.opacity = 155
  2013.     @status_windowshadow4.visible = false
  2014.     #========================================
  2015.     # Here, certain status window pictures are made visible depending on
  2016.     # how many actors or players there are..
  2017.     if $game_party.actors.size == 1
  2018.       @status_window1.visible = true
  2019.       @status_windowshadow1.visible = true
  2020.     end
  2021.      if $game_party.actors.size == 2
  2022.        @status_window1.visible = true
  2023.        @status_windowshadow1.visible = true
  2024.        @status_window2.visible = true
  2025.        @status_windowshadow2.visible = true
  2026.      end
  2027.      if $game_party.actors.size == 3
  2028.        @status_window1.visible = true
  2029.        @status_windowshadow1.visible = true
  2030.        @status_window2.visible = true
  2031.        @status_windowshadow2.visible = true
  2032.        @status_window3.visible = true
  2033.        @status_windowshadow3.visible = true
  2034.      end
  2035.       if $game_party.actors.size == 4
  2036.        @status_window1.visible = true
  2037.        @status_windowshadow1.visible = true
  2038.        @status_window2.visible = true
  2039.        @status_windowshadow2.visible = true
  2040.        @status_window3.visible = true
  2041.        @status_windowshadow3.visible = true
  2042.        @status_window4.visible = true
  2043.        @status_windowshadow4.visible = true
  2044.      end
  2045.      #===========================================
  2046.      # The window displaying the gold, and playtime is set up...
  2047.      @playtimegoldpicture = Sprite.new
  2048.      @playtimegoldpicture.bitmap = RPG::Cache.picture("goldplaytimewindow")
  2049.      @playtimegoldpicture.x = 646
  2050.      @playtimegoldpicture.y = 404
  2051.      @playtimegoldpicture.z = 100
  2052.      #============================================
  2053.      # And its shadow
  2054.      @playtimegoldshadow = Sprite.new
  2055.      @playtimegoldshadow.bitmap = RPG::Cache.picture("goldplaytimeshadow")
  2056.      @playtimegoldshadow.x = 651
  2057.      @playtimegoldshadow.y = 409
  2058.      @playtimegoldshadow.z = 1
  2059.      @playtimegoldshadow.opacity = 155
  2060.      #============================================
  2061.      # Setting up the location window's bar....
  2062.      @location_bar = Sprite.new
  2063.      @location_bar.bitmap = RPG::Cache.picture("locationbar")
  2064.      @location_bar.x = 15
  2065.      @location_bar.y = 635
  2066.      #============================================
  2067.      # Setting up the actual window for the map, opacity - 0
  2068.      @location_window = Window_Mapname.new
  2069.      @location_window.x = 0
  2070.      @location_window.y = 609
  2071.      #============================================
  2072.      # Setting up a white bar below the location
  2073.      @location_white = Sprite.new
  2074.      @location_white.bitmap = RPG::Cache.picture("locationwhite")
  2075.      @location_white.x = - 8
  2076.      @location_white.y = 622
  2077.      @location_white.z = 120
  2078.      #============================================
  2079.      @playtime_window = Window_PlayTime.new
  2080.      @playtime_window.x = 645
  2081.      @playtime_window.y = 390
  2082.     # コマンドウィンドウを作成
  2083.     # Command window, opacity - 0 so it is invisible, and commands are set to ""
  2084.     # - nothing so no text shows, as there is pictures used instead..
  2085.     s1 = ""
  2086.     s2 = ""
  2087.     s3 = ""
  2088.     s4 = ""
  2089.     s5 = ""
  2090.     s6 = ""
  2091.     @command_window = Window_Menucommand.new(200, [s1, s2, s3, s4, s5, s6])
  2092.     @command_window.opacity = 0
  2093.     @command_window.index = @menu_index
  2094.     # パーティ人数が 0 人の場合
  2095.     if $game_party.actors.size == 0
  2096.       # アイテム、スキル、装備、ステータスを無効化
  2097.       @command_window.disable_item(0)
  2098.       @command_window.disable_item(1)
  2099.       @command_window.disable_item(2)
  2100.       @command_window.disable_item(3)
  2101.     end
  2102.     # セーブ禁止の場合
  2103.     if $game_system.save_disabled
  2104.       # セーブを無効にする
  2105.       @command_window.disable_item(4)
  2106.     end
  2107.     # ゴールドウィンドウを作成
  2108.     @gold_window = Window_Gold.new
  2109.     @gold_window.x = 645
  2110.     @gold_window.y = 415
  2111.     @gold_window.opacity = 0
  2112.     # ステータスウィンドウを作成
  2113.     @status_window = Window_MenuStatus.new
  2114.     @status_window.x = 630
  2115.     @status_window.y = - 6
  2116.     @status_window.opacity = 0
  2117.     @status_window.visible = true
  2118.     # トランジション実行
  2119.     Graphics.transition
  2120.     # メインループ
  2121.     loop do
  2122.       # ゲーム画面を更新
  2123.       Graphics.update
  2124.       # 入力情報を更新
  2125.       Input.update
  2126.       # フレーム更新
  2127.       update
  2128.       # 画面が切り替わったらループを中断
  2129.       if $scene != self
  2130.         break
  2131.       end
  2132.     end
  2133.     # トランジション準備
  2134.     Graphics.freeze
  2135.     # ウィンドウを解放
  2136.     @command_window.dispose
  2137.     @gold_window.dispose
  2138.     @status_window.dispose
  2139.     @background.dispose
  2140.     @command1.dispose
  2141.     @command2.dispose
  2142.     @command3.dispose
  2143.     @command4.dispose
  2144.     @command5.dispose
  2145.     @command6.dispose
  2146.     @commands1.dispose
  2147.     @commands2.dispose
  2148.     @commands3.dispose
  2149.     @commands4.dispose
  2150.     @commands5.dispose
  2151.     @commands6.dispose
  2152.     @arrow.dispose
  2153.     @status_window1.dispose
  2154.     @status_window2.dispose
  2155.     @status_window3.dispose
  2156.     @status_window4.dispose
  2157.     @status_windowshadow1.dispose
  2158.     @status_windowshadow2.dispose
  2159.     @status_windowshadow3.dispose
  2160.     @status_windowshadow4.dispose
  2161.     @playtimegoldpicture.dispose
  2162.     @playtimegoldshadow.dispose
  2163.     @location_bar.dispose
  2164.     @location_window.dispose
  2165.     @location_white.dispose
  2166.     @playtime_window.dispose
  2167.     @arrow_status.dispose
  2168.   end
  2169.   #--------------------------------------------------------------------------
  2170.   def delay(seconds)
  2171.   for i in 0...(seconds * 1)
  2172.     sleep 0.01
  2173.     Graphics.update
  2174.   end
  2175. end
  2176.   # ● フレーム更新
  2177.   #--------------------------------------------------------------------------
  2178.   def update
  2179.     if @command2.y < 100
  2180.       @command2.y += 20
  2181.     end
  2182.     if @command3.y < 160
  2183.       @command3.y += 20
  2184.     end
  2185.     if @command4.y < 220
  2186.       @command4.y += 20
  2187.     end
  2188.     if @command5.y < 280
  2189.       @command5.y += 20
  2190.     end
  2191.     if @command6.y < 340
  2192.       @command6.y += 20
  2193.     end
  2194.     if @command6.y >= 340
  2195.      @commands1.visible = true
  2196.      @commands2.visible = true
  2197.      @commands3.visible = true
  2198.      @commands4.visible = true
  2199.      @commands5.visible = true
  2200.      @commands6.visible = true
  2201.      end
  2202.     if @status_window1.x > 293
  2203.      @status_window1.x -= 50
  2204.     end
  2205.     if @status_window2.x > 276
  2206.      @status_window2.x -= 50
  2207.     end
  2208.     if @status_window3.x > 259
  2209.      @status_window3.x -= 50
  2210.     end
  2211.     if @status_window4.x > 240
  2212.      @status_window4.x -= 50
  2213.     end
  2214.     if @status_windowshadow1.x > 297
  2215.       @status_windowshadow1.x -= 50
  2216.     end
  2217.     if @status_windowshadow2.x > 281
  2218.       @status_windowshadow2.x -= 50
  2219.     end
  2220.     if @status_windowshadow3.x > 264
  2221.       @status_windowshadow3.x -= 50
  2222.     end
  2223.     if @status_windowshadow4.x > 245
  2224.       @status_windowshadow4.x -= 50
  2225.     end
  2226.     if @status_window.x > 230
  2227.       @status_window.x -= 50
  2228.       end
  2229.     if @playtimegoldpicture.x > 446
  2230.      @playtimegoldpicture.x -= 25
  2231.     end
  2232.     if @playtimegoldshadow.x > 451
  2233.      @playtimegoldshadow.x -= 25
  2234.    end
  2235.    if @playtime_window.x > 445
  2236.      @playtime_window.x -= 25
  2237.    end
  2238.    if @gold_window.x > 445
  2239.      @gold_window.x -= 25
  2240.    end
  2241.    if @location_bar.y > 435
  2242.      @location_bar.y -= 25
  2243.    end
  2244.    if @location_window.y > 409
  2245.      @location_window.y -= 25
  2246.    end
  2247.    if @location_white.y > 422
  2248.      @location_white.y -= 25
  2249.      end
  2250.      # ウィンドウを更新
  2251.     @command_window.update
  2252.     @playtime_window.update
  2253.     @gold_window.update
  2254.     @status_window.update
  2255.     @arrow.update
  2256.     @playtime_window.update
  2257.     # コマンドウィンドウがアクティブの場合: update_command を呼ぶ
  2258.     if @command_window.active
  2259.       update_command
  2260.       return
  2261.     end
  2262.     # ステータスウィンドウがアクティブの場合: update_status を呼ぶ
  2263.     if @status_window.active
  2264.       update_status
  2265.       return
  2266.     end
  2267.   end
  2268.   #--------------------------------------------------------------------------
  2269.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  2270.   #--------------------------------------------------------------------------
  2271.   def update_command
  2272.      case @command_window.index
  2273.     when 0
  2274.       @arrow.y = 45
  2275.       @commands1.y = 45
  2276.       @commands2.y = 105
  2277.       @commands3.y = 165
  2278.       @commands4.y = 225
  2279.       @commands5.y = 285
  2280.       @commands6.y = 345
  2281.       @status_windowshadow1.y = 13
  2282.       @status_windowshadow2.y = 112
  2283.       @status_windowshadow3.y = 212
  2284.       @status_windowshadow4.y = 312
  2285.       @playtimegoldshadow.y = 409
  2286.     when 1
  2287.       @arrow.y = 105
  2288.       @commands1.y = 42
  2289.       @commands2.y = 100
  2290.       @commands3.y = 162
  2291.       @commands4.y = 222
  2292.       @commands5.y = 282
  2293.       @commands6.y = 342
  2294.       @status_windowshadow1.y = 11
  2295.       @status_windowshadow2.y = 110
  2296.       @status_windowshadow3.y = 210
  2297.       @status_windowshadow4.y = 310
  2298.       @playtimegoldshadow.y = 406
  2299.     when 2
  2300.       @arrow.y = 165
  2301.       @commands1.y = 39
  2302.       @commands2.y = 97
  2303.       @commands3.y = 159
  2304.       @commands4.y = 219
  2305.       @commands5.y = 279
  2306.       @commands6.y = 339
  2307.       @status_windowshadow1.y = 8
  2308.       @status_windowshadow2.y = 107
  2309.       @status_windowshadow3.y = 207
  2310.       @status_windowshadow4.y = 307
  2311.       @playtimegoldshadow.y = 403
  2312.     when 3
  2313.       @arrow.y = 225
  2314.       @commands1.y = 36
  2315.       @commands2.y = 94
  2316.       @commands3.y = 156
  2317.       @commands4.y = 216
  2318.       @commands5.y = 276
  2319.       @commands6.y = 336
  2320.       @status_windowshadow1.y = 5
  2321.       @status_windowshadow2.y = 104
  2322.       @status_windowshadow3.y = 204
  2323.       @status_windowshadow4.y = 304
  2324.       @playtimegoldshadow.y = 400
  2325.     when 4
  2326.       @arrow.y = 285
  2327.       @commands1.y = 33
  2328.       @commands2.y = 91
  2329.       @commands3.y = 153
  2330.       @commands4.y = 213
  2331.       @commands5.y = 273
  2332.       @commands6.y = 333
  2333.       @status_windowshadow1.y = 2
  2334.       @status_windowshadow2.y = 101
  2335.       @status_windowshadow3.y = 201
  2336.       @status_windowshadow4.y = 301
  2337.       @playtimegoldshadow.y = 397
  2338.     when 5
  2339.       @arrow.y = 345
  2340.       @commands1.y = 30
  2341.       @commands2.y = 88
  2342.       @commands3.y = 150
  2343.       @commands4.y = 210
  2344.       @commands5.y = 270
  2345.       @commands6.y = 330
  2346.       @status_windowshadow1.y = - 1
  2347.       @status_windowshadow2.y = 99
  2348.       @status_windowshadow3.y = 199
  2349.       @status_windowshadow4.y = 299
  2350.       @playtimegoldshadow.y = 394
  2351.     end
  2352.     #======================
  2353.   # B ボタンが押された場合
  2354.     if Input.trigger?(Input::B)
  2355.       # キャンセル SE を演奏
  2356.       @arrow.visible = false
  2357.       loop do
  2358.      if @command1.x > - 200
  2359.        @command1.x -= 40
  2360.        end
  2361.        if @command2.x > - 200
  2362.       @command2.x -= 40
  2363.     end
  2364.     if @command3.x > - 200
  2365.       @command3.x -= 40
  2366.     end
  2367.     if @command4.x > - 200
  2368.       @command4.x -= 40
  2369.     end
  2370.     if @command5.x > - 200
  2371.       @command5.x -= 40
  2372.     end
  2373.     if @command6.x > - 200
  2374.       @command6.x -= 40
  2375.     end
  2376.      @commands1.visible = false
  2377.      @commands2.visible = false
  2378.      @commands3.visible = false
  2379.      @commands4.visible = false
  2380.      @commands5.visible = false
  2381.      @commands6.visible = false
  2382.     if @status_window1.x < 640
  2383.      @status_window1.x += 50
  2384.     end
  2385.     if @status_window2.x < 640
  2386.      @status_window2.x += 50
  2387.     end
  2388.     if @status_window3.x < 640
  2389.      @status_window3.x += 50
  2390.     end
  2391.     if @status_window4.x < 640
  2392.      @status_window4.x += 50
  2393.     end
  2394.     if @status_windowshadow1.x < 640
  2395.       @status_windowshadow1.x += 50
  2396.     end
  2397.     if @status_windowshadow2.x < 640
  2398.       @status_windowshadow2.x += 50
  2399.     end
  2400.     if @status_windowshadow3.x < 640
  2401.       @status_windowshadow3.x += 50
  2402.     end
  2403.     if @status_windowshadow4.x < 640
  2404.       @status_windowshadow4.x += 50
  2405.     end
  2406.     if @status_window.x < 640
  2407.       @status_window.x += 50
  2408.       end
  2409.     if @playtimegoldpicture.x < 640
  2410.      @playtimegoldpicture.x += 25
  2411.     end
  2412.     if @playtimegoldshadow.x < 640
  2413.      @playtimegoldshadow.x += 25
  2414.    end
  2415.    if @playtime_window.x < 640
  2416.      @playtime_window.x += 25
  2417.    end
  2418.    if @gold_window.x < 640
  2419.      @gold_window.x += 25
  2420.    end
  2421.    if @location_bar.y < 480
  2422.      @location_bar.y += 25
  2423.    end
  2424.    if @location_window.y < 480
  2425.      @location_window.y += 25
  2426.    end
  2427.    if @location_white.y < 480
  2428.      @location_white.y += 25
  2429.    end
  2430.    delay(0.1)
  2431.    if @status_window.x >= 640
  2432.      break
  2433.    end
  2434.    end
  2435.       $game_system.se_play($data_system.cancel_se)
  2436.       # マップ画面に切り替え
  2437.       $scene = Scene_Map.new
  2438.       return
  2439.     end
  2440.     # C ボタンが押された場合
  2441.     if Input.trigger?(Input::C)
  2442.       # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合
  2443.       if $game_party.actors.size == 0 and @command_window.index < 4
  2444.         # ブザー SE を演奏
  2445.         $game_system.se_play($data_system.buzzer_se)
  2446.         return
  2447.       end
  2448.       # コマンドウィンドウのカーソル位置で分岐
  2449.       case @command_window.index
  2450.       when 0  # アイテム
  2451.         @command1.z = 999
  2452.         loop do
  2453.         if @status_window.x < 640
  2454.           @status_window.x += 50
  2455.           end
  2456.         if @status_window1.x < 640
  2457.           @status_window1.x += 50
  2458.         end
  2459.         if @status_window2.x < 640
  2460.           @status_window2.x += 50
  2461.         end
  2462.         if @status_window3.x < 640
  2463.           @status_window3.x += 50
  2464.         end
  2465.         if @status_window4.x < 640
  2466.           @status_window4.x += 50
  2467.         end
  2468.         if @status_windowshadow1.x < 640
  2469.           @status_windowshadow1.x += 50
  2470.         end
  2471.         if @status_windowshadow2.x < 640
  2472.           @status_windowshadow2.x += 50
  2473.         end
  2474.         if @status_windowshadow3.x < 640
  2475.           @status_windowshadow3.x += 50
  2476.         end
  2477.         if @status_windowshadow4.x < 640
  2478.           @status_windowshadow4.x += 50
  2479.         end
  2480.         if @playtimegoldpicture.x < 640
  2481.           @playtimegoldpicture.x += 50
  2482.         end
  2483.         if @playtimegoldshadow.x < 640
  2484.           @playtimegoldshadow.x += 50
  2485.         end
  2486.         if @gold_window.x < 640
  2487.           @gold_window.x += 50
  2488.         end
  2489.         if @playtime_window.x < 640
  2490.           @playtime_window.x += 50
  2491.         end
  2492.         if @command2.y > 40
  2493.           @command2.y -= 30
  2494.         end
  2495.         if @command3.y > 40
  2496.           @command3.y -= 30
  2497.         end
  2498.         if @command4.y > 40
  2499.           @command4.y -= 30
  2500.         end
  2501.         if @command5.y > 40
  2502.           @command5.y -= 30
  2503.         end
  2504.         if @command6.y > 40
  2505.           @command6.y -= 30
  2506.         end
  2507.         @commands2.visible = false
  2508.         @commands3.visible = false
  2509.         @commands4.visible = false
  2510.         @commands5.visible = false
  2511.         @commands6.visible = false
  2512.         @arrow.visible = false
  2513.         if @location_bar.y < 480
  2514.           @location_bar.y += 30
  2515.         end
  2516.         if @location_white.y < 480
  2517.           @location_white.y += 30
  2518.         end
  2519.         if @location_window.y < 480
  2520.           @location_window.y += 30
  2521.         end
  2522.         delay(0.1)
  2523.         if @command6.y <= 40
  2524.         break
  2525.       end
  2526.       end
  2527.         # 決定  SE を演奏
  2528.         $game_system.se_play($data_system.decision_se)
  2529.         # アイテム画面に切り替え
  2530.         $scene = Scene_Item.new
  2531.       when 1  # スキル
  2532.         # 決定 SE を演奏
  2533.         $game_system.se_play($data_system.decision_se)
  2534.         # ステータスウィンドウをアクティブにする
  2535.         @command_window.active = false
  2536.         @status_window.active = true
  2537.         @status_window.index = 0
  2538.         @arrow_status.visible = true
  2539.       when 2  # 装備
  2540.         # 決定 SE を演奏
  2541.         $game_system.se_play($data_system.decision_se)
  2542.         # ステータスウィンドウをアクティブにする
  2543.         @command_window.active = false
  2544.         @status_window.active = true
  2545.         @status_window.index = 0
  2546.         @arrow_status.visible = true
  2547.       when 3  # ステータス
  2548.         # 決定 SE を演奏
  2549.         $game_system.se_play($data_system.decision_se)
  2550.         # ステータスウィンドウをアクティブにする
  2551.         @command_window.active = false
  2552.         @status_window.active = true
  2553.         @status_window.index = 0
  2554.         @arrow_status.visible = true
  2555.       when 4  # セーブ
  2556.         # セーブ禁止の場合
  2557.         if $game_system.save_disabled
  2558.           # ブザー SE を演奏
  2559.           $game_system.se_play($data_system.buzzer_se)
  2560.           return
  2561.         end
  2562.         #=====================
  2563.                 @command5.z = 999
  2564.         loop do
  2565.         if @status_window.x < 640
  2566.           @status_window.x += 50
  2567.           end
  2568.         if @status_window1.x < 640
  2569.           @status_window1.x += 50
  2570.         end
  2571.         if @status_window2.x < 640
  2572.           @status_window2.x += 50
  2573.         end
  2574.         if @status_window3.x < 640
  2575.           @status_window3.x += 50
  2576.         end
  2577.         if @status_window4.x < 640
  2578.           @status_window4.x += 50
  2579.         end
  2580.         if @status_windowshadow1.x < 640
  2581.           @status_windowshadow1.x += 50
  2582.         end
  2583.         if @status_windowshadow2.x < 640
  2584.           @status_windowshadow2.x += 50
  2585.         end
  2586.         if @status_windowshadow3.x < 640
  2587.           @status_windowshadow3.x += 50
  2588.         end
  2589.         if @status_windowshadow4.x < 640
  2590.           @status_windowshadow4.x += 50
  2591.         end
  2592.         if @playtimegoldpicture.x < 640
  2593.           @playtimegoldpicture.x += 50
  2594.         end
  2595.         if @playtimegoldshadow.x < 640
  2596.           @playtimegoldshadow.x += 50
  2597.         end
  2598.         if @gold_window.x < 640
  2599.           @gold_window.x += 50
  2600.         end
  2601.         if @playtime_window.x < 640
  2602.           @playtime_window.x += 50
  2603.         end
  2604.         if @command2.y > 40
  2605.           @command2.y -= 30
  2606.         end
  2607.         if @command3.y > 40
  2608.           @command3.y -= 30
  2609.         end
  2610.         if @command4.y > 40
  2611.           @command4.y -= 30
  2612.         end
  2613.         if @command5.y > 40
  2614.           @command5.y -= 30
  2615.         end
  2616.         if @command6.y > 40
  2617.           @command6.y -= 30
  2618.         end
  2619.         @commands2.visible = false
  2620.         @commands3.visible = false
  2621.         @commands4.visible = false
  2622.         @commands5.visible = false
  2623.         @commands6.visible = false
  2624.          @arrow.visible = false
  2625.         if @location_bar.y < 480
  2626.           @location_bar.y += 30
  2627.         end
  2628.         if @location_white.y < 480
  2629.           @location_white.y += 30
  2630.         end
  2631.         if @location_window.y < 480
  2632.           @location_window.y += 30
  2633.         end
  2634.         delay(0.1)
  2635.         if @command6.y <= 40
  2636.         break
  2637.       end
  2638.       end
  2639.         # 決定 SE を演奏
  2640.         $game_system.se_play($data_system.decision_se)
  2641.         # セーブ画面に切り替え
  2642.         $scene = Scene_Save.new
  2643.       when 5  # ゲーム終了
  2644.                 @command6.z = 999
  2645.         loop do
  2646.         if @status_window.x < 640
  2647.           @status_window.x += 50
  2648.           end
  2649.         if @status_window1.x < 640
  2650.           @status_window1.x += 50
  2651.         end
  2652.         if @status_window2.x < 640
  2653.           @status_window2.x += 50
  2654.         end
  2655.         if @status_window3.x < 640
  2656.           @status_window3.x += 50
  2657.         end
  2658.         if @status_window4.x < 640
  2659.           @status_window4.x += 50
  2660.         end
  2661.         if @status_windowshadow1.x < 640
  2662.           @status_windowshadow1.x += 50
  2663.         end
  2664.         if @status_windowshadow2.x < 640
  2665.           @status_windowshadow2.x += 50
  2666.         end
  2667.         if @status_windowshadow3.x < 640
  2668.           @status_windowshadow3.x += 50
  2669.         end
  2670.         if @status_windowshadow4.x < 640
  2671.           @status_windowshadow4.x += 50
  2672.         end
  2673.         if @playtimegoldpicture.x < 640
  2674.           @playtimegoldpicture.x += 50
  2675.         end
  2676.         if @playtimegoldshadow.x < 640
  2677.           @playtimegoldshadow.x += 50
  2678.         end
  2679.         if @gold_window.x < 640
  2680.           @gold_window.x += 50
  2681.         end
  2682.         if @playtime_window.x < 640
  2683.           @playtime_window.x += 50
  2684.         end
  2685.         if @command2.y > 40
  2686.           @command2.y -= 30
  2687.         end
  2688.         if @command3.y > 40
  2689.           @command3.y -= 30
  2690.         end
  2691.         if @command4.y > 40
  2692.           @command4.y -= 30
  2693.         end
  2694.         if @command5.y > 40
  2695.           @command5.y -= 30
  2696.         end
  2697.         if @command6.y > 40
  2698.           @command6.y -= 30
  2699.         end
  2700.         @commands2.visible = false
  2701.         @commands3.visible = false
  2702.         @commands4.visible = false
  2703.         @commands5.visible = false
  2704.         @commands6.visible = false
  2705.         @arrow.visible = false
  2706.         if @location_bar.y < 480
  2707.           @location_bar.y += 30
  2708.         end
  2709.         if @location_white.y < 480
  2710.           @location_white.y += 30
  2711.         end
  2712.         if @location_window.y < 480
  2713.           @location_window.y += 30
  2714.         end
  2715.         delay(0.1)
  2716.         if @command6.y <= 40
  2717.         break
  2718.       end
  2719.       end
  2720.         # 決定 SE を演奏
  2721.         $game_system.se_play($data_system.decision_se)
  2722.         # ゲーム終了画面に切り替え
  2723.         $scene = Scene_End.new
  2724.       end
  2725.       return
  2726.     end
  2727.   end
  2728.   #--------------------------------------------------------------------------
  2729.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  2730.   #--------------------------------------------------------------------------
  2731.   def update_status
  2732.     case @command_window.index
  2733.     when 1
  2734.       @arrow.y = 105
  2735.       @commands1.y = 42
  2736.       @commands2.y = 100
  2737.       @commands3.y = 162
  2738.       @commands4.y = 222
  2739.       @commands5.y = 282
  2740.       @commands6.y = 342
  2741.       @status_windowshadow1.y = 11
  2742.       @status_windowshadow2.y = 110
  2743.       @status_windowshadow3.y = 210
  2744.       @status_windowshadow4.y = 310
  2745.       @playtimegoldshadow.y = 406
  2746.     when 2
  2747.       @arrow.y = 165
  2748.       @commands1.y = 39
  2749.       @commands2.y = 97
  2750.       @commands3.y = 159
  2751.       @commands4.y = 219
  2752.       @commands5.y = 279
  2753.       @commands6.y = 339
  2754.       @status_windowshadow1.y = 8
  2755.       @status_windowshadow2.y = 107
  2756.       @status_windowshadow3.y = 207
  2757.       @status_windowshadow4.y = 307
  2758.       @playtimegoldshadow.y = 403
  2759.     when 3
  2760.       @arrow.y = 225
  2761.       @commands1.y = 36
  2762.       @commands2.y = 94
  2763.       @commands3.y = 156
  2764.       @commands4.y = 216
  2765.       @commands5.y = 276
  2766.       @commands6.y = 336
  2767.       @status_windowshadow1.y = 5
  2768.       @status_windowshadow2.y = 104
  2769.       @status_windowshadow3.y = 204
  2770.       @status_windowshadow4.y = 304
  2771.       @playtimegoldshadow.y = 400
  2772.       end
  2773.   #========================
  2774.     case @status_window.index
  2775.     when 0
  2776.       @arrow_status.y = 37
  2777.       @arrow_status.x = 260
  2778.     when 1
  2779.       @arrow_status.y = 137
  2780.       @arrow_status.x = 265 - @status_window.index * 25
  2781.     when 2
  2782.       @arrow_status.y = 237
  2783.       @arrow_status.x = 265 - @status_window.index * 25
  2784.     when 3
  2785.       @arrow_status.y = 337
  2786.       @arrow_status.x = 265 - @status_window.index * 23
  2787.       end
  2788.     # B ボタンが押された場合
  2789.     if Input.trigger?(Input::B)
  2790.       # キャンセル SE を演奏
  2791.       $game_system.se_play($data_system.cancel_se)
  2792.       # コマンドウィンドウをアクティブにする
  2793.       @command_window.active = true
  2794.       @status_window.active = false
  2795.       @status_window.index = -1
  2796.       @arrow_status.visible = false
  2797.       return
  2798.     end
  2799.     # C ボタンが押された場合
  2800.     if Input.trigger?(Input::C)
  2801.       # コマンドウィンドウのカーソル位置で分岐
  2802.       case @command_window.index
  2803.       when 1  # スキル
  2804.         # このアクターの行動制限が 2 以上の場合
  2805.         if $game_party.actors[@status_window.index].restriction >= 2
  2806.           # ブザー SE を演奏
  2807.           $game_system.se_play($data_system.buzzer_se)
  2808.           return
  2809.         end
  2810.         @command2.z = 999
  2811.         loop do
  2812.         if @status_window.x < 640
  2813.           @status_window.x += 50
  2814.           end
  2815.         if @status_window1.x < 640
  2816.           @status_window1.x += 50
  2817.         end
  2818.         if @status_window2.x < 640
  2819.           @status_window2.x += 50
  2820.         end
  2821.         if @status_window3.x < 640
  2822.           @status_window3.x += 50
  2823.         end
  2824.         if @status_window4.x < 640
  2825.           @status_window4.x += 50
  2826.         end
  2827.         if @status_windowshadow1.x < 640
  2828.           @status_windowshadow1.x += 50
  2829.         end
  2830.         if @status_windowshadow2.x < 640
  2831.           @status_windowshadow2.x += 50
  2832.         end
  2833.         if @status_windowshadow3.x < 640
  2834.           @status_windowshadow3.x += 50
  2835.         end
  2836.         if @status_windowshadow4.x < 640
  2837.           @status_windowshadow4.x += 50
  2838.         end
  2839.         if @playtimegoldpicture.x < 640
  2840.           @playtimegoldpicture.x += 50
  2841.         end
  2842.         if @playtimegoldshadow.x < 640
  2843.           @playtimegoldshadow.x += 50
  2844.         end
  2845.         if @gold_window.x < 640
  2846.           @gold_window.x += 50
  2847.         end
  2848.         if @playtime_window.x < 640
  2849.           @playtime_window.x += 50
  2850.         end
  2851.         if @command2.y > 40
  2852.           @command2.y -= 30
  2853.         end
  2854.         if @command3.y > 40
  2855.           @command3.y -= 30
  2856.         end
  2857.         if @command4.y > 40
  2858.           @command4.y -= 30
  2859.         end
  2860.         if @command5.y > 40
  2861.           @command5.y -= 30
  2862.         end
  2863.         if @command6.y > 40
  2864.           @command6.y -= 30
  2865.         end
  2866.         @commands2.visible = false
  2867.         @commands3.visible = false
  2868.         @commands4.visible = false
  2869.         @commands5.visible = false
  2870.         @commands6.visible = false
  2871.         @arrow.visible = false
  2872.         @arrow_status.visible = false
  2873.         if @location_bar.y < 480
  2874.           @location_bar.y += 30
  2875.         end
  2876.         if @location_white.y < 480
  2877.           @location_white.y += 30
  2878.         end
  2879.         if @location_window.y < 480
  2880.           @location_window.y += 30
  2881.         end
  2882.         delay(0.1)
  2883.         if @command6.y <= 40
  2884.         break
  2885.       end
  2886.       end
  2887.         # 決定 SE を演奏
  2888.         $game_system.se_play($data_system.decision_se)
  2889.         # スキル画面に切り替え
  2890.         $scene = Scene_Skill.new(@status_window.index)
  2891.       when 2  # 装備
  2892.                 @command3.z = 999
  2893.         loop do
  2894.         if @status_window.x < 640
  2895.           @status_window.x += 50
  2896.           end
  2897.         if @status_window1.x < 640
  2898.           @status_window1.x += 50
  2899.         end
  2900.         if @status_window2.x < 640
  2901.           @status_window2.x += 50
  2902.         end
  2903.         if @status_window3.x < 640
  2904.           @status_window3.x += 50
  2905.         end
  2906.         if @status_window4.x < 640
  2907.           @status_window4.x += 50
  2908.         end
  2909.         if @status_windowshadow1.x < 640
  2910.           @status_windowshadow1.x += 50
  2911.         end
  2912.         if @status_windowshadow2.x < 640
  2913.           @status_windowshadow2.x += 50
  2914.         end
  2915.         if @status_windowshadow3.x < 640
  2916.           @status_windowshadow3.x += 50
  2917.         end
  2918.         if @status_windowshadow4.x < 640
  2919.           @status_windowshadow4.x += 50
  2920.         end
  2921.         if @playtimegoldpicture.x < 640
  2922.           @playtimegoldpicture.x += 50
  2923.         end
  2924.         if @playtimegoldshadow.x < 640
  2925.           @playtimegoldshadow.x += 50
  2926.         end
  2927.         if @gold_window.x < 640
  2928.           @gold_window.x += 50
  2929.         end
  2930.         if @playtime_window.x < 640
  2931.           @playtime_window.x += 50
  2932.         end
  2933.         if @command2.y > 40
  2934.           @command2.y -= 30
  2935.         end
  2936.         if @command3.y > 40
  2937.           @command3.y -= 30
  2938.         end
  2939.         if @command4.y > 40
  2940.           @command4.y -= 30
  2941.         end
  2942.         if @command5.y > 40
  2943.           @command5.y -= 30
  2944.         end
  2945.         if @command6.y > 40
  2946.           @command6.y -= 30
  2947.         end
  2948.         @commands2.visible = false
  2949.         @commands3.visible = false
  2950.         @commands4.visible = false
  2951.         @commands5.visible = false
  2952.         @commands6.visible = false
  2953.         @arrow.visible = false
  2954.         @arrow_status.visible = false
  2955.         if @location_bar.y < 480
  2956.           @location_bar.y += 30
  2957.         end
  2958.         if @location_white.y < 480
  2959.           @location_white.y += 30
  2960.         end
  2961.         if @location_window.y < 480
  2962.           @location_window.y += 30
  2963.         end
  2964.         delay(0.1)
  2965.         if @command6.y <= 40
  2966.         break
  2967.       end
  2968.       end
  2969.         # 決定 SE を演奏
  2970.         $game_system.se_play($data_system.decision_se)
  2971.         # 装備画面に切り替え
  2972.         $scene = Scene_Equip.new(@status_window.index)
  2973.       when 3  # ステータス
  2974.                 @command4.z = 999
  2975.         loop do
  2976.         if @status_window.x < 640
  2977.           @status_window.x += 50
  2978.           end
  2979.         if @status_window1.x < 640
  2980.           @status_window1.x += 50
  2981.         end
  2982.         if @status_window2.x < 640
  2983.           @status_window2.x += 50
  2984.         end
  2985.         if @status_window3.x < 640
  2986.           @status_window3.x += 50
  2987.         end
  2988.         if @status_window4.x < 640
  2989.           @status_window4.x += 50
  2990.         end
  2991.         if @status_windowshadow1.x < 640
  2992.           @status_windowshadow1.x += 50
  2993.         end
  2994.         if @status_windowshadow2.x < 640
  2995.           @status_windowshadow2.x += 50
  2996.         end
  2997.         if @status_windowshadow3.x < 640
  2998.           @status_windowshadow3.x += 50
  2999.         end
  3000.         if @status_windowshadow4.x < 640
  3001.           @status_windowshadow4.x += 50
  3002.         end
  3003.         if @playtimegoldpicture.x < 640
  3004.           @playtimegoldpicture.x += 50
  3005.         end
  3006.         if @playtimegoldshadow.x < 640
  3007.           @playtimegoldshadow.x += 50
  3008.         end
  3009.         if @gold_window.x < 640
  3010.           @gold_window.x += 50
  3011.         end
  3012.         if @playtime_window.x < 640
  3013.           @playtime_window.x += 50
  3014.         end
  3015.         if @command2.y > 40
  3016.           @command2.y -= 30
  3017.         end
  3018.         if @command3.y > 40
  3019.           @command3.y -= 30
  3020.         end
  3021.         if @command4.y > 40
  3022.           @command4.y -= 30
  3023.         end
  3024.         if @command5.y > 40
  3025.           @command5.y -= 30
  3026.         end
  3027.         if @command6.y > 40
  3028.           @command6.y -= 30
  3029.         end
  3030.         @commands2.visible = false
  3031.         @commands3.visible = false
  3032.         @commands4.visible = false
  3033.         @commands5.visible = false
  3034.         @commands6.visible = false
  3035.         @arrow.visible = false
  3036.         @arrow_status.visible = false
  3037.         if @location_bar.y < 480
  3038.           @location_bar.y += 30
  3039.         end
  3040.         if @location_white.y < 480
  3041.           @location_white.y += 30
  3042.         end
  3043.         if @location_window.y < 480
  3044.           @location_window.y += 30
  3045.         end
  3046.         delay(0.1)
  3047.         if @command6.y <= 40
  3048.         break
  3049.       end
  3050.       end
  3051.         # 決定 SE を演奏
  3052.         $game_system.se_play($data_system.decision_se)
  3053.         # ステータス画面に切り替え
  3054.         $scene = Scene_Status.new(@status_window.index)
  3055.       end
  3056.       return
  3057.     end
  3058.   end
  3059. end
  3060. #==============================================================================
  3061. # ■ Scene_Item
  3062. #------------------------------------------------------------------------------
  3063. #  アイテム画面の処理を行うクラスです。
  3064. #==============================================================================

  3065. class Scene_Item
  3066.   #--------------------------------------------------------------------------
  3067.   # ● メイン処理
  3068.   #--------------------------------------------------------------------------
  3069.   def main
  3070.     #==============================================
  3071.     # Setting up all the images
  3072.     @background = Sprite.new
  3073.     @background.bitmap = RPG::Cache.picture("background")
  3074.     @background.x = 0
  3075.     @background.y = 0
  3076.     #================help window pic====================
  3077.     @help_picture = Sprite.new
  3078.     @help_picture.bitmap = RPG::Cache.picture("helpwindow12")
  3079.     @help_picture.x = 0
  3080.     @help_picture.y = - 52
  3081.     #=================Command=======================
  3082.     @command1 = Sprite.new
  3083.     @command1.bitmap = RPG::Cache.picture("cmscommand1")
  3084.     @command1.x = 15
  3085.     @command1.y = 40
  3086.     @command1.z = 100
  3087.     #=====================shadow=======================
  3088.     @commands1 = Sprite.new
  3089.     @commands1.bitmap = RPG::Cache.picture("cmscommandshadow")
  3090.     @commands1.x = 20
  3091.     @commands1.y = 45
  3092.     @commands1.z = 1
  3093.     @commands1.opacity = 155
  3094.     #===================item window======================
  3095.     @item_picture = Sprite.new
  3096.     @item_picture.bitmap = RPG::Cache.picture("itemwindow")
  3097.     @item_picture.x = 7
  3098.     @item_picture.y = 509
  3099.     @item_picture.z = 11
  3100.     #===============================================
  3101.     @item_shadow = Sprite.new
  3102.     @item_shadow.bitmap = RPG::Cache.picture("itemshadow")
  3103.     @item_shadow.x = 12
  3104.     @item_shadow.y = 514
  3105.     @item_shadow.z = 1
  3106.     @item_shadow.opacity = 155
  3107.     #===============================================
  3108.     @help_window = Window_Menuhelp.new
  3109.     @item_window = Window_Menuitem.new
  3110.     @item_window.z = 100
  3111.     @item_window.help_window = @help_window
  3112.     # ターゲットウィンドウを作成 (不可視・非アクティブに設定)
  3113.     @target_picture = Sprite.new
  3114.     @target_picture.bitmap = RPG::Cache.picture("targetwindow")
  3115.     @target_picture.z = 998
  3116.     @target_picture.visible = false
  3117.     @target_window = Window_Target.new
  3118.     @target_window.z = 999
  3119.     @target_window.opacity = 0
  3120.     @target_window.visible = false
  3121.     @target_window.active = false
  3122.     # トランジション実行
  3123.     Graphics.transition
  3124.     # メインループ
  3125.     loop do
  3126.       # ゲーム画面を更新
  3127.       Graphics.update
  3128.       # 入力情報を更新
  3129.       Input.update
  3130.       # フレーム更新
  3131.       update
  3132.       # 画面が切り替わったらループを中断
  3133.       if $scene != self
  3134.         break
  3135.       end
  3136.     end
  3137.     # トランジション準備
  3138.     Graphics.freeze
  3139.     # ウィンドウを解放
  3140.     @help_window.dispose
  3141.     @item_window.dispose
  3142.     @target_window.dispose
  3143.     @background.dispose
  3144.     @command1.dispose
  3145.     @commands1.dispose
  3146.     @help_picture.dispose
  3147.     @item_shadow.dispose
  3148.   end
  3149.   #--------------------------------------------------------------------------
  3150.   # ● フレーム更新
  3151.   #--------------------------------------------------------------------------
  3152.   def update
  3153.     # ウィンドウを更新
  3154.     @help_window.update
  3155.     @item_window.update
  3156.     @target_window.update
  3157.     @command1.update
  3158.     # enter animation
  3159.     if @item_shadow.y > 114
  3160.       @item_shadow.y -= 50
  3161.       end
  3162.     if @item_picture.y > 109
  3163.       @item_picture.y -= 50
  3164.     end
  3165.     if @item_window.y > 100
  3166.       @item_window.y -= 50
  3167.     end
  3168.     if @help_picture.y < - 4
  3169.       @help_picture.y += 24
  3170.     end
  3171.     if @help_window.y < - 7
  3172.       @help_window.y += 35
  3173.     end
  3174.     if @command1.x < 215
  3175.       @command1.x += 100
  3176.     end
  3177.     if @command1.y < 50
  3178.       @command1.y += 5
  3179.     end
  3180.     if @commands1.x < 220
  3181.       @commands1.x += 100
  3182.     end
  3183.     if @commands1.y < 55
  3184.       @commands1.y += 5
  3185.       end
  3186.     # アイテムウィンドウがアクティブの場合: update_item を呼ぶ
  3187.     if @item_window.active
  3188.       update_item
  3189.       return
  3190.     end
  3191.     # ターゲットウィンドウがアクティブの場合: update_target を呼ぶ
  3192.     if @target_window.active
  3193.       update_target
  3194.       return
  3195.     end
  3196.   end
  3197.   #--------------------------------------------------------------------------
  3198.   def delay(seconds)
  3199.   for i in 0...(seconds * 1)
  3200.     sleep 0.01
  3201.     Graphics.update
  3202.   end
  3203. end
  3204.   # ● フレーム更新 (アイテムウィンドウがアクティブの場合)
  3205.   #--------------------------------------------------------------------------
  3206.   def update_item
  3207.     # B ボタンが押された場合
  3208.     if Input.trigger?(Input::B)
  3209.       # exit animation
  3210.       $game_system.se_play($data_system.cancel_se)
  3211.       loop do
  3212.         if @item_shadow.y < 480
  3213.           @item_shadow.y += 50
  3214.           end
  3215.         if @item_picture.y < 480
  3216.           @item_picture.y += 50
  3217.         end
  3218.         if @item_window.y < 480
  3219.           @item_window.y += 50
  3220.         end
  3221.         if @help_picture.y > - 50
  3222.           @help_picture.y -= 30
  3223.         end
  3224.         if @help_window.y > - 64
  3225.           @help_window.y -= 30
  3226.         end
  3227.         if @command1.x > 15
  3228.           @command1.x -= 100
  3229.         end
  3230.         if @command1.y > 40
  3231.           @command1.y -= 5
  3232.         end
  3233.         if @commands1.x > 20
  3234.           @commands1.x -= 100
  3235.         end
  3236.         if @commands1.y > 45
  3237.           @commands1.y -= 5
  3238.         end
  3239.         delay(0.2)
  3240.         if @item_picture.y >= 480
  3241.           break
  3242.         end
  3243.         end
  3244.       # メニュー画面に切り替え
  3245.       $scene = Scene_Menu.new(0)
  3246.       return
  3247.     end
  3248.     # C ボタンが押された場合
  3249.     if Input.trigger?(Input::C)
  3250.       # アイテムウィンドウで現在選択されているデータを取得
  3251.       @item = @item_window.item
  3252.       # 使用アイテムではない場合
  3253.       unless @item.is_a?(RPG::Item)
  3254.         # ブザー SE を演奏
  3255.         $game_system.se_play($data_system.buzzer_se)
  3256.         return
  3257.       end
  3258.       # 使用できない場合
  3259.       unless $game_party.item_can_use?(@item.id)
  3260.         # ブザー SE を演奏
  3261.         $game_system.se_play($data_system.buzzer_se)
  3262.         return
  3263.       end
  3264.       # 決定 SE を演奏
  3265.       $game_system.se_play($data_system.decision_se)
  3266.       # 効果範囲が味方の場合
  3267.       if @item.scope >= 3
  3268.         # ターゲットウィンドウをアクティブ化
  3269.         @item_window.active = false
  3270.         @target_window.x = (@item_window.index + 1) % 2 * 304
  3271.         @target_picture.x = (@item_window.index + 1) % 2 * 304
  3272.         @target_picture.visible = true
  3273.         @target_window.visible = true
  3274.         @target_window.active = true
  3275.         # 効果範囲 (単体/全体) に応じてカーソル位置を設定
  3276.         if @item.scope == 4 || @item.scope == 6
  3277.           @target_window.index = -1
  3278.         else
  3279.           @target_window.index = 0
  3280.         end
  3281.       # 効果範囲が味方以外の場合
  3282.       else
  3283.         # コモンイベント ID が有効の場合
  3284.         if @item.common_event_id > 0
  3285.           # コモンイベント呼び出し予約
  3286.           $game_temp.common_event_id = @item.common_event_id
  3287.           # アイテムの使用時 SE を演奏
  3288.           $game_system.se_play(@item.menu_se)
  3289.           # 消耗品の場合
  3290.           if @item.consumable
  3291.             # 使用したアイテムを 1 減らす
  3292.             $game_party.lose_item(@item.id, 1)
  3293.             # アイテムウィンドウの項目を再描画
  3294.             @item_window.draw_item(@item_window.index)
  3295.           end
  3296.           # マップ画面に切り替え
  3297.           $scene = Scene_Map.new
  3298.           return
  3299.         end
  3300.       end
  3301.       return
  3302.     end
  3303.   end
  3304.   #--------------------------------------------------------------------------
  3305.   # ● フレーム更新 (ターゲットウィンドウがアクティブの場合)
  3306.   #--------------------------------------------------------------------------
  3307.   def update_target
  3308.     # B ボタンが押された場合
  3309.     if Input.trigger?(Input::B)
  3310.       # キャンセル SE を演奏
  3311.       $game_system.se_play($data_system.cancel_se)
  3312.       # アイテム切れなどで使用できなくなった場合
  3313.       unless $game_party.item_can_use?(@item.id)
  3314.         # アイテムウィンドウの内容を再作成
  3315.         @item_window.refresh
  3316.       end
  3317.       # ターゲットウィンドウを消去
  3318.       @item_window.active = true
  3319.       @target_window.visible = false
  3320.       @target_picture.visible = false
  3321.       @target_window.active = false
  3322.       return
  3323.     end
  3324.     # C ボタンが押された場合
  3325.     if Input.trigger?(Input::C)
  3326.       # アイテムを使い切った場合
  3327.       if $game_party.item_number(@item.id) == 0
  3328.         # ブザー SE を演奏
  3329.         $game_system.se_play($data_system.buzzer_se)
  3330.         return
  3331.       end
  3332.       # ターゲットが全体の場合
  3333.       if @target_window.index == -1
  3334.         # パーティ全体にアイテムの使用効果を適用
  3335.         used = false
  3336.         for i in $game_party.actors
  3337.           used |= i.item_effect(@item)
  3338.         end
  3339.       end
  3340.       # ターゲットが単体の場合
  3341.       if @target_window.index >= 0
  3342.         # ターゲットのアクターにアイテムの使用効果を適用
  3343.         target = $game_party.actors[@target_window.index]
  3344.         used = target.item_effect(@item)
  3345.       end
  3346.       # アイテムを使った場合
  3347.       if used
  3348.         # アイテムの使用時 SE を演奏
  3349.         $game_system.se_play(@item.menu_se)
  3350.         # 消耗品の場合
  3351.         if @item.consumable
  3352.           # 使用したアイテムを 1 減らす
  3353.           $game_party.lose_item(@item.id, 1)
  3354.           # アイテムウィンドウの項目を再描画
  3355.           @item_window.draw_item(@item_window.index)
  3356.         end
  3357.         # ターゲットウィンドウの内容を再作成
  3358.         @target_window.refresh
  3359.         # 全滅の場合
  3360.         if $game_party.all_dead?
  3361.           # ゲームオーバー画面に切り替え
  3362.           $scene = Scene_Gameover.new
  3363.           return
  3364.         end
  3365.         # コモンイベント ID が有効の場合
  3366.         if @item.common_event_id > 0
  3367.           # コモンイベント呼び出し予約
  3368.           $game_temp.common_event_id = @item.common_event_id
  3369.           # マップ画面に切り替え
  3370.           $scene = Scene_Map.new
  3371.           return
  3372.         end
  3373.       end
  3374.       # アイテムを使わなかった場合
  3375.       unless used
  3376.         # ブザー SE を演奏
  3377.         $game_system.se_play($data_system.buzzer_se)
  3378.       end
  3379.       return
  3380.     end
  3381.   end
  3382. end
  3383. #==============================================================================
  3384. # ■ Scene_Skill
  3385. #------------------------------------------------------------------------------
  3386. #  スキル画面の処理を行うクラスです。
  3387. #==============================================================================

  3388. class Scene_Skill
  3389.   #--------------------------------------------------------------------------
  3390.   # ● オブジェクト初期化
  3391.   #     actor_index : アクターインデックス
  3392.   #--------------------------------------------------------------------------
  3393.   def initialize(actor_index = 0, equip_index = 0)
  3394.     @actor_index = actor_index
  3395.   end
  3396.   #--------------------------------------------------------------------------
  3397.   # ● メイン処理
  3398.   #--------------------------------------------------------------------------
  3399.   def main
  3400.      #==============================================
  3401.     # Setting up all the images
  3402.     @background = Sprite.new
  3403.     @background.bitmap = RPG::Cache.picture("background")
  3404.     @background.x = 0
  3405.     @background.y = 0
  3406.     #================help window image=====================
  3407.     @help_picture = Sprite.new
  3408.     @help_picture.bitmap = RPG::Cache.picture("helpwindow12")
  3409.     @help_picture.x = 0
  3410.     @help_picture.y = - 52
  3411.     #==============Command image=====================
  3412.     @command2 = Sprite.new
  3413.     @command2.bitmap = RPG::Cache.picture("cmscommand2")
  3414.     @command2.x = 15
  3415.     @command2.y = 40
  3416.     @command2.z = 100
  3417.     #==============shadow================================
  3418.     @commands2 = Sprite.new
  3419.     @commands2.bitmap = RPG::Cache.picture("cmscommandshadow")
  3420.     @commands2.x = 20
  3421.     @commands2.y = 45
  3422.     @commands2.z = 1
  3423.     @commands2.opacity = 155
  3424.     #==============status window==========================
  3425.     @status_window1 = Sprite.new
  3426.     @status_window1.bitmap = RPG::Cache.picture("status window 1")
  3427.     @status_window1.x = 690
  3428.     @status_window1.y = 45
  3429.     @status_window1.z = 100
  3430.     #============shadow================================
  3431.     @status_windowshadow1 = Sprite.new
  3432.     @status_windowshadow1.bitmap = RPG::Cache.picture("blackwindow2")
  3433.     @status_windowshadow1.x = 697
  3434.     @status_windowshadow1.y = 50
  3435.     @status_windowshadow1.z = 1
  3436.     @status_windowshadow1.opacity = 155
  3437.     #==================skill window pic====================
  3438.     @skill_picture = Sprite.new
  3439.     @skill_picture.bitmap = RPG::Cache.picture("skillwindow")
  3440.     @skill_picture.x = 7
  3441.     @skill_picture.y = 540
  3442.     @skill_picture.z = 2
  3443.     #================skill shadow pic=====================
  3444.     @skill_shadow = Sprite.new
  3445.     @skill_shadow.bitmap = RPG::Cache.picture("skillshadow")
  3446.     @skill_shadow.x = 14
  3447.     @skill_shadow.y = 545
  3448.     @skill_shadow.z = 1
  3449.     @skill_shadow.opacity = 155
  3450.     #===============target window========================
  3451.     @target_picture = Sprite.new
  3452.     @target_picture.bitmap = RPG::Cache.picture("targetwindow")
  3453.     @target_picture.z = 998
  3454.     @target_picture.visible = false
  3455.     # アクターを取得
  3456.     @actor = $game_party.actors[@actor_index]
  3457.     # ヘルプウィンドウ、ステータスウィンドウ、スキルウィンドウを作成
  3458.     @help_window = Window_Menuhelp.new
  3459.     @help_window.opacity = 0
  3460.     @status_window = Window_SkillStatus.new(@actor)
  3461.     @skill_window = Window_Menuskill.new(@actor)
  3462.     @skill_window.opacity = 0
  3463.     # ヘルプウィンドウを関連付け
  3464.     @skill_window.help_window = @help_window
  3465.     # ターゲットウィンドウを作成 (不可視・非アクティブに設定)
  3466.     @target_window = Window_Target.new
  3467.     @target_window.z = 999
  3468.     @target_window.opacity = 0
  3469.     @target_window.visible = false
  3470.     @target_window.active = false
  3471.     # トランジション実行
  3472.     Graphics.transition
  3473.     # メインループ
  3474.     loop do
  3475.       # ゲーム画面を更新
  3476.       Graphics.update
  3477.       # 入力情報を更新
  3478.       Input.update
  3479.       # フレーム更新
  3480.       update
  3481.       # 画面が切り替わったらループを中断
  3482.       if $scene != self
  3483.         break
  3484.       end
  3485.     end
  3486.     # トランジション準備
  3487.     Graphics.freeze
  3488.     # ウィンドウを解放
  3489.     @help_window.dispose
  3490.     @status_window.dispose
  3491.     @skill_window.dispose
  3492.     @target_window.dispose
  3493.     @background.dispose
  3494.     @help_picture.dispose
  3495.     @commands2.dispose
  3496.     @command2.dispose
  3497.     @status_window1.dispose
  3498.     @status_windowshadow1.dispose
  3499.     @skill_picture.dispose
  3500.     @skill_shadow.dispose
  3501.   end
  3502.   #--------------------------------------------------------------------------
  3503.   def delay(seconds)
  3504.   for i in 0...(seconds * 1)
  3505.     sleep 0.01
  3506.     Graphics.update
  3507.   end
  3508. end
  3509.   # ● フレーム更新
  3510.   #--------------------------------------------------------------------------
  3511.   def update
  3512.     # enter animation
  3513.     if @help_picture.y < - 4
  3514.       @help_picture.y += 24
  3515.     end
  3516.     if @help_window.y < - 7
  3517.       @help_window.y += 35
  3518.     end
  3519.     if @command2.y < 60
  3520.       @command2.y += 20
  3521.     end
  3522.     if @commands2.y < 65
  3523.       @commands2.y += 20
  3524.     end
  3525.     if @skill_shadow.y > 145
  3526.       @skill_shadow.y -= 50
  3527.       end
  3528.     if @skill_picture.y > 140
  3529.       @skill_picture.y -= 50
  3530.     end
  3531.     if @skill_window.y > 131
  3532.       @skill_window.y -= 50
  3533.     end
  3534.     if @status_window1.x > 293
  3535.        @status_window1.x -= 100
  3536.     end
  3537.     if @status_window.x > 230
  3538.        @status_window.x -= 100
  3539.      end
  3540.      if @status_windowshadow1.x > 297
  3541.        @status_windowshadow1.x -= 100
  3542.      end
  3543.     # ウィンドウを更新
  3544.     @help_window.update
  3545.     @status_window.update
  3546.     @skill_window.update
  3547.     @target_window.update
  3548.     # スキルウィンドウがアクティブの場合: update_skill を呼ぶ
  3549.     if @skill_window.active
  3550.       update_skill
  3551.       return
  3552.     end
  3553.     # ターゲットウィンドウがアクティブの場合: update_target を呼ぶ
  3554.     if @target_window.active
  3555.       update_target
  3556.       return
  3557.     end
  3558.   end
  3559.   #--------------------------------------------------------------------------
  3560.   # ● フレーム更新 (スキルウィンドウがアクティブの場合)
  3561.   #--------------------------------------------------------------------------
  3562.   def update_skill
  3563.     if Input.trigger?(Input::B)
  3564.       # exit animation
  3565.        loop do
  3566.          if @skill_shadow.y < 480
  3567.            @skill_shadow.y += 50
  3568.            end
  3569.         if @skill_picture.y < 480
  3570.           @skill_picture.y += 50
  3571.         end
  3572.         if @skill_window.y < 480
  3573.           @skill_window.y += 50
  3574.         end
  3575.         if @help_picture.y > - 50
  3576.           @help_picture.y -= 30
  3577.         end
  3578.         if @help_window.y > - 64
  3579.           @help_window.y -= 30
  3580.         end
  3581.         if @command2.x > 15
  3582.           @command2.x -= 100
  3583.         end
  3584.         if @command2.y > 40
  3585.           @command2.y -= 10
  3586.         end
  3587.         if @commands2.x > 20
  3588.           @commands2.x -= 100
  3589.         end
  3590.         if @commands2.y > 45
  3591.           @commands2.y -= 10
  3592.         end
  3593.         if @status_window1.x < 640
  3594.            @status_window1.x += 100
  3595.         end
  3596.         if @status_window.x < 640
  3597.            @status_window.x += 100
  3598.          end
  3599.          if @status_windowshadow1.x < 640
  3600.            @status_windowshadow1.x += 100
  3601.            end
  3602.         delay(0.2)
  3603.         if @skill_picture.y >= 480
  3604.           break
  3605.         end
  3606.         end
  3607.       # キャンセル SE を演奏
  3608.       $game_system.se_play($data_system.cancel_se)
  3609.       # メニュー画面に切り替え
  3610.       $scene = Scene_Menu.new(1)
  3611.       return
  3612.     end
  3613.     # C ボタンが押された場合
  3614.     if Input.trigger?(Input::C)
  3615.       # スキルウィンドウで現在選択されているデータを取得
  3616.       @skill = @skill_window.skill
  3617.       # 使用できない場合
  3618.       if @skill == nil or not @actor.skill_can_use?(@skill.id)
  3619.         # ブザー SE を演奏
  3620.         $game_system.se_play($data_system.buzzer_se)
  3621.         return
  3622.       end
  3623.       # 決定 SE を演奏
  3624.       $game_system.se_play($data_system.decision_se)
  3625.       # 効果範囲が味方の場合
  3626.       if @skill.scope >= 3
  3627.         # ターゲットウィンドウをアクティブ化
  3628.         @skill_window.active = false
  3629.         @target_window.x = (@skill_window.index + 1) % 2 * 304
  3630.         @target_picture.x = (@skill_window.index + 1) % 2 * 304
  3631.         @target_window.visible = true
  3632.         @target_window.active = true
  3633.         @target_picture.visible = true
  3634.         # 効果範囲 (単体/全体) に応じてカーソル位置を設定
  3635.         if @skill.scope == 4 || @skill.scope == 6
  3636.           @target_window.index = -1
  3637.         elsif @skill.scope == 7
  3638.           @target_window.index = @actor_index - 10
  3639.         else
  3640.           @target_window.index = 0
  3641.         end
  3642.       # 効果範囲が味方以外の場合
  3643.       else
  3644.         # コモンイベント ID が有効の場合
  3645.         if @skill.common_event_id > 0
  3646.           # コモンイベント呼び出し予約
  3647.           $game_temp.common_event_id = @skill.common_event_id
  3648.           # スキルの使用時 SE を演奏
  3649.           $game_system.se_play(@skill.menu_se)
  3650.           # SP 消費
  3651.           @actor.sp -= @skill.sp_cost
  3652.           # 各ウィンドウの内容を再作成
  3653.           @status_window.refresh
  3654.           @skill_window.refresh
  3655.           @target_window.refresh
  3656.           # マップ画面に切り替え
  3657.           $scene = Scene_Map.new
  3658.           return
  3659.         end
  3660.       end
  3661.       return
  3662.     end
  3663.     # R ボタンが押された場合
  3664.     if Input.trigger?(Input::R)
  3665.       # カーソル SE を演奏
  3666.       $game_system.se_play($data_system.cursor_se)
  3667.       # 次のアクターへ
  3668.       @actor_index += 1
  3669.       @actor_index %= $game_party.actors.size
  3670.       # 別のスキル画面に切り替え
  3671.       $scene = Scene_Skill.new(@actor_index)
  3672.       return
  3673.     end
  3674.     # L ボタンが押された場合
  3675.     if Input.trigger?(Input::L)
  3676.       # カーソル SE を演奏
  3677.       $game_system.se_play($data_system.cursor_se)
  3678.       # 前のアクターへ
  3679.       @actor_index += $game_party.actors.size - 1
  3680.       @actor_index %= $game_party.actors.size
  3681.       # 別のスキル画面に切り替え
  3682.       $scene = Scene_Skill.new(@actor_index)
  3683.       return
  3684.     end
  3685.   end
  3686.   #--------------------------------------------------------------------------
  3687.   # ● フレーム更新 (ターゲットウィンドウがアクティブの場合)
  3688.   #--------------------------------------------------------------------------
  3689.   def update_target
  3690.     # B ボタンが押された場合
  3691.     if Input.trigger?(Input::B)
  3692.       # キャンセル SE を演奏
  3693.       $game_system.se_play($data_system.cancel_se)
  3694.       # ターゲットウィンドウを消去
  3695.       @skill_window.active = true
  3696.       @target_window.visible = false
  3697.       @target_window.active = false
  3698.       @target_picture.visible = false
  3699.       return
  3700.     end
  3701.     # C ボタンが押された場合
  3702.     if Input.trigger?(Input::C)
  3703.       # SP 切れなどで使用できなくなった場合
  3704.       unless @actor.skill_can_use?(@skill.id)
  3705.         # ブザー SE を演奏
  3706.         $game_system.se_play($data_system.buzzer_se)
  3707.         return
  3708.       end
  3709.       # ターゲットが全体の場合
  3710.       if @target_window.index == -1
  3711.         # パーティ全体にスキルの使用効果を適用
  3712.         used = false
  3713.         for i in $game_party.actors
  3714.           used |= i.skill_effect(@actor, @skill)
  3715.         end
  3716.       end
  3717.       # ターゲットが使用者の場合
  3718.       if @target_window.index <= -2
  3719.         # ターゲットのアクターにスキルの使用効果を適用
  3720.         target = $game_party.actors[@target_window.index + 10]
  3721.         used = target.skill_effect(@actor, @skill)
  3722.       end
  3723.       # ターゲットが単体の場合
  3724.       if @target_window.index >= 0
  3725.         # ターゲットのアクターにスキルの使用効果を適用
  3726.         target = $game_party.actors[@target_window.index]
  3727.         used = target.skill_effect(@actor, @skill)
  3728.       end
  3729.       # スキルを使った場合
  3730.       if used
  3731.         # スキルの使用時 SE を演奏
  3732.         $game_system.se_play(@skill.menu_se)
  3733.         # SP 消費
  3734.         @actor.sp -= @skill.sp_cost
  3735.         # 各ウィンドウの内容を再作成
  3736.         @status_window.refresh
  3737.         @skill_window.refresh
  3738.         @target_window.refresh
  3739.         # 全滅の場合
  3740.         if $game_party.all_dead?
  3741.           # ゲームオーバー画面に切り替え
  3742.           $scene = Scene_Gameover.new
  3743.           return
  3744.         end
  3745.         # コモンイベント ID が有効の場合
  3746.         if @skill.common_event_id > 0
  3747.           # コモンイベント呼び出し予約
  3748.           $game_temp.common_event_id = @skill.common_event_id
  3749.           # マップ画面に切り替え
  3750.           $scene = Scene_Map.new
  3751.           return
  3752.         end
  3753.       end
  3754.       # スキルを使わなかった場合
  3755.       unless used
  3756.         # ブザー SE を演奏
  3757.         $game_system.se_play($data_system.buzzer_se)
  3758.       end
  3759.       return
  3760.     end
  3761.   end
  3762. end
  3763. #==============================================================================
  3764. # ■ Scene_Equip
  3765. #------------------------------------------------------------------------------
  3766. #  装備画面の処理を行うクラスです。
  3767. #==============================================================================

  3768. class Scene_Equip
  3769.   #--------------------------------------------------------------------------
  3770.   # ● オブジェクト初期化
  3771.   #     actor_index : アクターインデックス
  3772.   #     equip_index : 装備インデックス
  3773.   #--------------------------------------------------------------------------
  3774.   def initialize(actor_index = 0, equip_index = 0)
  3775.     @actor_index = actor_index
  3776.     @equip_index = equip_index
  3777.   end
  3778.   #--------------------------------------------------------------------------
  3779.   # ● メイン処理
  3780.   #--------------------------------------------------------------------------
  3781.   def main
  3782.      # This is setting up the background picture
  3783.     @background = Sprite.new
  3784.     @background.bitmap = RPG::Cache.picture("background")
  3785.     @background.x = 0
  3786.     @background.y = 0
  3787.     #=============the equip command pic========================
  3788.     @command3 = Sprite.new
  3789.     @command3.bitmap = RPG::Cache.picture("cmscommand3")
  3790.     @command3.x = 15
  3791.     @command3.y = 40
  3792.     @command3.z = 100
  3793.     #=================the shadow of it=======================
  3794.     @commands3 = Sprite.new
  3795.     @commands3.bitmap = RPG::Cache.picture("cmscommandshadow")
  3796.     @commands3.x = 20
  3797.     @commands3.y = 45
  3798.     @commands3.z = 1
  3799.     @commands3.opacity = 155
  3800.     #================the status window pic====================
  3801.     @status_window1 = Sprite.new
  3802.     @status_window1.bitmap = RPG::Cache.picture("status window")
  3803.     @status_window1.x = 570
  3804.     @status_window1.y = 30
  3805.     @status_window1.z = 100
  3806.     #=============the shadow of it===========================
  3807.     @status_windowshadow1 = Sprite.new
  3808.     @status_windowshadow1.bitmap = RPG::Cache.picture("blackwindow2")
  3809.     @status_windowshadow1.x = 697
  3810.     @status_windowshadow1.y = 50
  3811.     @status_windowshadow1.z = 1
  3812.     @status_windowshadow1.opacity = 155
  3813.     #================help window image=====================
  3814.     @help_picture = Sprite.new
  3815.     @help_picture.bitmap = RPG::Cache.picture("helpwindow12")
  3816.     @help_picture.x = 0
  3817.     @help_picture.y = - 52
  3818.     #==============This sets up the 3rd status picture=============
  3819.     @picture_status2 = Sprite.new
  3820.     @picture_status2.bitmap = RPG::Cache.picture("windowstatus2")
  3821.     @picture_status2.x = 850
  3822.     @picture_status2.y = 135
  3823.     @picture_status2.z = 3
  3824.     #============the shadow of the 2nd status pic================
  3825.     @picture_shadow2 = Sprite.new
  3826.     @picture_shadow2.bitmap = RPG::Cache.picture("windowstatus2shadow")
  3827.     @picture_shadow2.x = 855
  3828.     @picture_shadow2.y = 140
  3829.     @picture_shadow2.z = 1
  3830.     @picture_shadow2.opacity = 155
  3831.     #======the pic for equip left (status window 2 in this script)==========
  3832.     @equip_window1 = Sprite.new
  3833.     @equip_window1.bitmap = RPG::Cache.picture("equipwindow1")
  3834.     @equip_window1.x = - 113
  3835.     @equip_window1.y = 117
  3836.     @equip_window1.z = 2
  3837.     #============the equipment selection window pic===============
  3838.     @equip_window2 = Sprite.new
  3839.     @equip_window2.bitmap = RPG::Cache.picture("equipwindow2")
  3840.     @equip_window2.x = 245
  3841.     @equip_window2.y = 585
  3842.     @equip_window2.z = 2
  3843.     #================the shadow of it==========================
  3844.     @equip_shadow2 = Sprite.new
  3845.     @equip_shadow2.bitmap = RPG::Cache.picture("equipwindow2shadow")
  3846.     @equip_shadow2.x = 250
  3847.     @equip_shadow2.y = 590
  3848.     @equip_shadow2.opacity = 155
  3849.     @equip_shadow2.z = 1
  3850.     #================the selection arrow=========================
  3851.     @arrow = Sprite.new
  3852.     @arrow.bitmap = RPG::Cache.picture("arrow4")
  3853.     @arrow.x = 12
  3854.     @arrow.y = 150
  3855.     @arrow.z = 1000
  3856.     # アクターを取得
  3857.     @actor = $game_party.actors[@actor_index]
  3858.     # ウィンドウを作成
  3859.     @status_window = Window_SkillStatus.new(@actor)
  3860.     @status_window2 = Window_Status2.new(@actor)
  3861.     @status_window2.x = 850
  3862.     @status_window2.y = 120
  3863.     @status_window2.opacity = 0
  3864.     @help_window = Window_Menuhelp.new
  3865.     @help_window.opacity = 0
  3866.     @right_window = Window_EquipRight.new(@actor)
  3867.     @right_window.visible = true
  3868.     @item_window1 = Window_EquipItem.new(@actor, 0)
  3869.     @item_window2 = Window_EquipItem.new(@actor, 1)
  3870.     @item_window3 = Window_EquipItem.new(@actor, 2)
  3871.     @item_window4 = Window_EquipItem.new(@actor, 3)
  3872.     @item_window5 = Window_EquipItem.new(@actor, 4)
  3873.     # ヘルプウィンドウを関連付け
  3874.     @right_window.help_window = @help_window
  3875.     @item_window1.help_window = @help_window
  3876.     @item_window2.help_window = @help_window
  3877.     @item_window3.help_window = @help_window
  3878.     @item_window4.help_window = @help_window
  3879.     @item_window5.help_window = @help_window
  3880.     # カーソル位置を設定
  3881.     @right_window.index = @equip_index
  3882.     refresh
  3883.     # トランジション実行
  3884.     Graphics.transition
  3885.     # メインループ
  3886.     loop do
  3887.       # ゲーム画面を更新
  3888.       Graphics.update
  3889.       # 入力情報を更新
  3890.       Input.update
  3891.       # フレーム更新
  3892.       update
  3893.       # 画面が切り替わったらループを中断
  3894.       if $scene != self
  3895.         break
  3896.       end
  3897.     end
  3898.     # トランジション準備
  3899.     Graphics.freeze
  3900.     # ウィンドウを解放
  3901.     @help_window.dispose
  3902.     @right_window.dispose
  3903.     @item_window1.dispose
  3904.     @item_window2.dispose
  3905.     @item_window3.dispose
  3906.     @item_window4.dispose
  3907.     @item_window5.dispose
  3908.     @background.dispose
  3909.     @command3.dispose
  3910.     @commands3.dispose
  3911.     @status_window1.dispose
  3912.     @status_windowshadow1.dispose
  3913.     @help_picture.dispose
  3914.     @status_window.dispose
  3915.     @status_window2.dispose
  3916.     @equip_window1.dispose
  3917.     @equip_window2.dispose
  3918.     @picture_status2.dispose
  3919.     @arrow.dispose
  3920.     @equip_shadow2.dispose
  3921.     @picture_shadow2.dispose
  3922.   end
  3923.   #--------------------------------------------------------------------------
  3924.   # ● リフレッシュ
  3925.   #--------------------------------------------------------------------------
  3926.   def refresh
  3927.     # アイテムウィンドウの可視状態設定
  3928.     @item_window1.visible = (@right_window.index == 0)
  3929.     @item_window2.visible = (@right_window.index == 1)
  3930.     @item_window3.visible = (@right_window.index == 2)
  3931.     @item_window4.visible = (@right_window.index == 3)
  3932.     @item_window5.visible = (@right_window.index == 4)
  3933.     # 現在装備中のアイテムを取得
  3934.     item1 = @right_window.item
  3935.     # 現在のアイテムウィンドウを @item_window に設定
  3936.     case @right_window.index
  3937.     when 0
  3938.       @item_window = @item_window1
  3939.     when 1
  3940.       @item_window = @item_window2
  3941.     when 2
  3942.       @item_window = @item_window3
  3943.     when 3
  3944.       @item_window = @item_window4
  3945.     when 4
  3946.       @item_window = @item_window5
  3947.     end
  3948.     # ライトウィンドウがアクティブの場合
  3949.     if @right_window.active
  3950.       # 装備変更後のパラメータを消去
  3951.       @status_window2.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
  3952.     end
  3953.     # アイテムウィンドウがアクティブの場合
  3954.     if @item_window.active
  3955.       # 現在選択中のアイテムを取得
  3956.       item2 = @item_window.item
  3957.       # 装備を変更
  3958.       last_hp = @actor.hp
  3959.       last_sp = @actor.sp
  3960.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  3961.       # 装備変更後のパラメータを取得
  3962.       new_atk = @actor.atk
  3963.       new_pdef = @actor.pdef
  3964.       new_mdef = @actor.mdef
  3965.       new_str = @actor.str
  3966.       new_dex = @actor.dex
  3967.       new_agi = @actor.agi
  3968.       new_int = @actor.int
  3969.       # 装備を戻す
  3970.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  3971.       @actor.hp = last_hp
  3972.       @actor.sp = last_sp
  3973.       # レフトウィンドウに描画
  3974.     @status_window2.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
  3975.     @status_window2.refresh
  3976.     end
  3977.   end
  3978.   #--------------------------------------------------------------------------
  3979.   def delay(seconds)
  3980.   for i in 0...(seconds * 1)
  3981.     sleep 0.01
  3982.     Graphics.update
  3983.   end
  3984. end
  3985.   # ● フレーム更新
  3986.   #--------------------------------------------------------------------------
  3987.   def update
  3988.     @status_window.update
  3989.         if @command3.y < 60
  3990.       @command3.y += 20
  3991.     end
  3992.     if @commands3.y < 65
  3993.       @commands3.y += 20
  3994.     end
  3995.       if @help_picture.y < - 4
  3996.       @help_picture.y += 24
  3997.     end
  3998.     if @help_window.y < - 7
  3999.       @help_window.y += 35
  4000.     end
  4001.     if @status_window1.x > 293
  4002.        @status_window1.x -= 80
  4003.      end
  4004.     if @status_windowshadow1.x > 297
  4005.       @status_windowshadow1.x -= 80
  4006.       end
  4007.         if @status_window.x > 230
  4008.        @status_window.x -= 50
  4009.      end
  4010.        if @status_window2.x > 250
  4011.       @status_window2.x -= 100
  4012.     end
  4013.       if @picture_status2.x > 250
  4014.       @picture_status2.x -= 100
  4015.     end
  4016.      if @picture_shadow2.x > 255
  4017.       @picture_shadow2.x -= 100
  4018.     end
  4019.     if @equip_window1.x < 7
  4020.       @equip_window1.x += 20
  4021.     end
  4022.     if @right_window.x < 20
  4023.       @right_window.x += 20
  4024.     end
  4025.     if @equip_window2.y > 285
  4026.       @equip_window2.y -= 50
  4027.     end
  4028.     if @equip_shadow2.y > 290
  4029.       @equip_shadow2.y -= 50
  4030.       end
  4031.     if @arrow.x < - 10
  4032.       @arrow.x += 10
  4033.     end
  4034.        if @item_window1.y > 273
  4035.       @item_window1.y -= 50
  4036.     end
  4037.     if @item_window2.y > 273
  4038.       @item_window2.y -= 50
  4039.     end
  4040.     if @item_window3.y > 273
  4041.       @item_window3.y -= 50
  4042.     end
  4043.     if @item_window4.y > 273
  4044.       @item_window4.y -= 50
  4045.     end
  4046.     if @item_window5.y > 273
  4047.       @item_window5.y -= 50
  4048.       end
  4049.     # ウィンドウを更新
  4050.     @right_window.update
  4051.     @item_window.update
  4052.     refresh
  4053.     # ライトウィンドウがアクティブの場合: update_right を呼ぶ
  4054.     if @right_window.active
  4055.       update_right
  4056.       return
  4057.     end
  4058.     # アイテムウィンドウがアクティブの場合: update_item を呼ぶ
  4059.     if @item_window.active
  4060.       update_item
  4061.       return
  4062.     end
  4063.   end
  4064.   #--------------------------------------------------------------------------
  4065.   # ● フレーム更新 (ライトウィンドウがアクティブの場合)
  4066.   #--------------------------------------------------------------------------
  4067.   def update_right
  4068.     case @right_window.index
  4069.     when 0
  4070.       @arrow.y = 141
  4071.     when 1
  4072.       @arrow.y = 208
  4073.     when 2
  4074.       @arrow.y = 276
  4075.     when 3
  4076.       @arrow.y = 344
  4077.     when 4
  4078.       @arrow.y = 408
  4079.       end
  4080.     # B ボタンが押された場合
  4081.     if Input.trigger?(Input::B)
  4082.       # キャンセル SE を演奏
  4083.       loop do
  4084.           if @command3.x > 15
  4085.           @command3.x -= 100
  4086.         end
  4087.         if @command3.y > 40
  4088.           @command3.y -= 10
  4089.         end
  4090.         if @commands3.x > 20
  4091.           @commands2.x -= 100
  4092.         end
  4093.         if @commands3.y > 45
  4094.           @commands3.y -= 10
  4095.         end
  4096.         if @help_picture.y > - 50
  4097.           @help_picture.y -= 30
  4098.         end
  4099.         if @help_window.y > - 64
  4100.           @help_window.y -= 30
  4101.         end
  4102.          if @status_window1.x < 640
  4103.            @status_window1.x += 100
  4104.         end
  4105.         if @status_window.x < 640
  4106.            @status_window.x += 100
  4107.          end
  4108.          if @status_windowshadow1.x < 640
  4109.            @status_windowshadow1.x += 100
  4110.          end
  4111.          if @status_window2.x < 640
  4112.             @status_window2.x += 100
  4113.          end
  4114.         if @picture_status2.x < 640
  4115.            @picture_status2.x += 100
  4116.          end
  4117.          if @picture_shadow2.x < 640
  4118.            @picture_shadow2.x += 100
  4119.          end
  4120.           if @equip_window1.x > - 250
  4121.           @equip_window1.x -= 50
  4122.          end
  4123.         if @right_window.x > - 250
  4124.        @right_window.x -= 50
  4125.       end
  4126.       if @equip_window2.y < 480
  4127.        @equip_window2.y += 50
  4128.      end
  4129.       if @equip_shadow2.y < 480
  4130.       @equip_shadow2.y += 50
  4131.       end
  4132.       if @item_window1.y < 480
  4133.         @item_window1.y += 50
  4134.       end
  4135.       if @item_window2.y < 480
  4136.         @item_window2.y += 50
  4137.       end
  4138.        if @item_window3.y < 480
  4139.         @item_window3.y += 50
  4140.        end
  4141.        if @item_window4.y < 480
  4142.        @item_window4.y += 50
  4143.       end
  4144.       if @item_window5.y < 480
  4145.          @item_window5.y += 50
  4146.        end
  4147.     @arrow.visible = false
  4148.       delay(0.1)
  4149.       if @equip_window1.x <= - 250
  4150.         break
  4151.     end
  4152.     end
  4153.        $game_system.se_play($data_system.cancel_se)
  4154.       # メニュー画面に切り替え
  4155.       $scene = Scene_Menu.new(2)
  4156.       return
  4157.     end
  4158.     # C ボタンが押された場合
  4159.     if Input.trigger?(Input::C)
  4160.       # 装備固定の場合
  4161.       if @actor.equip_fix?(@right_window.index)
  4162.         # ブザー SE を演奏
  4163.         $game_system.se_play($data_system.buzzer_se)
  4164.         return
  4165.       end
  4166.       # 決定 SE を演奏
  4167.       $game_system.se_play($data_system.decision_se)
  4168.       # アイテムウィンドウをアクティブ化
  4169.       @right_window.active = false
  4170.       @item_window.active = true
  4171.       @item_window.index = 0
  4172.       return
  4173.     end
  4174.     # R ボタンが押された場合
  4175.     if Input.trigger?(Input::R)
  4176.       # カーソル SE を演奏
  4177.       $game_system.se_play($data_system.cursor_se)
  4178.       # 次のアクターへ
  4179.       @actor_index += 1
  4180.       @actor_index %= $game_party.actors.size
  4181.       # 別の装備画面に切り替え
  4182.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  4183.       return
  4184.     end
  4185.     # L ボタンが押された場合
  4186.     if Input.trigger?(Input::L)
  4187.       # カーソル SE を演奏
  4188.       $game_system.se_play($data_system.cursor_se)
  4189.       # 前のアクターへ
  4190.       @actor_index += $game_party.actors.size - 1
  4191.       @actor_index %= $game_party.actors.size
  4192.       # 別の装備画面に切り替え
  4193.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  4194.       return
  4195.     end
  4196.   end
  4197.   #--------------------------------------------------------------------------
  4198.   # ● フレーム更新 (アイテムウィンドウがアクティブの場合)
  4199.   #--------------------------------------------------------------------------
  4200.   def update_item
  4201.     # B ボタンが押された場合
  4202.     if Input.trigger?(Input::B)
  4203.       # キャンセル SE を演奏
  4204.       $game_system.se_play($data_system.cancel_se)
  4205.       # ライトウィンドウをアクティブ化
  4206.       @right_window.active = true
  4207.       @status_window2.refresh
  4208.       @item_window.active = false
  4209.       @item_window.index = -1
  4210.       return
  4211.     end
  4212.     # C ボタンが押された場合
  4213.     if Input.trigger?(Input::C)
  4214.       # 装備 SE を演奏
  4215.       $game_system.se_play($data_system.equip_se)
  4216.       # アイテムウィンドウで現在選択されているデータを取得
  4217.       item = @item_window.item
  4218.       # 装備を変更
  4219.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  4220.       # ライトウィンドウをアクティブ化
  4221.       @right_window.active = true
  4222.       @item_window.active = false
  4223.       @item_window.index = -1
  4224.       # ライトウィンドウ、アイテムウィンドウの内容を再作成
  4225.       @right_window.refresh
  4226.       @item_window.refresh
  4227.       return
  4228.     end
  4229.   end
  4230. end
  4231. #==============================================================================
  4232. # ■ Scene_Status
  4233. #------------------------------------------------------------------------------
  4234. #  ステータス画面の処理を行うクラスです。
  4235. #==============================================================================

  4236. class Scene_Status
  4237.   #--------------------------------------------------------------------------
  4238.   # ● オブジェクト初期化
  4239.   #     actor_index : アクターインデックス
  4240.   #--------------------------------------------------------------------------
  4241.   def initialize(actor_index = 0, equip_index = 0)
  4242.     @actor_index = actor_index
  4243.   end
  4244.   #--------------------------------------------------------------------------
  4245.   # ● メイン処理
  4246.   #--------------------------------------------------------------------------
  4247.   def main
  4248.     #========================================
  4249.     # This is setting up the background picture
  4250.     @background = Sprite.new
  4251.     @background.bitmap = RPG::Cache.picture("background")
  4252.     @background.x = 0
  4253.     @background.y = 0
  4254.     #========================================
  4255.     # This sets up the command picture & shadow
  4256.     @command4 = Sprite.new
  4257.     @command4.bitmap = RPG::Cache.picture("cmscommand4")
  4258.     @command4.x = 15
  4259.     @command4.y = 40
  4260.     @command4.z = 100
  4261.     #========================================
  4262.     @commands4 = Sprite.new
  4263.     @commands4.bitmap = RPG::Cache.picture("cmscommandshadow")
  4264.     @commands4.x = 20
  4265.     @commands4.y = 45
  4266.     @commands4.z = 1
  4267.     @commands4.opacity = 155
  4268.     #==============This sets up the 1st status picture=============
  4269.     @picture_status1 = Sprite.new
  4270.     @picture_status1.bitmap = RPG::Cache.picture("windowstatus1")
  4271.     @picture_status1.x = 230
  4272.     @picture_status1.y = - 120
  4273.     @picture_status1.z = 2
  4274.     #=============This sets up the 2nd status picture==============
  4275.     @picture_status2 = Sprite.new
  4276.     @picture_status2.bitmap = RPG::Cache.picture("windowstatus2")
  4277.     @picture_status2.x = 830
  4278.     @picture_status2.y = 115
  4279.     @picture_status2.z = 2
  4280.     #==============This sets up the 3rd status picture=============
  4281.     @picture_status3 = Sprite.new
  4282.     @picture_status3.bitmap = RPG::Cache.picture("windowstatus3")
  4283.     @picture_status3.x = 230
  4284.     @picture_status3.y = 480
  4285.     @picture_status3.z = 2
  4286.     #===============This sets up the 4th status picture==============
  4287.     @picture_status4 = Sprite.new
  4288.     @picture_status4.bitmap = RPG::Cache.picture("windowstatus4")
  4289.     @picture_status4.x = - 280
  4290.     @picture_status4.y = 388
  4291.     @picture_status4.z = 2
  4292.     #============the shadow of the 1st status pic==================
  4293.     @picture_shadow1 = Sprite.new
  4294.     @picture_shadow1.bitmap = RPG::Cache.picture("windowstatus1shadow")
  4295.     @picture_shadow1.x = 235
  4296.     @picture_shadow1.y = - 115
  4297.     @picture_shadow1.z = 1
  4298.     @picture_shadow1.opacity = 155
  4299.     #============the shadow of the 2nd status pic==================
  4300.     @picture_shadow2 = Sprite.new
  4301.     @picture_shadow2.bitmap = RPG::Cache.picture("windowstatus2shadow")
  4302.     @picture_shadow2.x = 835
  4303.     @picture_shadow2.y = 120
  4304.     @picture_shadow2.z = 1
  4305.     @picture_shadow2.opacity = 155
  4306.     #============the shadow of the 3rd status pic==================
  4307.     @picture_shadow3 = Sprite.new
  4308.     @picture_shadow3.bitmap = RPG::Cache.picture("windowstatus3shadow")
  4309.     @picture_shadow3.x = 235
  4310.     @picture_shadow3.y = 485
  4311.     @picture_shadow3.z = 1
  4312.     @picture_shadow3.opacity = 155
  4313.     #============the shadow of the 4th status pic==================
  4314.     @picture_shadow4 = Sprite.new
  4315.     @picture_shadow4.bitmap = RPG::Cache.picture("windowstatus4shadow")
  4316.     @picture_shadow4.x = - 275
  4317.     @picture_shadow4.y = 393
  4318.     @picture_shadow4.z = 1
  4319.     @picture_shadow4.opacity = 155
  4320.     # アクターを取得
  4321.     @actor = $game_party.actors[@actor_index]
  4322.     # Sets up the 1st status window
  4323.     @status_window1 = Window_Status.new(@actor)
  4324.     @status_window1.x = 220
  4325.     @status_window1.y = - 160
  4326.     @status_window1.opacity = 0
  4327.     #=============Sets up the 2nd status window==================
  4328.     @status_window2 = Window_Status2.new(@actor)
  4329.     @status_window2.x = 830
  4330.     @status_window2.y = 100
  4331.     @status_window2.opacity = 0
  4332.     #============Sets up the 3rd status window===================
  4333.     @status_window3 = Window_Status3.new(@actor)
  4334.     @status_window3.x = 220
  4335.     @status_window3.y = 700
  4336.     @status_window3.opacity = 0
  4337.     #=============Sets up the 4th status window==================
  4338.     @status_window4 = Window_Status4.new(@actor)
  4339.     @status_window4.x = - 280
  4340.     @status_window4.y = 385
  4341.     @status_window4.opacity = 0
  4342.     #============Sets up the 5th status window - battler=============
  4343.     @status_window5 = Window_Status5.new(@actor)
  4344.     @status_window5.x = - 300
  4345.     @status_window5.y = 0
  4346.     @status_window5.opacity = 0
  4347.     # トランジション実行
  4348.     Graphics.transition
  4349.     # メインループ
  4350.     loop do
  4351.       # ゲーム画面を更新
  4352.       Graphics.update
  4353.       # 入力情報を更新
  4354.       Input.update
  4355.       # フレーム更新
  4356.       update
  4357.       # 画面が切り替わったらループを中断
  4358.       if $scene != self
  4359.         break
  4360.       end
  4361.     end
  4362.     # トランジション準備
  4363.     Graphics.freeze
  4364.     # ウィンドウを解放
  4365.     @background.dispose
  4366.     @command4.dispose
  4367.     @commands4.dispose
  4368.     @picture_status1.dispose
  4369.     @picture_status2.dispose
  4370.     @picture_status3.dispose
  4371.     @picture_status4.dispose
  4372.     @status_window1.dispose
  4373.     @status_window2.dispose
  4374.     @status_window3.dispose
  4375.     @status_window4.dispose
  4376.     @status_window5.dispose
  4377.     @picture_shadow1.dispose
  4378.     @picture_shadow2.dispose
  4379.     @picture_shadow3.dispose
  4380.     @picture_shadow4.dispose
  4381.   end
  4382.   #--------------------------------------------------------------------------
  4383.     def delay(seconds)
  4384.   for i in 0...(seconds * 1)
  4385.     sleep 0.01
  4386.     Graphics.update
  4387.   end
  4388. end
  4389.   # ● フレーム更新
  4390.   #--------------------------------------------------------------------------
  4391.   def update
  4392.     #===========================================
  4393.     # enter animation
  4394.     if @picture_status1.y < 15
  4395.       @picture_status1.y += 45
  4396.     end
  4397.      if @picture_shadow1.y < 20
  4398.       @picture_shadow1.y += 45
  4399.     end
  4400.     if @picture_status2.x > 230
  4401.       @picture_status2.x -= 150
  4402.     end
  4403.       if @picture_shadow2.x > 235
  4404.       @picture_shadow2.x -= 150
  4405.     end
  4406.     if @picture_status3.y > 262
  4407.       @picture_status3.y -= 109
  4408.     end
  4409.     if @picture_shadow3.y > 267
  4410.       @picture_shadow3.y -= 109
  4411.     end
  4412.     if @picture_status4.x < 5
  4413.       @picture_status4.x += 95
  4414.     end
  4415.     if @picture_shadow4.x < 10
  4416.       @picture_shadow4.x += 95
  4417.     end
  4418.     if @status_window1.y < 0
  4419.       @status_window1.y += 80
  4420.     end
  4421.     if @status_window2.x > 230
  4422.       @status_window2.x -= 150
  4423.     end
  4424.     if @status_window3.y > 250
  4425.       @status_window3.y -= 150
  4426.     end
  4427.     if @status_window4.x < 5
  4428.       @status_window4.x += 95
  4429.     end
  4430.     if @status_window5.x < 0
  4431.       @status_window5.x += 100
  4432.       end
  4433.     # B ボタンが押された場合
  4434.     if Input.trigger?(Input::B)
  4435.       # exit animation
  4436.       loop do
  4437.     if @picture_status1.y > - 400
  4438.       @picture_status1.y -= 100
  4439.     end
  4440.       if @picture_shadow1.y > - 400
  4441.       @picture_shadow1.y -= 100
  4442.     end
  4443.     if @picture_status2.x < 640
  4444.       @picture_status2.x += 100
  4445.     end
  4446.      if @picture_shadow2.x < 640
  4447.       @picture_shadow2.x += 100
  4448.     end
  4449.     if @picture_status3.y < 480
  4450.       @picture_status3.y += 100
  4451.     end
  4452.      if @picture_shadow3.y < 480
  4453.       @picture_shadow3.y += 100
  4454.     end
  4455.     if @picture_status4.x > - 300
  4456.       @picture_status4.x -= 100
  4457.     end
  4458.     if @picture_shadow4.x > - 400
  4459.       @picture_shadow4.x -= 100
  4460.     end
  4461.     if @status_window1.y > - 400
  4462.       @status_window1.y -= 100
  4463.     end
  4464.     if @status_window2.x < 640
  4465.       @status_window2.x += 100
  4466.     end
  4467.     if @status_window3.y < 640
  4468.       @status_window3.y += 100
  4469.     end
  4470.     if @status_window4.x > - 200
  4471.       @status_window4.x -= 100
  4472.     end
  4473.     if @status_window5.x > - 300
  4474.       @status_window5.x -= 100
  4475.     end
  4476.     delay(0.1)
  4477.     if @status_window2.x >= 640
  4478.       break
  4479.     end
  4480.     end
  4481.       $game_system.se_play($data_system.cancel_se)
  4482.       # メニュー画面に切り替え
  4483.       $scene = Scene_Menu.new(3)
  4484.       return
  4485.     end
  4486.     # R ボタンが押された場合
  4487.     if Input.trigger?(Input::R)
  4488.       # カーソル SE を演奏
  4489.       $game_system.se_play($data_system.cursor_se)
  4490.       # 次のアクターへ
  4491.       @actor_index += 1
  4492.       @actor_index %= $game_party.actors.size
  4493.       # 別のステータス画面に切り替え
  4494.       $scene = Scene_Status.new(@actor_index)
  4495.       return
  4496.     end
  4497.     # L ボタンが押された場合
  4498.     if Input.trigger?(Input::L)
  4499.       # カーソル SE を演奏
  4500.       $game_system.se_play($data_system.cursor_se)
  4501.       # 前のアクターへ
  4502.       @actor_index += $game_party.actors.size - 1
  4503.       @actor_index %= $game_party.actors.size
  4504.       # 別のステータス画面に切り替え
  4505.       $scene = Scene_Status.new(@actor_index)
  4506.       return
  4507.     end
  4508.   end
  4509. end
  4510. #==============================================================================
  4511. # ■ Scene_File
  4512. #------------------------------------------------------------------------------
  4513. #  セーブ画面およびロード画面のスーパークラスです。
  4514. #==============================================================================

  4515. class Scene_File
  4516.   #--------------------------------------------------------------------------
  4517.   # ● オブジェクト初期化
  4518.   #     help_text : ヘルプウィンドウに表示する文字列
  4519.   #--------------------------------------------------------------------------
  4520.   def initialize(help_text)
  4521.     @help_text = help_text
  4522.   end
  4523.   #--------------------------------------------------------------------------
  4524.   # ● メイン処理
  4525.   #--------------------------------------------------------------------------
  4526.   def main
  4527.     # This is setting up the background picture
  4528.     @background = Sprite.new
  4529.     @background.bitmap = RPG::Cache.picture("save window")
  4530.     @background.x = 0
  4531.     @background.y = 0
  4532.     # ヘルプウィンドウを作成
  4533.     @help_window = Window_Help.new
  4534.     @help_window.opacity = 0
  4535.     @help_window.set_text(@help_text)
  4536.     # セーブファイルウィンドウを作成
  4537.     @savefile_windows = []
  4538.     for i in 0..3
  4539.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  4540.     end
  4541.     # 最後に操作したファイルを選択
  4542.     @file_index = $game_temp.last_file_index
  4543.     @savefile_windows[@file_index].selected = true
  4544.     # トランジション実行
  4545.     Graphics.transition
  4546.     # メインループ
  4547.     loop do
  4548.       # ゲーム画面を更新
  4549.       Graphics.update
  4550.       # 入力情報を更新
  4551.       Input.update
  4552.       # フレーム更新
  4553.       update
  4554.       # 画面が切り替わったらループを中断
  4555.       if $scene != self
  4556.         break
  4557.       end
  4558.     end
  4559.     # トランジション準備
  4560.     Graphics.freeze
  4561.     # ウィンドウを解放
  4562.     @background.dispose
  4563.     @help_window.dispose
  4564.     for i in @savefile_windows
  4565.       i.dispose
  4566.     end
  4567.   end
  4568.   #--------------------------------------------------------------------------
  4569.   # ● フレーム更新
  4570.   #--------------------------------------------------------------------------
  4571.   def update
  4572.     # ウィンドウを更新
  4573.     @help_window.update
  4574.     for i in @savefile_windows
  4575.       i.update
  4576.     end
  4577.     # C ボタンが押された場合
  4578.     if Input.trigger?(Input::C)
  4579.       # メソッド on_decision (継承先で定義) を呼ぶ
  4580.       on_decision(make_filename(@file_index))
  4581.       $game_temp.last_file_index = @file_index
  4582.       return
  4583.     end
  4584.     # B ボタンが押された場合
  4585.     if Input.trigger?(Input::B)
  4586.       # メソッド on_cancel (継承先で定義) を呼ぶ
  4587.       on_cancel
  4588.       return
  4589.     end
  4590.     # 方向ボタンの下が押された場合
  4591.     if Input.repeat?(Input::DOWN)
  4592.       # 方向ボタンの下の押下状態がリピートでない場合か、
  4593.       # またはカーソル位置が 3 より前の場合
  4594.       if Input.trigger?(Input::DOWN) or @file_index < 3
  4595.         # カーソル SE を演奏
  4596.         $game_system.se_play($data_system.cursor_se)
  4597.         # カーソルを下に移動
  4598.         @savefile_windows[@file_index].selected = false
  4599.         @file_index = (@file_index + 1) % 4
  4600.         @savefile_windows[@file_index].selected = true
  4601.         return
  4602.       end
  4603.     end
  4604.     # 方向ボタンの上が押された場合
  4605.     if Input.repeat?(Input::UP)
  4606.       # 方向ボタンの上の押下状態がリピートでない場合か、
  4607.       # またはカーソル位置が 0 より後ろの場合
  4608.       if Input.trigger?(Input::UP) or @file_index > 0
  4609.         # カーソル SE を演奏
  4610.         $game_system.se_play($data_system.cursor_se)
  4611.         # カーソルを上に移動
  4612.         @savefile_windows[@file_index].selected = false
  4613.         @file_index = (@file_index + 3) % 4
  4614.         @savefile_windows[@file_index].selected = true
  4615.         return
  4616.       end
  4617.     end
  4618.   end
  4619.   #--------------------------------------------------------------------------
  4620.   # ● ファイル名の作成
  4621.   #     file_index : セーブファイルのインデックス (0~3)
  4622.   #--------------------------------------------------------------------------
  4623.   def make_filename(file_index)
  4624.     return "Save#{file_index + 1}.rxdata"
  4625.   end
  4626. end
  4627. #==============================================================================
  4628. # ■ Scene_End
  4629. #------------------------------------------------------------------------------
  4630. #  ゲーム終了画面の処理を行うクラスです。
  4631. #==============================================================================

  4632. class Scene_End
  4633.   #--------------------------------------------------------------------------
  4634.   # ● メイン処理
  4635.   #--------------------------------------------------------------------------
  4636.   def main
  4637.      # This is setting up the background picture
  4638.     @background = Sprite.new
  4639.     @background.bitmap = RPG::Cache.picture("background")
  4640.     @background.x = 0
  4641.     @background.y = 0
  4642.     @background.opacity = 255
  4643.     # コマンドウィンドウを作成
  4644.     s1 = ""
  4645.     s2 = ""
  4646.     s3 = ""
  4647.     @command_window = Window_Command.new(192, [s1, s2, s3])
  4648.     @command_window.x = 320 - @command_window.width / 2
  4649.     @command_window.y = 240 - @command_window.height / 2
  4650.     @command_window.opacity = 0
  4651.     @command_window.visible = false
  4652.     #===============Arrow selection pic======================
  4653.     @arrow = Sprite.new
  4654.     @arrow.bitmap = RPG::Cache.picture("arrow4")
  4655.     @arrow.x = 340 - @command_window.width / 2 - 30
  4656.     @arrow.y = 175
  4657.     @arrow.z = 999
  4658.     #=======the end window - replaces command window===========
  4659.     @end_window = Window_End.new
  4660.     @end_window.x = 320 - @command_window.width / 2 + 8
  4661.     @end_window.y = 240 - @command_window.height / 2 - 15
  4662.     #=============end window pic============================
  4663.     @endwindow = Sprite.new
  4664.     @endwindow.bitmap = RPG::Cache.picture("endwindow")
  4665.     @endwindow.opacity = 255
  4666.     @endwindow.x = 320 - @command_window.width / 2 - 10
  4667.     @endwindow.y = 240 - @command_window.height / 2 - 10
  4668.     # トランジション実行
  4669.     Graphics.transition
  4670.     # メインループ
  4671.     loop do
  4672.       # ゲーム画面を更新
  4673.       Graphics.update
  4674.       # 入力情報を更新
  4675.       Input.update
  4676.       # フレーム更新
  4677.       update
  4678.       # 画面が切り替わったらループを中断
  4679.       if $scene != self
  4680.         break
  4681.       end
  4682.     end
  4683.     # トランジション準備
  4684.     Graphics.freeze
  4685.     # ウィンドウを解放
  4686.     @endwindow.dispose
  4687.     @command_window.dispose
  4688.     @end_window.dispose
  4689.     @arrow.dispose
  4690.     @background.dispose
  4691.     # タイトル画面に切り替え中の場合
  4692.     if $scene.is_a?(Scene_Title)
  4693.       # 画面をフェードアウト
  4694.       Graphics.transition
  4695.       Graphics.freeze
  4696.     end
  4697.   end
  4698.   #--------------------------------------------------------------------------
  4699.      def delay(seconds)
  4700.   for i in 0...(seconds * 1)
  4701.     sleep 0.01
  4702.     Graphics.update
  4703.   end
  4704. end
  4705.   # ● フレーム更新
  4706.   #--------------------------------------------------------------------------
  4707.   def update
  4708.     # Little effect added
  4709.       if @background.opacity > 100
  4710.         @background.opacity -= 2
  4711.       end
  4712.       if @endwindow.opacity > 150
  4713.         @endwindow.opacity -= 1
  4714.         end
  4715.     case @command_window.index
  4716.      when 0
  4717.        @arrow.y = 175
  4718.      when 1
  4719.        @arrow.y = 220
  4720.      when 2
  4721.        @arrow.y = 265
  4722.        end
  4723.     # コマンドウィンドウを更新
  4724.     @command_window.update
  4725.     # B ボタンが押された場合
  4726.     if Input.trigger?(Input::B)
  4727.       # キャンセル SE を演奏
  4728.       $game_system.se_play($data_system.cancel_se)
  4729.       # メニュー画面に切り替え
  4730.       $scene = Scene_Menu.new(5)
  4731.       return
  4732.     end
  4733.     # C ボタンが押された場合
  4734.     if Input.trigger?(Input::C)
  4735.       # コマンドウィンドウのカーソル位置で分岐
  4736.       case @command_window.index
  4737.       when 0  # タイトルへ
  4738.         command_to_title
  4739.       when 1  # シャットダウン
  4740.         command_shutdown
  4741.       when 2  # やめる
  4742.         command_cancel
  4743.       end
  4744.       return
  4745.     end
  4746.   end
  4747.   #--------------------------------------------------------------------------
  4748.   # ● コマンド [タイトルへ] 選択時の処理
  4749.   #--------------------------------------------------------------------------
  4750.   def command_to_title
  4751.     # 決定 SE を演奏
  4752.     $game_system.se_play($data_system.decision_se)
  4753.     # BGM、BGS、ME をフェードアウト
  4754.     Audio.bgm_fade(800)
  4755.     Audio.bgs_fade(800)
  4756.     Audio.me_fade(800)
  4757.     # タイトル画面に切り替え
  4758.     $scene = Scene_Title.new
  4759.   end
  4760.   #--------------------------------------------------------------------------
  4761.   # ● コマンド [シャットダウン] 選択時の処理
  4762.   #--------------------------------------------------------------------------
  4763.   def command_shutdown
  4764.     # 決定 SE を演奏
  4765.     $game_system.se_play($data_system.decision_se)
  4766.     # BGM、BGS、ME をフェードアウト
  4767.     Audio.bgm_fade(800)
  4768.     Audio.bgs_fade(800)
  4769.     Audio.me_fade(800)
  4770.     # シャットダウン
  4771.     $scene = nil
  4772.   end
  4773.   #--------------------------------------------------------------------------
  4774.   # ● コマンド [やめる] 選択時の処理
  4775.   #--------------------------------------------------------------------------
  4776.   def command_cancel
  4777.     # 決定 SE を演奏
  4778.     $game_system.se_play($data_system.decision_se)
  4779.     # メニュー画面に切り替え
  4780.     $scene = Scene_Menu.new(5)
  4781.   end
  4782. end
复制代码
好人做到底,把我找的素材也给你把
如果想自己更换就对照我给的素材的大小去该就可以了

Pictures.rar

1.49 MB, 下载次数: 58

评分

参与人数 1梦石 +1 收起 理由
myownroc + 1 塞糖

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-22 15:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表