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

Project1

 找回密码
 注册会员
搜索
楼主: 劍之飛龍☆
打印 上一主题 下一主题

[原创发布] ●●【小游戏常用脚本】●●

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-6
帖子
1139
11
发表于 2008-5-31 02:23:18 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

龙骑

梦石
0
星屑
545
在线时间
10 小时
注册时间
2007-12-31
帖子
2030
12
 楼主| 发表于 2009-6-12 08:00:00 | 只看该作者
以下引用xiarongshan于2008-5-30 18:23:18的发言:

http://rpg.blue/viewthread.php?tid=87842
这个排行榜系统相当有用了


[本贴由作者于 2008-5-30 18:23:33 最后编辑]

话说你应该自己编辑下吧……
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-6
帖子
1139
13
发表于 2008-5-31 20:02:31 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-6-20
帖子
14
14
发表于 2008-6-20 03:19:14 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-23
帖子
45
15
发表于 2008-7-24 01:56:44 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

龙骑

梦石
0
星屑
545
在线时间
10 小时
注册时间
2007-12-31
帖子
2030
16
 楼主| 发表于 2008-7-25 18:18:07 | 只看该作者
以下引用右手于2008-7-23 17:56:44的发言:

呵呵  我问个问题 XP与VX的脚本有多大区别

XP与VX的语法不同
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2008-5-18
帖子
251
17
发表于 2008-8-8 04:39:05 | 只看该作者
显示地图名的,当25号开关打开,此脚本才开始工作
  1. #==========================================================================
  2. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  3. #==========================================================================

  4. XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。

  5. #==============================================================================
  6. # ■ Window_XY
  7. #------------------------------------------------------------------------------
  8. #  显示坐标的窗口。
  9. #==============================================================================
  10. class Window_xy < Window_Base#注意前面那个window_xy是文件名
  11. #--------------------------------------------------------------------------
  12. # ● 初始化窗口
  13. #--------------------------------------------------------------------------
  14. def initialize
  15.    super(0, 0, 130, 80)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
  16.    self.contents = Bitmap.new(width - 32, height - 32)
  17.    self.back_opacity = 255  # 这个是背景透明
  18.    self.opacity = 255       # 这个是边框和背景都透明
  19.    self.contents_opacity = 255       # 这个是内容透明
  20.    self.visible = false
  21.    refresh
  22.    @x = $game_player.x
  23.    @y = $game_player.y
  24.    @id = $game_map.map_id
  25. end

  26. #--------------------------------------------------------------------------
  27. # ● 刷新
  28. #--------------------------------------------------------------------------
  29. def refresh
  30.    if $game_switches[XY_SWITCH] #确定开关是否打开,可以自己改变开关
  31.      @x = $game_player.x #获取角色X坐标
  32.      @y = $game_player.y #获取角色Y坐标
  33.      @id = $game_map.map_id  #获取地图编号
  34.     self.contents.clear #清除以前的东西
  35.     $mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
  36.     map_name = $mapnames[@id].name #获得地图名
  37.     self.contents.font.color = disabled_color#颜色,这里是白色~
  38.     self.contents.draw_text(0, 0, 70, 24, map_name,2)
  39.     self.contents.font.color = system_color#颜色,暗蓝色
  40.     self.contents.draw_text(0, 24, 80, 20, "X:")#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
  41.     self.contents.font.color = Color.new(220, 220, 220, 255)#颜色,这里是白色~
  42.     self.contents.draw_text(0, 24, 40, 20, @x.to_s,2)
  43.     self.contents.font.color = system_color#上面那个是X坐标的变量,可以自己更改变量名~
  44.     self.contents.draw_text(48, 24, 24, 20, "Y:")#显示Y这个字~
  45.     self.contents.font.color = Color.new(220, 220, 220, 255)
  46.     self.contents.draw_text(0, 24, 90, 20, @y.to_s,2)
  47.    end
  48. end
  49. #--------------------------------------------------------------------------
  50. # ● 判断文字刷新。节约内存用
  51. #--------------------------------------------------------------------------
  52. def judge
  53.    return true if @x != $game_player.x
  54.    return true if @y != $game_player.y
  55.    return true if @id != $game_map.map_id
  56.    return false
  57. end
  58. end
  59. ###########################################################################
  60. #                           下面的东西不需要掌握~                         #
  61. ###########################################################################

  62. class Scene_Map
  63. alias xy_66rpg_main main
  64. def main
  65.    @xy_window = Window_xy.new
  66.    @xy_window.x = 4
  67.    @xy_window.y = 4
  68.    @xy_window.opacity = 0
  69.    xy_66rpg_main
  70.    @xy_window.dispose
  71. end
  72. #--------------------------------------------------------------------------
  73. # ● 刷新画面
  74. #--------------------------------------------------------------------------
  75. alias xy_66rpg_update update
  76. def update
  77.    xy_66rpg_update
  78.    if $game_switches[XY_SWITCH]
  79.      @xy_window.visible = true     
  80.      @xy_window.refresh if @xy_window.judge
  81.    else
  82.      @xy_window.visible = false
  83.    end
  84. end
  85. end
  86. #==========================================================================
  87. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  88. #==========================================================================
复制代码



