Aportes de Scripts RPG-Maker

Estado
Cerrado para nuevas respuestas
Mensajes
9.007
Reacciones
224
Puntos
0
Ubicación
00 Qan[T]
oye esos scripts se pueden usar para rpg maker xp

SI


==================================

Título Final Fantasy IV-VI - RPG MAKER VX

Descripción:
Este script sirve para poner un menú sobrio, al estilo de los Final Fantasy IV, V y VI. Aunque en la screen el fondo sea negro, en realidad será cualquier imagen de título que tengáis puesta.

Screen:
ttuloffpsonemy1.jpg

Script:
Código:
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================
class Window_Basic < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    self.contents = Bitmap.new(width - 32, height - 32)
    @writtentext  = ""
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    rect = Rect.new(0, 0, self.contents.text_size(@writtentext).width, self.contents.text_size(@writtentext).height)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @writtentext, 1)
  end
  
  def setText(newText)
      @writtentext  = newText
      refresh
  end
end
class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0    #New game
        command_new_game
      when 1    # Continue
        command_continue
      when 2    # Shutdown
        command_shutdown
      end
    end
    case @command_window.index
      when 0  # New game
        @text_window.setText("Comenzar una Nueva Partida.")
      when 1  # Continue
        @text_window.setText("Cargar una partida guardada.")
      when 2  # Shutdown
        @text_window.setText("Salir del juego.")
      end
    end
      #--------------------------------------------------------------------------
  # * Dispose of Command Window
  #--------------------------------------------------------------------------
  def dispose_command_window
    @command_window.dispose
    @text_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::new_game
    s2 = Vocab::continue
    s3 = Vocab::shutdown
    @text_window = Window_Basic.new(20,30,480,60)
    @text_window.setText("Comenzar una Nueva Partida.")
    @command_window = Window_Command.new(172, [s1, s2, s3])
    @command_window.x = 325
    @command_window.y = 95
    if @continue_enabled                    # If continue is enabled
      @command_window.index = 1             # Move cursor over command
    else                                    # If disabled
      @command_window.draw_item(1, false)   # Make command semi-transparent
    end
    @text_window.openness = 0
    @command_window.openness = 0
    @command_window.open
    @text_window.open
  end
  
    def open_command_window
    @text_window.open
    @command_window.open
    begin
      @text_window.update
      @command_window.update
      Graphics.update
    end until @command_window.openness == 255
  end
  
    def close_command_window
    @text_window.close
    @command_window.close
    begin
      @text_window.update
      @command_window.update
      Graphics.update
      @text_window.openness = @command_window.openness
    end until @command_window.openness == 0
  end
  end
Instrucciones:
Lo más sencillo del mundo, pegar encima de Main. :y:

Créditos:
Script creado por Euromaster.

Post original de Fegarur (VZ4)
 
Última edición:
Mensajes
657
Reacciones
0
Puntos
0
Ubicación
EMUDESC, el mejor sitio de Emulación de todo Inter
Aquí voy con 3 más:
Usar armas que causan daño propio a los Aliados: http://www.atelier-rgss.com/RGSS/Demos/MOG_Cursed_Weapon.exe
Parámetros de enemigos basados en el nivel del héroe: http://www.atelier-rgss.com/RGSS/Battle/Script_Bat08_Code.txt
Los golpes causan temblor a la pantalla en batalla: http://www.atelier-rgss.com/RGSS/Battle/Script_Bat23_Code.txt ¿Cómo se utiliza? Miren esta imagen: http://www.atelier-rgss.com/RGSS/Battle/Script_Bat23_IM02.gif
Kairi: La suerte es un parámetro normal. Cuando sebes de nivel, la suerte aumenta, todo normal. Si quieres editar con cuanta suerte empesará el jugador en el nivel 1, creo que tienes editarlo en el script, no estoy seguro, no lo he provado. Si tienes duda, pregunta.
 
Última edición:
Mensajes
9.007
Reacciones
224
Puntos
0
Ubicación
00 Qan[T]
Este script no aparece en el buscador :) (si por alguna razón fue posteado avisarme por mp o msn)

Screen:
shot3vv4.png


Demo:
Descargar Demo (SkyDrive)
Descargar Demo (MegaUpload)
Descargar Demo (FileFront)
Descargar Demo (Fortaleza Friki)

Instrucciones:
Viene todo en el script. Si hay alguna duda posteadla aquí para que pueda resolverla.
El script no da error, lo he probado personalmente. Si obtenéis errores es muy probable que se deba a la compatibilidad con otros scripts.
Para obtener battlers para este sistema os recomiendo que utilicéis un generador de personajes para RO, os será de gran ayuda.

Créditos:
Script creado por... por... A ver. Han intervenido en la elaboración de este script (xDD):
Azrith001
SephirothSpawn
Minkoff
DerVVulfman
Charlie Lee

Post original de Fegarur (VZ4)
 
Mensajes
9.007
Reacciones
224
Puntos
0
Ubicación
00 Qan[T]
Este script no aparece en el buscador (si por alguna razón fue posteado avisarme por mp o msn)

RPG MAKER VX- Día/Noche

Con este script se notará el paso del tiempo en el juego. Aunque eso de tiempo es relativo, porque puede ir según el tiempo o según el número de pasos. En cualquier momento se puede forzar a que sea un determinado momento del día (día-anochecer-noche-amanecer).

Screens:
Anocheciendo:
anocheciendoal3.jpg

De Noche:
denochebu4.jpg

Amaneciendo:
amaneciendofe3.jpg


Script:
Código:
#===============================================================================
#  Script Simple de Día y Noche
#
#  Versión : 0.3.2 - 28.03.08
#  Creado por: hellMinor
#  Descripción: Un simple script que cambia el tono de la pantalla para emular
#               el día o la noche. Se basa en los pasos o la hora del sistema.
#
#===============================================================================

#===============================================================================
# Map-Detection F.A.Q.
#===============================================================================
# Si tienes un mapa interior en el que no se muestran efectos de día y noche
# simplemente pon [int] al comienzo del nombre del mapa.
# Al entrar a este tipo de mapas, el script cambiará inmediatamente el
# tono de pantalla a $daytone y todos los cambios hechos por el scrip serán
# ignorados.
#
# Algunos mapas interiores necesitan ser oscuros,como cuevas. Sólo pon [dint]
# al comienzo del nombre dle mapa para marcarlo como mapa interior oscuro.
# El script cambiará el tono a $nighttone en vez de $daytone
#
# Mientras, el tiempo sigue pasando en el mapa interior, y cuando salgas del
# interior se cambiará al tono de tiempo actual del juego.
#===============================================================================
# Get-Time F.A.Q.
#===============================================================================
# Si necesitas obtener el tiempo actual, puedes usar esto en Llamar Script:
# para obtener el tiempo actual:
# $game_variables[0001] = $dayandnight.getTime
# para obtener la hora actual:
# $game_variables[0001] = $dayandnight.getHour
# o para obtener el minuto actual:
# $game_variables[0001] = $dayandnight.getMinute
#
# $game_variables[0001] será la primera variable en la base de datos.
# Para usar otra variable, cambia el 0001 a algo >5000
#
#===============================================================================

class DayAndNight < Game_Screen
#===============================================================================
# Configuración Principal
#------------------------------------------------------------------------------
  $active = true        # Activa/Desactiva el script
  $timesystem = 1       # Determina qué tipo de sistema está activo
                        # 0 = Sistema por Pasos
                        # 1 = Sistema por Hora
  $fadingtime = 4       # Velocidad a la que cambia el tono (en segundos)
#-------------------------------------------------------------------------------
  $dusktone = Tone.new(-68, -51, -9, 25)      # Tono al Anochecer
  $nighttone = Tone.new(-136, -102, -17, 51)  # Tono por la Noche
  $dawntone = Tone.new(-20, -51, -68, 0)      # Tono al Amanecer
  $daytone = Tone.new(0, 0, 0, 0)             # Tono por el Día
#-------------------------------------------------------------------------------
# Timesystem config
#-------------------------------------------------------------------------------
 $starting_time = "night" # Determina la fase de inicio
                          # "day" para día ,"dusk" para anochecer
                          # "dawn" para amanecer y "night" para noche.
                          # Notas: Por defecto es "night".
                          # ¡¡Cualquier otro cambiará TODOS los cálculos
                          # hechos con Graphics.frame_counter!!
                         
  $divider = 1            # Decide la velocidad a la que corre l Sistema Temporal
                          # Ej: 2 = Doble velocidad (30 segundos = 1 hora)
                          # Ej: 0,5 = Mitad de Velocidad (2 minutos = 1 hora)
  $dusktime =   7         # Cambia al anochecer en $dusktime
  $daytime =    8         # Cambia al día en $daytime
  $dawntime =   19        # Cambia al amanecer en $dawntime
  $nighttime =  20        # Cambia a la noche en $nighttime
#------------------------------------------------------------------------------
# Configuración de los Pasos
#------------------------------------------------------------------------------
  $count = 0            # Cuenta cuántos pasos hay entre un periodo
  $maxsteps = 200       # Cuántos pasos hay entre el cambio día/noche
#-------------------------------------------------------------------------------
# Comprobaciones
#------------------------------------------------------------------------------
  $day = true           # Comprueba si es de día
  $dusk = false         # Comprueba si anochece
  $dawn = false         # Comprueba si amanece
  $night = false        # Comprueba si es de noche
#-------------------------------------------------------------------------------
 def change?
   if $count >= $maxsteps
     if $day
       doDusk
     end
     if $dusk
       doNight
     end
     if $night
       doDawn
     end
     if $dawn
       doDay
     end
   end
 end
#-------------------------------------------------------------------------------
 def doNight
   if $dayandnight.exterior?
     $game_map.screen.start_tone_change($nighttone,$fadingtime*60)
   end
   $count = 0
   $day = false
   $dusk = false
   $dawn = false
   $night = true
 end
#-------------------------------------------------------------------------------
 def doDay
   if $dayandnight.exterior?
     $game_map.screen.start_tone_change($daytone,$fadingtime*60)
   end
   $count = 0
   $day = true
   $night = false
   $dawn = false
   $dusk = false
 end
#-------------------------------------------------------------------------------
 def doDawn
   if $dayandnight.exterior?
     $game_map.screen.start_tone_change($dawntone,$fadingtime*60)
   end
   $count = 0
   $day = false
   $night = false
   $dusk = false
   $dawn = true
 end
#-------------------------------------------------------------------------------
 def doDusk
   if $dayandnight.exterior?
     $game_map.screen.start_tone_change($dusktone,$fadingtime*60)
   end
   $count = 0
   $day = false
   $night = false
   $dusk = true
   $dawn = false
 end
#-------------------------------------------------------------------------------
 def updateclock
   clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
   hour = clocktime / 60 % 24
   minutes = clocktime % 60
   if hour == $dawntime && minutes == 0
     doDawn
   end
   if hour == $daytime && minutes == 0
     doDay
   end
   if hour == $dusktime && minutes == 0
     doDusk
   end
   if hour == $nighttime && minutes == 0
     doNight
   end
 end
#-------------------------------------------------------------------------------
 def interior?
   if($game_map.name.to_s.index("[int]") != nil)
     return true
   end
 end
#-------------------------------------------------------------------------------
 def exterior?
   if($game_map.name.to_s.index("[int]") == nil &&
     $game_map.name.to_s.index("[dint]") == nil)
     return true
   end
 end
#-------------------------------------------------------------------------------  
 def dark_interior?
   if($game_map.name.to_s.index("[dint]") != nil)
     return true
   end
 end
#-------------------------------------------------------------------------------
 def get_state_tone
   if $dawn
     return $dawntone
   end
   if $day
     return $daytone
   end
   if $dusk
     return $dusktone
   end
   if $night
     return $nighttone
   end
 end
#-------------------------------------------------------------------------------
 def getTime
   clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
   hour = clocktime / 60 % 24
   minutes = clocktime % 60
   return hour.to_s+":"+minutes.to_s
 end
#-------------------------------------------------------------------------------  
 def getHour
   clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
   hour = clocktime / 60 % 24
   return hour
 end
#-------------------------------------------------------------------------------  
 def getMinute
   clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
   minutes = clocktime % 60
   return minutes
 end
 
end
#===============================================================================

class Game_Character
#===============================================================================

 def increase_steps
   @stop_count = 0
   if $active && $timesystem == 0
     $count += 1
     $dayandnight = DayAndNight.new
     $dayandnight.change?
   end
   update_bush_depth
 end
 
end
#===============================================================================

class Game_Map
#===============================================================================

 def initialize
   @screen = Game_Screen.new
   if $active && $timesystem == 1
     $dayandnight = DayAndNight.new
   end
   @interpreter = Game_Interpreter.new(0, true)
   @map_id = 0
   @display_x = 0
   @display_y = 0
   create_vehicles
 end
#-------------------------------------------------------------------------------
 def update
   refresh if $game_map.need_refresh
   update_scroll
   update_events
   update_vehicles
   update_parallax
   if $active && $timesystem == 1
     $dayandnight.updateclock
   end
   @screen.update
 end

 def name
   $data_mapinfos[@map_id]
 end
   
end
#===============================================================================

class Scene_Map
#===============================================================================

 def fadein(duration)
   Graphics.transition(0)
   if $active && $dayandnight.interior?
     $game_map.screen.start_tone_change($daytone,1)
   else if $active && $dayandnight.dark_interior?
     $game_map.screen.start_tone_change($nighttone,1)
   else if $active && $dayandnight.exterior?
       $game_map.screen.start_tone_change($dayandnight.get_state_tone,1)
     end
     end
   end
   for i in 0..duration-1
     Graphics.brightness = 255 * i / duration
     update_basic
   end
   Graphics.brightness = 255
 end

end
#===============================================================================

class Scene_Title
#===============================================================================

 alias load_database_additions load_database
 def load_database
   load_database_additions
   $data_mapinfos      = load_data("Data/MapInfos.rvdata")
   for key in $data_mapinfos.keys
     $data_mapinfos[key] = $data_mapinfos[key].name
   end
 end
 
 alias command_new_game_additions command_new_game
 def command_new_game
   command_new_game_additions
   Graphics.frame_count += 25200/$divider if $starting_time == "dawn"
   Graphics.frame_count += 28800/$divider if $starting_time == "day"
   Graphics.frame_count += 68400/$divider if $starting_time == "dusk"
 end
 
end

#===============================================================================
# Game-Time-Hotfix
#===============================================================================

#===============================================================================

class Window_SaveFile < Window_Base
#===============================================================================

 def load_gamedata
   @time_stamp = Time.at(0)
   @file_exist = FileTest.exist?(@filename)
   if @file_exist
     file = File.open(@filename, "r")
     @time_stamp = file.mtime
     begin
       @characters     = Marshal.load(file)
       @frame_count    = Marshal.load(file)
       @last_bgm       = Marshal.load(file)
       @last_bgs       = Marshal.load(file)
       @game_system    = Marshal.load(file)
       @game_message   = Marshal.load(file)
       @game_switches  = Marshal.load(file)
       @game_variables = Marshal.load(file)
       case $starting_time
         when "night"
           @total_sec = @frame_count / Graphics.frame_rate
         when "dawn"
           @total_sec = @frame_count-(25200/$divider) / Graphics.frame_rate
         when "day"
           @total_sec = @frame_count-(28800/$divider) / Graphics.frame_rate
         when "dusk"
           @total_sec = @frame_count-(68400/$divider) / Graphics.frame_rate
       end
     rescue
       @file_exist = false
     ensure
       file.close
     end
   end
 end
 
end

Instrucciones:
Como viene siendo habitual, está todo en el script, y en español. Si tenéis alguna duda posteadla aquí e intentaré resolverla.

Créditos:
Script creado por hellMinor
 
Mensajes
944
Reacciones
0
Puntos
0
Ubicación
En los Cuarteles del Clan Uchiha [Jefazo]
Wena Cabros Coo Estan Jojo Ando buscando Un Script para Xp o Para Vx (de preferencia el Vx) El cual permita Aumentar la dificultad de los mounstros a medida que el personaje principal suba de nivel una vez lo vi >.< no creo que aya sido un sueño xD eso ojala lo encuentren

desde ya gracias!!!
 
Mensajes
38
Reacciones
0
Puntos
0
necesito 2 scripts, 1 pa ke salga la vida de los moustros y 2 uno pa k se aprendan skills tilo ffXII k es coo un mapa y te las vas desblokeando, y k tambien sea para ekipar armas plz
 
Última edición:
Mensajes
20
Reacciones
0
Puntos
0
Olaz...mnn... soy nuevo con el rpg.. aver si me podian explicar como le hago para colocar en el rpg maker xp Tilesets de 16 x 16 n_n

grax (y)
 
Mensajes
243
Reacciones
0
Puntos
0
bueno traigo mi primer aporte
bestiario
(para RPG maker XP)
(advertencia, es incompatible con el script de dificultad)
screen
jojojokb3.png

explicacion
es simple
sirve para ver las caracteristicas de los mounstruos como en los final fantasy
como se usa
el bestiario se usa como objeto
primero hay que hacer una categoria nueva encima de main y pegar el codigo
luego
creas un evento comun en el que pones llamar script
y escribes:
Código:
$scene = Scene_Beastairy.new
se crea un objeto y en efectos pones llamar evento comun
¡y listo!
Script
Código:
#==============================================================================
# Beastairy System
#--------------------------------------------------------------------------
#   Created By SephirothSpawn (11.18.05)
#    Last Updated: 11.18.05
#   Traducido al español por SketchDeluxe para mundodeluxe.com
#==============================================================================

#==============================================================================
# ** Class Scene Title
#==============================================================================
class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias' New Game Method
  #--------------------------------------------------------------------------
  alias new_game command_new_game
  #--------------------------------------------------------------------------
  # * Adds Beastairy Game Variables
  #--------------------------------------------------------------------------
  def command_new_game
    # Sets Up Smithery List
    $game_beastairy = Game_Beastairy.new
    new_game
  end
end

#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :beastairy_return
  #--------------------------------------------------------------------------
  # * Alias Initialization
  #--------------------------------------------------------------------------
  alias beastairy_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    beastairy_initialize
    @beastairy_return = false
  end
end

#==============================================================================
# ** Class Game Beastairy
#==============================================================================
class Game_Beastairy
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :monster_groups
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @monster_groups = []
    for i in 1...$data_enemies.size
      $data_enemies[i].beastairy_setup
      unless @monster_groups.include?($data_enemies[i].group)
        @monster_groups.push($data_enemies[i].group)
      end
    end
  end
end

#==============================================================================
# ** Module RPG
#==============================================================================
module RPG
  #=========================================================================
  # ** Class Enemy
  #=========================================================================
  class Enemy
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    # Detectors
    attr_accessor :seen, :defeated, :group
    # Counters
    attr_accessor :seen_times, :defeated_times
    #--------------------------------------------------------------------------
    # * Setup Beastairy
    #--------------------------------------------------------------------------
    def beastairy_setup
      @seen_times, @defeated_times = 0, 0
      @seen, @defeated = false, false
      if @name.include?('(')
        a, b = @name.index('('), @name.index(')')
        @group = @name.slice!(a..b)
        @group.delete!('(')
        @group.delete!(')')
      else
        @group = "Sin clasificar"
      end
    end
    #--------------------------------------------------------------------------
    # * See Enemy
    #--------------------------------------------------------------------------
    def see
      @seen = true
      @seen_times += 1
    end
    #--------------------------------------------------------------------------
    # * Defeat Enemy
    #--------------------------------------------------------------------------
    def defeat
      @defeated = true
      @defeated_times += 1
    end
  end
end

#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Save Data
  #--------------------------------------------------------------------------
  alias new_save write_save_data
  #--------------------------------------------------------------------------
  # * Write Save Data
  #--------------------------------------------------------------------------
  def write_save_data(file)
    new_save(file)
    Marshal.dump($game_beastairy, file)
  end
end

#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Read Save Data
  #--------------------------------------------------------------------------
  alias new_load read_save_data
  #--------------------------------------------------------------------------
  # * Read Save Data
  #--------------------------------------------------------------------------
  def read_save_data(file)
    new_load(file)
    $game_beastairy = Marshal.load(file)
  end
end

