Últimos temas
» [Ace]Movimiento Libre
por brrt Ayer a las 3:57 pm

» Virtual Kingom (Old Version)
por NinjaLOL Ayer a las 3:22 am

» Concurso de relatos - Septiembre/Octubre 2018 [Inscripción]
por raffael_0 Ayer a las 3:18 am

» Laminación [VXACE] [PROYECTO EN CURSO]
por Pocari Vie Oct 12, 2018 12:08 pm

» QUITAR VENTANA DEL MENU (VX ACE)
por THESHINYMISTERXD Sáb Oct 06, 2018 7:46 pm

» Condición para saber si el jugador está caminando
por Sonik Sáb Oct 06, 2018 5:03 pm

» ¿Tileset de un futbolín?
por MCarlos15 Jue Oct 04, 2018 9:07 pm

» RPG Maker VX Ace en MAC
por Er1ck_92 Mar Oct 02, 2018 8:42 am

» Distrito 0 [VXACE]
por BREAK93 Mar Oct 02, 2018 6:08 am

» Necesito taileset modernos pero que no tengan estilo anime por favor
por Doble D Mar Oct 02, 2018 12:36 am

» Fantasy World XP (+ de 200 para o grupo)
por DecinBR Sáb Sep 29, 2018 6:28 pm

» Problemas con un archivo
por AetherIssei Dom Sep 23, 2018 4:08 am


[Ace]Soulpour777 - Party Damage Bonus

Ir abajo

[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.

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
avatar
JapoZero
PJ Principal
PJ Principal

Masculino
Chile
RPG Maker : Ace
Mensajes : 653
Monedas : 3510
Reputación : 261
Edad : 18
Localización : Chile

Volver arriba Ir abajo

Volver arriba

- Temas similares

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