血条
  1. class Game_Actor < Game_Battler
  2. def now_exp
  3.    return @exp - @exp_list[@level]
  4. end
  5. def next_exp
  6.    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  7. end
  8. end
  9. #==============================================================================
  10. # 描绘角色血条
  11. #==============================================================================
  12. class Window_BattleStatus < Window_Base
  13. #--------------------------------------------------------------------------
  14. # ● 初始化
  15. #--------------------------------------------------------------------------
  16. alias xrxs_bp2_refresh refresh
  17. def refresh
  18.   xrxs_bp2_refresh
  19.   @item_max = $game_party.actors.size
  20.   for i in 0...$game_party.actors.size
  21.     actor = $game_party.actors[i]
  22.     actor_x = actor.s_x - 455
  23.     actor_y = actor.s_y - 270
  24.     x1=self.x
  25.     y1=self.y
  26.     if actor.xiaoshi == nil and actor.dead? == false
  27.      draw_actor_hp_meter(actor, actor_x, 1+actor_y,35)
  28.      draw_actor_sp_meter(actor, actor_x, 10+actor_y, 35)
  29.     end
  30.   end
  31. end
  32. end
  33. #==============================================================================
  34. # ■ Window_Base
  35. #==============================================================================
  36. class Window_Base < Window
  37. #--------------------------------------------------------------------------
  38. # ● HP描画
  39. #--------------------------------------------------------------------------
  40. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  41.   if type == 1 and actor.hp == 0
  42.     return
  43.   end
  44.   self.contents.fill_rect(x-1, y+82, width+2,6, Color.new(0, 0, 0, 255))
  45.   w = width * actor.hp / [actor.maxhp,1].max
  46.   self.contents.fill_rect(x, y+84, w,1, Color.new(255, 140, 140, 255))
  47.   self.contents.fill_rect(x, y+85, w,1, Color.new(180, 18, 0, 255))
  48.   self.contents.fill_rect(x, y+86, w,1, Color.new(209, 33, 0,255))
  49. self.contents.fill_rect(x, y+87, w,1, Color.new(180, 18, 0, 255))
  50. end
  51. #--------------------------------------------------------------------------
  52. # ● SP描画
  53. #--------------------------------------------------------------------------
  54. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  55.   if type == 1 and actor.hp == 0
  56.     return
  57.   end
  58.   self.contents.fill_rect(x-1, y+82, width+2,6, Color.new(0, 0, 0, 255))
  59.   w = width * actor.sp / [actor.maxsp,1].max
  60.   self.contents.fill_rect(x, y+84, w,1, Color.new(40, 176, 255, 255))
  61.   self.contents.fill_rect(x, y+85, w,1, Color.new(78, 10, 175, 255))
  62.   self.contents.fill_rect(x, y+86, w,1, Color.new(94, 10, 214, 255))
  63.   self.contents.fill_rect(x, y+87, w,1, Color.new(78, 10, 175, 255))
  64. end
  65. #--------------------------------------------------------------------------
  66. # ● exp描画
  67. #--------------------------------------------------------------------------
  68. def draw_actor_exp_meter(actor, x, y, width = 156, type = 0)
  69. if type == 1 and actor.hp == 0
  70.    return
  71. end
  72. self.contents.fill_rect(x-1, y+83, width+2,6, Color.new(0, 0, 0, 255))
  73. w = width * actor.now_exp/[ actor.next_exp,1].max
  74. self.contents.fill_rect(x, y+83, w,1, Color.new(77, 140, 140, 255))
  75. self.contents.fill_rect(x, y+85, w,1, Color.new(100, 220, 220, 255))
  76. self.contents.fill_rect(x, y+86, w,1, Color.new(77, 173, 173, 255))
  77. self.contents.fill_rect(x, y+87, w,1, Color.new(77, 207, 207, 255))
  78. self.contents.fill_rect(x, y+87, w,1, Color.new(77, 173, 173, 255))
  79. self.contents.fill_rect(x, y+87, w,1, Color.new(77, 140, 140, 255))
  80. end
  81. end
复制代码



