查看: 2289|回复: 0

[已经过期] 有谁知道这些脚本的作者吗?

[复制链接]
梦石
0
星屑
3810
在线时间
744 小时
注册时间
2016-6-2
回帖
175

开拓者

发表于 2017-10-3 15:29:11 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 David_Exmachina 于 2017-10-3 15:40 编辑

如题,由于论坛搬迁后提高了素材要求,
所以我想知道这些脚本是谁写的。


制作人员名单
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #——————————————————————————————————————
  5. # Scene_Credit 制作人员名单
  6. #——————————————————————————————————————

  7. #——使用注意:默认会返回地图,如果需要返回开头,请将本脚本中的
  8. #return_scene = Scene_Map.new改为return_scene = Scene_Title.new
  9. class Scene_Credit
  10.   CREDIT=<<_END_
  11. -----Cast------
  12. 制作工具:RPG Maker XP
  13. 先帝创业未半而中道崩殂
  14. 今天下三分,益州疲弊
  15. 此诚危急存亡之秋也
  16. 然侍卫之臣不懈于内,忠志之士忘身于外者
  17. 盖追先帝之殊遇,欲报之于陛下也
  18. 诚宜开张圣听,以光先帝遗德,恢弘志士之气
  19. 不宜妄自菲薄,引喻失义,以塞忠谏之路也
  20. 宫中府中,俱为一体,陟罚臧否,不宜异同
  21. 若有作奸犯科及为忠善者
  22. 宜付有司论其刑赏,以昭陛下平明之理
  23. 不宜偏私,使内外异法也。
  24. 侍中侍郎郭攸之、费祎、董允等
  25. 此皆良实,志虑忠纯,是以先帝简拔以遗陛下
  26. 愚以为宫中之事,事无大小,悉以咨之,然后施行
  27. 必能裨补阙漏,有所广益。

  28. _END_
  29. end
  30. class Scene_Credit
  31.   def initialize(return_scene = nil)
  32.     @sprite = Sprite.new
  33.     @sprite.bitmap = Bitmap.new("Graphics/Pictures/1")
  34.     @sprite.x = 0
  35.     @sprite.y = 0
  36.     if return_scene.nil?
  37.       return_scene = Scene_Map.new
  38.     end
  39.     @return_scene = return_scene
  40.   end
  41.   
  42.   def scene_start
  43.     credit_lines = CREDIT.split(/\n/)
  44.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  45.     credit_lines.each_index do |i|
  46.       line = credit_lines[i]
  47.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  48.     end
  49.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
  50.     @credit_sprite.bitmap = credit_bitmap
  51.     @credit_sprite.oy = -430
  52.     @frame_index = 0
  53.     @last_flag = false
  54.   end
  55.   def scene_end
  56.     @credit_sprite.dispose
  57.     @sprite.dispose
  58.   end
  59.   
  60.   def last?
  61.     return (@frame_index >= @credit_sprite.bitmap.height + 480)
  62.   end
  63.   
  64.   def last
  65.     if not @last_flag
  66.       Audio.bgm_fade(10000)
  67.       @last_flag = true
  68.       @last_count = 0
  69.     else
  70.       @last_count += 1
  71.     end
  72.     if @last_count >= 300
  73.       $scene = @return_scene
  74.     end
  75.   end
  76.   
  77.   def update
  78.     @frame_index += 1
  79.     return if cancel?
  80.     last if last?
  81.     @credit_sprite.oy += 1
  82.   end
  83.   def cancel?
  84.     if Input.trigger?(Input::B)
  85.       $scene = @return_scene
  86.       return true
  87.     end
  88.     return false
  89.   end
  90.   def main
  91.     scene_start
  92.     # 过渡
  93.     Graphics.transition
  94.     # 主循环
  95.     loop do
  96.       Graphics.update
  97.       Input.update
  98.       update
  99.       if $scene != self
  100.         break
  101.       end
  102.     end
  103.     # 准备过渡
  104.     Graphics.freeze
  105.     scene_end
  106.   end
  107. end
  108. #==============================================================================
  109. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  110. #==============================================================================
复制代码



