Vai al contenuto

Rilevato Ad-Blocker. Per favore disabilita il tuo adblocker quando navighi su makerando.com - Non c'è nessun annuncio invasivo.

  • Chatbox

    You don't have permission to chat.
    Load More
Ally

BS/Battlers Addon Battle Background basati sul tile

Recommended Posts

Nome Script: Battle Background basati sul tile
Versione: 1.1
Autore/i: Reedo

Informazioni:
Lo script permette di settare il Background di battaglia in base all'autotile in cui il PG è posto prima che inizi la battaglia.
E' anche possibile settare lo sfondo di battaglia per un'unica mappa.

Screenshots:

battlebacks1.jpg
battlebacks2.jpg
battlebacks3.jpg
battlebacks4.jpg
battlebacks5.jpg
battlebacks6.jpg


Istruzioni:
Inserite lo script sopra Main.
Altre istruzioni all'interno dello script/demo.

Script:

###############################################################################
##  Tile-Based Battle Backgrounds
##  Version 1.1
##  December 28, 2009
##  By Reedo
###############################################################################
##  SOURCE
##
##  http://www.rpgmakervx.net/index.php?showtopic=23649
###############################################################################
##  REFERENCES
##
##  None.  This is an original script by Reedo.
###############################################################################
##  DESCRIPTION
##  
##  [UPDATE 1.1]
##  Added option to stretch images based on a request by Riokogen.
###############################################################################
##  DESCRIPTION
##
##  This script allows you to replace the background image(s) of the default
##  battle scene with custom background and/or floor image of your own making.
##
##  What's different about this script is that it will set the battle background
##  based on the tile the player is standing on when the battle begins!
##
##  The script names all of the autotiles in TileSetA, many of the single floor
##  tiles, and allows you to name any others that you like.  Named tiles can
##  then have a specific set of battle graphics applied to them.  In this way,
##  the script can check to see which (if any) named tile the player is standing
##  on, and set the battle background appropriately.  Now Ralph and friends can
##  fight in the woods when standing in the woods.  
##
##  The script also allows backgrounds specific to an entire map, and provides
##  a list to exclude individual maps from custom battle background processing.
###############################################################################
##  COMPATIBILITY
##
##  Should be compatible with most other scripts.
###############################################################################
##  REQUIREMENTS
##
##  None
###############################################################################
##  INSTALLATION
##
##  Plug-and-play.
##  Insert below Materials, or other Reedo scripts.
###############################################################################
##  RIGHTS & RESTRICTIONS
##
##  As with most Reedo scripts, this script is free to re-use, as-is,
##  in personal, educational, and commercial RPGVX development projects,
##  providing that:  this script, as well as the rpgmakervx.net forum link  
##  from which it was obtained, are credited in writing displayed readily
##  to the user of the final compiled code assembly.
##
##  Reedo and rgpmakervx.net retain all rights of intellect and ownership.
##  You forego all rights of warranty by utilizing this script.
###############################################################################
##  USAGE
##
##  Specify user options according to the comments below.
###############################################################################