回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2008-5-18
帖子
251
18
发表于 2008-8-8 04:41:13 | 只看该作者
加点的
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. # 设定说明:
  5. # 在数据库的角色一栏里的名称加上如下的信息,如:
  6. #
  7. # 阿尔西斯,9999,5555,999,55,60,36
  8. # HP SP 力 巧 速 魔
  9. #
  10. # 如果某一项不想受限制,则可输入
  11. #
  12. # 阿尔西斯,,5555,,,60,36
  13. #
  14. # 也就是只需要把受限的属性最大值写出即可
  15. #
  16. # 还有就是,如果都不受限……(那似乎就没必要用这个了)
  17. # 也要在名字后面加上6个半角的逗号……
  18. #
  19. # 阿尔西斯,,,,,,
  20. #
  21. # 这样就可以一直加下去……上万也没问题,不过前提是在相关的类中已经扩大上限。
  22. # 默认的 HP SP 最大为9999 其余四项为999。
  23. module RPG
  24. class Actor
  25. def name
  26. name = @name.split(/,/)[0]
  27. return name != nil ? name : ''
  28. end
  29. def max_hp_stars
  30. max_hp = @name.split(/,/)[1]
  31. return max_hp != nil ? max_hp.to_i : 0
  32. end
  33. def max_sp_stars
  34. max_sp = @name.split(/,/)[2]
  35. return max_sp != nil ? max_sp.to_i : 0
  36. end
  37. def max_str_stars
  38. max_str = @name.split(/,/)[3]
  39. return max_str != nil ? max_str.to_i : 0
  40. end
  41. def max_dex_stars
  42. max_dex = @name.split(/,/)[4]
  43. return max_dex != nil ? max_dex.to_i : 0
  44. end
  45. def max_agi_stars
  46. max_agi = @name.split(/,/)[5]
  47. return max_agi != nil ? max_agi.to_i : 0
  48. end
  49. def max_int_stars
  50. max_int = @name.split(/,/)[6]
  51. return max_int != nil ? max_int.to_i : 0
  52. end
  53. end
  54. end
  55. # 脚本使用设定:
  56. LEVEL_UP_POINT = 5 # 每升一级所增加的点数
  57. LEVEL_UP_VARIABLE = 100 # 储存角色点数的变量编号与角色id编号的差值
  58. # 默认情况 = 100,
  59. # 则是数据库里1号角色的加点数存于101号变量
  60. # 3号角色的加点数存于103号变量。
  61. # 你可以直接操作变量赠与角色可分配点数
  62. # 每增加一次点数,各项能力值的变化:357-410行
  63. # 使用方法介绍:
  64. # 本脚本不会取代原有升级功能,只是一个附加功能。也就是说,默认的升级还在,但可以用
  65. # 这个功能手动追加点数。如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中
  66. # 角色升级能力,1-99级全部等于一个相同数值就行了。
  67. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  68. # 默认都是0号
  69. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  70. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
  71. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
  72. #==============================================================================
  73. # ■ Window_Command
  74. #------------------------------------------------------------------------------
  75. #  一般的命令选择行窗口。(追加定义)
  76. #==============================================================================
  77. class Window_Command < Window_Selectable
  78. #--------------------------------------------------------------------------
  79. # ● 项目有效化
  80. # index : 项目编号
  81. #--------------------------------------------------------------------------
  82. def able_item(index)
  83. draw_item(index, normal_color)
  84. end
  85. end
  86. #==============================================================================
  87. # ■ Game_Actor
  88. #------------------------------------------------------------------------------
  89. #  处理角色的类。(再定义)
  90. #==============================================================================
  91. class Game_Actor < Game_Battler
  92. #--------------------------------------------------------------------------
  93. # ● 更改 EXP
  94. # exp : 新的 EXP
  95. #--------------------------------------------------------------------------
  96. def exp=(exp)
  97. # 升级
  98. if @actor_id > 20 and $game_actors[self.zhuren].level + 6 <= self.level
  99. @exp = @exp
  100. return
  101. else
  102. @exp = [[exp, 9999999].min, 0].max
  103. end
  104. while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  105. @level += 1
  106. @qianli += 5
  107. # 增加4点可自由分配的点数
  108. $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  109. # 学会特技
  110. for j in $data_classes[@class_id].learnings
  111. if j.level == @level
  112. learn_skill(j.skill_id)
  113. end
  114. end
  115. if @actor_id > 20 and $game_actors[self.zhuren].level + 6 <= self.level
  116. break
  117. end
  118. end
  119. # 降级
  120. #if @actor_id == 88
  121. # p $game_actors[self.zhuren].level
  122. # p self.level
  123. #end
  124. if @actor_id > 20 and $game_actors[self.zhuren].level + 6 <= self.level
  125. @exp = @exp
  126. return
  127. end
  128. while @exp < @exp_list[@level]
  129. # p self.name
  130. @level -= 1
  131. @qianli -= 5
  132. @qianli = [@qianli, 0].max
  133. end
  134. # 修正当前的 HP 与 SP 超过最大值
  135. @hp = [@hp, self.maxhp].min
  136. @sp = [@sp, self.maxsp].min
  137. end
  138. end
  139. #==============================================================================
  140. # ■ Window_Base
  141. #------------------------------------------------------------------------------
  142. #  游戏中全部窗口的超级类(追加定义)
  143. #==============================================================================
  144. class Window_Base < Window
  145. #--------------------------------------------------------------------------
  146. # ● 描绘 HP
  147. # actor : 角色
  148. # x : 描画目标 X 坐标
  149. # y : 描画目标 Y 坐标
  150. # width : 描画目标的宽
  151. #--------------------------------------------------------------------------
  152. def draw_actor_hp_lvup(actor, x, y)
  153. self.contents.font.color = system_color
  154. self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  155. if $temp_hp == 0
  156. self.contents.font.color = normal_color
  157. self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  158. else
  159. maxhp = actor.maxhp + $temp_hp
  160. self.contents.font.color = Color.new(255, 128, 128, 255)
  161. self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  162. self.contents.font.color = normal_color
  163. self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  164. if $temp_hp >=0
  165. self.contents.font.color = Color.new(255, 128, 128, 255)
  166. self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  167. else
  168. self.contents.font.color = Color.new(255,255,0,255)
  169. self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  170. end
  171. self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  172. self.contents.font.color = normal_color
  173. self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  174. end
  175. end
  176. #--------------------------------------------------------------------------
  177. # ● 描绘 SP
  178. # actor : 角色
  179. # x : 描画目标 X 坐标
  180. # y : 描画目标 Y 坐标
  181. # width : 描画目标的宽
  182. #--------------------------------------------------------------------------
  183. def draw_actor_sp_lvup(actor, x, y)
  184. self.contents.font.color = system_color
  185. self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  186. if $temp_sp == 0
  187. self.contents.font.color = normal_color
  188. self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  189. else
  190. maxsp = actor.maxsp + $temp_sp
  191. self.contents.font.color = Color.new(255, 128, 128, 255)
  192. self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  193. self.contents.font.color = normal_color
  194. self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  195. if $temp_sp >=0
  196. self.contents.font.color = Color.new(255, 128, 128, 255)
  197. self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  198. else
  199. self.contents.font.color = Color.new(255,255,0,255)
  200. self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  201. end
  202. self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  203. self.contents.font.color = normal_color
  204. self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  205. end
  206. end
  207. #--------------------------------------------------------------------------
  208. # ● 描绘能力值
  209. # actor : 角色
  210. # x : 描画目标 X 坐标
  211. # y : 描画目标 Y 坐标
  212. # type : 能力值种类 (0~4)
  213. #--------------------------------------------------------------------------
  214. def draw_actor_lvup(actor, x, y, type)
  215. # 定义数字颜色
  216. lvup = normal_color
  217. upcolor = Color.new(255, 128, 128, 255)
  218. self.contents.font.color = normal_color
  219. case type
  220. when 0
  221. parameter_name = $data_system.words.str
  222. parameter_value = actor.str
  223. parameter_value_temp = parameter_value + $temp_str
  224. if $temp_str != 0
  225. lvup = upcolor
  226. self.contents.draw_text(x + 256, y, 16, 32, "(")
  227. if $temp_str >= 0
  228. self.contents.font.color = lvup
  229. self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  230. else
  231. self.contents.font.color = Color.new(255,255,0,255)
  232. self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  233. end
  234. self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  235. self.contents.font.color = normal_color
  236. self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  237. end
  238. when 1
  239. parameter_name = $data_system.words.dex
  240. parameter_value = actor.dex
  241. parameter_value_temp = parameter_value + $temp_dex
  242. if $temp_dex != 0
  243. lvup = upcolor
  244. self.contents.draw_text(x + 256, y, 16, 32, "(")
  245. if $temp_dex >= 0
  246. self.contents.font.color = lvup
  247. self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  248. else
  249. self.contents.font.color = Color.new(255,255,0,255)
  250. self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  251. end
  252. self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  253. self.contents.font.color = normal_color
  254. self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  255. end
  256. when 2
  257. parameter_name = $data_system.words.agi
  258. parameter_value = actor.agi
  259. parameter_value_temp = parameter_value + $temp_agi
  260. if $temp_agi != 0
  261. lvup = upcolor
  262. self.contents.draw_text(x + 256, y, 16, 32, "(")
  263. if $temp_agi >= 0
  264. self.contents.font.color = lvup
  265. self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  266. else
  267. self.contents.font.color = Color.new(255,255,0,255)
  268. self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  269. end
  270. self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  271. self.contents.font.color = normal_color
  272. self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  273. end
  274. when 3
  275. parameter_name = $data_system.words.int
  276. parameter_value = actor.int
  277. parameter_value_temp = parameter_value + $temp_int
  278. if $temp_int != 0
  279. lvup = upcolor
  280. self.contents.draw_text(x + 256, y, 16, 32, "(")
  281. if $temp_int >= 0
  282. self.contents.font.color = lvup
  283. self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  284. else
  285. self.contents.font.color = Color.new(255,255,0,255)
  286. self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  287. end
  288. self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  289. self.contents.font.color = normal_color
  290. self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  291. end
  292. when 4
  293. parameter_name = "剩余点数"
  294. parameter_value = $point
  295. if $point != 0
  296. lvup = upcolor
  297. end
  298. when 5
  299. parameter_name = $data_system.words.pdef
  300. parameter_value = actor.pdef
  301. parameter_value_temp = parameter_value + $temp_dex
  302. if $temp_dex != 0
  303. lvup = upcolor
  304. self.contents.draw_text(x + 256, 96, 16, 32, "(")
  305. if $temp_dex >= 0
  306. self.contents.font.color = lvup
  307. self.contents.draw_text(x + 272, 96, 80, 32, "+",0)
  308. else
  309. self.contents.font.color = Color.new(255,255,0,255)
  310. self.contents.draw_text(x + 272, 96, 80, 32, "-",0)
  311. end
  312. self.contents.draw_text(x + 272, 96, 80, 32, $temp_dex.abs.to_s,1)
  313. self.contents.font.color = normal_color
  314. self.contents.draw_text(x + 272, 96, 80, 32, ")", 2)
  315. end
  316. end
  317. self.contents.font.color = system_color
  318. self.contents.draw_text(x, y, 120, 32, parameter_name)
  319. self.contents.font.color = normal_color
  320. self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)
  321. if type != 4
  322. self.contents.draw_text(x + 150, y, 36, 32, "→")
  323. end
  324. self.contents.font.color = lvup
  325. self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  326. self.contents.font.color = normal_color
  327. end
  328. end
  329. #==============================================================================
  330. # ■ Window_lvup
  331. #------------------------------------------------------------------------------
  332. #  显示升级状态窗口。
  333. #==============================================================================
  334. class Window_Lvup < Window_Base
  335. #--------------------------------------------------------------------------
  336. # ● 初始化对像
  337. # actor : 角色
  338. #--------------------------------------------------------------------------
  339. def initialize(actor)
  340. super(0, 0, 512, 320)
  341. self.contents = Bitmap.new(width - 32, height - 32)
  342. @actor = actor
  343. refresh
  344. end
  345. #--------------------------------------------------------------------------
  346. # ● 刷新
  347. #--------------------------------------------------------------------------
  348. def refresh
  349. self.contents.clear
  350. draw_actor_graphic(@actor, 40, 112)
  351. draw_actor_name(@actor, 4, 0)
  352. draw_actor_class(@actor, 4 + 144, 0)
  353. draw_actor_level(@actor, 96, 32)
  354. draw_actor_state(@actor, 96, 64)
  355. draw_actor_hp_lvup(@actor, 96+128, 32)
  356. draw_actor_sp_lvup(@actor, 96+128, 64)
  357. draw_actor_lvup(@actor, 96, 128, 0)
  358. draw_actor_lvup(@actor, 96, 160, 1)
  359. draw_actor_lvup(@actor, 96, 192, 2)
  360. draw_actor_lvup(@actor, 96, 224, 3)
  361. draw_actor_lvup(@actor, 96, 256, 4)
  362. draw_actor_lvup(@actor, 96, 96, 5)
  363. end
  364. end
  365. #==============================================================================
  366. # ■ Window_Help
  367. #------------------------------------------------------------------------------
  368. #  特技及物品的说明、角色的状态显示的窗口。
  369. #==============================================================================
  370. class Window_Lvup_Help < Window_Base
  371. #--------------------------------------------------------------------------
  372. # ● 初始化对像
  373. #--------------------------------------------------------------------------
  374. def initialize
  375. super(0, 320, 640, 160)
  376. self.contents = Bitmap.new(width - 32, height - 32)
  377. @test = "" #——这个东西用来检测,节约内存专用
  378. end
  379. #--------------------------------------------------------------------------
  380. # ● 设置文本
  381. #--------------------------------------------------------------------------
  382. def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  383. if @test != text1
  384. @test = text1
  385. else
  386. return
  387. end
  388. self.contents.clear
  389. self.contents.font.color = normal_color
  390. self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  391. if text2 != nil
  392. self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  393. end
  394. self.contents.font.size -= 4
  395. if text3 != nil
  396. self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  397. end
  398. if text4 != nil
  399. self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  400. end
  401. self.contents.font.size += 4
  402. end
  403. end
  404. #==============================================================================
  405. # ■ Scene_lvup
  406. #------------------------------------------------------------------------------
  407. #  处理升级画面的类。
  408. #==============================================================================
  409. class Scene_Lvup
  410. #--------------------------------------------------------------------------
  411. # ● 初始化对像
  412. # actor_index : 角色索引
  413. # menu_index : 选项起始位置
  414. #--------------------------------------------------------------------------
  415. def initialize(actor_index = 0 , menu_index = 0)
  416. @actor_index = actor_index
  417. @menu_index = menu_index
  418. end
  419. #--------------------------------------------------------------------------
  420. # ● 主处理
  421. #--------------------------------------------------------------------------
  422. def main
  423. s1 = "增加体力"
  424. s2 = "增加力量"
  425. s3 = "增加罡气"
  426. s4 = "增加敏捷"
  427. s5 = "增加仙力"
  428. s6 = "确认加点"
  429. s7 = "点数重置"
  430. @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  431. @command_window.index = @menu_index
  432. # 获取角色
  433. @actor = $game_party.actors[@actor_index]
  434. # 将角色的剩余点数带入
  435. $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
  436. # 初始化临时量
  437. $temp_str = 0
  438. $temp_dex = 0
  439. $temp_pdef = 0
  440. $temp_agi = 0
  441. $temp_int = 0
  442. $temp_hp = 0
  443. $temp_sp = 0
  444. #=========================================================================
  445. # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  446. # (各种编程语言都有这种意外),建议还是使用整数,正负不限
  447. #=========================================================================
  448. # 每提升一次力量,提升多少附加能力
  449. #=========================================================================
  450. @str_hp = 0 # 每提升一次力量附加提升多少HP
  451. @str_sp = 0 # 每提升一次力量附加提升多少SP
  452. @str_dex = 0 # 每提升一次力量附加提升多少灵巧
  453. @str_agi = 0 # 每提升一次力量附加提升多少速度
  454. @str_int = 0 # 每提升一次力量附加提升多少魔力
  455. @str_str = 1 # 每提升一次力量附加提升多少力量
  456. #=========================================================================
  457. # 每提升一次灵巧,提升多少附加能力
  458. #=========================================================================
  459. @dex_hp = 0 # 每提升一次灵巧附加提升多少HP
  460. @dex_sp = 0 # 每提升一次灵巧附加提升多少SP
  461. @dex_str = 0 # 每提升一次灵巧附加提升多少力量
  462. @dex_agi = 0 # 每提升一次灵巧附加提升多少速度
  463. @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
  464. @dex_dex = 1.5 # 每提升一次灵巧附加提升多少灵巧
  465. #=========================================================================
  466. # 每提升一次速度,提升多少附加能力
  467. #=========================================================================
  468. @agi_hp = 0 # 每提升一次速度附加提升多少HP
  469. @agi_sp = 0 # 每提升一次速度附加提升多少SP
  470. @agi_str = 0 # 每提升一次速度附加提升多少力量
  471. @agi_dex = 0 # 每提升一次速度附加提升多少灵巧
  472. @agi_int = 0 # 每提升一次速度附加提升多少魔力
  473. @agi_agi = 1 # 每提升一次速度附加提升多少速度
  474. #=========================================================================
  475. # 每提升一次魔力,提升多少附加能力
  476. #=========================================================================
  477. @int_hp = 0 # 每提升一次魔力附加提升多少HP
  478. @int_sp = 7 # 每提升一次魔力附加提升多少SP
  479. @int_str = 0 # 每提升一次魔力附加提升多少力量
  480. @int_dex = 0 # 每提升一次魔力附加提升多少灵巧
  481. @int_agi = 0 # 每提升一次魔力附加提升多少速度
  482. @int_int = 1 # 每提升一次魔力附加提升多少魔力
  483. #=========================================================================
  484. # 每提升一次体力,提升多少附加能力
  485. #=========================================================================
  486. @hp = 10 # 每提升一次体力提升多少HP
  487. @sp = 0 # 每提升一次体力提升多少SP
  488. @hp_str = 0 # 每提升一次体力提升多少力量
  489. @hp_dex = 0 # 每提升一次体力提升多少速度
  490. @hp_agi = 0 # 每提升一次体力提升多少灵巧
  491. @hp_int = 0 # 每提升一次体力提升多少魔力
  492. # 定义说明文字
  493. @text_hp_sc = "【提高10点气血上限】"
  494. @text_str_sc = $data_system.words.str + "【提高1点伤害】"
  495. @text_dex_sc = $data_system.words.dex + "【提高1.5点防御】【提高物理命中】【提高必杀率】"
  496. @text_agi_sc = $data_system.words.agi + "【提高1点速度】【提高躲避】"
  497. @text_int_sc = $data_system.words.int + "【提升7点魔法上限】【提高1点灵力】"
  498. @text_save = "保存分配情况并返回游戏"
  499. @text_reset= "重新分配能力点数"
  500. @text_2 = "每增加一次此项能力值,可以提升能力值"
  501. @text_hp = "最大" + $data_system.words.hp + "值"
  502. @text_sp = "最大" + $data_system.words.sp + "值"
  503. @text_str = "最大" + $data_system.words.str + "值"
  504. @text_dex = "最大" + $data_system.words.dex + "值"
  505. @text_agi = "最大" + $data_system.words.agi + "值"
  506. @text_int = "最大" + $data_system.words.int + "值"
  507. s_disable
  508. # 生成状态窗口
  509. @lvup_window = Window_Lvup.new(@actor)
  510. @lvup_window.x = 128
  511. @lvup_window.y = 0
  512. # 生成帮助窗口并初始化帮助文本
  513. @help_window = Window_Lvup_Help.new
  514. # 执行过渡
  515. Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  516. # 主循环
  517. loop do
  518. # 刷新游戏画面
  519. Graphics.update
  520. # 刷新输入信息
  521. Input.update
  522. # 刷新画面
  523. update
  524. # 如果切换画面就中断循环
  525. if $scene != self
  526. break
  527. end
  528. end
  529. # 准备过渡
  530. Graphics.freeze
  531. # 释放窗口
  532. @command_window.dispose
  533. @lvup_window.dispose
  534. @help_window.dispose
  535. end
  536. #--------------------------------------------------------------------------
  537. # ● 刷新画面
  538. #--------------------------------------------------------------------------
  539. def update
  540. # 刷新窗口
  541. @command_window.update
  542. # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  543. s_disable
  544. @lvup_window.update
  545. #=============================================================
  546. # 按下 B 键的情况下
  547. #=============================================================
  548. if Input.trigger?(Input::B)
  549. # 演奏取消 SE
  550. $game_system.se_play($data_system.cancel_se)
  551. # 切换到地图画面
  552. #$scene = Scene_Map.new
  553. $scene = Scene_Menu.new(6)
  554. return
  555. end
  556. #=============================================================
  557. # 按下 C 键的情况下
  558. #=============================================================
  559. if Input.trigger?(Input::C)
  560. if @command_window.index == 5
  561. # 演奏确定 SE
  562. $game_system.se_play($data_system.decision_se)
  563. # 将角色的剩余点数带回
  564. $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  565. # 将角色点数实际加上
  566. @actor.str += $temp_str
  567. @actor.dex += $temp_dex
  568. @actor.agi += $temp_agi
  569. @actor.int += $temp_int
  570. @actor.maxhp += $temp_hp
  571. @actor.maxsp += $temp_sp
  572. @actor.maxhp = $data_actors[@actor.id].max_hp_stars if @actor.maxhp >= $data_actors[@actor.id].max_hp_stars and $data_actors[@actor.id].max_hp_stars != 0
  573. @actor.maxsp = $data_actors[@actor.id].max_sp_stars if @actor.maxsp >= $data_actors[@actor.id].max_sp_stars and $data_actors[@actor.id].max_sp_stars != 0
  574. @actor.str = $data_actors[@actor.id].max_str_stars if @actor.str >= $data_actors[@actor.id].max_str_stars and $data_actors[@actor.id].max_str_stars != 0
  575. @actor.dex = $data_actors[@actor.id].max_dex_stars if @actor.dex >= $data_actors[@actor.id].max_dex_stars and $data_actors[@actor.id].max_dex_stars != 0
  576. @actor.agi = $data_actors[@actor.id].max_agi_stars if @actor.agi >= $data_actors[@actor.id].max_agi_stars and $data_actors[@actor.id].max_agi_stars != 0
  577. @actor.int = $data_actors[@actor.id].max_int_stars if @actor.int >= $data_actors[@actor.id].max_int_stars and $data_actors[@actor.id].max_int_stars != 0
  578. # 切换到地图画面
  579. $scene = Scene_Lvup.new(@actor_index)
  580. return
  581. end
  582. if @command_window.index == 6
  583. # 演奏确定 SE
  584. $game_system.se_play($data_system.cancel_se)
  585. # 将角色的剩余点数带入
  586. $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
  587. # 初始化临时量
  588. $temp_str = 0
  589. $temp_dex = 0
  590. $temp_agi = 0
  591. $temp_int = 0
  592. $temp_hp = 0
  593. $temp_sp = 0
  594. @lvup_window.refresh
  595. return
  596. end
  597. if $point == 0
  598. # 演奏冻结 SE
  599. $game_system.se_play($data_system.buzzer_se)
  600. return
  601. end
  602. case @command_window.index
  603. when 0
  604. if flag(0)
  605. $game_system.se_play($data_system.buzzer_se)
  606. return
  607. end
  608. # 演奏确定 SE
  609. $game_system.se_play($data_system.decision_se)
  610. $temp_hp += flag(0) ? 0 : @hp
  611. $temp_sp += flag(5) ? 0 : @sp
  612. $temp_str += flag(1) ? 0 : @hp_str
  613. $temp_dex += flag(2) ? 0 : @hp_dex
  614. $temp_agi += flag(3) ? 0 : @hp_agi
  615. $temp_int += flag(4) ? 0 :@hp_int
  616. judge
  617. $point -= 1
  618. @lvup_window.refresh
  619. s_disable
  620. return
  621. when 1
  622. if flag(1)
  623. $game_system.se_play($data_system.buzzer_se)
  624. return
  625. end
  626. # 演奏确定 SE
  627. $game_system.se_play($data_system.decision_se)
  628. $temp_hp += flag(0) ? 0 : @str_hp
  629. $temp_sp += flag(5) ? 0 : @str_sp
  630. $temp_str += flag(1) ? 0 : @str_str
  631. $temp_dex += flag(2) ? 0 : @str_dex
  632. $temp_agi += flag(3) ? 0 : @str_agi
  633. $temp_int += flag(4) ? 0 :@str_int
  634. judge
  635. $point -= 1
  636. @lvup_window.refresh
  637. s_disable
  638. return
  639. when 2
  640. if flag(2)
  641. $game_system.se_play($data_system.buzzer_se)
  642. return
  643. end
  644. # 演奏确定 SE
  645. $game_system.se_play($data_system.decision_se)
  646. $temp_hp += flag(0) ? 0 : @dex_hp
  647. $temp_sp += flag(5) ? 0 : @dex_sp
  648. $temp_str += flag(1) ? 0 : @dex_str
  649. $temp_dex += flag(2) ? 0 : @dex_dex
  650. $temp_agi += flag(3) ? 0 : @dex_agi
  651. $temp_int += flag(4) ? 0 :@dex_int
  652. judge
  653. $point -= 1
  654. @lvup_window.refresh
  655. s_disable
  656. return
  657. when 3
  658. if flag(3)
  659. $game_system.se_play($data_system.buzzer_se)
  660. return
  661. end
  662. # 演奏确定 SE
  663. $game_system.se_play($data_system.decision_se)
  664. $temp_hp += flag(0) ? 0 : @agi_hp
  665. $temp_sp += flag(5) ? 0 : @agi_sp
  666. $temp_str += flag(1) ? 0 : @agi_str
  667. $temp_dex += flag(2) ? 0 : @agi_dex
  668. $temp_agi += flag(3) ? 0 : @agi_agi
  669. $temp_int += flag(4) ? 0 :@agi_int
  670. judge
  671. $point -= 1
  672. @lvup_window.refresh
  673. s_disable
  674. return
  675. when 4
  676. if flag(4)
  677. $game_system.se_play($data_system.buzzer_se)
  678. return
  679. end
  680. # 演奏确定 SE
  681. $game_system.se_play($data_system.decision_se)
  682. $temp_hp += flag(0) ? 0 : @int_hp
  683. $temp_sp += flag(5) ? 0 : @int_sp
  684. $temp_str += flag(1) ? 0 : @int_str
  685. $temp_dex += flag(2) ? 0 : @int_dex
  686. $temp_agi += flag(3) ? 0 : @int_agi
  687. $temp_int += flag(4) ? 0 :@int_int
  688. judge
  689. $point -= 1
  690. @lvup_window.refresh
  691. s_disable
  692. return
  693. end
  694. end
  695. #=============================================================
  696. # 什么都没有按下的情况
  697. #=============================================================
  698. case @command_window.index
  699. when 0 # 增加体力
  700. temptext1 = @text_hp + @hp.to_s + "点 " + @text_str + @hp_str.to_s + "点 " + @text_dex + @hp_dex.to_s + "点"
  701. temptext2 = @text_sp + @sp.to_s + "点 " + @text_agi + @hp_agi.to_s + "点 " + @text_int + @hp_int.to_s + "点"
  702. @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  703. when 1 # 增加力量
  704. temptext1 = @text_hp + @str_hp.to_s + "点 " + @text_str + @str_str.to_s + "点 " + @text_dex + @str_dex.to_s + "点"
  705. temptext2 = @text_sp + @str_sp.to_s + "点 " + @text_agi + @str_agi.to_s + "点 " + @text_int + @str_int.to_s + "点"
  706. @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  707. when 2 # 增加灵巧
  708. temptext1 = @text_hp + @dex_hp.to_s + "点 " + @text_str + @dex_agi.to_s + "点 " + @text_dex + @dex_dex.to_s + "点"
  709. temptext2 = @text_sp + @dex_sp.to_s + "点 " + @text_agi + @dex_agi.to_s + "点 " + @text_int + @dex_int.to_s + "点"
  710. @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  711. when 3 # 增加速度
  712. temptext1 = @text_hp + @agi_hp.to_s + "点 " + @text_str + @agi_str.to_s + "点 " + @text_dex + @agi_dex.to_s + "点"
  713. temptext2 = @text_sp + @agi_sp.to_s + "点 " + @text_agi + @agi_agi.to_s + "点 " + @text_int + @agi_int.to_s + "点"
  714. @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  715. when 4 # 增加魔力
  716. temptext1 = @text_hp + @int_hp.to_s + "点 " + @text_str + @int_str.to_s + "点 " + @text_dex + @int_dex.to_s + "点"
  717. temptext2 = @text_sp + @int_sp.to_s + "点 " + @text_agi + @int_agi.to_s + "点 " + @text_int + @int_int.to_s + "点"
  718. @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  719. when 5 # 保存设定
  720. @help_window.lvup_text(@text_save)
  721. when 6 # 点数重置
  722. @help_window.lvup_text(@text_reset)
  723. end
  724. #=============================================================
  725. # 按下R与L换人的情况
  726. #=============================================================
  727. if Input.trigger?(Input::R)
  728. # 演奏光标 SE
  729. $game_system.se_play($data_system.cursor_se)
  730. # 移至下一位角色
  731. @actor_index += 1
  732. @actor_index %= $game_party.actors.size
  733. # 切换到别的状态画面
  734. $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  735. return
  736. end
  737. # 按下 L 键的情况下
  738. if Input.trigger?(Input::L)
  739. # 演奏光标 SE
  740. $game_system.se_play($data_system.cursor_se)
  741. # 移至上一位角色
  742. @actor_index += $game_party.actors.size - 1
  743. @actor_index %= $game_party.actors.size
  744. # 切换到别的状态画面
  745. $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  746. return
  747. end
  748. end
  749. #--------------------------------------------------------------------------
  750. # ● 指数超标判断
  751. #--------------------------------------------------------------------------
  752. def flag(i)
  753. case i
  754. when 0 # hp
  755. if $data_actors[@actor.id].max_hp_stars == 0
  756. return false
  757. else
  758. return @actor.maxhp + $temp_hp >= $data_actors[@actor.id].max_hp_stars
  759. end
  760. when 1 # str
  761. if $data_actors[@actor.id].max_str_stars == 0
  762. return false
  763. else
  764. return @actor.str + $temp_str >= $data_actors[@actor.id].max_str_stars
  765. end
  766. when 2 # dex
  767. if $data_actors[@actor.id].max_dex_stars == 0
  768. return false
  769. else
  770. return @actor.dex + $temp_dex >= $data_actors[@actor.id].max_dex_stars
  771. end
  772. when 3 # agi
  773. if $data_actors[@actor.id].max_agi_stars == 0
  774. return false
  775. else
  776. return @actor.agi + $temp_agi >= $data_actors[@actor.id].max_agi_stars
  777. end
  778. when 4 # int
  779. if $data_actors[@actor.id].max_int_stars == 0
  780. return false
  781. else
  782. return @actor.int + $temp_int >= $data_actors[@actor.id].max_int_stars
  783. end
  784. when 5 # sp
  785. if $data_actors[@actor.id].max_sp_stars == 0
  786. return false
  787. else
  788. return @actor.maxsp + $temp_sp >= $data_actors[@actor.id].max_sp_stars
  789. end
  790. end
  791. end
  792. #--------------------------------------------------------------------------
  793. # ● 超标属性校正
  794. #--------------------------------------------------------------------------
  795. def judge
  796. $temp_hp = $data_actors[@actor.id].max_hp_stars - @actor.maxhp if flag(0)
  797. $temp_sp = $data_actors[@actor.id].max_sp_stars - @actor.maxsp if flag(5)
  798. $temp_str = $data_actors[@actor.id].max_str_stars - @actor.str if flag(1)
  799. $temp_dex = $data_actors[@actor.id].max_dex_stars - @actor.dex if flag(2)
  800. $temp_agi = $data_actors[@actor.id].max_agi_stars - @actor.agi if flag(3)
  801. $temp_int = $data_actors[@actor.id].max_int_stars - @actor.int if flag(4)
  802. end
  803. #--------------------------------------------------------------------------
  804. # ● 选项明暗判断
  805. #--------------------------------------------------------------------------
  806. def s_disable
  807. # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  808. if $point == 0
  809. @command_window.disable_item(0)
  810. @command_window.disable_item(1)
  811. @command_window.disable_item(2)
  812. @command_window.disable_item(3)
  813. @command_window.disable_item(4)
  814. else
  815. @command_window.able_item(0)
  816. @command_window.able_item(1)
  817. @command_window.able_item(2)
  818. @command_window.able_item(3)
  819. @command_window.able_item(4)
  820. end
  821. if flag(1)
  822. @command_window.disable_item(1)
  823. end
  824. if flag(2)
  825. @command_window.disable_item(2)
  826. end
  827. if flag(3)
  828. @command_window.disable_item(3)
  829. end
  830. if flag(4)
  831. @command_window.disable_item(4)
  832. end
  833. if flag(0)
  834. @command_window.disable_item(0)
  835. end
  836. end
  837. end
  838. #==============================================================================
  839. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  840. #=============================================================================
