RPG Fusion
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.



 
AccueilPortailRechercherDernières imagesS'enregistrerConnexion
Le Deal du moment : -40%
-40% sur le Pack Gaming Mario PDP Manette filaire + ...
Voir le deal
29.99 €

 

 [Demande à genoux] modification - système de points d'action

Aller en bas 
AuteurMessage
Invité
Invité
Anonymous



[Demande à genoux] modification - système de points d'action Empty
MessageSujet: [Demande à genoux] modification - système de points d'action   [Demande à genoux] modification - système de points d'action EmptySam 01 Sep 2012, 16:16

Bonjour/bonsoir, je viens ici pour.. vous implorer à genoux *-* ..

à la recherche du script qui donnerait du cachet à mes combats je suis tombé sur un script dans lequel chaque sort demande pour se lancer des points appelés " BP " et qui se rechargent à chaque tours, hors ce système de tour n'est pas compatible avec mes combats actuels (Il y a un tour par personnage et chaque tour affecte ce script, donc au lieu de gagner 1 bp j'en gagne 4 à 8..) , j'aurais donc aimé savoir si quelqu'un était habilité à transformer le mode de recharge pour passer de " à chaque tour " à " quand le personnage attaque " (l'attaque normal, pas un sort)

Edit : Et si ça ne pose vraiment pas de difficulté à la personne, j'aurais apprécié que le mode de recharge soit " quand le personnage attaque ou se défend ", mais c'est purement facultatif.. ou alors " quand le personnage a effectué une action ", je ne sais pas si c'est plus simple ou compliqué mais ça serait tout aussi bien !

Edit 2 : La langue des annotations est le portugais, mais je ne pense pas que ça dérange vraiment.

Le script actuellement :

Code:
################################################################################
################################# CODE CRUSH ###################################
################################################################################
=begin
                                  BP SYSTEM                             

--------------------------------------------------------------------------------
Script créés par Claimh.
Version - 2.1.0
--------------------------------------------------------------------------------

CARACTERISTIQUES
 Ajoute un système de restriction par BP
 Des BP sont nécessaires en plus des SP pour utiliser les capacités
 Les BP ne peuvent être récupéré avec des objets, ils sont récupéré automatiquement
 à la fin de chaque tour de façon similaire à Wild Arms

MODIFICATION
=end
#-------------------------------------------------------------------------------
module SysSkill_BP
  # Usar o custo SP.
  BATTLE_SP_USE = true     
  # Ativar a janela de BP.
  WINDOW_BP_USE = true   
  # Ativar o valor do BP por í­cones.
  USE_BP_ICON = false   
  # Nome do arquivo BP.
  BP_ICON = "036-Item05"
  SKILL_BP = {
  # Definição do custo de BP para cada habilidade.
  #
  # A => B
  #----------------------------------
  # A = ID du sort.
  # B = BP nécéssaire.
  #----------------------------------
    1 => 2, 2 => 5, 3 =>7,
    4 => 2, 5 => 5,
    6 => 5,
    7 => 2, 8 => 4, 9 => 6,
    10 => 2, 11 => 4, 12 => 6,
    13 => 2, 14 => 4, 15 => 6,
    16 => 2, 17 => 4, 18 => 6,
    19 => 2, 20 => 4, 21 => 6,
    22 => 2, 23 => 4, 24 => 6,
    25 => 2, 26 => 4, 27 => 6,
    28 => 2, 29 => 4, 30 => 6,
    31 => 3, 32 => 7,
    33 => 1, 34 => 4,
    35 => 1, 36 => 4,
    37 => 1, 38 => 4,
    39 => 1, 40 => 4,
    41 => 1, 42 => 4,
    43 => 1, 44 => 4,
    45 => 1, 46 => 4,
    47 => 1, 48 => 4,
    49 => 1, 50 => 4,
    51 => 1, 52 => 4,
    53 => 3, 54 => 3, 55 => 3, 56 => 3,
    57 => 2, 58 => 4, 59 => 6, 60 => 9,
    61 => 2, 62 => 4, 63 => 6, 64 => 9,
    65 => 2, 66 => 4, 67 => 6, 68 => 9,
    69 => 2, 70 => 4, 71 => 6, 72 => 9,
    73 => 2, 74 => 4, 75 => 6, 76 => 9,
    77 => 2, 78 => 4, 79 => 6, 80 => 9
  }
  # Definição dos parí¢metros iniciais de BP para cada personagem.
    ACT_BP = {
  #------------------------------------------------------
  # A => [B, C, D]
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Quantité de BP d'origine du personnage.
  # C = Quantité de BP maximum du personnage.
  # D = Quantité de BP récupéré quand un tour passe.
  #------------------------------------------------------
    1 => [5, 10, 3],
    2 => [4, 9, 4],
    3 => [2, 13, 3],
    4 => [4, 9, 2],
    5 => [2, 10, 4],
    6 => [3, 10, 2],
    7 => [4, 12, 3],
    8 => [4, 15, 2]
  }
  # Definindo em que Level o personagem aumentará o valor inicial de BP.
  ACT_INIT_BP_LVUP = {
  #------------------------------------------------------
  # A  => [B,B,B,B,B,B],
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Level
    1 => [5,10,15,25,30,40],
    2 => [5,10,15,25,30,40],
    3 => [5,10,15,25,30,40],
    4 => [5,10,15,25,30,40],
    5 => [5,10,15,25,30,40],
    6 => [5,10,15,25,30,40],
    7 => [5,10,15,25,30,40],
    8 => [5,10,15,25,30,40]
  }
  # Definindo em que Level o personagem aumentará o valor maximo de BP.
  ACT_MAX_BP_LVUP = {
  #------------------------------------------------------
  # A  => [B,B,B,B,B,B],
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Level
    1 => [5,10,15,25,30,40],
    2 => [5,10,15,25,30,40],
    3 => [5,10,15,25,30,40],
    4 => [5,10,15,25,30,40],
    5 => [5,10,15,25,30,40],
    6 => [5,10,15,25,30,40],
    7 => [5,10,15,25,30,40],
    8 => [5,10,15,25,30,40]
  }
  # Definindo em que Level o personagem aumentará o valor de BP ganho por turno.
  ACT_REST_BP_LVUP = {
  #------------------------------------------------------
  # A  => [B,B,B,B,B,B],
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Level

    1 => [5,10,15,25,30,40],
    2 => [5,10,15,25,30,40],
    3 => [5,10,15,25,30,40],
    4 => [5,10,15,25,30,40],
    5 => [5,10,15,25,30,40],
    6 => [5,10,15,25,30,40],
    7 => [5,10,15,25,30,40],
    8 => [5,10,15,25,30,40]
  }
end
#-------------------------------------------------------------------------------

class Game_Actor
  attr_accessor  :bp     
  attr_accessor  :init_bp 
  attr_accessor  :max_bp   
  attr_accessor  :rest_bp
  alias initialize_use_limit initialize
  def initialize(actor_id)
    initialize_use_limit(actor_id)
    act_bp = SysSkill_BP::ACT_BP[actor_id]
    @bp = act_bp[0]
    @init_bp = act_bp[0]
    @max_bp = act_bp[1]
    @rest_bp = act_bp[2]
  end
  alias exp_bp= exp=
  def exp=(exp)
    cp_level = @level   
    self.exp_bp = exp 
    if cp_level < @level   
      counter_num = 1
    elsif cp_level > @level 
      counter_num = -1
    else                   
      return
    end
    for lv_index in cp_level...@level
      if SysSkill_BP::ACT_INIT_BP_LVUP[self.id].include?(lv_index)
        @init_bp += counter_num
      end
      if SysSkill_BP::ACT_MAX_BP_LVUP[self.id].include?(lv_index)
        @max_bp += counter_num
      end
      if SysSkill_BP::ACT_REST_BP_LVUP[self.id].include?(lv_index)
        @rest_bp += counter_num
      end
    end
  end
end

class Game_Battler
  alias skill_limit_can_use? skill_can_use?
  def skill_can_use?(skill_id)
    ret = skill_limit_can_use?(skill_id)
    if self.is_a?(Game_Actor) and $scene.is_a?(Scene_Battle)
      bp = SysSkill_BP::SKILL_BP[skill_id]
      skill_bp = ( bp == nil ? 1 : bp)
      if ret   
        if self.bp < skill_bp
          return false
        end
      else
        if !SysSkill_BP::BATTLE_SP_USE
          if $data_skills[skill_id].sp_cost > self.sp
            cp_sp = $data_skills[skill_id].sp_cost.dup
            $data_skills[skill_id].sp_cost = 0
            ret_sp = skill_limit_can_use?(skill_id)
            $data_skills[skill_id].sp_cost = cp_sp
            if ret_sp
              if self.bp < skill_bp
                # if FlashSystem::FLASH_COST and self.flash_flg
                #  return true
                # end
                return false
              end
            end
          end
        end
      end
    end
    return ret
  end
end


class Scene_Battle
  alias main_use_limit main
  def main
    for i in 0..$game_party.actors.size-1
      actor = $game_party.actors[i]
      actor.bp = actor.init_bp
    end
    main_use_limit
  end
  alias start_skill_select_limit start_skill_select
  def start_skill_select
    start_skill_select_limit
    if SysSkill_BP::WINDOW_BP_USE
      @actor_bp_window = Window_Battle_Point.new
      @actor_bp_window.x = @actor_index * 160
      @actor_bp_window.y = 300
      @actor_bp_window.back_opacity =160
      @actor_bp_window.set_actor_bp(@active_battler)
    end
  end
  alias end_skill_select_limit end_skill_select
  def end_skill_select
    if SysSkill_BP::WINDOW_BP_USE
      @actor_bp_window.dispose
      @actor_bp_window = nil
    end
    end_skill_select_limit
  end
  alias make_skill_action_result_limit make_skill_action_result
  def make_skill_action_result
    make_skill_action_result_limit
    if @active_battler.is_a?(Game_Actor)
      bp = SysSkill_BP::SKILL_BP[@skill.id]
      skill_bp = (bp==nil ? 1 : bp)
      @active_battler.bp -= skill_bp
      if !SysSkill_BP::BATTLE_SP_USE
        @active_battler.sp += @skill.sp_cost
      end
    end
  end
  alias update_phase4_step6_limit update_phase4_step6
  def update_phase4_step6
    update_phase4_step6_limit
    if @active_battler.is_a?(Game_Actor)
      @active_battler.bp += @active_battler.rest_bp
      if @active_battler.bp > @active_battler.max_bp
        @active_battler.bp = @active_battler.max_bp
      end
    end
  end
end
class Window_Base < Window
  def draw_actor_bp(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "BP")
    width = 144
    if width - 32 >= 108
      sp_x = x + width - 124
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.bp == 0 ? knockout_color :
      actor.bp <= actor.max_bp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 36, 32, actor.bp.to_s, 2)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 36, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 48, y, 48, 32, actor.max_bp.to_s)
      self.contents.font.color = knockout_color
      self.contents.draw_text(sp_x + 72, y, 12, 32, "+", 1)
      self.contents.draw_text(sp_x + 84, y, 48, 32, actor.rest_bp.to_s)
      self.contents.font.color = normal_color
    end
  end
  def draw_actor_bp_icon(actor, x, y)
    bitmap = RPG::Cache.icon(SysSkill_BP::BP_ICON)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    for i in 0...actor.bp
      self.contents.blt(x + cw - bitmap.width, y - ch + 30, bitmap, src_rect)
      cw += bitmap.width
    end
  end
