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

Project1

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

[已经过期] 求各位大佬帮忙整合一下这两个脚本

[复制链接]

Lv2.观梦者

梦石
0
星屑
375
在线时间
74 小时
注册时间
2014-1-13
帖子
40
跳转到指定楼层
1
发表于 2017-11-30 12:26:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这是我在百变宝典借用的国外制作XP菜单
  1. #_______________________________________________________________________________
  2. # MOG Scene Menu Itigo V1.5            
  3. #_______________________________________________________________________________
  4. # By Moghunter  
  5. # http://www.atelier-rgss.com
  6. #_______________________________________________________________________________
  7. module MOG
  8. #Tipo de fundo.
  9. # 0 = Imagens em movimento.
  10. # 1 = Mapa de fundo.
  11. MENU_BACKGROUND = 0
  12. #Transition Time.
  13. MNTT = 20
  14. #Transition Type (Name)
  15. MNTP = "006-Stripe02"
  16. end
  17. $mogscript = {} if $mogscript == nil
  18. $mogscript["menu_itigo"] = true
  19. ##############
  20. # Game_Actor #
  21. ##############
  22. class Game_Actor < Game_Battler
  23. def now_exp
  24. return @exp - @exp_list[@level]
  25. end
  26. def next_exp
  27. return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  28. end
  29. end
  30. ############
  31. # Game_Map #
  32. ############
  33. class Game_Map
  34. attr_reader   :map_id  
  35. def mpname
  36. $mpname = load_data("Data/MapInfos.rxdata")
  37. $mpname[@map_id].name
  38. end
  39. end
  40. ###############
  41. # Window_Base #
  42. ###############
  43. class Window_Base < Window
  44. def nada
  45. face = RPG::Cache.picture("")
  46. end   
  47. def drw_face(actor,x,y)
  48. face = RPG::Cache.picture(actor.name + "_fc") rescue nada
  49. cw = face.width
  50. ch = face.height
  51. src_rect = Rect.new(0, 0, cw, ch)
  52. self.contents.blt(x , y - ch, face, src_rect)   
  53. end   
  54. def draw_maphp3(actor, x, y)
  55. back = RPG::Cache.picture("BAR0")   
  56. cw = back.width  
  57. ch = back.height
  58. src_rect = Rect.new(0, 0, cw, ch)   
  59. self.contents.blt(x + 65, y - ch + 30, back, src_rect)
  60. meter = RPG::Cache.picture("HP_Bar")   
  61. cw = meter.width  * actor.hp / actor.maxhp
  62. ch = meter.height
  63. src_rect = Rect.new(0, 0, cw, ch)
  64. self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
  65. text = RPG::Cache.picture("HP_Tx")   
  66. cw = text.width  
  67. ch = text.height
  68. src_rect = Rect.new(0, 0, cw, ch)
  69. self.contents.blt(x + 35, y - ch + 30, text, src_rect)
  70. self.contents.font.color = Color.new(0,0,0,255)
  71. self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2)
  72. self.contents.font.color = Color.new(255,255,255,255)
  73. self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2)   
  74. end  
  75. def draw_mapsp3(actor, x, y)
  76. back = RPG::Cache.picture("BAR0")   
  77. cw = back.width  
  78. ch = back.height
  79. src_rect = Rect.new(0, 0, cw, ch)   
  80. self.contents.blt(x + 65, y - ch + 30, back, src_rect)
  81. meter = RPG::Cache.picture("SP_Bar")   
  82. cw = meter.width  * actor.sp / actor.maxsp
  83. ch = meter.height
  84. src_rect = Rect.new(0, 0, cw, ch)
  85. self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
  86. text = RPG::Cache.picture("SP_Tx")   
  87. cw = text.width  
  88. ch = text.height
  89. src_rect = Rect.new(0, 0, cw, ch)
  90. self.contents.blt(x + 35, y - ch + 30, text, src_rect)
  91. self.contents.font.color = Color.new(0,0,0,255)
  92. self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2)
  93. self.contents.font.color = Color.new(255,255,255,255)
  94. self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2)   
  95. end  
  96. def draw_mexp2(actor, x, y)
  97. bitmap2 = RPG::Cache.picture("Exp_Back")
  98. cw = bitmap2.width
  99. ch = bitmap2.height
  100. src_rect = Rect.new(0, 0, cw, ch)
  101. self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect)
  102. if actor.next_exp != 0
  103. rate = actor.now_exp.to_f / actor.next_exp
  104. else
  105. rate = 1
  106. end
  107. bitmap = RPG::Cache.picture("Exp_Meter")
  108. if actor.level < 99
  109. cw = bitmap.width * rate
  110. else
  111. cw = bitmap.width
  112. end   
  113. ch = bitmap.height
  114. src_rect = Rect.new(0, 0, cw, ch)
  115. self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect)
  116. exp_tx = RPG::Cache.picture("Exp_tx")
  117. cw = exp_tx.width
  118. ch = exp_tx.height
  119. src_rect = Rect.new(0, 0, cw, ch)
  120. self.contents.blt(x + 55 , y - ch + 30, exp_tx, src_rect)
  121. lv_tx = RPG::Cache.picture("LV_tx")
  122. cw = lv_tx.width
  123. ch = lv_tx.height
  124. src_rect = Rect.new(0, 0, cw, ch)
  125. self.contents.blt(x + 125 , y - ch + 35, lv_tx, src_rect)
  126. self.contents.font.color = Color.new(0,0,0,255)
  127. self.contents.draw_text(x + 161, y + 7, 24, 32, actor.level.to_s, 1)
  128. self.contents.font.color = Color.new(255,255,255,255)
  129. self.contents.draw_text(x + 160, y + 6, 24, 32, actor.level.to_s, 1)
  130. end
  131. def draw_actor_state2(actor, x, y, width = 80)
  132. text = make_battler_state_text(actor, width, true)
  133. self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
  134. self.contents.draw_text(x, y, width, 32, text,2)
  135. end  
  136. end
  137. ######################
  138. # Window_MenuStatus2 #
  139. ######################
  140. class Window_MenuStatus2 < Window_Selectable
  141. def initialize
  142. super(0, 0, 415, 280)
  143. self.contents = Bitmap.new(width - 32, height - 32)
  144. self.windowskin = RPG::Cache.windowskin("")
  145. self.opacity = 0
  146. self.z = 15
  147. refresh
  148. self.active = false
  149. self.index = -1
  150. end
  151. def refresh
  152. self.contents.clear
  153. @item_max = $game_party.actors.size
  154. for i in 0...$game_party.actors.size
  155. x = 20
  156. y = i * 62
  157. actor = $game_party.actors[i]
  158. self.contents.font.name = "Georgia"
  159. if $mogscript["TP_System"] == true
  160. draw_actor_tp(actor ,x + 285, y - 5,4)  
  161. draw_actor_state2(actor ,x + 190, y - 5)
  162. else  
  163. draw_actor_state2(actor ,x + 220, y - 5)
  164. end
  165. drw_face(actor,x,y + 50)
  166. draw_maphp3(actor,x + 40, y - 5)
  167. draw_mapsp3(actor,x + 40, y + 20 )
  168. draw_mexp2(actor,x + 140, y + 15 )
  169. end
  170. end
  171. def update_cursor_rect
  172. if @index < 0
  173. self.cursor_rect.empty
  174. else
  175. self.cursor_rect.set(5, @index * 62, self.width - 32, 50)
  176. end
  177. end
  178. end
  179. ################
  180. # Window_Gold2 #
  181. ################
  182. class Window_Gold2 < Window_Base
  183. def initialize
  184. super(0, 0, 160, 64)
  185. self.contents = Bitmap.new(width - 32, height - 32)
  186. self.windowskin = RPG::Cache.windowskin("")
  187. self.opacity = 0
  188. self.z = 15
  189. refresh
  190. end
  191. def refresh
  192. self.contents.clear
  193. cx = contents.text_size($data_system.words.gold).width
  194. self.contents.font.color = normal_color
  195. self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
  196. self.contents.font.color = system_color
  197. self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
  198. end
  199. end
  200. ####################
  201. # Window_PlayTime2 #
  202. ####################
  203. class Window_PlayTime2 < Window_Base
  204. def initialize
  205. super(0, 0, 160, 96)
  206. self.contents = Bitmap.new(width - 32, height - 32)
  207. self.windowskin = RPG::Cache.windowskin("")
  208. self.opacity = 0
  209. self.z = 15
  210. refresh
  211. end
  212. def refresh
  213. self.contents.clear
  214. @total_sec = Graphics.frame_count / Graphics.frame_rate
  215. hour = @total_sec / 60 / 60
  216. min = @total_sec / 60 % 60
  217. sec = @total_sec % 60
  218. text = sprintf("%02d:%02d:%02d", hour, min, sec)
  219. self.contents.font.color = normal_color
  220. self.contents.draw_text(4, 32, 120, 32, text, 2)
  221. end
  222. def update
  223. super
  224. if Graphics.frame_count / Graphics.frame_rate != @total_sec
  225. refresh
  226. end
  227. end
  228. end
  229. #################
  230. # Window_Steps2 #
  231. #################
  232. class Window_Steps2 < Window_Base
  233. def initialize
  234. super(0, 0, 160, 96)
  235. self.contents = Bitmap.new(width - 32, height - 32)
  236. self.windowskin = RPG::Cache.windowskin("")
  237. self.opacity = 0
  238. self.z = 15
  239. refresh
  240. end
  241. def refresh
  242. self.contents.clear
  243. self.contents.font.color = normal_color
  244. self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2)
  245. end
  246. end
  247. ###################
  248. # Window_Map_Name #
  249. ###################
  250. class Window_Map_Name < Window_Base
  251. def initialize
  252. super(0, 0, 160, 96)
  253. self.contents = Bitmap.new(width - 32, height - 32)
  254. self.windowskin = RPG::Cache.windowskin("")
  255. self.opacity = 0
  256. self.z = 15
  257. refresh
  258. end
  259. def refresh
  260. self.contents.clear
  261. self.contents.font.color = normal_color
  262. self.contents.draw_text(4, 32, 120, 32, $game_map.mpname.to_s, 1)
  263. end
  264. end
  265. ##############
  266. # Scene_Menu #
  267. ##############
  268. class Scene_Menu
  269. def initialize(menu_index = 0)
  270. @menu_index = menu_index
  271. end
  272. def main
  273. s1 = ""
  274. s2 = ""
  275. s3 = ""
  276. s4 = ""
  277. s5 = ""
  278. s6 = ""
  279. @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  280. @command_window.index = @menu_index
  281. if $game_party.actors.size == 0
  282. @command_window.disable_item(0)
  283. @command_window.disable_item(1)
  284. @command_window.disable_item(2)
  285. @command_window.disable_item(3)
  286. end
  287. @command_window.visible = false
  288. @command_window.x = -640
  289. @mnlay = Sprite.new
  290. @mnlay.bitmap = RPG::Cache.picture("Mn_lay")
  291. @mnlay.z = 10
  292. @mnlay.opacity = 0
  293. @mnlay.x = -100
  294. if MOG::MENU_BACKGROUND == 0
  295. @mnback = Plane.new
  296. @mnback.bitmap = RPG::Cache.picture("Mn_back")
  297. @mnback.blend_type = 0
  298. @mnback.z = 5
  299. @mnback2 = Plane.new
  300. @mnback2.bitmap = RPG::Cache.picture("Mn_back")
  301. @mnback2.blend_type = 0
  302. @mnback2.z = 5
  303. @mnback2.opacity = 60
  304. else
  305. @spriteset = Spriteset_Map.new
  306. end
  307. @mnsel = Sprite.new
  308. @mnsel.bitmap = RPG::Cache.picture("Mn_Sel")
  309. @mnsel.z = 20
  310. @mnsel.x = 0
  311. @mnsel.y = 110
  312. @mnop = 150
  313. if $game_system.save_disabled
  314. @command_window.disable_item(4)
  315. end
  316. @playtime_window = Window_PlayTime2.new
  317. @playtime_window.x = 30
  318. @playtime_window.y = 375
  319. @playtime_window.contents_opacity = 0
  320. @mapname_window = Window_Map_Name.new
  321. @mapname_window.x = 425
  322. @mapname_window.y = 25
  323. @mapname_window.contents_opacity = 0
  324. @steps_window = Window_Steps2.new
  325. @steps_window.x = 230
  326. @steps_window.y = 375
  327. @steps_window.contents_opacity = 0
  328. @gold_window = Window_Gold2.new
  329. @gold_window.x = 455
  330. @gold_window.y = 405
  331. @gold_window.contents_opacity = 0
  332. @status_window = Window_MenuStatus2.new
  333. @status_window.x = 295
  334. @status_window.y = 110
  335. @status_window.contents_opacity = 0
  336. if MOG::MENU_BACKGROUND == 0
  337. Graphics.transition(MOG::MNTT, "Graphics/Transitions/" + MOG::MNTP)
  338. else
  339. Graphics.transition  
  340. end
  341. loop do
  342. Graphics.update
  343. Input.update
  344. update
  345. if $scene != self
  346. break
  347. end
  348. end
  349. for i in 0..10  
  350. if MOG::MENU_BACKGROUND == 0
  351. @mnback.oy += 1
  352. @mnback.ox += 1
  353. @mnback2.oy += 1
  354. @mnback2.ox -= 1
  355. end
  356. @status_window.x += 20
  357. @status_window.contents_opacity -= 25
  358. @mnsel.opacity -= 25
  359. @mnsel.zoom_x += 0.03
  360. @mnlay.x -= 10
  361. @mnlay.opacity -= 25
  362. @mapname_window.x += 5
  363. @mapname_window.contents_opacity -= 20
  364. @steps_window.contents_opacity -= 25
  365. @gold_window.contents_opacity -= 25
  366. @playtime_window.contents_opacity -= 25
  367. Graphics.update   
  368. end
  369. Graphics.freeze
  370. @command_window.dispose
  371. @playtime_window.dispose
  372. @steps_window.dispose
  373. @gold_window.dispose   
  374. @status_window.dispose
  375. @mnlay.dispose
  376. if MOG::MENU_BACKGROUND == 0
  377. @mnback.dispose
  378. @mnback2.dispose
  379. else
  380. @spriteset.dispose
  381. end
  382. @mnsel.dispose
  383. @mapname_window.dispose
  384. Graphics.update
  385. end
  386. def update
  387. if @mnsel.zoom_x <= 1.6
  388. @mnsel.zoom_x += 0.03
  389. @mnsel.opacity -= 10
  390. elsif @mnsel.zoom_x > 1.6
  391. @mnsel.zoom_x = 1.0
  392. @mnsel.opacity = 255
  393. end     
  394. if @mnlay.x < 0
  395. @mnlay.opacity += 25
  396. @mnlay.x += 10
  397. elsif @mnlay.x >= 0  
  398. @mnlay.opacity = 255
  399. @mnlay.x = 0
  400. end
  401. @command_window.update if @command_window.active
  402. @playtime_window.update
  403. @status_window.update if @status_window.active
  404. if MOG::MENU_BACKGROUND == 0
  405. @mnback.oy += 1
  406. @mnback.ox += 1
  407. @mnback2.oy += 1
  408. @mnback2.ox -= 1
  409. end
  410. @mnop += 5
  411. @mapname_window.contents_opacity += 15
  412. @playtime_window.contents_opacity += 15
  413. @gold_window.contents_opacity += 15
  414. @playtime_window.contents_opacity += 15
  415. @steps_window.contents_opacity += 15
  416. if @status_window.x > 195
  417. @status_window.x -= 10
  418. @status_window.contents_opacity += 10
  419. elsif @status_window.x <= 195
  420. @status_window.x = 195
  421. @status_window.contents_opacity = 255
  422. end
  423. if @mnop >= 255
  424. @mnop = 120
  425. end   
  426. if @command_window.active
  427. update_command
  428. return
  429. end
  430. if @status_window.active
  431. update_status
  432. return
  433. end
  434. end
  435. def update_command
  436. case @command_window.index
  437. when 0  
  438. @mnsel.x = 0
  439. @mnsel.y = 110
  440. when 1
  441. @mnsel.x = 25
  442. @mnsel.y = 155
  443. when 2
  444. @mnsel.x = 40
  445. @mnsel.y = 197
  446. when 3
  447. @mnsel.x = 45
  448. @mnsel.y = 242
  449. when 4
  450. @mnsel.x = 25
  451. @mnsel.y = 285
  452. when 5
  453. @mnsel.x = 0
  454. @mnsel.y = 325
  455. end   
  456. if Input.trigger?(Input::B)
  457. $game_system.se_play($data_system.cancel_se)
  458. $scene = Scene_Map.new
  459. return
  460. end
  461. if Input.trigger?(Input::C)
  462. if $game_party.actors.size == 0 and @command_window.index < 4
  463. $game_system.se_play($data_system.buzzer_se)
  464. return
  465. end
  466. case @command_window.index
  467. when 0
  468. $game_system.se_play($data_system.decision_se)
  469. $scene = Scene_Item.new
  470. when 1
  471. $game_system.se_play($data_system.decision_se)
  472. @command_window.active = false
  473. @status_window.active = true
  474. @status_window.index = 0
  475. when 2
  476. $game_system.se_play($data_system.decision_se)
  477. @command_window.active = false
  478. @status_window.active = true
  479. @status_window.index = 0
  480. when 3
  481. $game_system.se_play($data_system.decision_se)
  482. @command_window.active = false
  483. @status_window.active = true
  484. @status_window.index = 0
  485. when 4
  486. if $game_system.save_disabled
  487. $game_system.se_play($data_system.buzzer_se)
  488. return
  489. end
  490. $game_system.se_play($data_system.decision_se)
  491. $scene = Scene_Save.new
  492. when 5
  493. $game_system.se_play($data_system.decision_se)
  494. $scene = Scene_End.new
  495. end
  496. return
  497. end
  498. end
  499. def update_status  
  500. case @status_window.index
  501. when 0  
  502. @mnsel.x = 180
  503. @mnsel.y = 130
  504. when 1
  505. @mnsel.x = 180
  506. @mnsel.y = 195
  507. when 2
  508. @mnsel.x = 180
  509. @mnsel.y = 255
  510. when 3
  511. @mnsel.x = 180
  512. @mnsel.y = 320
  513. end  
  514. if Input.trigger?(Input::B)
  515. $game_system.se_play($data_system.cancel_se)
  516. @command_window.active = true
  517. @status_window.active = false
  518. @status_window.index = -1
  519. return
  520. end
  521. if Input.trigger?(Input::C)
  522. case @command_window.index
  523. when 1
  524. if $game_party.actors[@status_window.index].restriction >= 2
  525. $game_system.se_play($data_system.buzzer_se)
  526. return
  527. end
  528. $game_system.se_play($data_system.decision_se)
  529. $scene = Scene_Skill.new(@status_window.index)
  530. when 2  
  531. $game_system.se_play($data_system.decision_se)
  532. $scene = Scene_Equip.new(@status_window.index)
  533. when 3  
  534. $game_system.se_play($data_system.decision_se)
  535. $scene = Scene_Status.new(@status_window.index)
  536. end
  537. return
  538. end
  539. end
  540. end
