Últimos temas
» (RMMV) Precognition
por JapoZero Ayer a las 11:40 pm

» Ayuda, duda
por BACA Miér Oct 16, 2019 7:38 pm

» Duda con ventana de comandos en Script
por DorFenn Lun Oct 14, 2019 1:46 am

» Zaza no konpasu (La Brújula de Zaza) [VXACE]
por Pocari Dom Oct 13, 2019 2:23 pm

» Índice Scripts RGSS3
por ZororoWhite Dom Oct 13, 2019 12:24 am

» [VX Ace] Script para duplicar tamaño y escala de ventana del juego
por ZororoWhite Dom Oct 13, 2019 12:23 am

» [Sugerencia]Limpieza de recursos viejos en el foro.
por ZororoWhite Dom Oct 06, 2019 10:25 pm

» RPG maker mv ABS
por Akutenshi Vie Oct 04, 2019 5:35 am

» Pokemon Destiny
por Greninja555 Jue Oct 03, 2019 7:31 pm

» Montura más realista [XP]
por Ledai Jue Oct 03, 2019 7:16 pm

» Characters y face de samurais o gente japonesa
por Metatron Jue Oct 03, 2019 4:53 pm

» El personaje principal no se mueve.
por Meloon Miér Oct 02, 2019 12:17 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 : 708
Monedas : 4364
Reputación : 288
Localización : Chile

Volver arriba Ir abajo

Volver arriba

- Temas similares

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