#==============================================================================
# ** Class Window Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Enemy Sprite
  #--------------------------------------------------------------------------
  def draw_enemy_sprite(x, y, enemy_name, enemy_hue, pose, frame)
    bitmap = RPG::Cache.character(enemy_name, enemy_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    # Facing Direction
    case pose
      when 0    ;a = 0             # Down
      when 1    ;a = ch           # Left
      when 2    ;a = ch * 3      # Up
      when 3    ;a = ch * 2      # Right
    end
    # Current Animation Slide
    case frame
      when 0    ;b = 0
      when 1    ;b = cw
      when 2    ;b = cw * 2
      when 3    ;b = cw * 3
    end
    # Bitmap Rectange
    src_rect = Rect.new(b, a, cw, ch)
    # Draws Bitmap
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
end

#==============================================================================
# Window Monster Group Info
#==============================================================================
class Window_Monster_Group_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(200, 0, 440, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #     index  : Index of Group From Game_Beastairy.Groups
  #     pose   : Enemy Character Pose
  #     frame  : Frame of Pose
  #--------------------------------------------------------------------------
  def refresh(index, pose, frame)
    # Clears Window
    contents.clear
    # Sets Up Group Name
    group_name = $game_beastairy.monster_groups[index]
    # Sets Up Enemies In Group
    enemies = []
    for i in 1...$data_enemies.size
      if $data_enemies[i].group == group_name
        enemies.push($data_enemies[i])
      end
    end
    group_name = "Salir" if index == $game_beastairy.monster_groups.size
    # Draws Enemy Group Name
    contents.font.color = system_color
    contents.draw_text(0, 0, self.width - 32, 32, group_name, 1)
    unless index == $game_beastairy.monster_groups.size
      # Offsets Graphics X Position
      graphics_offset = contents.width / (enemies.size + 1)
      # Draws Enemies Graphics
      for i in 0...enemies.size
        draw_enemy_sprite(graphics_offset * (i + 1), 124, enemies[i].battler_name , enemies[i].battler_hue , pose, frame)
      end
      # HP, SP, and Gold Word
      hp_word = $data_system.words.hp
      sp_word = $data_system.words.sp
      gold_word = $data_system.words.gold
      # Draws Table Headings
      contents.draw_text(4, 128, width, 24, "Nombre")
      contents.draw_text(0, 128, 200, 24, "Max #{hp_word}", 2)
      contents.draw_text(0, 128, 300, 24, "Max #{sp_word}", 2)
      contents.draw_text(-4, 128, contents.width, 24, "#{gold_word} Award", 2)
      # Draws Enemies Stats
      contents.font.color = normal_color
      for i in 0...enemies.size
        # Sets Enemy Stats
        name, hp, sp, gold = "??????????", "???", "???", "?????"
        name, hp, sp = enemies[i].name, enemies[i].maxhp, enemies[i].maxsp if enemies[i].seen
        gold = enemies[i].gold if enemies[i].defeated
        # Draws Stats
        contents.draw_text(4, 152 + (i * 24), width, 24, name)
        contents.draw_text(0, 152 + (i * 24), 200, 24, "#{hp}", 2)
        contents.draw_text(0, 152 + (i * 24), 300, 24, "#{sp}", 2)
        contents.draw_text(-4, 152 + (i * 24), contents.width, 24, "#{gold}", 2)
      end
    end
  end
end

#==============================================================================
# Window Monster Info
#==============================================================================
class Window_Monster_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(200, 0, 440, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #     index  : Index of enemy From $data_enemies
  #     pose   : Enemy Character Pose
  #     frame  : Frame of Pose
  #--------------------------------------------------------------------------
  def refresh(index, pose, frame)
    # Clears Window
    contents.clear
    # Enemy
    enemy = $data_enemies[index]
    # Graphic Image
    draw_enemy_sprite(52, 100, enemy.battler_name , enemy.battler_hue, pose, frame)
    # Default Stats Set
    name = "??????????"
    maxhp = maxsp =  str = dex = agi = int = atk = pdef = mdef = eva = "???"
    exp = gold = item_id = weapon_id = armor_id = treasure_prob = "?????"
    item_icon = weapon_icon = armor_icon = "049-Skill06"
    armor_type = 2
    # If the Enemy has been seen
    if enemy.seen
      name = enemy.name
      maxhp = enemy.maxhp.to_s
      maxsp =  enemy.maxsp.to_s
      str = enemy.str.to_s
      dex = enemy.dex.to_s
      agi = enemy.agi.to_s
      int = enemy.int.to_s
      atk = enemy.atk.to_s
      pdef = enemy.pdef.to_s
      mdef = enemy.mdef.to_s
      eva = enemy.eva.to_s
    end
    # If the Enemy has been Defeated
    if enemy.defeated
      exp = enemy.exp.to_s
      gold = enemy.gold.to_s
      if enemy.item_id == 0
        item_id = "Nothing"
        item_icon = "032-Item01"
      else
        item_id = $data_items[enemy.item_id].name
        item_icon = $data_items[enemy.item_id].icon_name
      end
      if enemy.weapon_id == 0
        weapon_id = "Nada"
        weapon_icon = "032-Item01"
      else
        weapon_id = $data_weapons[enemy.weapon_id].name
        weapon_icon = $data_weapons[enemy.weapon_id].icon_name
      end
      if enemy.armor_id == 0
        armor_id = "Nada"
        armor_icon = "032-Item01"
      else
        armor_id = $data_armors[enemy.armor_id].name
        armor_icon = $data_armors[enemy.armor_id].icon_name
        armor_type = $data_armors[enemy.armor_id].type
      end
      treasure_prob = enemy.treasure_prob.to_s
    end
    # System Words
    g_word = $data_system.words.gold 
    hp_word = $data_system.words.hp 
    sp_word = $data_system.words.sp 
    str_word = $data_system.words.str 
    dex_word = $data_system.words.dex 
    agi_word = $data_system.words.agi 
    int_word = $data_system.words.int 
    atk_word = $data_system.words.atk 
    pdef_word = $data_system.words.pdef 
    mdef_word = $data_system.words.mdef 
    weapon_word = $data_system.words.weapon
    case armor_type
      when 0     ;armor_type = $data_system.words.armor1
      when 1     ;armor_type = $data_system.words.armor2
      when 2     ;armor_type = $data_system.words.armor3
      when 3     ;armor_type = $data_system.words.armor4
    end
    item_word = $data_system.words.item 
    # Draws Name
    contents.font.color = normal_color
    contents.draw_text(116, 0, contents.width - 116, 32, name)
    # Draws Times Seen & Defeated
    contents.font.color = system_color
    contents.draw_text(116, 32, contents.width - 116, 32, "Veces visto:")
    contents.draw_text(116, 64, contents.width - 116, 32, "Veces derrotado:")
    contents.font.color = normal_color
    contents.draw_text(0, 32, contents.width, 32, "#{enemy.seen_times}", 2)
    contents.draw_text(0, 64, contents.width, 32, "#{enemy.defeated_times}", 2)
    # Organizes Stats
    colomn_a_left = ["Max #{hp_word}", "Max #{sp_word}", str_word, dex_word, 
                     agi_word, int_word, atk_word, pdef_word, mdef_word, "Evasion"]
    colomn_a_right = [maxhp, maxsp, str,dex , agi, int, atk, pdef, mdef, eva]
    # Organized Victory Settings
    column_b_left = ["Experiencia:", "#{g_word} arrojado:", "#{item_word} arrojado:", "",
          "#{weapon_word} arrojada:", "", "#{armor_type} arrojada:", "", "Probabilidad de objeto:"]
    column_b_right = [exp, gold, "", item_id, "", weapon_id, "", armor_id, treasure_prob]
    # Draws Stats
    for i in 0...colomn_a_left.size
      contents.font.color = system_color
      contents.draw_text(4, 160 + i * 32, 160, 32, colomn_a_left[i])
      contents.font.color = normal_color
      contents.draw_text(-4, 160 + i * 32, 160, 32, colomn_a_right[i], 2)
    end
    # Draws Victory Settings
    for i in 0...column_b_left.size
      contents.font.color = system_color
      contents.draw_text(168, 160 + i * 32, contents.width, 32, column_b_left[i])
      x = -4
      x = -30 if i == 3 or i == 5 or i == 7
      contents.font.color = normal_color
      contents.draw_text(x, 160 + i * 32, contents.width, 32, column_b_right[i], 2)
    end
    # Draws Item Icons
    bitmap = RPG::Cache.icon(item_icon)
    self.contents.blt(contents.width - 24, 260, bitmap, Rect.new(0, 0, 24, 24))
    bitmap = RPG::Cache.icon(weapon_icon)
    self.contents.blt(contents.width - 24, 324, bitmap, Rect.new(0, 0, 24, 24))
    bitmap = RPG::Cache.icon(armor_icon)
    self.contents.blt(contents.width - 24, 388, bitmap, Rect.new(0, 0, 24, 24))
  end
end

#==============================================================================
# Window Beastairy Controls
#==============================================================================
class Window_Beastairy_Controls < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 288, 200, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 999
    refresh(0)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(phase)
    # Clears Window
    contents.clear
    disabled_system_color = Color.new(192, 224, 255, 128)
    contents.font.color = normal_color
    contents.draw_text(0, 0, contents.width, 24, "Izq / Der : Cambiar vista")
    # Main Phase Controls
    contents.font.color = phase == 0 ? system_color : disabled_system_color
    contents.draw_text(4, 24, contents.width, 24, "Principal")
    contents.font.color = phase == 0 ? normal_color : disabled_color
    contents.draw_text(8, 48, contents.width, 24, "B : Regresar al mapa")
    contents.draw_text(8, 72, contents.width, 24, "C : Elegir grupo")
    # Enemy Select Controls
    contents.font.color = phase == 1 ? system_color : disabled_system_color
    contents.draw_text(4, 96, contents.width, 24, "Elegir enemigo")
    contents.font.color = phase == 1 ? normal_color : disabled_color
    contents.draw_text(8, 120, contents.width, 24, "B : Atras")
    contents.draw_text(8, 140, contents.width, 24, "C : Probar batalla")
  end
end

#==============================================================================
# ** Class Scene Beastairy
#==============================================================================
class Scene_Beastairy
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Sets Main Phase
    @phase = 0
    # Enemies Graphic Animation
    @pose, @frame, @counting_frame= 0, 0, 0
    # Current Phase Window
    @phase_window = Window_Base.new(0, 0, width = 200, height = 64)
      @phase_window.contents = contents = Bitmap.new(width - 32, height - 32)
      @phase_window.contents.draw_text(0, 0, 168, 32, "Fase principal", 1)
    # Main Window (Enemy Groups)
    commands = $game_beastairy.monster_groups.dup
    commands.push("Salir")
    @enemy_groups = Window_Command.new(200, commands)
      @enemy_groups.y = 64
      @enemy_groups.height = 224
    # Controls Window
    @controls = Window_Beastairy_Controls.new
    # Monster Group Information Window
    @monster_window = Window_Monster_Group_Info.new
      @monster_window.refresh(0, 0, 0)
    # Enemy Information Window
    @enemy_window = Window_Monster_Info.new
      @enemy_window.visible = false
    # Scene Objects
    @objects = [@phase_window, @enemy_groups, @controls, @monster_window, @enemy_window]
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Update Objects Information
      @objects.each {|x| x.update}
      # Frame update
      update
      # Abort loop if screen is changed
      break if $scene != self
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of Objects
    @objects.each {|x| x.dispose unless x.disposed?}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Visiblity Changes Between Methods
    case @phase
    # Main Phase
    when 0
      [@enemy_window].each {|x| x.visible = false if x.visible}
      [@enemy_groups, @monster_window].each {|x| x.visible = true unless x.visible}
      @enemy_groups.active = true
    when 1
      [@enemy_window].each {|x| x.visible = true unless x.visible}
      [@enemy_groups, @monster_window].each {|x| x.visible = false if x.visible}
      @enemy_groups.active = false
    end
    # Updates Enemy Animation
    @counting_frame += 1
    if @counting_frame == 8
      @counting_frame = 0
      @frame += 1
      @frame = 0 if @frame == 4
      if @phase == 0
        @monster_window.refresh(@enemy_groups.index, @pose, @frame)
      else
        enemy_id = @enemies[@groups_enemies.index].id
        @enemy_window.refresh(enemy_id, @pose, @frame)
      end
    end
    # Current Phase Update
    case @phase
      when 0; main_update
      when 1; enemy_select
    end
  end
  #--------------------------------------------------------------------------
  # * Main Frame Update
  #--------------------------------------------------------------------------
  def main_update
    # Exit Scene
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $game_temp.beastairy_return = false
      $scene = Scene_Map.new
    # Enemy Select
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      if @enemy_groups.index == $game_beastairy.monster_groups.size
        $game_temp.beastairy_return = false
        $scene = Scene_Map.new
      else
        commands, @enemies = [], []
        group = $game_beastairy.monster_groups[@enemy_groups.index]
        for i in 1...$data_enemies.size
           if $data_enemies[i].group == group
            commands.push($data_enemies[i].name)
            @enemies.push($data_enemies[i])
          end
        end
        @groups_enemies = Window_Command.new(200, commands)
          @groups_enemies.y = 64
          @groups_enemies.height = 224
        # Phase Window Update
        @phase_window.contents.clear
        @phase_window.contents.draw_text(0, 0, 168, 32, "Elegir enemigo", 1)
        # Adds Object (For Updating)
        @objects.push(@groups_enemies)
        # Updates Controls Window
        @controls.refresh(1)
        enemy_id = @enemies[@groups_enemies.index].id
        @enemy_window.refresh(enemy_id, @pose, @frame)
        # Changes Phase
        @phase = 1
      end
    # Changes Pose
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 0 ? @pose = 3 : @pose -= 1
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 3 ? @pose = 0 : @pose += 1
    end
  end
  #--------------------------------------------------------------------------
  # * Enemy Frame Update
  #--------------------------------------------------------------------------
  def enemy_select
    # Exit Phase
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @groups_enemies.dispose
      @objects.delete(@groups_enemies)
      # Phase Window Update
      @phase_window.contents.clear
      @phase_window.contents.draw_text(0, 0, 168, 32, "Bestiario", 1)
      # Updates Controls Window
      @controls.refresh(0)
      # Changes Phase
      @phase = 0
    # Enemy Select
    elsif Input.trigger?(Input::C)
      enemy  = @enemies[@groups_enemies.index]
      if enemy.seen
        $game_system.se_play($data_system.decision_se)
        enemy_name = enemy.name
        for i in 1...$data_troops.size
          if $data_troops[i].name == enemy_name
            $game_temp.beastairy_return = true
            $game_temp.battle_troop_id = i
            $game_temp.battle_can_escape = true
            $game_temp.battle_can_lose = false
            $game_temp.battle_proc = nil
            # Memorize map BGM and stop BGM
            $game_temp.map_bgm = $game_system.playing_bgm
            $game_system.bgm_stop
            # Play battle start SE
            $game_system.se_play($data_system.battle_start_se)
            # Play battle BGM
            $game_system.bgm_play($game_system.battle_bgm)
            # Straighten player position
            $game_player.straighten
            # Switch to battle screen
            $scene = Scene_Battle.new
          end
        end
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 0 ? @pose = 3 : @pose -= 1
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 3 ? @pose = 0 : @pose += 1
    end
  end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Main Processing
  #--------------------------------------------------------------------------
  alias beastairy_main main
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    unless $game_temp.beastairy_return
      @beastairy_troop = []
      troop = $data_troops[$game_temp.battle_troop_id]
      for i in 0...troop.members.size
        enemy = $data_enemies[troop.members[i].enemy_id]
        @beastairy_troop.push(enemy)
        enemy.see
      end
    else
      @beastairy_troop = []
    end
    beastairy_main
  end
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # Clear in battle flag
    $game_temp.in_battle = false
    # Clear entire party actions flag
    $game_party.clear_actions
    # Remove battle states
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # Clear enemies
    $game_troop.enemies.clear
    # Call battle callback
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
    if $game_temp.beastairy_return
      $scene = Scene_Beastairy.new
    else
      if result == 0
        for enemy in @beastairy_troop
          enemy.defeat
        end
      end
      $scene = Scene_Map.new
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If battle event is running
    if $game_system.battle_interpreter.running?
      # Update interpreter
      $game_system.battle_interpreter.update
      # If a battler which is forcing actions doesn't exist
      if $game_temp.forcing_battler == nil
        # If battle event has finished running
        unless $game_system.battle_interpreter.running?
          # Rerun battle event set up if battle continues
          unless judge
            setup_battle_event
          end
        end
        # If not after battle phase
        if @phase != 5
          # Refresh status window
          @status_window.refresh
        end
      end
    end
    # Update system (timer) and screen
    $game_system.update
    $game_screen.update
    # If timer has reached 0
    if $game_system.timer_working and $game_system.timer == 0
      # Abort battle
      $game_temp.battle_abort = true
    end
    # Update windows
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    @status_window.update
    @message_window.update
    # Update sprite set
    @spriteset.update
    # If transition is processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If message window is showing
    if $game_temp.message_window_showing
      return
    end
    # If effect is showing
    if @spriteset.effect?
      return
    end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      if $game_temp.beastairy_return
        $scene = Scene_Beastairy.new
      else
        $scene = Scene_Gameover.new
      end
    end
    # If returning to title screen
    if $game_temp.to_title
      # Switch to title screen
      $scene = Scene_Title.new
      return
    end
    # If battle is aborted
    if $game_temp.battle_abort
      # Return to BGM used before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
      return
    end
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end
    # If battler forcing an action doesn't exist,
    # and battle event is running
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # Branch according to phase
    case @phase
    when 1  # pre-battle phase
      update_phase1
    when 2  # party command phase
      update_phase2
    when 3  # actor command phase
      update_phase3
    when 4  # main phase
      update_phase4
    when 5  # after battle phase
      update_phase5
    end
  end  
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        unless $game_temp.beastairy_return
          # Add EXP and amount of gold obtained
          exp += enemy.exp
          gold += enemy.gold
          # Determine if treasure appears
          if rand(100) < enemy.treasure_prob
            if enemy.item_id > 0
              treasures.push($data_items[enemy.item_id])
            end
            if enemy.weapon_id > 0
              treasures.push($data_weapons[enemy.weapon_id])
            end
            if enemy.armor_id > 0
              treasures.push($data_armors[enemy.armor_id])
            end
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100
  end
end
 
Última edición:
Mensajes
657
Reacciones
0
Puntos
0
Ubicación
EMUDESC, el mejor sitio de Emulación de todo Inter
Mensajes
466
Reacciones
3
Puntos
0
Ubicación
Miami, Florida
El moderador legend of host no podria hacer una recopilacion de
todos los scrips en el tema principal...?
de los que llevan?.


tendran algun scrip para que se puedan tener mas de 4 personajes a
la hora de pelear?.
 
Mensajes
572
Reacciones
0
Puntos
0
Ubicación
Mas allá de lo que ves... a______a
aki aportare con algunos scripts
Script de plataformas estilo mario bros: Este script sirve para hacer que el juego sea en sentido lateral al estilo mario bros y ademas puedes saltar.
instrucciones:crear una nueva categoria sobre main y coloca
Código:
# ▼▲▼ XRXS50. Action-Maps XC. ▼▲▼ built 033010
# by 桜雅 在土

#=====================================================
# □ カスタマイズポイント
#=====================================================
class XRXS50
#
# Action-Maps を稼動させるマップIDの配列
#
ENABLE_FULL_ACTY_MAPS = [1, 2]#
# 「斜め降下」
#
ENABLE_SLIDE_DESCENT = true
#
# 向きジャンプ(true : 向いている方向へジャンプ。
# false : キーが押されている方向へジャンプ。)
#
JUMP_AS_KEY = false
end
#=======================================================
# ■ Game_Player
#=======================================================
class Game_Player < Game_Character
#-------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------
# 既存
attr_writer :direction_fix
attr_accessor :walk_anime
# 新規
attr_accessor :now_jumps
attr_writer :xrxs50_direction_sidefix
#-------------------------------------------------------
# ○ 最大ジャンプ回数
#--------------------------------------------------------
def max_jumps
return 1
end
#--------------------------------------------------------
# ● 左を向く
#--------------------------------------------------------
alias xrxs50_turn_left turn_left
def turn_left
if @xrxs50_direction_sidefix
@direction = 4
else
xrxs50_turn_left
end
end
#-------------------------------------------------------
# ● 右を向く
#------------------------------------------------------
alias xrxs50_turn_right turn_right
def turn_right
if @xrxs50_direction_sidefix
@direction = 6
else
xrxs50_turn_right
end
end
end
#========================================================
# ■ Scene_Map
#========================================================
class Scene_Map
#--------------------------------------------------------
# ● メイン処理
#----------------------------------------------------------
alias xrxs50_main main
def main
# チェック
xrxs50_enable_check
# 呼び戻す
xrxs50_main
end
#---------------------------------------------------------
# ● フレーム更新
#---------------------------------------------------------
alias xrxs50_update update
def update
# 呼び戻す
xrxs50_update
# フレーム更新 (座標系更新)
if @xrxs50_enable
update_coordinates
end
end
#------------------------------------------------------------
# ○ フレーム更新 (座標系更新)
#------------------------------------------------------------
def update_coordinates
if $game_player.passable?($game_player.x,$game_player.y,2)
unless $game_player.moving?
if XRXS50::ENABLE_SLIDE_DESCENT and
Input.press?(Input::RIGHT) and
$game_player.passable?($game_player.x,$game_player.y+1,6)
$game_player.move_lower_right
elsif XRXS50::ENABLE_SLIDE_DESCENT and
Input.press?(Input::LEFT) and
$game_player.passable?($game_player.x,$game_player.y+1,4)
$game_player.move_lower_left
else
$game_player.move_down
end
end
else
$game_player.move_down
$game_player.walk_anime = true unless $game_player.walk_anime
$game_player.now_jumps = 0
if Input.trigger?(Input::X) and
$game_player.now_jumps < $game_player.max_jumps
if XRXS50::JUMP_AS_KEY
direction = $game_player.direction == 4 ? -1 : 1
else
if Input.press?(Input::RIGHT)
direction = 1
elsif Input.press?(Input::LEFT)
direction = -1
else
direction = 0
end
end
$game_player.jump(direction, -2)
$game_player.now_jumps += 1
$game_player.walk_anime = false
end
end
end
#-------------------------------------------------------
# ● プレイヤーの場所移動
#-------------------------------------------------------
alias xrxs50_transfer_player transfer_player
def transfer_player
# 呼び戻す
xrxs50_transfer_player
# チェック
xrxs50_enable_check
end
#--------------------------------------------------------
# ○ XRXS50 が稼動するか判定
#---------------------------------------------------------
def xrxs50_enable_check
if XRXS50::ENABLE_FULL_ACTY_MAPS.include?($game_map.map_id)
$game_player.now_jumps = 0 if $game_player.now_jumps.nil?
@xrxs50_enable = true
$game_player.direction_fix = true
$game_player.xrxs50_direction_sidefix = true
else
@xrxs50_enable = false
$game_player.direction_fix = false
$game_player.xrxs50_direction_sidefix = false
end
end
end
flechas isquierda y derecha: mover
Flecha arriba: saltar


[script]Ventana emergente antes de jugar
como su nombre lo indica, este script sirve para que al abrir el juego salga una ventana diciendo algo que tu ayas escito

instrucciones:
crear uno nuevo encima de main y coloca
Código:
 #---Script para mensaje al principio del juego--#

begin
print  "tu mensaje"
end

en donde dice 'tu mensaje' cambialo por el texto que tu quieras.



[script]resalto de opciones

si se entiende, este script sirve para que cuando uno pone el marco sobre una opcion esta resalte
solo crear uno nuevo encima de main y colocar
Código:
 #==============================================================================
# Reruri-Chan : don't forgett the credits -.-
# Gato : 0.o it would be really better for you if you don't forgett them XD
# Carol13 : yes! >.<
#==============================================================================
# ■ Make a new event call it like you want.. for
# example RgC
# Reruri-Chan Gato Carol
# Roling Games Cops *löl*
#------------------------------------------------------------------------------
# Shouting! >.<
# By Reruri-Chan , Gato , and Carol13
#==============================================================================

class Window_Command < Window_Selectable
def initialize(width, commands)
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
@item = []
self.index = 0
refresh
@oldindex = 0
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i != self.index
draw_item_dis(i)
else
draw_item_active(i,@item[i])
end
end
end
#--------------------------------------------------------------------------
# colors and font name etc.
#--------------------------------------------------------------------------

def draw_item_dis(index)
self.contents.font.name = "Arial"
self.contents.font.size -= 2
self.contents.font.color = disabled_color
rect = Rect.new(4+16, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
self.contents.font.size += 2
end
def draw_item_active(index, type)
self.contents.font.name = "Arial"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
if type==1
self.contents.font.color = disabled_color
else
self.contents.font.color = Color.new(255,255,220,255)
end
self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index])
end
#--------------------------------------------------------------------------
# index
#--------------------------------------------------------------------------
def disable_item(index)
@item[index] = 1
end

#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
#——refresh
if self.index != @oldindex
@oldindex = self.index
refresh
end
end
end
 
Última edición:
Mensajes
657
Reacciones
0
Puntos
0
Ubicación
EMUDESC, el mejor sitio de Emulación de todo Inter
Bueno, aquí con 3 scripts más:
1- Menú pricipal totalmente animado: http://www.atelier-rgss.com/RGSS/Demos/MOG_Scene_Menu.exe
2- Menú de estado con imágenes de animación: http://www.atelier-rgss.com/RGSS/Demos/MOG_Scene_Status.zip
3- Menú de habilidades totalmente animado: http://www.atelier-rgss.com/RGSS/Demos/MOG_Scene_Skill.zip
The Virus: Ese script..... no está mal, pero me preguntaba si hay alguna demo por ahí que expliquea la perfección el script.... ¿Saves si hay?
Bueno, hasta la próxima...
 
Mensajes
243
Reacciones
0
Puntos
0
bueno aqui traigo otro script para XP
zoom batallas
explicacion
este script es para que en las batallas tenga un zoom,osea,que se acerque al enemigo al atacar haciendo un efecto muy wapo,aqui esta el script que va como siempre encima de main
script:

Código:
# Momo Camera Script
# Zoom battle effect
# Modificado por Soramaro para La Compañia Nodws
# 基本的に導入するだけで大丈夫です。
#
# 2005.5.18 バグ修正
# Arrow_Actor 修正
# self.enemy → self.actor
# アホなミスを犯してました。
#
# 2005.11.5 更新
# 設定項目を増やしました。
# いくつかの項目は、デフォルト(アクターがバトルフィールド上にいない)状態だと
# 変になるので、適切設定してください。
# (デフォ状態でtrueにするとマズイものには★をつけてます)

module MoMo_Camera
 # カメラの移動にかけるフレーム数の初期値
 MOVE_SPEED_INI = 8
 # カメラのズームにかけるフレーム数の初期値
 ZOOM_SPEED_INI = 8
 # バトルバック引き伸ばし率追加値(0.0で引き伸ばし無し)
 BATTLEBACK_ZOOM = 1.0
 
 # アクターもカメラの影響を受けるようにする ★
 # (★のついている項目を true にする場合などはこちらも true にして下さい)
 CAMERA_UPDATE_ACTOR = false
 
 # エネミー通常攻撃時、行動者を注視する
 ACTIVE_LOOK_ENEMY_NOMAL_ATTACK = true
 # エネミー防御時、行動者を注視する
 ACTIVE_LOOK_ENEMY_GUARD = true
 # エネミー逃走時、行動者を注視する
 ACTIVE_LOOK_ENEMY_ESCAPE = true
 # エネミースキル使用時、行動者を注視する
 ACTIVE_LOOK_ENEMY_SKILL = true
 # エネミー選択時、選択エネミーを注視する
 ACTIVE_LOOK_ENEMY_SELECT = true
 
 # エネミー通常攻撃時、対象者を注視する(対象がアクターの時) ★
 TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ACTOR = false
 # エネミー通常攻撃時、対象者を注視する(対象がエネミーの時)
 TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ENEMY = true
 # エネミースキル使用時、対象者を注視する(対象がアクターの時) ★
 TARGET_LOOK_ENEMY_SKILL_TR_ACTOR = false
 # エネミースキル使用時、対象者を注視する(対象がエネミーの時)
 TARGET_LOOK_ENEMY_SKILL_TR_ENEMY = true
 
 # エネミークリティカル発生時は問答無用で対象を注視する(対象がアクターの時) ★
 CLITICAL_LOOK_ENEMY_TR_ACTOR = false
 # エネミークリティカル発生時は問答無用で対象を注視する(対象がエネミーの時)
 CLITICAL_LOOK_ENEMY_TR_ENEMY = true
 # エネミークリティカル発生時のズーム倍率(ズームしたくない時は0.0を設定)
 CRITICAL_ZOOM_ENEMY = 0.3
 
 # アクター通常攻撃時、行動者を注視する ★
 ACTIVE_LOOK_ACTOR_NOMAL_ATTACK = false
 # アクター防御時、行動者を注視する ★
 ACTIVE_LOOK_ACTOR_GUARD = false
 # アクター逃走時、行動者を注視する ★
 ACTIVE_LOOK_ACTOR_ESCAPE = false
 # アクタースキル使用時、行動者を注視する ★
 ACTIVE_LOOK_ACTOR_SKILL = false
 # アクターアイテム使用時、行動者を注視する ★
 ACTIVE_LOOK_ACTOR_ITEM = false
 # アクター選択時、選択アクターを注視する ★
 ACTIVE_LOOK_ACTOR_SELECT = false
 
 # アクター通常攻撃時、対象者を注視する(対象がアクターの時) ★
 TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ACTOR = false
 # アクター通常攻撃時、対象者を注視する(対象がエネミーの時)
 TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ENEMY = true
 # アクタースキル使用時、対象者を注視する(対象がアクターの時) ★
 TARGET_LOOK_ACTOR_SKILL_TR_ACTOR = false
 # アクタースキル使用時、対象者を注視する(対象がエネミーの時)
 TARGET_LOOK_ACTOR_SKILL_TR_ENEMY = true
 # アクターアイテム使用時、対象者を注視する(対象がアクターの時) ★
 TARGET_LOOK_ACTOR_ITEM_TR_ACTOR = false
 # アクターアイテム使用時、対象者を注視する(対象がエネミーの時)
 TARGET_LOOK_ACTOR_ITEM_TR_ENEMY = true
 
 # アクタークリティカル発生時は問答無用で対象を注視する(対象がアクターの時) ★
 CLITICAL_LOOK_ACTOR_TR_ACTOR = true
 # アクタークリティカル発生時は問答無用で対象を注視する(対象がエネミーの時)
 CLITICAL_LOOK_ACTOR_TR_ENEMY = true
 # アクタークリティカル発生時のズーム倍率(ズームしたくない時は0.0を設定)
 CRITICAL_ZOOM_ACTOR = 0.3
 
 # エネミースリップダメージ時に注視する
 LOOK_ENEMY_SLIP_DAMAGE = true
 
 # アクタースリップダメージ時に注視する ★
 LOOK_ACTOR_SLIP_DAMAGE = false
 
 # コマンド入力時に、アクターを注視 ★
 LOOK_ACTOR_COMMAND_INPUT = false
 
 # 行動終了毎にカメラをセンタリング
 EACH_ACTION_CENTERING = true
 
 # 全体攻撃時のズーム率
 ALL_ATTACK_ZOOM = 0.6
end

class Battle_Camera
 attr_accessor :x
 attr_accessor :y
 attr_accessor :zoom
 attr_accessor :new_x
 attr_accessor :new_y
 attr_accessor :new_zoom
 def initialize
   @x = 320
   @y = 160
   @zoom = 1.0
   @new_x = @x
   @new_y = @y
   @dis_x = 0
   @dis_y = 0
   @dis_zoom = 0.0
   @new_zoom = @zoom
   @move_speed = MoMo_Camera::MOVE_SPEED_INI
   @zoom_speed = MoMo_Camera::ZOOM_SPEED_INI
 end
 # 新しい移動先設定
 def new_x=(newx)
   @new_x = newx
   @dis_x = (@x - @new_x).abs
 end
 def new_y=(newy)
   @new_y = newy
   @dis_y = (@y - @new_y).abs
 end
 def new_zoom=(newz)
   @new_zoom = newz
   @dis_zoom = (@zoom - @new_zoom).abs
 end
 # カメラセット
 def set(x, y, zoom=nil, speed=nil)
   unless speed.nil?
     @move_speed = speed
     @zoom_speed = speed
   end
   self.new_x = x
   self.new_y = y
   self.new_zoom = zoom unless zoom.nil?
 end
 # カメラを真ん中に
 def center(zoom=1.0)
   self.new_x = 320
   self.new_y = 160
   self.new_zoom = zoom
 end
 # バトラー注視
 def battler_look(battler)
   hei = get_battler_height(battler)
   zoom = [160.0 / hei, 0.8].max
   self.new_zoom = zoom
   self.new_x = battler.screen_x
   self.new_y = (battler.screen_y - hei / 2 * [[@new_zoom, 1.0].max, 1.5].min).truncate
 end
 # バトラーの計算色々
 def battler_x_plus(battler)
   dis = battler.screen_x - @x
   val = dis * (@zoom - 1.0)
   return val
 end
 def pos_battler_x(battler)
   return battler.screen_x - (@x - 320)
 end
 def battler_x(battler)
   return pos_battler_x(battler) + battler_x_plus(battler)
 end
 def battler_y_plus(battler)
   dis = battler.screen_y - @y
   val = dis * (@zoom - 1.0)
   return val
 end
 def pos_battler_y(battler)
   return battler.screen_y - (@y - 160)
 end
 def battler_y(battler)
   return pos_battler_y(battler) + battler_y_plus(battler)
 end
 # 更新
 def update
   if @x != @new_x
     if @new_x - @x > 0
       @x = [@x + move_speed_x, @new_x].min
     else
       @x = [@x - move_speed_x, @new_x].max
     end
   end
   if @y != @new_y
     if @new_y - @y > 0
       @y = [@y + move_speed_y, @new_y].min
     else
       @y = [@y - move_speed_y, @new_y].max
     end
   end
   if @zoom != @new_zoom
     if @new_zoom - @zoom > 0
       @zoom = [@zoom + zoom_speed, @new_zoom].min
     else
       @zoom = [@zoom - zoom_speed, @new_zoom].max
     end
   end
 end
 # 移動距離計算
 def move_speed_x
   return [(@dis_x / @move_speed).to_i, 1].max
 end
 def move_speed_y
   return [(@dis_y / @move_speed).to_i, 1].max
 end
 # ズーム倍率計算
 def zoom_speed
   return [(@dis_zoom / @zoom_speed), 0.01].max
 end
 def get_battler_height(battler)
   bammy = get_battler_bmp(battler)
   return bammy.height
 end
 def get_battler_bmp(battler)
   return RPG::Cache.battler(battler.battler_name, battler.battler_hue)
 end
 def move?
   return (@x != @new_x or @y != @new_y or @zoom != @new_zoom)
 end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
#  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
# スの内部で使用されます。
#==============================================================================

class Spriteset_Battle
 attr_accessor :battle_camera
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 alias spriteset_battle_battle_camera_initialize initialize
 def initialize
   @battle_camera = Battle_Camera.new
   spriteset_battle_battle_camera_initialize
   @battleback_sprite.ox = @viewport1.rect.width / 2
   @battleback_sprite.oy = @viewport1.rect.height / 2
   camera_battleback_scroll
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 alias spriteset_battle_battle_camera_update update
 def update
   spriteset_battle_battle_camera_update
   camera_update
 end
 # 更新するバトラーの指定
 def camera_update_battlers
   if MoMo_Camera::CAMERA_UPDATE_ACTOR
     return @enemy_sprites + @actor_sprites
   else
     return @enemy_sprites
   end
 end
 # カメラ更新
 def camera_update
   @battle_camera.update
   camera_battleback_scroll
   camera_battleback_zoom
   camera_battler_update
 end
 # カメラ更新:バトルバックスクロール
 def camera_battleback_scroll
   # バトルバックの計算色々
   view_width = @viewport1.rect.width / 2
   view_height = @viewport1.rect.height / 2
   @battleback_sprite.x = view_width + (view_width - @battle_camera.x) * @battle_camera.zoom
   @battleback_sprite.y = view_height + (view_height - @battle_camera.y) * @battle_camera.zoom
 end
 # カメラ更新:バトルバックズーム
 def camera_battleback_zoom
   @battleback_sprite.zoom_x = @battle_camera.zoom + MoMo_Camera::BATTLEBACK_ZOOM
   @battleback_sprite.zoom_y = @battle_camera.zoom + MoMo_Camera::BATTLEBACK_ZOOM
 end
 # カメラ更新:バトラースプライト更新
 def camera_battler_update
   for sprite in camera_update_battlers
     battler_sprite_zoom(sprite)
     battler_sprite_scroll(sprite)
   end
 end
 # カメラ更新:バトラースプライト更新:バトラースプライトスクロール
 def battler_sprite_scroll(sprite)
   if !sprite.nil? and !sprite.battler.nil?
     sprite.x = @battle_camera.battler_x(sprite.battler)
     sprite.y = @battle_camera.battler_y(sprite.battler)
   end
 end
 # カメラ更新:バトラースプライト更新:バトラースプライトズーム
 def battler_sprite_zoom(sprite)
   unless sprite.nil?
     sprite.zoom_x = @battle_camera.zoom
     sprite.zoom_y = @battle_camera.zoom
   end
 end
end

class Arrow_Actor < Arrow_Base
 attr_accessor :camera
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 alias arrow_actor_battle_camera_update update
 def update
   arrow_actor_battle_camera_update
   # スプライトの座標を再設定
   if self.actor != nil and @camera != nil
     self.x = @camera.battler_x(self.actor)
     self.y = @camera.battler_y(self.actor)
   end
 end
end

class Arrow_Enemy < Arrow_Base
 attr_accessor :camera
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 alias arrow_enemy_battle_camera_update update
 def update
   arrow_enemy_battle_camera_update
   # スプライトの座標を再設定
   if self.enemy != nil and @camera != nil
     self.x = @camera.battler_x(self.enemy)
     self.y = @camera.battler_y(self.enemy)
   end
 end
end

class Scene_Battle
 def camera
   return @spriteset.battle_camera
 end
 
 # 行動側アニメーション中のカメラワーク判定
 def camera_action_judge_active
   if @active_battler.is_a?(Game_Enemy)
     case @active_battler.current_action.kind
     when 0
       camera_action_judge_active_basic_enemy
     when 1
       camera_action_judge_active_skill_enemy
     when 2
       camera_action_judge_active_item_enemy
     end
   else
     case @active_battler.current_action.kind
     when 0
       camera_action_judge_active_basic_actor
     when 1
       camera_action_judge_active_skill_actor
     when 2
       camera_action_judge_active_item_actor
     end
   end
 end
 # 行動側アニメ中のカメラワーク(エネミー):基本
 def camera_action_judge_active_basic_enemy
   case @active_battler.current_action.basic
   when 0
     camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_NOMAL_ATTACK
   when 1
     camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_GUARD
   when 2
     camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_ESCAPE
   end
 end
 # 行動側アニメ中のカメラワーク(エネミー):スキル
 def camera_action_judge_active_skill_enemy
   camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_SKILL
 end
 # 行動側アニメ中のカメラワーク(エネミー):アイテム(一応実装)
 def camera_action_judge_active_item_enemy
   camera.battler_look(@active_battler)
 end
 # 行動側アニメ中のカメラワーク(アクター):基本
 def camera_action_judge_active_basic_actor
   case @active_battler.current_action.basic
   when 0
     camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_NOMAL_ATTACK
   when 1
     camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_GUARD
   when 2
     camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_ESCAPE
   end
 end
 # 行動側アニメ中のカメラワーク(アクター):スキル
 def camera_action_judge_active_skill_actor
   camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_SKILL
 end
 # 行動側アニメ中のカメラワーク(アクター):アイテム
 def camera_action_judge_active_item_actor
   camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_ITEM
 end
 
 # 対象側アニメーション中のカメラワーク判定
 def camera_action_judge_target
   if @active_battler.is_a?(Game_Enemy)
     case @active_battler.current_action.kind
     when 0
       camera_action_judge_target_basic_enemy
     when 1
       camera_action_judge_target_skill_enemy
     when 2
       camera_action_judge_target_item_enemy
     end
   else
     case @active_battler.current_action.kind
     when 0
       camera_action_judge_target_basic_actor
     when 1
       camera_action_judge_target_skill_actor
     when 2
       camera_action_judge_target_item_actor
     end
   end
 end
 
 # 対象側アニメ中のカメラワーク(エネミー):基本
 def camera_action_judge_target_basic_enemy
   case @active_battler.current_action.basic
   when 0
     camera_action_judge_target_basic_enemy_attack
   when 1
     camera_action_judge_target_basic_enemy_guard
   when 2
     camera_action_judge_target_basic_enemy_escape
   when 3
     camera_action_judge_target_basic_enemy_none
   end
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:攻撃
 def camera_action_judge_target_basic_enemy_attack
   if @target_battlers.size > 1
     camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
   else
     if @target_battlers[0].is_a?(Game_Actor)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ACTOR
       if @target_battlers[0].critical
         if MoMo_Camera::CLITICAL_LOOK_ENEMY_TR_ACTOR
           camera.battler_look(@target_battlers[0])
         end
         camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ENEMY
       end
     elsif @target_battlers[0].is_a?(Game_Enemy)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ENEMY
       if @target_battlers[0].critical
         if MoMo_Camera::CLITICAL_LOOK_ENEMY_TR_ENEMY
           camera.battler_look(@target_battlers[0])
         end
         camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ENEMY
       end
     else
       camera.center
     end
   end
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:防御
 def camera_action_judge_target_basic_enemy_guard
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:逃走
 def camera_action_judge_target_basic_enemy_escape
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:なにもしない
 def camera_action_judge_target_basic_enemy_none
 end
 
 # 対象側アニメ中のカメラワーク(エネミー):スキル
 def camera_action_judge_target_skill_enemy
   if @target_battlers.size > 1
     camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
   elsif @target_battlers.size == 1
     if @target_battlers[0].is_a?(Game_Actor)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_SKILL_TR_ACTOR
     elsif @target_battlers[0].is_a?(Game_Enemy)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_SKILL_TR_ENEMY
     end
   else
     camera.center
   end
 end
 # 対象側アニメ中のカメラワーク(エネミー):アイテム(一応実装)
 def camera_action_judge_target_item_enemy
 end
 

 # 対象側アニメ中のカメラワーク(アクター):基本
 def camera_action_judge_target_basic_actor
   case @active_battler.current_action.basic
   when 0
     camera_action_judge_target_basic_actor_attack
   when 1
     camera_action_judge_target_basic_actor_guard
   when 2
     camera_action_judge_target_basic_actor_escape
   when 3
     camera_action_judge_target_basic_actor_none
   end
 end
 # 対象側アニメ中のカメラワーク(アクター):基本:攻撃
 def camera_action_judge_target_basic_actor_attack
   if @target_battlers.size > 1
     camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
   else
     if @target_battlers[0].is_a?(Game_Actor)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ACTOR
       if @target_battlers[0].critical
         if MoMo_Camera::CLITICAL_LOOK_ACTOR_TR_ACTOR
           camera.battler_look(@target_battlers[0])
         end
         camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ACTOR
       end
     elsif @target_battlers[0].is_a?(Game_Enemy)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ENEMY
       if @target_battlers[0].critical
         if MoMo_Camera::CLITICAL_LOOK_ACTOR_TR_ENEMY
           camera.battler_look(@target_battlers[0])
         end
         camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ACTOR
       end
     else
       camera.center
     end
   end
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:防御
 def camera_action_judge_target_basic_actor_guard
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:逃走
 def camera_action_judge_target_basic_actor_escape
 end
 # 対象側アニメ中のカメラワーク(エネミー):基本:なにもしない
 def camera_action_judge_target_basic_actor_none
 end
 # 対象側アニメ中のカメラワーク(アクター):スキル
 def camera_action_judge_target_skill_actor
   if @target_battlers.size > 1
     camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
   elsif @target_battlers.size == 1
     if @target_battlers[0].is_a?(Game_Actor)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_SKILL_TR_ACTOR
     elsif @target_battlers[0].is_a?(Game_Enemy)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_SKILL_TR_ENEMY
     end
   else
     camera.center
   end
 end
 # 対象側アニメ中のカメラワーク(アクター):アイテム
 def camera_action_judge_target_item_actor
   if @target_battlers.size > 1
     camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
   elsif @target_battlers.size == 1
     if @target_battlers[0].is_a?(Game_Actor)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_ITEM_TR_ACTOR
     elsif @target_battlers[0].is_a?(Game_Enemy)
       camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_ITEM_TR_ENEMY
     else
     end
   else
     camera.center
   end
 end
#--------------------------------------------------------------------------
 # ● パーティコマンドフェーズ開始
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_start_phase2 start_phase2
 def start_phase2
   camera.center
   scene_battle_battle_camera_start_phase2
 end
 #--------------------------------------------------------------------------
 # ● アフターバトルフェーズ開始
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_start_phase5 start_phase5
 def start_phase5
   camera.center
   scene_battle_battle_camera_start_phase5
 end
 #--------------------------------------------------------------------------
 # ● 次のアクターのコマンド入力へ
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_phase3_next_actor phase3_next_actor
 def phase3_next_actor
   scene_battle_battle_camera_phase3_next_actor
   if @active_battler != nil and MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
     camera.battler_look(@active_battler)
   end
 end
 #--------------------------------------------------------------------------
 # ● 前のアクターのコマンド入力へ
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_phase3_prior_actor phase3_prior_actor
 def phase3_prior_actor
   scene_battle_battle_camera_phase3_prior_actor
   if @active_battler != nil and MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
     camera.battler_look(@active_battler)
   end
 end
 #--------------------------------------------------------------------------
 # ● アクター選択開始
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_start_actor_select start_actor_select
 def start_actor_select
   scene_battle_battle_camera_start_actor_select
   if MoMo_Camera::ACTIVE_LOOK_ACTOR_SELECT
     @last_arrow_index = nil
     @actor_arrow.camera = camera
   elsif MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
     camera.center
   end
 end
 #--------------------------------------------------------------------------
 # ● アクター選択終了
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_end_actor_select end_actor_select
 def end_actor_select
   scene_battle_battle_camera_end_actor_select
   if MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
     camera.battler_look(@active_battler)
   else
     camera.center
   end
 end
 #--------------------------------------------------------------------------
 # ● エネミー選択開始
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_start_enemy_select start_enemy_select
 def start_enemy_select
   scene_battle_battle_camera_start_enemy_select
   if MoMo_Camera::ACTIVE_LOOK_ENEMY_SELECT
     @last_arrow_index = nil
     @enemy_arrow.camera = camera
   elsif MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
     camera.center
   end
 end
 #--------------------------------------------------------------------------
 # ● エネミー選択終了
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_end_enemy_select end_enemy_select
 def end_enemy_select
   scene_battle_battle_camera_end_enemy_select
   if MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
     camera.battler_look(@active_battler)
   else
     camera.center
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (アクターコマンドフェーズ : アクター選択)
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_update_phase3_actor_select update_phase3_actor_select
 def update_phase3_actor_select
   scene_battle_battle_camera_update_phase3_actor_select
   if MoMo_Camera::ACTIVE_LOOK_ACTOR_SELECT
     if @actor_arrow != nil and (@last_arrow_index != @actor_arrow.index)
       @last_arrow_index = @actor_arrow.index
       camera.battler_look(@actor_arrow.actor)
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_update_phase3_enemy_select update_phase3_enemy_select
 def update_phase3_enemy_select
   scene_battle_battle_camera_update_phase3_enemy_select
   if MoMo_Camera::ACTIVE_LOOK_ENEMY_SELECT
     if @enemy_arrow != nil and (@last_arrow_index != @enemy_arrow.index)
       @last_arrow_index = @enemy_arrow.index
       camera.battler_look(@enemy_arrow.enemy)
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_update_phase4_step1 update_phase4_step1
 def update_phase4_step1
   unless @camera_move
     if $game_temp.forcing_battler == nil and @action_battlers.size != 0 and
        @action_battlers[0].slip_damage?
       camera_action_judge_phase4_step1
     end
     @camera_move = true
   end
   return if camera.move?
   @camera_move = false
   scene_battle_battle_camera_update_phase4_step1
 end
 def camera_action_judge_phase4_step1
   if @action_battlers[0].is_a?(Game_Enemy)
     camera.battler_look(@action_battlers[0]) if MoMo_Camera::LOOK_ENEMY_SLIP_DAMAGE
   elsif @action_battlers[0].is_a?(Game_Actor)
     camera.battler_look(@action_battlers[0]) if MoMo_Camera::LOOK_ACTOR_SLIP_DAMAGE
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_update_phase4_step3 update_phase4_step3
 def update_phase4_step3
   unless @camera_move
     camera_action_judge_active
     @camera_move = true
   end
   return if camera.move?
   @camera_move = false
   scene_battle_battle_camera_update_phase4_step3
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_update_phase4_step4 update_phase4_step4
 def update_phase4_step4
   unless @camera_move
     camera_action_judge_target
     @camera_move = true
   end
   return if camera.move?
   @camera_move = false
   scene_battle_battle_camera_update_phase4_step4
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
 #--------------------------------------------------------------------------
 alias scene_battle_battle_camera_update_phase4_step6 update_phase4_step6
 def update_phase4_step6
   scene_battle_battle_camera_update_phase4_step6
   camera.center if MoMo_Camera::EACH_ACTION_CENTERING
 end
end
 
Mensajes
572
Reacciones
0
Puntos
0
Ubicación
Mas allá de lo que ves... a______a
Bueno, aquí con 3 scripts más:
1- Menú pricipal totalmente animado: http://www.atelier-rgss.com/RGSS/Demos/MOG_Scene_Menu.exe
2- Menú de estado con imágenes de animación: http://www.atelier-rgss.com/RGSS/Demos/MOG_Scene_Status.zip
3- Menú de habilidades totalmente animado: http://www.atelier-rgss.com/RGSS/Demos/MOG_Scene_Skill.zip
The Virus: Ese script..... no está mal, pero me preguntaba si hay alguna demo por ahí que expliquea la perfección el script.... ¿Saves si hay?
Bueno, hasta la próxima...

a cual de los script te refieres ya que son 3

aki hay otroscript que quizas le sirva a alguno de ustedes, se trata de un menu de seleccion de niveles al clasico estilo de Megaman. Es muy personalizable asi que podrian usarlo en un juego que no sea de megaman, usenlo como quieran, es mi aporte a esta comunidad.

FICHA TECNICA

Crado por mi amigo SOULDARK
DESCRIPCION: Script que permite implementar un menu de seleccion de niveles, muy personalizable.

SCRIPT RGSS

MODS:

Código:
#===============================================================================
#  MENU SELECCION DE NIVEL - ESTILO MEGAMAN
#  DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
#  MODS
#===============================================================================

class Window_Selectable < Window_Base
  def setColumn_max(cm)
    @column_max = cm
  end
  def set_Index(i)
    self.index = i
  end
end

class Window_Base < Window
  def draw_text_outline(x, y, wid, hei, text, align = 0, line = outline_color,fore = normal_color)
    self.contents.font.color = line
    self.contents.draw_text(x + 1,y + 1,wid,hei,text, align)
    self.contents.draw_text(x + 1,y - 1,wid,hei,text, align)
    self.contents.draw_text(x - 1,y - 1,wid,hei,text, align)
    self.contents.draw_text(x - 1,y + 1,wid,hei,text, align)
    self.contents.draw_text(x - 1,y,wid,hei,text, align)
    self.contents.draw_text(x + 1,y,wid,hei,text, align)
    self.contents.draw_text(x ,y-1,wid,hei,text, align)
    self.contents.draw_text(x,y+1,wid,hei,text, align)
    self.contents.font.color = fore
    self.contents.draw_text(x,y,wid,hei,text, align)
  end
  def outline_color
   return Color.new(0, 0, 0, 255)
  end
end

class Window_Info < Window_Base
  def initialize(s, d, j)
    super(100, 190, 300, 200)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 18
    self.opacity = 0
    refresh(s, d, j)
  end
  def refresh(s, d, j)
    self.contents.clear
    escribir(s, d, j)
  end
  def escribir(s, d, j)
    draw_text_outline(5, 5, 250, 20, "Stage: #{s}")
    draw_text_outline(5, 30, 250, 20, "Dificultad: #{d}")
    draw_text_outline(5, 55, 250, 20, "Jefe: #{j}")
  end
  def update(s, d, j)
    refresh(s, d, j)
  end
  def clear
    self.contents.clear
  end
end

class Window_Desicion < Window_Selectable
  def initialize
    an = 250
    al = 100
    x = 320 - (an / 2)
    y = 240 - (al / 2)
    super(x, y, an, al)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 18
    self.contents.font.color = normal_color
    @item_max = 2
    @column_max = 2
    @opc = ["Si", "No"]
    pos_cur(1)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.draw_text(4, 0, 165, 32, "¿Deseas Entrar?", 2)
    draw_item(0)
    draw_item(1)
  end
  def draw_item(index)
    x = 4 + index % @column_max * ((self.width - 64)/@column_max + 25)
    self.contents.draw_text(x, 40, 53, 32, @opc[index], 2)
  end
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      x = -4 + index % @column_max * ((self.width - 64)/@column_max + 22)
      self.cursor_rect.set(x, 40, 110, 32)
    end
  end
  def pos_cur(p)
    self.index = p
  end
  def pos_cur2
    return self.index
  end
end

MENU:

Código:
#===============================================================================
#  MENU SELECCION DE NIVEL - ESTILO MEGAMAN
#  DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
#  Script que permite implementar un menu de seleccion de niveles,
#  muy personalizable.
#===============================================================================

class Scene_MenuMegaman
  
  $m = []
  $m = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  
  def initialize(p = 0)
    @p = p
  end
  
  def main
    # -------------------    MODIFICABLES    --------------------
    @nroMounstros = 10     # Numero de Mounstros
    @nroFilas = 2         # Numero de Filas
    @stages = ["Bosque", "Laboratorio", "Base", "Laboratorio Parte 2", "Volcan", "Polo Norte", "Desierto", "???", "Cielo", "Termales Contaminados"]
    @dificultad = [1, 5, "Ninguna", 6, 8, 4, 7, "???", 3, 2]
    @jefes = ["Comander Yamark", "Gate", "Ninguno", "Colonel", "Matrrex", "FrostMan", "Anubis the Necromancer", "???", "TenguMan", "FlameMan"]
    @ma = [1, 1, 1, 1, 1, 1, 1, 0, 1, 1] #Mounstros Activos
    $mapa = [2, 2, 2, 1, 2, 2, 2, 2, 2, 2] #ID de Mapa en el que aparece el Mounstro
    $corx = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] #Coordenada X del Mapa en el que aparece el Mounstro
    $cory = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] #Coordenada Y del Mapa en el que aparece el Mounstro
    @posMf = 7 #Posicion mounstro final
    # -----------------------------------------------------------
    @fondo = Sprite.new
    @fondo.bitmap = RPG::Cache.picture("mapa")
    @wc = []
    for i in 0..@nroMounstros - 1
      @wc[i] = ""
    end
    @command_window = Window_Command.new(192, @wc)
    pos_cur(@p)
    @command_window.opacity = 0
    @command_window.setColumn_max(@nroMounstros / @nroFilas)
    @command_window.visible = false
    # -----------------------------------------------------------
    @caras = []
    dibujarCaras(true)
    # -----------------------------------------------------------
    @window = Window_Info.new(@stages[@p], @dificultad[@p], @jefes[@p])
    # -----------------------------------------------------------
    @marco = Sprite.new
    @marco.bitmap = RPG::Cache.picture("marcos")
    @cursor = Sprite.new
    @cursor.bitmap = RPG::Cache.picture("cursor")
    dibujarCursor(@p)
    @flag = true
    # -----------------------------------------------------------
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    if @flag
      @fondo.dispose
      @marco.dispose
      for i in 0..@nroMounstros - 1
        @caras[i + 1].dispose
      end      
      @cursor.dispose
    end
    @window.dispose
  end
  # -------------------------------------------------------------
  # METODO: UPDATE
  # -------------------------------------------------------------
  def update
    @command_window.update
    # -----------------------------------------------------------
    if compruebaMounstro
      @caras[@posMf + 1].bitmap = RPG::Cache.picture("m#{@posMf + 1}_v_a")
      @ma[@posMf] = 1
    end
    # -----------------------------------------------------------
    if Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::LEFT) or Input.repeat?(Input::RIGHT)
      for i in 0..@nroMounstros - 1
        if @command_window.index == i
          dibujarCursor(i)
          if @ma[i] == 1
            @window.update(@stages[i], @dificultad[i], @jefes[i])
          else
            @window.clear
          end
        end
      end
    end
    if Input.trigger?(Input::C)
      for i in 0..@nroMounstros - 1
        if @command_window.index == i
          if @ma[i] == 1
            @flag = false
            $scene = Scene_Seleccion.new(@command_window.index)
          end
        end
      end
    end
  end
  
  def pos_cur(p)
    @command_window.set_Index(p)
  end
  
  def dibujarCaras(f)
    flag = f
    for i in 0..@nroMounstros - 1
      if flag
        @caras[i + 1] = Sprite.new
      end
      if $m[i] == 1
        @caras[i + 1].bitmap = RPG::Cache.picture("m#{i + 1}_v_d")
      else
        if $m[i] == 0
          @caras[i + 1].bitmap = RPG::Cache.picture("m#{i + 1}_m_d")
        end
      end
      if i < @nroMounstros / @nroFilas
        @caras[i + 1].x = 63 + (i * 105)
        @caras[i + 1].y = 23
      else
        @caras[i + 1].x = 63 + ((i - (@nroMounstros / 2)) * 105)
        @caras[i + 1].y = 356
      end
    end
  end
  
  def compruebaMounstro
    sum = 0
    res = false
    for i in 0..9
      sum += $m[i]
    end
    if sum == 0
      res = true
    end
    return res
  end
  
  def dibujarCursor(i)
    if @command_window.index < @nroMounstros / @nroFilas
      @cursor.x = 75 + (i * 105)
      @cursor.y = 31
    else
      @cursor.x = 75 + ((i - (@nroMounstros / @nroFilas)) * 105)
      @cursor.y = 362
    end
  end
  