复制代码




这是我在66rpg图书馆借用的任务系统脚本

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #简略使用说明:
  5. #事件脚本输入  $任务 = "文字"  或  $支线 = "文字"  即可设定任务。
  6. #至于怎么完成任务……本喵忘记了……(~ ̄△ ̄)~

  7. #==============================================================================
  8. # Game_System
  9. #------------------------------------------------------------------------------
  10. # 添加内容
  11. #==============================================================================
  12. class Game_System
  13.   attr_accessor :mission #现在执行的任务
  14.   attr_accessor :partmission
  15.   alias carol3_ini initialize
  16.   def initialize
  17.     carol3_ini
  18.     @mission = ""
  19.     @partmission = []
  20.   end
  21. end
  22. #==============================================================================
  23. # ■ Scene_Title
  24. #------------------------------------------------------------------------------
  25. #  处理标题画面的类。
  26. #==============================================================================
  27. class Scene_Title
  28.   alias carol3_title1 main
  29.   def main
  30.     $map_infos = load_data("Data/MapInfos.rxdata")
  31.     for key in $map_infos.keys
  32.       $map_infos[key] = $map_infos[key].name
  33.     end
  34.     $任务 = ""
  35.     $支线 = nil
  36.     $支线完成 = nil
  37.     carol3_title1
  38.   end
  39. end
  40. class Scene_Map
  41.   alias carol3_update update
  42.   def update
  43.     carol3_update
  44.     if $支线 != nil
  45.       for i in 0...$game_system.partmission.size
  46.         if $game_system.partmission[i] == $支线
  47.           $支线 = nil
  48.           break
  49.         end
  50.       end
  51.       if $支线 != nil
  52.         $game_system.partmission.push($支线)
  53.         $支线 = nil
  54.       end
  55.     end
  56.     if $支线完成 != nil
  57.       for i in 0...$game_system.partmission.size
  58.         if $game_system.partmission[i] == $支线完成
  59.           $game_system.partmission.delete($game_system.partmission[i])
  60.           break
  61.         end
  62.       end
  63.       $支线完成 = nil
  64.     end
  65.   end
  66. end
  67. #==============================================================================
  68. # Window_MenuStatus
  69. #------------------------------------------------------------------------------
  70. # 显示菜单画面和同伴状态的窗口。
  71. #==============================================================================
  72. class Window_MenuStatus < Window_Selectable
  73.   #--------------------------------------------------------------------------
  74.   # ● 初始化目标
  75.   #--------------------------------------------------------------------------
  76.   def initialize
  77.     super(0, 0, 480, 384)
  78.     self.contents = Bitmap.new(width - 32, height - 32)
  79.     self.active = false
  80.     self.index = -1
  81.     @position = 0
  82.     @count = 0
  83.     @oldposition = 0
  84.     refresh
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 刷新
  88.   #--------------------------------------------------------------------------
  89.   def refresh
  90.     self.contents.clear
  91.     @item_max = $game_party.actors.size
  92.     for i in 0...$game_party.actors.size
  93.       x = 64
  94.       y = i * 90
  95.       actor = $game_party.actors[i]
  96.       self.contents.font.size = 18
  97.       draw_actor_active_graphic(actor, x - 40, y + 50)
  98.       draw_actor_name(actor, x, y)
  99.       draw_actor_class(actor, x + 144, y)
  100.       draw_actor_level(actor, x, y + 25)
  101.       draw_actor_state(actor, x + 90, y + 25)
  102.       draw_actor_exp(actor, x, y + 50)
  103.       draw_actor_hp(actor, x + 236, y + 25)
  104.       draw_actor_sp(actor, x + 236, y + 50)
  105.     end
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● 绘制行走图
  109.   #--------------------------------------------------------------------------
  110.   def draw_actor_active_graphic(actor, x, y)
  111.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  112.     cw = bitmap.width / 4
  113.     ch = bitmap.height / 4
  114.     p = @position * cw
  115.     src_rect = Rect.new(p, 0, cw, ch)
  116.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 刷新光标矩形
  120.   #--------------------------------------------------------------------------
  121.   def update_cursor_rect
  122.     if @index < 0
  123.       self.cursor_rect.empty
  124.     else
  125.       self.cursor_rect.set(0, @index *90-5, self.width - 32, 90)
  126.     end
  127.   end  
  128.   def update
  129.     super
  130.     @count += 1
  131.     @count %= 15
  132.     if @count == 0
  133.       @position = (@position + 1) % 4
  134.     end
  135.     if @position != @oldposition
  136.       @oldposition = @position
  137.       refresh
  138.     end
  139.   end
  140. end
  141. #==============================================================================
  142. # ■ Game_Map
  143. #------------------------------------------------------------------------------
  144. #  处理地图的类。包含卷动以及可以通行的判断功能。
  145. # 本类的实例请参考 $game_map 。
  146. #==============================================================================
  147. class Game_Map
  148.   def name
  149.     return $map_infos[@map_id]
  150.   end
  151. end
  152. #==============================================================================
  153. # Window_RecordBook
  154. #------------------------------------------------------------------------------
  155. # 菜单界面表示信息的窗口
  156. #==============================================================================
  157. class Window_RecordBook < Window_Base
  158.   #--------------------------------------------------------------------------
  159.   # ● 初始化对象
  160.   #--------------------------------------------------------------------------
  161.   def initialize
  162.     super(160, 384, 480, 480)
  163.     self.contents = Bitmap.new(width - 32, height - 32)
  164.     if $任务 == ""
  165.       $任务 = $game_system.mission
  166.     else
  167.       $game_system.mission = $任务
  168.     end
  169.     refresh
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 刷新画面
  173.   #--------------------------------------------------------------------------
  174.   def refresh
  175.     self.contents.clear
  176.     self.contents.font.color = system_color
  177.     self.contents.font.size = 20
  178.     cx = self.contents.text_size("现在地点").width + 24
  179.     self.contents.draw_text(4, 0, cx, 24, "现在地点")
  180.     self.contents.font.color = normal_color
  181.     self.contents.draw_text(4 + cx, 0, 444 - cx, 24, $game_map.name.to_s)  
  182.     self.contents.font.color = system_color
  183.     cx = self.contents.text_size("主线任务").width + 24
  184.     self.contents.draw_text(4, 32, cx, 24, "主线任务")
  185.     self.contents.font.color = Color.new(240,250,75,255)
  186.     self.contents.draw_text(4 + cx, 32, 444 - cx, 24, $game_system.mission.to_s)  
  187.     self.contents.font.color = system_color
  188.     cx = self.contents.text_size("支线任务").width + 24
  189.     self.contents.draw_text(4, 96, cx, 24, "支线任务")
  190.     self.contents.font.color = normal_color
  191.     for i in 0...$game_system.partmission.size
  192.       self.contents.draw_text(4 + cx, 96 + i * 32, 444 - cx, 24, $game_system.partmission[i].to_s)
  193.     end
  194.   end
  195. end
  196. #==============================================================================
  197. # ■ Scene_Menu
  198. #------------------------------------------------------------------------------
  199. #  处理菜单画面的类。
  200. #==============================================================================
  201. class Scene_Menu
  202.   #--------------------------------------------------------------------------
  203.   # ● 初始化对像
  204.   # menu_index : 命令光标的初期位置
  205.   #--------------------------------------------------------------------------
  206.   def initialize(menu_index = 0)
  207.     @menu_index = menu_index
  208.     @切换状态暂停 = ""
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● 主处理
  212.   #--------------------------------------------------------------------------
  213.   def main
  214.     # 生成命令窗口
  215.     s1 = " 使用物品"#$data_system.words.item
  216.     s2 = " 使用技能"#$data_system.words.skill
  217.     s3 = " 更改装备"#$data_system.words.equip
  218.     s4 = " 查看状态"
  219.     s5 = " 储存游戏"
  220.     s6 = " 结束游戏"
  221.     s7 = " 查看任务"
  222.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  223.     @command_window.index = @menu_index
  224.     # 同伴人数为 0 的情况下
  225.     if $game_party.actors.size == 0
  226.       # 物品、特技、装备、状态无效化
  227.       @command_window.disable_item(0)
  228.       @command_window.disable_item(1)
  229.       @command_window.disable_item(2)
  230.       @command_window.disable_item(3)
  231.     end
  232.     # 禁止存档的情况下
  233.     if $game_system.save_disabled
  234.       # 存档无效
  235.       @command_window.disable_item(4)
  236.     end
  237.     # 生成游戏时间窗口
  238.     @playtime_window = Window_PlayTime.new
  239.     @playtime_window.x = 0
  240.     @playtime_window.y = 256
  241.     # 生成金钱窗口
  242.     @gold_window = Window_Gold.new
  243.     @gold_window.x = 0
  244.     @gold_window.y = 416
  245.     # 生成状态窗口
  246.     @status_window = Window_MenuStatus.new
  247.     @status_window.x = 160
  248.     @status_window.y = 0
  249.     #—— 生成天书窗口
  250.     @recordbook_window = Window_RecordBook.new
  251.     @recordbook_window.z = 1000
  252.     #—— 生成外边框窗口
  253.     @outside_window = Window_Outside.new
  254.     @outside_window.visible = true
  255.     @outside_window.z = 1001
  256.     # 执行过渡
  257.     Graphics.transition
  258.     # 主循环
  259.     loop do
  260.       # 刷新游戏画面
  261.       Graphics.update
  262.       # 刷新输入信息
  263.       Input.update
  264.       # 刷新画面
  265.       update
  266.       # 如果切换画面就中断循环
  267.       if $scene != self
  268.         break
  269.       end
  270.     end
  271.     # 准备过渡
  272.     Graphics.freeze
  273.     # 释放窗口
  274.     @command_window.dispose
  275.     @playtime_window.dispose
  276.     @gold_window.dispose
  277.     @status_window.dispose
  278.     @outside_window.dispose
  279.     @recordbook_window.dispose
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 刷新画面
  283.   #--------------------------------------------------------------------------
  284.   def update
  285.     # 刷新窗口
  286.     @command_window.update
  287.     @playtime_window.update
  288.     @gold_window.update
  289.     @status_window.update
  290.     # 命令窗口被激活的情况下: 调用 update_command
  291.     if @command_window.active
  292.       update_command
  293.       return
  294.     end
  295.     # 状态窗口被激活的情况下: 调用 update_status
  296.     if @status_window.active
  297.       update_status
  298.       return
  299.     end
  300.     if @outside_window.visible == false
  301.       update_recordbook
  302.       return
  303.     end
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● 刷新画面 (命令窗口被激活的情况下)
  307.   #--------------------------------------------------------------------------
  308.   def update_command
  309.     # 按下 B 键的情况下
  310.     if Input.trigger?(Input::B)
  311.       # 演奏取消 SE
  312.       $game_system.se_play($data_system.cancel_se)
  313.       # 切换的地图画面
  314.       $scene = Scene_Map.new
  315.       return
  316.     end
  317.     # 按下 C 键的情况下
  318.     if Input.trigger?(Input::C)
  319.       # 同伴人数为 0、存档、游戏结束以外的场合
  320.       if $game_party.actors.size == 0 and @command_window.index < 4
  321.         # 演奏冻结 SE
  322.         $game_system.se_play($data_system.buzzer_se)
  323.         return
  324.       end
  325.       # 命令窗口的光标位置分支
  326.       case @command_window.index
  327.       when 0 # 物品
  328.         # 演奏确定 SE
  329.         $game_system.se_play($data_system.decision_se)
  330.         # 切换到物品画面
  331.         $scene = Scene_Item.new
  332.       when 1 # 特技
  333.         # 演奏确定 SE
  334.         $game_system.se_play($data_system.decision_se)
  335.         # 激活状态窗口
  336.         @command_window.active = false
  337.         @status_window.active = true
  338.         @status_window.index = 0
  339.       when 2 # 装备
  340.         # 演奏确定 SE
  341.         $game_system.se_play($data_system.decision_se)
  342.         # 激活状态窗口
  343.         @command_window.active = false
  344.         @status_window.active = true
  345.         @status_window.index = 0
  346.       when 3 # 状态
  347.         # 演奏确定 SE
  348.         $game_system.se_play($data_system.decision_se)
  349.         # 激活状态窗口
  350.         @command_window.active = false
  351.         @status_window.active = true
  352.         @status_window.index = 0
  353.       when 4 # 存档
  354.         # 禁止存档的情况下
  355.         if $game_system.save_disabled
  356.           # 演奏冻结 SE
  357.           $game_system.se_play($data_system.buzzer_se)
  358.           return
  359.         end
  360.         # 演奏确定 SE
  361.         $game_system.se_play($data_system.decision_se)
  362.         # 切换到存档画面
  363.         $scene = Scene_Save.new
  364.       when 5 # 游戏结束
  365.         # 演奏确定 SE
  366.         $game_system.se_play($data_system.decision_se)
  367.         # 切换到游戏结束画面
  368.         $scene = Scene_End.new
  369.       when 6 # 查看任务
  370.         # 演奏确定 SE
  371.         $game_system.se_play($data_system.decision_se)
  372.         @command_window.active = false
  373.         @outside_window.visible = false
  374.       end
  375.       return
  376.     end
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● 刷新画面 (查看天书的情况下)
  380.   #--------------------------------------------------------------------------
  381.   def update_recordbook
  382.     if @切换状态暂停 == "天书消失"
  383.       if @recordbook_window.y < 384
  384.         @recordbook_window.y +=64
  385.         @status_window.y -= 16
  386.         return
  387.       else
  388.         @切换状态暂停 = ""
  389.         @outside_window.visible = true
  390.         @command_window.active = true
  391.       end
  392.     else
  393.       if @recordbook_window.y >0
  394.         @recordbook_window.y -= 32
  395.         @status_window.y += 8
  396.         return
  397.       else
  398.         @status_window.visible = false
  399.         if Input.trigger?(Input::B)
  400.           @切换状态暂停 = "天书消失"
  401.           $game_system.se_play($data_system.cancel_se)
  402.           @status_window.visible = true
  403.           return
  404.         end
  405.       end
  406.     end
  407.   end  
  408.   #--------------------------------------------------------------------------
  409.   # ● 刷新画面 (状态窗口被激活的情况下)
  410.   #--------------------------------------------------------------------------
  411.   def update_status
  412.     # 按下 B 键的情况下
  413.     if Input.trigger?(Input::B)
  414.       # 演奏取消 SE
  415.       $game_system.se_play($data_system.cancel_se)
  416.       # 激活命令窗口
  417.       @command_window.active = true
  418.       @status_window.active = false
  419.       @status_window.index = -1
  420.       return
  421.     end
  422.     # 按下 C 键的情况下
  423.     if Input.trigger?(Input::C)
  424.       # 命令窗口的光标位置分支
  425.       case @command_window.index
  426.       when 1 # 特技
  427.         # 本角色的行动限制在 2 以上的情况下
  428.         if $game_party.actors[@status_window.index].restriction >= 2
  429.           # 演奏冻结 SE
  430.           $game_system.se_play($data_system.buzzer_se)
  431.           return
  432.         end
  433.         # 演奏确定 SE
  434.         $game_system.se_play($data_system.decision_se)
  435.         # 切换到特技画面
  436.         $scene = Scene_Skill.new(@status_window.index)
  437.       when 2 # 装备
  438.         # 演奏确定 SE
  439.         $game_system.se_play($data_system.decision_se)
  440.         # 切换的装备画面
  441.         $scene = Scene_Equip.new(@status_window.index)
  442.       when 3 # 状态
  443.         # 演奏确定 SE
  444.         $game_system.se_play($data_system.decision_se)
  445.         # 切换到状态画面
  446.         $scene = Scene_Status.new(@status_window.index)
  447.       end
  448.       return
  449.     end
  450.   end
  451. end

  452. #==============================================================================
  453. # Window_Outside
  454. #------------------------------------------------------------------------------
  455. # 外边框窗口
  456. #==============================================================================
  457. class Window_Outside < Window_Base
  458.   #--------------------------------------------------------------------------
  459.   # ● 初始化对象
  460.   #--------------------------------------------------------------------------
  461.   def initialize
  462.     super(160, 384, 480, 96)
  463.     self.back_opacity = 0
  464.   end
  465. end
  466. #==============================================================================
  467. # ■ Window_PlayTime
  468. #------------------------------------------------------------------------------
  469. # 菜单画面的系统时间表示
  470. #==============================================================================
  471. class Window_PlayTime < Window_Base
  472.   #--------------------------------------------------------------------------
  473.   # ● 初始化对像
  474.   #--------------------------------------------------------------------------
  475.   def initialize
  476.     super(0, 0, 160, 128)
  477.     self.contents = Bitmap.new(width - 32, height - 32)
  478.     self.contents.font.size = 18
  479.     refresh
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # ● 刷新
  483.   #--------------------------------------------------------------------------
  484.   def refresh
  485.     self.contents.clear
  486.     self.contents.font.color = system_color
  487.     self.contents.font.color = text_color(6)
  488.     time = Time.now
  489.     text = time.strftime("%x %X")
  490.     self.contents.draw_text(-2, 32, 130, 32, text, 2)
  491.     @total_sec = Graphics.frame_count / Graphics.frame_rate
  492.     hour = @total_sec / 60 / 60
  493.     min = @total_sec / 60 % 60
  494.     sec = @total_sec % 60
  495.     text = sprintf("%02d:%02d:%02d", hour, min, sec)
  496.     self.contents.font.color = normal_color
  497.     self.contents.draw_text(4, 0, 160, 32, "日期与游戏时间")
  498.     self.contents.draw_text(-2, 64, 130, 32, text, 2)
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # ● 更新
  502.   #--------------------------------------------------------------------------
  503.   def update
  504.     super
  505.     if Graphics.frame_count / Graphics.frame_rate != @total_sec
  506.       refresh
  507.     end
  508.   end
  509. end



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


这两个脚本有冲突,请各位大大帮忙修改一下,感激不尽
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-11-27 12:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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