赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 5775 |
最后登录 | 2019-5-3 |
在线时间 | 209 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 148
- 在线时间
- 209 小时
- 注册时间
- 2012-1-9
- 帖子
- 169
|
本帖最后由 嘿嘿一笑 于 2012-1-18 21:09 编辑
01.#==============================================================================
02.# ■ Game_Party
03.#------------------------------------------------------------------------------
04.# 处理同伴的类。包含金钱以及物品的信息。本类的实例
05.# 请参考 $game_party。
06.#==============================================================================
07.class Game_Party
08.#--------------------------------------------------------------------------
09.# ● 加入同伴
10.# actor_id : 角色 ID
11.#--------------------------------------------------------------------------
12.def add_actor(actor_id)
13. # 获取角色
14. actor = $game_actors[actor_id]
15. # 同伴人数未满 5 人、本角色不在队伍中的情况下
16. if @actors.size < 5 and not @actors.include?(actor)
17. # 添加角色
18. @actors.push(actor)
19. # 还原主角
20. $game_player.refresh
21. end
22.end
23.end
24.#==============================================================================
25.# ■ Window_MenuStatus
26.#------------------------------------------------------------------------------
27.# 显示菜单画面和同伴状态的窗口。
28.#==============================================================================
29.class Window_MenuStatus
30.#--------------------------------------------------------------------------
31.# ● 刷新
32.#--------------------------------------------------------------------------
33.def refresh
34. self.contents.clear
35. @item_max = $game_party.actors.size
36. for i in 0...$game_party.actors.size
37. x = 64
38. y = i * 86
39. actor = $game_party.actors
40. draw_actor_graphic(actor, x - 40, y + 70)
41. draw_actor_name(actor, x, y)
42. draw_actor_class(actor, x + 144, y)
43. draw_actor_level(actor, x, y + 24)
44. draw_actor_state(actor, x + 90, y + 24)
45. draw_actor_exp(actor, x, y + 48)
46. draw_actor_hp(actor, x + 236, y + 24)
47. draw_actor_sp(actor, x + 236, y + 48)
48. end
49.end
50.#--------------------------------------------------------------------------
51.# ● 刷新光标矩形
52.#--------------------------------------------------------------------------
53.def update_cursor_rect
54. if @index < 0
55. self.cursor_rect.empty
56. else
57. self.cursor_rect.set(0, @index * 86, self.width - 32, 76)
58. end
59.end
60.end
61.#==============================================================================
62.# ■ Window_BattleStatus
63.#------------------------------------------------------------------------------
64.# 显示战斗画面同伴状态的窗口。
65.#==============================================================================
66.class Window_BattleStatus < Window_Base
67.#--------------------------------------------------------------------------
68.# ● 刷新
69.#--------------------------------------------------------------------------
70.def refresh
71. self.contents.clear
72. @item_max = $game_party.actors.size
73. for i in 0...$game_party.actors.size
74. actor = $game_party.actors
75. actor_x = i * 120 + 4
76. draw_actor_name(actor, actor_x, 0)
77. draw_actor_hp(actor, actor_x, 32, 120)
78. draw_actor_sp(actor, actor_x, 64, 120)
79. if @level_up_flags
80. self.contents.font.color = normal_color
81. self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
82. else
83. draw_actor_state(actor, actor_x, 96)
84. end
85. end
86.end
87.end
88.#==============================================================================
89.# ■ Scene_Battle
90.#------------------------------------------------------------------------------
91.# 处理战斗画面的类。
92.#==============================================================================
93.class Scene_Battle
94.#--------------------------------------------------------------------------
95.# ● 设置角色指令窗口
96.#--------------------------------------------------------------------------
97.def phase3_setup_command_window
98. # 同伴指令窗口无效化
99. @party_command_window.active = false
100. @party_command_window.visible = false
101. # 角色指令窗口无效化
102. @actor_command_window.active = true
103. @actor_command_window.visible = true
104. # 设置角色指令窗口的位置
105. @actor_command_window.x = @actor_index * 120
106. # 设置索引为 0
107. @actor_command_window.index = 0
108.end
109.end
110.#==============================================================================
111.# ■ Game_Actor
112.#------------------------------------------------------------------------------
113.# 处理角色的类。本类在 Game_Actors 类 ($game_actors)
114.# 的内部使用、Game_Party 类请参考 ($game_party) 。
115.#==============================================================================
116.
117.class Game_Actor < Game_Battler
118.#--------------------------------------------------------------------------
119.# ● 取得战斗画面的 X 坐标
120.#--------------------------------------------------------------------------
121.def screen_x
122. # 返回计算后的队伍 X 坐标的排列顺序
123. if self.index != nil
124. return self.index * 120 + 80
125. else
126. return 0
127. end
128.end
129.end
130.#==============================================================================
131.# ■ Sprite_Battler
132.#------------------------------------------------------------------------------
133.# 战斗显示用活动块。Game_Battler 类的实例监视、
134.# 活动块的状态的监视。
135.#==============================================================================
136.
137.class Spriteset_Battle
138.#--------------------------------------------------------------------------
139.# ● 初始化变量
140.#--------------------------------------------------------------------------
141.def initialize
142. # 生成显示端口
143. @viewport1 = Viewport.new(0, 0, 640, 320)
144. @viewport2 = Viewport.new(0, 0, 640, 480)
145. @viewport3 = Viewport.new(0, 0, 640, 480)
146. @viewport4 = Viewport.new(0, 0, 640, 480)
147. @viewport2.z = 101
148. @viewport3.z = 200
149. @viewport4.z = 5000
150. # 生成战斗背景活动块
151. @battleback_sprite = Sprite.new(@viewport1)
152. # 生成敌人活动块
153. @enemy_sprites = []
154. for enemy in $game_troop.enemies.reverse
155. @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
156. end
157. # 生成敌人活动块 ★★修改了这里
158. @actor_sprites = []
159. @actor_sprites.push(Sprite_Battler.new(@viewport2))
160. @actor_sprites.push(Sprite_Battler.new(@viewport2))
161. @actor_sprites.push(Sprite_Battler.new(@viewport2))
162. @actor_sprites.push(Sprite_Battler.new(@viewport2))
163. @actor_sprites.push(Sprite_Battler.new(@viewport2))
164. # 生成天候
165. @weather = RPG::Weather.new(@viewport1)
166. # 生成图片活动块
167. @picture_sprites = []
168. for i in 51..100
169. @picture_sprites.push(Sprite_Picture.new(@viewport3,
170. $game_screen.pictures))
171. end
172. # 生成计时器块
173. @timer_sprite = Sprite_Timer.new
174. # 刷新画面
175. update
176.end
177. #--------------------------------------------------------------------------
178.# ● 刷新画面
179.#--------------------------------------------------------------------------
180.def update
181. # 刷新角色的活动块 (对应角色的替换) ★修改了这里
182. @actor_sprites[0].battler = $game_party.actors[0]
183. @actor_sprites[1].battler = $game_party.actors[1]
184. @actor_sprites[2].battler = $game_party.actors[2]
185. @actor_sprites[3].battler = $game_party.actors[3]
186. @actor_sprites[4].battler = $game_party.actors[4]
187. # 战斗背景的文件名与现在情况有差异的情况下
188. if @battleback_name != $game_temp.battleback_name
189. @battleback_name = $game_temp.battleback_name
190. if @battleback_sprite.bitmap != nil
191. @battleback_sprite.bitmap.dispose
192. end
193. @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
194. @battleback_sprite.src_rect.set(0, 0, 640, 320)
195. end
196. # 刷新战斗者的活动块
197. for sprite in @enemy_sprites + @actor_sprites
198. sprite.update
199. end
200. # 刷新天气图形
201. @weather.type = $game_screen.weather_type
202. @weather.max = $game_screen.weather_max
203. @weather.update
204. # 刷新图片活动块
205. for sprite in @picture_sprites
206. sprite.update
207. end
208. # 刷新计时器活动块
209. @timer_sprite.update
210. # 设置画面的色调与震动位置
211. @viewport1.tone = $game_screen.tone
212. @viewport1.ox = $game_screen.shake
213. # 设置画面的闪烁色
214. @viewport4.color = $game_screen.flash_color
215. # 刷新显示端口
216. @viewport1.update
217. @viewport2.update
218. @viewport4.update
219.end
220.end
复制代码
为什么我使用,测试游戏时,跳出:
脚本XX的3行发生了SyntaxError。咋么回事求教!是脚本问题吗???
XX是我自己定的脚本的名字
|
|