Últimos temas
» [HPRPG] Harry Potter y la Piedra Filosofal
por xDiego Hoy a las 3:53 am

» Muz-taller: Charas
por Muzgar Ayer a las 1:24 pm

» (MAKER MV)Algunos aditamentos extras para el generador de charas ):
por Muzgar Ayer a las 12:39 pm

» [XP] Recopilación de charas con ropa moderna
por Muzgar Ayer a las 12:10 pm

» KyoDiscounts XP
por Muzgar Ayer a las 12:07 pm

» Nuevos cambios en el foro
por Muzgar Ayer a las 11:42 am

» Chaos of Destiny - The Origin
por Ruben_modder Miér Dic 12, 2018 6:01 pm

» Necesito Bases de proyecto nuevo Maker MV
por Ruben_modder Miér Dic 12, 2018 9:23 am

» necesito script para ver mi estado de EXP
por rapopero Miér Dic 12, 2018 2:46 am

» [Engine Vx Ace] Suelos Movedizos
por IvalteK_Dev Mar Dic 11, 2018 10:01 pm

» [VX/Ace]PersonajesEscolares
por mdk3dd Mar Dic 11, 2018 10:30 am

» Laminación [VXACE] [NUEVO LAVADO DE CARA!]
por Pocari Lun Dic 10, 2018 3:22 pm


[Ace]Soulpour777 - Party Damage Bonus

Ir abajo

[Ace]Soulpour777 - Party Damage Bonus

Mensaje por JapoZero el Vie Ago 22, 2014 3: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 : MV
Mensajes : 674
Monedas : 3589
Reputación : 269
Localización : Chile

Volver arriba Ir abajo

Volver arriba

- Temas similares

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