Project1

标题: 请教怎么制作一购买物品中的提示窗口 [打印本页]

作者: 七禽七兽    时间: 2014-9-29 20:43
标题: 请教怎么制作一购买物品中的提示窗口
例如55号物品已经拥有了20件,再次购买会跳出一窗口提示一句话
作者: 573932914    时间: 2014-9-29 20:58
如果是物品得失提示的脚本如下←←。如果购买完物品判断的你还是在这里面进行判断物品数量吧
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. # 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。

  5. # 开关定义:

  6. $不显示金钱窗口 = 41

  7. $不显示物品窗口 = 42

  8. $不显示武器窗口 = 43

  9. $不显示防具窗口 = 44

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

  11. # ————————————————————————————————————

  12. class Interpreter
  13. #--------------------------------------------------------------------------
  14. # ● 增减金钱
  15. #--------------------------------------------------------------------------
  16. def command_125
  17. value = operate_value(@parameters[0], @parameters[1], @parameters[2])
  18. $game_party.gain_gold(value)
  19. if $game_switches[$不显示金钱窗口]==false
  20. carol3_66RPG = Window_Base.new((640-160)/2,128,180,100)
  21. carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  22. if value >= 0
  23. carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
  24. #——声效,可以自己改
  25. Audio.se_play("Audio/SE/"+"006-System06",80,100)
  26. else
  27. carol3_66RPG.contents.draw_text(0,0,240,32,"失去金钱:")
  28. #——声效,可以自己改
  29. Audio.se_play("Audio/SE/"+"005-System05",80,100)
  30. end
  31. carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
  32. carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
  33. carol3_66RPG.opacity = 160
  34. for i in 0..30
  35. Graphics.update
  36. end
  37. for i in 0..10
  38. carol3_66RPG.opacity -= 30
  39. carol3_66RPG.contents_opacity -= 30
  40. Graphics.update
  41. end
  42. carol3_66RPG.dispose
  43. end
  44. return true
  45. end
  46. #--------------------------------------------------------------------------
  47. # ● 增减物品
  48. #--------------------------------------------------------------------------
  49. def command_126
  50. value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  51. $game_party.gain_item(@parameters[0], value)
  52. if $game_switches[$不显示物品窗口]==false
  53. carol3_66RPG_item = $data_items[@parameters[0]]
  54. carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  55. carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  56. if value >= 0
  57. carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")
  58. #——声效,可以自己改
  59. Audio.se_play("Audio/SE/"+"006-System06",80,100)
  60. else
  61. carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")
  62. #——声效,可以自己改


  63. Audio.se_play("Audio/SE/"+"005-System05",80,100)
  64. end
  65. carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  66. carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  67. carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  68. carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  69. carol3_66RPG.opacity = 160
  70. for i in 0..30
  71. Graphics.update
  72. end
  73. for i in 0..10
  74. carol3_66RPG.opacity -= 30
  75. carol3_66RPG.contents_opacity -= 30
  76. Graphics.update
  77. end
  78. carol3_66RPG.dispose
  79. end
  80. return true
  81. end
  82. #--------------------------------------------------------------------------
  83. # ● 增减武器
  84. #--------------------------------------------------------------------------
  85. def command_127
  86. value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  87. $game_party.gain_weapon(@parameters[0], value)
  88. if $game_switches[$不显示武器窗口]==false
  89. carol3_66RPG_item = $data_weapons[@parameters[0]]
  90. carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  91. carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  92. if value >= 0
  93. carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")
  94. #——声效,可以自己改
  95. Audio.se_play("Audio/SE/"+"006-System06",80,100)
  96. else
  97. carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")
  98. #——声效,可以自己改
  99. Audio.se_play("Audio/SE/"+"005-System05",80,100)
  100. end
  101. carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  102. carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  103. carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  104. carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  105. carol3_66RPG.opacity = 160
  106. for i in 0..30
  107. Graphics.update
  108. end
  109. for i in 0..10
  110. carol3_66RPG.opacity -= 30
  111. carol3_66RPG.contents_opacity -= 30
  112. Graphics.update
  113. end
  114. carol3_66RPG.dispose
  115. end
  116. return true
  117. end
  118. #--------------------------------------------------------------------------
  119. # ● 增减防具
  120. #--------------------------------------------------------------------------
  121. def command_128
  122. value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  123. $game_party.gain_armor(@parameters[0], value)
  124. if $game_switches[$不显示防具窗口]==false
  125. carol3_66RPG_item = $data_armors[@parameters[0]]
  126. carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  127. carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  128. if value >= 0
  129. carol3_66RPG.contents.draw_text(0,0,240,32,"获得防具:")
  130. #——声效,可以自己改
  131. Audio.se_play("Audio/SE/"+"006-System06",80,100)
  132. else
  133. carol3_66RPG.contents.draw_text(0,0,240,32,"失去防具:")
  134. #——声效,可以自己改
  135. Audio.se_play("Audio/SE/"+"005-System05",80,100)
  136. end
  137. carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  138. carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  139. carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  140. carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  141. carol3_66RPG.opacity = 160
  142. for i in 0..30
  143. Graphics.update
  144. end
  145. for i in 0..10
  146. carol3_66RPG.opacity -= 30
  147. carol3_66RPG.contents_opacity -= 30
  148. Graphics.update
  149. end
  150. carol3_66RPG.dispose
  151. end
  152. return true
  153. end
  154. end



  155. #==============================================================================
  156. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  157. #==============================================================================
复制代码

作者: 七禽七兽    时间: 2014-9-29 22:14
573932914 发表于 2014-9-29 20:58
如果是物品得失提示的脚本如下←←。如果购买完物品判断的你还是在这里面进行判断物品数量吧 ...

不是得失提示,其实就是购买的物品累计达到多少会有一个窗口提示
作者: 573932914    时间: 2014-9-30 12:36
七禽七兽 发表于 2014-9-29 22:14
不是得失提示,其实就是购买的物品累计达到多少会有一个窗口提示

那就在显示的时候的内容改一下啊




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