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

Recommended Posts

Nome Script: Animated Battlers
Versione: 1.2
Autore/i: Fomar0153

Informazioni:
Questo script aggiunge la possibilità di avere battlers animati nelle battaglie.

Screenshots:

SS0010.png



Istruzioni:
Inserite lo script sotto Material.
Istruzioni all'interno dello script.

Script:

=begin
Animated Battlers Script
by Fomar0153
Version 1.2
----------------------
Notes
----------------------
Includes Side View Battlers
Compatable with my Customisable ATB/Stamina Based Battle System Script
Make sure this goes above my Customisable ATB/Stamina Based Battle System Script
----------------------
Instructions
----------------------
Edit variables in Animated_Battlers to suit your needs.
You will need to import battlers for the party to use
they should be named like this:
name_battler
e.g.
Ralph_battler
or you can name them through note tagging
----------------------
Change Log
----------------------
1.0 -> 1.1 Added Notetag support for default battlers
           <battler name> and you can edit it through the
           game e.g. $game_actors[1].battler_name = "Fomar0153"
           Added support for individual battler setup
           Added support for different length animations
           Added support for individual skill and item animations
           Added notetag support to further define when skills are
           close and long range. <close> <range>
1.1 -> 1.2 Fixed a bug were pose overrode setpose animation lengths
           Fixed screen_x related bug that sometimes caused positioning errors.
----------------------
Known bugs
----------------------
None
=end

module Animated_Battlers

  # Setup Generics
  # RPG VXA Caps at 60 FPS at best
  FRAMES_PER_SECOND = 4
  # How long it takes for someone to move into position
  MOVEMENT_SECONDS = 1
  # HP level before whoozy pose (percentage)
  LOW_HEALTH_POSE = 50

  # Set up Actor Positions
  X_START = 400
  X_OFFSET = 0
  Y_START = 0
  Y_OFFSET = 60


  BATTLERS = {}
  BATTLERS['DEFAULT'] = {}
  # How many frames there are in an animation
  # Note FRAMES must be set to the maximum
  BATTLERS['DEFAULT']['FRAMES'] = 4
  BATTLERS['DEFAULT']['VFRAMES'] = 14
  # Setup default battlers' standard rows
  BATTLERS['DEFAULT']['POSE_IDLE']     = 0
  BATTLERS['DEFAULT'][0]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_DEFEND']   = 1
  BATTLERS['DEFAULT'][1]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_WHOOZY']   = 2
  BATTLERS['DEFAULT'][2]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_STRUCK']   = 3
  BATTLERS['DEFAULT'][3]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_ATTACK']   = 4
  BATTLERS['DEFAULT'][4]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_ITEM']     = []
  BATTLERS['DEFAULT']['POSE_ITEM'][0]  = 5
  BATTLERS['DEFAULT'][5]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_SKILL']    = []
  BATTLERS['DEFAULT']['POSE_SKILL'][0] = 6
  BATTLERS['DEFAULT'][6]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_MAGIC']    = 7
  BATTLERS['DEFAULT'][7]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_ADVANCE']  = 8
  BATTLERS['DEFAULT'][8]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_RETREAT']  = 9
  BATTLERS['DEFAULT'][9]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_VICTORY']  = 10
  BATTLERS['DEFAULT'][10]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_ENTER']    = 11
  BATTLERS['DEFAULT'][11]               = BATTLERS['DEFAULT']['FRAMES']
  BATTLERS['DEFAULT']['POSE_DEAD']     = 12
  BATTLERS['DEFAULT'][12]               = BATTLERS['DEFAULT']['FRAMES']
  # When doing the victory pose loop back to frame
  # 0 for the first frame
  # (FRAMES - 1) to not loop
  BATTLERS['DEFAULT']['VICTORY_LOOP']  = 1

  # I reccomend adding your non-conformist battlers here
  # copy the big block above starting from:
  # BATTLERS['DEFAULT'] = {}
  # all the way to BATTLERS['DEFAULT']['VICTORY_LOOP']  = 1
  # and then change DEFAULT to the name of the battler.



  def self.get_pose(battler_name, pose, id = nil)
    if BATTLERS[battler_name] == nil
      b = BATTLERS['DEFAULT']
    else
      b = BATTLERS[battler_name]
    end
    if pose == "POSE_ITEM" or pose == "POSE_SKILL"
      if id.nil? or b[pose][id].nil?
        return b[pose][0]
      else
        return b[pose][id]
      end
    elsif !b[pose].nil?
      return b[pose]
    else
      return b['POSE_IDLE']
    end
  end