end

VENTANA DESICION:

Código:
#===============================================================================
#  MENU SELECCION DE NIVEL - ESTILO MEGAMAN
#  DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
#  VENTANA DESICION
#===============================================================================

class Scene_Seleccion
  
  def initialize(p)
    @p = p
  end
  
  def main
    @wd = Window_Desicion.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @wd.dispose
  end
  
  # -------------------------------------------------------------
  # METODO: UPDATE
  # -------------------------------------------------------------
  
  def update
    @wd.update
    if Input.trigger?(Input::C)
      if @wd.pos_cur2 == 1
        $scene = Scene_MenuMegaman.new(@p)
      else @wd.pos_cur2 == 0
        if
          teletransporte($mapa[@p], $corx[@p], $cory[@p])
        end
      end
    end
  end
     
  def teletransporte(mapa, cx, cy)
    $scene = Scene_Map.new
    $game_map.setup(mapa)
    $game_player.moveto(cx, cy)
  end

IMPORTANTE

Para poder usar este scripts necesitaras 4 tipos de imagenes:

  1. Imagen de Fondo: Una imagen con un paisaje u otra cosa de 640 x 480 pixeles.
  • Imagen de los marcos: Una imagen con el marco que rodeara las caras de 640 x 480 pixeles(Adjuntada mas adelante).
  • Imagenes de Jefes: Varias imagenes de los rostros de los jefes de 105 x 103 pixeles.
  • Imagenes de Jefes Caidos: Varias imagenes de los rostros de los jefes en escala de grises de 105 x 103 pixeles.

NOTA:

Las imagenes de los rostros tendran un estandar para los nombres: "mX_E_d", donde X es el numero del jefe y E el estado.

Ejemplo: m2_v_d

Para el Jefe final el nombre de la imagen sera: "mX_v_a", donde X es el numero del jefe

Si desean que corriga algo, o tienen alguna duda simplemente posteen, estoy aqui para ayudar y espero que este script le sirva a alguien.

SUERTE!
 
Última edición:
Mensajes
9.007
Reacciones
224
Puntos
0
Ubicación
00 Qan[T]
Necesito el script de main, porque se borro, y saber como m.... agrego otros

Código:
#==============================================================================
# ■ Main
#------------------------------------------------------------------------------
#  Despues de la definicion de cada clase...El proceso real empieza aqui
#==============================================================================

begin
  # Fuente que usará el juego
  $fontface = "Lucida Console"
  # Tamaño de la fuente
  $fontsize = 25
  # Preparar transicion
  Graphics.freeze
  # Crear objeto de escena (Pantalla de Titulo)
  $scene = Scene_Title.new
  # Limitacion efectiva de $scene. Llamar metodo principal
  while $scene != nil
    $scene.main
  end
  # Fundido
  Graphics.transition(20)
rescue Errno::ENOENT
  # Complementar la exepcion con Errno::ENOENT
  # Cuando no se puede abrir un archivo, mostrar un mensaje y cerrar.
  filename = $!.message.sub("No se encontó el archivo o directorio - ", "")
  print("Error RGSS: #{filename}")
end
 
Mensajes
657
Reacciones
0
Puntos
0
Ubicación
EMUDESC, el mejor sitio de Emulación de todo Inter

Nan

Mensajes
26
Reacciones
0
Puntos
0
Ubicación
Cordoba, Argentina
Juego estilo zelda :
Script XMS:
################################################################################
################################### XMS ########################################
################################################################################
=begin
MODULO XRXS
Scripts necessários para rodar alguns scripts do site XMS.
By Xiderowg (XMS)
http://xms.rdy.jp/

L4 - built 122410 - Window Selectable
L5 - built 091221 - Elemment %
L6 - built 092308 - Elemment Set
L7 - built ?????? - Window Command
L10 - built ?????? - Window Selectable
L13 - built ?????? - Map Name
L14 - built 122012 - Sprite and Picture
(05/01/06)
=end
################################################################################