###############################################################################
##  USER OPTIONS
###############################################################################
module REEDO_TILE_BASED_BATTLE_BACKGROUNDS
  # Set this flag to turn the entire script on and off.  You can change this
  # value via a scipt. My long names can be a pain in the butt, so use code
  # like this in an event script command:
  #    @b = REEDO_TILE_BASED_BATTLE_BACKGROUNDS
  #    @b::ENABLED = false
  #
  ENABLED = true

  # Here the specific tiles that make up each game tile are specified. The
  # reason for this is that each auto-tile on a map is actually one of 48
  # different tiles, and each tile on the game map has three possible layers
  # where a tile ID can be stored (so each game tile can have three tiles on it).
  #
  # The hash below attempts to name each floor tile in Tile Set A to make them
  # easier to refer to when specifing battle graphics.  Since I was naming auto-
  # tiles anyway, I decided to name them all for you, incase your game makes a
  # tile passable when it normally would not be.  The autotiles are the hard ones
  # to find - I started naming the non-autotile floor tiles too, and you should
  # be able to look at Tile Set A and figure out where I stopped at. The rest of
  # the tiles are numbered sequentially, left to right, top to bottom, so you
  # should be able to simply count to any tile in tile set A that you want to
  # add to the hash below.
  #
  # The hash is simply a tile group name for the key, and an array of tile IDs
  # followed by the target layer, for the value. The layer is 0 for most tiles,
  # but 1 for "bushes" and 2 for anything rendered above the character.
  #
  # NOTE - THIS IS FOR THE DEFAULT TILESETS
  # Though, the rules for autotiles are set, so this script should work with
  # custom tile sets. But for the defaults, you should not have to change
  # anything on the autotiles and you can add the other floor tiles easily.
  #
  #         Group Name      =>    Tile IDs     , Graphic Layer
  TILE_GROUPS = {
           "RoughGrass"     =>  [(2816 .. 2863), 0],
           "GreenTrees"     =>  [(2864 .. 2911), 1],
           "HighMountains"  =>  [(2912 .. 2959), 0],
           "LightGrass"     =>  [(2960 .. 3007), 0],
           "GrassBushes"    =>  [(3008 .. 3055), 1],
           "WoodenFence"    =>  [(3056 .. 3103), 1],
           "StoneFloor"     =>  [(3104 .. 3151), 0],
           "WoodCounter"    =>  [(3152 .. 3199), 0],
           "RoughDirt"      =>  [(3200 .. 3247), 0],
           "DeadTrees"      =>  [(3248 .. 3295), 1],
           "MedMountains"   =>  [(3296 .. 3343), 0],
           "LightDirt"      =>  [(3344 .. 3391), 0],
           "DirtBushes"     =>  [(3392 .. 3439), 1],
           "StoneFence1"    =>  [(3440 .. 3487), 1],
           "GoldCarpet"     =>  [(3488 .. 3535), 0],
           "FancyCounter"   =>  [(3536 .. 3583), 0],
           "BeachSand"      =>  [(3584 .. 3631), 0],
           "PalmTrees"      =>  [(3632 .. 3679), 1],
           "LowMountains"   =>  [(3680 .. 3727), 0],
           "DesertSand"     =>  [(3728 .. 3775), 0],
           "SandBushes"     =>  [(3776 .. 3823), 1],
           "StoneFence2"    =>  [(3824 .. 3871), 1],
           "RedCarpet"      =>  [(3872 .. 3919), 0],
           "StoneCounter"   =>  [(3920 .. 3967), 0],
           "HeavySnow"      =>  [(3968 .. 4015), 0],
           "SnowTrees"      =>  [(4016 .. 4063), 1],
           "SnowMountains"  =>  [(4064 .. 4111), 0],
           "LightSnow"      =>  [(4112 .. 4159), 0],
           "SnowBushes"     =>  [(4160 .. 4207), 1],
           "SnowFence"      =>  [(4208 .. 4255), 1],
           "RaisedFloor"    =>  [(4256 .. 4303), 0],
           "ClothCounter"   =>  [(4304 .. 4351), 0],
           "BrownStone"     =>  [[1528], 0],
           "GrayStone"      =>  [[1529], 0],
           "LavaStone"      =>  [[1530], 0],
           "IceStone"       =>  [[1531], 0],
           "PlantVines"     =>  [[1532], 0],
           "CrystalStone"   =>  [[1533], 0],
           "LivingTissue"   =>  [[1534], 0],
           "PurpleCord"     =>  [[1535], 0],
           "Empty"          =>  [[1536], 0],
           "CrystalClear1"  =>  [[1537], 0],
           "CrystalClear2"  =>  [[1538], 0],
           "CrystalIce"     =>  [[1539], 0],
           "ForceField"     =>  [[1540], 0],
     "CrystalClear1Steps"   =>  [[1541], 0],
        "CrystalIceSteps"   =>  [[1542], 0],
           "MetalGrate"     =>  [[1543], 0],
     "CrystalClear2Steps"   =>  [[1549], 0],
      "ForceFieldSteps"     =>  [[1550], 0],
      "SquareGrayStone"     =>  [[1552], 0],
      "LargeRedStone"       =>  [[1553], 0],
      "LargeGoldStone"      =>  [[1554], 0],
      "YellowStone"         =>  [[1555], 0],
      "SmallRoundGrayStone" =>  [[1556], 0],
      "LargeRoundGrayStone" =>  [[1557], 0],
          "MossCovered"     =>  [[1558], 0],
          "IceCovered"      =>  [[1559], 0],

            } #END TILE_GROUPS

  # This hash contains the actual background image settings for each tile
  # group name. Enter the tile group name which should have unique battle
  # graphics as the key in the hash.  Enter an array of the two picture
  # names (imported into the Pictures Game Resources), to use as the background
  # and floor, respectively, for the value of each hash entry. The floor
  # picture is optional and can be set to 'nil' if not used.
  DATA = {"RoughGrass" => ["opensky1", "roughgrass1"],
          "GreenTrees" => ["forestsky1", "greentrees1"],
          "RoughDirt"  => ["opensky1", "roughdirt1"],
          "BeachSand"  => ["oceansky1", "beachsand1"],
          "DesertSand" => ["desertsky1", "desertsand1"],
         }

  # This hash allows you to specify map IDs for maps that will always use the
  # same battle graphics, regardless of the tile the player is on. Just set
  # this to an empty hash {} if not used.
  SINGLE_BACKGROUND_MAPS = {7 => "RoughGrass"}

  # Here you can specify map IDs for maps that will be ignored by this script.
  # Simply input a map ID into the array and that map will not use this script
  # to determine its battle images.
  EXCLUDED_MAPS = [10, 11, 12]

  # These values allow you to offest the position and z-depth of the background
  # image. The normal background image is 544 X 224 if you use a standard floor,
  # but you may want some overlap or offest for transparency overlay.
  BACK_TOP = 0
  BACK_LEFT = 0
  BACK_Z_DEPTH = 0

  # Set this to true to stretch the background image to fit.
  FIT_BACK = true
  # This is the size which the background image should be stretched to.
  FIT_BACK_SIZE = [544, 416]

  # These values allow you to offest the position and z-depth of the floor
  # image. The normal floor image is 544 X 192 if you use a standard background,
  # but you may want some overlap or offest for transparency overlay.  
  FLOOR_TOP = 0 #224
  FLOOR_LEFT = 0
  FLOOR_Z_DEPTH = 1

  # Set this to true to stretch the floor image to fit.
  FIT_FLOOR = true
  # This is the size which the floor image should be stretched to.
  FIT_FLOOR_SIZE = [544, 416]

  # This allows you to disable drawing of the default floor if you specify
  # a background image, but no floor image for a tile. In most cases you
  # won't need to modify this, but if you have another custom script providing
  # a floor image, then you may want to set this to false when using tiles with
  # only a background image specified.
  DEFAULT_FLOOR_ENABLED = true

