Project1

标题: 物品提示脚本 [打印本页]

作者: 黑米馒头    时间: 2014-8-29 10:16
标题: 物品提示脚本
怎么给物品提示脚本增加人物增减的提示
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————
  4.   
  5. # 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。

  6. # 开关定义:

  7. $不显示金钱窗口 = 4

  8. $不显示物品窗口 = 4

  9. $不显示武器窗口 = 4

  10. $不显示防具窗口 = 4

  11. # 以上开关,当打开的时候,获得物品将不会提示,比如默认打开5号开关,获得金钱不再提示

  12. # ————————————————————————————————————

  13. class Interpreter  
  14.   #--------------------------------------------------------------------------
  15.   # ● 增减金钱
  16.   #--------------------------------------------------------------------------
  17.   def command_125
  18.     value = operate_value(@parameters[0], @parameters[1], @parameters[2])
  19.     $game_party.gain_gold(value)
  20.     if $game_switches[$不显示金钱窗口]==false
  21.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  22.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  23.       if value >= 0
  24.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  25.         carol3_66RPG.contents.font.size = 16
  26.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你得到了")
  27.         #——声效,可以自己改
  28.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  29.       else
  30.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  31.         carol3_66RPG.contents.font.size = 15
  32.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你失去了")
  33.         #——声效,可以自己改
  34.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  35.       end   

  36.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  37.       carol3_66RPG.contents.font.size = 16
  38.       carol3_66RPG.contents.draw_text(64,-8,240,32,value.abs.to_s + "两银子。")
  39.       carol3_66RPG.opacity = 255
  40.       
  41.       for i in 0..30
  42.         Graphics.update
  43.       end
  44.       for i in 0..10
  45.         carol3_66RPG.opacity -= 30
  46.         carol3_66RPG.contents_opacity -= 30
  47.         Graphics.update
  48.       end
  49.       carol3_66RPG.dispose
  50.     end
  51.     return true
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 增减物品
  55.   #--------------------------------------------------------------------------
  56.   def command_126
  57.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  58.     $game_party.gain_item(@parameters[0], value)
  59.     if $game_switches[$不显示物品窗口]==false
  60.       carol3_66RPG_item = $data_items[@parameters[0]]
  61.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  62.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  63.       if value >= 0
  64.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  65.         carol3_66RPG.contents.font.size = 16
  66.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你获得了")   
  67.         #——声效,可以自己改
  68.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  69.       else
  70.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  71.         carol3_66RPG.contents.font.size = 16
  72.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你遗失了")   
  73.         #——声效,可以自己改
  74.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  75.       end
  76.       
  77.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  78.       carol3_66RPG.contents.font.size = 16
  79.       carol3_66RPG.contents.font.color = Color.new(255, 18, 0, 255)
  80.       carol3_66RPG.contents.draw_text(64,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width,32,carol3_66RPG_item.name)
  81.       carol3_66RPG.contents.font.color = Color.new(255, 255, 255, 255)
  82.       carol3_66RPG.contents.draw_text(55,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width + 24,32,"。", 2)
  83.       carol3_66RPG.opacity = 160
  84.      
  85.       for i in 0..30
  86.         Graphics.update
  87.       end
  88.       for i in 0..10
  89.         carol3_66RPG.opacity -= 30
  90.         carol3_66RPG.contents_opacity -= 30
  91.         Graphics.update
  92.       end
  93.       carol3_66RPG.dispose
  94.     end
  95.     return true
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● 增减武器
  99.   #--------------------------------------------------------------------------
  100.   def command_127
  101.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  102.     $game_party.gain_weapon(@parameters[0], value)
  103.     if $game_switches[$不显示武器窗口]==false
  104.       carol3_66RPG_item = $data_weapons[@parameters[0]]
  105.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  106.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  107.       if value >= 0
  108.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  109.         carol3_66RPG.contents.font.size = 16
  110.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你获得了")   
  111.         #——声效,可以自己改
  112.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  113.       else
  114.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  115.         carol3_66RPG.contents.font.size = 16
  116.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你遗失了")   
  117.         #——声效,可以自己改
  118.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  119.       end
  120.            
  121.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  122.       carol3_66RPG.contents.font.size = 16
  123.       carol3_66RPG.contents.font.color = Color.new(255, 18, 0, 255)
  124.       carol3_66RPG.contents.draw_text(64,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width,32,carol3_66RPG_item.name)
  125.       carol3_66RPG.contents.font.color = Color.new(255, 255, 255, 255)
  126.       carol3_66RPG.contents.draw_text(55,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width + 24,32,"。", 2)
  127.       carol3_66RPG.opacity = 160
  128.       
  129.       for i in 0..30
  130.         Graphics.update
  131.       end
  132.       for i in 0..10
  133.         carol3_66RPG.opacity -= 30
  134.         carol3_66RPG.contents_opacity -= 30
  135.         Graphics.update
  136.       end
  137.       carol3_66RPG.dispose
  138.     end
  139.     return true
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 增减防具
  143.   #--------------------------------------------------------------------------
  144.   def command_128
  145.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  146.     $game_party.gain_armor(@parameters[0], value)
  147.     if $game_switches[$不显示防具窗口]==false
  148.       carol3_66RPG_item = $data_armors[@parameters[0]]
  149.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  150.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  151.       if value >= 0
  152.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  153.         carol3_66RPG.contents.font.size = 16
  154.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你获得了")   
  155.         #——声效,可以自己改
  156.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  157.       else
  158.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  159.         carol3_66RPG.contents.font.size = 16
  160.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你遗失了")   
  161.         #——声效,可以自己改
  162.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  163.       end
  164.       
  165.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  166.       carol3_66RPG.contents.font.size = 16
  167.       carol3_66RPG.contents.font.color = Color.new(255, 18, 0, 255)
  168.       carol3_66RPG.contents.draw_text(64,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width,32,carol3_66RPG_item.name)
  169.       carol3_66RPG.contents.font.color = Color.new(255, 255, 255, 255)
  170.       carol3_66RPG.contents.draw_text(55,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width + 24,32,"。", 2)
  171.       carol3_66RPG.opacity = 160
  172.       
  173.       for i in 0..30
  174.         Graphics.update
  175.       end
  176.       for i in 0..10
  177.         carol3_66RPG.opacity -= 30
  178.         carol3_66RPG.contents_opacity -= 30
  179.         Graphics.update
  180.       end
  181.       carol3_66RPG.dispose
  182.     end
  183.     return true
  184.   end
  185. end