module XRXS_Cursor2
def initialize(x, y, w, h)
super(x, y, w, h)
@xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
@xrxsc2_window.opacity = 0
@xrxsc2_window.active = false
@xrxsc2_window.index = -1
end
def index2
return @xrxsc2_window.index
end
def index2=(index)
@xrxsc2_window.index = index
if index == -1
@xrxsc2_window.cursor_rect.empty
else
@xrxsc2_window.x = self.x
@xrxsc2_window.y = self.y
@xrxsc2_window.cursor_rect = self.cursor_rect
end
end
def top_row=(row)
super
pre_oy = @xrxsc2_window.oy
@xrxsc2_window.oy = self.oy
@xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
end
def dispose
@xrxsc2_window.dispose
super
end
def x=(n)
super
@xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
end
def y=(n)
super
@xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
end
def visible=(b)
@xrxsc2_window.visible = b
super
end
end
######
# L5 #
######
module XRXS
def XRXS.element_check(set, element_name)
returnar = [false, 0, 0, []]
return returnar if !set.is_a?(Array) or set.size == 0 or element_name == ""
for i in set
if $data_system.elements =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
returnar[3].push($1.to_i)
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
def XRXS.element_include?(set, element_name)
return element_check(set, element_name)[0]
end
def XRXS.element_amount(set, element_name)
return element_check(set, element_name)[1]
end
def XRXS.element_percent(set, element_name)
return element_check(set, element_name)[2]
end
def XRXS.element_numbers(set, element_name)
return element_check(set, element_name)[3]
end
end
######
# L6 #
######
class Game_Battler
def skill_element_set(skill)
return skill.nil? ? [] : skill.element_set
end
def equip_element_set
return self.element_set + self.guard_element_set
end
def guard_element_set
return []
end
end
class Game_Actor < Game_Battler
def guard_element_set
set = []
for id in self.armor_ids
next if id.nil?
armor = $data_armors[id]
set += (armor != nil ? armor.guard_element_set : [])
end
return set
end
def weapon_ids
unless self.is_a?(Game_Actor)
return []
end
ids = @weapon_ids != nil ? @weapon_ids : []
ids[0] = @weapon_id
return ids
end
def armor_ids
unless self.is_a?(Game_Actor)
return []
end
ids = @armor_ids != nil ? @armor_ids : []
ids[0] = @armor1_id
ids[1] = @armor2_id
ids[2] = @armor3_id
ids[3] = @armor4_id
return ids
end
def equipments
equipments = []
self.weapon_ids.each {|id| equipments.push($data_weapons[id])}
self.armor_ids.each {|id| equipments.push($data_armors[id])}
return equipments
end
def equiping?(item)
case item
when RPG::Weapon
return self.weapon_ids.include?(item.id)
when RPG::Armor
return self.armor_ids.include?(item.id)
else
return false
end
end
end
######
# L7 #
######
module XRXS_Window_Command
def add_command(command)
@disabled = [] if @disabled.nil?
if @commands.size != @disabled.size
for i in [email protected]
@disabled = false
end
end
@commands.push(command)
@disabled.push(false)
@item_max = @commands.size
self.y -= 32
self.height += 32
self.contents.dispose
self.contents = nil
self.contents = Bitmap.new(self.width - 32, @item_max * 32)
refresh
for i in [email protected]
if @disabled
disable_item(i)
end
end
end
def disable_item(index)
@disabled = [] if @disabled.nil?
@disabled[index] = true
draw_item(index, disabled_color)
end
def enable_item(index)
@disabled = [] if @disabled.nil?
@disabled[index] = false
draw_item(index, normal_color)
end
end
class Window_Command < Window_Selectable
include XRXS_Window_Command
def disable_item(index)
super
end
end
#######
# L1s0 #
#######
module Module_SelectableEX
def line_height
return 32
end
attr_accessor :align
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
@align = 0
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, self.line_height * index, self.contents.width - 8, self.line_height)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], self.align)
end
def top_row
return self.oy / self.line_height
end
def top_row=(row)
super
self.oy = self.oy/32 * self.line_height
end
def page_row_max
return (self.height - 32) / self.line_height
end
def update_cursor_rect
super
unless @index < 0
y = (self.cursor_rect.y + self.oy) * self.line_height/32 - self.oy
self.cursor_rect.set(0, y, self.cursor_rect.width, self.line_height)
end
end
end
class Window_Command < Window_Selectable
include Module_SelectableEX
def line_height
return 32
end
def initialize(width, commands)
super(0, 0, width, commands.size * self.line_height + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * self.line_height)
refresh
self.index = 0
end
def draw_item(index, color)
super
end
end
#######
# L13 #
#######
class Game_Map
def name
$data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil?
$data_mapinfos[@map_id].name
end
end
#######
# L14 #
#######
class Bitmap
def draw_hemming_text(x, y, w, h, text, align = 0)
original_color = self.font.color.dup
self.font.color = Color.new(0,0,0,255)
self.draw_text(x , y , w, h, text, align)
self.draw_text(x , y+2, w, h, text, align)
self.draw_text(x+2, y+2, w, h, text, align)
self.draw_text(x+2, y , w, h, text, align)
self.font.color = original_color
self.draw_text(x+1, y+1, w, h, text, align)
end
end
module RPG_FileTest
def RPG_FileTest.character_exist?(filename)
return RPG::Cache.character(filename, 0) rescue return false
end
def RPG_FileTest.picture_exist?(filename)
return RPG::Cache.picture(filename) rescue return false
end
def RPG_FileTest.battler_exist?(filename)
return RPG::Cache.battler(filename, 0) rescue return false
end
end
class Sprite_Number < Sprite
attr_reader :w
def initialize(font = Font.new)
super()
self.bitmap = Bitmap.new(1,1)
self.bitmap.font = font
max = s = 0
for i in 0..9
s = self.bitmap.text_size(i.to_s).width
max = s if max < s
end
@w = max + 2
@h = font.size + 2
self.bitmap.dispose
self.bitmap = Bitmap.new(@w, @h * 10)
self.bitmap.font = font
(0..9).each {|n| self.bitmap.draw_hemming_text(0, @h * n, @w, @h, n.to_s) }
self.src_rect.height /= 10
end
def number=(n)
self.src_rect.y = n * @h
end
def n=(n)
self.number = n
end
end
class Spriteset_Numbers
attr_reader :x
attr_reader :y
attr_reader :z
attr_reader :visible
def initialize(font = Font.new)
@font = font
@numbers = []
@x = 0
@y = 0
@z = 0
@visible = true
end
def number=(n)
@numbers.each{|number| number.n = 10 }
d = (n == 0 ? 0 : Math.log10(n).to_i)
for i in 0..d
@numbers = Sprite_Number.new(@font) if @numbers == nil
@numbers.n = n % 10
@numbers.visible = true
n /= 10
end
self.x = self.x
self.y = self.y
self.z = self.z
end
def n=(n)
self.number=(n)
end
def x=(n)
@x = n
for i in [email protected]
@numbers.x = n
n -= @numbers.w
end
end
def y=(n)
@y = n
@numbers.each{|sprite| sprite.y = @y }
end
def z=(n)
@z = n
@numbers.each{|sprite| sprite.z = @z }
end
def visible=(b)
@visible = b
@numbers.each{|sprite| sprite.visible = b }
end
def dispose
@numbers.each{|sprite| sprite.dispose }
end
end
#===============================================================================
# ---> XIDEROWG ACTION SYSTEM) <---
# (XRXS64 Self Action System)
#===============================================================================
# By Xiderowg (XMS)
# http://xms.rdy.jp/
#===============================================================================
# Unofficial Hero Features by Moghunter
#===============================================================================
# XAS - System Config
#===============================================================================
module XAS_BA
# Definição do Som quando o herói receber dano
HERO_HIT_SE = RPG::AudioFile.new("Mana - Duran_Hit", 100, 100)
#-------------------------------------------------------------------------------
# Definição especifica da animação de dano da ferramenta.
# ATTACK_ANI_HIT = {A=>B,A=>B...}
# A = Ferramenta ID.
# B = Animation ID.
ATTACK_ANI_HIT = {
1=>14
}
#-------------------------------------------------------------------------------
# Definição padrão animação de dano, quando não especificado.
DEFAULT_ATTACK_ANI_HIT = 4
#-------------------------------------------------------------------------------
# Definição das skills que farão tremer a tela no momento do HIT.
# (Coloque o ID da Ferramenta)
ATTACK_SKILL_SHAKE = []
#-------------------------------------------------------------------------------
# Definição do tremor.
SH_POWER = 5 #Poder (Força)
SH_SPEED = 10 #Velocidade
SH_DUR = 20 #Duração(20 = 1 segundo)
#-------------------------------------------------------------------------------
# Ativar JUMP HIT, player dá um pulo quando recebe o dano.
JUMP_HIT_HERO = true
#-------------------------------------------------------------------------------
# Definição dos inimigos que não terão a animação Jump
# ao receberem dano.
JUMP_HIT_ENEMY_DISABLE = []
#-------------------------------------------------------------------------------
# Definição da ID da variável que definirá a área de
# ativação da ação.
SENSOR_VAR = 10
#-------------------------------------------------------------------------------
# Definição de qual ferramenta será
# ativada quando equipar a arma.
#
# WEP_ID_TOOL = { A=>B, A=>B, ...}
#
# A = ID da Arma.
# B = ID da Ferramenta.
WEP_ID_TOOL = {
1=>1
}
#-------------------------------------------------------------------------------
# Definição do equipamento secundário
# que no caso é a função ESCUDO(SHIELD)
#
# SECOND_HAND_ID_TOOL = { A=>B, A=>B, ...}
# A=>B
#
# A = ID da armadura(Função escudo).
# B = ID da ferramenta.
SECOND_HAND_ID_TOOL = {
1=>34
}
#-------------------------------------------------------------------------------
# Ativar Gameover automático ao ser derrotado.
AUTOGAMEOVER = true
#-------------------------------------------------------------------------------
# ID da switch que será ativada quando o herói morrer.
# (Somente quando a opção AUTOGAMEOVER estiver em False)
GAMEOVER_SWITCH_ID = 4
#-------------------------------------------------------------------------------
# Fazer o Battler Piscar após receber dano.
# (O tempo de piscar é igual ao tempo de invencibilidade.)
BLINK_ON = false
#-------------------------------------------------------------------------------
# Tempo de invencibilidade após receber o dano.
INVICIBLE_DURATION_HERO = 35
#-------------------------------------------------------------------------------
# Tempo em que o herói ficará paralisado após receber o dano.
KNOCK_BACK_DURATION_HERO = 30
#-------------------------------------------------------------------------------
# Tempo padrão de invencibilidade e paralisia do inimigo
# após receber o dano.
DEFAULT_INVICIBLE_DURATION_ENEMY = 60
#-------------------------------------------------------------------------------
# Tempo especifico em que o inimigo ficará parado e invencível
# após receber o dano.
#
# A=>B
#
# A = ID do inimigo (Tropas inimigos).
# B = Tempo de invencibilidade.
INVICIBLE_DURATION_ENEMY = {
1=>45
}
#-------------------------------------------------------------------------------
# Velocidade do recuo do battler após receber o dano.
# (Herói e Inimigo)
KNOCK_BACK_SPEED = 5
#-------------------------------------------------------------------------------
# Definição da ME quando fizer Level UP.
LEVEL_UP_ME = RPG::AudioFile.new("007-Fanfare01")
#-------------------------------------------------------------------------------
# Definição da SE ao pegar o item do inimigo no chão.
ITEMDROP_SE = RPG::AudioFile.new("056-Right02", 70, 140)
#-------------------------------------------------------------------------------
# Definição da SE quando for ativada a função Shield.
SHIELD_SE = RPG::AudioFile.new("097-Attack09", 80, 150)
#-------------------------------------------------------------------------------
# Definição do Texto quando for ativada a função Shield.
SHIELD_TEXT = "Guard"
#-------------------------------------------------------------------------------
# Definição da animação ID quando for ativada a função Shield.
SHIELD_ANI = 64
#-------------------------------------------------------------------------------
end
#===============================================================================
# XAS - Item Config
#===============================================================================
module XAS
# Definição das ferramentas que correspondem os itens
# no banco de dados.
#
# A=>B
#
# A = ID da ferramenta.
# B = ID do item no banco de dados.
ITEM_COST = {}
end
#===============================================================================
# XAS - Enemy Config
#===============================================================================
module XAS_BA_ENEMY
# Ativar Animação do inimigo ao morrer.
# A duração da animação é proporcional ao tempo
# do colapso, por default é 40Frames(2s).
# DEF_ANI = {A=>B, A=>B, A=>B...}
# A = ID do inimigo.
# B = ID da animação.
DEF_ANI = {1=>119}
#-------------------------------------------------------------------------------
# Definição do inimigo que terá um dos lados invulnerável.
#
# A=>
#
# A = ID do Inimigo
# B = Direção que o inimigo ficará invulnerável.
#
#(2 = Defesa Frontal.)
#(4 = Defesa Esquerda.)
#(6 = Defesa Direita.)
#(8 = Defesa nas costas.)
SHILED_DIRECTIONS = {}
#-------------------------------------------------------------------------------
# Definição de quais tipos de ferramentas(Habilidades) o
# inimigo será invulnerável.
#
# A=>[B,B,B,B,B,B...]
#
# A = ID do inimigo.
# B = ID da ferramenta que não terá efeito no inimigo.
SHILED_ACTIONS = {}
#-------------------------------------------------------------------------------
# Definição dos inimigos que terão o recuo desativado.
KNOCK_BACK_DISABLES = []
#-------------------------------------------------------------------------------
# Definição do tamanho extra(Área) do inimigo, ou seja, define a
# área de impacto do inimigo.
#
# BODY_SQUARE = {A=>B, A=>B, A=>B...}
#
# A = ID do inimigo.
# B = Valor do tamanho extra do inimigo.
BODY_SQUARE = {}
#-------------------------------------------------------------------------------
# Ativação automática de Switchs quando o inimigo morre.
#
# A=>B
#
# A = ID do inimigo.
# B = ID da switch que será ativada quando o inimigo morrer.
DEFEAT_SWITCH_IDS = {}
end
#===============================================================================
# XAS - (Y) Botão de Habilidade e Item.
#===============================================================================
module XRXS64
# Definição do botão que ativará a ferramenta.
ACTION_BUTTON = Input::Y
# Definição da variável que ficará registrado a
# ID da ferramenta do botão Y.
ACTION_VARIABLE_ID = 2
end
#===============================================================================
# XAS - (C) Botão de Ataque.
#===============================================================================
module XAS_CS
# Definição do botão que ativará a ferramenta arma.
SLASH_BUTTON = Input::C
# Definição da variável que ficará registrado a
# ID da ferramenta do botão C.
SLASH_VARIABLE_ID = 1
end
#===============================================================================
# XAS - (Z) Button Action
#===============================================================================
module XAS_Z
# Definição do botão que trocará as ferramentas ativas.
ACTION_CHANGE_BUTTON = Input::Z #Função Desativada(SORA ED)
# Definição da variável que ficará registrado a
# ID da ferramenta SKILL.
ACTION_VARIABLE_ID = 2
# Definição dos ícones que representam as ferramentas.
ACTION_ICON = {}
# Swtich que desativa a janela de ferramentas.
SWITCH_ID = 5
# Posição da janela de ferramentas na horizontal.
X = 246
# Posição da janela de ferramentas na vertical.
Y = 390
end
#===============================================================================
# XAS - Customização de Mapa de Ferramenta.
#===============================================================================
module XAS
# ID da variável de impacto de Ferramentas.
HIT_ID = 3
# ID do mapa onde fica ficarão os eventos de ferramentas.
ACTION_TEMPLATE_MAP_ID = 1
end
#===============================================================================
# XAS - Customizações gerais de evento.
#===============================================================================
module XAS_BA
# Variável que define a ID do inimigo.
ENEMY_ID_VARIABLE_ID = 4
# Sensor que Define a página de ação do inimigo.
SENSOR_SELF_SWITCH = "D"
# Definição da variável que registrará a
# quantidade de inimigos derrotados.
DEFEAT_NUMBER_ID = 999
end
#===============================================================================
# XAS EX - SYSTEM (XRXS64 Self Action System)
#===============================================================================
$xrxs = {} if $xrxs == nil
$xrxs["xas"] = true
$mogscript = {} if $mogscript == nil
################
# RPG_FileTest #
################
module RPG_FileTest
def RPG_FileTest.character_exist?(filename)
return RPG::Cache.character(filename, 0) rescue return false
end
def RPG_FileTest.picture_exist?(filename)
return RPG::Cache.picture(filename) rescue return false
end
def RPG_FileTest.battler_exist?(filename)
return RPG::Cache.battler(filename, 0) rescue return false
end
end
#################
# Sprite_Number #
#################
class Sprite_Number < Sprite
attr_reader :w
def initialize(font = Font.new)
super()
self.bitmap = Bitmap.new(1,1)
self.bitmap.font = font
max = s = 0
for i in 0..9
s = self.bitmap.text_size(i.to_s).width
max = s if max < s
end
@w = max + 2
@h = font.size + 2
self.bitmap.dispose
self.bitmap = Bitmap.new(@w, @h * 10)
self.bitmap.font = font
(0..9).each {|n| self.bitmap.draw_hemming_text(0, @h * n, @w, @h, n.to_s) }
self.src_rect.height /= 10
end
def number=(n)
self.src_rect.y = n * @h
end
def n=(n)
self.number = n
end
end
class Spriteset_Numbers
attr_reader :x
attr_reader :y
attr_reader :z
attr_reader :visible
def initialize(font = Font.new)
@font = font
@numbers = []
@x = 0
@y = 0
@z = 0
@visible = true
end
def number=(n)
@numbers.each{|number| number.n = 10 }
d = (n == 0 ? 0 : Math.log10(n).to_i)
for i in 0..d
@numbers = Sprite_Number.new(@font) if @numbers == nil
@numbers.n = n % 10
@numbers.visible = true
n /= 10
end
self.x = self.x
self.y = self.y
self.z = self.z
end
def n=(n)
self.number=(n)
end
def x=(n)
@x = n
for i in [email protected]
@numbers.x = n
n -= @numbers.w
end
end
def y=(n)
@y = n
@numbers.each{|sprite| sprite.y = @y }
end
def z=(n)
@z = n
@numbers.each{|sprite| sprite.z = @z }
end
def visible=(b)
@visible = b
@numbers.each{|sprite| sprite.visible = b }
end
def dispose
@numbers.each{|sprite| sprite.dispose }
end
end
#########
# Lib15 #
#########
class Game_Map
attr_accessor :need_refresh_token
def need_add_tokens
@need_add_tokens = [] if @need_add_tokens == nil
return @need_add_tokens
end
def need_remove_tokens
@need_remove_tokens = [] if @need_remove_tokens == nil
return @need_remove_tokens
end
def add_token(token_event)
@events[token_event.id] = token_event
self.need_add_tokens.push(token_event)
self.need_refresh_token = true
end
def remove_token(token_event)
@events.delete(token_event.id)
self.need_remove_tokens.push(token_event)
self.need_refresh_token = true
end
def clear_tokens
for event in @events.values.dup
remove_token(event) if event.is_a?(Token_Event)
end
channels = ["A", "B", "C", "D"]
for id in 1001..(token_id_shift - 1)
for a in channels
key = [self.map_id, id, a]
$game_self_switches.delete(key)
end
end
clear_token_id
end
end
class Game_SelfSwitches
def delete(key)
@data.delete(key)
end
end
class Game_Map
def token_id_shift
@token_id = 1000 if @token_id == nil
@token_id += 1
return @token_id
end
def clear_token_id
@token_id = nil
end
end
module XRXS_CTS_RefreshToken
def refresh_token
for event in $game_map.need_add_tokens
@character_sprites.push(Sprite_Character.new(@viewport1, event))
end
$game_map.need_add_tokens.clear
for sprite in @character_sprites.dup
if $game_map.need_remove_tokens.empty?
break
end
if $game_map.need_remove_tokens.delete(sprite.character)
@character_sprites.delete(sprite)
sprite.dispose
end
end
$game_map.need_refresh_token = false
end
end
class Spriteset_Map
include XRXS_CTS_RefreshToken
alias xrxs_lib15_update update
def update
xrxs_lib15_update
refresh_token if $game_map.need_refresh_token
end
end
class Scene_Map
alias xrxs_lib15_transfer_player transfer_player
def transfer_player
$game_map.clear_tokens
xrxs_lib15_transfer_player
end
end
class Token_Event < Game_Event
def initialize(map_id, event)
event.id = $game_map.token_id_shift
#
@multi = 0
#
super
end
def erase
super
$game_map.remove_token(self)
end
end
##############
# Token Mech #
##############
module XRXS_ActionTemplate
map_id = XAS::ACTION_TEMPLATE_MAP_ID
map = load_data(sprintf("Data/Map%03d.rxdata", map_id))
@@events = map.events
end
class Token_Event < Game_Event
include XRXS_ActionTemplate
end
class Game_Temp
attr_accessor :active_token
end
module XAS_ACTION
attr_reader :action
attr_reader :erased
def shoot(action_id)
return if action_id == 0
item_id = XAS::ITEM_COST[action_id]
if item_id != nil and $game_party.item_number(item_id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
self.action_attachment(action_id)
n = 1
@action.prelag = n
skill_id = action_id
skill = skill_id == nil ? nil : $data_skills[skill_id]
sp_cost = skill.sp_cost
if self.battler.sp < sp_cost
m = 1
else
m = Database_Bullet::SUFLAGS[action_id].to_i
end
@action.duration = m
end
def action_attachment(action_id)
@action = Game_Action.new(self, action_id)
@action.attachment(action_id)
plan = Database_Bullet::SELF_ANIMATION_PLANS[action_id]
@self_animation_plan = plan.nil? ? nil : plan.dup

end
def action_update
return unless @action.is_a?(Game_Action)
if @self_motion != nil
self.character_name_suffix = @self_motion
@pattern = 0
@pattern_count = 0
@self_motion = nil
if self.is_a?(Game_Player)
@step_anime = true
end
end
if @self_animation_plan != nil
animation_id = @self_animation_plan[@action.now_count]
self.animation_id = animation_id unless animation_id.nil?
end
if @action.prelag > 0
@action.prelag -= 1
self.shoot_bullet(@action.id) if @action.prelag == 0
return
end
@action.update
end
def check_event_trigger_attack()
if $game_system.map_interpreter.running?
return
end
if @action.nil? or @action.attack_id == 0
return
end
hit_check = false
range = @action.attack_range
hit = []
targets = [$game_player] + (@action.player_damage ? [] : $game_map.events.values)
for event in targets
next if event == self or
@action.hit_events.include?(event) or
event.jumping? or event.erased
body_size = event.body_size
event_center_x = event.x
event_center_y = event.y - body_size
dx = event_center_x - self.x
dy = event_center_y - self.y
dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min)
dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min)
case @action.attack_range_type
when Map::RHOMBUS
hit_check = (dx.abs + dy.abs <= range)
when Map::SQUARE
hit_check = (dx.abs <= range and dy.abs <= range)
when Map::LINE
case self.direction
when 2
hit_check = (dx == 0 and dy >= 0 and dy <= range)
when 8
hit_check = (dx == 0 and dy <= 0 and dy >= -range)
when 6
hit_check = (dy == 0 and dx >= 0 and dx <= range)
when 4
hit_check = (dy == 0 and dx <= 0 and dx >= -range)
end
end
hit.push(event) if hit_check
hit_check = false
end
for event in hit
if event.action_effect(self, self.action.attack_id)
hit_check = true
end
@action.hit_events.push(event)
end
if hit_check
$game_temp.active_token = self
end
end
def action_effect(attacker, attack_id)
return false unless self.is_a?(Game_Event)
for page in @event.pages
if page.condition.variable_valid and
page.condition.variable_id == XAS::HIT_ID and
page.condition.variable_value == attack_id
self.reaction_valid_attack_id = attack_id
self.refresh
@trigger = 0
self.start
return true
end
end
return false
end
def shoot_bullet(action_id)
return false if action_id == 0
item_id = XAS::ITEM_COST[action_id]
if item_id != nil
$game_party.lose_item(item_id, 1)
if $mogscript["mpequip"] == true
$eref = true
end
end
bullet_token = Token_Bullet.new(self, action_id)
$game_map.add_token(bullet_token)
@self_motion = Database_Bullet::SELF_MOTIONS[action_id]
return bullet_token
end
def body_size
return 0
end
def action_clear
@action = nil
self.character_name_suffix = nil
end
end
class Game_Character
include XAS_ACTION
end
module XAS_Dispose
def update
action_update
super
if @action.is_a?(Game_Action) and @action.done?
self.action_clear
if self.is_a?(Game_Player)
@step_anime = false
end
end
end
end
class Game_Player < Game_Character
include XAS_Dispose
end
class Game_Event < Game_Character
include XAS_Dispose
end
module XAS_CharacterName_Suffix
def character_name
character_name = super
file_name = character_name + self.character_name_suffix.to_s
character_name = file_name if RPG_FileTest.character_exist?(file_name)
return character_name
end
attr_accessor :character_name_suffix
end
class Game_Player < Game_Character
include XAS_CharacterName_Suffix
end
class Game_Event < Game_Character
include XAS_CharacterName_Suffix
end
module XAS_StopToAction
def acting?
return self.action != nil
end
def moving?
return (super or self.acting?)
end
end
class Game_Player < Game_Character
include XAS_StopToAction
end
class Interpreter
alias xrxs64_command_end command_end
def command_end
@list = nil
event = $game_map.events[@event_id]
return if event == nil
if event.reaction_valid_attack_id
event.reaction_valid_attack_id = nil
event.refresh
end
xrxs64_command_end
end
end
class Game_Event < Game_Character
attr_accessor :reaction_valid_attack_id
def refresh
new_page = nil
unless @erased
for page in @event.pages.reverse
c = page.condition
if c.switch1_valid
if $game_switches[c.switch1_id] == false
next
end
end
if c.switch2_valid
if $game_switches[c.switch2_id] == false
next
end
end
if c.variable_valid
if c.variable_id == XAS::HIT_ID and
c.variable_value == self.reaction_valid_attack_id
elsif $game_variables[c.variable_id] < c.variable_value
next
end
end
if c.self_switch_valid
key = [@map_id, @event.id, c.self_switch_ch]
if $game_self_switches[key] != true
next
end
end
new_page = page
break
end
end
if new_page == @page
return
end
@page = new_page
clear_starting
if @page == nil
@tile_id = 0
@character_name = ""
@character_hue = 0
@move_type = 0
@through = true
@trigger = nil
@list = nil
@interpreter = nil
return
end
@tile_id = @page.graphic.tile_id
@character_name = @page.graphic.character_name
@character_hue = @page.graphic.character_hue
if @original_direction != @page.graphic.direction
@direction = @page.graphic.direction
@original_direction = @direction
@prelock_direction = 0
end
if @original_pattern != @page.graphic.pattern
@pattern = @page.graphic.pattern
@original_pattern = @pattern
end
@opacity = @page.graphic.opacity
@blend_type = @page.graphic.blend_type
@move_type = @page.move_type
@move_speed = @page.move_speed
@move_frequency = @page.move_frequency
@move_route = @page.move_route
@move_route_index = 0
@move_route_forcing = false
@walk_anime = @page.walk_anime
@step_anime = @page.step_anime
@direction_fix = @page.direction_fix
@through = @page.through
@always_on_top = @page.always_on_top
@trigger = @page.trigger
@list = @page.list
@interpreter = nil
if @trigger == 4
@interpreter = Interpreter.new
end
check_event_trigger_auto
end
end
class Game_Action
attr_reader :id
attr_accessor :prelag
attr_accessor :attack_id
attr_reader :attack_range
attr_reader :attack_range_type
attr_accessor :user
attr_reader :hit_events
attr_accessor :now_count
attr_reader :final_mark
attr_accessor :duration
attr_reader :blow_power
attr_reader :piercing
attr_reader :player_damage
attr_reader :ignore_invincible
def initialize(user, action_id)
@user = user
@id = action_id
@prelag = 0
@now_count = 0
@duration = nil
@attack_id = 0
@attack_range= 0
@hit_events = []
@blow_power = 0
end
def attachment(action_id)
@duration = Database_Bullet::DURATIONS[action_id]
power = Database_Bullet::BLOW_POWERS[action_id]
@blow_power = power == nil ? 1 : power
@attack_id_plan = Database_Bullet::ATTACK_ID_PLANS[action_id]
@attack_range_type = Database_Bullet::ATTACK_RANGE_TYPES[action_id]
plan = Database_Bullet::ATTACK_RANGE_PLANS[action_id]
@attack_range_plan = plan.nil? ? nil : plan.dup
@self_damage = Database_Bullet::SELF_DAMAGES[self.id]
@player_damage = Database_Bullet::pLAYER_DAMAGES[action_id]
@ignore_invincible = Database_Bullet::IGNORE_INVINCIBLES[action_id]
end
def update
if @attack_id_plan != nil
id = @attack_id_plan[@now_count]
unless id.nil?
@attack_id = id
@hit_events.clear
@hit_events.push(self.user) unless @self_damage
end
end
if @attack_range_plan != nil
range = @attack_range_plan[@now_count]
@attack_range = range unless range.nil?
end
@now_count += 1
end
def done?
return (self.duration.to_i > 0 and self.now_count >= self.duration)
end
end
class Token_Bullet < Token_Event
def initialize(user, action_id)
original_event = @@events[action_id]
return if original_event == nil
event = original_event.dup
event.x = user.x
event.y = user.y
event.pages[0].graphic.direction = user.direction
@character_name = event.pages[0].graphic
super($game_map.map_id, event)
self.action_attachment(action_id)
@action.user = user
@remain_for_an_act = @action.duration.is_a?(Numeric)
end
def update
super
erase if @action == nil and @remain_for_an_act
check_event_trigger_attack
end
end
module Map
RHOMBUS = 1
SQUARE = 2
LINE = 3
end
module Database_Bullet
include Map
EVENTS = []
EVENT_IDS = []
DURATIONS = []
PRELAGS = []
SUFLAGS = []
FINALIZE_MARKS = []
ATTACK_ID_PLANS = []
ATTACK_RANGE_TYPES = []
ATTACK_RANGE_PLANS = []
BLOW_POWERS = []
SELF_MOTIONS = []
SELF_ANIMATION_PLANS = []
PIERCINGS = []
SELF_DAMAGES = []
PLAYER_DAMAGES = []
IGNORE_INVINCIBLES = []
end
#===============================================================================
# XAS - Character damage pop mechanism
#===============================================================================
module XRXS_DAMAGE_OFFSET
def update
super
@damage_sprites = [] if @damage_sprites.nil?
for damage_sprite in @damage_sprites
damage_sprite.x = self.x
damage_sprite.y = self.y
end
end
end
class Sprite_Character < RPG::Sprite
include XRXS_DAMAGE_OFFSET
end
class Game_Character
attr_accessor :collapse_duration
attr_accessor :battler_visible
attr_writer :eek:pacity
attr_accessor :collapse_done
end
module XRXS_CharacterDamagePop
def update
super
if @battler == nil
return
end
if @character.collapse_duration != nil
if @character.collapse_duration > 0
collapse
end
@_collapse_duration = @character.collapse_duration
end
@battler_visible = @character.battler_visible
@battler_visible = true if @battler_visible == nil
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
unless @battler_visible
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
appear
@battler_visible = true
end
end
if @battler_visible
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
else
$game_system.se_play($data_system.actor_collapse_se)
end
collapse
@battler_visible = false
end
else
if @_collapse_duration > 0
@_collapse_duration -= 1
@character.opacity = 256 - (48 - @_collapse_duration) * 6
if @_collapse_duration == 0
@character.collapse_done = true
end
end
end
@character.collapse_duration = @_collapse_duration
@character.battler_visible = @battler_visible
end
end
class Sprite_Character < RPG::Sprite
include XRXS_CharacterDamagePop
end
########################
# Action Battle System #
########################
class Game_Event < Game_Character
def enemy_defeat_process(enemy)
last_level = $game_player.battler.level
$game_party.gain_exp(enemy.exp)
$game_party.gain_gold(enemy.gold)
if last_level < $game_player.battler.level
$game_system.me_play(XAS_BA::LEVEL_UP_ME)
$game_player.battler.damage = "Level up!"
$game_player.battler.damage_pop = true
$game_player.need_refresh = true
end
id = XAS_BA::DEFEAT_NUMBER_ID
$game_variables[id] += 1 if id != 0
switch_id = XAS_BA_ENEMY::DEFEAT_SWITCH_IDS[self.enemy_id]
if switch_id != nil
$game_switches[switch_id] = true
$game_map.refresh
end
end
end
class Game_Party
def gain_exp(exp)
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.cant_get_exp? == false
actor.exp += exp
end
end
end
end
class Game_Player < Game_Character
attr_accessor :need_refresh
end
module XAS_BA_BULLET_SP_COST
def shoot_bullet(action_id)
skill_id = action_id
skill = skill_id == nil ? nil : $data_skills[skill_id]
if skill != nil
sp_cost = skill.sp_cost
if self.battler.sp < sp_cost
$game_system.se_play($data_system.buzzer_se)
return false
end
self.battler.sp -= sp_cost
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
self.need_refresh = true
end
return super
end
end
class Game_Player < Game_Character
include XAS_BA_BULLET_SP_COST
end
module XRXS_EnemySensor
def update_sensor
distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs
enable = (distance <= $game_variables[XAS_BA::SENSOR_VAR])
key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
last_enable = $game_self_switches[key]
last_enable = false if last_enable == nil
if enable != last_enable
$game_self_switches[key] = enable
$game_map.need_refresh = true
end
end
end
class Game_Event < Game_Character
include XRXS_EnemySensor
end
class Game_Character
attr_writer :eek:pacity
end
module XRXS_BattlerAttachment
def attack_effect(attacker)
return super if self.battler.nil? or attacker.nil?
result = (not self.battler.dead? and self.battler.hiblink_duration.to_i <= 0)
if result
$game_temp.in_battle = true
self.battler.attack_effect(attacker.battler)
self.battler.damage_pop = true
$game_temp.in_battle = false
if self.battler.damage.to_i > 0
self.blow(attacker.direction, 1)
end
self.battler.hiblink_duration = self.damage_hiblink_duration
if self.is_a?(Game_Player)
self.need_refresh = true
end
end
@xrxs64c_defeat_done = false if @xrxs64c_defeat_done == nil
if not @xrxs64c_defeat_done and self.battler.dead?
defeat_process
@xrxs64c_defeat_done = true
end
end
def action_effect(bullet, action_id)
return super if self.battler.nil?
if self.battler.hiblink_duration.to_i > 0 and
not bullet.action.ignore_invincible
return false
end
skill_id = action_id
return if skill_id == nil
user = bullet.action.user
attacker = (user == nil ? nil : user.battler)
result = (user != nil and not self.battler.dead?)
skill_id = action_id
dirset = [2,6,8,4]
dir_index = (dirset.index(bullet.direction) + 2) % 4
shield = self.shield_actions.include?(action_id)
for direction in self.shield_directions
dir_index2 = (dirset.index(self.direction) + dirset.index(direction)) % 4
shield |= dirset[dir_index2] == dirset[dir_index]
end
if shield
if user.is_a?(Game_Player)
self.battler.damage = XAS_BA::SHIELD_TEXT
self.battler.damage_pop = true
$game_system.se_play(XAS_BA::SHIELD_SE)
user.blow(dirset[dir_index])
self.animation_id = XAS_BA::SHIELD_ANI
end
super
return true
end
if result
skill = $data_skills[skill_id]
if skill_id == 2 and $game_switches[120]
skill = skill.dup
skill.power = 8
end
$game_temp.in_battle = true
self.battler.skill_effect(attacker, skill)
self.battler.damage_pop = true
$game_temp.in_battle = false
if self.battler.damage.to_i > 0
if XAS_BA::ATTACK_SKILL_SHAKE.include?(skill_id)
$game_screen.start_shake(XAS_BA::SH_POWER,XAS_BA::SH_SPEED,XAS_BA::SH_DUR)
end
hit_skill_anime = XAS_BA::ATTACK_ANI_HIT[skill_id]
if hit_skill_anime != nil
self.animation_id = hit_skill_anime
else
self.animation_id = XAS_BA::DEFAULT_ATTACK_ANI_HIT
end
d = bullet.direction
p = bullet.action.blow_power.to_i
self.blow(d, p)
self.battler.hiblink_duration = self.damage_hiblink_duration
end
if self.is_a?(Game_Player)
self.need_refresh = true
end
end
if not @xrxs64c_defeat_done and self.battler.dead?
defeat_process
@xrxs64c_defeat_done = true
end
return (super or result)
end
def shield_directions
return []
end
def shield_actions
return []
end
def knock_back_disable
return false
end
def damage_hiblink_duration
actor = $game_party.actors[0]
if self.is_a?(Game_Player) and self.battler.damage.to_i > 0
if XAS_BA::JUMP_HIT_HERO == true
jump(0,0)
$game_system.se_play(XAS_BA::HERO_HIT_SE)
end
else
if self.battler.damage.to_i > 0
unless XAS_BA::JUMP_HIT_ENEMY_DISABLE.include?(self.enemy_id)
jump(0,0)
end
end
end
if self.is_a?(Game_Player)
return XAS_BA::INVICIBLE_DURATION_HERO
else
enemy_invicible_duration = XAS_BA::INVICIBLE_DURATION_ENEMY[enemy_id]
if enemy_invicible_duration != nil
return enemy_invicible_duration
else
return XAS_BA::DEFAULT_INVICIBLE_DURATION_ENEMY
end
end
end
def dead?
return self.battler == nil ? false : self.battler.dead?
end
def defeat_process
end
end
class Game_Player < Game_Character
include XRXS_BattlerAttachment
def battler
return $game_party.actors[0]
end
def defeat_process
super
if XAS_BA::AUTOGAMEOVER == true
$scene = Scene_Gameover.new rescue nil
else
$game_switches[XAS_BA::GAMEOVER_SWITCH_ID] = true
$game_map.refresh
end
end
alias xrxs64c_update update
def update
xrxs64c_update
self.battler.remove_states_auto if self.battler != nil
if self.collapse_done
self.collapse_done = false
@xrxs64c_defeat_done = false
end
end
end
class Game_Event < Game_Character
include XRXS_BattlerAttachment
def battler
return @battler
end
alias xrxs64c_refresh refresh
def refresh
xrxs64c_refresh
self.battler_recheck
end
def battler_recheck
return if @battler != nil
if @page == nil
return
end
@enemy_id = 0
for page in @event.pages.reverse
condition = page.condition
if condition.variable_valid and
condition.variable_id == XAS_BA::ENEMY_ID_VARIABLE_ID and
(!condition.switch1_valid or $game_switches[condition.switch1_id]) and
(!condition.switch2_valid or $game_switches[condition.switch2_id])
@enemy_id = condition.variable_value
break
end
end
if @enemy_id == 0
return
end
troop_id = -1
member_index = -1
for troop in $data_troops
next if troop == nil
for enemy in troop.members
if enemy.enemy_id == @enemy_id
troop_id = $data_troops.index(troop)
member_index = troop.members.index(enemy)
break
end
end
end
if troop_id != -1 and member_index != -1
@battler = Game_Enemy.new(troop_id, member_index)
end
end
def enemy_id
self.battler
return @enemy_id
end
alias xrxs64c_update update
def update
if @collapse_wait_count.to_i > 0
@collapse_wait_count -= 1
if @collapse_wait_count == 0
@collapse_wait_count = nil
$game_map.remove_token(self)
end
return
end
update_sensor
xrxs64c_update
if self.battler != nil
self.battler.remove_states_auto
end
if self.collapse_duration.to_i > 0
@through = true
end
if self.collapse_done
@opacity = 0
@collapse_wait_count = 32
return
end
end
def shield_enable!
@shield_disable = nil
end
def shield_disable!
@shield_disable = true
end
def shield_directions
set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_DIRECTIONS[self.enemy_id]
set = [] if set == nil
return set
end
def shield_actions
set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_ACTIONS[self.enemy_id]
set = [] if set == nil
return set
end
def knock_back_disable
return XAS_BA_ENEMY::KNOCK_BACK_DISABLES.include?(self.enemy_id)
end
def body_size
return XAS_BA_ENEMY::BODY_SQUARE[self.enemy_id].to_i
end
def defeat_process
super
enemy_defeat_process(self.battler)
enemy_defeat_animation = XAS_BA_ENEMY::DEF_ANI[enemy_id]
if XAS_BA_ENEMY::DEF_ANI[enemy_id] != nil
self.animation_id = enemy_defeat_animation
end
end
end
class Game_Event < Game_Character
attr_reader :collision_attack
def img_act_exist?
begin
RPG::Cache.character(@page.graphic.character_name + "_Act" , @page.graphic.character_hue)
rescue
return false
end
return true
end
def attack_on
@collision_attack = true
if img_act_exist?
@character_name = @page.graphic.character_name + "_Act"
end
end
def attack_off
@collision_attack = false
@character_name = @page.graphic.character_name
end
end
class Game_Player < Game_Character
alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
def check_event_trigger_touch(x, y)
xrxs64c_check_event_trigger_touch(x, y)
if $game_system.map_interpreter.running?
return
end
for event in $game_map.events.values
next unless event.collision_attack
unless [1,2].include?(event.trigger)
if event.battler != nil and event.x == x and event.y == y
$game_player.attack_effect(event)
$game_player.animation_id = XAS_BA::DEFAULT_ATTACK_ANI_HIT
end
end
end
end
end
class Game_Event < Game_Character
alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
def check_event_trigger_touch(x, y)
xrxs64c_check_event_trigger_touch(x, y)
if $game_system.map_interpreter.running?
return
end
return unless self.collision_attack
if self.battler != nil and x == $game_player.x and y == $game_player.y
$game_player.attack_effect(self)
end
end
end
module XAS_BA_BATTLEEVENT_NONPREEMPT
def update
return if self.battler != nil and $game_system.map_interpreter.running?
super
end
end
class Game_Event < Game_Character
include XAS_BA_BATTLEEVENT_NONPREEMPT
end
class Game_Battler
attr_accessor :hiblink_duration
end
class Sprite_Character < RPG::Sprite
alias xrxs64c_update update
def update
if @battler == nil
@battler = @character.battler
end
xrxs64c_update
if @battler == nil
return
end
if @_collapse_duration > 0
return
end
if @character.collapse_done
return
end
if @battler.hiblink_duration.is_a?(Numeric)
if XAS_BA::BLINK_ON == true
@character.opacity = (@character.opacity + 70) % 190 + 40
end
@battler.hiblink_duration -= 1
if @battler.hiblink_duration <= 0
@battler.hiblink_duration = nil
@character.opacity = 255
end
end
end
end
module XAS_BA_ItemDrop
def defeat_process
super
if self.battler.is_a?(Game_Enemy) and self.battler.dead?
treasure = nil
enemy = self.battler
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasure = $data_items[enemy.item_id]
end
if enemy.weapon_id > 0
treasure = $data_weapons[enemy.weapon_id]
end
if enemy.armor_id > 0
treasure = $data_armors[enemy.armor_id]
end
end
if treasure != nil
item_se = XAS_BA::ITEMDROP_SE
opecode = treasure.is_a?(RPG::Item) ? 126 :
treasure.is_a?(RPG::Weapon) ? 127 :
treasure.is_a?(RPG::Armor) ? 128 :
nil
list = []
if opecode != nil
list[0] = RPG::EventCommand.new(opecode, 0, [treasure.id,0,0,1])
list[1] = RPG::EventCommand.new(250, 0, [item_se])
list[2] = RPG::EventCommand.new(116, 0, [])
end
list.push(RPG::EventCommand.new)
command = RPG::MoveCommand.new
command.code = 14
command.parameters = [0,0]
route = RPG::MoveRoute.new
route.repeat = false
route.list = [command, RPG::MoveCommand.new]
page = RPG::Event::page.new
page.move_type = 3
page.move_route = route
page.move_frequency = 6
page.always_on_top = true
page.trigger = 1
page.list = list
event = RPG::Event.new(self.x, self.y)
event.pages = [page]
token = Token_Event.new($game_map.id, event)
token.icon_name = treasure.icon_name
$game_map.add_token(token)
end
end
end
end
class Game_Event < Game_Character
include XAS_BA_ItemDrop
end
class Game_Character
attr_accessor :icon_name
end
class Sprite_Character < RPG::Sprite
alias xrxs_charactericon_update update
def update
xrxs_charactericon_update
if @character.icon_name != nil #and @icon_name != @character.icon_name
@icon_name = @character.icon_name
self.bitmap = RPG::Cache.icon(@icon_name)
self.src_rect.set(0, 0, 24, 24)
self.ox = 12
self.oy = 24
end
end
end
class Game_Character
def blow(d, power = 1)
return if self.knock_back_disable
@knock_back_prespeed = @move_speed if @knock_back_prespeed == nil
power.times do
if passable?(self.x, self.y, d)
@x += ([3,6,9].include?(d) ? 1 : [1,4,7].include?(d) ? -1 : 0)
@y += ([1,2,3].include?(d) ? 1 : [7,8,9].include?(d) ? -1 : 0)
end
end
if self.battler.is_a?(Game_Enemy)
enemy_knock_duration = XAS_BA::INVICIBLE_DURATION_ENEMY[enemy_id]
if enemy_knock_duration != nil
@knock_back_duration = enemy_knock_duration
else
@knock_back_duration = XAS_BA::DEFAULT_INVICIBLE_DURATION_ENEMY
end
else
@knock_back_duration = XAS_BA::KNOCK_BACK_DURATION_HERO
end
@move_speed = XAS_BA::KNOCK_BACK_SPEED
end
alias xrxs64c_nb_update update
def update
@stop_count = -1 if self.knockbacking? or self.dead?
xrxs64c_nb_update
def img_hit_enemy_exist?
begin
RPG::Cache.character(@page.graphic.character_name + "_Hit" , @page.graphic.character_hue)
rescue
return false
end
return true
end
def img_hit_actor_exist?
begin
actor = $game_party.actors[0]
RPG::Cache.character(actor.character_name + "_Hit" , actor.character_hue)
rescue
return false
end
return true
end
if self.knockbacking?
if self.battler.is_a?(Game_Enemy)
if img_hit_enemy_exist?
@character_name = @page.graphic.character_name + "_Hit"
@collision_attack = false
end
else
if img_hit_actor_exist?
actor = $game_party.actors[0]
@character_name = actor.character_name + "_Hit"
end
end
@pattern = 0
@knock_back_duration -= 1
if @knock_back_duration <= 0
if self.battler.is_a?(Game_Enemy)
@character_name = @page.graphic.character_name
else
actor = $game_party.actors[0]
@character_name = actor.character_name
end
@knock_back_duration = nil
@move_speed = @knock_back_prespeed
@knock_back_prespeed = nil
end
return
end
end
def knockbacking?
return @knock_back_duration != nil
end
def collapsing?
return self.collapse_duration.to_i > 0
end
end
module XAS_DamageStop
def acting?
return (super or self.knockbacking? or self.collapsing?)
end
end
class Game_Player < Game_Character
include XAS_DamageStop
end
class Game_Event < Game_Character
include XAS_DamageStop
end
module RPG
class Sprite < ::Sprite
def dispose_animation
if @_animation_sprites != nil
sprite = @_animation_sprites[0]
if sprite != nil
@@_reference_count[sprite.bitmap] -= 1
end
for sprite in @_animation_sprites
sprite.dispose
end
@_animation_sprites = nil
@_animation = nil
end
end
end
end
#===============================================================================
# XAS - (Y) Button Action
#===============================================================================
class Game_Player < Game_Character
alias xrxs64_ya_update update
def update
xrxs64_ya_update
if Input.trigger?(XRXS64::ACTION_BUTTON)
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing or
self.action != nil
action_id = $game_variables[XRXS64::ACTION_VARIABLE_ID]
self.shoot(action_id)
end
end
end
end
#===============================================================================
# XAS - (Z) Button Change
#===============================================================================
class Game_Party
def goods
@goods = [] if @goods == nil
return @goods
end
def gain_goods(action_id)
@goods = [] if @goods == nil
@goods.push(action_id) unless @goods.include?(action_id)
end
end
module XAS_ACTION
alias xas_z_shoot_bullet shoot_bullet
def shoot_bullet(action_id)
bullet_token = xas_z_shoot_bullet(action_id)
$scene.refresh_goods if bullet_token
return bullet_token
end
end
class Game_Map
attr_accessor :goodref
end
class Interpreter
alias mogfix11_command_126 command_126
def command_126
mogfix11_command_126
$game_map.goodref = true
end
end
class Scene_Map
alias xrxs64_zc_main main
def main
@action_change = Spriteset_ActionChange.new
if $game_switches[XAS_Z::SWITCH_ID] == false
@action_change.show(nil, $game_variables[XAS_Z::ACTION_VARIABLE_ID], nil)
end
xrxs64_zc_main
@action_change.dispose if @action_change != nil
end
alias xrxs64_zc_update update
def update
xrxs64_zc_update
unless $game_switches[XAS_Z::SWITCH_ID] == false
return @action_change.visible = false
end
@action_change.update
if $game_map.goodref == true
refresh_goods
$game_map.goodref = false
end
if $xrxs["xas_good_ax"] == true
if Input.trigger?(XAS_Z::ACTION_CHANGE_BUTTON) and XAS_WINDOW_SKILL::ZBUTTON_ACTIVE == true
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing
action_id2 = $game_variables[XAS_Z::ACTION_VARIABLE_ID]
goods = $game_party.goods
return if goods.size == 0
index = (goods.index(action_id2).to_i + 1) % goods.size
action_id3 = goods[index]
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = action_id3
@action_change.show(nil, action_id2, action_id3)
@action_change.left_slide
end
end
else
if Input.trigger?(XAS_Z::ACTION_CHANGE_BUTTON)
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing
action_id2 = $game_variables[XAS_Z::ACTION_VARIABLE_ID]
goods = $game_party.goods
return if goods.size == 0
index = (goods.index(action_id2).to_i + 1) % goods.size
action_id3 = goods[index]
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = action_id3
@action_change.show(nil, action_id2, action_id3)
@action_change.left_slide
end
end
end
end
alias xrxs64_zc_transfer_player transfer_player
def transfer_player
xrxs64_zc_transfer_player
if $game_switches[XAS_Z::SWITCH_ID] == false
@action_change.show(nil, $game_variables[XAS_Z::ACTION_VARIABLE_ID], nil)
end
end
def refresh_goods
@action_change.refresh if @action_change != nil
end
end
class Spriteset_ActionChange
def initialize
@x = XAS_Z::X
@y = XAS_Z::Y
@icons = []
@action_ids = [nil, nil, nil]
@font = Font.new
@font.name = "Comic Sans MS"
@font.size = 22
@font.bold = true
self.clear
@leftslide_duration = 0
@show_duration = 0
@fadeout_duration = 0
end
def dispose
@icons.each {|sprite| sprite.dispose}
@window.dispose if @window != nil
@numbers.dispose if @numbers != nil
end
def clear
self.dispose
@window = Window_Base.new(@x, @y, 26, 26)
@window.visible = false
@window.back_opacity = 160
@window.z = 500
for i in 0..2
@icons = Sprite.new
@icons.z = 501
end
@numbers = Spriteset_Numbers.new(@font)
@numbers.visible = false
@numbers.x = @x + 12
@numbers.y = @y + 12
@numbers.z = 502
end
def show(action_id1, action_id2, action_id3)
self.clear
@window.visible = true
@action_ids = [action_id1, action_id2, action_id3]
for i in 0..2
icon_name = XAS_Z::ACTION_ICON[@action_ids]
if icon_name != nil
@icons.bitmap = RPG::Cache.icon(icon_name)
@icons.x = @x + (i - 1) * 48
@icons.y = @y + 16 - (i % 2) * 16
@icons.opacity = 96 + (i % 2) * 160
@icons.visible = true
else
@icons.bitmap = nil
end
end
@show_duration = (action_id3 == nil ? 0 : 60)
@leftslide_duration = 0
@fadeout_duration = (action_id3 == nil ? 12 : 0)
@numbers.visible = self.need_number?
@numbers.n = $game_party.item_number(self.item_id) if @numbers.visible
end
def refresh
self.show(*@action_ids)
end
def left_slide
@leftslide_duration = 8
end
def visible=(b)
@window.visible = b
@icons.each{|sprite| sprite.visible = b }
@numbers.visible = (b and need_number?)
end
def need_number?
return (self.item_id != nil)
end
def item_id
return XAS::ITEM_COST[@action_ids[1]]
end
def update
if @leftslide_duration > 0
@leftslide_duration -= 1
@icons[0].opacity = @leftslide_duration * 20
@icons[1].x = @x - 48 + @leftslide_duration * 6
@icons[1].y = @y + 16 - @leftslide_duration * 2
@icons[1].opacity = @leftslide_duration * 20 + 96
@icons[2].x = @x + 48 - (8 - @leftslide_duration) * 6
@icons[2].y = @y + 16 - (8 - @leftslide_duration) * 2
@icons[2].opacity = (8 - @leftslide_duration) * 20 + 96
if @leftslide_duration == 0
show(@action_ids[1], @action_ids[2], nil)
end
return
end
if @icons[0].visible
@icons[0].x += 2
@icons[0].opacity -= 22
@icons[0].visible = false if @icons[0].opacity == 0
return
end
end
end
#===============================================================================
# XAS - (C) Button Slash
#===============================================================================
class Game_Player < Game_Character
alias xrxs64_cs_update update
def update
xrxs64_cs_update
if Input.trigger?(XAS_CS::SLASH_BUTTON)
unless self.action != nil or $game_system.map_interpreter.running? or
$game_temp.message_window_showing or $game_map.starting? or
self.knockbacking?
if Input.press?(Input::UP)
turn_up
elsif Input.press?(Input::DOWN)
turn_down
elsif Input.press?(Input::RIGHT)
turn_right
elsif Input.press?(Input::LEFT)
turn_left
end
action_id = $game_variables[XAS_CS::SLASH_VARIABLE_ID]
self.shoot(action_id)
end
end
end
end
#===============================================================================
# Game_Map
#===============================================================================
class Game_Map
def starting?
if $game_system.map_interpreter.running?
return true
end
for event in $game_map.events.values
return true if event.starting
end
return false
end
end
#===============================================================================
# Scene_Map
#===============================================================================
class Game_Player
alias mog_xaswep_update update
def update
mog_xaswep_update
actor = $game_party.actors[0]
weapon_id = actor.weapon_id
weapon_tool_id = XAS_BA::WEP_ID_TOOL[weapon_id]
$game_variables[XAS_CS::SLASH_VARIABLE_ID] = weapon_tool_id
end
end
#===============================================================================
# XAS - SCENE_SKILL_AX (OPCIONAL)
#===============================================================================
# - Suporte para equipar as ferramentas através da janela de
#Skill.
# - Permite ganhar as ferramentas através do level como se
#fossem skills normais.
#===============================================================================
module XAS_WINDOW_SKILL
#Texto de Skill Equipada.
EQUIPPED = "Equipado"
#Texto de ajuda inicial.
PRESS = "Pressione C para Equipar"
#Botão para equipar a skill.
BUTTON = Input::C
#Ativar ou desativar o botão de Change para mudar as skills.
ZBUTTON_ACTIVE = false
# Ativar ganho de Ferramentas através do ganho de skill por level
#e através da adição e remoção de Skill usando o comando de
#eventos. (Somente com o botão change Ativado.)
LVGAINGOOD = false
end
$xrxs["xas_good_ax"] = true
#===============================================================================
# Scene_Skill
#===============================================================================
class Scene_Skill
alias mog_xasmain main
def main
@xastextime = 0
@xastextime2 = 450
@skill_text = Sprite.new
@skill_text.bitmap = Bitmap.new(160,100)
@skill_text.x = 700
@skill_text.y = 0
@skill_text.z = 9999
@skill_text.bitmap.font.name = "Georgia"
@skill_text.bitmap.font.size = 24
@skill_text.bitmap.font.bold = true
@skill_text.visible = false
@skill_text.bitmap.draw_text(0, 0, 140, 64, XAS_WINDOW_SKILL::EQUIPPED,1)
@skill_text2 = Sprite.new
@skill_text2.bitmap = Bitmap.new(640,64)
@skill_text2.x = 0
@skill_text2.y = 450
@skill_text2.z = 9999
@skill_text2.bitmap.font.name = "Georgia"
@skill_text2.bitmap.font.size = 24
@skill_text2.bitmap.font.bold = true
@skill_text2.visible = true
@skill_text2.bitmap.draw_text(0, 20, 640, 64,XAS_WINDOW_SKILL::pRESS ,1)
@skill_text2.opacity = @xastextime2
mog_xasmain
@skill_text.dispose
@skill_text2.dispose
end
alias mog_xasupdate update
def update
mog_xasupdate
@xastextime -= 3
@xastextime2 -= 3
@skill_text.opacity = @xastextime
@skill_text2.opacity = @xastextime2
if @xastextime <= 0
@xastextime = 0
@skill_text.visible = false
end
if @xastextime2 <= 0
@xastextime2 = 0
@skill_text2.visible = false
end
if @skill_text2.y > 400
@skill_text2.y -= 3
elsif @skill_text2.y <= 400
@skill_text2.y = 400
end
if @skill_text.x > 480
@skill_text.x -= 10
elsif @skill_text.x <= 480
@skill_text.x = 480
end
end
alias mog_xasupdate_skill update_skill
def update_skill
mog_xasupdate_skill
if Input.trigger?(XAS_WINDOW_SKILL::BUTTON)
@skill = @skill_window.skill
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = @skill.id
@skill_text.visible = true
@skill_text.x = 700
@skill_text.opacity = @xastextime
@xastextime = 355
end
end
end
#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
alias mog_xasgood_setup setup
def setup(actor_id)
mog_xasgood_setup(actor_id)
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
$game_party.gain_goods(j.skill_id) if XAS_WINDOW_SKILL::LVGAINGOOD == true
end
end
end
end
end
#===============================================================================
# Game_Actor
#===============================================================================
class Interpreter
alias mog_xasgood_command_318 command_318
def command_318
mog_xasgood_command_318
actor = $game_actors[@parameters[0]]
if actor != nil
if @parameters[1] == 0
$game_party.gain_goods(@parameters[2]) if XAS_WINDOW_SKILL::LVGAINGOOD == true
else
$game_party.goods.delete(@parameters[2]) if XAS_WINDOW_SKILL::LVGAINGOOD == true
end
end
return true
end
end
#===============================================================================
# XAS - SCENE_ITEM_AX (OPCIONAL)
#===============================================================================
# - Suporte para equipar as ferramentas através da janela de
# itens.
#===============================================================================
module XAS_WINDOW_ITEM
#Definição da ID que ativará a Ferramenta ID.
# XASITEM_ID = {A=>B, A=>B,...}
# A = ID do Item
# B = ID da Ferramenta
XASITEM_ID = {
# A B Nome do item
1=>8, # Potion
2=>9, # HI-Potion
3=>10, # Ether
4=>11, # HI-Ether
5=>12, # Remedy
6=>13, # Elixir
7=>14 # Bomb
}
#Texto de item Equipado.
EQUIPPED = "Equipado"
#Texto de ajuda inicial.
PRESS = "Pressione C para Equipar"
#Botão para equipar o item.
BUTTON = Input::C
end
##############
# Scene_Item #
##############
class Scene_Item
alias mog_xasmain main
def main
@xastextime = 0
@xastextime2 = 450
@item_text = Sprite.new
@item_text.bitmap = Bitmap.new(160,100)
@item_text.x = 700
@item_text.y = 0
@item_text.z = 9999
@item_text.bitmap.font.name = "Georgia"
@item_text.bitmap.font.size = 24
@item_text.bitmap.font.bold = true
@item_text.visible = false
@item_text.bitmap.draw_text(0, 0, 140, 64, XAS_WINDOW_ITEM::EQUIPPED,1)
@item_text2 = Sprite.new
@item_text2.bitmap = Bitmap.new(640,64)
@item_text2.x = 0
@item_text2.y = 450
@item_text2.z = 9999
@item_text2.bitmap.font.name = "Georgia"
@item_text2.bitmap.font.size = 24
@item_text2.bitmap.font.bold = true
@item_text2.visible = true
@item_text2.bitmap.draw_text(0, 20, 640, 64,XAS_WINDOW_ITEM::pRESS ,1)
@item_text2.opacity = @xastextime2
mog_xasmain
@item_text.dispose
@item_text2.dispose
end
alias mog_xasupdate update
def update
mog_xasupdate
@xastextime -= 3
@xastextime2 -= 3
@item_text.opacity = @xastextime
@item_text2.opacity = @xastextime2
if @xastextime <= 0
@xastextime = 0
@item_text.visible = false
end
if @xastextime2 <= 0
@xastextime2 = 0
@item_text2.visible = false
end
if @item_text2.y > 400
@item_text2.y -= 3
elsif @item_text2.y <= 400
@item_text2.y = 400
end
if @item_text.x > 480
@item_text.x -= 10
elsif @item_text.x <= 480
@item_text.x = 480
end
end
alias mog_xas_update_item update_item
def update_item
mog_xas_update_item
if Input.trigger?(XAS_WINDOW_ITEM::BUTTON)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
item_id = @item.id
item_tool_id = XAS_WINDOW_ITEM::XASITEM_ID[@item.id]
if item_tool_id != nil
$game_system.se_play($data_system.equip_se)
@item_text.visible = true
@item_text.x = 700
@item_text.opacity = @xastextime
@xastextime = 355
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = item_tool_id
end
end
end
end
module Database_Bullet
action_id = 1
SUFLAGS[action_id] = 22
DURATIONS[action_id] = 22
SELF_MOTIONS[action_id] = "_SWD_01"
plan = []
plan[5] = action_id
ATTACK_ID_PLANS[action_id] = plan
ATTACK_RANGE_TYPES[action_id] = SQUARE
ATTACK_RANGE_PLANS[action_id] = [1]
BLOW_POWERS[action_id] = 1
SELF_ANIMATION_PLANS[action_id] = []
SELF_DAMAGES[action_id] = false
PLAYER_DAMAGES[action_id] = false
IGNORE_INVINCIBLES[action_id] = true
end
module Database_Bullet
action_id = 2
SUFLAGS[action_id] = 20
DURATIONS[action_id] = 20
SELF_MOTIONS[action_id] = "_SHD_01"
ATTACK_ID_PLANS[action_id] = [action_id]
ATTACK_RANGE_TYPES[action_id] = LINE
ATTACK_RANGE_PLANS[action_id] = [1]
BLOW_POWERS[action_id] = 5
SELF_ANIMATION_PLANS[action_id] = []
SELF_DAMAGES[action_id] = false
PLAYER_DAMAGES[action_id] = false
IGNORE_INVINCIBLES[action_id] = false
end