end

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● New attr_accessor
  #--------------------------------------------------------------------------
  attr_accessor :battler_name
  #--------------------------------------------------------------------------
  # ● Aliases setup
  #--------------------------------------------------------------------------
  alias ab_setup setup
  def setup(actor_id)
    ab_setup(actor_id)
    if actor.note =~ /<battler (.*)>/i
      @battler_name = $1
    else
      @battler_name = actor.name + "_battler"
    end
  end
  #--------------------------------------------------------------------------
  # ● Rewrites use_sprite?
  #--------------------------------------------------------------------------
  def use_sprite?
    return true
  end
  #--------------------------------------------------------------------------
  # ● New Method screen_x
  #--------------------------------------------------------------------------
  def screen_x
    return Animated_Battlers::X_START + self.index * Animated_Battlers::X_OFFSET
  end
  #--------------------------------------------------------------------------
  # ● New Method screen_y
  #--------------------------------------------------------------------------
  def screen_y
    return Animated_Battlers::Y_START + self.index * Animated_Battlers::Y_OFFSET
  end
  #--------------------------------------------------------------------------
  # ● New Method screen_z
  #--------------------------------------------------------------------------
  def screen_z
    return 100
  end
end

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● Rewrites create_actors
  #--------------------------------------------------------------------------
  def create_actors
    @actor_sprites = $game_party.battle_members.reverse.collect do |actor|
      Sprite_Battler.new(@viewport1, actor)
    end
  end
end

