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

Project1

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

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3770
在线时间
741 小时
注册时间
2016-6-2
帖子
211

开拓者

跳转到指定楼层
1
发表于 2017-10-3 15:29:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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


制作人员名单
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #——————————————————————————————————————
  5. # Scene_Credit 制作人员名单
  6. #——————————————————————————————————————
  7.  
  8. #——使用注意:默认会返回地图,如果需要返回开头,请将本脚本中的
  9. #return_scene = Scene_Map.new改为return_scene = Scene_Title.new
  10. class Scene_Credit
  11.   CREDIT=<<_END_
  12. -----Cast------
  13. 制作工具:RPG Maker XP
  14. 先帝创业未半而中道崩殂
  15. 今天下三分,益州疲弊
  16. 此诚危急存亡之秋也
  17. 然侍卫之臣不懈于内,忠志之士忘身于外者
  18. 盖追先帝之殊遇,欲报之于陛下也
  19. 诚宜开张圣听,以光先帝遗德,恢弘志士之气
  20. 不宜妄自菲薄,引喻失义,以塞忠谏之路也
  21. 宫中府中,俱为一体,陟罚臧否,不宜异同
  22. 若有作奸犯科及为忠善者
  23. 宜付有司论其刑赏,以昭陛下平明之理
  24. 不宜偏私,使内外异法也。
  25. 侍中侍郎郭攸之、费祎、董允等
  26. 此皆良实,志虑忠纯,是以先帝简拔以遗陛下
  27. 愚以为宫中之事,事无大小,悉以咨之,然后施行
  28. 必能裨补阙漏,有所广益。
  29.  
  30. _END_
  31. end
  32. class Scene_Credit
  33.   def initialize(return_scene = nil)
  34.     @sprite = Sprite.new
  35.     @sprite.bitmap = Bitmap.new("Graphics/Pictures/1")
  36.     @sprite.x = 0
  37.     @sprite.y = 0
  38.     if return_scene.nil?
  39.       return_scene = Scene_Map.new
  40.     end
  41.     @return_scene = return_scene
  42.   end
  43.  
  44.   def scene_start
  45.     credit_lines = CREDIT.split(/\n/)
  46.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  47.     credit_lines.each_index do |i|
  48.       line = credit_lines[i]
  49.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  50.     end
  51.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
  52.     @credit_sprite.bitmap = credit_bitmap
  53.     @credit_sprite.oy = -430
  54.     @frame_index = 0
  55.     @last_flag = false
  56.   end
  57.   def scene_end
  58.     @credit_sprite.dispose
  59.     @sprite.dispose
  60.   end
  61.  
  62.   def last?
  63.     return (@frame_index >= @credit_sprite.bitmap.height + 480)
  64.   end
  65.  
  66.   def last
  67.     if not @last_flag
  68.       Audio.bgm_fade(10000)
  69.       @last_flag = true
  70.       @last_count = 0
  71.     else
  72.       @last_count += 1
  73.     end
  74.     if @last_count >= 300
  75.       $scene = @return_scene
  76.     end
  77.   end
  78.  
  79.   def update
  80.     @frame_index += 1
  81.     return if cancel?
  82.     last if last?
  83.     @credit_sprite.oy += 1
  84.   end
  85.   def cancel?
  86.     if Input.trigger?(Input::B)
  87.       $scene = @return_scene
  88.       return true
  89.     end
  90.     return false
  91.   end
  92.   def main
  93.     scene_start
  94.     # 过渡
  95.     Graphics.transition
  96.     # 主循环
  97.     loop do
  98.       Graphics.update
  99.       Input.update
  100.       update
  101.       if $scene != self
  102.         break
  103.       end
  104.     end
  105.     # 准备过渡
  106.     Graphics.freeze
  107.     scene_end
  108.   end
  109. end
  110. #==============================================================================
  111. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  112. #==============================================================================



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