end

class Window_Battle_Point < Window_Base
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  def set_actor_bp(actor)
    if SysSkill_BP::USE_BP_ICON
      draw_actor_bp_icon(actor, 4, 0)
    else
      draw_actor_bp(actor, 4, 0)
    end
  end
end


#==============================================================================
# ? Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    if SysSkill_BP::BATTLE_SP_USE
      self.contents.draw_text(x + 196, y, 48, 32, skill.sp_cost.to_s, 2)
    end
    bp = SysSkill_BP::SKILL_BP[skill.id]
    skill_bp = (bp == nil ? 1 : bp)
    self.contents.font.color = crisis_color
    self.contents.draw_text(x + 232, y, 48, 32, skill_bp.to_s, 2)
  end
end


#==============================================================================
# ? Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      if SysSkill_BP::BATTLE_SP_USE
        draw_actor_hp(actor, actor_x, 30, 120)
        draw_actor_sp(actor, actor_x, 50, 120)
      else
        draw_actor_hp(actor, actor_x, 32, 120)
      end
      if SysSkill_BP::BATTLE_SP_USE
        bp_y = 70
      else
        bp_y = 64
      end
      if SysSkill_BP::USE_BP_ICON
        draw_actor_bp_icon(actor, actor_x, bp_y)
      else
        draw_actor_bp(actor, actor_x, bp_y)
      end
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end