class Sprite_Battler < Sprite_Base
  #--------------------------------------------------------------------------
  # ● Aliases initialize
  #--------------------------------------------------------------------------
  alias ab_initialize initialize
  def initialize(viewport, battler = nil)
    ab_initialize(viewport, battler)
    @frame = 0
    @mframe = 0
    @pose = 0
    @set_pose = Animated_Battlers.get_pose(@battler.battler_name,"POSE_ENTER")
  end
  #--------------------------------------------------------------------------
  # ● Rewrote update_src_rect
  #--------------------------------------------------------------------------
  def update_src_rect
    sx = (@frame / (60 / Animated_Battlers::FRAMES_PER_SECOND)) * @cw
    if @set_pose >= 0
      sy = @set_pose * bitmap.height / (Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES"))
    else
      sy = @pose * bitmap.height / (Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES"))
    end
    self.src_rect.set(sx, sy, @cw, @ch)
  end
  #--------------------------------------------------------------------------
  # ● Destroyed update_collapse
  #--------------------------------------------------------------------------
  def update_collapse
    return
  end
  #--------------------------------------------------------------------------
  # ● Aliases start_effect
  #--------------------------------------------------------------------------
  alias ab_start_effect start_effect
  def start_effect(effect_type)
    return if effect_type = :collapse
    ab_start_effect
  end
  #--------------------------------------------------------------------------
  # ● Rewrote update_position
  #--------------------------------------------------------------------------
  def update_position
    if @battler.actor?
      self.x = @battler.screen_x
      self.ox = 0
      self.y = @battler.screen_y + bitmap.height
      if @battler.moving > 0
        self.x += (@mframe * (@battler.target_x - @battler.target_width - self.<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt=':grah1' /> / (60 * Animated_Battlers::MOVEMENT_SECONDS))
        self.y += @mframe * (@battler.target_y - self.y + (bitmap.height * (Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES") - 1)/Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES"))) / (60 * Animated_Battlers::MOVEMENT_SECONDS)
      end
    else
      self.x = @battler.screen_x
      self.y = @battler.screen_y + (bitmap.height * (Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES") - 1)) / Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES")
      if @battler.moving > 0
        self.x += (@mframe * (@battler.target_x - self.x + @battler.bitmap_width / Animated_Battlers.get_pose(@battler.battler_name, "FRAMES")) / (60 * Animated_Battlers::MOVEMENT_SECONDS))
        self.y += @mframe * (@battler.target_y + @battler.target_height - @battler.screen_y) / (60 * Animated_Battlers::MOVEMENT_SECONDS)
      end
    end
    self.z = @battler.screen_z
  end
  #--------------------------------------------------------------------------
  # ● New Method update_pose
  #--------------------------------------------------------------------------
  def update_pose
    if @battler.set_pose >= 0
      @set_pose = @battler.set_pose
      @frame = 0
      @battler.set_pose = -1
    end
    return if @set_pose > 0 or @battler.moving > 0
    if @battler.dead?
      @pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_DEAD")
      return
    end
    if $game_troop.all_dead?
      @pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_VICTORY")
      return
    end
    if battler.guard?
      @pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_DEFEND")
      return
    end
    if battler.hp <= (battler.mhp * Animated_Battlers::LOW_HEALTH_POSE / 100)
      @pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_WHOOZY")
      return
    end
    @pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_IDLE")
  end
  #--------------------------------------------------------------------------
  # ● Rewrote update
  #--------------------------------------------------------------------------
  def update
    super
    @frame += 1
    if @battler.moving == 1 and @mframe == 0
      @set_pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_ADVANCE")
    end
    if @battler.moving == 3 and @mframe == (60 * Animated_Battlers::MOVEMENT_SECONDS)
      @set_pose = Animated_Battlers.get_pose(@battler.battler_name, "POSE_RETREAT")
    end
    @mframe += 1 if @set_pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_ADVANCE")
    @mframe -= 1 if @set_pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_RETREAT")
    if (@mframe == 0 or @mframe == (60 * Animated_Battlers::MOVEMENT_SECONDS)) and @battler.moving?
      @set_pose = -1
      @battler.moving = (@battler.moving + 1) % 4
    end
    if @frame >= (Animated_Battlers.get_pose(@battler.battler_name, @set_pose) * (60 / Animated_Battlers::FRAMES_PER_SECOND)) and @set_pose > 0
      if @pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_VICTORY")
        @frame = (Animated_Battlers.get_pose(@battler.battler_name, "VICTORY_LOOP") * (60 / Animated_Battlers::FRAMES_PER_SECOND))
      else
        @frame = 0
      end
      @set_pose = -1 unless (@set_pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_ADVANCE") or @set_pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_RETREAT"))
    end
    if @frame >= (Animated_Battlers.get_pose(@battler.battler_name, @pose) * (60 / Animated_Battlers::FRAMES_PER_SECOND))
      if @pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_VICTORY")
        @frame = (Animated_Battlers.get_pose(@battler.battler_name, "VICTORY_LOOP") * (60 / Animated_Battlers::FRAMES_PER_SECOND))
      else
        @frame = 0
      end
      @set_pose = -1 unless (@set_pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_ADVANCE") or @set_pose == Animated_Battlers.get_pose(@battler.battler_name, "POSE_RETREAT"))
    end
    last_pose = @pose
    update_pose
    if last_pose != @pose
      @frame = 0
    end
    if @battler
      @use_sprite = @battler.use_sprite?
      if @use_sprite
        update_bitmap
        update_origin
        update_position
        update_src_rect
      end
      setup_new_effect
      setup_new_animation
      update_effect
    else
      self.bitmap = nil
      @effect_type = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● New Method moving?
  #--------------------------------------------------------------------------
  def moving?
    return !(@mframe == 0 or @mframe == 60 * Animated_Battlers::MOVEMENT_SECONDS)
  end
  #--------------------------------------------------------------------------
  # ● Rewrote update_bitmap
  #--------------------------------------------------------------------------
  def update_bitmap
    new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
    if bitmap != new_bitmap
      self.bitmap = new_bitmap
      @cw = bitmap.width / Animated_Battlers.get_pose(@battler.battler_name, "FRAMES")
      @ch = bitmap.height / Animated_Battlers.get_pose(@battler.battler_name, "VFRAMES")
      init_visibility
      @battler.bitmap_height = bitmap.height
      @battler.bitmap_width = bitmap.width
    end
  end
  #--------------------------------------------------------------------------
  # ● Rewrote effect?
  #--------------------------------------------------------------------------
  def effect?
    return (@effect_type != nil or moving?)
  end
end

class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # ● New attr_accessors
  #--------------------------------------------------------------------------
  attr_accessor :target_x
  attr_accessor :target_y
  attr_accessor :target_width
  attr_accessor :target_height
  attr_accessor :moving
  attr_accessor :set_pose
  attr_accessor :bitmap_height
  attr_accessor :bitmap_width
  #--------------------------------------------------------------------------
  # ● Aliases initialize
  #--------------------------------------------------------------------------
  alias ab_initialize initialize
  def initialize
    ab_initialize
    @target_x = 0
    @target_y = 0
    @target_width = 0
    @target_height = 0
    @moving = 0
    @set_pose = -1
    @bitmap_height = 0
    @bitmap_width = 0
  end
  #--------------------------------------------------------------------------
  # ● New Method move_to
  #--------------------------------------------------------------------------
  def move_to(target)
    @target_x = target.screen_x
    @target_y = target.screen_y
    @target_width = target.bitmap_width / Animated_Battlers.get_pose(target.battler_name, "FRAMES")
    @target_height = target.bitmap_height / Animated_Battlers.get_pose(target.battler_name, "VFRAMES")
    @moving = 1
  end
  #--------------------------------------------------------------------------
  # ● New Method moving?
  #--------------------------------------------------------------------------
  def moving?
    return (@moving == 1 or @moving == 3)
  end
end

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● Rewrote use_item
  #--------------------------------------------------------------------------
  def use_item
    item = @subject.current_action.item
    @log_window.display_use_item(@subject, item)
    @subject.use_item(item)
    refresh_status
    targets = @subject.current_action.make_targets.compact
    targets.each {|target| item.repeats.times { invoke_item(target, item) } }
  end
  #--------------------------------------------------------------------------
  # ● Rewrote invoke_item
  #--------------------------------------------------------------------------
  def invoke_item(target, item)
    if rand < target.item_cnt(@subject, item)
      invoke_counter_attack(target, item)
    elsif rand < target.item_mrf(@subject, item)
      invoke_magic_reflection(target, item)
    else
      if item.is_a?(RPG::Item)
        @subject.set_pose = Animated_Battlers.get_pose(@subject.battler_name, "POSE_ITEM", item.id)
        show_animation([target], item.animation_id)
        apply_item_effects(apply_substitute(target, item), item)
      elsif item.is_a?(RPG::Skill)
        if item.id == @subject.attack_skill_id
          @subject.move_to(target)
          update_for_wait while @subject.moving?
          @subject.set_pose = Animated_Battlers.get_pose(@subject.battler_name, "POSE_ATTACK")
          target.set_pose = Animated_Battlers.get_pose(target.battler_name, "POSE_STRUCK")
          show_animation([target], item.animation_id)
          apply_item_effects(apply_substitute(target, item), item)
          @subject.moving = 3
          update_for_wait while @subject.moving?
        elsif item.id == @subject.guard_skill_id
          show_animation([target], item.animation_id)
          apply_item_effects(apply_substitute(target, item), item)
        elsif (item.magical? or item.note.include?("<range>")) and not item.note.include?("<close>")
          @subject.set_pose = Animated_Battlers.get_pose(@subject.battler_name, "POSE_MAGIC",item.id)
          target.set_pose = Animated_Battlers.get_pose(target.battler_name, "POSE_STRUCK") if item.for_opponent?
          show_animation([target], item.animation_id)
          apply_item_effects(apply_substitute(target, item), item)
        else
          if item.for_opponent?
            @subject.move_to(target)
            update_for_wait while @subject.moving?
            @subject.set_pose = Animated_Battlers.get_pose(@subject.battler_name, "POSE_SKILL", item.id)
            target.set_pose = Animated_Battlers.get_pose(target.battler_name, "POSE_STRUCK")
            show_animation([target], item.animation_id)
            apply_item_effects(apply_substitute(target, item), item)
            @subject.moving = 3
            update_for_wait while @subject.moving?
          else
            @subject.set_pose = Animated_Battlers.get_pose(@subject.battler_name, "POSE_SKILL", item.id)
            show_animation([target], item.animation_id)
            apply_item_effects(apply_substitute(target, item), item)
          end
        end
      end
    end
    @subject.last_target_index = target.index
  end
end

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
×