Hud:
#_______________________________________________________________________________
# MOG_MPW ICON V1.0
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# HUD que apresenta o HP e SP em forma de ícones.
#
# É preciso ter as imagens:
# HP_Icon
# HP_Icon_Back
# SP_Icon
# SP_Icon_Back
# Nome_do_Heroi_Face (Opcional)
# Dentro da pasta Graphics/Pictures.
#
# NOTA - O script vai calcular cada ícone pela porcentagem de
# HP ou SP, ou seja, não é porque você toma um ponto de dano
# que você vai perder um ícone de HP (a não ser que seu HP final
# seja igual a quantidade final de ícones.
#
#-------------------------------------------------------------------------------
module MOG
#Posição do HUD.
STMAPX = 0 # X Pos
STMAPY = 0 # Y Pos
#Switch que desativa o HUD.
STMAPVIS = 5
#Quantidade maxima final de ícones para o HP.
MAX_ICON_HP = 20
#Quantidade maxima final de ícones para o SP.
MAX_ICON_SP = 20
#Espaço entre os ícones de HP na horizontal.
HP_ICON_SPACE_X = 20
#Espaço entre os ícones de SP na horizontal.
SP_ICON_SPACE_X = 10
#Espaço entre a primeira linha de ícones com a segunda linha.
#(Somente se a DIV_HP_LINE estiver como true)
HP_ICON_SPACE_Y = 48
#Espaço entre a primeira linha de ícones com a segunda linha.
#(Somente se a DIV_SP_LINE estiver como true)
SP_ICON_SPACE_Y = 64
#Deixar os ìcones de HP em 2 linhas quando o HP
#passar da metade do valor maximo final.
DIV_HP_LINE = true
#Deixar os ìcones de SP em 2 linhas quando o SP
#passar da metade do valor maximo final.
DIV_SP_LINE = false
#Mostrar a condição do personagem.
SHOW_STATES = true
end
$mogscript = {} if $mogscript == nil
$mogscript["mpstelen"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
attr_reader :final_maxhp
attr_reader :final_maxsp
def final_maxhp
return $data_actors[@actor_id].parameters[0,$data_actors[@actor_id].final_level]
end
def final_maxsp
return $data_actors[@actor_id].parameters[1,$data_actors[@actor_id].final_level]
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_maphp2(actor, x, y)
one_icon_hp_max = actor.final_maxhp * MOG::MAX_ICON_HP / actor.final_maxhp
valor = 100 * actor.final_maxhp / 100
valor2 = 100 * actor.hp / 100
valor3 = one_icon_hp_max * valor2 / valor
valor4 = 100 * actor.maxhp / 100
valor5 = one_icon_hp_max * valor4 / valor
valor6 = one_icon_hp_max * valor / valor
now_hp = RPG::Cache.icon("HP_Icon")
now_cw = now_hp.width
now_ch = now_hp.height
now_hp_src_rect = Rect.new(0, 0, now_cw, now_ch)
max_hp = RPG::Cache.icon("HP_Icon_Back")
max_cw = max_hp.width
max_ch = max_hp.height
max_hp_src_rect = Rect.new(0, 0, max_cw, max_ch)
if valor5 < 1
valor5 = 1
end
if valor3 < 1 and actor.hp > 0
valor3 = 1
elsif valor3 <= 0
valor3 = 0
end
if MOG::DIV_HP_LINE == true
div = valor6 / 2
if valor5 < div
for r in 0...valor5
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect)
end
else
for r in 0...div
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect)
end
for r in div...valor5
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::HP_ICON_SPACE_X * div, y - max_ch + MOG::HP_ICON_SPACE_Y, max_hp, max_hp_src_rect)
end
end
else
for r in 0...valor5
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect)
end
end
if MOG::DIV_HP_LINE == true
div2 = valor6 / 2
if valor3 < div2
for i in 0...valor3
x = i * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect)
end
else
for i in 0...div2
x = i * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect)
end
for i in div2...valor3
x = i * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::HP_ICON_SPACE_X * div2, y - now_ch + MOG::HP_ICON_SPACE_Y, now_hp, now_hp_src_rect)
end
end
else
for i in 0...valor3
x = i * MOG::HP_ICON_SPACE
self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect)
end
end
end
def draw_mapsp2(actor, x, y)
one_icon_sp_max = actor.final_maxsp * MOG::MAX_ICON_SP / actor.final_maxsp
valor = 100 * actor.final_maxsp / 100
valor2 = 100 * actor.sp / 100
valor3 = one_icon_sp_max * valor2 / valor
valor4 = 100 * actor.maxsp / 100
valor5 = one_icon_sp_max * valor4 / valor
valor6 = one_icon_sp_max * valor / valor
now_sp = RPG::Cache.icon("SP_Icon")
now_cw = now_sp.width
now_ch = now_sp.height
now_sp_src_rect = Rect.new(0, 0, now_cw, now_ch)
max_sp = RPG::Cache.icon("SP_Icon_Back")
max_cw = max_sp.width
max_ch = max_sp.height
max_sp_src_rect = Rect.new(0, 0, max_cw, max_ch)
if valor5 < 1
valor5 = 1
end
if valor3 < 1 and actor.sp > 0
valor3 = 1
elsif valor3 <= 0
valor3 = 0
end
if MOG::DIV_SP_LINE == true
div = valor6 / 2
if valor5 < div
for r in 0...valor5
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect)
end
else
for r in 0...div
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect)
end
for r in div...valor5
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::SP_ICON_SPACE_X * div, y - max_ch + MOG::SP_ICON_SPACE_Y, max_sp, max_sp_src_rect)
end
end
else
for r in 0...valor5
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect)
end
end
if MOG::DIV_SP_LINE == true
div = valor6 / 2
if valor5 < div
for r in 0...valor3
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect)
end
else
for r in 0...div
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect)
end
for r in div...valor3
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::SP_ICON_SPACE_X * div, y - now_ch + MOG::SP_ICON_SPACE_Y, now_sp, now_sp_src_rect)
end
end
else
for i in 0...valor3
x = i * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect)
end
end
end
def nada
face = RPG::Cache.picture("")
end
def draw_heroface(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_actor_statemap(actor, x, y)
self.contents.font.size = 16
self.contents.font.name = "Georgia"
text = make_battler_state_text(actor, width, true)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 1, y + 1, 120, 32, text,1)
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(x, y, 120, 32, text,1)
end
end
#####################
# Window_Status_Map #
#####################
class Window_Sthero < Window_Base
def initialize
super(0, 0, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.contents.font.bold = true
self.contents.font.size = 20
self.contents.font.name = "Georgia"
self.opacity = 0
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_maphp2(actor,0, 0)
draw_mapsp2(actor, - 50, 50)
draw_heroface(actor, 0, 80)
draw_actor_statemap(actor, 0, 75) if MOG::SHOW_STATES == true
end
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
@sthero = Window_Sthero.new
@sthero.x = MOG::STMAPX
@sthero.y = MOG::STMAPY
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true
else
@sthero.visible = false
end
mog11_main
@sthero.dispose
end
alias mog11_update update
def update
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true
else
@sthero.visible = false
end
if $game_player.wref == true
@sthero.refresh
$game_player.wref = false
end
mog11_update
end
end
##############
# Game_Party #
###############
class Game_Party
alias mog11_check_map_slip_damage check_map_slip_damage
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
$game_player.wref = true
end
end
mog11_check_map_slip_damage
end
end
###############
# Interpreter #
###############
class Interpreter
alias mog11_command_311 command_311
def command_311
mog11_command_311
$game_player.wref = true
end
alias mog11_command_312 command_312
def command_312
mog11_command_312
$game_player.wref = true
end
alias mog11_command_313 command_313
def command_313
mog11_command_313
$game_player.wref = true
end
alias mog11_command_314 command_314
def command_314
mog11_command_314
$game_player.wref = true
end
alias mog11_command_315 command_315
def command_315
mog11_command_315
$game_player.wref = true
end
end
################
# Game_Battler #
################
class Game_Battler
alias mog11_attack_effect attack_effect
def attack_effect(attacker)
mog11_attack_effect(attacker)
$game_player.wref = true
end
alias mog11_skill_effect skill_effect
def skill_effect(user, skill)
mog11_skill_effect(user, skill)
$game_player.wref = true
end
alias mog11_item_effect item_effect
def item_effect(item)
mog11_item_effect(item)
$game_player.wref = true
end
alias mog11_add_state add_state
def add_state(state_id, force = false)
mog11_add_state(state_id, force = false)
$game_player.wref = true
end
end

Instrucciones:
Pegas los dos scripts sobre main y listo
PD: necesitas recursos del chara atacando y debilitado
 

.//Arcanie

Banneado
Mensajes
244
Reacciones
0
Puntos
0
Ubicación
Ishbal
Juego estilo zelda :
Script XMS:
################################################################################
################################### XMS ########################################
################################################################################
=begin
MODULO XRXS
Scripts necessários para rodar alguns scripts do site XMS.
By Xiderowg (XMS)
http://xms.rdy.jp/

L4 - built 122410 - Window Selectable
L5 - built 091221 - Elemment %
L6 - built 092308 - Elemment Set
L7 - built ?????? - Window Command
L10 - built ?????? - Window Selectable
L13 - built ?????? - Map Name
L14 - built 122012 - Sprite and Picture
(05/01/06)
=end
################################################################################

module XRXS_Cursor2
def initialize(x, y, w, h)
super(x, y, w, h)
@xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
@xrxsc2_window.opacity = 0
@xrxsc2_window.active = false
@xrxsc2_window.index = -1
end
def index2
return @xrxsc2_window.index
end
def index2=(index)
@xrxsc2_window.index = index
if index == -1
@xrxsc2_window.cursor_rect.empty
else
@xrxsc2_window.x = self.x
@xrxsc2_window.y = self.y
@xrxsc2_window.cursor_rect = self.cursor_rect
end
end
def top_row=(row)
super
pre_oy = @xrxsc2_window.oy
@xrxsc2_window.oy = self.oy
@xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
end
def dispose
@xrxsc2_window.dispose
super
end
def x=(n)
super
@xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
end
def y=(n)
super
@xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
end
def visible=(b)
@xrxsc2_window.visible = b
super
end
end
######
# L5 #
######
module XRXS
def XRXS.element_check(set, element_name)
returnar = [false, 0, 0, []]
return returnar if !set.is_a?(Array) or set.size == 0 or element_name == ""
for i in set
if $data_system.elements =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
returnar[3].push($1.to_i)
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
def XRXS.element_include?(set, element_name)
return element_check(set, element_name)[0]
end
def XRXS.element_amount(set, element_name)
return element_check(set, element_name)[1]
end
def XRXS.element_percent(set, element_name)
return element_check(set, element_name)[2]
end
def XRXS.element_numbers(set, element_name)
return element_check(set, element_name)[3]
end
end
######
# L6 #
######
class Game_Battler
def skill_element_set(skill)
return skill.nil? ? [] : skill.element_set
end
def equip_element_set
return self.element_set + self.guard_element_set
end
def guard_element_set
return []
end
end
class Game_Actor < Game_Battler
def guard_element_set
set = []
for id in self.armor_ids
next if id.nil?
armor = $data_armors[id]
set += (armor != nil ? armor.guard_element_set : [])
end
return set
end
def weapon_ids
unless self.is_a?(Game_Actor)
return []
end
ids = @weapon_ids != nil ? @weapon_ids : []
ids[0] = @weapon_id
return ids
end
def armor_ids
unless self.is_a?(Game_Actor)
return []
end
ids = @armor_ids != nil ? @armor_ids : []
ids[0] = @armor1_id
ids[1] = @armor2_id
ids[2] = @armor3_id
ids[3] = @armor4_id
return ids
end
def equipments
equipments = []
self.weapon_ids.each {|id| equipments.push($data_weapons[id])}
self.armor_ids.each {|id| equipments.push($data_armors[id])}
return equipments
end
def equiping?(item)
case item
when RPG::Weapon
return self.weapon_ids.include?(item.id)
when RPG::Armor
return self.armor_ids.include?(item.id)
else
return false
end
end
end
######
# L7 #
######
module XRXS_Window_Command
def add_command(command)
@disabled = [] if @disabled.nil?
if @commands.size != @disabled.size
for i in [email protected]
@disabled = false
end
end
@commands.push(command)
@disabled.push(false)
@item_max = @commands.size
self.y -= 32
self.height += 32
self.contents.dispose
self.contents = nil
self.contents = Bitmap.new(self.width - 32, @item_max * 32)
refresh
for i in [email protected]
if @disabled
disable_item(i)
end
end
end
def disable_item(index)
@disabled = [] if @disabled.nil?
@disabled[index] = true
draw_item(index, disabled_color)
end
def enable_item(index)
@disabled = [] if @disabled.nil?
@disabled[index] = false
draw_item(index, normal_color)
end
end
class Window_Command < Window_Selectable
include XRXS_Window_Command
def disable_item(index)
super
end
end
#######
# L1s0 #
#######
module Module_SelectableEX
def line_height
return 32
end
attr_accessor :align
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
@align = 0
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, self.line_height * index, self.contents.width - 8, self.line_height)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], self.align)
end
def top_row
return self.oy / self.line_height
end
def top_row=(row)
super
self.oy = self.oy/32 * self.line_height
end
def page_row_max
return (self.height - 32) / self.line_height
end
def update_cursor_rect
super
unless @index < 0
y = (self.cursor_rect.y + self.oy) * self.line_height/32 - self.oy
self.cursor_rect.set(0, y, self.cursor_rect.width, self.line_height)
end
end
end
class Window_Command < Window_Selectable
include Module_SelectableEX
def line_height
return 32
end
def initialize(width, commands)
super(0, 0, width, commands.size * self.line_height + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * self.line_height)
refresh
self.index = 0
end
def draw_item(index, color)
super
end
end
#######
# L13 #
#######
class Game_Map
def name
$data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil?
$data_mapinfos[@map_id].name
end
end
#######
# L14 #
#######
class Bitmap
def draw_hemming_text(x, y, w, h, text, align = 0)
original_color = self.font.color.dup
self.font.color = Color.new(0,0,0,255)
self.draw_text(x , y , w, h, text, align)
self.draw_text(x , y+2, w, h, text, align)
self.draw_text(x+2, y+2, w, h, text, align)
self.draw_text(x+2, y , w, h, text, align)
self.font.color = original_color
self.draw_text(x+1, y+1, w, h, text, align)
end
end
module RPG_FileTest
def RPG_FileTest.character_exist?(filename)
return RPG::Cache.character(filename, 0) rescue return false
end
def RPG_FileTest.picture_exist?(filename)
return RPG::Cache.picture(filename) rescue return false
end
def RPG_FileTest.battler_exist?(filename)
return RPG::Cache.battler(filename, 0) rescue return false
end
end
class Sprite_Number < Sprite
attr_reader :w
def initialize(font = Font.new)
super()
self.bitmap = Bitmap.new(1,1)
self.bitmap.font = font
max = s = 0
for i in 0..9
s = self.bitmap.text_size(i.to_s).width
max = s if max < s
end
@w = max + 2
@h = font.size + 2
self.bitmap.dispose
self.bitmap = Bitmap.new(@w, @h * 10)
self.bitmap.font = font
(0..9).each {|n| self.bitmap.draw_hemming_text(0, @h * n, @w, @h, n.to_s) }
self.src_rect.height /= 10
end
def number=(n)
self.src_rect.y = n * @h
end
def n=(n)
self.number = n
end
end
class Spriteset_Numbers
attr_reader :x
attr_reader :y
attr_reader :z
attr_reader :visible
def initialize(font = Font.new)
@font = font
@numbers = []
@x = 0
@y = 0
@z = 0
@visible = true
end
def number=(n)
@numbers.each{|number| number.n = 10 }
d = (n == 0 ? 0 : Math.log10(n).to_i)
for i in 0..d
@numbers = Sprite_Number.new(@font) if @numbers == nil
@numbers.n = n % 10
@numbers.visible = true
n /= 10
end
self.x = self.x
self.y = self.y
self.z = self.z
end
def n=(n)
self.number=(n)
end
def x=(n)
@x = n
for i in [email protected]
@numbers.x = n
n -= @numbers.w
end
end
def y=(n)
@y = n
@numbers.each{|sprite| sprite.y = @y }
end
def z=(n)
@z = n
@numbers.each{|sprite| sprite.z = @z }
end
def visible=(b)
@visible = b
@numbers.each{|sprite| sprite.visible = b }
end
def dispose
@numbers.each{|sprite| sprite.dispose }
end
end
#===============================================================================
# ---> XIDEROWG ACTION SYSTEM) <---
# (XRXS64 Self Action System)
#===============================================================================
# By Xiderowg (XMS)
# http://xms.rdy.jp/
#===============================================================================
# Unofficial Hero Features by Moghunter
#===============================================================================
# XAS - System Config
#===============================================================================
module XAS_BA
# Definição do Som quando o herói receber dano
HERO_HIT_SE = RPG::AudioFile.new("Mana - Duran_Hit", 100, 100)
#-------------------------------------------------------------------------------
# Definição especifica da animação de dano da ferramenta.
# ATTACK_ANI_HIT = {A=>B,A=>B...}
# A = Ferramenta ID.
# B = Animation ID.
ATTACK_ANI_HIT = {
1=>14
}
#-------------------------------------------------------------------------------
# Definição padrão animação de dano, quando não especificado.
DEFAULT_ATTACK_ANI_HIT = 4
#-------------------------------------------------------------------------------
# Definição das skills que farão tremer a tela no momento do HIT.
# (Coloque o ID da Ferramenta)
ATTACK_SKILL_SHAKE = []
#-------------------------------------------------------------------------------
# Definição do tremor.
SH_POWER = 5 #Poder (Força)
SH_SPEED = 10 #Velocidade
SH_DUR = 20 #Duração(20 = 1 segundo)
#-------------------------------------------------------------------------------
# Ativar JUMP HIT, player dá um pulo quando recebe o dano.
JUMP_HIT_HERO = true
#-------------------------------------------------------------------------------
# Definição dos inimigos que não terão a animação Jump
# ao receberem dano.
JUMP_HIT_ENEMY_DISABLE = []
#-------------------------------------------------------------------------------
# Definição da ID da variável que definirá a área de
# ativação da ação.
SENSOR_VAR = 10
#-------------------------------------------------------------------------------
# Definição de qual ferramenta será
# ativada quando equipar a arma.
#
# WEP_ID_TOOL = { A=>B, A=>B, ...}
#
# A = ID da Arma.
# B = ID da Ferramenta.
WEP_ID_TOOL = {
1=>1
}
#-------------------------------------------------------------------------------
# Definição do equipamento secundário
# que no caso é a função ESCUDO(SHIELD)
#
# SECOND_HAND_ID_TOOL = { A=>B, A=>B, ...}
# A=>B
#
# A = ID da armadura(Função escudo).
# B = ID da ferramenta.
SECOND_HAND_ID_TOOL = {
1=>34
}
#-------------------------------------------------------------------------------
# Ativar Gameover automático ao ser derrotado.
AUTOGAMEOVER = true
#-------------------------------------------------------------------------------
# ID da switch que será ativada quando o herói morrer.
# (Somente quando a opção AUTOGAMEOVER estiver em False)
GAMEOVER_SWITCH_ID = 4
#-------------------------------------------------------------------------------
# Fazer o Battler Piscar após receber dano.
# (O tempo de piscar é igual ao tempo de invencibilidade.)
BLINK_ON = false
#-------------------------------------------------------------------------------
# Tempo de invencibilidade após receber o dano.
INVICIBLE_DURATION_HERO = 35
#-------------------------------------------------------------------------------
# Tempo em que o herói ficará paralisado após receber o dano.
KNOCK_BACK_DURATION_HERO = 30
#-------------------------------------------------------------------------------
# Tempo padrão de invencibilidade e paralisia do inimigo
# após receber o dano.
DEFAULT_INVICIBLE_DURATION_ENEMY = 60
#-------------------------------------------------------------------------------
# Tempo especifico em que o inimigo ficará parado e invencível
# após receber o dano.
#
# A=>B
#
# A = ID do inimigo (Tropas inimigos).
# B = Tempo de invencibilidade.
INVICIBLE_DURATION_ENEMY = {
1=>45
}
#-------------------------------------------------------------------------------
# Velocidade do recuo do battler após receber o dano.
# (Herói e Inimigo)
KNOCK_BACK_SPEED = 5
#-------------------------------------------------------------------------------
# Definição da ME quando fizer Level UP.
LEVEL_UP_ME = RPG::AudioFile.new("007-Fanfare01")
#-------------------------------------------------------------------------------
# Definição da SE ao pegar o item do inimigo no chão.
ITEMDROP_SE = RPG::AudioFile.new("056-Right02", 70, 140)
#-------------------------------------------------------------------------------
# Definição da SE quando for ativada a função Shield.
SHIELD_SE = RPG::AudioFile.new("097-Attack09", 80, 150)
#-------------------------------------------------------------------------------
# Definição do Texto quando for ativada a função Shield.
SHIELD_TEXT = "Guard"
#-------------------------------------------------------------------------------
# Definição da animação ID quando for ativada a função Shield.
SHIELD_ANI = 64
#-------------------------------------------------------------------------------
end
#===============================================================================
# XAS - Item Config
#===============================================================================
module XAS
# Definição das ferramentas que correspondem os itens
# no banco de dados.
#
# A=>B
#
# A = ID da ferramenta.
# B = ID do item no banco de dados.
ITEM_COST = {}
end
#===============================================================================
# XAS - Enemy Config
#===============================================================================
module XAS_BA_ENEMY
# Ativar Animação do inimigo ao morrer.
# A duração da animação é proporcional ao tempo
# do colapso, por default é 40Frames(2s).
# DEF_ANI = {A=>B, A=>B, A=>B...}
# A = ID do inimigo.
# B = ID da animação.
DEF_ANI = {1=>119}
#-------------------------------------------------------------------------------
# Definição do inimigo que terá um dos lados invulnerável.
#
# A=>
#
# A = ID do Inimigo
# B = Direção que o inimigo ficará invulnerável.
#
#(2 = Defesa Frontal.)
#(4 = Defesa Esquerda.)
#(6 = Defesa Direita.)
#(8 = Defesa nas costas.)
SHILED_DIRECTIONS = {}
#-------------------------------------------------------------------------------
# Definição de quais tipos de ferramentas(Habilidades) o
# inimigo será invulnerável.
#
# A=>[B,B,B,B,B,B...]
#
# A = ID do inimigo.
# B = ID da ferramenta que não terá efeito no inimigo.
SHILED_ACTIONS = {}
#-------------------------------------------------------------------------------
# Definição dos inimigos que terão o recuo desativado.
KNOCK_BACK_DISABLES = []
#-------------------------------------------------------------------------------
# Definição do tamanho extra(Área) do inimigo, ou seja, define a
# área de impacto do inimigo.
#
# BODY_SQUARE = {A=>B, A=>B, A=>B...}
#
# A = ID do inimigo.
# B = Valor do tamanho extra do inimigo.
BODY_SQUARE = {}
#-------------------------------------------------------------------------------
# Ativação automática de Switchs quando o inimigo morre.
#
# A=>B
#
# A = ID do inimigo.
# B = ID da switch que será ativada quando o inimigo morrer.
DEFEAT_SWITCH_IDS = {}
end
#===============================================================================
# XAS - (Y) Botão de Habilidade e Item.
#===============================================================================
module XRXS64
# Definição do botão que ativará a ferramenta.
ACTION_BUTTON = Input::Y
# Definição da variável que ficará registrado a
# ID da ferramenta do botão Y.
ACTION_VARIABLE_ID = 2
end
#===============================================================================
# XAS - (C) Botão de Ataque.
#===============================================================================
module XAS_CS
# Definição do botão que ativará a ferramenta arma.
SLASH_BUTTON = Input::C
# Definição da variável que ficará registrado a
# ID da ferramenta do botão C.
SLASH_VARIABLE_ID = 1
end
#===============================================================================
# XAS - (Z) Button Action
#===============================================================================
module XAS_Z
# Definição do botão que trocará as ferramentas ativas.
ACTION_CHANGE_BUTTON = Input::Z #Função Desativada(SORA ED)
# Definição da variável que ficará registrado a
# ID da ferramenta SKILL.
ACTION_VARIABLE_ID = 2
# Definição dos ícones que representam as ferramentas.
ACTION_ICON = {}
# Swtich que desativa a janela de ferramentas.
SWITCH_ID = 5
# Posição da janela de ferramentas na horizontal.
X = 246
# Posição da janela de ferramentas na vertical.
Y = 390
end
#===============================================================================
# XAS - Customização de Mapa de Ferramenta.
#===============================================================================
module XAS
# ID da variável de impacto de Ferramentas.
HIT_ID = 3
# ID do mapa onde fica ficarão os eventos de ferramentas.
ACTION_TEMPLATE_MAP_ID = 1
end
#===============================================================================
# XAS - Customizações gerais de evento.
#===============================================================================
module XAS_BA
# Variável que define a ID do inimigo.
ENEMY_ID_VARIABLE_ID = 4
# Sensor que Define a página de ação do inimigo.
SENSOR_SELF_SWITCH = "D"
# Definição da variável que registrará a
# quantidade de inimigos derrotados.
DEFEAT_NUMBER_ID = 999
end
#===============================================================================
# XAS EX - SYSTEM (XRXS64 Self Action System)
#===============================================================================
$xrxs = {} if $xrxs == nil
$xrxs["xas"] = true
$mogscript = {} if $mogscript == nil
################
# RPG_FileTest #
################
module RPG_FileTest
def RPG_FileTest.character_exist?(filename)
return RPG::Cache.character(filename, 0) rescue return false
end
def RPG_FileTest.picture_exist?(filename)
return RPG::Cache.picture(filename) rescue return false
end
def RPG_FileTest.battler_exist?(filename)
return RPG::Cache.battler(filename, 0) rescue return false
end
end
#################
# Sprite_Number #
#################
class Sprite_Number < Sprite
attr_reader :w
def initialize(font = Font.new)
super()
self.bitmap = Bitmap.new(1,1)
self.bitmap.font = font
max = s = 0
for i in 0..9
s = self.bitmap.text_size(i.to_s).width
max = s if max < s
end
@w = max + 2
@h = font.size + 2
self.bitmap.dispose
self.bitmap = Bitmap.new(@w, @h * 10)
self.bitmap.font = font
(0..9).each {|n| self.bitmap.draw_hemming_text(0, @h * n, @w, @h, n.to_s) }
self.src_rect.height /= 10
end
def number=(n)
self.src_rect.y = n * @h
end
def n=(n)
self.number = n
end
end
class Spriteset_Numbers
attr_reader :x
attr_reader :y
attr_reader :z
attr_reader :visible
def initialize(font = Font.new)
@font = font
@numbers = []
@x = 0
@y = 0
@z = 0
@visible = true
end
def number=(n)
@numbers.each{|number| number.n = 10 }
d = (n == 0 ? 0 : Math.log10(n).to_i)
for i in 0..d
@numbers = Sprite_Number.new(@font) if @numbers == nil
@numbers.n = n % 10
@numbers.visible = true
n /= 10
end
self.x = self.x
self.y = self.y
self.z = self.z
end
def n=(n)
self.number=(n)
end
def x=(n)
@x = n
for i in [email protected]
@numbers.x = n
n -= @numbers.w
end
end
def y=(n)
@y = n
@numbers.each{|sprite| sprite.y = @y }
end
def z=(n)
@z = n
@numbers.each{|sprite| sprite.z = @z }
end
def visible=(b)
@visible = b
@numbers.each{|sprite| sprite.visible = b }
end
def dispose
@numbers.each{|sprite| sprite.dispose }
end
end
#########
# Lib15 #
#########
class Game_Map
attr_accessor :need_refresh_token
def need_add_tokens
@need_add_tokens = [] if @need_add_tokens == nil
return @need_add_tokens
end
def need_remove_tokens
@need_remove_tokens = [] if @need_remove_tokens == nil
return @need_remove_tokens
end
def add_token(token_event)
@events[token_event.id] = token_event
self.need_add_tokens.push(token_event)
self.need_refresh_token = true
end
def remove_token(token_event)
@events.delete(token_event.id)
self.need_remove_tokens.push(token_event)
self.need_refresh_token = true
end
def clear_tokens
for event in @events.values.dup
remove_token(event) if event.is_a?(Token_Event)
end
channels = ["A", "B", "C", "D"]
for id in 1001..(token_id_shift - 1)
for a in channels
key = [self.map_id, id, a]
$game_self_switches.delete(key)
end
end
clear_token_id
end
end
class Game_SelfSwitches
def delete(key)
@data.delete(key)
end
end
class Game_Map
def token_id_shift
@token_id = 1000 if @token_id == nil
@token_id += 1
return @token_id
end
def clear_token_id
@token_id = nil
end
end
module XRXS_CTS_RefreshToken
def refresh_token
for event in $game_map.need_add_tokens
@character_sprites.push(Sprite_Character.new(@viewport1, event))
end
$game_map.need_add_tokens.clear
for sprite in @character_sprites.dup
if $game_map.need_remove_tokens.empty?
break
end
if $game_map.need_remove_tokens.delete(sprite.character)
@character_sprites.delete(sprite)
sprite.dispose
end
end
$game_map.need_refresh_token = false
end
end
class Spriteset_Map
include XRXS_CTS_RefreshToken
alias xrxs_lib15_update update
def update
xrxs_lib15_update
refresh_token if $game_map.need_refresh_token
end
end
class Scene_Map
alias xrxs_lib15_transfer_player transfer_player
def transfer_player
$game_map.clear_tokens
xrxs_lib15_transfer_player
end
end
class Token_Event < Game_Event
def initialize(map_id, event)
event.id = $game_map.token_id_shift
#
@multi = 0
#
super
end
def erase
super
$game_map.remove_token(self)
end
end
##############
# Token Mech #
##############
module XRXS_ActionTemplate
map_id = XAS::ACTION_TEMPLATE_MAP_ID
map = load_data(sprintf("Data/Map%03d.rxdata", map_id))
@@events = map.events
end
class Token_Event < Game_Event
include XRXS_ActionTemplate
end
class Game_Temp
attr_accessor :active_token
end
module XAS_ACTION
attr_reader :action
attr_reader :erased
def shoot(action_id)
return if action_id == 0
item_id = XAS::ITEM_COST[action_id]
if item_id != nil and $game_party.item_number(item_id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
self.action_attachment(action_id)
n = 1
@action.prelag = n
skill_id = action_id
skill = skill_id == nil ? nil : $data_skills[skill_id]
sp_cost = skill.sp_cost
if self.battler.sp < sp_cost
m = 1
else
m = Database_Bullet::SUFLAGS[action_id].to_i
end
@action.duration = m
end
def action_attachment(action_id)
@action = Game_Action.new(self, action_id)
@action.attachment(action_id)
plan = Database_Bullet::SELF_ANIMATION_PLANS[action_id]
@self_animation_plan = plan.nil? ? nil : plan.dup

end
def action_update
return unless @action.is_a?(Game_Action)
if @self_motion != nil
self.character_name_suffix = @self_motion
@pattern = 0
@pattern_count = 0
@self_motion = nil
if self.is_a?(Game_Player)
@step_anime = true
end
end
if @self_animation_plan != nil
animation_id = @self_animation_plan[@action.now_count]
self.animation_id = animation_id unless animation_id.nil?
end
if @action.prelag > 0
@action.prelag -= 1
self.shoot_bullet(@action.id) if @action.prelag == 0
return
end
@action.update
end
def check_event_trigger_attack()
if $game_system.map_interpreter.running?
return
end
if @action.nil? or @action.attack_id == 0
return
end
hit_check = false
range = @action.attack_range
hit = []
targets = [$game_player] + (@action.player_damage ? [] : $game_map.events.values)
for event in targets
next if event == self or
@action.hit_events.include?(event) or
event.jumping? or event.erased
body_size = event.body_size
event_center_x = event.x
event_center_y = event.y - body_size
dx = event_center_x - self.x
dy = event_center_y - self.y
dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min)
dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min)
case @action.attack_range_type
when Map::RHOMBUS
hit_check = (dx.abs + dy.abs <= range)
when Map::SQUARE
hit_check = (dx.abs <= range and dy.abs <= range)
when Map::LINE
case self.direction
when 2
hit_check = (dx == 0 and dy >= 0 and dy <= range)
when 8
hit_check = (dx == 0 and dy <= 0 and dy >= -range)
when 6
hit_check = (dy == 0 and dx >= 0 and dx <= range)
when 4
hit_check = (dy == 0 and dx <= 0 and dx >= -range)
end
end
hit.push(event) if hit_check
hit_check = false
end
for event in hit
if event.action_effect(self, self.action.attack_id)
hit_check = true
end
@action.hit_events.push(event)
end
if hit_check
$game_temp.active_token = self
end
end
def action_effect(attacker, attack_id)
return false unless self.is_a?(Game_Event)
for page in @event.pages
if page.condition.variable_valid and
page.condition.variable_id == XAS::HIT_ID and
page.condition.variable_value == attack_id
self.reaction_valid_attack_id = attack_id
self.refresh
@trigger = 0
self.start
return true
end
end
return false
end
def shoot_bullet(action_id)
return false if action_id == 0
item_id = XAS::ITEM_COST[action_id]
if item_id != nil
$game_party.lose_item(item_id, 1)
if $mogscript["mpequip"] == true
$eref = true
end
end
bullet_token = Token_Bullet.new(self, action_id)
$game_map.add_token(bullet_token)
@self_motion = Database_Bullet::SELF_MOTIONS[action_id]
return bullet_token
end
def body_size
return 0
end
def action_clear
@action = nil
self.character_name_suffix = nil
end
end
class Game_Character
include XAS_ACTION
end
module XAS_Dispose
def update
action_update
super
if @action.is_a?(Game_Action) and @action.done?
self.action_clear
if self.is_a?(Game_Player)
@step_anime = false
end
end
end
end
class Game_Player < Game_Character
include XAS_Dispose
end
class Game_Event < Game_Character
include XAS_Dispose
end
module XAS_CharacterName_Suffix
def character_name
character_name = super
file_name = character_name + self.character_name_suffix.to_s
character_name = file_name if RPG_FileTest.character_exist?(file_name)
return character_name
end
attr_accessor :character_name_suffix
end
class Game_Player < Game_Character
include XAS_CharacterName_Suffix
end
class Game_Event < Game_Character
include XAS_CharacterName_Suffix
end
module XAS_StopToAction
def acting?
return self.action != nil
end
def moving?
return (super or self.acting?)
end
end
class Game_Player < Game_Character
include XAS_StopToAction
end
class Interpreter
alias xrxs64_command_end command_end
def command_end
@list = nil
event = $game_map.events[@event_id]
return if event == nil
if event.reaction_valid_attack_id
event.reaction_valid_attack_id = nil
event.refresh
end
xrxs64_command_end
end
end
class Game_Event < Game_Character
attr_accessor :reaction_valid_attack_id
def refresh
new_page = nil
unless @erased
for page in @event.pages.reverse
c = page.condition
if c.switch1_valid
if $game_switches[c.switch1_id] == false
next
end
end
if c.switch2_valid
if $game_switches[c.switch2_id] == false
next
end
end
if c.variable_valid
if c.variable_id == XAS::HIT_ID and
c.variable_value == self.reaction_valid_attack_id
elsif $game_variables[c.variable_id] < c.variable_value
next
end
end
if c.self_switch_valid
key = [@map_id, @event.id, c.self_switch_ch]
if $game_self_switches[key] != true
next
end
end
new_page = page
break
end
end
if new_page == @page
return
end
@page = new_page
clear_starting
if @page == nil
@tile_id = 0
@character_name = ""
@character_hue = 0
@move_type = 0
@through = true
@trigger = nil
@list = nil
@interpreter = nil
return
end
@tile_id = @page.graphic.tile_id
@character_name = @page.graphic.character_name
@character_hue = @page.graphic.character_hue
if @original_direction != @page.graphic.direction
@direction = @page.graphic.direction
@original_direction = @direction
@prelock_direction = 0
end
if @original_pattern != @page.graphic.pattern
@pattern = @page.graphic.pattern
@original_pattern = @pattern
end
@opacity = @page.graphic.opacity
@blend_type = @page.graphic.blend_type
@move_type = @page.move_type
@move_speed = @page.move_speed
@move_frequency = @page.move_frequency
@move_route = @page.move_route
@move_route_index = 0
@move_route_forcing = false
@walk_anime = @page.walk_anime
@step_anime = @page.step_anime
@direction_fix = @page.direction_fix
@through = @page.through
@always_on_top = @page.always_on_top
@trigger = @page.trigger
@list = @page.list
@interpreter = nil
if @trigger == 4
@interpreter = Interpreter.new
end
check_event_trigger_auto
end
end
class Game_Action
attr_reader :id
attr_accessor :prelag
attr_accessor :attack_id
attr_reader :attack_range
attr_reader :attack_range_type
attr_accessor :user
attr_reader :hit_events
attr_accessor :now_count
attr_reader :final_mark
attr_accessor :duration
attr_reader :blow_power
attr_reader :piercing
attr_reader :player_damage
attr_reader :ignore_invincible
def initialize(user, action_id)
@user = user
@id = action_id
@prelag = 0
@now_count = 0
@duration = nil
@attack_id = 0
@attack_range= 0
@hit_events = []
@blow_power = 0
end
def attachment(action_id)
@duration = Database_Bullet::DURATIONS[action_id]
power = Database_Bullet::BLOW_POWERS[action_id]
@blow_power = power == nil ? 1 : power
@attack_id_plan = Database_Bullet::ATTACK_ID_PLANS[action_id]
@attack_range_type = Database_Bullet::ATTACK_RANGE_TYPES[action_id]
plan = Database_Bullet::ATTACK_RANGE_PLANS[action_id]
@attack_range_plan = plan.nil? ? nil : plan.dup
@self_damage = Database_Bullet::SELF_DAMAGES[self.id]
@player_damage = Database_Bullet::pLAYER_DAMAGES[action_id]
@ignore_invincible = Database_Bullet::IGNORE_INVINCIBLES[action_id]
end
def update
if @attack_id_plan != nil
id = @attack_id_plan[@now_count]
unless id.nil?
@attack_id = id
@hit_events.clear
@hit_events.push(self.user) unless @self_damage
end
end
if @attack_range_plan != nil
range = @attack_range_plan[@now_count]
@attack_range = range unless range.nil?
end
@now_count += 1
end
def done?
return (self.duration.to_i > 0 and self.now_count >= self.duration)
end
end
class Token_Bullet < Token_Event
def initialize(user, action_id)
original_event = @@events[action_id]
return if original_event == nil
event = original_event.dup
event.x = user.x
event.y = user.y
event.pages[0].graphic.direction = user.direction
@character_name = event.pages[0].graphic
super($game_map.map_id, event)
self.action_attachment(action_id)
@action.user = user
@remain_for_an_act = @action.duration.is_a?(Numeric)
end
def update
super
erase if @action == nil and @remain_for_an_act
check_event_trigger_attack
end
end
module Map
RHOMBUS = 1
SQUARE = 2
LINE = 3
end
module Database_Bullet
include Map
EVENTS = []
EVENT_IDS = []
DURATIONS = []
PRELAGS = []
SUFLAGS = []
FINALIZE_MARKS = []
ATTACK_ID_PLANS = []
ATTACK_RANGE_TYPES = []
ATTACK_RANGE_PLANS = []
BLOW_POWERS = []
SELF_MOTIONS = []
SELF_ANIMATION_PLANS = []
PIERCINGS = []
SELF_DAMAGES = []
PLAYER_DAMAGES = []
IGNORE_INVINCIBLES = []
end
#===============================================================================
# XAS - Character damage pop mechanism
#===============================================================================
module XRXS_DAMAGE_OFFSET
def update
super
@damage_sprites = [] if @damage_sprites.nil?
for damage_sprite in @damage_sprites
damage_sprite.x = self.x
damage_sprite.y = self.y
end
end
end
class Sprite_Character < RPG::Sprite
include XRXS_DAMAGE_OFFSET
end
class Game_Character
attr_accessor :collapse_duration
attr_accessor :battler_visible
attr_writer :eek:pacity
attr_accessor :collapse_done
end
module XRXS_CharacterDamagePop
def update
super
if @battler == nil
return
end
if @character.collapse_duration != nil
if @character.collapse_duration > 0
collapse
end
@_collapse_duration = @character.collapse_duration
end
@battler_visible = @character.battler_visible
@battler_visible = true if @battler_visible == nil
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
unless @battler_visible
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
appear
@battler_visible = true
end
end
if @battler_visible
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
else
$game_system.se_play($data_system.actor_collapse_se)
end
collapse
@battler_visible = false
end
else
if @_collapse_duration > 0
@_collapse_duration -= 1
@character.opacity = 256 - (48 - @_collapse_duration) * 6
if @_collapse_duration == 0
@character.collapse_done = true
end
end
end
@character.collapse_duration = @_collapse_duration
@character.battler_visible = @battler_visible
end
end
class Sprite_Character < RPG::Sprite
include XRXS_CharacterDamagePop
end
########################
# Action Battle System #
########################
class Game_Event < Game_Character
def enemy_defeat_process(enemy)
last_level = $game_player.battler.level
$game_party.gain_exp(enemy.exp)
$game_party.gain_gold(enemy.gold)
if last_level < $game_player.battler.level
$game_system.me_play(XAS_BA::LEVEL_UP_ME)
$game_player.battler.damage = "Level up!"
$game_player.battler.damage_pop = true
$game_player.need_refresh = true
end
id = XAS_BA::DEFEAT_NUMBER_ID
$game_variables[id] += 1 if id != 0
switch_id = XAS_BA_ENEMY::DEFEAT_SWITCH_IDS[self.enemy_id]
if switch_id != nil
$game_switches[switch_id] = true
$game_map.refresh
end
end
end
class Game_Party
def gain_exp(exp)
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.cant_get_exp? == false
actor.exp += exp
end
end
end
end
class Game_Player < Game_Character
attr_accessor :need_refresh
end
module XAS_BA_BULLET_SP_COST
def shoot_bullet(action_id)
skill_id = action_id
skill = skill_id == nil ? nil : $data_skills[skill_id]
if skill != nil
sp_cost = skill.sp_cost
if self.battler.sp < sp_cost
$game_system.se_play($data_system.buzzer_se)
return false
end
self.battler.sp -= sp_cost
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
self.need_refresh = true
end
return super
end
end
class Game_Player < Game_Character
include XAS_BA_BULLET_SP_COST
end
module XRXS_EnemySensor
def update_sensor
distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs
enable = (distance <= $game_variables[XAS_BA::SENSOR_VAR])
key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
last_enable = $game_self_switches[key]
last_enable = false if last_enable == nil
if enable != last_enable
$game_self_switches[key] = enable
$game_map.need_refresh = true
end
end
end
class Game_Event < Game_Character
include XRXS_EnemySensor
end
class Game_Character
attr_writer :eek:pacity
end
module XRXS_BattlerAttachment
def attack_effect(attacker)
return super if self.battler.nil? or attacker.nil?
result = (not self.battler.dead? and self.battler.hiblink_duration.to_i <= 0)
if result
$game_temp.in_battle = true
self.battler.attack_effect(attacker.battler)
self.battler.damage_pop = true
$game_temp.in_battle = false
if self.battler.damage.to_i > 0
self.blow(attacker.direction, 1)
end
self.battler.hiblink_duration = self.damage_hiblink_duration
if self.is_a?(Game_Player)
self.need_refresh = true
end
end
@xrxs64c_defeat_done = false if @xrxs64c_defeat_done == nil
if not @xrxs64c_defeat_done and self.battler.dead?
defeat_process
@xrxs64c_defeat_done = true
end
end
def action_effect(bullet, action_id)
return super if self.battler.nil?
if self.battler.hiblink_duration.to_i > 0 and
not bullet.action.ignore_invincible
return false
end
skill_id = action_id
return if skill_id == nil
user = bullet.action.user
attacker = (user == nil ? nil : user.battler)
result = (user != nil and not self.battler.dead?)
skill_id = action_id
dirset = [2,6,8,4]
dir_index = (dirset.index(bullet.direction) + 2) % 4
shield = self.shield_actions.include?(action_id)
for direction in self.shield_directions
dir_index2 = (dirset.index(self.direction) + dirset.index(direction)) % 4
shield |= dirset[dir_index2] == dirset[dir_index]
end
if shield
if user.is_a?(Game_Player)
self.battler.damage = XAS_BA::SHIELD_TEXT
self.battler.damage_pop = true
$game_system.se_play(XAS_BA::SHIELD_SE)
user.blow(dirset[dir_index])
self.animation_id = XAS_BA::SHIELD_ANI
end
super
return true
end
if result
skill = $data_skills[skill_id]
if skill_id == 2 and $game_switches[120]

