设为首页 收藏本站
登录 /立即注册 /找回密码

URPGs

快捷导航
  • 门户Portal
  • 论坛BBS
  • 群组Group
  • 导读Guide
  • 家园Space
  • 工具Tools
  • 广播Follow
  • 期刊Periodical
  • 排行榜Ranklist
  • 社区茶坊
  • pixlr图片编辑
  • 资源列表
  • photobucket
  • RMVA Lite [In English]
  • RM RTP
  • TryRUBY
  • RMXP+RMVX下载[VeryCD]
  • RMVA下载[66RPG]
搜索
  • 本版
  • 帖子
  • 用户
URPGs»论坛 › 技术讨论 › 技术讨论 › 新战斗模板
返回列表 发新帖
查看: 3546|回复: 0

[RMVA 技术讨论] 新战斗模板

[复制链接]
唯道集虚
唯道集虚 当前离线
积分
2
查看详细资料 窥视卡 雷达卡
发表于 2015-5-8 18:10:51 | 显示全部楼层 |阅读模式
来源:http://www.rpgmakervxace.net/top ... ometer/#entry217067想看效果图就去原站看去
此脚本使游戏有一个与标准战斗系统新样式。
特点:Features
•Icon Based Command Selection
•Scroll Based Enemy Selection
•Damage Odometer for HP and MP
•Simple Battle HUD

