查看: 1986|回复: 3

[已经解决] 請問要怎樣才能和這位大大一樣 戰鬥中顯示肖像圖

[复制链接]
梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-1-1
回帖
14
发表于 2013-1-3 13:48:28 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 a89672341 于 2013-1-3 20:56 编辑



請問要怎樣才能和這位大大一樣 戰鬥中顯示肖像圖?
梦石
0
星屑
55
在线时间
131 小时
注册时间
2012-7-3
回帖
118
发表于 2013-1-3 15:29:21 | 显示全部楼层
外站找的
  1. =begin
  2. YanFly Compatible Customisable ATB/Stamina Based Battle System Script
  3. by Fomar0153
  4. Version 1.2
  5. ----------------------
  6. Notes
  7. ----------------------
  8. Requires Yanfly Engine Ace - Ace Battle Engine
  9. Customises the battle system to be similar to
  10. ATB or Stamina based battle systems.
  11. ----------------------
  12. Instructions
  13. ----------------------
  14. Edit variables in CBS to suit your needs.
  15. The guard status should be set to 2~2 turns.
  16. ----------------------
  17. Change Log
  18. ----------------------
  19. 1.0 -> 1.1 Added CTB related options
  20.            Added the ability to pass a turn
  21.            Added options for turn functionality to be based on time
  22.            or number of actions
  23.            Added the ability to change the bar colours based on states
  24. 1.1 -> 1.2 Fixed a bug when escaping using CTB mode
  25. ----------------------
  26. Known bugs
  27. ----------------------
  28. None
  29. =end

  30. $imported = {} if $imported.nil?
  31. $imported["Fomar0153-CBS"] = true

  32. module CBS

  33.   MAX_STAMINA = 1000
  34.   RESET_STAMINA = true
  35.   
  36.   # If ATB is set to false then the bars won't appear and
  37.   # the pauses where the bars would be filling up are removed
  38.   # effectively turning this into a CTB system
  39.   ATB = true
  40.   SAMINA_GAUGE_NAME = "ATB"
  41.   ENABLE_PASSING = true
  42.   PASSING_COST = 200

  43.   # If TURN_LENGTH is set to 0 then a turn length will be
  44.   # decided on number of actions
  45.   # TURN_LENGTH is number of seconds per turn
  46.   TURN_LENGTH = 4
  47.   
  48.   ESCAPE_COST = 500
  49.   # If reset stamina is set to true then all characters
  50.   # will start with a random amount of stamina capped at
  51.   # the percentage you set.
  52.   # If reset stamina is set to false then this just
  53.   # affects enemies.
  54.   STAMINA_START_PERCENT = 20

  55.   # Default skill cost
  56.   # If you want to customise skill costs do it like this
  57.   # SKILL_COST[skill_id] = cost
  58.   SKILL_COST = []
  59.   SKILL_COST[0] = 1000
  60.   # Attack
  61.   SKILL_COST[1] = 1000
  62.   # Guard
  63.   SKILL_COST[2] = 500
  64.   ITEM_COST = 1000

  65.   # If you prefer to have states handle agility buffs then set STATES_HANDLE_AGI to true
  66.   STATES_HANDLE_AGI = false
  67.   # In the following section mult means the amount you multiply stamina gains by
  68.   # if STATES_HANDLE_AGI is set to true then it is only used to determine bar color
  69.   # with debuffs taking precedence over buffs
  70.   STAMINA_STATES = []
  71.   # Default colour
  72.   STAMINA_STATES[0] = [1,31,32]
  73.   # in the form
  74.   # STAMINA_STATES[STATE_ID] = [MULT,FILL_COLOUR,EMPTY_COLOR]
  75.   # e.g. Haste
  76.   STAMINA_STATES[10] = [2,4,32]
  77.   # e.g. Stop  
  78.   STAMINA_STATES[11] = [0,8,32]
  79.   # e.g. Slow  
  80.   STAMINA_STATES[12] = [0.5,8,32]

  81.   #--------------------------------------------------------------------------
  82.   # ● New Method stamina_gain
  83.   #--------------------------------------------------------------------------
  84.   def self.stamina_gain(battler)
  85.     return ((2 + [0, battler.agi / 10].max) * self.stamina_mult(battler)).to_i
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● New Method stamina_gain
  89.   #--------------------------------------------------------------------------
  90.   def self.stamina_mult(battler)
  91.     return 1 if STATES_HANDLE_AGI
  92.     mult = STAMINA_STATES[0][0]
  93.     for state in battler.states
  94.       unless STAMINA_STATES[state.id].nil?
  95.         mult *= STAMINA_STATES[state.id][0]
  96.       end
  97.     end
  98.     return mult
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● New Method stamina_gain
  102.   #--------------------------------------------------------------------------
  103.   def self.stamina_colors(battler)
  104.     colors = STAMINA_STATES[0]
  105.     for state in battler.states
  106.       unless STAMINA_STATES[state.id].nil?
  107.         if STAMINA_STATES[state.id][0] < colors[0] or colors[0] == 1
  108.           colors = STAMINA_STATES[state.id]
  109.         end
  110.       end
  111.     end
  112.     return colors
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● New Method stamina_start
  116.   #--------------------------------------------------------------------------
  117.   def self.stamina_start(battler)
  118.     battler.stamina = rand(MAX_STAMINA * STAMINA_START_PERCENT / 100)
  119.   end
  120. end

  121. class Game_BattlerBase
  122.   #--------------------------------------------------------------------------
  123.   # ● New attr_accessor
  124.   #--------------------------------------------------------------------------
  125.   attr_accessor :stamina
  126.   #--------------------------------------------------------------------------
  127.   # ● Aliases initialize
  128.   #--------------------------------------------------------------------------
  129.   alias yf_fomar_cbs_initialize initialize
  130.   def initialize
  131.     yf_fomar_cbs_initialize
  132.     @stamina = 0
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● New Method stamina_rate
  136.   #--------------------------------------------------------------------------
  137.   def stamina_rate
  138.     @stamina.to_f / CBS::MAX_STAMINA
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● New Method stamina_rate
  142.   #--------------------------------------------------------------------------
  143.   def stamina_gain
  144.     return if not movable?
  145.     @stamina = [CBS::MAX_STAMINA, @stamina + CBS.stamina_gain(self)].min
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● New Method stamina_color
  149.   #--------------------------------------------------------------------------
  150.   def stamina_color
  151.     for state in @states
  152.       unless CBS::STAMINA_STATES[state].nil?
  153.         return STAMINA_STATES[state]
  154.       end
  155.     end
  156.     return STAMINA_STATES[0]
  157.   end
  158. end

  159. class Scene_Battle < Scene_Base
  160.   #--------------------------------------------------------------------------
  161.   # ● Rewrote update
  162.   #--------------------------------------------------------------------------
  163.   def update
  164.     super
  165.     if (CBS::ENABLE_PASSING and @actor_command_window.active) and Input.press?(:A)
  166.       command_pass
  167.     end
  168.     if BattleManager.in_turn? and !inputting?
  169.       while @subject.nil? and !CBS::ATB
  170.         process_stamina
  171.       end
  172.       if CBS::ATB
  173.         process_stamina
  174.       end
  175.       process_event
  176.       process_action
  177.     end
  178.     BattleManager.judge_win_loss
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● Rewrote Method update_info_viewport
  182.   #--------------------------------------------------------------------------
  183.   def update_info_viewport
  184.     move_info_viewport(0)   if @party_command_window.active
  185.     move_info_viewport(128) if @actor_command_window.active
  186.     move_info_viewport(64)  if BattleManager.in_turn? and !inputting?
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● New Method inputting?
  190.   #--------------------------------------------------------------------------
  191.   def inputting?
  192.     return @actor_command_window.active || @skill_window.active ||
  193.       @item_window.active || @actor_window.active || @enemy_window.active
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● New Method process_stamina
  197.   #--------------------------------------------------------------------------
  198.   def process_stamina
  199.     @actor_command_window.close
  200.     return if @subject
  201.     BattleManager.advance_turn
  202.     all_battle_members.each do |battler|
  203.       battler.stamina_gain
  204.     end
  205.     @status_window.refresh_stamina
  206.     if @status_window.close?
  207.       @status_window.open
  208.      end
  209.     if BattleManager.escaping?
  210.       $game_party.battle_members.each do |battler|
  211.         if battler.stamina < CBS::MAX_STAMINA
  212.           $game_troop.members.each do |enemy|
  213.             if enemy.stamina == CBS::MAX_STAMINA
  214.               enemy.make_actions
  215.               @subject = enemy
  216.             end
  217.           end
  218.           return
  219.         end
  220.       end
  221.       unless BattleManager.process_escape
  222.         $game_party.battle_members.each do |actor|
  223.           actor.stamina -= CBS::ESCAPE_COST
  224.         end
  225.         BattleManager.set_escaping(false) unless CBS::ATB
  226.       end
  227.     end
  228.     all_battle_members.each do |battler|
  229.       if battler.stamina == CBS::MAX_STAMINA
  230.         battler.make_actions
  231.         @subject = battler
  232.         if @subject.inputable? and battler.is_a?(Game_Actor)
  233.           @actor_command_window.setup(@subject)
  234.           @status_window.index = @subject.index
  235.           BattleManager.set_actor(battler)
  236.         end
  237.         return
  238.       end
  239.     end
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● Rewrote start_party_command_selection Yanfly version
  243.   #--------------------------------------------------------------------------
  244.   def start_party_command_selection
  245.     unless scene_changing?
  246.       refresh_status
  247.       @status_window.unselect
  248.       @status_window.open
  249.       if BattleManager.input_start
  250.         @actor_command_window.close
  251.         @party_command_window.setup
  252.       else
  253.         @party_command_window.deactivate
  254.         turn_start
  255.       end
  256.     end
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● Rewrote start_actor_command_selection
  260.   #--------------------------------------------------------------------------
  261.   def start_actor_command_selection
  262.     @party_command_window.close
  263.     BattleManager.set_escaping(false)
  264.     turn_start
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● Rewrote prior_command Yanfly version
  268.   #--------------------------------------------------------------------------
  269.   def prior_command
  270.     redraw_current_status
  271.     start_party_command_selection
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● Rewrote process_action
  275.   #--------------------------------------------------------------------------
  276.   def process_action
  277.     return if scene_changing?
  278.     if !@subject || !@subject.current_action
  279.       @subject = BattleManager.next_subject
  280.     end
  281.     if Input.trigger?(:B) and (@subject == nil)
  282.       start_party_command_selection
  283.     end
  284.     return unless @subject
  285.     if @subject.current_action
  286.       @subject.current_action.prepare
  287.       if @subject.current_action.valid?
  288.         @status_window.open
  289.         execute_action
  290.       end
  291.       @subject.remove_current_action
  292.       refresh_status
  293.       @log_window.display_auto_affected_status(@subject)
  294.       @log_window.wait_and_clear
  295.     end
  296.     process_action_end unless @subject.current_action
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● Aliases use_item
  300.   #--------------------------------------------------------------------------
  301.   alias cbs_use_item use_item
  302.   def use_item
  303.     cbs_use_item
  304.     @subject.stamina_loss
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ● Rewrote turn_end
  308.   #--------------------------------------------------------------------------
  309.   def turn_end
  310.     all_battle_members.each do |battler|
  311.       battler.on_turn_end
  312.       refresh_status
  313.       @log_window.display_auto_affected_status(battler)
  314.       @log_window.wait_and_clear
  315.     end
  316.     #BattleManager.turn_end
  317.     #process_event
  318.     #start_party_command_selection
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● Rewrote command_fight
  322.   #--------------------------------------------------------------------------
  323.   def command_fight
  324.     BattleManager.next_command
  325.     start_actor_command_selection
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● Rewrote command_escape
  329.   #--------------------------------------------------------------------------
  330.   def command_escape
  331.     @party_command_window.close
  332.     BattleManager.set_escaping(true)
  333.     turn_start
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● New method command_pass
  337.   #--------------------------------------------------------------------------
  338.   def command_pass
  339.     BattleManager.actor.stamina -= CBS::PASSING_COST
  340.     BattleManager.clear_actor
  341.     @subject = nil
  342.     turn_start
  343.     @actor_command_window.active = false
  344.     @actor_command_window.close
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● Destroyed next_command
  348.   #--------------------------------------------------------------------------
  349.   def next_command
  350.     @status_window.show
  351.     @actor_command_window.show
  352.     @status_aid_window.hide
  353.   end
  354. end




  355. module BattleManager
  356.   #--------------------------------------------------------------------------
  357.   # ● Rewrote setup
  358.   #--------------------------------------------------------------------------
  359.   def self.setup(troop_id, can_escape = true, can_lose = false)
  360.     init_members
  361.     $game_troop.setup(troop_id)
  362.     @can_escape = can_escape
  363.     @can_lose = can_lose
  364.     make_escape_ratio
  365.     @escaping = false
  366.     @turn_counter = 0
  367.     @actions_per_turn = $game_party.members.size + $game_troop.members.size
  368.     ($game_party.members + $game_troop.members).each do |battler|
  369.       if battler.is_a?(Game_Enemy) or CBS::RESET_STAMINA
  370.         CBS.stamina_start(battler)
  371.       end
  372.     end
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ● New Method set_escaping
  376.   #--------------------------------------------------------------------------
  377.   def self.set_escaping(escaping)
  378.     @escaping = escaping
  379.   end
  380.   #--------------------------------------------------------------------------
  381.   # ● New Method escaping?
  382.   #--------------------------------------------------------------------------
  383.   def self.escaping?
  384.     return @escaping
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● Rewrote turn_start Yanfly version
  388.   #--------------------------------------------------------------------------
  389.   def self.turn_start
  390.     @phase = :turn
  391.     clear_actor
  392.     $game_troop.increase_turn if $game_troop.turn_count == 0
  393.     @performed_battlers = []
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ● New Method set_actor
  397.   #--------------------------------------------------------------------------
  398.   def self.set_actor(actor)
  399.     @actor_index = actor.index
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● New Increase action counter
  403.   #--------------------------------------------------------------------------
  404.   def self.add_action
  405.     return if @actions_per_turn.nil?
  406.     @turn_counter += 1
  407.     if @turn_counter == @actions_per_turn and CBS::TURN_LENGTH == 0
  408.       $game_troop.increase_turn
  409.       SceneManager.scene.turn_end
  410.       @turn_counter = 0
  411.     end
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● New Method advance_turn
  415.   #--------------------------------------------------------------------------
  416.   def self.advance_turn
  417.     return if CBS::TURN_LENGTH == 0
  418.     @turn_counter += 1
  419.     if @turn_counter == 60 * CBS::TURN_LENGTH
  420.       $game_troop.increase_turn
  421.       SceneManager.scene.turn_end
  422.       @turn_counter = 0
  423.     end
  424.   end
  425. end

  426. class Game_Battler < Game_BattlerBase
  427.   #--------------------------------------------------------------------------
  428.   # ● Rewrote on_turn_end
  429.   #--------------------------------------------------------------------------
  430.   def on_turn_end
  431.     @result.clear
  432.     regenerate_all
  433.     update_state_turns
  434.     update_buff_turns
  435.     remove_states_auto(2)
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● New Method on_turn_end
  439.   #--------------------------------------------------------------------------
  440.   def stamina_loss
  441.     if self.actor?
  442.       @stamina -= input.stamina_cost
  443.     else
  444.       @stamina -= @actions[0].stamina_cost
  445.     end
  446.     BattleManager.add_action
  447.   end
  448. end

  449. class Game_Actor < Game_Battler
  450.   #--------------------------------------------------------------------------
  451.   # ● Rewrote input
  452.   #--------------------------------------------------------------------------
  453.   def input
  454.     if @actions[@action_input_index] == nil
  455.       @actions[@action_input_index] = Game_Action.new(self)
  456.     end
  457.     return @actions[@action_input_index]
  458.   end
  459. end

  460. class Game_Action
  461.   #--------------------------------------------------------------------------
  462.   # ● New Method stamina_cost
  463.   #--------------------------------------------------------------------------
  464.   def stamina_cost
  465.     if @item.is_skill?
  466.       return CBS::SKILL_COST[item.id] if CBS::SKILL_COST[item.id]
  467.       return CBS::SKILL_COST[0]
  468.     end
  469.     return CBS::ITEM_COST if @item.is_item?
  470.     return CBS::MAX_STAMINA
  471.   end
  472. end

  473. class Window_BattleStatus < Window_Selectable
  474.   #--------------------------------------------------------------------------
  475.   # Aliases method: draw_item yanfly version
  476.   #--------------------------------------------------------------------------
  477.   alias prefomar_draw_item draw_item
  478.   def draw_item(index)
  479.     unless CBS::ATB
  480.       prefomar_draw_item(index)
  481.       return
  482.     end
  483.     return if index.nil?
  484.     clear_item(index)
  485.     actor = battle_members[index]
  486.     rect = item_rect(index)
  487.     return if actor.nil?
  488.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  489.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  490.     draw_actor_action(actor, rect.x, rect.y)
  491.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  492.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  493.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  494.     draw_actor_hp(actor, rect.x+2, line_height*2, rect.width-4)
  495.     if draw_tp?(actor) && draw_mp?(actor)
  496.       dw = rect.width/2-2
  497.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  498.       draw_actor_tp(actor, rect.x+2, line_height*2+gx, dw)
  499.       dw = rect.width - rect.width/2 - 2
  500.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*2+gx, dw)
  501.     elsif draw_tp?(actor) && !draw_mp?(actor)
  502.       draw_actor_tp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  503.     else
  504.       draw_actor_mp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  505.     end
  506.     draw_actor_stamina(actor, rect.x+2, line_height*3, rect.width-4)
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # overwrite method: draw_item yanfly version
  510.   #--------------------------------------------------------------------------
  511.   def draw_item_stamina(index)
  512.     return if index.nil?
  513.     actor = battle_members[index]
  514.     rect = item_rect(index)
  515.     return if actor.nil?
  516.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  517.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  518.     draw_actor_stamina(actor, rect.x+2, line_height*3, rect.width-4)
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # new method: refresh_stamina
  522.   #--------------------------------------------------------------------------
  523.   def refresh_stamina
  524.     return unless CBS::ATB
  525.     item_max.times {|i| draw_item_stamina(i) }
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # new method: draw_actor_stamina
  529.   #--------------------------------------------------------------------------
  530.   def draw_actor_stamina(actor, dx, dy, width = 124)
  531.     draw_gauge(dx, dy, width, actor.stamina_rate, text_color(CBS.stamina_colors(actor)[2]),text_color(CBS.stamina_colors(actor)[1]))
  532.     change_color(system_color)
  533.     cy = (Font.default_size - contents.font.size) / 2 + 1
  534.     draw_text(dx+2, dy+cy, 30, line_height, CBS::SAMINA_GAUGE_NAME)
  535.   end
  536. end
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-1-1
回帖
14
 楼主| 发表于 2013-1-3 15:36:50 | 显示全部楼层
本帖最后由 a89672341 于 2013-1-3 15:40 编辑
冰鎮史萊姆 发表于 2013-1-3 15:29
外站找的
=begin
YanFly Compatible Customisable ATB/Stamina Based Battle System Script


擷取.PNG

大大我丟上去變成這樣子o口o

2.PNG

是這樣放嗎?
回复

使用道具 举报

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-1-1
回帖
14
 楼主| 发表于 2013-1-3 20:52:19 | 显示全部楼层
我找到了這篇文章 丟上去成功顯現臉圖了!

也感謝 冰鎮史萊姆 長輩

http://rpg.blue/forum.php?mod=viewthread&tid=223765

点评

记得提问要自己发帖,别再回复旧帖了。(^^这样发帖不就挺不错的么~  发表于 2013-1-3 21:53

评分

参与人数 1星屑 +20 收起 理由
Mic_洛洛 + 20 补充节操,记得以后别挖坟了!.

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部