Je pense que ça serait plus ou moins le point central de mes combats donc si quelqu'un en a la capacité et la volonté je le remercie grandement !

Bon Making et à bientôt ~
Revenir en haut Aller en bas
Seri
Modérateur
Modérateur
Seri


Masculin
Nombre de messages : 558
Age : 35
Projet(s) en cours : Oliver
Niveau Rpg Maker : Se débrouille
Jeux Préférés : FF9,FF12, Chrono Cross
Date d'inscription : 10/07/2012

[Demande à genoux] modification - système de points d'action Empty
MessageSujet: Re: [Demande à genoux] modification - système de points d'action   [Demande à genoux] modification - système de points d'action EmptyDim 02 Sep 2012, 19:41

Salut !

J'ai ici quelques modifications qui pourraient marcher. Je ne promets rien - j'ai le cerveau qui marche un peu au ralenti - mais ça devrait marcher. J'ai rajouté quelques commentaires pour que tu vois ce que j'ai changé.

Code:
################################################################################
################################# CODE CRUSH ###################################
################################################################################
=begin
                                  BP SYSTEM                             

--------------------------------------------------------------------------------
Script créés par Claimh.
Version - 2.1.0
--------------------------------------------------------------------------------

CARACTERISTIQUES
 Ajoute un système de restriction par BP
 Des BP sont nécessaires en plus des SP pour utiliser les capacités
 Les BP ne peuvent être récupéré avec des objets, ils sont récupéré automatiquement
 à la fin de chaque tour de façon similaire à Wild Arms