skill = skill.dup
skill.power = 8
end
$game_temp.in_battle = true
self.battler.skill_effect(attacker, skill)
self.battler.damage_pop = true
$game_temp.in_battle = false
if self.battler.damage.to_i > 0
if XAS_BA::ATTACK_SKILL_SHAKE.include?(skill_id)
$game_screen.start_shake(XAS_BA::SH_POWER,XAS_BA::SH_SPEED,XAS_BA::SH_DUR)
end
hit_skill_anime = XAS_BA::ATTACK_ANI_HIT[skill_id]
if hit_skill_anime != nil
self.animation_id = hit_skill_anime
else
self.animation_id = XAS_BA::DEFAULT_ATTACK_ANI_HIT
end
d = bullet.direction
p = bullet.action.blow_power.to_i
self.blow(d, p)
self.battler.hiblink_duration = self.damage_hiblink_duration
end
if self.is_a?(Game_Player)
self.need_refresh = true
end
end
if not @xrxs64c_defeat_done and self.battler.dead?
defeat_process
@xrxs64c_defeat_done = true
end
return (super or result)
end
def shield_directions
return []
end
def shield_actions
return []
end
def knock_back_disable
return false
end
def damage_hiblink_duration
actor = $game_party.actors[0]
if self.is_a?(Game_Player) and self.battler.damage.to_i > 0
if XAS_BA::JUMP_HIT_HERO == true
jump(0,0)
$game_system.se_play(XAS_BA::HERO_HIT_SE)
end
else
if self.battler.damage.to_i > 0
unless XAS_BA::JUMP_HIT_ENEMY_DISABLE.include?(self.enemy_id)
jump(0,0)
end
end
end
if self.is_a?(Game_Player)
return XAS_BA::INVICIBLE_DURATION_HERO
else
enemy_invicible_duration = XAS_BA::INVICIBLE_DURATION_ENEMY[enemy_id]
if enemy_invicible_duration != nil
return enemy_invicible_duration
else
return XAS_BA::DEFAULT_INVICIBLE_DURATION_ENEMY
end
end
end
def dead?
return self.battler == nil ? false : self.battler.dead?
end
def defeat_process
end
end
class Game_Player < Game_Character
include XRXS_BattlerAttachment
def battler
return $game_party.actors[0]
end
def defeat_process
super
if XAS_BA::AUTOGAMEOVER == true
$scene = Scene_Gameover.new rescue nil
else
$game_switches[XAS_BA::GAMEOVER_SWITCH_ID] = true
$game_map.refresh
end
end
alias xrxs64c_update update
def update
xrxs64c_update
self.battler.remove_states_auto if self.battler != nil
if self.collapse_done
self.collapse_done = false
@xrxs64c_defeat_done = false
end
end
end
class Game_Event < Game_Character
include XRXS_BattlerAttachment
def battler
return @battler
end
alias xrxs64c_refresh refresh
def refresh
xrxs64c_refresh
self.battler_recheck
end
def battler_recheck
return if @battler != nil
if @page == nil
return
end
@enemy_id = 0
for page in @event.pages.reverse
condition = page.condition
if condition.variable_valid and
condition.variable_id == XAS_BA::ENEMY_ID_VARIABLE_ID and
(!condition.switch1_valid or $game_switches[condition.switch1_id]) and
(!condition.switch2_valid or $game_switches[condition.switch2_id])
@enemy_id = condition.variable_value
break
end
end
if @enemy_id == 0
return
end
troop_id = -1
member_index = -1
for troop in $data_troops
next if troop == nil
for enemy in troop.members
if enemy.enemy_id == @enemy_id
troop_id = $data_troops.index(troop)
member_index = troop.members.index(enemy)
break
end
end
end
if troop_id != -1 and member_index != -1
@battler = Game_Enemy.new(troop_id, member_index)
end
end
def enemy_id
self.battler
return @enemy_id
end
alias xrxs64c_update update
def update
if @collapse_wait_count.to_i > 0
@collapse_wait_count -= 1
if @collapse_wait_count == 0
@collapse_wait_count = nil
$game_map.remove_token(self)
end
return
end
update_sensor
xrxs64c_update
if self.battler != nil
self.battler.remove_states_auto
end
if self.collapse_duration.to_i > 0
@through = true
end
if self.collapse_done
@opacity = 0
@collapse_wait_count = 32
return
end
end
def shield_enable!
@shield_disable = nil
end
def shield_disable!
@shield_disable = true
end
def shield_directions
set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_DIRECTIONS[self.enemy_id]
set = [] if set == nil
return set
end
def shield_actions
set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_ACTIONS[self.enemy_id]
set = [] if set == nil
return set
end
def knock_back_disable
return XAS_BA_ENEMY::KNOCK_BACK_DISABLES.include?(self.enemy_id)
end
def body_size
return XAS_BA_ENEMY::BODY_SQUARE[self.enemy_id].to_i
end
def defeat_process
super
enemy_defeat_process(self.battler)
enemy_defeat_animation = XAS_BA_ENEMY::DEF_ANI[enemy_id]
if XAS_BA_ENEMY::DEF_ANI[enemy_id] != nil
self.animation_id = enemy_defeat_animation
end
end
end
class Game_Event < Game_Character
attr_reader :collision_attack
def img_act_exist?
begin
RPG::Cache.character(@page.graphic.character_name + "_Act" , @page.graphic.character_hue)
rescue
return false
end
return true
end
def attack_on
@collision_attack = true
if img_act_exist?
@character_name = @page.graphic.character_name + "_Act"
end
end
def attack_off
@collision_attack = false
@character_name = @page.graphic.character_name
end
end
class Game_Player < Game_Character
alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
def check_event_trigger_touch(x, y)
xrxs64c_check_event_trigger_touch(x, y)
if $game_system.map_interpreter.running?
return
end
for event in $game_map.events.values
next unless event.collision_attack
unless [1,2].include?(event.trigger)
if event.battler != nil and event.x == x and event.y == y
$game_player.attack_effect(event)
$game_player.animation_id = XAS_BA::DEFAULT_ATTACK_ANI_HIT
end
end
end
end
end
class Game_Event < Game_Character
alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
def check_event_trigger_touch(x, y)
xrxs64c_check_event_trigger_touch(x, y)
if $game_system.map_interpreter.running?
return
end
return unless self.collision_attack
if self.battler != nil and x == $game_player.x and y == $game_player.y
$game_player.attack_effect(self)
end
end
end
module XAS_BA_BATTLEEVENT_NONPREEMPT
def update
return if self.battler != nil and $game_system.map_interpreter.running?
super
end
end
class Game_Event < Game_Character
include XAS_BA_BATTLEEVENT_NONPREEMPT
end
class Game_Battler
attr_accessor :hiblink_duration
end
class Sprite_Character < RPG::Sprite
alias xrxs64c_update update
def update
if @battler == nil
@battler = @character.battler
end
xrxs64c_update
if @battler == nil
return
end
if @_collapse_duration > 0
return
end
if @character.collapse_done
return
end
if @battler.hiblink_duration.is_a?(Numeric)
if XAS_BA::BLINK_ON == true
@character.opacity = (@character.opacity + 70) % 190 + 40
end
@battler.hiblink_duration -= 1
if @battler.hiblink_duration <= 0
@battler.hiblink_duration = nil
@character.opacity = 255
end
end
end
end
module XAS_BA_ItemDrop
def defeat_process
super
if self.battler.is_a?(Game_Enemy) and self.battler.dead?
treasure = nil
enemy = self.battler
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasure = $data_items[enemy.item_id]
end
if enemy.weapon_id > 0
treasure = $data_weapons[enemy.weapon_id]
end
if enemy.armor_id > 0
treasure = $data_armors[enemy.armor_id]
end
end
if treasure != nil
item_se = XAS_BA::ITEMDROP_SE
opecode = treasure.is_a?(RPG::Item) ? 126 :
treasure.is_a?(RPG::Weapon) ? 127 :
treasure.is_a?(RPG::Armor) ? 128 :
nil
list = []
if opecode != nil
list[0] = RPG::EventCommand.new(opecode, 0, [treasure.id,0,0,1])
list[1] = RPG::EventCommand.new(250, 0, [item_se])
list[2] = RPG::EventCommand.new(116, 0, [])
end
list.push(RPG::EventCommand.new)
command = RPG::MoveCommand.new
command.code = 14
command.parameters = [0,0]
route = RPG::MoveRoute.new
route.repeat = false
route.list = [command, RPG::MoveCommand.new]
page = RPG::Event::page.new
page.move_type = 3
page.move_route = route
page.move_frequency = 6
page.always_on_top = true
page.trigger = 1
page.list = list
event = RPG::Event.new(self.x, self.y)
event.pages = [page]
token = Token_Event.new($game_map.id, event)
token.icon_name = treasure.icon_name
$game_map.add_token(token)
end
end
end
end
class Game_Event < Game_Character
include XAS_BA_ItemDrop
end
class Game_Character
attr_accessor :icon_name
end
class Sprite_Character < RPG::Sprite
alias xrxs_charactericon_update update
def update
xrxs_charactericon_update
if @character.icon_name != nil #and @icon_name != @character.icon_name
@icon_name = @character.icon_name
self.bitmap = RPG::Cache.icon(@icon_name)
self.src_rect.set(0, 0, 24, 24)
self.ox = 12
self.oy = 24
end
end
end
class Game_Character
def blow(d, power = 1)
return if self.knock_back_disable
@knock_back_prespeed = @move_speed if @knock_back_prespeed == nil
power.times do
if passable?(self.x, self.y, d)
@x += ([3,6,9].include?(d) ? 1 : [1,4,7].include?(d) ? -1 : 0)
@y += ([1,2,3].include?(d) ? 1 : [7,8,9].include?(d) ? -1 : 0)
end
end
if self.battler.is_a?(Game_Enemy)
enemy_knock_duration = XAS_BA::INVICIBLE_DURATION_ENEMY[enemy_id]
if enemy_knock_duration != nil
@knock_back_duration = enemy_knock_duration
else
@knock_back_duration = XAS_BA::DEFAULT_INVICIBLE_DURATION_ENEMY
end
else
@knock_back_duration = XAS_BA::KNOCK_BACK_DURATION_HERO
end
@move_speed = XAS_BA::KNOCK_BACK_SPEED
end
alias xrxs64c_nb_update update
def update
@stop_count = -1 if self.knockbacking? or self.dead?
xrxs64c_nb_update
def img_hit_enemy_exist?
begin
RPG::Cache.character(@page.graphic.character_name + "_Hit" , @page.graphic.character_hue)
rescue
return false
end
return true
end
def img_hit_actor_exist?
begin
actor = $game_party.actors[0]
RPG::Cache.character(actor.character_name + "_Hit" , actor.character_hue)
rescue
return false
end
return true
end
if self.knockbacking?
if self.battler.is_a?(Game_Enemy)
if img_hit_enemy_exist?
@character_name = @page.graphic.character_name + "_Hit"
@collision_attack = false
end
else
if img_hit_actor_exist?
actor = $game_party.actors[0]
@character_name = actor.character_name + "_Hit"
end
end
@pattern = 0
@knock_back_duration -= 1
if @knock_back_duration <= 0
if self.battler.is_a?(Game_Enemy)
@character_name = @page.graphic.character_name
else
actor = $game_party.actors[0]
@character_name = actor.character_name
end
@knock_back_duration = nil
@move_speed = @knock_back_prespeed
@knock_back_prespeed = nil
end
return
end
end
def knockbacking?
return @knock_back_duration != nil
end
def collapsing?
return self.collapse_duration.to_i > 0
end
end
module XAS_DamageStop
def acting?
return (super or self.knockbacking? or self.collapsing?)
end
end
class Game_Player < Game_Character
include XAS_DamageStop
end
class Game_Event < Game_Character
include XAS_DamageStop
end
module RPG
class Sprite < ::Sprite
def dispose_animation
if @_animation_sprites != nil
sprite = @_animation_sprites[0]
if sprite != nil
@@_reference_count[sprite.bitmap] -= 1
end
for sprite in @_animation_sprites
sprite.dispose
end
@_animation_sprites = nil
@_animation = nil
end
end
end
end
#===============================================================================
# XAS - (Y) Button Action
#===============================================================================
class Game_Player < Game_Character
alias xrxs64_ya_update update
def update
xrxs64_ya_update
if Input.trigger?(XRXS64::ACTION_BUTTON)
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing or
self.action != nil
action_id = $game_variables[XRXS64::ACTION_VARIABLE_ID]
self.shoot(action_id)
end
end
end
end
#===============================================================================
# XAS - (Z) Button Change
#===============================================================================
class Game_Party
def goods
@goods = [] if @goods == nil
return @goods
end
def gain_goods(action_id)
@goods = [] if @goods == nil
@goods.push(action_id) unless @goods.include?(action_id)
end
end
module XAS_ACTION
alias xas_z_shoot_bullet shoot_bullet
def shoot_bullet(action_id)
bullet_token = xas_z_shoot_bullet(action_id)
$scene.refresh_goods if bullet_token
return bullet_token
end
end
class Game_Map
attr_accessor :goodref
end
class Interpreter
alias mogfix11_command_126 command_126
def command_126
mogfix11_command_126
$game_map.goodref = true
end
end
class Scene_Map
alias xrxs64_zc_main main
def main
@action_change = Spriteset_ActionChange.new
if $game_switches[XAS_Z::SWITCH_ID] == false
@action_change.show(nil, $game_variables[XAS_Z::ACTION_VARIABLE_ID], nil)
end
xrxs64_zc_main
@action_change.dispose if @action_change != nil
end
alias xrxs64_zc_update update
def update
xrxs64_zc_update
unless $game_switches[XAS_Z::SWITCH_ID] == false
return @action_change.visible = false
end
@action_change.update
if $game_map.goodref == true
refresh_goods
$game_map.goodref = false
end
if $xrxs["xas_good_ax"] == true
if Input.trigger?(XAS_Z::ACTION_CHANGE_BUTTON) and XAS_WINDOW_SKILL::ZBUTTON_ACTIVE == true
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing
action_id2 = $game_variables[XAS_Z::ACTION_VARIABLE_ID]
goods = $game_party.goods
return if goods.size == 0
index = (goods.index(action_id2).to_i + 1) % goods.size
action_id3 = goods[index]
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = action_id3
@action_change.show(nil, action_id2, action_id3)
@action_change.left_slide
end
end
else
if Input.trigger?(XAS_Z::ACTION_CHANGE_BUTTON)
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing
action_id2 = $game_variables[XAS_Z::ACTION_VARIABLE_ID]
goods = $game_party.goods
return if goods.size == 0
index = (goods.index(action_id2).to_i + 1) % goods.size
action_id3 = goods[index]
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = action_id3
@action_change.show(nil, action_id2, action_id3)
@action_change.left_slide
end
end
end
end
alias xrxs64_zc_transfer_player transfer_player
def transfer_player
xrxs64_zc_transfer_player
if $game_switches[XAS_Z::SWITCH_ID] == false
@action_change.show(nil, $game_variables[XAS_Z::ACTION_VARIABLE_ID], nil)
end
end
def refresh_goods
@action_change.refresh if @action_change != nil
end
end
class Spriteset_ActionChange
def initialize
@x = XAS_Z::X
@y = XAS_Z::Y
@icons = []
@action_ids = [nil, nil, nil]
@font = Font.new
@font.name = "Comic Sans MS"
@font.size = 22
@font.bold = true
self.clear
@leftslide_duration = 0
@show_duration = 0
@fadeout_duration = 0
end
def dispose
@icons.each {|sprite| sprite.dispose}
@window.dispose if @window != nil
@numbers.dispose if @numbers != nil
end
def clear
self.dispose
@window = Window_Base.new(@x, @y, 26, 26)
@window.visible = false
@window.back_opacity = 160
@window.z = 500
for i in 0..2
@icons = Sprite.new
@icons.z = 501
end
@numbers = Spriteset_Numbers.new(@font)
@numbers.visible = false
@numbers.x = @x + 12
@numbers.y = @y + 12
@numbers.z = 502
end
def show(action_id1, action_id2, action_id3)
self.clear
@window.visible = true
@action_ids = [action_id1, action_id2, action_id3]
for i in 0..2
icon_name = XAS_Z::ACTION_ICON[@action_ids]
if icon_name != nil
@icons.bitmap = RPG::Cache.icon(icon_name)
@icons.x = @x + (i - 1) * 48
@icons.y = @y + 16 - (i % 2) * 16
@icons.opacity = 96 + (i % 2) * 160
@icons.visible = true
else
@icons.bitmap = nil
end
end
@show_duration = (action_id3 == nil ? 0 : 60)
@leftslide_duration = 0
@fadeout_duration = (action_id3 == nil ? 12 : 0)
@numbers.visible = self.need_number?
@numbers.n = $game_party.item_number(self.item_id) if @numbers.visible
end
def refresh
self.show(*@action_ids)
end
def left_slide
@leftslide_duration = 8
end
def visible=(b)
@window.visible = b
@icons.each{|sprite| sprite.visible = b }
@numbers.visible = (b and need_number?)
end
def need_number?
return (self.item_id != nil)
end
def item_id
return XAS::ITEM_COST[@action_ids[1]]
end
def update
if @leftslide_duration > 0
@leftslide_duration -= 1
@icons[0].opacity = @leftslide_duration * 20
@icons[1].x = @x - 48 + @leftslide_duration * 6
@icons[1].y = @y + 16 - @leftslide_duration * 2
@icons[1].opacity = @leftslide_duration * 20 + 96
@icons[2].x = @x + 48 - (8 - @leftslide_duration) * 6
@icons[2].y = @y + 16 - (8 - @leftslide_duration) * 2
@icons[2].opacity = (8 - @leftslide_duration) * 20 + 96
if @leftslide_duration == 0
show(@action_ids[1], @action_ids[2], nil)
end
return
end
if @icons[0].visible
@icons[0].x += 2
@icons[0].opacity -= 22
@icons[0].visible = false if @icons[0].opacity == 0
return
end
end
end
#===============================================================================
# XAS - (C) Button Slash
#===============================================================================
class Game_Player < Game_Character
alias xrxs64_cs_update update
def update
xrxs64_cs_update
if Input.trigger?(XAS_CS::SLASH_BUTTON)
unless self.action != nil or $game_system.map_interpreter.running? or
$game_temp.message_window_showing or $game_map.starting? or
self.knockbacking?
if Input.press?(Input::UP)
turn_up
elsif Input.press?(Input::DOWN)
turn_down
elsif Input.press?(Input::RIGHT)
turn_right
elsif Input.press?(Input::LEFT)
turn_left
end
action_id = $game_variables[XAS_CS::SLASH_VARIABLE_ID]
self.shoot(action_id)
end
end
end
end
#===============================================================================
# Game_Map
#===============================================================================
class Game_Map
def starting?
if $game_system.map_interpreter.running?
return true
end
for event in $game_map.events.values
return true if event.starting
end
return false
end
end
#===============================================================================
# Scene_Map
#===============================================================================
class Game_Player
alias mog_xaswep_update update
def update
mog_xaswep_update
actor = $game_party.actors[0]
weapon_id = actor.weapon_id
weapon_tool_id = XAS_BA::WEP_ID_TOOL[weapon_id]
$game_variables[XAS_CS::SLASH_VARIABLE_ID] = weapon_tool_id
end
end
#===============================================================================
# XAS - SCENE_SKILL_AX (OPCIONAL)
#===============================================================================
# - Suporte para equipar as ferramentas através da janela de
#Skill.
# - Permite ganhar as ferramentas através do level como se
#fossem skills normais.
#===============================================================================
module XAS_WINDOW_SKILL
#Texto de Skill Equipada.
EQUIPPED = "Equipado"
#Texto de ajuda inicial.
PRESS = "Pressione C para Equipar"
#Botão para equipar a skill.
BUTTON = Input::C
#Ativar ou desativar o botão de Change para mudar as skills.
ZBUTTON_ACTIVE = false
# Ativar ganho de Ferramentas através do ganho de skill por level
#e através da adição e remoção de Skill usando o comando de
#eventos. (Somente com o botão change Ativado.)
LVGAINGOOD = false
end
$xrxs["xas_good_ax"] = true
#===============================================================================
# Scene_Skill
#===============================================================================
class Scene_Skill
alias mog_xasmain main
def main
@xastextime = 0
@xastextime2 = 450
@skill_text = Sprite.new
@skill_text.bitmap = Bitmap.new(160,100)
@skill_text.x = 700
@skill_text.y = 0
@skill_text.z = 9999
@skill_text.bitmap.font.name = "Georgia"
@skill_text.bitmap.font.size = 24
@skill_text.bitmap.font.bold = true
@skill_text.visible = false
@skill_text.bitmap.draw_text(0, 0, 140, 64, XAS_WINDOW_SKILL::EQUIPPED,1)
@skill_text2 = Sprite.new
@skill_text2.bitmap = Bitmap.new(640,64)
@skill_text2.x = 0
@skill_text2.y = 450
@skill_text2.z = 9999
@skill_text2.bitmap.font.name = "Georgia"
@skill_text2.bitmap.font.size = 24
@skill_text2.bitmap.font.bold = true
@skill_text2.visible = true
@skill_text2.bitmap.draw_text(0, 20, 640, 64,XAS_WINDOW_SKILL::pRESS ,1)
@skill_text2.opacity = @xastextime2
mog_xasmain
@skill_text.dispose
@skill_text2.dispose
end
alias mog_xasupdate update
def update
mog_xasupdate
@xastextime -= 3
@xastextime2 -= 3
@skill_text.opacity = @xastextime
@skill_text2.opacity = @xastextime2
if @xastextime <= 0
@xastextime = 0
@skill_text.visible = false
end
if @xastextime2 <= 0
@xastextime2 = 0
@skill_text2.visible = false
end
if @skill_text2.y > 400
@skill_text2.y -= 3
elsif @skill_text2.y <= 400
@skill_text2.y = 400
end
if @skill_text.x > 480
@skill_text.x -= 10
elsif @skill_text.x <= 480
@skill_text.x = 480
end
end
alias mog_xasupdate_skill update_skill
def update_skill
mog_xasupdate_skill
if Input.trigger?(XAS_WINDOW_SKILL::BUTTON)
@skill = @skill_window.skill
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = @skill.id
@skill_text.visible = true
@skill_text.x = 700
@skill_text.opacity = @xastextime
@xastextime = 355
end
end
end
#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
alias mog_xasgood_setup setup
def setup(actor_id)
mog_xasgood_setup(actor_id)
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
$game_party.gain_goods(j.skill_id) if XAS_WINDOW_SKILL::LVGAINGOOD == true
end
end
end
end
end
#===============================================================================
# Game_Actor
#===============================================================================
class Interpreter
alias mog_xasgood_command_318 command_318
def command_318
mog_xasgood_command_318
actor = $game_actors[@parameters[0]]
if actor != nil
if @parameters[1] == 0
$game_party.gain_goods(@parameters[2]) if XAS_WINDOW_SKILL::LVGAINGOOD == true
else
$game_party.goods.delete(@parameters[2]) if XAS_WINDOW_SKILL::LVGAINGOOD == true
end
end
return true
end
end
#===============================================================================
# XAS - SCENE_ITEM_AX (OPCIONAL)
#===============================================================================
# - Suporte para equipar as ferramentas através da janela de
# itens.
#===============================================================================
module XAS_WINDOW_ITEM
#Definição da ID que ativará a Ferramenta ID.
# XASITEM_ID = {A=>B, A=>B,...}
# A = ID do Item
# B = ID da Ferramenta
XASITEM_ID = {
# A B Nome do item
1=>8, # Potion
2=>9, # HI-Potion
3=>10, # Ether
4=>11, # HI-Ether
5=>12, # Remedy
6=>13, # Elixir
7=>14 # Bomb
}
#Texto de item Equipado.
EQUIPPED = "Equipado"
#Texto de ajuda inicial.
PRESS = "Pressione C para Equipar"
#Botão para equipar o item.
BUTTON = Input::C
end
##############
# Scene_Item #
##############
class Scene_Item
alias mog_xasmain main
def main
@xastextime = 0
@xastextime2 = 450
@item_text = Sprite.new
@item_text.bitmap = Bitmap.new(160,100)
@item_text.x = 700
@item_text.y = 0
@item_text.z = 9999
@item_text.bitmap.font.name = "Georgia"
@item_text.bitmap.font.size = 24
@item_text.bitmap.font.bold = true
@item_text.visible = false
@item_text.bitmap.draw_text(0, 0, 140, 64, XAS_WINDOW_ITEM::EQUIPPED,1)
@item_text2 = Sprite.new
@item_text2.bitmap = Bitmap.new(640,64)
@item_text2.x = 0
@item_text2.y = 450
@item_text2.z = 9999
@item_text2.bitmap.font.name = "Georgia"
@item_text2.bitmap.font.size = 24
@item_text2.bitmap.font.bold = true
@item_text2.visible = true
@item_text2.bitmap.draw_text(0, 20, 640, 64,XAS_WINDOW_ITEM::pRESS ,1)
@item_text2.opacity = @xastextime2
mog_xasmain
@item_text.dispose
@item_text2.dispose
end
alias mog_xasupdate update
def update
mog_xasupdate
@xastextime -= 3
@xastextime2 -= 3
@item_text.opacity = @xastextime
@item_text2.opacity = @xastextime2
if @xastextime <= 0
@xastextime = 0
@item_text.visible = false
end
if @xastextime2 <= 0
@xastextime2 = 0
@item_text2.visible = false
end
if @item_text2.y > 400
@item_text2.y -= 3
elsif @item_text2.y <= 400
@item_text2.y = 400
end
if @item_text.x > 480
@item_text.x -= 10
elsif @item_text.x <= 480
@item_text.x = 480
end
end
alias mog_xas_update_item update_item
def update_item
mog_xas_update_item
if Input.trigger?(XAS_WINDOW_ITEM::BUTTON)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
item_id = @item.id
item_tool_id = XAS_WINDOW_ITEM::XASITEM_ID[@item.id]
if item_tool_id != nil
$game_system.se_play($data_system.equip_se)
@item_text.visible = true
@item_text.x = 700
@item_text.opacity = @xastextime
@xastextime = 355
$game_variables[XAS_Z::ACTION_VARIABLE_ID] = item_tool_id
end
end
end
end
module Database_Bullet
action_id = 1
SUFLAGS[action_id] = 22
DURATIONS[action_id] = 22
SELF_MOTIONS[action_id] = "_SWD_01"
plan = []
plan[5] = action_id
ATTACK_ID_PLANS[action_id] = plan
ATTACK_RANGE_TYPES[action_id] = SQUARE
ATTACK_RANGE_PLANS[action_id] = [1]
BLOW_POWERS[action_id] = 1
SELF_ANIMATION_PLANS[action_id] = []
SELF_DAMAGES[action_id] = false
PLAYER_DAMAGES[action_id] = false
IGNORE_INVINCIBLES[action_id] = true
end
module Database_Bullet
action_id = 2
SUFLAGS[action_id] = 20
DURATIONS[action_id] = 20
SELF_MOTIONS[action_id] = "_SHD_01"
ATTACK_ID_PLANS[action_id] = [action_id]
ATTACK_RANGE_TYPES[action_id] = LINE
ATTACK_RANGE_PLANS[action_id] = [1]
BLOW_POWERS[action_id] = 5
SELF_ANIMATION_PLANS[action_id] = []
SELF_DAMAGES[action_id] = false
PLAYER_DAMAGES[action_id] = false
IGNORE_INVINCIBLES[action_id] = false
end