复制代码

版主对此帖的认可:『3Q』,积分『+10』。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2008-5-18
帖子
251
19
发表于 2008-8-8 04:43:19 | 只看该作者

自动提示物品得失的
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————
  4.   
  5. # 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。

  6. # 开关定义:

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

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

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

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

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

  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-160)/2,128,180,100)
  22.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  23.       if value >= 0
  24.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
  25.         #——声效,可以自己改
  26.         Audio.se_play("Audio/SE/"+"006-System06",80,100)
  27.       else
  28.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去金钱:")
  29.         #——声效,可以自己改
  30.         Audio.se_play("Audio/SE/"+"005-System05",80,100)
  31.       end   
  32.       carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
  33.       carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
  34.       carol3_66RPG.opacity = 160
  35.       for i in 0..30
  36.         Graphics.update
  37.       end
  38.       for i in 0..10
  39.         carol3_66RPG.opacity -= 30
  40.         carol3_66RPG.contents_opacity -= 30
  41.         Graphics.update
  42.       end
  43.       carol3_66RPG.dispose
  44.     end
  45.     return true
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ● 增减物品
  49.   #--------------------------------------------------------------------------
  50.   def command_126
  51.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  52.     $game_party.gain_item(@parameters[0], value)
  53.     if $game_switches[$不显示物品窗口]==false
  54.       carol3_66RPG_item = $data_items[@parameters[0]]
  55.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  56.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  57.       if value >= 0
  58.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")   
  59.         #——声效,可以自己改
  60.         Audio.se_play("Audio/SE/"+"006-System06",80,100)
  61.       else
  62.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")   
  63.         #——声效,可以自己改
  64.         Audio.se_play("Audio/SE/"+"005-System05",80,100)
  65.       end
  66.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  67.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  68.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  69.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  70.       carol3_66RPG.opacity = 160
  71.       for i in 0..30
  72.         Graphics.update
  73.       end
  74.       for i in 0..10
  75.         carol3_66RPG.opacity -= 30
  76.         carol3_66RPG.contents_opacity -= 30
  77.         Graphics.update
  78.       end
  79.       carol3_66RPG.dispose
  80.     end
  81.     return true
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 增减武器
  85.   #--------------------------------------------------------------------------
  86.   def command_127
  87.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  88.     $game_party.gain_weapon(@parameters[0], value)
  89.     if $game_switches[$不显示武器窗口]==false
  90.       carol3_66RPG_item = $data_weapons[@parameters[0]]
  91.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  92.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  93.       if value >= 0
  94.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")   
  95.         #——声效,可以自己改
  96.         Audio.se_play("Audio/SE/"+"006-System06",80,100)
  97.       else
  98.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")   
  99.         #——声效,可以自己改
  100.         Audio.se_play("Audio/SE/"+"005-System05",80,100)
  101.       end
  102.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  103.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  104.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  105.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  106.       carol3_66RPG.opacity = 160
  107.       for i in 0..30
  108.         Graphics.update
  109.       end
  110.       for i in 0..10
  111.         carol3_66RPG.opacity -= 30
  112.         carol3_66RPG.contents_opacity -= 30
  113.         Graphics.update
  114.       end
  115.       carol3_66RPG.dispose
  116.     end
  117.     return true
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● 增减防具
  121.   #--------------------------------------------------------------------------
  122.   def command_128
  123.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  124.     $game_party.gain_armor(@parameters[0], value)
  125.     if $game_switches[$不显示防具窗口]==false
  126.       carol3_66RPG_item = $data_armors[@parameters[0]]
  127.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  128.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  129.       if value >= 0
  130.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得防具:")   
  131.         #——声效,可以自己改
  132.         Audio.se_play("Audio/SE/"+"006-System06",80,100)
  133.       else
  134.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去防具:")   
  135.         #——声效,可以自己改
  136.         Audio.se_play("Audio/SE/"+"005-System05",80,100)
  137.       end
  138.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  139.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  140.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  141.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  142.       carol3_66RPG.opacity = 160
  143.       for i in 0..30
  144.         Graphics.update
  145.       end
  146.       for i in 0..10
  147.         carol3_66RPG.opacity -= 30
  148.         carol3_66RPG.contents_opacity -= 30
  149.         Graphics.update
  150.       end
  151.       carol3_66RPG.dispose
  152.     end
  153.     return true
  154.   end
  155. end
复制代码
回复 支持 反对

使用道具 举报

Lv2.观梦者

龙骑

梦石
0
星屑
545
在线时间
10 小时
注册时间
2007-12-31
帖子
2030
20
 楼主| 发表于 2008-8-12 19:19:27 | 只看该作者
先谢谢LS的
不过用处不大
鼓励
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-26 07:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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