end
###############################################################################
##  MAIN SCRIPT
###############################################################################
##  EDITS BEYOND THIS POINT ARE AT YOUR OWN RISK!!!
###############################################################################
class Spriteset_Battle
  alias reedo_tbbb_sb_create_battleback create_battleback                                                            
  def create_battleback
    tbbb = REEDO_TILE_BASED_BATTLE_BACKGROUNDS
    image = reedo_get_battleback
    if image != nil
      picture = Cache.picture(image)
      if tbbb::FIT_BACK
        bmp = Bitmap.new(tbbb::FIT_BACK_SIZE[0], tbbb::FIT_BACK_SIZE[1])
        bmp.stretch_blt(bmp.rect, picture, picture.rect)
      else
        bmp = picture
      end
      @battleback_sprite = Sprite.new(@viewport1)
      @battleback_sprite.bitmap = picture
      @battleback_sprite.x = tbbb::BACK_LEFT
      @battleback_sprite.y = tbbb::BACK_TOP
      @battleback_sprite.z = tbbb::BACK_Z_DEPTH
    else
      reedo_tbbb_sb_create_battleback
    end
  end

  alias reedo_tbbb_sb_create_battlefloor create_battlefloor
  def create_battlefloor
    tbbb = REEDO_TILE_BASED_BATTLE_BACKGROUNDS
    image = reedo_get_battlefloor
    if image != nil
      picture = Cache.picture(image)
      if tbbb::FIT_FLOOR
        bmp = Bitmap.new(tbbb::FIT_FLOOR_SIZE[0], tbbb::FIT_FLOOR_SIZE[1])
        bmp.stretch_blt(bmp.rect, picture, picture.rect)
      else
        bmp = picture
      end      
      @battlefloor_sprite = Sprite.new(@viewport1)
      @battlefloor_sprite.bitmap = bmp
      @battlefloor_sprite.x = tbbb::FLOOR_LEFT
      @battlefloor_sprite.y = tbbb::FLOOR_TOP
      @battlefloor_sprite.z = tbbb::FLOOR_Z_DEPTH
    else
      reedo_tbbb_sb_create_battlefloor if tbbb::DEFAULT_FLOOR_ENABLED
    end
  end

  def self.reedo_get_current_tile_id(layer)
    x = $game_player.x
    y = $game_player.y
    tile_id = $game_map.data[x, y, layer]     
    tile_id = -1 if tile_id == nil
    return tile_id
  end

  def reedo_get_battleback
    return nil if !REEDO_TILE_BASED_BATTLE_BACKGROUNDS::ENABLED
    return nil if REEDO_TILE_BASED_BATTLE_BACKGROUNDS::EXCLUDED_MAPS.include?($game_map.map_id)
    @reedo_backs = reedo_get_battle_backgrounds if @reedo_backs == nil
    return nil if @reedo_backs.length == 0
    return @reedo_backs[0]
  end

  def reedo_get_battlefloor
    return nil if !REEDO_TILE_BASED_BATTLE_BACKGROUNDS::ENABLED
    return nil if REEDO_TILE_BASED_BATTLE_BACKGROUNDS::EXCLUDED_MAPS.include?($game_map.map_id)
    @reedo_backs = reedo_get_battle_backgrounds if @reedo_backs == nil
    return nil if @reedo_backs.length == 0
    return @reedo_backs[1]
  end

  def reedo_get_battle_backgrounds
    values = nil
    if REEDO_TILE_BASED_BATTLE_BACKGROUNDS::SINGLE_BACKGROUND_MAPS.has_key?($game_map.map_id)
      key = REEDO_TILE_BASED_BATTLE_BACKGROUNDS::SINGLE_BACKGROUND_MAPS[$game_map.map_id]
      values = REEDO_TILE_BASED_BATTLE_BACKGROUNDS::DATA[key]
    else
      t1 = Spriteset_Battle.reedo_get_current_tile_id(0)
      t2 = Spriteset_Battle.reedo_get_current_tile_id(1)
      t3 = Spriteset_Battle.reedo_get_current_tile_id(2)

      REEDO_TILE_BASED_BATTLE_BACKGROUNDS::TILE_GROUPS.keys.each do |key|
        data = REEDO_TILE_BASED_BATTLE_BACKGROUNDS::TILE_GROUPS[key]
        case data[1]
        when 0
          t_id = t1
        when 1
          t_id = t2
        when 2
          t_id = t3
        end
        if t_id != nil
          if data[0].include?(t_id)
            values = REEDO_TILE_BASED_BATTLE_BACKGROUNDS::DATA[key]
            break
          end
        end
      end      
    end
    if values == nil
      values = REEDO_TILE_BASED_BATTLE_BACKGROUNDS::DATA["Default"]
    end
    return [] if values == nil
    return values
  end

