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

Project1

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

[已经解决] 请问,CP横版里,如何把怪物血条数值显示在左边。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2010-12-29
帖子
24
跳转到指定楼层
1
发表于 2011-1-11 13:11:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 sunruifeng 于 2011-1-18 20:27 编辑

请问,CP横版里,如何把怪物血条数值显示在左边。
太靠右了的话,血值太高了,就变的只能显示一半。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
120 小时
注册时间
2010-11-19
帖子
160
2
发表于 2011-1-11 14:32:17 | 只看该作者
你使用的是哪一个显血脚本?
请列名吧~
@@
或者截个图
资料不足不确定怎样帮你咧zzz
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
518 小时
注册时间
2010-6-16
帖子
1073
3
发表于 2011-1-11 18:01:38 | 只看该作者
来~血条显示在左边~插入即可~
  1. #======================================================================
  2. # Jens009's Enemy Hp Window                                            
  3. # Version 1.2                                                         
  4. # Log: July 29, 2008                                                  
  5. #     - Version 1.0: Show Enemy Hp Bars
  6. #      August 5, 2008
  7. #     - Version 1.1: Enable On/Off feature Using a $game_system instance
  8. #                  : Enable On/Off feature using an in-game switch
  9. #      August 8, 2008
  10. #     - Version 1.2: Add New Options
  11. #                  : Change Default Window Size
  12. #                  : Add Enemy States
  13. # Rant: [Code Geass ftw]                                             
  14. #   C.C. Still loves Pizza <3                                          
  15. #   Be nice to her Lulu.                                          
  16. #   Oh.. I haven't done my summer homework yet. T_T
  17. #                                                                        
  18. # Credits to:                                                         
  19. #  Jens009 (Translation and Modification)                                             
  20. #  Puppeto4 (Alias tutorial and for bugging me to create a script)   
  21. #      just kidding puppeto =p                                       
  22. # Author's Note:                                                        
  23. # 9 Methods were aliased. Refer to lines 110-118                     
  24. #   4 Were not necessary but was needed so that Enemy Window         
  25. #     was not present during item/skill selections.                    
  26. #                                                                     
  27. #                                                                     
  28. # Modification:                                                        
  29. #   If you want to modify the bars, look @lines 42-72.You can see that
  30. #     I simply took draw_actor_hp and turned it into draw_enemy_hp      
  31. #     This means you can use any bars you desire so long as you define  
  32. #     it correctly. =]                                                  
  33. #            
  34. #-----------------------------------------------------------------------------
  35. # CONFIG:
  36. #
  37. # I. Turning the Window On of Off during In-Game:
  38. #
  39. #    There are two kinds of switches you can use depending
  40. #     upon your liking. I made it so that you either have a
  41. #     game switch or a script switch that handles the enemy window flag.
  42. #
  43. #  If you want to use a script switch
  44. #     -set USE_GSWITCH to false
  45. #     -Use a call script, $game_system.enemy_window = true/false
  46. #         True = Window Shows up, False = No Enemy Window
  47. #
  48. #  If you want to use a game switch
  49. #     -Set USE_GSWITCH to true
  50. #     -Decide what Game Switch ID you want to use
  51. #         in ENEMY_WINDOW_SWITCH
  52. #     -Use that game switch to check for showing the Enemy Hp Window
  53. #        True = Window Shows up, False = No enemy window.
  54. #
  55. #
  56. #  BY DEFAULT, USE_GSWITCH is false.
  57. #     So you are using a Script Switch
  58. #  
  59. #  II.  ALWAYS_UPDATE
  60. #         can either be set to true or false.
  61. #         if true, the enemy window always update for every action
  62. #             but the battle system will have more lag.
  63. #         if false, the enemy window only updates at the end of each turn
  64. #             and everytime the battle selection begins.
  65. #         Setting it to false will lower compatibility but should still work
  66. #        for most systems regardless.
  67. #
  68. # III. Spacing X and Y change
  69. #    SPACING_X = Changing this number will change the X spacing of the windows
  70. #    SPACING_Y = Changing this number will change the Y spacing of the windows
  71. # IV. COLUMNS
  72. #     COLUMNS = Draw enemy information by creating 4 columns.
  73. # V. SHOW_STATES
  74. #     if set to true, enemies state will be shown.
  75. #======================================================================
  76. module JCONFIG
  77.   USE_GSWITCH = false       # Setting it to false will use the script
  78.                             #   switch $game_system.enemy_hp instead.
  79.                             # Setting it to true will use an in-game switch
  80.                             #   using the switch ID below.
  81.   ENEMY_WINDOW_SWITCH = 1 # Switch ID that will be used to check
  82.                           # Enemy Window is only ON, when Switch is ON
  83.   ALWAYS_UPDATE = true     # True = window always updates
  84.                             # False = window updates at end of turn
  85.   SPACING_X = 90          # X spacing per enemy info
  86.   SPACING_Y = 44          # Y spacing per enemy info
  87.   COLUMNS = 4             # By default, Do 4 Columns.
  88.   SHOW_STATES = true      # true will show enemies states
  89.                           # false will not show states
  90.                            
  91. end
  92.                         
  93. #======================================================================
  94. # Start Game_System Edit
  95. #======================================================================
  96. class Game_System
  97.   attr_accessor :enemy_hp       # Show enemy HP on battle
  98.   
  99.   alias jens009_system_initialize_enemy_hp initialize
  100. #=============================================
  101. # Initialize Values
  102. #=============================================
  103.   def initialize
  104.     # Initialize enemy hp window to true
  105.     @enemy_hp = true
  106.     # Call previous methods
  107.     jens009_system_initialize_enemy_hp
  108.   end
  109.   
  110. end # END Game system Edit
  111.   

  112. class Window_Base
  113. #====================================
  114. # Define Enemy Name                  
  115. #====================================
  116.   def draw_enemy_name(enemy, x, y)
  117.     self.contents.font.color = normal_color
  118.     self.contents.draw_text (x, y, 120, 32, enemy.name)
  119.   end
  120.   
  121. #==========================
  122. # Define Enemy State
  123. #========================
  124.   def draw_enemy_state(enemy, x, y)
  125.     count = 0
  126.     for state in enemy.states
  127.       draw_icon(state.icon_index, x + 24 * count, y)
  128.       count += 1
  129.       break if (24 * count > width - 24)
  130.     end
  131.   end
  132. #--------------------------------------------------------------------------
  133. # * Draw Enemy HP
  134. #     actor : actor
  135. #     x     : draw spot x-coordinate
  136. #     y     : draw spot y-coordinate
  137. #     width : Width
  138. #--------------------------------------------------------------------------
  139.   def draw_enemy_hp(enemy, x, y, width = 120)
  140.     draw_enemy_hp_gauge(enemy, x, y, width)
  141.     self.contents.font.color = system_color
  142.     self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
  143.     last_font_size = self.contents.font.size
  144.     xr = x + width
  145.     if width < 120
  146.       self.contents.draw_text(xr - 44, y, 44, WLH, enemy.hp, 2)
  147.     else
  148.       self.contents.draw_text(xr - 99, y, 44, WLH, enemy.hp, 2)
  149.       self.contents.font.color = normal_color
  150.       self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
  151.       self.contents.draw_text(xr - 44, y, 44, WLH, enemy.maxhp, 2)
  152.     end
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # * Draw HP gauge
  156.   #     actor : actor
  157.   #     x     : draw spot x-coordinate
  158.   #     y     : draw spot y-coordinate
  159.   #     width : Width
  160.   #--------------------------------------------------------------------------
  161.   def draw_enemy_hp_gauge(enemy, x, y, width = 120)
  162.     gw = width * enemy.hp / enemy.maxhp
  163.     gc1 = hp_gauge_color1
  164.     gc2 = hp_gauge_color2
  165.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  166.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  167.   end
  168.   
  169. end #End of Window_Base Class


  170. #=====================================#
  171. # Window_EnemyHP                      #  
  172. # Class handles window for Enemy's HP #
  173. #=====================================#
  174. class Window_EnemyHP < Window_Selectable
  175.   def initialize
  176.     super ( 0, 0, 545, 300)
  177.     self.contents = Bitmap.new(width - 32, height - 32)
  178.     self.opacity = 0
  179.     @column_max = JCONFIG::COLUMNS
  180.     refresh
  181.   end
  182.   
  183.   def refresh
  184.     self.contents.clear
  185.     for i in 0...$game_troop.members.size
  186.       enemy = $game_troop.members[i]
  187.       x = i % @column_max * (JCONFIG::SPACING_X + @spacing)
  188.     if JCONFIG::SHOW_STATES
  189.       y = (i / @column_max * (JCONFIG::SPACING_Y + WLH) )
  190.     else
  191.       y = (i / @column_max * ((JCONFIG::SPACING_Y - 34) + WLH) )
  192.     end
  193.    
  194.       #========================================
  195.       # If Using Game_Switch
  196.       #=========================================
  197.       if JCONFIG::USE_GSWITCH and $game_switches[JCONFIG::ENEMY_WINDOW_SWITCH]
  198.         draw_enemy_hp(enemy, x, y+20, 90)
  199.         draw_enemy_name(enemy, x, y)
  200.         if JCONFIG::SHOW_STATES
  201.         draw_enemy_state(enemy, x, y +44)
  202.         end
  203.       end
  204.       #==========================================
  205.       # If Using Script Switch
  206.       #==========================================
  207.       if JCONFIG::USE_GSWITCH == false
  208.         if $game_system.enemy_hp == true # Start check if Window Flag is On
  209.           draw_enemy_hp(enemy, x, y+20, 90)
  210.           draw_enemy_name(enemy, x, y)
  211.           if JCONFIG::SHOW_STATES
  212.           draw_enemy_state(enemy, x, y +44)
  213.           end # END CHECK
  214.         end #End flag check
  215.       end # END game switche check
  216.       
  217.     end
  218.   end #End Refresh

  219. end #End of Window_EnemyHP Class


  220. #====================================#
  221. # Scene_Battle                       #
  222. # New methods that were aliased:     #
  223. #====================================#
  224. class Scene_Battle
  225.   
  226. alias jens009_create_info_viewport create_info_viewport
  227. alias jens009_dispose_info_viewport dispose_info_viewport
  228. alias jens009_start_item_selection start_item_selection
  229. alias jens009_start_skill_selection start_skill_selection
  230. alias jens009_end_item_selection end_item_selection
  231. alias jens009_end_skill_selection end_skill_selection
  232. alias jens009_process_victory process_victory

  233. alias jens009_update_info_viewport update_info_viewport

  234. alias jens009_start_party_command_selection start_party_command_selection
  235. alias jens009_execute_action execute_action
  236. alias jens009_turn_end turn_end

  237. # Create Information
  238. def create_info_viewport
  239.    jens009_create_info_viewport
  240.    @enemy_window = Window_EnemyHP.new
  241. end
  242. # Dispose Information
  243. def dispose_info_viewport
  244.    jens009_dispose_info_viewport
  245.    @enemy_window.dispose
  246. end

  247. #=============================================
  248. # Always Update Window
  249. #============================================
  250. def update_info_viewport
  251.   if JCONFIG::ALWAYS_UPDATE == true
  252.     @enemy_window.refresh
  253.     jens009_update_info_viewport
  254.   else
  255.     jens009_update_info_viewport
  256.   end
  257. end

  258. #=============================================
  259. # Update Only When Turn starts and ends
  260. #============================================
  261. def start_party_command_selection
  262.   if JCONFIG::ALWAYS_UPDATE == true
  263.     jens009_start_party_command_selection
  264.     else
  265.     @enemy_window.visible = true
  266.     @enemy_window.refresh
  267.     jens009_start_party_command_selection
  268.   end
  269. end

  270. def execute_action
  271.   if JCONFIG::ALWAYS_UPDATE == true
  272.     jens009_execute_action
  273.   else
  274.     @enemy_window.visible = false
  275.     jens009_execute_action
  276.   end
  277. end

  278. def turn_end
  279.   if JCONFIG::ALWAYS_UPDATE == true
  280.     jens009_turn_end
  281.   else
  282.     @enemy_window.refresh
  283.     jens009_turn_end
  284.   end
  285. end
  286. #============================================
  287. # END OF UPDATE CHECK
  288. #===========================================

  289. #=====================================
  290. # Remove Window During Selection  
  291. def start_item_selection
  292.    @enemy_window.visible = false
  293.    jens009_start_item_selection
  294. end
  295. # Remove Window During Selection
  296. def start_skill_selection
  297.    @enemy_window.visible = false
  298.    jens009_start_skill_selection
  299. end
  300. # True Visibility after slection
  301. def end_item_selection
  302.    jens009_end_item_selection
  303.    @enemy_window.visible = true
  304. end
  305. # True Visibility after selection
  306. def end_skill_selection
  307.    jens009_end_skill_selection
  308.    @enemy_window.visible = true
  309. end
  310. # Refresh When Victorious
  311. def process_victory
  312.    @enemy_window.refresh
  313.    jens009_process_victory
  314.   end

  315. #=====================================#
  316. # End of Scene_Battle Method Edits    #
  317. #=====================================#

  318. end
复制代码

评分

参与人数 1星屑 +400 收起 理由
夕阳武士 + 400 认可

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2010-12-29
帖子
24
4
 楼主| 发表于 2011-1-18 20:17:34 | 只看该作者
谢谢你们了。呃,怎么结帖来着——|||


sunruifeng于2011-1-18 20:17补充以下内容:
谢谢你们了。呃,怎么结帖来着——|||

点评

编辑主楼标签为“已经解决”即可~  发表于 2011-1-22 19:13
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-3 17:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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