截图存档
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],转载和使用请保留此信息
  3. #===============================================================================

  4. BBS_66RPG_DIR = "Save/"  # 储存文件夹名,请制作游戏时自行建立此文件夹

  5. # 若想使用自定义背景图,脚本62行的井号去掉,并放置一张相应图形。

  6. # 在你的Scene_Title中找到这一段(如果使用其他插件脚本,在插件中找):
  7. #    for i in 0..3
  8. #      if FileTest.exist?("Save#{i+1}.rxdata")
  9. # 请自行把0..3改为0..最大进度号,比如0..9
  10. # "Save#{i+1}.rxdata" 改为"Save/Save#{i}.rxdata"

  11. # 增加进度的方法:138,258行,继续添加。你也可以改“进度X”为“回忆X”或者“红/绿/蓝笔记本”

  12. #===============================================================================
  13. module Screen  
  14.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  15.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  16.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  17.   module_function
  18.   #-----------------------------------------------------------------------------
  19.   # here comes the stuff...
  20.   # i add here the stuff for automatic change of the number for the screenshot
  21.   # so it wont overrite the old one...
  22.   # if you want to change so stuff change them in this line below
  23.   # or you can change them in your command line... like
  24.   # Screen::shot("screenshot", 2)
  25.   # this change the name and the type of the screenshot
  26.   # (0 = bmp, 1 = jpg and 2 = png)
  27.   # ----------------------------------------------------------------------------
  28.   def shot(file = "shot", typ = 1)
  29.     # to add the right extension...
  30.     if typ == 0
  31.       typname = ".bmp"
  32.     elsif typ == 1
  33.       typname = ".jpg"
  34.     elsif typ == 2
  35.       typname = ".png"
  36.     end   
  37.     file_index = 0   
  38.     dir = "Save/"   
  39.     # make the filename....
  40.     file_name = dir + file.to_s + typname.to_s   
  41.     # make the screenshot.... Attention dont change anything from here on....
  42.     @screen.call(0,0,640,480,file_name,get_window_handle,typ)
  43.   end
  44.   # find the game window...
  45.   #def handel
  46.     #game_name = "\0" * 256
  47.     #@readini.call('Game','Title','',game_name,255,".\\Game.ini")
  48.     #game_name.delete!("\0")
  49.     #return @findwindow.call('RGSS Player',game_name)
  50.   #end
  51. end
  52. class Window_File < Window_Base
  53.   attr_accessor :index
  54.   def initialize(index = 0)
  55.     @backsp = Sprite.new
  56.     @backsp.bitmap = Bitmap.new("Graphics/Pictures/存盘背景.jpg")
  57.     @backsp.z = 99
  58.     super(160,0,480,368)
  59.     self.back_opacity = 80
  60.     #这行可以不用
  61.     self.contents = Bitmap.new(width - 32, height - 32)
  62.     @index = index   
  63.     #这里我要说明一句,之所以用sprite是为了放缩图片
  64.     @sprite = Sprite.new
  65.     @sprite.visible = false
  66.     @sprite.z = 100
  67.     @sp_ch = []
  68.     @sp_ch[0] = Sprite.new
  69.     refresh
  70.   end
  71.   def refresh
  72.     self.contents.clear
  73.     for i in @sp_ch
  74.       i.visible = false
  75.     end
  76.     @sprite.visible = false
  77.     if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
  78.       @sprite.visible = true
  79.       if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
  80.         @sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
  81.       else
  82.         self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  83.       end
  84.       @sprite.x = 176
  85.       @sprite.y = 16
  86.       @sprite.zoom_x = 0.7
  87.       @sprite.zoom_y = 0.7
  88.       file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
  89.       @time_stamp = file.mtime
  90.       @characters = Marshal.load(file)
  91.       @frame_count = Marshal.load(file)
  92.       @game_system = Marshal.load(file)
  93.       @game_switches = Marshal.load(file)
  94.       @game_variables = Marshal.load(file)
  95.       @total_sec = @frame_count / Graphics.frame_rate
  96.       file.close
  97.       for i in [url=mailto:0...@characters.size]0...@characters.size[/url]
  98.         @sp_ch[i] = Sprite.new
  99.         @sp_ch[i].visible = true
  100.         @sp_ch[i].bitmap = RPG::Cache.battler(@characters[i][3], @characters[i][4])
  101.         @sp_ch[i].x = 180 + i* 100     
  102.         @sp_ch[i].y = 310 - @sp_ch[i].bitmap.height
  103.         @sp_ch[i].z = 101
  104.         @sp_ch[i].opacity = 80
  105.       end
  106.       # 描绘游戏时间
  107.       hour = @total_sec / 60 / 60
  108.       min = @total_sec / 60 % 60
  109.       sec = @total_sec % 60
  110.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  111.       self.contents.font.color = normal_color
  112.       self.contents.draw_text(32, 60, 410, 70, time_string, 2)
  113.       # 描绘时间标记
  114.       self.contents.font.color = normal_color
  115.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  116.       self.contents.draw_text(32, 40, 410, 50, time_string, 2)
  117.      case self.index
  118.       when $game_temp.last_file_index
  119.        self.contents.draw_text(20,20,410,20,"最近的进度")
  120.     end
  121.   else
  122.       self.contents.draw_text(20,20,410,20,"这个进度是空的")
  123.     end
  124.   end
  125.   def dispose
  126.     super
  127.     @sprite.dispose
  128.     @backsp.dispose
  129.     for i in @sp_ch
  130.       i.dispose
  131.     end
  132.   end
  133. end
  134. class Scene_Save
  135.   def main
  136.     @screen = Spriteset_Map.new
  137.     @command_window = Window_Command.new(160,["进度一","进度二","进度三","进度四","进度五","进度六"])
  138.     @command_window.contents.font.size = 24
  139.     @command_window.contents.font.bold = true
  140.     @command_window.y = 96
  141.     @command_window.index = $game_temp.last_file_index
  142.     @command_window.opacity = 0
  143.     @command_window.windowskin = nil
  144.     @content_window = Window_File.new($game_temp.last_file_index)
  145.     # 执行过渡
  146.     Graphics.transition
  147.     # 主循环
  148.     loop do
  149.       # 刷新游戏画面
  150.       Graphics.update
  151.       # 刷新输入信息
  152.       Input.update
  153.       # 刷新画面
  154.       update
  155.       # 如果画面被切换的话就中断循环
  156.       if $scene != self
  157.         break
  158.       end
  159.     end
  160.     # 准备过渡
  161.     Graphics.freeze
  162.     @screen.dispose
  163.     @command_window.dispose
  164.     @content_window.dispose
  165.   end
  166.   def update
  167.     @command_window.update   
  168.     if @command_window.index != @content_window.index
  169.       @content_window.index = @command_window.index
  170.       @content_window.refresh
  171.     end   
  172.     #——————下面这一部分是原装脚本——————#
  173.     if Input.trigger?(Input::B)  
  174.       $game_system.se_play($data_system.cancel_se)
  175.       if $game_temp.save_calling
  176.         $game_temp.save_calling = false
  177.         $scene = Scene_Map.new
  178.         return
  179.       end
  180.       $scene = Scene_Menu.new(4)
  181.     end   
  182.     #———————————————————————#   
  183.     if Input.trigger?(Input::C)
  184.       # 演奏存档 SE
  185.       $game_system.se_play($data_system.save_se)
  186.       # 写入存档数据
  187.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "wb")
  188.       write_save_data(file)
  189.       if FileTest.exist?(BBS_66RPG_DIR+"shot.jpg")
  190.         File.rename(BBS_66RPG_DIR+"shot.jpg", BBS_66RPG_DIR+"Save#{@command_window.index}.jpg")
  191.       end
  192.       file.close
  193.       $game_temp.last_file_index = @command_window.index
  194.       # 如果被事件调用
  195.       if $game_temp.save_calling
  196.         # 清除存档调用标志
  197.         $game_temp.save_calling = false
  198.         # 切换到地图画面
  199.         $scene = Scene_Map.new
  200.         return
  201.       end
  202.       # 切换到菜单画面
  203.       $scene = Scene_Map.new
  204.     end
  205.     #———————————————————————#
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● 写入存档数据
  209.   #     file : 写入用文件对像 (已经打开)
  210.   #--------------------------------------------------------------------------
  211.   def write_save_data(file)
  212.     # 生成描绘存档文件用的角色图形
  213.     characters = []
  214.     for i in 0...$game_party.actors.size
  215.       actor = $game_party.actors[i]
  216.       characters.push([actor.character_name, actor.character_hue, actor.id, actor.battler_name, actor.battler_hue])
  217.     end
  218.     # 写入描绘存档文件用的角色数据
  219.     Marshal.dump(characters, file)
  220.     # 写入测量游戏时间用画面计数
  221.     Marshal.dump(Graphics.frame_count, file)
  222.     # 增加 1 次存档次数
  223.     $game_system.save_count += 1
  224.     # 保存魔法编号
  225.     # (将编辑器保存的值以随机值替换)
  226.     $game_system.magic_number = $data_system.magic_number
  227.     # 写入各种游戏对像
  228.     Marshal.dump($data_skills, file)
  229.     Marshal.dump($game_system, file)
  230.     Marshal.dump($game_switches, file)
  231.     Marshal.dump($game_variables, file)
  232.     Marshal.dump($game_self_switches, file)
  233.     Marshal.dump($game_screen, file)
  234.     Marshal.dump($game_actors, file)
  235.     Marshal.dump($game_party, file)
  236.     Marshal.dump($game_troop, file)
  237.     Marshal.dump($game_map, file)
  238.     Marshal.dump($game_player, file)
  239.     Marshal.dump($pet_array, file)
  240.     end
  241. end
  242. class Scene_Load
  243.   
  244.   def initialize
  245.     # 再生成临时对像
  246.     $game_temp = Game_Temp.new
  247.     # 选择存档时间最新的文件
  248.     $game_temp.last_file_index = 0
  249.     latest_time = Time.at(0)
  250.     for i in 0..5
  251.       filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  252.       if FileTest.exist?(filename)
  253.         file = File.open(filename, "r")
  254.         if file.mtime > latest_time
  255.           latest_time = file.mtime
  256.           $game_temp.last_file_index = i
  257.         end
  258.         file.close
  259.       end
  260.     end
  261.   end  
  262.   def main
  263.     @command_window = Window_Command.new(160,["进度一","进度二","进度三","进度四","进度五","进度六"])
  264.     for i in 0..5
  265.       filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  266.       if !FileTest.exist?(filename)
  267.       @command_window.disable_item(i)
  268.       end
  269.     end
  270.     @command_window.contents.font.size = 24
  271.     @command_window.contents.font.bold = true
  272.     @command_window.y = 96
  273.     @command_window.opacity = 0
  274.     @command_window.index = $game_temp.last_file_index
  275.     @content_window = Window_File.new($game_temp.last_file_index)
  276.     @command_window.windowskin = nil
  277.     # 执行过渡
  278.     Graphics.transition
  279.     # 主循环
  280.     loop do
  281.       # 刷新游戏画面
  282.       Graphics.update
  283.       # 刷新输入信息
  284.       Input.update
  285.       # 刷新画面
  286.       update
  287.       # 如果画面被切换的话就中断循环
  288.       if $scene != self
  289.         break
  290.       end
  291.     end
  292.     # 准备过渡
  293.     Graphics.freeze
  294.     @command_window.dispose
  295.     @content_window.dispose
  296.   end
  297.   def update
  298.     @command_window.update
  299.     if @command_window.index != @content_window.index
  300.       @content_window.index = @command_window.index
  301.       @content_window.refresh
  302.     end   
  303.     #——————下面这一部分是原装脚本——————#
  304.     if Input.trigger?(Input::B)  
  305.     # 演奏取消 SE
  306.     $game_system.se_play($data_system.cancel_se)
  307.     # 切换到标题画面
  308.     $scene = Scene_Title.new
  309.     end   
  310.     #———————————————————————#   
  311.     if Input.trigger?(Input::C)
  312.       # 文件不存在的情况下
  313.       unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata")
  314.         # 演奏冻结 SE
  315.         $game_system.se_play($data_system.buzzer_se)
  316.         return
  317.       end
  318.       # 演奏读档 SE
  319.       $game_system.se_play($data_system.load_se)
  320.       # 写入存档数据
  321.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "rb")
  322.       read_save_data(file)
  323.       file.close
  324.       # 还原 BGM、BGS
  325.       $game_system.bgm_play($game_system.playing_bgm)
  326.       $game_system.bgs_play($game_system.playing_bgs)
  327.       # 刷新地图 (执行并行事件)
  328.       $game_map.update
  329.       # 切换到地图画面
  330.       $scene = Scene_Map.new
  331.     end
  332.     #———————————————————————#
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 写入存档数据
  336.   #     file : 写入用文件对像 (已经打开)
  337.   #--------------------------------------------------------------------------
  338.   def read_save_data(file)
  339.     # 读取描绘存档文件用的角色数据
  340.     characters = Marshal.load(file)
  341.     # 读取测量游戏时间用画面计数
  342.     Graphics.frame_count = Marshal.load(file)
  343.     # 读取各种游戏对像
  344.     $data_skills        = Marshal.load(file)
  345.     $game_system        = Marshal.load(file)
  346.     $game_switches      = Marshal.load(file)
  347.     $game_variables     = Marshal.load(file)
  348.     $game_self_switches = Marshal.load(file)
  349.     $game_screen        = Marshal.load(file)
  350.     $game_actors        = Marshal.load(file)
  351.     $game_party         = Marshal.load(file)
  352.     $game_troop         = Marshal.load(file)
  353.     $game_map           = Marshal.load(file)
  354.     $game_player        = Marshal.load(file)
  355.     $pet_array          = Marshal.load(file)
  356.     # 魔法编号与保存时有差异的情况下
  357.     # (加入编辑器的编辑过的数据)
  358.     if $game_system.magic_number != $data_system.magic_number
  359.       # 重新装载地图
  360.       $game_map.setup($game_map.map_id)
  361.       $game_player.center($game_player.x, $game_player.y)
  362.     end
  363.     # 刷新同伴成员
  364.     $game_party.refresh
  365.   end
  366. end
  367. class Scene_Menu
  368.   alias bbs_66rpg_shotsave_main main
  369.   def main
  370.     if $menu_save
  371.       Screen::shot
  372.       $menu_save = false
  373.     end   
  374.     bbs_66rpg_shotsave_main
  375.   end
  376. end
  377. class Interpreter
  378.   #--------------------------------------------------------------------------
  379.   # ● 调用存档画面
  380.   #--------------------------------------------------------------------------
  381.   def command_352
  382.     # 设置战斗中断标志
  383.     $game_temp.battle_abort = true
  384.     # 设置调用存档标志
  385.     $game_temp.save_calling = true
  386.     # 推进索引
  387.     @index += 1
  388.     # 结束
  389.     Screen::shot
  390.     return false
  391.   end
  392. end
  393. #==============================================================================
  394. # 本脚本来自[url=http://www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息
  395. #==============================================================================