然后是脚本:
  1. #==============================================================================
  2. #
  3. # ▼ Mother Battle Style v0.1
  4. # -- Author: Soulpour777
  5. # -- Last Updated: 2015, 5, 1
  6. # -- Level: Advanced
  7. # -- Requires: n/a
  8. #==============================================================================
  9. #==============================================================================
  10. # ▼ Introduction
  11. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  12. # This script allows the developer to have a new look from the standard
  13. # battle system. This allows icons above to show what actions should be
  14. # done, a simple battle hud and an odometer.
  15. #==============================================================================
  16. # ▼ Features
  17. #  - Icon Based Command Selection
  18. #  - Scroll Based Enemy Selection
  19. #  - Damage Odometer for HP and MP
  20. #  - Simple Battle HUD
  21. #==============================================================================
  22. # ▼ Instructions
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # To install this script, open up your script editor and copy/paste this script
  25. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  26. #==============================================================================
  27. #==============================================================================
  28. # ▼ Compatibility
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # This script is for RPG Maker VX Ace only.
  31. #==============================================================================
  32. # ▼ Terms of Use
  33. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. # Feel free to use for Non Commercial Use. For commercial uses, please contact
  35. # me.
  36. #==============================================================================

  37. module Soul
  38.   module MotherJP
  39.    
  40.     NORM_REFRESH_RATE = 20 # How fast you want your sprite to walk.  
  41.     RUN_REFRESH_RATE = 10 # How fast you want your sprite to escape.

  42.     ATTACK_TURN = true # Do you want your sprite to turn when attacking?

  43.     BLACKBACK_TRANSPARENCY = 100 # Transparency for the message window.
  44.     ESCAPE_ANIMATION = true # Do you want the characters to run off screen escaping?
  45.     ESCAPE_ANIMATION_RATE = 5 # How fast do you want the characters to escape?

  46.     ATTACK_ICON = 387 # Icon you want for the attack button
  47.     SKILL_ICON =  115# Icon you want for the skill button
  48.     SPECIAL_ICON = 118
  49.     GUARD_ICON = 506 # Icon you want for the guard button
  50.     ITEM_ICON = 264 # Icon you want for the item button
  51.     ESCAPE_ICON = 12 # Icon you want for the escape button

  52.     USE_ODOMETER = true # Do you want to use the Odometric system at all?
  53.     LAG_TIME = 15 # Higher number, less lag. But the HP Bar refreshes slower.
  54.     HP_DECREASE = 1 # How fast you want the HP to decrease. Formulas using the actor class are also applicable.
  55.     MP_DECREASE = 1 # How fast you want the MP to decrease. Formulas using the actor class are also applicable.
  56.     ROLL_SOUND = RPG::SE.new("Cursor1", 80, 100) # The sound you want to make when the odometer rolls.

  57.     SPRITE_TRANSPARENCY = 0 # Transparency of the battle sprite when unactive.
  58.     SPRITEY_OFFSET = -16 # Offset of the Sprite's Y co-ordinate. Negative moves up, positive down.

  59.     COMMAND_ICONS ={
  60.       # Command Name => IconID
  61.       "Attack" => ATTACK_ICON,
  62.       "Magic" => SKILL_ICON,
  63.       "Special" => SPECIAL_ICON,
  64.       "Guard" => GUARD_ICON,
  65.       "Items" => ITEM_ICON,
  66.       "Escape" => ESCAPE_ICON,
  67.     }
  68.    
  69.     # this holds the command actions. If you want to configure them, use the
  70.     # values to change the way you want them to work.
  71.     COMMAND_ACTIONS = {
  72.       :opacity => 0, # opacity of the command window
  73.       :openness => 0, # openness of the command window
  74.       :actor_help_width => 250, # width of the actor command indicator
  75.     }   
  76.    
  77.     # this is the action setting that has to do with the odometer.
  78.     # The odometer holds the HP, MP and TP actions.
  79.     ODOMETER_ACTION = {
  80.       :hp => 0,
  81.       :mp => 0,
  82.     }
  83.    
  84.     # this action holds all the actor command action help window. This is where
  85.     # you hold the visible line number and the column max.
  86.     ACTOR_COMMAND_ACTION = {
  87.       :visible_line_number => 1,
  88.       :column_max => 6
  89.     }
  90.    
  91.   end
  92. end


  93. #==============================================================================
  94. # ** Game_Battler
  95. #------------------------------------------------------------------------------
  96. #  A battler class with methods for sprites and actions added. This class
  97. # is used as a super class of the Game_Actor class and Game_Enemy class.
  98. #==============================================================================

  99. class Game_Battler < Game_BattlerBase
  100.   alias soul_game_battler_ebbs_initialize initialize
  101.   #--------------------------------------------------------------------------
  102.   # * Public Instance Variables
  103.   #--------------------------------------------------------------------------
  104.   attr_accessor :soul_norm
  105.   attr_accessor :soul_odometric_hp
  106.   attr_accessor :soul_odometric_mp
  107.   #--------------------------------------------------------------------------
  108.   # * Object Initialization
  109.   #--------------------------------------------------------------------------
  110.   def initialize
  111.     soul_game_battler_ebbs_initialize
  112.     @soul_norm = false
  113.     @soul_odometric_hp = Soul::MotherJP::ODOMETER_ACTION.values[0]
  114.     @soul_odometric_mp = Soul::MotherJP::ODOMETER_ACTION.values[1]
  115.   end
  116. end

  117. class Game_Battler < Game_BattlerBase
  118.   alias soul_execute_damage_ebbs_game_battler execute_damage
  119.   #--------------------------------------------------------------------------
  120.   # * Damage Processing
  121.   #    @result.hp_damage @result.mp_damage @result.hp_drain
  122.   #    @result.mp_drain must be set before call.
  123.   #--------------------------------------------------------------------------
  124.   def execute_damage(user)
  125.     soul_execute_damage_ebbs_game_battler(user)
  126.     if Soul::MotherJP::USE_ODOMETER and SceneManager.scene.is_a?(Scene_Battle)
  127.       @soul_odometric_hp += @result.hp_damage
  128.       @soul_odometric_mp += @result.mp_damage
  129.       if @absorbed and user == self # If absorbing
  130.         @soul_odometric_hp -= @result.hp_damage
  131.         @soul_odometric_mp -= @result.mp_damage
  132.       end
  133.     else
  134.       self.hp -= @result.hp_damage
  135.       self.mp -= @result.mp_damage
  136.       if @absorbed                # If absorbing
  137.         user.hp += @result.hp_damage
  138.         user.mp += @result.mp_damage
  139.       end
  140.     end
  141.   end
  142. end

  143. class Sprite_Battler < Sprite_Base
  144.   #--------------------------------------------------------------------------
  145.   # * Alias Listings
  146.   #--------------------------------------------------------------------------  
  147.   alias soul_sprite_battler_update_effect update_effect
  148.   #--------------------------------------------------------------------------
  149.   # * Update Effect
  150.   #--------------------------------------------------------------------------
  151.   def update_effect
  152.     if @battler.soul_norm
  153.       @effect_duration = 1
  154.       @battler.soul_norm = false
  155.     end
  156.     soul_sprite_battler_update_effect # Call Original Method
  157.   end
  158. end

  159. #==============================================================================
  160. # ** Sprite_BlackBack
  161. #------------------------------------------------------------------------------
  162. #  Waaasteful Sprite, but I had no other way to do this.
  163. #==============================================================================

  164. class Sprite_BlackBack < Sprite
  165.   #--------------------------------------------------------------------------
  166.   # * Public Instance Variables
  167.   #--------------------------------------------------------------------------
  168.   attr_accessor :dummy_height            
  169.   #--------------------------------------------------------------------------
  170.   # * Object Initialization
  171.   #     viewport : viewport
  172.   #     picture  : picture (Game_Picture)
  173.   #--------------------------------------------------------------------------
  174.   def initialize(viewport)
  175.     super(viewport)
  176.     @dummy_height = 132
  177.     update
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # * Dispose
  181.   #--------------------------------------------------------------------------
  182.   def dispose
  183.     if self.bitmap != nil
  184.       self.bitmap.dispose
  185.     end
  186.     super
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # * Frame Update
  190.   #--------------------------------------------------------------------------
  191.   def update
  192.     super
  193.     self.x = 0
  194.     self.y = 0
  195.     self.bitmap = Bitmap.new(544, @dummy_height)
  196.     self.bitmap.fill_rect(0, 0, 544, @dummy_height, Color.new(0, 0, 0))
  197.     self.opacity = Soul::MotherJP::BLACKBACK_TRANSPARENCY
  198.   end
  199. end

  200. class Spriteset_Battle
  201.   alias soul_spriteset_battle_dispose_ebbs dispose
  202.   alias soul_spriteset_battle_update_ebbs update
  203.   attr_accessor                    :active_battler
  204.   #--------------------------------------------------------------------------
  205.   # * Object Initialization
  206.   #--------------------------------------------------------------------------
  207.   def initialize
  208.     @showing_battle_message = false
  209.     @character_sprites = []
  210.     @running = false   
  211.     create_viewports
  212.     create_battleback1
  213.     create_battleback2
  214.     create_enemies
  215.     create_actors
  216.     create_pictures
  217.     create_timer
  218.     create_blackback
  219.     update
  220.   end
  221.   
  222.   #--------------------------------------------------------------------------
  223.   # * Create Black Background Sprite
  224.   #--------------------------------------------------------------------------
  225.   def create_blackback
  226.     @blackback_sprite = Sprite_BlackBack.new(@viewport2)
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # * Free
  230.   #--------------------------------------------------------------------------
  231.   def dispose
  232.     soul_spriteset_battle_dispose_ebbs
  233.     dispose_blackback  
  234.   end  
  235.   #--------------------------------------------------------------------------
  236.   # * Dispose of Black Background Sprite
  237.   #--------------------------------------------------------------------------
  238.   def dispose_blackback
  239.     @blackback_sprite.dispose
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # * Frame Update
  243.   #--------------------------------------------------------------------------
  244.   def update
  245.     soul_spriteset_battle_update_ebbs
  246.     update_blackback
  247.   end
  248.   
  249.   #--------------------------------------------------------------------------
  250.   # * Update Black Background
  251.   #--------------------------------------------------------------------------
  252.   def update_blackback
  253.     if @showing_battle_message
  254.       @blackback_sprite.dummy_height = 132
  255.     else
  256.       @blackback_sprite.dummy_height = 60
  257.     end
  258.     @blackback_sprite.update
  259.   end
  260.   
  261. end

  262. #==============================================================================
  263. # ** Window_BattleStatus
  264. #------------------------------------------------------------------------------
  265. #  This window displays the status of all party members on the battle screen.
  266. #==============================================================================

  267. class Window_BattleStatus < Window_Selectable
  268.   #--------------------------------------------------------------------------
  269.   # * Object Initialization
  270.   #--------------------------------------------------------------------------
  271.   def initialize
  272.     super(0, 0, $game_party.members.size * 128 + 32, 128)
  273.     refresh
  274.     self.active = false
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # * Frame Update
  278.   #--------------------------------------------------------------------------
  279.   def update
  280.     super
  281.     if cursor_movable?
  282.       if Input.repeat?(Input::RIGHT)
  283.         cursor_down(Input.trigger?(Input::RIGHT))
  284.       end
  285.       if Input.repeat?(Input::LEFT)
  286.         cursor_up(Input.trigger?(Input::LEFT))
  287.       end
  288.     end
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # * Draw Item
  292.   #     index : Item number
  293.   #--------------------------------------------------------------------------
  294.   def draw_item(index)
  295.     rect = Rect.new(0, 0, 128, 96)
  296.     rect.x = index * 128
  297.     self.contents.clear_rect(rect)
  298.     self.contents.font.color = normal_color
  299.     actor = $game_party.members[index]
  300.     draw_face_graphic(actor.face_name, actor.face_index, rect.x + 16, rect.y, 96)
  301.     draw_actor_name(actor, rect.x + (128 - self.contents.text_size(actor.name).width) / 2, 0)
  302.     draw_actor_hp(actor, rect.x + 10, rect.y + 20, 110)
  303.     draw_actor_mp(actor, rect.x + 10, rect.y + line_height + 20, 110)
  304.     draw_actor_tp(actor, rect.x + 10, rect.y + line_height + 40, 110)   
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # * Draw Face Graphic
  308.   #     face_name  : Face graphic filename
  309.   #     face_index : Face graphic index
  310.   #     x     : draw spot x-coordinate
  311.   #     y     : draw spot y-coordinate
  312.   #     size       : Display size
  313.   #--------------------------------------------------------------------------
  314.   def draw_face_graphic(face_name, face_index, x, y, size = 96)
  315.     bitmap = Cache.face(face_name)
  316.     rect = Rect.new(0, 0, 0, 0)
  317.     rect.x = face_index % 4 * 96 + (96 - size) / 2
  318.     rect.y = face_index / 4 * 96 + (96 - size) / 2
  319.     rect.width = size
  320.     rect.height = size
  321.     self.contents.blt(x, y, bitmap, rect, 100)
  322.     bitmap.dispose
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # * Update Cursor
  326.   #--------------------------------------------------------------------------
  327.   def update_cursor
  328.     if @index < 0
  329.       self.cursor_rect.empty
  330.     else
  331.       self.cursor_rect.set(@index * 128, 0, 128, 96)
  332.     end
  333.   end
  334. end

  335. class Window_BattleLog < Window_Selectable
  336.   alias soul_window_battle_log_ebbs_battle initialize
  337.   #--------------------------------------------------------------------------
  338.   # * Object Initialization
  339.   #--------------------------------------------------------------------------
  340.   def initialize
  341.     soul_window_battle_log_ebbs_battle
  342.     self.x = 0
  343.     self.y = 0
  344.     self.opacity = 0   
  345.   end
  346. end

  347. #==============================================================================
  348. # ** Window_TargetEnemy
  349. #------------------------------------------------------------------------------
  350. #  Window for selecting the enemy who is the action target on the battle
  351. # screen.
  352. #==============================================================================

  353. class Window_TargetEnemy < Window_Command
  354.   #--------------------------------------------------------------------------
  355.   # * Object Initialization
  356.   #--------------------------------------------------------------------------
  357.   def initialize
  358.     commands = []
  359.     @enemies = []
  360.     for enemy in $game_troop.members
  361.       next unless enemy.exist?
  362.       commands.push(enemy.name)
  363.       @enemies.push(enemy)
  364.     end
  365.     super(416, commands, 2, 4)
  366.     self.visible = false
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # * Get Enemy Object
  370.   #--------------------------------------------------------------------------
  371.   def enemy
  372.     return @enemies[@index]
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # * Determine if cursor is moveable
  376.   #--------------------------------------------------------------------------
  377.   def cursor_movable?
  378.     return false if (not active)
  379.     return false if (index < 0 or index > @item_max or @item_max == 0)
  380.     return false if (@opening or @closing)
  381.     return true
  382.   end
  383. end

  384. class Scene_Battle < Scene_Base
  385.   
  386.   alias soul_scene_battle_ebbs_update_basic update_basic
  387.   alias soul_scene_battle_ebbs_update update
  388.   alias soul_scene_battle_ebbs_process_action process_action
  389.   #--------------------------------------------------------------------------
  390.   # * To Next Command Input
  391.   #--------------------------------------------------------------------------
  392.   def next_command
  393.     if BattleManager.next_command
  394.       start_actor_command_selection
  395.       @active_battler = $game_party.members[BattleManager.actor.index]
  396.     else
  397.       turn_start
  398.     end
  399.   end
  400.   
  401.   #--------------------------------------------------------------------------
  402.   # * Update Frame (Basic)
  403.   #--------------------------------------------------------------------------
  404.   def update_basic
  405.     soul_scene_battle_ebbs_update_basic
  406.     $game_system.current_cur_actor = @active_battler
  407.     odometer_update   
  408.   end  
  409.   #--------------------------------------------------------------------------
  410.   # * Battle Action Processing
  411.   #--------------------------------------------------------------------------
  412.   def process_action
  413.     soul_scene_battle_ebbs_process_action
  414.     @spriteset.active_battler = 0
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # * Frame Update
  418.   #--------------------------------------------------------------------------
  419.   def update
  420.     soul_scene_battle_ebbs_update
  421.     odometer_update
  422.   end  
  423.   #--------------------------------------------------------------------------
  424.   # * Start Actor Command Selection
  425.   #--------------------------------------------------------------------------
  426.   def start_actor_command_selection
  427.     @status_window.select(BattleManager.actor.index)
  428.     @party_command_window.close
  429.     @actor_command_window.setup(BattleManager.actor)
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # * Create Information Display Viewport
  433.   #--------------------------------------------------------------------------
  434.   def create_info_viewport
  435.     @info_viewport = Viewport.new
  436.     @info_viewport.rect.y = Graphics.height - @status_window.height
  437.     @info_viewport.rect.height = @status_window.height
  438.     @info_viewport.z = 100
  439.     @info_viewport.ox = 64   
  440.     @status_window.viewport = @info_viewport
  441.   end
  442.   
  443.   #--------------------------------------------------------------------------
  444.   # * Odometer Update
  445.   #--------------------------------------------------------------------------
  446.   def odometer_update
  447.     return if Soul::MotherJP::USE_ODOMETER == false
  448.     for actor in $game_party.battle_members
  449.       if actor.soul_odometric_hp > 0
  450.         if Graphics.frame_count % 2 == 1
  451.           actor.hp -= 1
  452.           actor.soul_odometric_hp -= 1
  453.         end
  454.         if Graphics.frame_count >= Soul::MotherJP::LAG_TIME
  455.           Soul::MotherJP::ROLL_SOUND.play
  456.           @status_window.refresh
  457.           Graphics.frame_count = 0
  458.         end
  459.       elsif actor.soul_odometric_hp < 0
  460.         actor.hp += 2
  461.         actor.odometric_hp += 2
  462.         if Graphics.frame_count >= Soul::MotherJP::LAG_TIME
  463.           Soul::MotherJP::ROLL_SOUND.play
  464.           @status_window.refresh
  465.           Graphics.frame_count = 0
  466.         end
  467.       end
  468.       if actor.soul_odometric_mp > 0
  469.         if Graphics.frame_count % 2 == 1
  470.           actor.mp -= 1
  471.           actor.soul_odometric_mp -= 1
  472.         end
  473.         if Graphics.frame_count >= Soul::MotherJP::LAG_TIME
  474.           Soul::MotherJP::ROLL_SOUND.play
  475.           @status_window.refresh
  476.           Graphics.frame_count = 0
  477.         end
  478.       elsif actor.soul_odometric_mp < 0
  479.         actor.mp += 2
  480.         actor.soul_odometric_mp += 2
  481.         if Graphics.frame_count >= Soul::MotherJP::LAG_TIME
  482.           Soul::MotherJP::ROLL_SOUND.play
  483.           @status_window.refresh
  484.           Graphics.frame_count = 0
  485.         end
  486.       end     
  487.     end
  488.     Graphics.frame_count += 1
  489.   end
  490.   
  491. end

  492. class Scene_Battle
  493.   def start_party_command_selection
  494.     unless scene_changing?
  495.       refresh_status
  496.       @status_window.unselect
  497.       @status_window.open
  498.       if BattleManager.input_start
  499.         next_command      
  500.       else
  501.         @party_command_window.deactivate
  502.         turn_start         
  503.       end
  504.     end
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # * Update Information Display Viewport
  508.   #--------------------------------------------------------------------------
  509.   def update_info_viewport
  510.     move_info_viewport(128)
  511.   end  
  512. end

  513. class Game_System
  514.   alias soul_ebbs_game_system_initialize initialize
  515.   attr_accessor :current_cur_actor
  516.   def initialize
  517.     soul_ebbs_game_system_initialize
  518.     @current_cur_actor = 0
  519.   end
  520. end


  521. class Window_BattleEnemy < Window_Selectable
  522.   #--------------------------------------------------------------------------
  523.   # * Object Initialization
  524.   #     info_viewport : Viewport for displaying information
  525.   #--------------------------------------------------------------------------
  526.   def initialize(info_viewport)
  527.     super(0, info_viewport.rect.y, window_width, fitting_height(4)+10)
  528.     refresh
  529.     self.visible = false
  530.     @info_viewport = info_viewport
  531.   end
  532. end

  533. class Window_BattleActor
  534.   
  535.   def update_position
  536.     self.x = (Graphics.width - window_width) / 2
  537.   end
  538.   
  539. end

  540. class Window_ActorCommand_Notification < Window_Help
  541.   
  542.   def initialize
  543.     super(1)
  544.     self.openness = Soul::MotherJP::COMMAND_ACTIONS.values[1]
  545.     self.opacity = Soul::MotherJP::COMMAND_ACTIONS.values[0]
  546.     update_position
  547.   end
  548.   
  549.   def update_position
  550.     self.x = Graphics.width - 224
  551.     self.width = Soul::MotherJP::COMMAND_ACTIONS.values[2]
  552.     create_contents
  553.   end
  554.   
  555.   def refresh
  556.     contents.clear
  557.     draw_text(4, 0, 224 - standard_padding * 2, line_height, @text, 1)
  558.   end
  559.   
  560. end


  561. class Scene_Battle < Scene_Base
  562.   #--------------------------------------------------------------------------
  563.   # * Alias Listings
  564.   #--------------------------------------------------------------------------
  565.   alias soul_ebbs_scene_battle_create_enemy_window create_enemy_window
  566.   alias soul_ebbs_scene_battle_update_basic update_basic
  567.   #--------------------------------------------------------------------------
  568.   # * start_party_command_selection
  569.   #--------------------------------------------------------------------------
  570.   def start_party_command_selection
  571.     unless scene_changing?
  572.       @status_window.open
  573.       @status_window.refresh
  574.       if BattleManager.input_start
  575.         next_command
  576.         start_actor_command_selection
  577.       else
  578.         @party_command_window.deactivate
  579.         turn_start
  580.       end
  581.     end
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # * create_actor_command_window
  585.   #--------------------------------------------------------------------------
  586.   def create_actor_command_window
  587.     @actor_command_window = Window_ActorCommand.new
  588.     @actor_command_window.opacity = Soul::MotherJP::COMMAND_ACTIONS.values[0]
  589.     @actor_command_window.set_handler(:attack, method(:command_attack))
  590.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  591.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  592.     @actor_command_window.set_handler(:item,   method(:command_item))
  593.     @actor_command_window.set_handler(:escape, method(:command_escape))
  594.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  595.     @actor_command_window.help_window = Window_ActorCommand_Notification.new
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # * create_help_window
  599.   #--------------------------------------------------------------------------
  600.   def create_help_window
  601.     @help_window = Window_Help.new(1)
  602.     @help_window.visible = false
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # * create_enemy_window
  606.   #--------------------------------------------------------------------------
  607.   def create_enemy_window(*args)
  608.     soul_ebbs_scene_battle_create_enemy_window(*args)
  609.     @enemy_window.help_window = @actor_command_window.help_window
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # * update_basic
  613.   #--------------------------------------------------------------------------
  614.   def update_basic(*args)
  615.     old_enemy = @enemy_window.active ? @enemy_window.enemy : nil
  616.     soul_ebbs_scene_battle_update_basic(*args)
  617.     update_enemy_whiten(old_enemy)
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # * update_enemy_whiten
  621.   #--------------------------------------------------------------------------
  622.   def update_enemy_whiten(old_enemy)
  623.     if !@enemy_window.active or old_enemy != @enemy_window.enemy
  624.       old_enemy.sprite_effect_type = :select_white_to_normal if old_enemy && !old_enemy.dead?
  625.     end
  626.     @enemy_window.enemy.sprite_effect_type = :select_white if @enemy_window.active
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # * update_info_viewport
  630.   #--------------------------------------------------------------------------
  631.   def update_info_viewport
  632.     move_info_viewport(128)
  633.   end

  634. end

  635. class Window_ActorCommand < Window_Command
  636.   alias_method(:soul_ebbs_actor_command_make_command_list,:make_command_list)  
  637.   #--------------------------------------------------------------------------
  638.   # * Determine Visible Number of Lines
  639.   #--------------------------------------------------------------------------
  640.   def visible_line_number
  641.     return Soul::MotherJP::ACTOR_COMMAND_ACTION.values[0]
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # * Column Max
  645.   #--------------------------------------------------------------------------
  646.   def col_max
  647.     return Soul::MotherJP::ACTOR_COMMAND_ACTION.values[1]
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # * Contents of the Height
  651.   #--------------------------------------------------------------------------
  652.   def contents_height
  653.     item_height
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # * Top Column
  657.   #--------------------------------------------------------------------------
  658.   def top_col
  659.     ox / (item_width + spacing)
  660.   end
  661.   #--------------------------------------------------------------------------
  662.   # * top_col=(col)
  663.   #--------------------------------------------------------------------------
  664.   def top_col=(col)
  665.     col = 0 if col < 0
  666.     col = col_max - 1 if col > col_max - 1
  667.     self.ox = col * (item_width + spacing)
  668.   end
  669.   #--------------------------------------------------------------------------
  670.   # * Bottom Column
  671.   #--------------------------------------------------------------------------
  672.   def bottom_col
  673.     top_col + col_max - 1
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # * bottom_col=(col)
  677.   #--------------------------------------------------------------------------
  678.   def bottom_col=(col)
  679.     self.top_col = col - (col_max - 1)
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # * ensure_cursor_visible
  683.   #--------------------------------------------------------------------------
  684.   def ensure_cursor_visible
  685.     self.top_col = index if index < top_col
  686.     self.bottom_col = index if index > bottom_col
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # * item_rect(index)
  690.   #--------------------------------------------------------------------------
  691.   def item_rect(index)
  692.     rect = super
  693.     rect.x = index * (item_width + spacing)
  694.     rect.y = 0
  695.     rect
  696.   end
  697.   #--------------------------------------------------------------------------
  698.   # * Window Width
  699.   #--------------------------------------------------------------------------
  700.   def window_width
  701.     Graphics.width - 224
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # * Open
  705.   #--------------------------------------------------------------------------
  706.   def open
  707.     @help_window.open
  708.     super
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # * Close
  712.   #--------------------------------------------------------------------------
  713.   def close
  714.     @help_window.close
  715.     super
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # * Update
  719.   #--------------------------------------------------------------------------
  720.   def update
  721.     super
  722.     @help_window.update
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # * draw_item(index)
  726.   #--------------------------------------------------------------------------
  727.   def draw_item(index)
  728.     rect = item_rect_for_text(index)
  729.     x = rect.x + rect.width / 2 - 12
  730.     y = item_rect_for_text(index).y
  731.     draw_icon(Soul::MotherJP::COMMAND_ICONS[command_name(index)], x, y, command_enabled?(index))
  732.   end
  733.   #--------------------------------------------------------------------------
  734.   # * make_command_list
  735.   #--------------------------------------------------------------------------
  736.   def make_command_list
  737.     soul_ebbs_actor_command_make_command_list
  738.     add_escape_command
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # * add_escape_command
  742.   #--------------------------------------------------------------------------
  743.   def add_escape_command
  744.     add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  745.   end
  746.   #--------------------------------------------------------------------------
  747.   # * update_help
  748.   #--------------------------------------------------------------------------
  749.   def update_help
  750.     @help_window.set_text(command_name(index))
  751.   end
  752. end

复制代码

评分

参与人数 1金币 +1 收起 理由
Sonic1997 + 1 赞一个!

查看全部评分

回复

使用道具 举报

  • 提升卡
  • 置顶卡
  • 沉默卡
  • 喧嚣卡
  • 变色卡
  • 抢沙发
  • 千斤顶
  • 显身卡
返回列表 发新帖
高级模式
B Color Image Link Quote Code Smilies
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

浏览过的版块

  • 测试游戏发布

站点统计|Archiver|手机版|意见反馈[feedback]| URPGs RPG Maker 游戏制作讨论

GMT+8, 2025-5-9 14:44 , Processed in 0.038384 second(s), 7 queries .

Powered by Discuz! X3.5

© 2011-2019 URPGs (Discuz! X3.4 © 2001-2019 Comsenz Inc.)

积分 0, 距离下一级还需 积分
快速回复 返回顶部 返回列表