物品分类
RUBY 代码复制
  1. # ————————————————————————————————————
  2. # 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
  3. # ————————————————————————————————————
  4.  
  5. #==============================================================================
  6. # ■ Harts_Window_ItemTitle
  7. #------------------------------------------------------------------------------
  8. #  アイテム画面で、タイトルを表示するウィンドウ。
  9. #==============================================================================
  10.  
  11. class Harts_Window_ItemTitle < Window_Base
  12.   #--------------------------------------------------------------------------
  13.   # ● オブジェクト初期化
  14.   #--------------------------------------------------------------------------
  15.   def initialize
  16.     super(0, 0, 160, 64)
  17.     self.contents = Bitmap.new(width - 32, height - 32)
  18.     self.contents.clear
  19.     self.contents.font.color = normal_color
  20.     self.contents.draw_text(4, 0, 120, 32, $data_system.words.item, 1)
  21.   end
  22. end
  23.  
  24. #==============================================================================
  25. # ■ Harts_Window_ItemCommand
  26. #------------------------------------------------------------------------------
  27. #  アイテムの種別選択を行うウィンドウです。
  28. #==============================================================================
  29.  
  30. class Harts_Window_ItemCommand < Window_Selectable
  31.   #--------------------------------------------------------------------------
  32.   # ● オブジェクト初期化
  33.   #--------------------------------------------------------------------------
  34.   def initialize
  35.     super(0, 64, 160, 288)
  36.     self.contents = Bitmap.new(width - 32, height - 32)
  37.     @item_max = 8
  38.     @commands = ["常规物品", "战斗物品", $data_system.words.weapon, $data_system.words.armor1, $data_system.words.armor2, $data_system.words.armor3, $data_system.words.armor4, "特殊道具"]
  39.     refresh
  40.     self.index = 0
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● リフレッシュ
  44.   #--------------------------------------------------------------------------
  45.   def refresh
  46.     self.contents.clear
  47.     for i in 0...@item_max
  48.     draw_item(i, normal_color)
  49.     end
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 項目の描画
  53.   # index : 項目番号
  54.   # color : 文字色
  55.   #--------------------------------------------------------------------------
  56.   def draw_item(index, color)
  57.     self.contents.font.color = color
  58.     y = index * 32
  59.     self.contents.draw_text(4, y, 128, 32, @commands[index])
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● ヘルプテキスト更新
  63.   #--------------------------------------------------------------------------
  64.   def update_help
  65.     case self.index
  66.     when 0
  67.       @text = @commands[0]
  68.     when 1
  69.       @text = @commands[1]
  70.     when 2
  71.       @text = @commands[2]
  72.     when 3
  73.       @text = @commands[3]
  74.     when 4
  75.       @text = @commands[4]
  76.     when 5
  77.       @text = @commands[5]
  78.     when 6
  79.       @text = @commands[6]
  80.     when 7
  81.       @text = @commands[7]
  82.     end
  83.     @help_window.set_text(@text)
  84.   end
  85. end
  86.  
  87. #==============================================================================
  88. # ■ Window_Item
  89. #------------------------------------------------------------------------------
  90. #  アイテム画面で、所持アイテムの一覧を表示するウィンドウです。
  91. #==============================================================================
  92.  
  93. class Harts_Window_ItemList < Window_Selectable
  94.   #--------------------------------------------------------------------------
  95.   # ● オブジェクト初期化
  96.   #--------------------------------------------------------------------------
  97.   def initialize
  98.     super(160, 0, 480, 416)
  99.     refresh
  100.     self.index = 0
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● アイテムの取得
  104.   #--------------------------------------------------------------------------
  105.   def item
  106.     return @data[self.index]
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● リフレッシュ
  110.   #--------------------------------------------------------------------------
  111.   def refresh
  112.     if self.contents != nil
  113.       self.contents.dispose
  114.       self.contents = nil
  115.     end
  116.     @data = []
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● アイテム一覧設定
  120.   # command : 選択中のコマンド
  121.   #--------------------------------------------------------------------------
  122.   def set_item(command)
  123.     refresh
  124.     case command
  125.     when 0
  126.       for i in 1...$data_items.size
  127.         if ($data_items[i].occasion == 0 or $data_items[i].occasion == 2) and $game_party.item_number(i) > 0
  128.           @data.push($data_items[i])
  129.         end
  130.       end
  131.     when 1
  132.       for i in 1...$data_items.size
  133.         if ($data_items[i].occasion == 1 and $game_party.item_number(i) > 0)
  134.           @data.push($data_items[i])
  135.         end
  136.       end
  137.     when 2
  138.       for i in 1...$data_weapons.size
  139.         if $game_party.weapon_number(i) > 0
  140.           @data.push($data_weapons[i])
  141.         end
  142.       end
  143.     when 3
  144.       for i in 1...$data_armors.size
  145.         if $data_armors[i].kind == 0 and $game_party.armor_number(i) > 0
  146.           @data.push($data_armors[i])
  147.         end
  148.       end
  149.     when 4
  150.       for i in 1...$data_armors.size
  151.         if $data_armors[i].kind == 1 and $game_party.armor_number(i) > 0
  152.           @data.push($data_armors[i])
  153.         end
  154.       end
  155.     when 5
  156.       for i in 1...$data_armors.size
  157.         if $data_armors[i].kind == 2 and $game_party.armor_number(i) > 0
  158.           @data.push($data_armors[i])
  159.         end
  160.       end
  161.     when 6
  162.       for i in 1...$data_armors.size
  163.         if $data_armors[i].kind == 3 and $game_party.armor_number(i) > 0
  164.           @data.push($data_armors[i])
  165.         end
  166.       end
  167.     when 7
  168.       for i in 1...$data_items.size
  169.         if $data_items[i].occasion == 3 and $game_party.item_number(i) > 0
  170.           @data.push($data_items[i])
  171.         end
  172.       end
  173.     end
  174.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  175.     @item_max = @data.size
  176.     if @item_max > 0
  177.       self.contents = Bitmap.new(width - 32, row_max * 32)
  178.       self.contents.clear
  179.       for i in 0...@item_max
  180.         draw_item(i)
  181.       end
  182.     end
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 種類別アイテム数の取得
  186.   #--------------------------------------------------------------------------
  187.   def item_number
  188.     return @item_max
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 項目の描画
  192.   # index : 項目番号
  193.   #--------------------------------------------------------------------------
  194.   def draw_item(index)
  195.     item = @data[index]
  196.     case item
  197.     when RPG::Item
  198.       number = $game_party.item_number(item.id)
  199.     when RPG::Weapon
  200.       number = $game_party.weapon_number(item.id)
  201.     when RPG::Armor
  202.       number = $game_party.armor_number(item.id)
  203.     end
  204.     if item.is_a?(RPG::Item) and
  205.       $game_party.item_can_use?(item.id)
  206.       self.contents.font.color = normal_color
  207.     else
  208.       self.contents.font.color = disabled_color
  209.     end
  210.     x = 4
  211.     y = index * 32
  212.     bitmap = RPG::Cache.icon(item.icon_name)
  213.     opacity = self.contents.font.color == normal_color ? 255 : 128
  214.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  215.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  216.     self.contents.draw_text(x + 400, y, 16, 32, ":", 1)
  217.     self.contents.draw_text(x + 416, y, 24, 32, number.to_s, 2)
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● ヘルプテキスト更新
  221.   #--------------------------------------------------------------------------
  222.   def update_help
  223.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  224.   end
  225. end
  226.  
  227. #==============================================================================
  228. # ■ Harts_Scene_Item
  229. #------------------------------------------------------------------------------
  230. #  アイテム画面の処理を行うクラスです。再定義
  231. #==============================================================================
  232.  
  233. class Scene_Item
  234.   #--------------------------------------------------------------------------
  235.   # ● メイン処理
  236.   #--------------------------------------------------------------------------
  237.   include OPACITY_66RPG
  238.   def main
  239.     create_screen
  240.     # タイトルウィンドウを作成
  241.     @itemtitle_window = Harts_Window_ItemTitle.new
  242.     #コマンドウィンドウを作成
  243.     @itemcommand_window = Harts_Window_ItemCommand.new
  244.     @command_index = @itemcommand_window.index
  245.     #アイテムウィンドウを作成
  246.     @itemlist_window = Harts_Window_ItemList.new
  247.     @itemlist_window.active = false
  248.     #ヘルプウィンドウを作成
  249.     @help_window = Window_Help.new
  250.     @help_window.x = 0
  251.     @help_window.y = 416
  252.     # ヘルプウィンドウを関連付け
  253.     @itemcommand_window.help_window = @help_window
  254.     @itemlist_window.help_window = @help_window
  255.     # ターゲットウィンドウを作成 (不可視?非アクティブに設定)
  256.     @target_window = Window_Target.new
  257.     @target_window.visible = false
  258.     @target_window.active = false
  259.     # アイテムウィンドウ内容表示
  260.     @itemlist_window.set_item(@command_index)
  261.     # トランジション実行
  262.     Graphics.transition
  263.     # メインループ
  264.     loop do
  265.       # ゲーム画面を更新
  266.       Graphics.update
  267.       # 入力情報を更新
  268.       Input.update
  269.       # フレーム更新
  270.       update
  271.       # 画面が切り替わったらループを中断
  272.       if $scene != self
  273.         break
  274.       end
  275.     end
  276.     # トランジション準備
  277.     Graphics.freeze
  278.     # ウィンドウを解放
  279.     @itemtitle_window.dispose
  280.     @itemcommand_window.dispose
  281.     @itemlist_window.dispose
  282.     @help_window.dispose
  283.     @target_window.dispose
  284.     dispose_screen
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● フレーム更新
  288.   #--------------------------------------------------------------------------
  289.   def update
  290.     # ウィンドウを更新
  291.     @itemtitle_window.update
  292.     @itemcommand_window.update
  293.     @itemlist_window.update
  294.     @help_window.update
  295.     @target_window.update
  296.     if @command_index != @itemcommand_window.index
  297.       @command_index = @itemcommand_window.index
  298.       @itemlist_window.set_item(@command_index)
  299.     end
  300.     # コマンドウィンドウがアクティブの場合: update_itemcommand を呼ぶ
  301.     if @itemcommand_window.active
  302.       update_itemcommand
  303.       return
  304.     end
  305.     # アイテムウィンドウがアクティブの場合: update_itemlist を呼ぶ
  306.     if @itemlist_window.active
  307.       update_itemlist
  308.       return
  309.     end
  310.     # ターゲットウィンドウがアクティブの場合: update_target を呼ぶ
  311.     if @target_window.active
  312.       update_target
  313.       return
  314.     end
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  318.   #--------------------------------------------------------------------------
  319.   def update_itemcommand
  320.   # B ボタンが押された場合
  321.   if Input.trigger?(Input::B)
  322.   # キャンセル SE を演奏
  323.   $game_system.se_play($data_system.cancel_se)
  324.   # メニュー画面に切り替え
  325.   $scene = Scene_Menu.new(0)
  326.   return
  327.   end
  328.   # C ボタンが押された場合
  329.   if Input.trigger?(Input::C)
  330.   # 選択中のコマンドのアイテムがない場合
  331.   if @itemlist_window.item_number == 0
  332.   # ブザー SE を演奏
  333.   $game_system.se_play($data_system.buzzer_se)
  334.   return
  335.   end
  336.   # 決定 SE を演奏
  337.   $game_system.se_play($data_system.decision_se)
  338.   # アイテムウィンドウをアクティブにする
  339.   @itemcommand_window.active = false
  340.   @itemlist_window.active = true
  341.   @itemlist_window.index = 0
  342.   return
  343.   end
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● フレーム更新 (アイテムウィンドウがアクティブの場合)
  347.   #--------------------------------------------------------------------------
  348.   def update_itemlist
  349.     # B ボタンが押された場合
  350.     if Input.trigger?(Input::B)
  351.       # キャンセル SE を演奏
  352.       $game_system.se_play($data_system.cancel_se)
  353.       # アイテムウィンドウをアクティブにする
  354.       @itemcommand_window.active = true
  355.       @itemlist_window.active = false
  356.       @itemlist_window.index = 0
  357.       @itemcommand_window.index = @command_index
  358.       return
  359.     end
  360.     # C ボタンが押された場合
  361.     if Input.trigger?(Input::C)
  362.       # アイテムウィンドウで現在選択されているデータを取得
  363.       @item = @itemlist_window.item
  364.       # 使用アイテムではない場合
  365.       unless @item.is_a?(RPG::Item)
  366.         # ブザー SE を演奏
  367.         $game_system.se_play($data_system.buzzer_se)
  368.         return
  369.       end
  370.       # 使用できない場合
  371.       unless $game_party.item_can_use?(@item.id)
  372.         # ブザー SE を演奏
  373.         $game_system.se_play($data_system.buzzer_se)
  374.         return
  375.       end
  376.       # 決定 SE を演奏
  377.       $game_system.se_play($data_system.decision_se)
  378.       # 効果範囲が味方の場合
  379.       if @item.scope >= 3
  380.         # ターゲットウィンドウをアクティブ化
  381.         @itemlist_window.active = false
  382.         @target_window.x = 304
  383.         @target_window.visible = true
  384.         @target_window.active = true
  385.         # 効果範囲 (単体/全体) に応じてカーソル位置を設定
  386.         if @item.scope == 4 || @item.scope == 6
  387.           @target_window.index = -1
  388.         else
  389.           @target_window.index = 0
  390.         end
  391.         # 効果範囲が味方以外の場合
  392.       else
  393.         # コモンイベント ID が有効の場合
  394.         if @item.common_event_id > 0
  395.           # コモンイベント呼び出し予約
  396.           $game_temp.common_event_id = @item.common_event_id
  397.           # アイテムの使用時 SE を演奏
  398.           $game_system.se_play(@item.menu_se)
  399.           # 消耗品の場合
  400.             if @item.consumable
  401.               # 使用したアイテムを 1 減らす
  402.               $game_party.lose_item(@item.id, 1)
  403.               # アイテムウィンドウの項目を再描画
  404.               @itemlist_window.draw_item(@itemlist_window.index)
  405.             end
  406.           # マップ画面に切り替え
  407.           $scene = Scene_Map.new
  408.           return
  409.         end
  410.       end
  411.       return
  412.     end
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● フレーム更新 (ターゲットウィンドウがアクティブの場合)
  416.   #--------------------------------------------------------------------------
  417.   def update_target
  418.     # B ボタンが押された場合
  419.     if Input.trigger?(Input::B)
  420.       # キャンセル SE を演奏
  421.       $game_system.se_play($data_system.cancel_se)
  422.       # アイテム切れなどで使用できなくなった場合
  423.       unless $game_party.item_can_use?(@item.id)
  424.         # アイテムウィンドウの内容を再作成
  425.         @itemlist_window.refresh
  426.       end
  427.       # ターゲットウィンドウを消去
  428.       @itemlist_window.active = true
  429.       @target_window.visible = false
  430.       @target_window.active = false
  431.       @itemlist_window.set_item(@command_index)
  432.       return
  433.     end
  434.     # C ボタンが押された場合
  435.     if Input.trigger?(Input::C)
  436.       # アイテムを使い切った場合
  437.       if $game_party.item_number(@item.id) == 0
  438.         # ブザー SE を演奏
  439.         $game_system.se_play($data_system.buzzer_se)
  440.         return
  441.       end
  442.       # ターゲットが全体の場合
  443.       if @target_window.index == -1
  444.         # パーティ全体にアイテムの使用効果を適用
  445.         used = false
  446.         for i in $game_party.actors
  447.           used |= i.item_effect(@item)
  448.         end
  449.       end
  450.       # ターゲットが単体の場合
  451.       if @target_window.index >= 0
  452.         # ターゲットのアクターにアイテムの使用効果を適用
  453.         target = $game_party.actors[@target_window.index]
  454.         used = target.item_effect(@item)
  455.       end
  456.       # アイテムを使った場合
  457.       if used
  458.         # アイテムの使用時 SE を演奏
  459.         $game_system.se_play(@item.menu_se)
  460.         # 消耗品の場合
  461.         if @item.consumable
  462.           # 使用したアイテムを 1 減らす
  463.           $game_party.lose_item(@item.id, 1)
  464.           # アイテムウィンドウの項目を再描画
  465.           @itemlist_window.draw_item(@itemlist_window.index)
  466.           @itemlist_window.set_item(@command_index)
  467.         end
  468.         # ターゲットウィンドウの内容を再作成
  469.         @target_window.refresh
  470.         # 全滅の場合
  471.         if $game_party.all_dead?
  472.           # ゲームオーバー画面に切り替え
  473.           $scene = Scene_Gameover.new
  474.           return
  475.         end
  476.         # コモンイベント ID が有効の場合
  477.         if @item.common_event_id > 0
  478.           # コモンイベント呼び出し予約
  479.           $game_temp.common_event_id = @item.common_event_id
  480.           # マップ画面に切り替え
  481.           $scene = Scene_Map.new
  482.           return
  483.         end
  484.       end
  485.       # アイテムを使わなかった場合
  486.       unless used
  487.         # ブザー SE を演奏
  488.         $game_system.se_play($data_system.buzzer_se)
  489.       end
  490.     return
  491.     end
  492.   end
  493. end
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-21 19:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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