MODIFICATION
=end
#-------------------------------------------------------------------------------
module SysSkill_BP
  # Usar o custo SP.
  BATTLE_SP_USE = true     
  # Ativar a janela de BP.
  WINDOW_BP_USE = true   
  # Ativar o valor do BP por í­cones.
  USE_BP_ICON = false   
  # Nome do arquivo BP.
  BP_ICON = "036-Item05"
  SKILL_BP = {
  # Definição do custo de BP para cada habilidade.
  #
  # A => B
  #----------------------------------
  # A = ID du sort.
  # B = BP nécéssaire.
  #----------------------------------
    1 => 2, 2 => 5, 3 =>7,
    4 => 2, 5 => 5,
    6 => 5,
    7 => 2, 8 => 4, 9 => 6,
    10 => 2, 11 => 4, 12 => 6,
    13 => 2, 14 => 4, 15 => 6,
    16 => 2, 17 => 4, 18 => 6,
    19 => 2, 20 => 4, 21 => 6,
    22 => 2, 23 => 4, 24 => 6,
    25 => 2, 26 => 4, 27 => 6,
    28 => 2, 29 => 4, 30 => 6,
    31 => 3, 32 => 7,
    33 => 1, 34 => 4,
    35 => 1, 36 => 4,
    37 => 1, 38 => 4,
    39 => 1, 40 => 4,
    41 => 1, 42 => 4,
    43 => 1, 44 => 4,
    45 => 1, 46 => 4,
    47 => 1, 48 => 4,
    49 => 1, 50 => 4,
    51 => 1, 52 => 4,
    53 => 3, 54 => 3, 55 => 3, 56 => 3,
    57 => 2, 58 => 4, 59 => 6, 60 => 9,
    61 => 2, 62 => 4, 63 => 6, 64 => 9,
    65 => 2, 66 => 4, 67 => 6, 68 => 9,
    69 => 2, 70 => 4, 71 => 6, 72 => 9,
    73 => 2, 74 => 4, 75 => 6, 76 => 9,
    77 => 2, 78 => 4, 79 => 6, 80 => 9
  }
  # Definição dos parí¢metros iniciais de BP para cada personagem.
    ACT_BP = {
  #------------------------------------------------------
  # A => [B, C, D]
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Quantité de BP d'origine du personnage.
  # C = Quantité de BP maximum du personnage.
  # D = Quantité de BP récupéré quand un tour passe.
  #------------------------------------------------------
    1 => [5, 10, 1],
    2 => [4, 9, 1],
    3 => [2, 13, 1],
    4 => [4, 9, 1],
    5 => [2, 10, 1],
    6 => [3, 10, 1],
    7 => [4, 12, 1],
    8 => [4, 15, 1]
  }