复制代码




物品分类
  1. # ————————————————————————————————————
  2. # 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
  3. # ————————————————————————————————————

  4. #==============================================================================
  5. # ■ Harts_Window_ItemTitle
  6. #------------------------------------------------------------------------------
  7. #  アイテム画面で、タイトルを表示するウィンドウ。
  8. #==============================================================================

  9. class Harts_Window_ItemTitle < Window_Base
  10.   #--------------------------------------------------------------------------
  11.   # ● オブジェクト初期化
  12.   #--------------------------------------------------------------------------
  13.   def initialize
  14.     super(0, 0, 160, 64)
  15.     self.contents = Bitmap.new(width - 32, height - 32)
  16.     self.contents.clear
  17.     self.contents.font.color = normal_color
  18.     self.contents.draw_text(4, 0, 120, 32, $data_system.words.item, 1)
  19.   end
  20. end

  21. #==============================================================================
  22. # ■ Harts_Window_ItemCommand
  23. #------------------------------------------------------------------------------
  24. #  アイテムの種別選択を行うウィンドウです。
  25. #==============================================================================

  26. class Harts_Window_ItemCommand < Window_Selectable
  27.   #--------------------------------------------------------------------------
  28.   # ● オブジェクト初期化
  29.   #--------------------------------------------------------------------------
  30.   def initialize
  31.     super(0, 64, 160, 288)
  32.     self.contents = Bitmap.new(width - 32, height - 32)
  33.     @item_max = 8
  34.     @commands = ["常规物品", "战斗物品", $data_system.words.weapon, $data_system.words.armor1, $data_system.words.armor2, $data_system.words.armor3, $data_system.words.armor4, "特殊道具"]
  35.     refresh
  36.     self.index = 0
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● リフレッシュ
  40.   #--------------------------------------------------------------------------
  41.   def refresh
  42.     self.contents.clear
  43.     for i in 0...@item_max
  44.     draw_item(i, normal_color)
  45.     end
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ● 項目の描画
  49.   # index : 項目番号
  50.   # color : 文字色
  51.   #--------------------------------------------------------------------------
  52.   def draw_item(index, color)
  53.     self.contents.font.color = color
  54.     y = index * 32
  55.     self.contents.draw_text(4, y, 128, 32, @commands[index])
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● ヘルプテキスト更新
  59.   #--------------------------------------------------------------------------
  60.   def update_help
  61.     case self.index
  62.     when 0
  63.       @text = @commands[0]
  64.     when 1
  65.       @text = @commands[1]
  66.     when 2
  67.       @text = @commands[2]
  68.     when 3
  69.       @text = @commands[3]
  70.     when 4
  71.       @text = @commands[4]
  72.     when 5
  73.       @text = @commands[5]
  74.     when 6
  75.       @text = @commands[6]
  76.     when 7
  77.       @text = @commands[7]
  78.     end
  79.     @help_window.set_text(@text)
  80.   end
  81. end

  82. #==============================================================================
  83. # ■ Window_Item
  84. #------------------------------------------------------------------------------
  85. #  アイテム画面で、所持アイテムの一覧を表示するウィンドウです。
  86. #==============================================================================

  87. class Harts_Window_ItemList < Window_Selectable
  88.   #--------------------------------------------------------------------------
  89.   # ● オブジェクト初期化
  90.   #--------------------------------------------------------------------------
  91.   def initialize
  92.     super(160, 0, 480, 416)
  93.     refresh
  94.     self.index = 0
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● アイテムの取得
  98.   #--------------------------------------------------------------------------
  99.   def item
  100.     return @data[self.index]
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● リフレッシュ
  104.   #--------------------------------------------------------------------------
  105.   def refresh
  106.     if self.contents != nil
  107.       self.contents.dispose
  108.       self.contents = nil
  109.     end
  110.     @data = []
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● アイテム一覧設定
  114.   # command : 選択中のコマンド
  115.   #--------------------------------------------------------------------------
  116.   def set_item(command)
  117.     refresh
  118.     case command
  119.     when 0
  120.       for i in 1...$data_items.size
  121.         if ($data_items[i].occasion == 0 or $data_items[i].occasion == 2) and $game_party.item_number(i) > 0
  122.           @data.push($data_items[i])
  123.         end
  124.       end
  125.     when 1
  126.       for i in 1...$data_items.size
  127.         if ($data_items[i].occasion == 1 and $game_party.item_number(i) > 0)
  128.           @data.push($data_items[i])
  129.         end
  130.       end
  131.     when 2
  132.       for i in 1...$data_weapons.size
  133.         if $game_party.weapon_number(i) > 0
  134.           @data.push($data_weapons[i])
  135.         end
  136.       end
  137.     when 3
  138.       for i in 1...$data_armors.size
  139.         if $data_armors[i].kind == 0 and $game_party.armor_number(i) > 0
  140.           @data.push($data_armors[i])
  141.         end
  142.       end
  143.     when 4
  144.       for i in 1...$data_armors.size
  145.         if $data_armors[i].kind == 1 and $game_party.armor_number(i) > 0
  146.           @data.push($data_armors[i])
  147.         end
  148.       end
  149.     when 5
  150.       for i in 1...$data_armors.size
  151.         if $data_armors[i].kind == 2 and $game_party.armor_number(i) > 0
  152.           @data.push($data_armors[i])
  153.         end
  154.       end
  155.     when 6
  156.       for i in 1...$data_armors.size
  157.         if $data_armors[i].kind == 3 and $game_party.armor_number(i) > 0
  158.           @data.push($data_armors[i])
  159.         end
  160.       end
  161.     when 7
  162.       for i in 1...$data_items.size
  163.         if $data_items[i].occasion == 3 and $game_party.item_number(i) > 0
  164.           @data.push($data_items[i])
  165.         end
  166.       end
  167.     end
  168.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  169.     @item_max = @data.size
  170.     if @item_max > 0
  171.       self.contents = Bitmap.new(width - 32, row_max * 32)
  172.       self.contents.clear
  173.       for i in 0...@item_max
  174.         draw_item(i)
  175.       end
  176.     end
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● 種類別アイテム数の取得
  180.   #--------------------------------------------------------------------------
  181.   def item_number
  182.     return @item_max
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 項目の描画
  186.   # index : 項目番号
  187.   #--------------------------------------------------------------------------
  188.   def draw_item(index)
  189.     item = @data[index]
  190.     case item
  191.     when RPG::Item
  192.       number = $game_party.item_number(item.id)
  193.     when RPG::Weapon
  194.       number = $game_party.weapon_number(item.id)
  195.     when RPG::Armor
  196.       number = $game_party.armor_number(item.id)
  197.     end
  198.     if item.is_a?(RPG::Item) and
  199.       $game_party.item_can_use?(item.id)
  200.       self.contents.font.color = normal_color
  201.     else
  202.       self.contents.font.color = disabled_color
  203.     end
  204.     x = 4
  205.     y = index * 32
  206.     bitmap = RPG::Cache.icon(item.icon_name)
  207.     opacity = self.contents.font.color == normal_color ? 255 : 128
  208.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  209.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  210.     self.contents.draw_text(x + 400, y, 16, 32, ":", 1)
  211.     self.contents.draw_text(x + 416, y, 24, 32, number.to_s, 2)
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● ヘルプテキスト更新
  215.   #--------------------------------------------------------------------------
  216.   def update_help
  217.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  218.   end
  219. end

  220. #==============================================================================
  221. # ■ Harts_Scene_Item
  222. #------------------------------------------------------------------------------
  223. #  アイテム画面の処理を行うクラスです。再定義
  224. #==============================================================================

  225. class Scene_Item
  226.   #--------------------------------------------------------------------------
  227.   # ● メイン処理
  228.   #--------------------------------------------------------------------------
  229.   include OPACITY_66RPG
  230.   def main
  231.     create_screen
  232.     # タイトルウィンドウを作成
  233.     @itemtitle_window = Harts_Window_ItemTitle.new
  234.     #コマンドウィンドウを作成
  235.     @itemcommand_window = Harts_Window_ItemCommand.new
  236.     @command_index = @itemcommand_window.index
  237.     #アイテムウィンドウを作成
  238.     @itemlist_window = Harts_Window_ItemList.new
  239.     @itemlist_window.active = false
  240.     #ヘルプウィンドウを作成
  241.     @help_window = Window_Help.new
  242.     @help_window.x = 0
  243.     @help_window.y = 416
  244.     # ヘルプウィンドウを関連付け
  245.     @itemcommand_window.help_window = @help_window
  246.     @itemlist_window.help_window = @help_window
  247.     # ターゲットウィンドウを作成 (不可視?非アクティブに設定)
  248.     @target_window = Window_Target.new
  249.     @target_window.visible = false
  250.     @target_window.active = false
  251.     # アイテムウィンドウ内容表示
  252.     @itemlist_window.set_item(@command_index)
  253.     # トランジション実行
  254.     Graphics.transition
  255.     # メインループ
  256.     loop do
  257.       # ゲーム画面を更新
  258.       Graphics.update
  259.       # 入力情報を更新
  260.       Input.update
  261.       # フレーム更新
  262.       update
  263.       # 画面が切り替わったらループを中断
  264.       if $scene != self
  265.         break
  266.       end
  267.     end
  268.     # トランジション準備
  269.     Graphics.freeze
  270.     # ウィンドウを解放
  271.     @itemtitle_window.dispose
  272.     @itemcommand_window.dispose
  273.     @itemlist_window.dispose
  274.     @help_window.dispose
  275.     @target_window.dispose
  276.     dispose_screen
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● フレーム更新
  280.   #--------------------------------------------------------------------------
  281.   def update
  282.     # ウィンドウを更新
  283.     @itemtitle_window.update
  284.     @itemcommand_window.update
  285.     @itemlist_window.update
  286.     @help_window.update
  287.     @target_window.update
  288.     if @command_index != @itemcommand_window.index
  289.       @command_index = @itemcommand_window.index
  290.       @itemlist_window.set_item(@command_index)
  291.     end
  292.     # コマンドウィンドウがアクティブの場合: update_itemcommand を呼ぶ
  293.     if @itemcommand_window.active
  294.       update_itemcommand
  295.       return
  296.     end
  297.     # アイテムウィンドウがアクティブの場合: update_itemlist を呼ぶ
  298.     if @itemlist_window.active
  299.       update_itemlist
  300.       return
  301.     end
  302.     # ターゲットウィンドウがアクティブの場合: update_target を呼ぶ
  303.     if @target_window.active
  304.       update_target
  305.       return
  306.     end
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  310.   #--------------------------------------------------------------------------
  311.   def update_itemcommand
  312.   # B ボタンが押された場合
  313.   if Input.trigger?(Input::B)
  314.   # キャンセル SE を演奏
  315.   $game_system.se_play($data_system.cancel_se)
  316.   # メニュー画面に切り替え
  317.   $scene = Scene_Menu.new(0)
  318.   return
  319.   end
  320.   # C ボタンが押された場合
  321.   if Input.trigger?(Input::C)
  322.   # 選択中のコマンドのアイテムがない場合
  323.   if @itemlist_window.item_number == 0
  324.   # ブザー SE を演奏
  325.   $game_system.se_play($data_system.buzzer_se)
  326.   return
  327.   end
  328.   # 決定 SE を演奏
  329.   $game_system.se_play($data_system.decision_se)
  330.   # アイテムウィンドウをアクティブにする
  331.   @itemcommand_window.active = false
  332.   @itemlist_window.active = true
  333.   @itemlist_window.index = 0
  334.   return
  335.   end
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● フレーム更新 (アイテムウィンドウがアクティブの場合)
  339.   #--------------------------------------------------------------------------
  340.   def update_itemlist
  341.     # B ボタンが押された場合
  342.     if Input.trigger?(Input::B)
  343.       # キャンセル SE を演奏
  344.       $game_system.se_play($data_system.cancel_se)
  345.       # アイテムウィンドウをアクティブにする
  346.       @itemcommand_window.active = true
  347.       @itemlist_window.active = false
  348.       @itemlist_window.index = 0
  349.       @itemcommand_window.index = @command_index
  350.       return
  351.     end
  352.     # C ボタンが押された場合
  353.     if Input.trigger?(Input::C)
  354.       # アイテムウィンドウで現在選択されているデータを取得
  355.       @item = @itemlist_window.item
  356.       # 使用アイテムではない場合
  357.       unless @item.is_a?(RPG::Item)
  358.         # ブザー SE を演奏
  359.         $game_system.se_play($data_system.buzzer_se)
  360.         return
  361.       end
  362.       # 使用できない場合
  363.       unless $game_party.item_can_use?(@item.id)
  364.         # ブザー SE を演奏
  365.         $game_system.se_play($data_system.buzzer_se)
  366.         return
  367.       end
  368.       # 決定 SE を演奏
  369.       $game_system.se_play($data_system.decision_se)
  370.       # 効果範囲が味方の場合
  371.       if @item.scope >= 3
  372.         # ターゲットウィンドウをアクティブ化
  373.         @itemlist_window.active = false
  374.         @target_window.x = 304
  375.         @target_window.visible = true
  376.         @target_window.active = true
  377.         # 効果範囲 (単体/全体) に応じてカーソル位置を設定
  378.         if @item.scope == 4 || @item.scope == 6
  379.           @target_window.index = -1
  380.         else
  381.           @target_window.index = 0
  382.         end
  383.         # 効果範囲が味方以外の場合
  384.       else
  385.         # コモンイベント ID が有効の場合
  386.         if @item.common_event_id > 0
  387.           # コモンイベント呼び出し予約
  388.           $game_temp.common_event_id = @item.common_event_id
  389.           # アイテムの使用時 SE を演奏
  390.           $game_system.se_play(@item.menu_se)
  391.           # 消耗品の場合
  392.             if @item.consumable
  393.               # 使用したアイテムを 1 減らす
  394.               $game_party.lose_item(@item.id, 1)
  395.               # アイテムウィンドウの項目を再描画
  396.               @itemlist_window.draw_item(@itemlist_window.index)
  397.             end
  398.           # マップ画面に切り替え
  399.           $scene = Scene_Map.new
  400.           return
  401.         end
  402.       end
  403.       return
  404.     end
  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # ● フレーム更新 (ターゲットウィンドウがアクティブの場合)
  408.   #--------------------------------------------------------------------------
  409.   def update_target
  410.     # B ボタンが押された場合
  411.     if Input.trigger?(Input::B)
  412.       # キャンセル SE を演奏
  413.       $game_system.se_play($data_system.cancel_se)
  414.       # アイテム切れなどで使用できなくなった場合
  415.       unless $game_party.item_can_use?(@item.id)
  416.         # アイテムウィンドウの内容を再作成
  417.         @itemlist_window.refresh
  418.       end
  419.       # ターゲットウィンドウを消去
  420.       @itemlist_window.active = true
  421.       @target_window.visible = false
  422.       @target_window.active = false
  423.       @itemlist_window.set_item(@command_index)
  424.       return
  425.     end
  426.     # C ボタンが押された場合
  427.     if Input.trigger?(Input::C)
  428.       # アイテムを使い切った場合
  429.       if $game_party.item_number(@item.id) == 0
  430.         # ブザー SE を演奏
  431.         $game_system.se_play($data_system.buzzer_se)
  432.         return
  433.       end
  434.       # ターゲットが全体の場合
  435.       if @target_window.index == -1
  436.         # パーティ全体にアイテムの使用効果を適用
  437.         used = false
  438.         for i in $game_party.actors
  439.           used |= i.item_effect(@item)
  440.         end
  441.       end
  442.       # ターゲットが単体の場合
  443.       if @target_window.index >= 0
  444.         # ターゲットのアクターにアイテムの使用効果を適用
  445.         target = $game_party.actors[@target_window.index]
  446.         used = target.item_effect(@item)
  447.       end
  448.       # アイテムを使った場合
  449.       if used
  450.         # アイテムの使用時 SE を演奏
  451.         $game_system.se_play(@item.menu_se)
  452.         # 消耗品の場合
  453.         if @item.consumable
  454.           # 使用したアイテムを 1 減らす
  455.           $game_party.lose_item(@item.id, 1)
  456.           # アイテムウィンドウの項目を再描画
  457.           @itemlist_window.draw_item(@itemlist_window.index)
  458.           @itemlist_window.set_item(@command_index)
  459.         end
  460.         # ターゲットウィンドウの内容を再作成
  461.         @target_window.refresh
  462.         # 全滅の場合
  463.         if $game_party.all_dead?
  464.           # ゲームオーバー画面に切り替え
  465.           $scene = Scene_Gameover.new
  466.           return
  467.         end
  468.         # コモンイベント ID が有効の場合
  469.         if @item.common_event_id > 0
  470.           # コモンイベント呼び出し予約
  471.           $game_temp.common_event_id = @item.common_event_id
  472.           # マップ画面に切り替え
  473.           $scene = Scene_Map.new
  474.           return
  475.         end
  476.       end
  477.       # アイテムを使わなかった場合
  478.       unless used
  479.         # ブザー SE を演奏
  480.         $game_system.se_play($data_system.buzzer_se)
  481.       end
  482.     return
  483.     end
  484.   end
  485. end
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部