复制代码

作者: 恐惧剑刃    时间: 2014-8-29 12:10
本帖最后由 恐惧剑刃 于 2014-8-29 18:56 编辑
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————
  4.   
  5. # 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。

  6. # 开关定义:

  7. $不显示金钱窗口 = 4

  8. $不显示物品窗口 = 4

  9. $不显示武器窗口 = 4

  10. $不显示防具窗口 = 4

  11. $不显示角色窗口 = 4

  12. # 以上开关,当打开的时候,获得物品将不会提示,比如默认打开5号开关,获得金钱不再提示

  13. # ————————————————————————————————————

  14. class Interpreter  
  15.   #--------------------------------------------------------------------------
  16.   # ● 角色的替换
  17.   #--------------------------------------------------------------------------
  18.   def command_129
  19.     # 获取角色
  20.     actor = $game_actors[@parameters[0]]
  21.     # 角色有效的情况下
  22.     if actor != nil
  23.       # 操作分支
  24.       if @parameters[1] == 0
  25.         if @parameters[2] == 1
  26.           $game_actors[@parameters[0]].setup(@parameters[0])
  27.         end
  28.         $game_party.add_actor(@parameters[0])
  29.       else
  30.         $game_party.remove_actor(@parameters[0])
  31.       end
  32.     end
  33.    
  34.     if @parameters[0] > 50
  35.       return true
  36.     end
  37.     #修正一个小BUG 应该+而不能<<
  38.     #<<会修改原字符串并添加到尾部。
  39.     if not $game_switches[$不显示角色窗口]
  40.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  41.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  42.       if @parameters[1] == 0
  43.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  44.         carol3_66RPG.contents.font.size = 16
  45.         carol3_66RPG.contents.draw_text(0,-8,240,32,$game_actors[@parameters[0]].name+"加入了队伍")
  46.         #——声效,可以自己改
  47.         #Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  48.       else
  49.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  50.         carol3_66RPG.contents.font.size = 15
  51.         carol3_66RPG.contents.draw_text(0,-8,240,32,$game_actors[@parameters[0]].name+"离开了队伍")
  52.         #——声效,可以自己改
  53.         #Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  54.       end   
  55.       for i in 0..30
  56.         Graphics.update
  57.       end
  58.       for i in 0..10
  59.         carol3_66RPG.opacity -= 30
  60.         carol3_66RPG.contents_opacity -= 30
  61.         Graphics.update
  62.       end
  63.       carol3_66RPG.dispose
  64.     end
  65.     # 继续
  66.     return true
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 增减金钱
  70.   #--------------------------------------------------------------------------
  71.   def command_125
  72.     value = operate_value(@parameters[0], @parameters[1], @parameters[2])
  73.     $game_party.gain_gold(value)
  74.     if $game_switches[$不显示金钱窗口]==false
  75.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  76.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  77.       if value >= 0
  78.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  79.         carol3_66RPG.contents.font.size = 16
  80.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你得到了")
  81.         #——声效,可以自己改
  82.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  83.       else
  84.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  85.         carol3_66RPG.contents.font.size = 15
  86.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你失去了")
  87.         #——声效,可以自己改
  88.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  89.       end   

  90.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  91.       carol3_66RPG.contents.font.size = 16
  92.       carol3_66RPG.contents.draw_text(64,-8,240,32,value.abs.to_s + "两银子。")
  93.       carol3_66RPG.opacity = 255
  94.       
  95.       for i in 0..30
  96.         Graphics.update
  97.       end
  98.       for i in 0..10
  99.         carol3_66RPG.opacity -= 30
  100.         carol3_66RPG.contents_opacity -= 30
  101.         Graphics.update
  102.       end
  103.       carol3_66RPG.dispose
  104.     end
  105.     return true
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● 增减物品
  109.   #--------------------------------------------------------------------------
  110.   def command_126
  111.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  112.     $game_party.gain_item(@parameters[0], value)
  113.     if $game_switches[$不显示物品窗口]==false
  114.       carol3_66RPG_item = $data_items[@parameters[0]]
  115.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  116.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  117.       if value >= 0
  118.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  119.         carol3_66RPG.contents.font.size = 16
  120.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你获得了")   
  121.         #——声效,可以自己改
  122.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  123.       else
  124.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  125.         carol3_66RPG.contents.font.size = 16
  126.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你遗失了")   
  127.         #——声效,可以自己改
  128.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  129.       end
  130.       
  131.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  132.       carol3_66RPG.contents.font.size = 16
  133.       carol3_66RPG.contents.font.color = Color.new(255, 18, 0, 255)
  134.       carol3_66RPG.contents.draw_text(64,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width,32,carol3_66RPG_item.name)
  135.       carol3_66RPG.contents.font.color = Color.new(255, 255, 255, 255)
  136.       carol3_66RPG.contents.draw_text(55,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width + 24,32,"。", 2)
  137.       carol3_66RPG.opacity = 160
  138.      
  139.       for i in 0..30
  140.         Graphics.update
  141.       end
  142.       for i in 0..10
  143.         carol3_66RPG.opacity -= 30
  144.         carol3_66RPG.contents_opacity -= 30
  145.         Graphics.update
  146.       end
  147.       carol3_66RPG.dispose
  148.     end
  149.     return true
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 增减武器
  153.   #--------------------------------------------------------------------------
  154.   def command_127
  155.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  156.     $game_party.gain_weapon(@parameters[0], value)
  157.     if $game_switches[$不显示武器窗口]==false
  158.       carol3_66RPG_item = $data_weapons[@parameters[0]]
  159.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  160.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  161.       if value >= 0
  162.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  163.         carol3_66RPG.contents.font.size = 16
  164.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你获得了")   
  165.         #——声效,可以自己改
  166.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  167.       else
  168.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  169.         carol3_66RPG.contents.font.size = 16
  170.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你遗失了")   
  171.         #——声效,可以自己改
  172.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  173.       end
  174.            
  175.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  176.       carol3_66RPG.contents.font.size = 16
  177.       carol3_66RPG.contents.font.color = Color.new(255, 18, 0, 255)
  178.       carol3_66RPG.contents.draw_text(64,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width,32,carol3_66RPG_item.name)
  179.       carol3_66RPG.contents.font.color = Color.new(255, 255, 255, 255)
  180.       carol3_66RPG.contents.draw_text(55,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width + 24,32,"。", 2)
  181.       carol3_66RPG.opacity = 160
  182.       
  183.       for i in 0..30
  184.         Graphics.update
  185.       end
  186.       for i in 0..10
  187.         carol3_66RPG.opacity -= 30
  188.         carol3_66RPG.contents_opacity -= 30
  189.         Graphics.update
  190.       end
  191.       carol3_66RPG.dispose
  192.     end
  193.     return true
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 增减防具
  197.   #--------------------------------------------------------------------------
  198.   def command_128
  199.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  200.     $game_party.gain_armor(@parameters[0], value)
  201.     if $game_switches[$不显示防具窗口]==false
  202.       carol3_66RPG_item = $data_armors[@parameters[0]]
  203.       carol3_66RPG = Window_Base.new((640-310)/2-5,432/2,310,48)
  204.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  205.       if value >= 0
  206.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  207.         carol3_66RPG.contents.font.size = 16
  208.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你获得了")   
  209.         #——声效,可以自己改
  210.         Audio.se_play("Audio/SE/"+"系统-获得物品",80,100)
  211.       else
  212.         carol3_66RPG.contents.font.name = (["宋体","黑体"])
  213.         carol3_66RPG.contents.font.size = 16
  214.         carol3_66RPG.contents.draw_text(0,-8,240,32,"你遗失了")   
  215.         #——声效,可以自己改
  216.         Audio.se_play("Audio/SE/"+"系统-失去物品",80,100)
  217.       end
  218.       
  219.       carol3_66RPG.contents.font.name = (["宋体","黑体"])
  220.       carol3_66RPG.contents.font.size = 16
  221.       carol3_66RPG.contents.font.color = Color.new(255, 18, 0, 255)
  222.       carol3_66RPG.contents.draw_text(64,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width,32,carol3_66RPG_item.name)
  223.       carol3_66RPG.contents.font.color = Color.new(255, 255, 255, 255)
  224.       carol3_66RPG.contents.draw_text(55,-8,carol3_66RPG.contents.text_size(carol3_66RPG_item.name).width + 24,32,"。", 2)
  225.       carol3_66RPG.opacity = 160
  226.       
  227.       for i in 0..30
  228.         Graphics.update
  229.       end
  230.       for i in 0..10
  231.         carol3_66RPG.opacity -= 30
  232.         carol3_66RPG.contents_opacity -= 30
  233.         Graphics.update
  234.       end
  235.       carol3_66RPG.dispose
  236.     end
  237.     return true
  238.   end
  239. end
复制代码

作者: 黑米馒头    时间: 2014-8-30 11:51
恐惧剑刃 发表于 2014-8-29 12:10

得到金钱显示的时候,有点问题帮我看下

物品提示.rar

199.62 KB, 下载次数: 29


作者: 恐惧剑刃    时间: 2014-8-30 16:08
修改了下X坐标和宽度

物品提示.rar

237.72 KB, 下载次数: 47






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