#Déjà là ça devrait changer la quantité de BP récupéré (1 au lieu de 4, 2 ou 3 qu'il y avait avant)

  # Definindo em que Level o personagem aumentará o valor inicial de BP.
  ACT_INIT_BP_LVUP = {
  #------------------------------------------------------
  # A  => [B,B,B,B,B,B],
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Level
    1 => [5,10,15,25,30,40],
    2 => [5,10,15,25,30,40],
    3 => [5,10,15,25,30,40],
    4 => [5,10,15,25,30,40],
    5 => [5,10,15,25,30,40],
    6 => [5,10,15,25,30,40],
    7 => [5,10,15,25,30,40],
    8 => [5,10,15,25,30,40]
  }
  # Definindo em que Level o personagem aumentará o valor maximo de BP.
  ACT_MAX_BP_LVUP = {
  #------------------------------------------------------
  # A  => [B,B,B,B,B,B],
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Level
    1 => [5,10,15,25,30,40],
    2 => [5,10,15,25,30,40],
    3 => [5,10,15,25,30,40],
    4 => [5,10,15,25,30,40],
    5 => [5,10,15,25,30,40],
    6 => [5,10,15,25,30,40],
    7 => [5,10,15,25,30,40],
    8 => [5,10,15,25,30,40]
  }
  # Definindo em que Level o personagem aumentará o valor de BP ganho por turno.
  ACT_REST_BP_LVUP = {
  #------------------------------------------------------
  # A  => [B,B,B,B,B,B],
  #------------------------------------------------------
  # A = ID do personagem.
  # B = Level

    1 => [5,10,15,25,30,40],
    2 => [5,10,15,25,30,40],
    3 => [5,10,15,25,30,40],
    4 => [5,10,15,25,30,40],
    5 => [5,10,15,25,30,40],
    6 => [5,10,15,25,30,40],
    7 => [5,10,15,25,30,40],
    8 => [5,10,15,25,30,40]
  }
end
#-------------------------------------------------------------------------------

class Game_Actor
  attr_accessor  :bp     
  attr_accessor  :init_bp 
  attr_accessor  :max_bp   
  attr_accessor  :rest_bp
  alias initialize_use_limit initialize
  def initialize(actor_id)
    initialize_use_limit(actor_id)
    act_bp = SysSkill_BP::ACT_BP[actor_id]
    @bp = act_bp[0]
    @init_bp = act_bp[0]
    @max_bp = act_bp[1]
    @rest_bp = act_bp[2]
  end
  alias exp_bp= exp=
  def exp=(exp)
    cp_level = @level   
    self.exp_bp = exp 
    if cp_level < @level   
      counter_num = 1
    elsif cp_level > @level 
      counter_num = -1
    else                   
      return
    end
    for lv_index in cp_level...@level
      if SysSkill_BP::ACT_INIT_BP_LVUP[self.id].include?(lv_index)
        @init_bp += counter_num
      end
      if SysSkill_BP::ACT_MAX_BP_LVUP[self.id].include?(lv_index)
        @max_bp += counter_num
      end
      if SysSkill_BP::ACT_REST_BP_LVUP[self.id].include?(lv_index)
        @rest_bp += counter_num
      end
    end
  end
end

class Game_Battler
  alias skill_limit_can_use? skill_can_use?
  def skill_can_use?(skill_id)
    ret = skill_limit_can_use?(skill_id)
    if self.is_a?(Game_Actor) and $scene.is_a?(Scene_Battle)
      bp = SysSkill_BP::SKILL_BP[skill_id]
      skill_bp = ( bp == nil ? 1 : bp)
      if ret   
        if self.bp < skill_bp
          return false
        end
      else
        if !SysSkill_BP::BATTLE_SP_USE
          if $data_skills[skill_id].sp_cost > self.sp
            cp_sp = $data_skills[skill_id].sp_cost.dup
            $data_skills[skill_id].sp_cost = 0
            ret_sp = skill_limit_can_use?(skill_id)
            $data_skills[skill_id].sp_cost = cp_sp
            if ret_sp
              if self.bp < skill_bp
                # if FlashSystem::FLASH_COST and self.flash_flg
                #  return true
                # end
                return false
              end
            end
          end
        end
      end
    end
    return ret
  end
end