Hud:
#_______________________________________________________________________________
# MOG_MPW ICON V1.0
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# HUD que apresenta o HP e SP em forma de ícones.
#
# É preciso ter as imagens:
# HP_Icon
# HP_Icon_Back
# SP_Icon
# SP_Icon_Back
# Nome_do_Heroi_Face (Opcional)
# Dentro da pasta Graphics/Pictures.
#
# NOTA - O script vai calcular cada ícone pela porcentagem de
# HP ou SP, ou seja, não é porque você toma um ponto de dano
# que você vai perder um ícone de HP (a não ser que seu HP final
# seja igual a quantidade final de ícones.
#
#-------------------------------------------------------------------------------
module MOG
#Posição do HUD.
STMAPX = 0 # X Pos
STMAPY = 0 # Y Pos
#Switch que desativa o HUD.
STMAPVIS = 5
#Quantidade maxima final de ícones para o HP.
MAX_ICON_HP = 20
#Quantidade maxima final de ícones para o SP.
MAX_ICON_SP = 20
#Espaço entre os ícones de HP na horizontal.
HP_ICON_SPACE_X = 20
#Espaço entre os ícones de SP na horizontal.
SP_ICON_SPACE_X = 10
#Espaço entre a primeira linha de ícones com a segunda linha.
#(Somente se a DIV_HP_LINE estiver como true)
HP_ICON_SPACE_Y = 48
#Espaço entre a primeira linha de ícones com a segunda linha.
#(Somente se a DIV_SP_LINE estiver como true)
SP_ICON_SPACE_Y = 64
#Deixar os ìcones de HP em 2 linhas quando o HP
#passar da metade do valor maximo final.
DIV_HP_LINE = true
#Deixar os ìcones de SP em 2 linhas quando o SP
#passar da metade do valor maximo final.
DIV_SP_LINE = false
#Mostrar a condição do personagem.
SHOW_STATES = true
end
$mogscript = {} if $mogscript == nil
$mogscript["mpstelen"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
attr_reader :final_maxhp
attr_reader :final_maxsp
def final_maxhp
return $data_actors[@actor_id].parameters[0,$data_actors[@actor_id].final_level]
end
def final_maxsp
return $data_actors[@actor_id].parameters[1,$data_actors[@actor_id].final_level]
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_maphp2(actor, x, y)
one_icon_hp_max = actor.final_maxhp * MOG::MAX_ICON_HP / actor.final_maxhp
valor = 100 * actor.final_maxhp / 100
valor2 = 100 * actor.hp / 100
valor3 = one_icon_hp_max * valor2 / valor
valor4 = 100 * actor.maxhp / 100
valor5 = one_icon_hp_max * valor4 / valor
valor6 = one_icon_hp_max * valor / valor
now_hp = RPG::Cache.icon("HP_Icon")
now_cw = now_hp.width
now_ch = now_hp.height
now_hp_src_rect = Rect.new(0, 0, now_cw, now_ch)
max_hp = RPG::Cache.icon("HP_Icon_Back")
max_cw = max_hp.width
max_ch = max_hp.height
max_hp_src_rect = Rect.new(0, 0, max_cw, max_ch)
if valor5 < 1
valor5 = 1
end
if valor3 < 1 and actor.hp > 0
valor3 = 1
elsif valor3 <= 0
valor3 = 0
end
if MOG::DIV_HP_LINE == true
div = valor6 / 2
if valor5 < div
for r in 0...valor5
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect)
end
else
for r in 0...div
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect)
end
for r in div...valor5
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::HP_ICON_SPACE_X * div, y - max_ch + MOG::HP_ICON_SPACE_Y, max_hp, max_hp_src_rect)
end
end
else
for r in 0...valor5
x = r * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect)
end
end
if MOG::DIV_HP_LINE == true
div2 = valor6 / 2
if valor3 < div2
for i in 0...valor3
x = i * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect)
end
else
for i in 0...div2
x = i * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect)
end
for i in div2...valor3
x = i * MOG::HP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::HP_ICON_SPACE_X * div2, y - now_ch + MOG::HP_ICON_SPACE_Y, now_hp, now_hp_src_rect)
end
end
else
for i in 0...valor3
x = i * MOG::HP_ICON_SPACE
self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect)
end
end
end
def draw_mapsp2(actor, x, y)
one_icon_sp_max = actor.final_maxsp * MOG::MAX_ICON_SP / actor.final_maxsp
valor = 100 * actor.final_maxsp / 100
valor2 = 100 * actor.sp / 100
valor3 = one_icon_sp_max * valor2 / valor
valor4 = 100 * actor.maxsp / 100
valor5 = one_icon_sp_max * valor4 / valor
valor6 = one_icon_sp_max * valor / valor
now_sp = RPG::Cache.icon("SP_Icon")
now_cw = now_sp.width
now_ch = now_sp.height
now_sp_src_rect = Rect.new(0, 0, now_cw, now_ch)
max_sp = RPG::Cache.icon("SP_Icon_Back")
max_cw = max_sp.width
max_ch = max_sp.height
max_sp_src_rect = Rect.new(0, 0, max_cw, max_ch)
if valor5 < 1
valor5 = 1
end
if valor3 < 1 and actor.sp > 0
valor3 = 1
elsif valor3 <= 0
valor3 = 0
end
if MOG::DIV_SP_LINE == true
div = valor6 / 2
if valor5 < div
for r in 0...valor5
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect)
end
else
for r in 0...div
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect)
end
for r in div...valor5
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::SP_ICON_SPACE_X * div, y - max_ch + MOG::SP_ICON_SPACE_Y, max_sp, max_sp_src_rect)
end
end
else
for r in 0...valor5
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect)
end
end
if MOG::DIV_SP_LINE == true
div = valor6 / 2
if valor5 < div
for r in 0...valor3
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect)
end
else
for r in 0...div
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect)
end
for r in div...valor3
x = r * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80 - MOG::SP_ICON_SPACE_X * div, y - now_ch + MOG::SP_ICON_SPACE_Y, now_sp, now_sp_src_rect)
end
end
else
for i in 0...valor3
x = i * MOG::SP_ICON_SPACE_X
self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect)
end
end
end
def nada
face = RPG::Cache.picture("")
end
def draw_heroface(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_actor_statemap(actor, x, y)
self.contents.font.size = 16
self.contents.font.name = "Georgia"
text = make_battler_state_text(actor, width, true)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 1, y + 1, 120, 32, text,1)
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(x, y, 120, 32, text,1)
end
end
#####################
# Window_Status_Map #
#####################
class Window_Sthero < Window_Base
def initialize
super(0, 0, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.contents.font.bold = true
self.contents.font.size = 20
self.contents.font.name = "Georgia"
self.opacity = 0
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_maphp2(actor,0, 0)
draw_mapsp2(actor, - 50, 50)
draw_heroface(actor, 0, 80)
draw_actor_statemap(actor, 0, 75) if MOG::SHOW_STATES == true
end
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
@sthero = Window_Sthero.new
@sthero.x = MOG::STMAPX
@sthero.y = MOG::STMAPY
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true
else
@sthero.visible = false
end
mog11_main
@sthero.dispose
end
alias mog11_update update
def update
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true
else
@sthero.visible = false
end
if $game_player.wref == true
@sthero.refresh
$game_player.wref = false
end
mog11_update
end
end
##############
# Game_Party #
###############
class Game_Party
alias mog11_check_map_slip_damage check_map_slip_damage
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
$game_player.wref = true
end
end
mog11_check_map_slip_damage
end
end
###############
# Interpreter #
###############
class Interpreter
alias mog11_command_311 command_311
def command_311
mog11_command_311
$game_player.wref = true
end
alias mog11_command_312 command_312
def command_312
mog11_command_312
$game_player.wref = true
end
alias mog11_command_313 command_313
def command_313
mog11_command_313
$game_player.wref = true
end
alias mog11_command_314 command_314
def command_314
mog11_command_314
$game_player.wref = true
end
alias mog11_command_315 command_315
def command_315
mog11_command_315
$game_player.wref = true
end
end
################
# Game_Battler #
################
class Game_Battler
alias mog11_attack_effect attack_effect
def attack_effect(attacker)
mog11_attack_effect(attacker)
$game_player.wref = true
end
alias mog11_skill_effect skill_effect
def skill_effect(user, skill)
mog11_skill_effect(user, skill)
$game_player.wref = true
end
alias mog11_item_effect item_effect
def item_effect(item)
mog11_item_effect(item)
$game_player.wref = true
end
alias mog11_add_state add_state
def add_state(state_id, force = false)
mog11_add_state(state_id, force = false)
$game_player.wref = true
end
end

Instrucciones:
Pegas los dos scripts sobre main y listo
PD: necesitas recursos del chara atacando y debilitado


me dices como lo uso ya que me no me sirve !!!
 
Estado
Cerrado para nuevas respuestas
Arriba Pie