end
Demo:
http://www.mediafire.com/download.php?opobyf38bzgno3m

Incompatibilita':
Dovrebbe essere compatibile con la maggior parte di altri script.
Lo script però è stato progettato per il sistema di combattimento di default e potrebbe non essere compatibile con gli altri.

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Crea un account o accedi per lasciare un commento

You need to be a member in order to leave a comment

Crea un account

Iscriviti per un nuovo account nella nostra comunità. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora

  • Contenuti simili

    • Da Syddo
      Salve, non sono riuscito a trovare uno script che possa creare una sorta di sistema pokémon-team party, dove si utilizza un certo character senza che però questo appaia in battaglia, mentre nella battle scene appaiano altri eroi o mostri che non possono essere utilizzati nell'overworld. C'è un qualche script che permetta di rendere 'inattivo' il personaggio principale (fisso, non scambiabile) del party rendendolo utilizzabile solo nell'overworld? Volendo mi accontenterei di un sistema interno senza scripting, purché non sia troppo legnoso (come ad esempio togliere il leader prima della battaglia). Il tutto, se possibile, sostenibile con gli script di follow come Caterpillar o Enhanced Squad Movement. Grazie mille! 
    • Da KenzaMe92
      Nome Script: KZM - Limit
      Versione: 1.0
      Autore:
      Descrizione:
      Questo script aggiunge la barra del limit e le abilità usate con questa barra in stile FFVII.
       
      Istruzioni:
      Installare sotto "▼ Materials" e sopra "▼ Main", dopodiché nel database creare un nuovo tipo di tecniche, chiamato limit e per ogni tecnica inserita in quel tipo, mettere il seguente tag nelle note dell'abilità:
              <limit>
      per farla riconoscere dallo script e permetterne l'uso solo a barra completamente carica.
       
      Screenshot:
      Devo ancora farne uno decente.
       
      Script:
      Pastebin [guarda] o [scarica]
       
      Bug e Conflitti Noti:
      Nessuno
       
      Note dell'autore:
      Condividetelo, usatelo nei vostri progetti free o commerciali, l'importante è creditare l'autore.
    • Da Ally
      Nome Script: Crystal Engine - Mimic
      Versione: N/D
      Autore/i: Crystal Noel
       
      Informazioni:
      Questo script fornisce due abilità da utilizzare in battaglia. Uno degli effetti copia semplicemente l'effetto e lo utilizza sul nemico. L'altra mossa è quella di mimare l'abilità fino alla fine della battaglia.
       
      Features:
      - Imparare temporaneamente (sostituisce l'abilità mimica fino alla fine della battaglia)
      - Copia Azione (Copia l'azione del bersaglio)
       
      Istruzioni:
      Script e istruzioni all'interno della demo.
       
      Nel note tag dei nemici, impostate in questo modo a seconda delle vostre esigenze:
       
      <mimic> Imposta la capacità di copiare l'ultima azione del bersaglio
       
      <borrow move> Imposta la capacità di prendere in prestito l'ultima abilità del bersaglio per il resto della battaglia
       
      Utilizzate questa opzione se desiderate che i nemici siano in grado di prendere in 'prestito' anche le abilità:
       
       
      class RPG::Enemy < RPG::BaseItem def actions set = [] set += @actions ids = [] set.each {|action| ids.push(action.skill_id)} $data_skills.each do |skill| next if skill.nil? action = RPG::Enemy::Action.new action.skill_id = skill.id set.push(action) unless ids.include?(skill.id) end set endend Demo:http://crystalnoel42.wordpress.com/2013/06/10/crystal-engine-mimic/
    • Da Ally
      Nome Script: Actor Battler Graphics
      Versione: 1.05
      Autore/i: Victor Sant
       
      Informazioni:
      Bisogna avere lo script "Victor's Engine - Basic Module" installato per far funzionare gli script di Victor.
      http://victorscripts.wordpress.com/rpg-maker-vx-ace/basic-scripts/basic-module/
       
      Istruzioni:
      Lo script va inserito sotto la sezione "Materials" e sotto lo script *NECESSARIO* "Victor's Engine - Basic Module"
      LE ISTRUZIONI SONO ALL'INTERNO DELLO SCRIPT
       
      Script:
       
       
      #==============================================================================# ** Victor Engine - Actors Battlers#------------------------------------------------------------------------------# Author : Victor Sant## Version History:# v 1.00 - 2011.12.19 > First relase# v 1.01 - 2011.12.30 > Faster Regular Expressions# v 1.02 - 2012.01.15 > Compatibility with Target Arrow# v 1.03 - 2012.01.28 > Compatibility with Animated Battle# v 1.04 - 2012.03.11 > Added position distance settings# v 1.05 - 2012.03.17 > Fixed battle test glitch#------------------------------------------------------------------------------# This script adds visible battler graphics for the party actors actors# during combat. With the visible battlers, new options will be available# like setting actor's battlers positions and attack animations.#------------------------------------------------------------------------------# Compatibility# Requires the script 'Victor Engine - Basic Module' v 1.11 or higher# If used with 'Victor Engine | Animated Battle' paste this one bellow it.# # * Overwrite methods (Default)# class Spriteset_Battle# def create_actors# def update_actors## class Scene_Battle < Scene_Base# def show_attack_animation(targets)## * Alias methods (Default)# class << DataManager# def setup_new_game# def create_game_objects# def make_save_contents# def extract_save_contents(contents)## class Game_Actor < Game_Battler# def setup(actor_id)## * Alias methods (Basic Module)# class Game_Interpreter# def comment_call##------------------------------------------------------------------------------# Instructions:# To instal the script, open you script editor and paste this script on# a new section on bellow the Materials section. This script must also# be bellow the script 'Victor Engine - Basic'##------------------------------------------------------------------------------# Comment calls note tags:# Tags to be used in events comment box, works like a script call.# # <battler name id: x># This tag allows to change the actor battler graphic.# id : actor ID# x : battler graphic filename## <battler hue id: x># This tag allows to change the actor battler graphic.# id : actor ID# x : battler graphic hue (0-360)## <battler position i: x, y># This tag allows to change the battler position during combat.# only valid if VE_BATTLE_FORMATION = :custom# i : position index# x : new coorditante X# y : new coorditante X##------------------------------------------------------------------------------# Actors note tags:# Tags to be used on the Actors note box in the database## <battler name: x># This tag allows to set the initial battler graphic filename for the actor.# x : battler graphic filename## <battler hue: x># This tag allows to set the initial battler graphic hur for the actor.# x : battler graphic hue (0-360)##------------------------------------------------------------------------------# Enemies note tags:# Tags to be used on the Enemies note box in the database## <attack animation: x># This tag allows to set the normal attack animation for the enemy# x : animation ID# #==============================================================================#==============================================================================# ** Victor Engine#------------------------------------------------------------------------------# Setting module for the Victor Engine#==============================================================================module Victor_Engine #-------------------------------------------------------------------------- # * Set the battle formation # Choose here how the actors battlers will be placed on the combat. # :front : horizontal placement # :side : vertical placement # :iso : isometric placement # :custom : custom placement #-------------------------------------------------------------------------- VE_BATTLE_FORMATION = :front #-------------------------------------------------------------------------- # * Set battler centralization # When true, battlers are centralized automatically. # Not valid if VE_BATTLE_FORMATION = :custom #-------------------------------------------------------------------------- VE_BATTLE_CENTRALIZE = true #-------------------------------------------------------------------------- # * Set battlers custom positions # Only if VE_BATTLE_FORMATION = :custom, allows to set the position of # all party actors, don't forget to add values for all positions # available if using a party bigger than the default. #-------------------------------------------------------------------------- VE_CUSTOM_POSITION = { # Position 1 => {x: 460, y: 180}, # Position for the first actor. 2 => {x: 480, y: 210}, # Position for the second actor. 3 => {x: 500, y: 240}, # Position for the thrid actor. 4 => {x: 520, y: 270}, # Position for the fourth actor. } # Don't remove #-------------------------------------------------------------------------- # * Actors battlers position adjust # Used to adjust the position of all actors battlers. #-------------------------------------------------------------------------- VE_POSITION_ADJUST = {x: 0, y: 0} #-------------------------------------------------------------------------- # * Actors battlers position adjust # Used to adjust the position of all actors battlers. #-------------------------------------------------------------------------- VE_DISTANCE_ADJUST = {x: 48, y: 32} #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the scriptn" msg += "'VE - Basic Module' v%s or higher above it to work properlyn" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value, don't edit this #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") endend$imported ||= {}$imported[:ve_actor_battlers] = 1.04Victor_Engine.required(:ve_actor_battlers, :ve_basic_module, 1.11, :above)#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module handles the game and database objects used in game.# Almost all global variables are initialized on this module#==============================================================================class << DataManager #-------------------------------------------------------------------------- # * Alias method: setup_new_game #-------------------------------------------------------------------------- alias :setup_new_game_ve_actor_battlers :setup_new_game def setup_new_game setup_new_game_ve_actor_battlers $game_custom_positions = VE_CUSTOM_POSITION.dup end #-------------------------------------------------------------------------- # * Alias method: setup_battle_test #-------------------------------------------------------------------------- alias :setup_battle_test_ve_actor_battlers :setup_battle_test def setup_battle_test setup_battle_test_ve_actor_battlers $game_custom_positions = VE_CUSTOM_POSITION.dup end #-------------------------------------------------------------------------- # * Alias method: create_game_objects #-------------------------------------------------------------------------- alias :create_game_objects_ve_actor_battlers :create_game_objects def create_game_objects create_game_objects_ve_actor_battlers $game_custom_positions = {} end #-------------------------------------------------------------------------- # * Alias method: make_save_contents #-------------------------------------------------------------------------- alias :make_save_contents_ve_actor_battlers :make_save_contents def make_save_contents contents = make_save_contents_ve_actor_battlers contents[:formations_ve] = $game_custom_positions contents end #-------------------------------------------------------------------------- # * Alias method: extract_save_contents #-------------------------------------------------------------------------- alias :extract_save_contents_ve_actor_battlers :extract_save_contents def extract_save_contents(contents) extract_save_contents_ve_actor_battlers(contents) $game_custom_positions = contents[:formations_ve] endend#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------# This class handles actors. It's used within the Game_Actors class# ($game_actors) and referenced by the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :screen_x # Coordenada X na tela attr_accessor :screen_y # Coordenada Y na tela #-------------------------------------------------------------------------- # * Alias method: setup #-------------------------------------------------------------------------- alias :setup_ve_actor_battlers :setup def setup(actor_id) setup_ve_actor_battlers(actor_id) @battler_name = actor_battler_name @battler_hue = actor_battler_hue end #-------------------------------------------------------------------------- # * Overwrite method: use_sprite? #-------------------------------------------------------------------------- def use_sprite? return true end #-------------------------------------------------------------------------- # * Overwrite method: screen_z #-------------------------------------------------------------------------- def screen_z return 100 end #-------------------------------------------------------------------------- # * New method: actor_battler_name #-------------------------------------------------------------------------- def actor_battler_name actor.note =~ /<BATTLER NAME: ([^><]*)>/i ? $1.to_s : "" end #-------------------------------------------------------------------------- # * New method: actor_battler_hue #-------------------------------------------------------------------------- def actor_battler_hue actor.note =~ /<BATTLER HUE: (d+)>/i ? $1.to_i : 0 end #-------------------------------------------------------------------------- # * New method: battler_name #-------------------------------------------------------------------------- def battler_name=(name) @battler_name = name if name.is_a?(String) end #-------------------------------------------------------------------------- # * New method: battler_hue #-------------------------------------------------------------------------- def battler_hue=(hue) @battler_hue = hue if hue.numeric? end #-------------------------------------------------------------------------- # * New method: screen_x #-------------------------------------------------------------------------- def screen_x setup_x end #-------------------------------------------------------------------------- # * New method: screen_y #-------------------------------------------------------------------------- def screen_y setup_y end #-------------------------------------------------------------------------- # * New method: setup_x #-------------------------------------------------------------------------- def setup_x case VE_BATTLE_FORMATION when :front then position = get_frontal_x when :side then position = get_sideview_x when :iso then position = get_isometric_x when :custom then position = $game_custom_positions[index + 1][:x] end position + VE_POSITION_ADJUST[:x] end #-------------------------------------------------------------------------- # * New method: setup_y #-------------------------------------------------------------------------- def setup_y case VE_BATTLE_FORMATION when :front then position = get_frontal_y when :side then position = get_sideview_y when :iso then position = get_isometric_y when :custom then position = $game_custom_positions[index + 1][:y] end position + VE_POSITION_ADJUST[:y] end #-------------------------------------------------------------------------- # * New method: get_frontal_x #-------------------------------------------------------------------------- def get_frontal_x if VE_BATTLE_CENTRALIZE size = $game_party.battle_members.size position = (index + 1) * Graphics.width / (size + 1) else size = $game_party.max_battle_members position = index * Graphics.width / size + 64 end position end #-------------------------------------------------------------------------- # * New method: get_frontal_y #-------------------------------------------------------------------------- def get_frontal_y Graphics.height - 16 end #-------------------------------------------------------------------------- # * New method: get_sideview_x #-------------------------------------------------------------------------- def get_sideview_x if VE_BATTLE_CENTRALIZE size = $game_party.max_battle_members x = dist[:x] / 8 position = -index * (index * x - x * size) + Graphics.width - 160 else position = index * dist[:x] + Graphics.width - 192 end position end #-------------------------------------------------------------------------- # * New method: get_sideview_y #-------------------------------------------------------------------------- def get_sideview_y if VE_BATTLE_CENTRALIZE size = $game_party.battle_members.size height = Graphics.height position = (index - size) * dist[:y] + size * dist[:y] / 2 + height - 160 else position = index * dist[:y] + Graphics.height - 192 end position end #-------------------------------------------------------------------------- # * New method: get_isometric_x #-------------------------------------------------------------------------- def get_isometric_x if VE_BATTLE_CENTRALIZE position = -index * (index * dist[:x] - 32) + Graphics.width - 160 else position = index * dist[:x] + Graphics.width - 192 end position end #-------------------------------------------------------------------------- # * New method: get_isometric_y #-------------------------------------------------------------------------- def get_isometric_y if VE_BATTLE_CENTRALIZE position = index * (dist[:y] - index * 6) + Graphics.height - 160 else position = Graphics.height - 96 - index * dist[:y] end position end #-------------------------------------------------------------------------- # * New method: dist #-------------------------------------------------------------------------- def dist VE_DISTANCE_ADJUST endend#==============================================================================# ** Game_Enemy#------------------------------------------------------------------------------# This class handles enemy characters. It's used within the Game_Troop class# ($game_troop).#==============================================================================class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * New method: atk_animation_id1 #-------------------------------------------------------------------------- def atk_animation_id1 enemy.note =~ /<ATTACK ANIM(?:ATION): (d+)>/i ? $1.to_i : 1 end #-------------------------------------------------------------------------- # * New method: atk_animation_id2 #-------------------------------------------------------------------------- def atk_animation_id2 return 0 endend#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------# An interpreter for executing event commands. This class is used within the# Game_Map, Game_Troop, and Game_Event classes.#==============================================================================class Game_Interpreter #-------------------------------------------------------------------------- # * Alias method: comment_call #-------------------------------------------------------------------------- alias :comment_call_ve_actor_battlers :comment_call def comment_call change_battler_name change_battler_hue change_position comment_call_ve_actor_battlers end #-------------------------------------------------------------------------- # * New method: change_battler_name #-------------------------------------------------------------------------- def change_battler_name note.scan(/<BATTLER NAME (d+): ([^><]*)>/i) do |id, name| $game_actors[id.to_i].battler_name = name end end #-------------------------------------------------------------------------- # * New method: change_battler_hue #-------------------------------------------------------------------------- def change_battler_hue note.scan(/<BATTLER HUE (d+): (d+)>/i) do |id, hue| $game_actors[id.to_i].battler_hue = hue end end #-------------------------------------------------------------------------- # * New method: change_position #-------------------------------------------------------------------------- def change_position regexp = /<BATTLER POSITION (d+): (d+) *, *(d+)>/i note.scan(regexp) do |i, x, y| $game_custom_positions[i.to_i][:x] = x.to_i $game_custom_positions[i.to_i][:y] = y.to_i end endend#==============================================================================# ** Spriteset_Battle#------------------------------------------------------------------------------# This class brings together battle screen sprites. It's used within the# Scene_Battle class.#==============================================================================class Spriteset_Battle #-------------------------------------------------------------------------- # * Overwrite method: create_actors #-------------------------------------------------------------------------- def create_actors @actor_sprites = $game_party.battle_members.reverse.collect do |actor| Sprite_Battler.new(@viewport1, actor) end @actors_party = $game_party.battle_members.dup end #-------------------------------------------------------------------------- # * Overwrite method: update_actors #-------------------------------------------------------------------------- def update_actors update_party if $game_party.battle_members != @actors_party @actor_sprites.each {|sprite| sprite.update } end #-------------------------------------------------------------------------- # * New method: update_party #-------------------------------------------------------------------------- def update_party @actor_sprites.each_index do |i| next if $game_party.battle_members.include?(@actor_sprites[i].battler) @actor_sprites[i].dispose @actor_sprites[i] = nil end $game_party.battle_members.collect do |actor| next if @actors_party.include?(actor) @actor_sprites.push(Sprite_Battler.new(@viewport1, actor)) end @actor_sprites.compact! @actors_party = $game_party.battle_members.dup $game_party.battle_members.each do |actor| old_position = [actor.screen_x, actor.screen_y] actor.setup_position if old_position != [actor.screen_x, actor.screen_y] sprite(actor).start_effect(:appear) end end endend#==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------# This class performs battle screen processing.#==============================================================================class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Overwrite method: show_attack_animation #-------------------------------------------------------------------------- def show_attack_animation(targets) show_normal_animation(targets, @subject.atk_animation_id1, false) show_normal_animation(targets, @subject.atk_animation_id2, true) endend
    • Da Ally
      Nome Script: Equipment Requirements
      Versione: 1.2
      Autore/i: Fomar0153
       
      Informazioni:
      Consente di definire i requisiti per Armi e Armature, ed è possibile utilizzare sia il loro livello o una delle loro statistiche.
       
      Istruzioni:
      Inserite lo script sotto Material.
      Istruzioni all'interno dello script.
       
      Script:
       
       
      =beginEquipment Requirementsby Fomar0153Version 1.2----------------------Notes----------------------Adds a level requirement to equipment.----------------------Instructions----------------------Notetag the weapons/armors like so:<levelreq x><mhpreq x><mmpreq x><atkreq x><defreq x><matreq x><mdfreq x><agireq x><lukreq x><switchreq x><wepreq x><armreq x>----------------------Change Log----------------------1.0 -> 1.1 Added stat requirements Changed script name from Equipment Level Requirements to just Equipment Requirements1.1 -> 1.2 Added switch and other equipment requirements----------------------Known bugs----------------------None=endclass Game_BattlerBase #-------------------------------------------------------------------------- # ● If set to true then it compares the requirement with the actor's base # stat rather than their current. #-------------------------------------------------------------------------- EQUIPREQ_USE_BASE_STAT = true #-------------------------------------------------------------------------- # ● Check the requirements #-------------------------------------------------------------------------- alias level_equippable? equippable? def equippable?(item) return false unless item.is_a?(RPG::EquipItem) return false if @level < item.levelreq return false if reqstat(0) < item.mhpreq return false if reqstat(1) < item.mmpreq return false if reqstat(2) < item.atkreq return false if reqstat(3) < item.defreq return false if reqstat(4) < item.matreq return false if reqstat(5) < item.mdfreq return false if reqstat(6) < item.agireq return false if reqstat(7) < item.lukreq if item.switchreq > 0 return false unless $game_switches[item.switchreq] end if item.wepreq > 0 e = [] for equip in @equips if equip.is_weapon? e.push(equip.object.id) end end return false unless e.include?(item.wepreq) unless equip.object.nil? end if item.armreq > 0 e = [] for equip in @equips if equip.is_armor? e.push(equip.object.id) unless equip.object.nil? end end return false unless e.include?(item.armreq) end return level_equippable?(item) end #-------------------------------------------------------------------------- # ● New Method #-------------------------------------------------------------------------- def reqstat(id) if EQUIPREQ_USE_BASE_STAT return param_base(id) else return param(id) end endendmodule RPG #-------------------------------------------------------------------------- # ● Equip Item is inherited by both Weapon and Armor #-------------------------------------------------------------------------- class EquipItem def levelreq if self.note =~ /<levelreq (.*)>/i return $1.to_i else return 0 end end def mhpreq if self.note =~ /<mhpreq (.*)>/i return $1.to_i else return 0 end end def mmpreq if self.note =~ /<mmpreq (.*)>/i return $1.to_i else return 0 end end def atkreq if self.note =~ /<atkreq (.*)>/i return $1.to_i else return 0 end end def defreq if self.note =~ /<defreq (.*)>/i return $1.to_i else return 0 end end def matreq if self.note =~ /<matreq (.*)>/i return $1.to_i else return 0 end end def mdfreq if self.note =~ /<mdfreq (.*)>/i return $1.to_i else return 0 end end def agireq if self.note =~ /<agireq (.*)>/i return $1.to_i else return 0 end end def lukreq if self.note =~ /<lukreq (.*)>/i return $1.to_i else return 0 end end def switchreq if self.note =~ /<switchreq (.*)>/i return $1.to_i else return 0 end end def wepreq if self.note =~ /<wepreq (.*)>/i return $1.to_i else return 0 end end def armreq if self.note =~ /<armreq (.*)>/i return $1.to_i else return 0 end end endend
×