class Scene_Battle
  alias main_use_limit main
  def main
    for i in 0..$game_party.actors.size-1
      actor = $game_party.actors[i]
      actor.bp = actor.init_bp
    end
    main_use_limit
  end
  alias start_skill_select_limit start_skill_select
  def start_skill_select
    start_skill_select_limit
    if SysSkill_BP::WINDOW_BP_USE
      @actor_bp_window = Window_Battle_Point.new
      @actor_bp_window.x = @actor_index * 160
      @actor_bp_window.y = 300
      @actor_bp_window.back_opacity =160
      @actor_bp_window.set_actor_bp(@active_battler)
    end
  end
  alias end_skill_select_limit end_skill_select
  def end_skill_select
    if SysSkill_BP::WINDOW_BP_USE
      @actor_bp_window.dispose
      @actor_bp_window = nil
    end
    end_skill_select_limit
  end
  alias make_skill_action_result_limit make_skill_action_result
  def make_skill_action_result
    make_skill_action_result_limit
    if @active_battler.is_a?(Game_Actor)
      bp = SysSkill_BP::SKILL_BP[@skill.id]
      skill_bp = (bp==nil ? 1 : bp)
      @active_battler.bp -= skill_bp
      if !SysSkill_BP::BATTLE_SP_USE
        @active_battler.sp += @skill.sp_cost
      end
    end
  end
  alias update_phase4_step6_limit update_phase4_step6
  def update_phase4_step6
    update_phase4_step6_limit
    if @active_battler.is_a?(Game_Actor)

    #rajout de la condition si le personnage était en train de se défendre. Ainsi il gagne des BP s'il se défend.  #Sans cette condition, tous les persos gagnent des BP à la fin du tour. Avec, seuls les persos qui se défendaient #en gagnent.

      if @active_battler.current_action.basic == 1
      @active_battler.bp += @active_battler.rest_bp

      if @active_battler.bp > @active_battler.max_bp
        @active_battler.bp = @active_battler.max_bp
      end
    end
  end
end
class Window_Base < Window
  def draw_actor_bp(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "BP")
    width = 144
    if width - 32 >= 108
      sp_x = x + width - 124
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.bp == 0 ? knockout_color :
      actor.bp <= actor.max_bp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 36, 32, actor.bp.to_s, 2)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 36, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 48, y, 48, 32, actor.max_bp.to_s)
      self.contents.font.color = knockout_color
      self.contents.draw_text(sp_x + 72, y, 12, 32, "+", 1)
      self.contents.draw_text(sp_x + 84, y, 48, 32, actor.rest_bp.to_s)
      self.contents.font.color = normal_color
    end
  end
  def draw_actor_bp_icon(actor, x, y)
    bitmap = RPG::Cache.icon(SysSkill_BP::BP_ICON)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    for i in 0...actor.bp
      self.contents.blt(x + cw - bitmap.width, y - ch + 30, bitmap, src_rect)
      cw += bitmap.width
    end
  end
end

class Window_Battle_Point < Window_Base
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  def set_actor_bp(actor)
    if SysSkill_BP::USE_BP_ICON
      draw_actor_bp_icon(actor, 4, 0)
    else
      draw_actor_bp(actor, 4, 0)
    end
  end
end


#==============================================================================
# ? Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    if SysSkill_BP::BATTLE_SP_USE
      self.contents.draw_text(x + 196, y, 48, 32, skill.sp_cost.to_s, 2)
    end
    bp = SysSkill_BP::SKILL_BP[skill.id]
    skill_bp = (bp == nil ? 1 : bp)
    self.contents.font.color = crisis_color
    self.contents.draw_text(x + 232, y, 48, 32, skill_bp.to_s, 2)
  end
end


#==============================================================================
# ? Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      if SysSkill_BP::BATTLE_SP_USE
        draw_actor_hp(actor, actor_x, 30, 120)
        draw_actor_sp(actor, actor_x, 50, 120)
      else
        draw_actor_hp(actor, actor_x, 32, 120)
      end
      if SysSkill_BP::BATTLE_SP_USE
        bp_y = 70
      else
        bp_y = 64
      end
      if SysSkill_BP::USE_BP_ICON
        draw_actor_bp_icon(actor, actor_x, bp_y)
      else
        draw_actor_bp(actor, actor_x, bp_y)
      end
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end

~Seri
Revenir en haut Aller en bas
 
[Demande à genoux] modification - système de points d'action
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Modification
» [Script]A-RPG avec quelque modification
» Modification ressource style Naruto

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Fusion :: BANQUE DU CODE :: Implorer de l'aide :: Demander un Script :: Archives-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser