Últimos temas
» [MV] Jabberwock
por rojo1991 Hoy a las 3:52 am

» [Publicidad] Around me
por Turbiosoft.acho Ayer a las 12:17 pm

» ¿Como hacer que los enemigos se muevan en batalla?
por Iskachu 2000 Ayer a las 7:06 am

» Necesito un script de batalla lateral
por Greninja555 Vie Jun 14, 2019 3:42 pm

» (RMMV) Around me, crimson-stained leaves (¡Descarga disponible!)
por brrt Vie Jun 14, 2019 2:04 am

» Tutoriales engine y script VX Ace.
por micky_joe Jue Jun 13, 2019 7:49 pm

» Duda con cambio de gráficos en Ruta de Movimiento (VXAce)
por Fiquei Jue Jun 13, 2019 11:02 am

» Maker MV: como hacer respawn de misiones y objetos?
por JapoZero Jue Jun 13, 2019 7:50 am

» Zaza no konpasu (La Brújula de Zaza) [VXACE]
por Pocari Mar Jun 11, 2019 11:58 pm

» Vampiros Eternos
por elcrom Mar Jun 11, 2019 1:38 am

» Los audios importados no aparecen!!
por Shy_Cream Mar Jun 11, 2019 1:33 am

» Dudas con el combate (RPGM 2003).
por Athelstan Lun Jun 10, 2019 6:53 am


[Ace]Soulpour777 - Party Damage Bonus

Ir abajo

[Ace]Soulpour777 - Party Damage Bonus Empty [Ace]Soulpour777 - Party Damage Bonus

Mensaje por JapoZero el Vie Ago 22, 2014 9:52 pm

[Ace]Soulpour777 - Party Damage Bonus
Autor: Soulpour777
Este script permite que haya una barra de bonus que se incrementa cuando un jugador esta siendo dañado en batalla. Cuando se llena, una técnica aleatoria es usada por cualquier usuario sin importar su clase. La barra vuelve a la normalidad luego de eso.
Instrucciones: Poner sobre el script Main.
[Ace]Soulpour777 - Party Damage Bonus Damage-boom
Script:
Código:

#==============================================================================
# ** Soulpour777 - Party Damage Bonus
# Author: Soulpour777
# Web URL: infinitytears.wordpress.com
# August 16, 2014 - 9:00PM
#------------------------------------------------------------------------------
# Description:
# This script allows the player to have a bonus gauge that increases while
# the actor is being damaged on battle. When the bonus gauge is filled up
# to its maximum, a random skill from a list of skills is performed by any
# user regardless of his class (remaining actor). The gauge then goes back
# to normal after.
#------------------------------------------------------------------------------
# Instructions:
# Put the script below materials above main.
#------------------------------------------------------------------------------
#==============================================================================
module Soulpour
  module Party_Damage_Bonus
    GAUGE_NAME = "Damage Boom: " #=> Name of the Gauge
    PARTY_GUARD_VARIABLE = 1  #=> Variable ID that would take damage
    RATE_SCOPE = 50          #=> Scope divided by the original value
    SKILL_ID_PERFORMED = [1,2,3,4,5,6,7,8,9,10] #=> Array of Skill ID performed
    ZERO_GAUGE_SE = "Heal6" #=> SE played when gauge is at 0.
  end
end

class Game_Battler < Game_BattlerBase
  include Soulpour::Party_Damage_Bonus
 
  #--------------------------------------------------------------------------
  # * Calculate Damage
  #--------------------------------------------------------------------------
  def make_damage_value(user, item)
    value = item.damage.eval(user, self, $game_variables)
    value *= item_element_rate(user, item)
   
    #--------------------------------------------------------------------------
    # * Item is Physical
    #--------------------------------------------------------------------------   
    if item.physical?
      if user.is_a?(Game_Enemy)
        value *= pdr
        $game_variables[PARTY_GUARD_VARIABLE] += value/RATE_SCOPE.to_f
      else
        value *= pdr
      end
    end
   
    #--------------------------------------------------------------------------
    # * Item is Magical
    #--------------------------------------------------------------------------   
    if item.magical?
      if user.is_a?(Game_Enemy)
        value *= mdr
        $game_variables[PARTY_GUARD_VARIABLE] += value/RATE_SCOPE.to_f
      else
        value *= mdr
      end
    end
   
    #--------------------------------------------------------------------------
    # * If Recover
    #--------------------------------------------------------------------------   
    if item.damage.recover?
      if user.is_a?(Game_Enemy)
        value *= rec
        $game_variables[PARTY_GUARD_VARIABLE] += value/RATE_SCOPE.to_f
      else
        value *= rec
      end
    end
   
    value = apply_critical(value) if @result.critical
    value = apply_variance(value, item.damage.variance)
    value = apply_guard(value)
    @result.make_damage(value.to_i, item)
  end
   
end


class Window_Party_Damage_Bonus < Window_Base
  include Soulpour::Party_Damage_Bonus
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, window_height)
    self.opacity = 0
    self.x = 80
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width
  end
 
  #--------------------------------------------------------------------------
  # * Window Height
  #-------------------------------------------------------------------------- 
  def window_height
    return Graphics.height
  end
 
  #--------------------------------------------------------------------------
  # * Rate
  #-------------------------------------------------------------------------- 
  def rate_value
    return $game_variables[PARTY_GUARD_VARIABLE].to_f / 100
  end
 
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(15, y, GAUGE_NAME)
    draw_gauge(140, -5, 200, rate_value, text_color(6), text_color(9))
  end

  #--------------------------------------------------------------------------
  # * Open Window
  #--------------------------------------------------------------------------
  def open
    refresh
    super
  end
end

class Scene_Battle < Scene_Base
  include Soulpour::Party_Damage_Bonus
  #--------------------------------------------------------------------------
  # * List of Aliased Methods
  #-------------------------------------------------------------------------- 
  alias :soul_party_damage_bonus_start                                  :start
  alias :soul_party_damage_bonus_update                                :update
  alias :soul_end_state_auto_cast                                    :turn_end
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    soul_party_damage_bonus_start
    create_party_bonus_hud
  end
 
  #--------------------------------------------------------------------------
  # * Create Party Bonus Hud
  #-------------------------------------------------------------------------- 
  def create_party_bonus_hud
    @bonus_gauge = Window_Party_Damage_Bonus.new
    @bonus_gauge.z = 99
  end

  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    soul_party_damage_bonus_update
    update_bonus_gauge
  end
 
  #--------------------------------------------------------------------------
  # * Refreshes the Bonus Hud
  #-------------------------------------------------------------------------- 
  def update_bonus_gauge
    @bonus_gauge.refresh
  end
 
  #--------------------------------------------------------------------------
  # * End Turn
  #--------------------------------------------------------------------------
  def turn_end
    soul_end_state_auto_cast
    $game_party.members.each do |player|
      if $game_variables[PARTY_GUARD_VARIABLE] >= 100
        soul_state_auto_cast_skill(player)
      end
    end
   
  end
 
  #--------------------------------------------------------------------------
  # * State Auto Skill Force Action
  #-------------------------------------------------------------------------- 
  def soul_state_auto_cast_skill(battler)
    last_subject = @subject
    @subject = battler
    action = Game_Action.new(battler)
    action.set_skill(SKILL_ID_PERFORMED[rand(SKILL_ID_PERFORMED.size)])
    battler.actions.unshift(action)
    use_item
    battler.actions.shift
    @subject = last_subject
    $game_variables[PARTY_GUARD_VARIABLE] = 0
    RPG::SE.new(ZERO_GAUGE_SE, 100, 100)
  end 
 
end
Espero que les sirva. Salu2
JapoZero
JapoZero
Héroe
Héroe

Masculino
Chile
RPG Maker : MV
Mensajes : 704
Monedas : 4593
Reputación : 280
Localización : Chile

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.