[Pedido] Script Muerto y fallo de Compatibilidad.

8:44 PM Posted by Mario Galarza

The remote server returned an unexpected response: (400) Bad Request.
The remote server returned an unexpected response: (400) Bad Request.
Predeterminado [Pedido] Script Muerto y fallo de Compatibilidad. Son 2 cosas:
1-Ando buscando este script pero TODOS los que e encontrado tienen el mismo enlace de descarga, el cual por desgracia esta ca?do...
Information Desk System
Versi?n 1.0

Im?genes
Spoiler

Ya no me interesa la versi?n, solo encuentrenme alguno por favor.

2-Estoy usando el ABS Requiem Hero V3, y cuando intento usa ya sea:
Pet (Utiliza un sprite de alg?n protagonista para que te siga.)
#==============================================================================# Pet#==============================================================================# Author : OriginalWij# Version : 1.3#==============================================================================#==============================================================================# v1.0# - Initial release# v1.1# - Added options to have pet in battle (auto-battle only)# v1.2# - Won't show pet if in vehicle# v1.3# - Added option to allow gameover if only the pet survives battle#==============================================================================#==============================================================================# Config#==============================================================================module OW_PET # Pet enable switch number PET_ENABLE_SWITCH = 1 # Pet ID (database actor number) [IMPORTANT: MUST be set to 'Auto-Battle'] PET_ID = 5 # Use pet in battle? PET_BATTLE = true # Heal pet after each battle? (if above = true) PET_HEAL = true # Allow game-over if the pet is the ONLY party member alive PET_GAMEOVER = trueend#==============================================================================# Game_Character#==============================================================================class Game_Character #-------------------------------------------------------------------------- # Public instance variables (New) #-------------------------------------------------------------------------- attr_accessor :priority_typeend#==============================================================================# Game_Player#==============================================================================class Game_Player #-------------------------------------------------------------------------- # Public instance variables (New) #-------------------------------------------------------------------------- attr_reader :move_speed #-------------------------------------------------------------------------- # Update (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_update update unless $@ def update $game_party.update_pet ow_pet_game_player_update end #-------------------------------------------------------------------------- # Move to (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_moveto moveto unless $@ def moveto(x, y) $game_party.moveto_pet(x, y) ow_pet_game_player_moveto(x, y) end #-------------------------------------------------------------------------- # Move down (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_down move_down unless $@ def move_down(turn = true) if passable?(@x, @y + 1) $game_party.move_pet(2, turn) end ow_pet_game_player_move_down(turn) end #-------------------------------------------------------------------------- # Move left (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_left move_left unless $@ def move_left(turn = true) if passable?(@x - 1, @y) $game_party.move_pet(4, turn) end ow_pet_game_player_move_left(turn) end #-------------------------------------------------------------------------- # Move right (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_right move_right unless $@ def move_right(turn = true) if passable?(@x + 1, @y) $game_party.move_pet(6, turn) end ow_pet_game_player_move_right(turn) end #-------------------------------------------------------------------------- # Move up (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_up move_up unless $@ def move_up(turn = true) if passable?(@x, @y - 1) $game_party.move_pet(8, turn) end ow_pet_game_player_move_up(turn) end #-------------------------------------------------------------------------- # Move down left (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_playermove_lower_left move_lower_left unless $@ def move_lower_left if passable?(@x - 1, @y + 1) $game_party.move_pet(1) end ow_pet_game_playermove_lower_left end #-------------------------------------------------------------------------- # Move down right (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_playermove_lower_right move_lower_right unless $@ def move_lower_right if passable?(@x + 1, @y + 1) $game_party.move_pet(3) end ow_pet_game_playermove_lower_right end #-------------------------------------------------------------------------- # Move up left (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_upper_left move_upper_left unless $@ def move_upper_left if passable?(@x - 1, @y - 1) $game_party.move_pet(5) end ow_pet_game_player_move_upper_left end #-------------------------------------------------------------------------- # Move up right (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_upper_right move_upper_right unless $@ def move_upper_right if passable?(@x + 1, @y - 1) $game_party.move_pet(7) end ow_pet_game_player_move_upper_right end #-------------------------------------------------------------------------- # Jump (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_jump jump unless $@ def jump(ow_pet_x, ow_pet_y) new_x = @x + ow_pet_x new_y = @y + ow_pet_y if (ow_pet_x == 0 and ow_pet_y == 0) or passable?(new_x, new_y) $game_party.move_pet(9, [ow_pet_x, ow_pet_y]) end ow_pet_game_player_jump(ow_pet_x, ow_pet_y) endend#==============================================================================# Game_Party#==============================================================================class Game_Party #-------------------------------------------------------------------------- # Include (New) #-------------------------------------------------------------------------- include OW_PET #-------------------------------------------------------------------------- # Public instance variables (New) #-------------------------------------------------------------------------- attr_reader :pet #-------------------------------------------------------------------------- # Initialize (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_party_initialize initialize unless $@ def initialize ow_pet_game_party_initialize @pet = Game_Pet.new(nil) @move_pet = [] end #-------------------------------------------------------------------------- # Update pet (New) #-------------------------------------------------------------------------- def update_pet @pet.actor = PET_ID @pet.move_speed = $game_player.move_speed if $game_player.dash? @pet.move_speed += 1 end @pet.update @pet.transparent = !$game_switches[PET_ENABLE_SWITCH] @pet.transparent = true if $game_player.in_vehicle? end #-------------------------------------------------------------------------- # Determine Everyone is Dead (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_party_all_dead? all_dead? unless $@ def all_dead? if $game_switches[PET_ENABLE_SWITCH] and PET_GAMEOVER and $game_temp.in_battle and existing_members == [$game_actors[PET_ID]] return true end ow_pet_game_party_all_dead? end #-------------------------------------------------------------------------- # Move to (pet) (New) #-------------------------------------------------------------------------- def moveto_pet(x, y) @pet.moveto(x, y) @move_pet.clear end #-------------------------------------------------------------------------- # Move pet (New) #-------------------------------------------------------------------------- def move_pet(type, turn = false) if @move_pet == nil @move_pet = [type, turn] do_type = 0 else do_type = @move_pet[0] do_turn = @move_pet[1] @move_pet = [type, turn] end case do_type when 1 @pet.move_lower_left when 2 @pet.move_down(do_turn) when 3 @pet.move_lower_right when 4 @pet.move_left(do_turn) when 5 @pet.move_upper_left when 6 @pet.move_right(do_turn) when 7 @pet.move_upper_right when 8 @pet.move_up(do_turn) when 9 @pet.jump(do_turn[0], do_turn[1]) end endend#==============================================================================# Game_Pet (New)#==============================================================================class Game_Pet < Game_Character #-------------------------------------------------------------------------- # Public instance variables #-------------------------------------------------------------------------- attr_reader :actor attr_accessor :move_speed #-------------------------------------------------------------------------- # Initialize #-------------------------------------------------------------------------- def initialize(actor) super() @through = true @actor = actor end #-------------------------------------------------------------------------- # Set actor #-------------------------------------------------------------------------- def actor=(actor) @actor = actor setup end #-------------------------------------------------------------------------- # Setup #-------------------------------------------------------------------------- def setup if @actor != nil @character_name = $game_actors[@actor].character_name @character_index = $game_actors[@actor].character_index else @character_name = "" @character_index = 0 end @priority_type = $game_player.priority_type end #-------------------------------------------------------------------------- # Get screen Z #-------------------------------------------------------------------------- def screen_z if $game_player.x == @x and $game_player.y == @y return $game_player.screen_z - 1 end super end #-------------------------------------------------------------------------- # Chek event trigger (here) #-------------------------------------------------------------------------- def check_event_trigger_here(triggers) return false end #-------------------------------------------------------------------------- # Check event trigger (there) #-------------------------------------------------------------------------- def check_event_trigger_there(triggers) return false end #-------------------------------------------------------------------------- # Check event trigger (touch) #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) return false end #-------------------------------------------------------------------------- # Jump #-------------------------------------------------------------------------- def jump(x, y) super(x, y) endend#==============================================================================# Spriteset_Map#==============================================================================class Spriteset_Map #-------------------------------------------------------------------------- # Create characters (Mod) #-------------------------------------------------------------------------- alias ow_pet_spriteset_map_create_characters create_characters unless $@ def create_characters ow_pet_spriteset_map_create_characters @character_sprites << Sprite_Character.new(@viewport1, $game_party.pet) endend#==============================================================================# Scene_Battle#==============================================================================class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # Include (New) #-------------------------------------------------------------------------- include OW_PET #-------------------------------------------------------------------------- # Start (Mod) #-------------------------------------------------------------------------- alias ow_pet_scene_battle_start start unless $@ def start if $game_party.members.size < 4 and $game_switches[PET_ENABLE_SWITCH] and PET_BATTLE $game_party.add_actor(PET_ID) end ow_pet_scene_battle_start end #-------------------------------------------------------------------------- # End battle (Mod) #-------------------------------------------------------------------------- alias ow_pet_scene_battle_battle_end battle_end unless $@ def battle_end(result) $game_party.remove_actor(PET_ID) ow_pet_scene_battle_battle_end(result) $game_actors[PET_ID].recover_all if PET_HEAL endendo
Caterpillar (Para que los miembros de tu grupo te sigan)
class Game_Player #-------------------------------------------------------------------------- # * Move Down # turn_enabled : a flag permits direction change on that spot #-------------------------------------------------------------------------- def move_down(turn_enabled = true) super(turn_enabled) end #-------------------------------------------------------------------------- # * Move Left # turn_enabled : a flag permits direction change on that spot #-------------------------------------------------------------------------- def move_left(turn_enabled = true) super(turn_enabled) end #-------------------------------------------------------------------------- # * Move Right # turn_enabled : a flag permits direction change on that spot #-------------------------------------------------------------------------- def move_right(turn_enabled = true) super(turn_enabled) end #-------------------------------------------------------------------------- # * Move up # turn_enabled : a flag permits direction change on that spot #-------------------------------------------------------------------------- def move_up(turn_enabled = true) super(turn_enabled) end #-------------------------------------------------------------------------- # * Move Lower Left #-------------------------------------------------------------------------- def move_lower_left super end #-------------------------------------------------------------------------- # * Move Lower Right #-------------------------------------------------------------------------- def move_lower_right super end #-------------------------------------------------------------------------- # * Move Upper Left #-------------------------------------------------------------------------- def move_upper_left super end #-------------------------------------------------------------------------- # * Move Upper Right #-------------------------------------------------------------------------- def move_upper_right super end endclass Game_Follower < Game_Character #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :actor attr_accessor :move_speed #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(actor) super() @through = true @actor = actor end #-------------------------------------------------------------------------- # * Set Actor #-------------------------------------------------------------------------- def actor=(actor) @actor = actor setup end #-------------------------------------------------------------------------- # * Setup #-------------------------------------------------------------------------- def setup if @actor != nil @character_name = $game_actors[@actor].character_name @character_index = $game_actors[@actor].character_index else @character_name = "" @character_index = 0 end @opacity = 255 @blend_type = 0 @priority_type = 0 end #-------------------------------------------------------------------------- # * Screen Z #-------------------------------------------------------------------------- def screen_z if $game_player.x == @x and $game_player.y == @y return $game_player.screen_z - 1 end super end #-------------------------------------------------------------------------- # * Same Position Starting Determinant (Disabled) #-------------------------------------------------------------------------- def check_event_trigger_here(triggers) result = false return result end #-------------------------------------------------------------------------- # * Front Envent Starting Determinant (Disabled) #-------------------------------------------------------------------------- def check_event_trigger_there(triggers) result = false return result end #-------------------------------------------------------------------------- # * Touch Event Starting Determinant (Disabled) #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) result = false return result end endclass Spriteset_Map alias_method :spriteset_map_create_characters, :create_characters def create_characters spriteset_map_create_characters $game_party.followers.each do |char| @character_sprites << Sprite_Character.new(@viewport1, char) end endendclass Game_Party #-------------------------------------------------------------------------- # * Constants #-------------------------------------------------------------------------- MAX_SIZE = 8 CATERPILLAR = 2 #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :followers #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias_method :trick_caterpillar_party_initialize, :initialize def initialize trick_caterpillar_party_initialize @followers = Array.new(MAX_SIZE - 1) {Game_Follower.new(nil)} @move_list = [] end #-------------------------------------------------------------------------- # * Update Followers #-------------------------------------------------------------------------- def update_followers flag = $game_player.transparent || $game_switches[CATERPILLAR] @followers.each_with_index do |char, i| char.actor = @actors[i + 1] char.move_speed = $game_player.move_speed if $game_player.dash? char.move_speed += 1 end char.update char.transparent = flag end end#--------------------------------------------------------------------------# * Move To Party#--------------------------------------------------------------------------def moveto_party(x, y) @followers.each {|char| char.moveto(x, y)} @move_list.clear end#--------------------------------------------------------------------------# * Move Party#--------------------------------------------------------------------------def move_party @move_list.each_index do |i| if @followers[i] == nil @move_list[i...@move_list.size] = nil next end case @move_list[i].type when 2 @followers[i].move_down(*@move_list[i].args) when 4 @followers[i].move_left(*@move_list[i].args) when 6 @followers[i].move_right(*@move_list[i].args) when 8 @followers[i].move_up(*@move_list[i].args) when j @followers[i].move_lower_left when 3 @followers[i].move_lower_right when 7 @followers[i].move_upper_left when 9 @followers[i].move_upper_right when 5 @followers[i].jump(*@move_list[i].args) end endend#--------------------------------------------------------------------------# * Add Move List#--------------------------------------------------------------------------def update_move(type, *args) move_party @move_list.unshift(Game_MoveListElement.new(type, args)) endendclass Game_MoveListElement #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(type, args) @type = type @args = args end #-------------------------------------------------------------------------- # * Type #-------------------------------------------------------------------------- def type return @type end #-------------------------------------------------------------------------- # * Args #-------------------------------------------------------------------------- def args return @args end endclass Game_Player #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :move_speed #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_update, :update def update $game_party.update_followers trick_caterpillar_player_update end #-------------------------------------------------------------------------- # * Moveto #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_moveto, :moveto def moveto(x, y) $game_party.moveto_party(x, y) trick_caterpillar_player_moveto(x, y) end #-------------------------------------------------------------------------- # * Move Down #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_down, :move_down def move_down(turn_enabled = true) if passable?(@x, @y+1) $game_party.update_move(2, turn_enabled) end trick_caterpillar_player_move_down(turn_enabled) end #-------------------------------------------------------------------------- # * Move Left #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_left, :move_left def move_left(turn_enabled = true) if passable?(@x-1, @y) $game_party.update_move(4, turn_enabled) end trick_caterpillar_player_move_left(turn_enabled) end #-------------------------------------------------------------------------- # * Move Right #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_right, :move_right def move_right(turn_enabled = true) if passable?(@x+1, @y) $game_party.update_move(6, turn_enabled) end trick_caterpillar_player_move_right(turn_enabled) end #-------------------------------------------------------------------------- # * Move Up #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_up, :move_up def move_up(turn_enabled = true) if passable?(@x, @y-1) $game_party.update_move(8, turn_enabled) end trick_caterpillar_player_move_up(turn_enabled) end #-------------------------------------------------------------------------- # * Move Lower Left #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_lower_left, :move_lower_left def move_lower_left if passable?(@x - 1, @y) and passable?(@x, @y + 1) $game_party.update_move(1) end trick_caterpillar_player_move_lower_left end #-------------------------------------------------------------------------- # * Move Lower Right #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_lower_right, :move_lower_right def move_lower_right if passable?(@x + 1, @y) and passable?(@x, @y + 1) $game_party.update_move(3) end trick_caterpillar_player_move_lower_right end #-------------------------------------------------------------------------- # * Move Upper Left #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_upper_left, :move_upper_left def move_upper_left if passable?(@x - 1, @y) and passable?(@x, @y - 1) $game_party.update_move(7) end trick_caterpillar_player_move_upper_left end #-------------------------------------------------------------------------- # * Move Upper Right #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_move_upper_right, :move_upper_right def move_upper_right if passable?(@x + 1, @y) and passable?(@x, @y - 1) $game_party.update_move(9) end trick_caterpillar_player_move_upper_right end #-------------------------------------------------------------------------- # * Jump #-------------------------------------------------------------------------- alias_method :trick_caterpillar_player_jump, :jump def jump(x_plus, y_plus) new_x = @x + x_plus new_y = @y + y_plus if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y) $game_party.update_move(5, x_plus, y_plus) end trick_caterpillar_player_jump(x_plus, y_plus) end endMe salta error en esta linea con el PET:
284: "@character_name = $game_actors[@actor].character_name" (script pet)
Y: "if @character.actor != nil and @character.actor.damage != 0" Con el caterpillar... y tambien el PET. (Script Requiem Sistem)
Aqui el script completo:
#=====================================================================## Requiem ABS 4 By Vlad (Original code) ## Requiem ABS Hero Edition by Falcao ## Para soporte vicitar la siguiente web: ## makerpalace.onlinegoo.com Date: Abril 17 del 2010 ##=====================================================================## Update 3.1module FalKey module_function def key(letter) case letter when 'A', 'a'; k = Input::X when 'S', 's'; k = Input::Y when 'D', 'd'; k = Input::Z when 'Q', 'q'; k = Input::L when 'W', 'w'; k = Input::R when 'Z', 'z', 'ESPACIO', 'espacio'; k = Input::C when 'X', 'x', 'ESC' 'esc'; k = Input::B when 'SHIFT', 'shift'; k = Input::A when 'ALT', 'alt'; k = Input::ALT end return k endendmodule Falre def self.auto_equip_item(id) actor = $game_party.members[0] return unless $game_party.has_item?($data_items[id]) actor.item_hotkeys[FalKey.key(Falcao::Item_Button)] = id $falref = true end def self.auto_equip_skill(id) actor = $game_party.members[0] return unless actor.skill_learn?($data_skills[id]) actor.skill_hotkeys[FalKey.key(Falcao::Skill_Button)] = id $falref = true end def self.event_pop(id, text) return unless $game_map.events[id].in_battle $game_map.events[id].actor.damage = text end def self.player_pop(text) $game_player.actor.damage = text end endmodule FALCAO_VELOCIDAD def speed(x) @move_speed = x end def animar(animar_id) self.animation_id = animar_id end end class Game_Event < Game_Character include FALCAO_VELOCIDADend#==============================================================================# Requiem Masterpiecemodule Requiem_Masterpiece Version = 1.2 @scripts = {} @warnings = {} Print_Errors = true def self.register(script, version, date) @scripts[script] = [version, date] end def self.enabled?(script, version = nil) if version != nil and @scripts.include?(script) if @scripts[script][0] >= version return true elsif @warnings[script].nil? and Print_Errors print "'#{script}' is obsolete.\r\nSome functions won't work correctly" @warnings[script] = ["is obsolete"] self.write_log end end return true if @scripts[script] != nil if @scripts[script].nil? and $TEST and @warnings[script].nil? and Print_Errors print "Unable to find script '#{script}' or it is placed in wrong place.\r\nSome functions won't work correctly" @warnings[script] = ["Unable to find"] self.write_log end return false end def self.show_scripts(alert=true) list = "Requiem Scripts [#{@scripts.size}]:\r\n\r\n" @scripts.each { |key, value| list += "#{key.gsub("Requiem ", "")} #{value[0]} #{value[1]}\r\n" } list += "\r\nWarnings:\r\n" if @warnings != {} @warnings.each { |key, value| list += "#{key} #{value}\r\n" } return print list if alert return list end def self.write_log file = File.new("Requiem/Requiem_Log-#{Time.now.strftime("%m_%d_%Y")}.log", "w") file.write(self.show_scripts(false)) file.close end end#==============================================================================# Requiem Extended Movements#==============================================================================#------------------------------------------------------------------------------Requiem_Masterpiece.register("Requiem Extended Movements", 1.0, "03/31/2009")#------------------------------------------------------------------------------class Game_Character attr_accessor :character_name attr_accessor :character_index attr_accessor :move_type attr_accessor :move_route attr_accessor :direction_fix attr_accessor :walk_anime attr_accessor :step_anime attr_accessor :move_speed attr_accessor :through attr_accessor :priority_type def area_size?(parent, target, size) distance = (parent.x - target.x).abs + (parent.y - target.y).abs enable = (distance <= size) return true if enable return false end def sensor_self_switch(event, value) key = [$game_map.map_id, event.id, "D"] $game_self_switches[key] = value $game_map.need_refresh = true end def in_range?(parent, target, range) x = (parent.x - target.x) * (parent.x - target.x) y = (parent.y - target.y) * (parent.y - target.y) r = x + y return true if r <= (range * range) return false end def in_direction?(parent, target) return true if parent.direction == 2 and target.y >= parent.y and target.x == parent.x return true if parent.direction == 4 and target.x <= parent.x and target.y == parent.y return true if parent.direction == 6 and target.x >= parent.x and target.y == parent.y return true if parent.direction == 8 and target.y <= parent.y and target.x == parent.x return false end def in_front?(parent, target) return true if parent.direction == 2 and parent.x == target.x and (parent.y+1) == target.y return true if parent.direction == 4 and (parent.x-1) == target.x and parent.y == target.y return true if parent.direction == 6 and (parent.x+1) == target.x and parent.y == target.y return true if parent.direction == 8 and parent.x == target.x and (parent.y-1) == target.y return false end def on_event?(parent, target) return true if parent.x == target.x and (parent.y) == target.y return false end def in_behind?(parent, target) return true if target.direction == 2 and parent.x == target.x and parent.y < target.y return true if target.direction == 4 and parent.x > target.x and parent.y == target.y return true if target.direction == 6 and parent.x < target.x and parent.y == target.y return true if target.direction == 8 and parent.x == target.x and parent.y > target.y return false end def in_beside?(parent, target) return true if target.direction == 2 and parent.direction == 4 and target.x == (parent.x-1) and target.y == parent.y return true if target.direction == 2 and parent.direction == 6 and target.x == (parent.x+1) and target.y == parent.y return true if target.direction == 4 and parent.direction == 2 and target.x == parent.x and target.y == (parent.y+1) return true if target.direction == 4 and parent.direction == 8 and target.x == parent.x and target.y == (parent.y-1) return true if target.direction == 6 and parent.direction == 2 and target.x == parent.x and target.y == (parent.y+1) return true if target.direction == 6 and parent.direction == 8 and target.x == parent.x and target.y == (parent.y-1) return true if target.direction == 8 and parent.direction == 4 and target.x == (parent.x-1) and target.y == parent.y return true if target.direction == 8 and parent.direction == 6 and target.x == (parent.x+1) and target.y == parent.y return false end def face_to_face?(parent, target) return true if parent.direction == 2 and target.direction == 8 return true if parent.direction == 4 and target.direction == 6 return true if parent.direction == 6 and target.direction == 4 return true if parent.direction == 8 and target.direction == 2 return false end def is_passable?(object, dir) x = dir == 4 ? -1 : dir == 6 ? 1 : 0 y = dir == 2 ? 1 : dir == 8 ? -1 : 0 return false if !$game_map.passable?(object.x+x, object.y+y) return true end def in_screen?(object) return false if $game_player.screen_x <= 40 return false if $game_player.screen_y <= 50 return false if $game_player.screen_x >= 544 - 20 return false if $game_player.screen_y >= 416 - 5 return true if object.screen_x <= 40 return true if object.screen_y <= 50 return true if object.screen_x >= 544 - 20 return true if object.screen_y >= 416 - 5 return false end def events_xy(object, dir) x = dir == 4 ? -1 : dir == 6 ? 1 : 0 y = dir == 2 ? 1 : dir == 8 ? -1 : 0 for i in $game_map.events.values return true if i.x == object.x+x and i.y == object.y+y and !i.through end return false end def move_toward(target) sx = distance_x_from(target) sy = distance_y_from(target) if sx != 0 or sy != 0 if sx.abs > sy.abs sx > 0 ? move_left : move_right if @move_failed and sy != 0 sy > 0 ? move_up : move_down end else sy > 0 ? move_up : move_down if @move_failed and sx != 0 sx > 0 ? move_left : move_right end end end end def turn_toward(target) sx = distance_x_from(target) sy = distance_y_from(target) if sx.abs > sy.abs sx > 0 ? turn_left : turn_right elsif sx.abs < sy.abs sy > 0 ? turn_up : turn_down end end def distance_x_from(target) sx = @x - target.x if $game_map.loop_horizontal? if sx.abs > $game_map.width / 2 sx -= $game_map.width end end return sx end def distance_y_from(target) sy = @y - target.y if $game_map.loop_vertical? if sy.abs > $game_map.height / 2 sy -= $game_map.height end end return sy end end#------------------------------------------------------------------------------class Game_Event < Game_Character def check_value(comment) return 0 if @list.nil? or @list.size <= 0 for item in @list if item.code == 108 or item.code == 408 if item.parameters[0] =~ /#{comment}[ ]?(\d+)?/ return $1.to_i end end end return 0 end def check_command(comment) return nil if @list.nil? or @list.size <= 0 for item in @list next unless item.code == 108 or item.code == 408 if item.parameters[0] =~ /#{comment} (.*)/ return $1.to_s end end return nil end def check_comment(comment) return false if @list.nil? or @list.size <= 0 for item in @list if item.code == 108 or item.code == 408 if item.parameters[0].include?(comment) return true end end end return false end endclass Game_System attr_accessor :defeat_count alias falcaoDefeat_initialize initialize def initialize falcaoDefeat_initialize @defeat_count = 0 endendif Requiem_Masterpiece.enabled?("Requiem Extended Movements")#------------------------------------------------------------------------------Requiem_Masterpiece.register("Requiem ABS", 6.0, "Abril 5 del 2010")#------------------------------------------------------------------------------class Requiem_ABS attr_reader :attack_key1 attr_reader :attack_key2 attr_reader :skill_keys attr_reader :item_keys attr_reader :player_attack_delay attr_reader :enemy_attack_delay attr_reader :animations_divide attr_reader :memorized_text attr_reader :allow_weapons_graphics attr_reader :allow_shields_graphics attr_reader :allow_attack_with_shield attr_reader :allow_combo_damage attr_reader :levelup_animation attr_reader :recovery_when_levelup attr_reader :gold_drop_icon_index attr_reader :gold_drop_rate attr_reader :drop_duration_time attr_reader :show_reward attr_reader :drop_se attr_reader :auto_exp_e_gold attr_reader :auto_exp_rate attr_reader :auto_gold_rate attr_reader :damage_properties def initialize @attack_key1 = param("Attack_Key1") @attack_key2 = param("Attack_Key2") @skill_keys = param("Skills_Keys") @item_keys = param("Items_Keys") @player_attack_delay = param("Player_Attack_Delay") @enemy_attack_delay = param("Enemy_Attack_Delay") @animations_divide = param("Animations_Divide") @memorized_text = param("Memorized_Text") @allow_weapons_graphics = param("Allow_Weapons_Graphics") @allow_shields_graphics = param("Allow_Shields_Graphics") @allow_attack_with_shield = param("Allow_attack_with_shield") @allow_combo_damage = param("Allow_Combo_Damage") @levelup_animation = param("LevelUp_Animation") @recovery_when_levelup = param("Recovery_When_LevelUp") @gold_drop_icon_index = param("Gold_Drop_Icon_Index") @gold_drop_rate = param("Gold_Drop_Rate") @drop_duration_time = param("Drop_Duration_Time") @show_reward = param("Show_Reward") @drop_se = [param("Drop_Money_SE"), param("Drop_Item_SE")] @auto_exp_e_gold = param("Auto_EXP_Gold") @auto_exp_rate = param("Auto_EXP_Rate") @auto_gold_rate = param("Auto_Gold_Rate") @damage_properties = {} @damage_properties["Damage"] = ["MS Gothic", 18, false, false] @damage_properties["Hits"] = ["Times New Roman", 26, true, true] @damage_properties["Texts"] = ["Miss", "Critical", "Combo", "Guard", "Level Up", "Hits", "Reflect"] @damage_properties["Colors"] = [ Color.new(255,255,255), Color.new(125,200,120), Color.new(255,255,128), Color.new(245,150,120), Color.new(210,160,210), Color.new(180,165,215) ] end def param(i) conf = File.read("ABS_Config/ABSConfig.ini").split("\n") conf.find_all { |item| return eval(conf[conf.index(item)]) if item.include?(i) } end end#------------------------------------------------------------------------------# Module RPG#------------------------------------------------------------------------------module RPG class State def animation_id self.note.each_line { |line| return line.gsub('ANIMATION = ', '').chomp.to_i if line.include?('ANIMATION = ') } return 0 end def walk_slower? self.note.each_line { |line| return true if line.include?("WALK SLOWER") } return false end def walk_faster? self.note.each_line { |line| return true if line.include?("WALK FASTER") } return false end def dont_walk? self.note.each_line { |line| return true if line.include?("DO NOT WALK") } return false end def duration self.note.each_line { |line| return line.gsub('DURATION = ', '').chomp.to_i if line.include?('DURATION = ') } return 500 end def confuse? self.note.each_line { |line| return true if line.include?("CONFUSE") } return false end def cannot_attack? self.note.each_line { |line| return true if line.include?("CANNOT ATTACK") } return false end end class BaseItem def ranged? self.note.each_line { |line| return true if line.include?("RANGED") } return false end def explosive? self.note.each_line { |line| return true if line.include?("EXPLOSIVE") } return false end def bomb? self.note.each_line { |line| return true if line.include?("BOMB") } return false end def graphic self.note.each_line { |line| return line.gsub!('GRAPHIC = ', '').chomp if line.include?('GRAPHIC = ') } return "" end def index self.note.each_line { |line| return line.gsub('INDEX = ', '').chomp.to_i if line.include?('INDEX = ') } return 0 end def move_speed self.note.each_line { |line| return line.gsub('SPEED = ', '').chomp.to_i if line.include?('SPEED = ') } return 4 end def range self.note.each_line { |line| return line.gsub('RANGE = ', '').chomp.to_i if line.include?('RANGE = ') } return 5 end def delay self.note.each_line { |line| return line.gsub('DELAY = ', '').chomp.to_i if line.include?('DELAY = ') } return 60 end def area self.note.each_line { |line| return line.gsub('AREA = ', '').chomp.to_i if line.include?('AREA = ') } return 3 end def combo_hits self.note.each_line { |line| return line.gsub('COMBO HITS = ', '').chomp.to_i if line.include?('COMBO HITS = ') } return 5 end def combo_rate self.note.each_line { |line| return line.gsub('COMBO RATE = ', '').chomp.to_i if line.include?('COMBO RATE = ') } return 75 end def ammo1 self.note.each_line { |line| return $data_items[line.gsub('ITEM COST = ', '').chomp.to_i] if line.include?('ITEM COST = ') } return nil end def ammo2 self.note.each_line { |line| return $data_items[line.gsub('Ammo2 = ', '').chomp.to_i] if line.include?('Ammo2 = ') } return nil end def defense_rate self.note.each_line { |line| return line.gsub('DEFENSE RATE = ', '').chomp.to_i if line.include?('DEFENSE RATE = ') } return 50 end def reflect_rate self.note.each_line { |line| return line.gsub('REFLECT RATE = ', '').chomp.to_i if line.include?('REFLECT RATE = ') } return 0 end # update def path self.note.each_line { |line| return line.gsub!('PATH = ', '').chomp if line.include?('PATH = ') } return "Line" end #new methods def multihit? self.note.each_line { |line| return true if line.include?("MULTIHIT") } return false end def multihitx2? self.note.each_line { |line| return true if line.include?("MULTIHIT X 2") } return false end def step_back self.note.each_line { |line| return line.gsub('HIT RETRO = ', '').chomp.to_i if line.include?('HIT RETRO = ') } return 1 end def animation self.note.each_line { |line| return line.gsub('ANIMATION = ', '').chomp.to_i if line.include?('ANIMATION = ') } return nil end def player_retro self.note.each_line { |line| return line.gsub('SHOT RETRO = ', '').chomp.to_i if line.include?('SHOT RETRO = ') } return 0 end def voice self.note.each_line { |line| return line.gsub('VOICE = ', '').chomp.to_s if line.include?('VOICE = ') } return nil end def ultra self.note.each_line { |line| return line.gsub('ULTRA POINTS = ', '').chomp.to_i if line.include?('ULTRA POINTS = ') } return nil end def shake? self.note.each_line { |line| return true if line.include?("SHAKE") } return false end def icon_char self.note.each_line { |line| return line.gsub!('ICON CHAR = ', '').chomp if line.include?('ICON CHAR = ') } return "" end def tool_size self.note.each_line { |line| return line.gsub('TOOL SIZE = ', '').chomp.to_i if line.include?('TOOL SIZE = ') } return 1 end def hit_delay self.note.each_line { |line| return line.gsub('HIT DELAY = ', '').chomp.to_i if line.include?('HIT DELAY = ') } return Falcao::DefaultFreeze end def frezar? self.note.each_line { |line| return true if line.include?("FREEZE") } return false end def field? self.note.each_line { |line| return true if line.include?("FIELD") } return false end endend#------------------------------------------------------------------------------# Game Battler#------------------------------------------------------------------------------class Game_Battler attr_accessor :damage attr_accessor :critical attr_accessor :combo attr_accessor :reflect attr_accessor :state_turns attr_accessor :defending attr_accessor :piece attr_accessor :hp_damage attr_accessor :slip_dplayer alias requiem_abs_gbattler_make_obj_damage_value make_obj_damage_value def attack_effect(attacker, puzzle=false) clear_action_results @ratk = attacker return if @ratk.nil? if !puzzle unless attack_effective?(attacker) @skipped = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end if rand(100) >= calc_hit(attacker) @missed = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end if rand(100) < calc_eva(attacker) @evaded = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end end make_attack_damage_value(attacker) execute_damage(attacker) if @hp_damage == 0 return end apply_state_changes(attacker) end def skill_effect(user, skill, puzzle=false) clear_action_results if !puzzle unless skill_effective?(user, skill) @skipped = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end if rand(100) >= calc_hit(user, skill) @missed = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end if rand(100) < calc_eva(user, skill) @evaded = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end end return if user == nil or skill == nil make_obj_damage_value(user, skill) make_obj_absorb_effect(user, skill) execute_damage(user) if skill.physical_attack and @hp_damage == 0 return end apply_state_changes(skill) end def item_effect(user, item, puzzle=false) clear_action_results if !puzzle unless item_effective?(user, item) @damage = $Requiem_ABS.damage_properties["Texts"][0] @skipped = true return end if rand(100) >= calc_hit(user, item) @missed = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end if rand(100) < calc_eva(user, item) @evaded = true @damage = $Requiem_ABS.damage_properties["Texts"][0] return end end return if user == nil or item == nil hp_recovery = calc_hp_recovery(user, item) mp_recovery = calc_mp_recovery(user, item) make_obj_damage_value(user, item) @hp_damage -= hp_recovery @mp_damage -= mp_recovery make_obj_absorb_effect(user, item) execute_damage(user) item_growth_effect(user, item) if item.physical_attack and @hp_damage == 0 return end apply_state_changes(item) end def execute_damage(user) if @hp_damage == 0 @damage = $Requiem_ABS.damage_properties["Texts"][0] elsif defending?(user) @damage = $Requiem_ABS.damage_properties["Texts"][3] return else if user.reflect user.damage = (@hp_damage/4 <= 0 ? 1 : @hp_damage/4) else @damage = @hp_damage end end if @hp_damage > 0 remove_states_shock end if user.reflect user.hp -= (@hp_damage/4 <= 0 ? 1 : @hp_damage/4) user.mp -= (@mp_damage/4 <= 0 ? 1 : @mp_damage/4) else self.hp -= @hp_damage self.mp -= @mp_damage end if @absorbed user.hp += @hp_damage user.mp += @mp_damage end end def make_attack_damage_value(attacker) damage = attacker.atk * 4 - self.def * 2 damage = 0 if damage < 0 damage *= elements_max_rate(attacker.element_set) damage /= 100 if damage == 0 damage = rand(2) elsif damage > 0 attacker.reflect = (rand(100) <= reflect_rate) @critical = (rand(100) < attacker.cri) @critical = false if prevent_critical or @reflect damage *= 2 if @critical calculate_combo(attacker) damage *= 3 if @combo damage = apply_variance(damage, 20) damage = apply_guard(damage) @hp_damage = damage end end def make_obj_damage_value(user, obj) requiem_abs_gbattler_make_obj_damage_value(user, obj) user.reflect = (rand(100) <= reflect_rate) end def calculate_combo(attacker) if attacker.is_a?(Game_Actor) and $Requiem_ABS.allow_combo_damage if $game_player.right_attack_on and attacker.weapons[0] != nil hits = attacker.weapons[0].combo_hits rate = attacker.weapons[0].combo_rate elsif $game_player.left_attack_on and attacker.weapons[1] != nil hits = attacker.weapons[1].combo_hits rate = attacker.weapons[1].combo_rate elsif $game_player.right_attack_on and attacker.weapons[0].nil? hits = 5 rate = 75 elsif $game_player.left_attack_on and attacker.weapons[1].nil? hits = 5 rate = 75 else hits = rate = 0 end @combo = ($game_player.hits >= hits and rand(100) <= rate) @combo = false if @reflect else @combo = false end end def defending?(user) if self.is_a?(Game_Actor) and @defending and equips[1].is_a?(RPG::Armor) and rand(100) <= equips[1].defense_rate and @piece != nil and user.piece.face_to_face?(user.piece, @piece) return true elsif self.is_a?(Game_Enemy) and @defending and rand(100) <= self.defense_rate and @piece != nil and user.piece.face_to_face?(user.piece, @piece) return true end return false end def remove_state(state_id) return unless state?(state_id) @states.delete(state_id) @state_turns.delete(state_id) end #-------------------------------------------------------------------------- # * Application of Slip Damage Effects #-------------------------------------------------------------------------- def slip_damage_effect if @slip_dplayer and @hp > 0 @hp_damage = apply_variance(maxhp / 10, 10) @hp_damage = @hp - 1 if @hp_damage >= @hp self.hp -= @hp_damage @damage = @hp_damage end endend#------------------------------------------------------------------------------# Game Actor#------------------------------------------------------------------------------class Game_Actor < Game_Battler attr_accessor :skill_hotkeys attr_accessor :item_hotkeys alias requiem_abs_gactor_initialize initialize def initialize(actor_id) requiem_abs_gactor_initialize(actor_id) skil_key = {} key_skil = [] @skill_hotkeys = skil_key conjure_key = {} item_key = {} key_item = [] @item_hotkeys = item_key end def display_level_up(new_skills) Audio.se_play("Audio/Se/" + Falcao::LevelUpSe, 100, 100) @damage = $Requiem_ABS.damage_properties["Texts"][4] if $Requiem_ABS.recovery_when_levelup $game_player.actor.hp = $game_player.actor.maxhp $game_player.actor.mp = $game_player.actor.maxmp end end def atk_animation_id2 if two_swords_style return weapons[1].nil? ? 1 : weapons[1].animation_id else return 1 end end def reflect_rate r = 0 for i in armors next if i.nil? r += i.reflect_rate end return r end end#------------------------------------------------------------------------------# Game Enemy#------------------------------------------------------------------------------class Game_Enemy < Game_Battler def character_name enemy.note.each_line { |line| return line.gsub('CHAR NAME = ', '').chomp if line.include?('CHAR NAME = ') } return "" end def character_index enemy.note.each_line { |line| return line.gsub('CHAR INDEX = ', '').chomp.to_i if line.include?('CHAR INDEX = ') } return 0 end def atk_animation_id enemy.note.each_line { |line| return line.gsub('ATTACK ANIMATION = ', '').chomp.to_i if line.include?('ATTACK ANIMATION = ') } return Falcao::Enemy_Atk_Anime end def die_animation_id enemy.note.each_line { |line| return line.gsub('DIE ANIMATION = ', '').chomp.to_i if line.include?('DIE ANIMATION = ') } return Falcao::DefaultDieAnime end def die_se enemy.note.each_line { |line| return line.gsub('DIE SE = ', '').chomp.to_s if line.include?('DIE SE = ') } return nil end def weapon_icon enemy.note.each_line { |line| return line.gsub('WEAPON ICON = ', '').chomp.to_i if line.include?('WEAPON ICON = ') } return 0 end def shield_icon enemy.note.each_line { |line| return line.gsub('SHIELD ICON = ', '').chomp.to_i if line.include?('SHIELD ICON = ') } return 0 end def defense_rate enemy.note.each_line { |line| return line.gsub('DEFENSE RATE = ', '').chomp.to_i if line.include?('DEFENSE RATE = ') } return 50 end def reflect_rate enemy.note.each_line { |line| return line.gsub('REFLECT RATE = ', '').chomp.to_i if line.include?('REFLECT RATE = ') } return 0 end def blink enemy.note.each_line { |line| return line.gsub('BLINK = ', '').chomp.to_i if line.include?('BLINK = ') } return 30 end end#------------------------------------------------------------------------------# Game Map#------------------------------------------------------------------------------class Game_Map alias requiem_abs_gmap_passable passable? def range_passable?(x, y, flag = 0x01) return true if @passages[@map.data[x, y, 0]] == 9 passable?(x, y, flag) end def passable?(x, y, flag = 0x01) for drop in $game_drop next if drop.nil? #return false if drop.x == x and drop.y == y end requiem_abs_gmap_passable(x, y, flag = 0x01) end def update_events for event in @events.values next unless in_range?(event) or event.trigger == 3 or event.trigger == 4 or event.check_comment("Force Update") event.update end for common_event in @common_events.values common_event.update end end def in_range?(object) return false if object.real_x < (@display_x-256) return false if object.real_x > (@display_x+(Graphics.width*8)) return false if object.real_y < (@display_y-256) return false if object.real_y > (@display_y+(Graphics.height*8)) return true end end#------------------------------------------------------------------------------# Game Character#------------------------------------------------------------------------------class Game_Character alias requiem_abs_gchar_initialize initialize alias requiem_abs_gchar_update update attr_accessor :actor attr_accessor :ani_time attr_accessor :state_time attr_accessor :weapon1_attack_time attr_accessor :weapon2_attack_time attr_accessor :assigned_skill attr_accessor :skill_attack_time attr_accessor :item_attack_time attr_accessor :recovery_time attr_accessor :right_attack_on attr_accessor :left_attack_on attr_accessor :freeze attr_accessor :anime_attack attr_accessor :original_move_speed attr_accessor :token_active attr_accessor :pattern_force attr_accessor :direction attr_accessor :hurt_action attr_accessor :step_anime attr_accessor :icon_char attr_accessor :icon_char_visible attr_accessor :freeze_state attr_accessor :opacity attr_accessor :blink_time def initialize requiem_abs_gchar_initialize @weapon1_attack_time = 0 @weapon2_attack_time = 0 @skill_attack_time = 0 @item_attack_time = 0 @recovery_time = 0 @assigned_skill = nil @ani_time = 0 @anime_attack = 0 @state_time = 0 @original_move_speed = 0 @actor = nil @freeze = false @right_attack_on = false @left_attack_on = false @icon_char = "" @icon_char_visible = false @pattern_force = 0 @hurt_action = [event=[], 0] @token_active = [time=0, enemy=[]] @time_a = 0 @freeze_state = false @blink_time = 0 end def update refresh_tokens update_hurt_action update_blink requiem_abs_gchar_update return if $game_party.members.size <= 0 decrease_counters states_effects end def update_blink if @blink_time > 0 @blink_time -= 1 if self.is_a?(Game_Event) and self.blink_counter > 0 @blink_time = 0 self.opacity = 255 end self.opacity = (self.opacity + 70) % 190 + 40 if @blink_time <= 1 self.opacity = 255 @blink_time = 0 end end end def update_hurt_action if @hurt_action[1] > 0 @hurt_action[1] -= 1 for event in @hurt_action[0] if event.actor.dead? and event.is_a?(Game_Event) event.animation_id = 0 @hurt_action = [event=[], 0] return end if @hurt_action[2] event.freeze_state = true @time_a += 1 case @time_a when 1 event.animation_id = 93 when 35 @time_a = 0 end end event.freeze = true event.step_anime = false end if @hurt_action[1] == 1 for event in @hurt_action[0] event.freeze = false event.freeze_state = false end @hurt_action = [event=[], 0] end end end def refresh_tokens if @token_active[0] > 0 @token_active[0] -= 1 for user in @token_active[1] if user.passable?(user.x, user.y) user.through = true else user.through = false end end if @token_active[0] == 1 for user in @token_active[1] user.through = false end @token_active = [time=0, enemy=[]] end end end def decrease_counters @ani_time -= 1 if @ani_time > 0 @weapon1_attack_time -= 1 if @weapon1_attack_time > 0 @weapon2_attack_time -= 1 if @weapon2_attack_time > 0 @skill_attack_time -= 1 if @skill_attack_time > 0 @item_attack_time -= 1 if @item_attack_time > 0 @recovery_time -= 1 if @recovery_time > 0 @anime_attack -= 1 if @anime_attack > 0 @right_attack_on = @left_attack_on = false if @anime_attack <= 0 end # editado def states_effects if self.is_a?(Game_Event) and self.in_battle or self.is_a?(Game_Player) for state in @actor.states if state.slip_damage == true @actor.slip_dplayer = true state.slip_damage = false end end if @actor.slip_dplayer and self.is_a?(Game_Player) @actor.slip_damage_effect if Graphics.frame_count % 80 <= 0 $game_temp.next_scene = "gameover" if self.actor.hp <= 1 end for state in @actor.states next if state.nil? if @state_time <= state.duration @state_time += 1 @freeze = true if state.dont_walk? @move_speed = 2 if state.walk_slower? @move_speed = 5 if state.walk_faster? if self.is_a?(Game_Event) and @actor.slip_dplayer if Graphics.frame_count % 60 <= 0 @actor.slip_damage_effect self.actor.attack_effect($game_player.actor, false) if @actor.hp <= 1 end end elsif @state_time > state.duration for state in @actor.states if self.actor.slip_dplayer self.actor.slip_dplayer = false state.slip_damage = true end end @freeze = false if state.dont_walk? @move_speed = @original_move_speed if state.walk_slower? @move_speed = @original_move_speed if state.walk_faster? @actor.remove_state(state.id) @state_time = 0 end end end end def apply_tool_effect?(enemy, tool, type) # type = number # 1 = weapon, 2= item, 3 = skill, if enemy.kill_with_weapon[0] > 0 or enemy.kill_with_item[0] > 0 or enemy.kill_with_skill[0] > 0 case type when 1 return true if enemy.kill_with_weapon.include?(tool.id) when 2 return true if enemy.kill_with_item.include?(tool.id) when 3 return true if enemy.kill_with_skill.include?(tool.id) end return false end return true end def user_state if self.is_a?(Game_Event) and self.in_battle or self.is_a?(Game_Player) for state in self.actor.states return state end return nil end end def step_back_action(user, bullet, item_value) last_dir = user.direction if item_value > 1 case bullet.direction when 2 for i in 0...item_value user.move_down end when 4 for i in 0...item_value user.move_left end when 6 for i in 0...item_value user.move_right end when 8 for i in 0...item_value user.move_up end end else return if item_value == 0 case bullet.direction when 2; user.move_down when 4; user.move_left when 6; user.move_right when 8; user.move_up end end user.direction = last_dir endend#------------------------------------------------------------------------------# Game Event#------------------------------------------------------------------------------class Game_Event < Game_Character attr_reader :in_battle attr_reader :kill_with_weapon attr_reader :kill_with_skill attr_reader :kill_with_item attr_reader :respawn attr_reader :boss attr_reader :object attr_reader :puzzle attr_reader :enemy_actor attr_reader :backward_disable attr_reader :blink_counter alias requiem_abs_gevent_initialize initialize alias requiem_abs_gevent_setup setup alias requiem_abs_gevent_update update alias requiem_abs_gevent_refresh refresh def initialize(map_id, event) @enemy_id = 0 @respawn = nil @in_battle = false @boss = false @object = false @puzzle = false # add @manager_act = false @backward_disable = false @blink_counter = 0 @enemy_actor = nil requiem_abs_gevent_initialize(map_id, event) end def setup(new_page) requiem_abs_gevent_setup(new_page) self.original_move_speed = @move_speed end def update requiem_abs_gevent_update if @blink_counter > 0 @blink_counter -= 1 if @blink_counter <= 1 @blink_counter = 0 end end @respawn -= 1 if !@in_battle and self.actor.nil? and @respawn != nil and @respawn > 0 if @in_battle and self.actor != nil and !self.actor.dead? if area_size?($game_player, self, $game_variables[Falcao::EnemySensor]) if !@manager_act sensor_self_switch(self, true) @manager_act = true end make_attack elsif @manager_act sensor_self_switch(self, false) @manager_act = false end elsif @in_battle and self.actor != nil and self.actor.dead? @blink_counter = 100 # p'empieza' kill_enemy erasing elsif !@in_battle and self.actor.nil? and @respawn != nil and @respawn <= 0 @erased = @starting = false refresh end end def refresh requiem_abs_gevent_refresh @enemy_id = check_value("ENEMY") @follow_distance = check_value("FOLLOW") @erase = check_comment("DIE ERASE") @self_switch_a = check_comment("DIE SELF SWITCH A") @self_switch_b = check_comment("DIE SELF SWITCH B") @self_switch_c = check_comment("DIE SELF SWITCH C") @self_switch_d = check_comment("DIE SELF SWITCH D") @switch = check_value("DIE SWITCH") @variable = check_value("DIE VARIABLE") @kill_with_weapon = [] for i in "#{check_value("KILL WITH WEAPON")}".scan(/./) @kill_with_weapon.push(i.to_i) end @kill_with_skill = [] for i in "#{check_value("KILL WITH SKILL")}".scan(/./) @kill_with_skill.push(i.to_i) end @kill_with_item = [] for i in "#{check_value("KILL WITH ITEM")}".scan(/./) @kill_with_item.push(i.to_i) end @boss = check_comment("BOSS") @object = check_comment("OBJECT") @puzzle = check_comment("PUZZLE") @backward_disable = check_comment("DISABLE RETRO") if @enemy_id > 0 and !@in_battle @respawn = check_value("RESPAWN") @respawn = nil if @respawn <= 0 self.actor = Game_Enemy.new(0, @enemy_id) @enemy_actor = self.actor self.actor.recover_all self.actor.piece = self @in_battle = true elsif @enemy_id <= 0 @in_battle = false end @opacity = 255 @blend_type = 0 end def make_attack return if $game_map.interpreter.running? return if $game_player.in_vehicle? return if self.freeze_state if user_state != nil return if self.user_state.dont_walk? if self.user_state.confuse? move_away_from_player if Graphics.frame_count % 30 <= 0 end if self.user_state.cannot_attack? if Graphics.frame_count % 120 <= 0 self.actor.damage = user_state.name end return end end for action in $data_enemies[@enemy_id].actions next unless self.actor.conditions_met?(action) next unless rand(11) < action.rating next if self.weapon1_attack_time > 0 case action.kind when 0 case action.basic when 0 attack_normal when 1 self.actor.defending = true end when 1 self.assigned_skill = $data_skills[action.skill_id] case self.assigned_skill.scope when 1..7 if self.assigned_skill.ranged? if area_size?(self, $game_player, $game_variables[Falcao::EnemySensor]) skill_attack_range elsif action.rating == 10 skill_attack_range end else skill_attack_normal end when 7..12 skill_recover end end end end def shot_skill(id) if user_state != nil return if self.user_state.dont_walk? return if self.user_state.cannot_attack? end if area_size?(self, $game_player, $game_variables[Falcao::EnemySensor]) self.assigned_skill = $data_skills[id] case self.assigned_skill.scope when 1..7 if self.assigned_skill.ranged? skill_attack_range else skill_attack_normal end when 7..12 skill_recover end end end def attack_normal return if $game_player.actor.nil? return unless in_front?(self, $game_player) self.anime_attack = 20 @pattern_force = 20 $game_player.animation_id = self.actor.atk_animation_id $game_player.actor.attack_effect(self.actor) $game_player.jump(0,0) $game_player.move_backward $game_player.blink_time = 30 self.weapon1_attack_time = $Requiem_ABS.enemy_attack_delay end def skill_attack_normal return if $game_player.actor.nil? return unless self.actor.mp >= self.assigned_skill.mp_cost and in_front?(self, $game_player) @pattern_force = 20 $game_player.hurt_action[0].push($game_player) $game_player.hurt_action[1] = self.assigned_skill.hit_delay $game_player.hurt_action[2] = self.assigned_skill.frezar? $game_player.shot_retro_action(self, self.assigned_skill.player_retro) if self.assigned_skill.icon_char != "" @icon_char = self.assigned_skill.icon_char @icon_char_visible = true end Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 $game_player.animation_id = self.assigned_skill.animation_id $game_player.actor.skill_effect(self.actor, self.assigned_skill) $game_player.jump(0,0) step_back_action($game_player, self, self.assigned_skill.step_back) self.weapon1_attack_time = $Requiem_ABS.enemy_attack_delay end def skill_attack_range return unless self.actor.mp >= self.assigned_skill.mp_cost @pattern_force = 20 $game_player.shot_retro_action(self, self.assigned_skill.player_retro) if self.assigned_skill.icon_char != "" @icon_char = self.assigned_skill.icon_char @icon_char_visible = true end Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 $game_range.push(Game_Range.new(self, self.assigned_skill.graphic, self.assigned_skill.index, self.assigned_skill.move_speed, self.assigned_skill.range, 3)) self.weapon1_attack_time = self.assigned_skill.delay end def skill_recover if self.actor.mp >= self.assigned_skill.mp_cost and self.actor.hp <= (self.actor.maxhp*25/100) self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 @animation_id = self.assigned_skill.animation_id self.actor.skill_effect(self.actor, self.assigned_skill) self.weapon1_attack_time = $Requiem_ABS.enemy_attack_delay end for event in $game_map.events.values if event.in_battle and in_range?(self, event, 3) if self.actor.mp >= self.assigned_skill.mp_cost and event.actor.hp <= (event.actor.maxhp*25/100) self.actor.mp -= self.assigned_skill.mp_cost $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 event.animation_id = self.assigned_skill.animation_id event.actor.skill_effect(self.actor, self.assigned_skill) self.weapon1_attack_time = $Requiem_ABS.enemy_attack_delay end end end end def erasing return if @puzzle @blend_type = 2 @opacity -= 10 end def kill_enemy dying unless @killed return if @opacity > 0 and !@puzzle self.actor = nil desactive_enemy @killed = false $game_player.hits = 0 @in_battle = false end def dying $game_system.defeat_count += 1 unless @puzzle if $falhero_menu == true $derrotados.push(@enemy_id) unless $derrotados.include?(@enemy_id) end make_drop unless @puzzle @animation_id = self.actor.die_animation_id if self.actor.die_se != nil RPG::SE.new(self.actor.die_se).play else Sound.play_enemy_collapse end end @killed = true end def desactive_enemy erase if @erase if @self_switch_a key = [$game_map.map_id, self.id, "A"] $game_self_switches[key] = !$game_self_switches[key] end if @self_switch_b key = [$game_map.map_id, self.id, "B"] $game_self_switches[key] = !$game_self_switches[key] end if @self_switch_c key = [$game_map.map_id, self.id, "C"] $game_self_switches[key] = !$game_self_switches[key] end if @self_switch_d key = [$game_map.map_id, self.id, "D"] $game_self_switches[key] = !$game_self_switches[key] end if @switch > 0 $game_switches[@switch] = !$game_switches[@switch] end if @variable > 0 $game_variables[@variable] += 1 end if $summon != nil and $summon.target == self $summon.target = $game_player $summon.lock_target = false end $game_map.need_refresh = true end def make_drop droped_items = [] for i in [self.actor.drop_item1, self.actor.drop_item2] next if i.kind <= 0 next if rand(i.denominator) != 0 if i.kind == 1 droped_items.push($data_items[i.item_id]) elsif i.kind == 2 droped_items.push($data_weapons[i.weapon_id]) elsif i.kind == 3 droped_items.push($data_armors[i.armor_id]) end end for t in droped_items next if t.nil? $game_drop.push(Game_Drop.new(self, t.icon_index, t , 0)) end $game_player.actor.gain_exp(self.actor.exp, 1) gold = self.actor.gold $game_drop.push(Game_Drop.new(self, $Requiem_ABS.gold_drop_icon_index, nil, gold)) if gold > 0 end def update_self_movement return if self.freeze or (self.anime_attack/2) > 0 if @stop_count > 30 * (5 - @move_frequency) if @in_battle and in_range?(self, $game_player, @follow_distance) move_type_toward_player else case @move_type when 1 move_type_random when 2 move_type_toward_player when 3 move_type_custom end end end end endclass Game_Character attr_accessor :pattern endclass Game_Event < Game_Character attr_reader :page #end#------------------------------------------------------------------------------# Game Player#------------------------------------------------------------------------------class Game_Player < Game_Character include Falcao attr_accessor :hit attr_accessor :hits attr_accessor :hit_time attr_accessor :assigned_item attr_accessor :bomb_already attr_accessor :reward attr_accessor :attack_weapon alias requiem_abs_gplayer_initialize initialize alias requiem_abs_gplayer_update update alias requiem_abs_gplayer_move_by_input move_by_input alias requiem_abs_gplayer_perform_transfer perform_transfer def initialize requiem_abs_gplayer_initialize @hits = 0 @hit_time = 0 @assigned_item = 0 @bomb_already = false @hit = nil @reward = nil self.original_move_speed = 4 end def update self.actor = $game_party.members[0] requiem_abs_gplayer_update self.actor.piece = self return if self.actor.nil? $game_temp.next_scene = "gameover" if self.actor.dead? case $game_player.direction when 2; push_x = 0; push_y = 1 when 4; push_x = -1; push_y = 0 when 6; push_x = 1; push_y = 0 when 8; push_x = 0; push_y = -1 else; push_x = 0; push_y = 0 end for event in $game_map.events.values if !event.page.nil? for i in event.page.list if i.code == 101 if $game_player.x + push_x == event.x and $game_player.y + push_y == event.y return if $game_map.interpreter.running? and Input.trigger?(FalKey.key(Attack_Button)) end end end end end return if in_vehicle? if user_state != nil return if user_state.dont_walk? if user_state.cannot_attack? if Input.trigger?(FalKey.key(Attack_Button)) || Input.trigger?(FalKey.key(Shield_Button)) || Input.trigger?(FalKey.key(Item_Button)) || Input.trigger?(FalKey.key(Skill_Button)) Audio.se_play("Audio/Se/" + NoItemSe) self.actor.damage = user_state.name return end end end return if $game_switches[Falcao::HudDisable] == true attack_with_weapon attack_with_skill attack_with_item auto_recovery update_hits end def hit_count return unless $Requiem_ABS.allow_combo_damage @hits += 1 @hit = "#{@hits}" end def update_hits if self.right_attack_on and @attack_weapon != nil @hits = 0 if @hit_time <= 0 or @hits >= @attack_weapon.combo_hits elsif self.left_attack_on and @attack_weapon_and_Shield != nil @hits = 0 if @hit_time <= 0 or @hits >= @attack_weapon_and_Shield.combo_hits elsif self.right_attack_on and @attack_weapon.nil? @hits = 0 if @hit_time <= 0 or @hits >= 5 elsif self.left_attack_on and @attack_weapon_and_Shield.nil? @hits = 0 if @hit_time <= 0 or @hits >= 5 end @hit_time -= 1 if @hit_time > 0 end def attack_with_weapon return if $game_player.freeze_state if Input.trigger?(FalKey.key(Attack_Button)) weapon = @actor.equips[0] return if weapon == nil return if !$Requiem_ABS.allow_attack_with_shield and self.actor.defending return if self.weapon1_attack_time > 0 @attack_weapon = self.actor.equips[0] @pattern_force = 20 if self.actor.equips[0].icon_char != "" @icon_char = self.actor.equips[0].icon_char @icon_char_visible = true self.anime_attack = 0 else self.anime_attack = 20 end self.right_attack_on = true self.left_attack_on = false if @attack_weapon != nil and @attack_weapon.ranged? range_attack_right self.weapon1_attack_time = @attack_weapon.delay @hit_time = self.weapon1_attack_time + 15 else normal_attack_right self.weapon1_attack_time = $Requiem_ABS.player_attack_delay @hit_time = self.weapon1_attack_time + 15 end end # ataque con escudo if Input.press?(FalKey.key(Shield_Button)) self.actor.defending = (self.actor.equips[1].is_a?(RPG::Armor) and $Requiem_ABS.allow_shields_graphics) else self.actor.defending = false end # editado if Input.press?(FalKey.key(Shield_Button)) shield = @actor.equips[1] return if shield == nil Audio.se_play("Audio/Se/" + self.actor.equips[1].voice) if self.actor.equips[1].voice != nil return if self.weapon2_attack_time > 0 return if !$Requiem_ABS.allow_attack_with_shield and self.actor.defending @attack_weapon_and_Shield = (self.actor.two_swords_style ? self.actor.equips[1] : self.actor.equips[0]) self.right_attack_on = false self.left_attack_on = true if @attack_weapon_and_Shield != nil and @attack_weapon_and_Shield.ranged? range_attack_left self.weapon2_attack_time = $Requiem_ABS.player_attack_delay @hit_time = self.weapon2_attack_time + 15 elsif self.actor.two_swords_style normal_attack_left self.weapon2_attack_time = @attack_weapon_and_Shield.delay @hit_time = self.weapon1_attack_time + 15 end end end def attack_with_skill return if $game_player.freeze_state for button in self.actor.skill_hotkeys.keys if Input.trigger?(button) and self.actor.skill_hotkeys[button] != nil and self.actor.skill_hotkeys[button] != 0 return if self.skill_attack_time > 0 return if !$Requiem_ABS.allow_attack_with_shield and self.actor.defending self.assigned_skill = $data_skills[self.actor.skill_hotkeys[button]] @pattern_force = 20 Audio.se_play("Audio/Se/" + Falcao::NoItemSe) unless self.actor.mp >= self.assigned_skill.mp_cost if self.assigned_skill.icon_char != "" @icon_char = self.assigned_skill.icon_char @icon_char_visible = true end if self.assigned_skill.scope == 2 skill_attack_all elsif self.assigned_skill.ranged? skill_attack_range elsif self.assigned_skill.explosive? skill_exlpode_range elsif self.assigned_skill.scope >= 7 skill_recover else skill_attack_normal end end end end def attack_with_item return if $game_player.freeze_state for button in self.actor.item_hotkeys.keys if Input.trigger?(button) and self.actor.item_hotkeys[button] != nil and self.actor.item_hotkeys[button] != 0 return if self.item_attack_time > 0 return if !$Requiem_ABS.allow_attack_with_shield and self.actor.defending @assigned_item = $data_items[self.actor.item_hotkeys[button]] @pattern_force = 20 if self.assigned_item.icon_char != "" @icon_char = self.assigned_item.icon_char @icon_char_visible = true end if @assigned_item.ranged? item_attack_range elsif @assigned_item.explosive? item_attack_explode elsif @assigned_item.bomb? item_attack_bomb else case @assigned_item.scope when 1 item_normal_attack when 2 item_attack_all when 3...7 item_normal_attack when 7...12 item_recover end end end end end def normal_attack_right Audio.se_play("Audio/Se/" + self.actor.equips[0].voice) if self.actor.equips[0].voice != nil $game_player.animation_id = self.actor.equips[0].animation if self.actor.equips[0].animation != nil shot_retro_action(self, self.actor.equips[0].player_retro) for event in $game_map.events.values next unless event.in_battle next if event.freeze_state if self.actor.equips[0].tool_size > 1 next unless area_size?(self, event, self.actor.equips[0].tool_size) else next unless in_front?(self, event) end next if event.actor.dead? or event.object next unless apply_tool_effect?(event, self.actor.equips[0], 1) event.hurt_action[0].push(event) event.hurt_action[1] = self.actor.equips[0].hit_delay event.hurt_action[2] = self.actor.equips[0].frezar? !self.actor.equips[0].ultra.nil? ? gain_ultra(self.actor.equips[0].ultra) : gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if self.actor.equips[0].shake? unless event.puzzle event.animation_id = self.actor.atk_animation_id unless event.puzzle hit_count unless event.puzzle event.actor.attack_effect(self.actor, event.puzzle) return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, self.actor.equips[0].step_back) end end def shot_retro_action(user, retro_value) return unless retro_value > 0 for i in 0...retro_value user.move_backward end end def range_attack_right Audio.se_play("Audio/Se/" + Falcao::NoItemSe) unless $game_party.has_item?(@attack_weapon.ammo1) return unless $game_party.has_item?(@attack_weapon.ammo1) shot_retro_action(self, self.actor.equips[0].player_retro) Audio.se_play("Audio/Se/" + self.actor.equips[0].voice) if self.actor.equips[0].voice != nil $game_party.consume_item(@attack_weapon.ammo1) unless $game_player.charge_complete $game_range.push(Game_Range.new(self, @attack_weapon.graphic, @attack_weapon.index, @attack_weapon.move_speed, @attack_weapon.range, 1)) end end def normal_attack_left Audio.se_play("Audio/Se/" + self.actor.equips[1].voice) if self.actor.equips[1].voice != nil $game_player.animation_id = self.actor.equips[1].animation if self.actor.equips[1].animation != nil shot_retro_action(self, self.actor.equips[1].player_retro) for event in $game_map.events.values next unless event.in_battle if self.actor.equips[0].tool_size > 1 next unless area_size?(self, event, self.actor.equips[0].tool_size) else next unless in_front?(self, event) end next if event.actor.dead? or event.object next if event.freeze and self.actor.equips[1].frezar? # ultra !self.actor.equips[1].ultra.nil? ? gain_ultra(self.actor.equips[1].ultra) : gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if self.actor.equips[1].shake? #puzzle add event.animation_id = self.actor.atk_animation_id2 unless event.puzzle hit_count event.actor.attack_effect(self.actor, event.puzzle) event.jump(0,0) unless event.puzzle event.blink_time = event.enemy_actor.blink end end def range_attack_left return unless $game_party.has_item?(@attack_weapon_and_Shield.ammo2) Audio.se_play("Audio/Se/" + self.actor.equips[1].voice) if self.actor.equips[1].voice != nil $game_player.animation_id = self.actor.equips[1].animation if self.actor.equips[1].animation != nil shot_retro_action(self, self.actor.equips[1].player_retro) $game_party.consume_item(@attack_weapon_and_Shield.ammo2) unless $game_player.charge_complete $game_range.push(Game_Range.new(self, @attack_weapon_and_Shield.graphic, @attack_weapon_and_Shield.index, @attack_weapon_and_Shield.move_speed, @attack_weapon_and_Shield.range, 2)) end end def skill_attack_normal return unless self.actor.mp >= self.assigned_skill.mp_cost Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil shot_retro_action(self, self.assigned_skill.player_retro) $game_player.animation_id = self.assigned_skill.animation if self.assigned_skill.animation != nil for event in $game_map.events.values next unless event.in_battle next if event.freeze_state if self.assigned_skill.tool_size > 1 next unless area_size?(self, event, self.assigned_skill.tool_size) else; next unless in_front?(self, event) end next unless apply_tool_effect?(event, self.assigned_skill, 3) event.hurt_action[0].push(event) event.hurt_action[1] = self.assigned_skill.hit_delay event.hurt_action[2] = self.assigned_skill.frezar? next if event.actor.dead? or event.object next unless self.actor.mp >= self.assigned_skill.mp_cost self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 # ultra !self.assigned_skill.ultra.nil? ? gain_ultra(self.assigned_skill.ultra) : gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if self.assigned_skill.shake? unless event.puzzle #puzzle add event.animation_id = self.assigned_skill.animation_id unless event.puzzle self.skill_attack_time = self.assigned_skill.delay event.actor.skill_effect(self.actor, self.assigned_skill, event.puzzle) # step back and more return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, self.assigned_skill.step_back) end end def skill_attack_range return unless self.actor.mp >= self.assigned_skill.mp_cost Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil shot_retro_action(self, self.assigned_skill.player_retro) #$game_player.animation_id = self.assigned_skill.animation if self.assigned_skill.animation != nil self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 $game_range.push(Game_Range.new(self, self.assigned_skill.graphic, self.assigned_skill.index, self.assigned_skill.move_speed, self.assigned_skill.range, 3)) self.skill_attack_time = self.assigned_skill.delay end def skill_attack_all return unless self.actor.mp >= self.assigned_skill.mp_cost Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil shot_retro_action(self, self.assigned_skill.player_retro) $game_player.animation_id = self.assigned_skill.animation if self.assigned_skill.animation != nil self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 for event in $game_map.events.values next unless event.in_battle next if event.actor.dead? or event.object next if event.freeze_state next unless apply_tool_effect?(event, self.assigned_skill, 3) # ultra !self.assigned_skill.ultra.nil? ? gain_ultra(self.assigned_skill.ultra) : gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if self.assigned_skill.shake? unless event.puzzle #puzzle add event.animation_id = self.assigned_skill.animation_id unless event.puzzle self.skill_attack_time = $Requiem_ABS.player_attack_delay event.hurt_action[0].push(event) event.hurt_action[1] = self.assigned_skill.hit_delay event.hurt_action[2] = self.assigned_skill.frezar? event.actor.skill_effect(self.actor, self.assigned_skill, event.puzzle) #step bCK return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, self.assigned_skill.step_back) end end def skill_exlpode_range return unless self.actor.mp >= self.assigned_skill.mp_cost Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil shot_retro_action(self, self.assigned_skill.player_retro) #$game_player.animation_id = self.assigned_skill.animation if self.assigned_skill.animation != nil self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 $game_range.push(Game_Range.new(self, self.assigned_skill.graphic, self.assigned_skill.index, self.assigned_skill.move_speed, self.assigned_skill.range, 4)) #RPG::SE.new(self.assigned_skill.shot_se).play if self.assigned_skill.shot_se != nil self.skill_attack_time = self.assigned_skill.delay end def skill_recover return unless self.actor.mp >= self.assigned_skill.mp_cost Audio.se_play("Audio/Se/" + self.assigned_skill.voice) if self.assigned_skill.voice != nil self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill) $game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0 self.actor.skill_effect(self.actor, self.assigned_skill) @animation_id = self.assigned_skill.animation_id self.skill_attack_time = $Requiem_ABS.player_attack_delay end def item_normal_attack return unless $game_party.has_item?(@assigned_item) Audio.se_play("Audio/Se/" + self.assigned_item.voice) if self.assigned_item.voice != nil shot_retro_action(self, self.assigned_item.player_retro) $game_player.animation_id = self.assigned_item.animation if self.assigned_item.animation != nil for event in $game_map.events.values next unless event.in_battle next if event.freeze_state if self.assigned_item.tool_size > 1 next unless area_size?(self, event, self.assigned_item.tool_size) else; next unless in_front?(self, event) end next if event.actor.dead? or event.object next unless $game_party.has_item?(@assigned_item) next unless apply_tool_effect?(event, self.assigned_item, 2) event.hurt_action[0].push(event) event.hurt_action[1] = self.assigned_item.hit_delay event.hurt_action[2] = self.assigned_item.frezar? $game_party.consume_item(@assigned_item) $game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0 # ultra !self.assigned_item.ultra.nil? ? gain_ultra(self.assigned_item.ultra) : gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if self.assigned_skill.shake? unless event.puzzle #puzzle add event.animation_id = @assigned_item.animation_id unless event.puzzle self.item_attack_time = $Requiem_ABS.player_attack_delay event.actor.item_effect(self.actor, @assigned_item, event.puzzle) # step back feature return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, self.assigned_item.step_back) end end def item_attack_range return unless $game_party.has_item?(@assigned_item) Audio.se_play("Audio/Se/" + self.assigned_item.voice) if self.assigned_item.voice != nil shot_retro_action(self, self.assigned_item.player_retro) #$game_player.animation_id = self.assigned_item.animation if self.assigned_item.animation != nil $game_party.consume_item(@assigned_item) $game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0 $game_range.push(Game_Range.new(self, @assigned_item.graphic, @assigned_item.index, @assigned_item.move_speed, @assigned_item.range, 5)) #RPG::SE.new(@assigned_item.shot_se).play if @assigned_item.shot_se != nil self.item_attack_time = @assigned_item.delay end def item_attack_explode return unless $game_party.has_item?(@assigned_item) Audio.se_play("Audio/Se/" + self.assigned_item.voice) if self.assigned_item.voice != nil shot_retro_action(self, self.assigned_item.player_retro) #$game_player.animation_id = self.assigned_item.animation if self.assigned_item.animation != nil $game_party.consume_item(@assigned_item) $game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0 $game_range.push(Game_Range.new(self, @assigned_item.graphic, @assigned_item.index, @assigned_item.move_speed, @assigned_item.range, 6)) #RPG::SE.new(@assigned_item.shot_se).play if @assigned_item.shot_se != nil self.item_attack_time = @assigned_item.delay end def item_recover return unless $game_party.has_item?(@assigned_item) Audio.se_play("Audio/Se/" + self.assigned_item.voice) if self.assigned_item.voice != nil $game_party.consume_item(@assigned_item) $game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0 @animation_id = @assigned_item.animation_id self.actor.item_effect(self.actor, @assigned_item) self.item_attack_time = $Requiem_ABS.player_attack_delay end def item_attack_all return unless $game_party.has_item?(@assigned_item) Audio.se_play("Audio/Se/" + self.assigned_item.voice) if self.assigned_item.voice != nil shot_retro_action(self, self.assigned_item.player_retro) $game_player.animation_id = self.assigned_item.animation if self.assigned_item.animation != nil $game_party.consume_item(@assigned_item) $game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0 for event in $game_map.events.values next unless event.in_battle next if event.actor.dead? or event.object next if event.freeze_state next unless apply_tool_effect?(event, self.assigned_item, 2) # ultra !self.assigned_item.ultra.nil? ? gain_ultra(self.assigned_item.ultra) : gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if self.assigned_skill.shake? unless event.puzzle #puzzle add event.animation_id = @assigned_item.animation_id unless event.puzzle self.item_attack_time = $Requiem_ABS.player_attack_delay event.actor.item_effect(self.actor, @assigned_item, event.puzzle) event.hurt_action[0].push(event) event.hurt_action[1] = self.assigned_item.hit_delay event.hurt_action[2] = self.assigned_item.frezar? # step back feature return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, self.assigned_item.step_back) end end def item_attack_bomb return if $game_party.has_item?(@assigned_item) and @bomb_already Audio.se_play("Audio/Se/" + self.assigned_item.voice) if self.assigned_item.voice != nil shot_retro_action(self, self.assigned_item.player_retro) $game_player.animation_id = self.assigned_item.animation if self.assigned_item.animation != nil $game_party.consume_item(@assigned_item) $game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0 $game_bomb.push(Game_Bomb.new(self, @assigned_item)) end def auto_recovery return unless self.actor.auto_hp_recover and self.recovery_time <= 0 self.actor.hp += (self.actor.maxhp*10/100) self.recovery_time = 1800 end def perform_transfer requiem_abs_gplayer_perform_transfer for range in $game_range next if range.nil? range.destroy = true end for drop in $game_drop next if drop.nil? drop.destroy = true end for bomb in $game_bomb next if bomb.nil? bomb.destroy = true end @bomb_already = false end def move_by_input return if self.freeze or (self.anime_attack/2) > 0 if user_state != nil if user_state.confuse? return unless movable? return if $game_map.interpreter.running? case Input.dir4 when 2; move_up when 4; move_right when 6; move_left when 8; move_down end return end end requiem_abs_gplayer_move_by_input end # n method alias falcao_check_event_trigger_there check_event_trigger_there def check_event_trigger_there(triggers) case @direction when 2; push_x = 0; push_y = 1 when 4; push_x = -1; push_y = 0 when 6; push_x = 1; push_y = 0 when 8; push_x = 0; push_y = -1 else; push_x = 0; push_y = 0 end for event in $game_map.events.values if event.puzzle if event.x == x + push_x and event.y == y + push_y return end end end falcao_check_event_trigger_there(triggers) endendclass Game_Character attr_accessor :through # pass-throughend########################## attack_weapon.graphic# # Multihit feature added #------------------------------------------------------------------------------# Game Bomb#------------------------------------------------------------------------------class Game_Bomb < Game_Character attr_accessor :draw attr_accessor :destroy attr_accessor :graphic_name attr_accessor :graphic_index def initialize(parent, item) super() @parent = parent @item = item @graphic_name = "IconSet" @graphic_index = @item.icon_index @area = @item.area @time = @item.delay @destroy = false @draw = false self.priority_type = 2 case @parent.direction when 2 moveto(@parent.x, @parent.y+1) when 4 moveto(@parent.x-1, @parent.y) when 6 moveto(@parent.x+1, @parent.y) when 8 moveto(@parent.x, @parent.y-1) end RPG::SE.new($Requiem_ABS.drop_se[1]).play if $Requiem_ABS.drop_se[1] != "" $game_player.bomb_already = true jump(0,0) move_random if !$game_map.passable?(@x, @y) or $game_map.events_xy(@x, @y) != [] end def update super return if @destroy if @item.voice != nil and Graphics.frame_count % 60 <= 0 RPG::SE.new(@item.voice).play end @time -= 1 if @time > 0 explode if @time <= 0 end def explode @animation_id = @item.animation_id if in_range?(self, $game_player, @area) $game_player.actor.item_effect(@parent.actor, @item) $game_player.jump(0, 0) end for event in $game_map.events.values if event.in_battle and in_range?(self, event, @area) if apply_tool_effect?(event, @item, 2) event.actor.item_effect(@parent.actor, @item) !@item.ultra.nil? ? $game_player.gain_ultra(@item.ultra) : $game_player.gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if @item.shake? unless event.puzzle end event.jump(0, 0) unless event.puzzle end end $game_player.bomb_already = false @destroy = true end def check_event_trigger_touch(x, y) end end#------------------------------------------------------------------------------# Game Drop#------------------------------------------------------------------------------class Game_Drop < Game_Character attr_accessor :draw attr_accessor :destroy attr_accessor :graphic_name attr_accessor :graphic_index def initialize(parent, graphic_index=0, item=nil, gold=0) super() @graphic_name = "IconSet" @graphic_index = graphic_index @item = item @gold = gold @drop_time = Falcao::DropTime moveto(parent.x, parent.y) RPG::SE.new($Requiem_ABS.drop_se[0]).play if $Requiem_ABS.drop_se[0] != "" and @gold > 0 RPG::SE.new($Requiem_ABS.drop_se[1]).play if $Requiem_ABS.drop_se[1] != "" and @items != nil @destroy = false @draw = false @through = true jump(0,0) move_random if !moving? end def update super return if @destroy @drop_time -= 1 if @drop_time > 0 @destroy = @drop_time <= 0 return unless $game_player.on_event?($game_player, self) #return unless Input.trigger?(Input::C) and in_front?($game_player, self) item = $data_items[@item.id] item.field? ? field_action(item) : get_reward end def field_action(item) $game_party.consume_item(item) $game_temp.common_event_id = item.common_event_id if item.common_event_id > 0 $game_player.animation_id = item.animation_id $game_player.actor.item_effect($game_player.actor, item) $game_player.through = false @destroy = true end def get_reward Sound.play_decision case @item when RPG::Item $game_party.gain_item($data_items[@item.id],1) $game_player.reward = $data_items[@item.id].name when RPG::Weapon $game_party.gain_item($data_weapons[@item.id],1) $game_player.reward = $data_weapons[@item.id].name when RPG::Armor $game_party.gain_item($data_armors[@item.id],1) $game_player.reward = $data_weapons[@item.id].name end if @gold > 0 $game_party.gain_gold(@gold) #$game_player.reward = "$ #{@gold}" Audio.se_play("Audio/Se/" + Falcao::GoldDropSe, 100, 100) end @destroy = true end def check_event_trigger_touch(x, y) end end#------------------------------------------------------------------------------# Sprite Base#------------------------------------------------------------------------------class Sprite_Base def animation_set_sprites(frame) cell_data = frame.cell_data for i in 0..15 sprite = @animation_sprites[i] next if sprite == nil pattern = cell_data[i, 0] if pattern == nil or pattern == -1 sprite.visible = false next end if pattern < 100 sprite.bitmap = @animation_bitmap1 else sprite.bitmap = @animation_bitmap2 end sprite.visible = true sprite.src_rect.set(pattern % 5 * 192, pattern % 100 / 5 * 192, 192, 192) if @animation_mirror sprite.x = @animation_ox - cell_data[i, 1] / $Requiem_ABS.animations_divide sprite.y = @animation_oy + cell_data[i, 2] / $Requiem_ABS.animations_divide sprite.angle = (360 - cell_data[i, 4]) sprite.mirror = (cell_data[i, 5] == 0) else sprite.x = @animation_ox + cell_data[i, 1] / $Requiem_ABS.animations_divide sprite.y = @animation_oy + cell_data[i, 2] / $Requiem_ABS.animations_divide sprite.angle = cell_data[i, 4] sprite.mirror = (cell_data[i, 5] == 1) end sprite.z = self.z + 300 + i sprite.ox = 96 sprite.oy = 96 sprite.zoom_x = cell_data[i, 3] / (100.0 * $Requiem_ABS.animations_divide) sprite.zoom_y = cell_data[i, 3] / (100.0 * $Requiem_ABS.animations_divide) sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end end#------------------------------------------------------------------------------# Sprite Character#------------------------------------------------------------------------------class Sprite_Character < Sprite_Base alias requiem_abs_spchar_initialize initialize alias requiem_abs_spchar_update update alias requiem_abs_spchar_dispose dispose def initialize(viewport, character=nil) @character = character @_damage_duration = 0 @_hit_duration = 0 @_reward_duration = 0 requiem_abs_spchar_initialize(viewport,@character) end def update if @character.pattern_force > 0 and !@character.moving? @character.pattern_force -= 1 @character.pattern = 0 if @pattern_force == 1 @pattern_force = 0 end end requiem_abs_spchar_update update_show_dmg update_show_hit update_show_reward update_show_state_ani end def dispose requiem_abs_spchar_dispose dispose_damage dispose_hit dispose_reward end def update_show_dmg if @_damage_duration > 0 @_damage_duration -=1 @_damage_sprite.y -= 1 @_damage_sprite.x = self.x elsif @_damage_duration <= 0 and @_damage_sprite != nil and !@_damage_sprite.disposed? @_damage_sprite.y -= 1 @_damage_sprite.opacity -= 5 dispose_damage if @_damage_sprite.opacity <= 0 end if @character.actor != nil and @character.actor.damage != 0 return if @character.is_a?(Game_Event) and @character.puzzle damage(@character.actor.damage, @character.actor.critical, @character.actor.combo, @character.actor.reflect) @character.actor.damage = 0 @character.actor.critical = @character.actor.combo = @character.actor.reflect = false end end def update_show_hit if @_hit_duration > 0 @_hit_duration -=1 elsif @_hit_duration <= 0 and @_hit_sprite != nil and !@_hit_sprite.disposed? @_hit_sprite.opacity -= 5 dispose_hit if @_hit_sprite.opacity <= 0 end if @character.is_a?(Game_Player) and @character.hit != nil hit(@character.hit) @character.hit = nil end end def update_show_reward if @_reward_duration > 0 @_reward_duration -= 1 elsif @_reward_duration <= 0 and @_reward_sprite != nil and !@_reward_sprite.disposed? @_reward_sprite.opacity -= 5 dispose_reward if @_reward_sprite.opacity <= 0 end if $game_player.reward != nil and $Requiem_ABS.show_reward show_reward($game_player.reward) $game_player.reward = nil end end def update_show_state_ani return if @character.actor.nil? for state in @character.actor.states next if state.nil? or state.animation_id <= 0 if @character.ani_time <= 0 @character.animation_id = state.animation_id @character.ani_time = $data_animations[@character.animation_id].frame_max * 4 + 1 end end end def damage(value, critical, combo, reflect) dispose_damage damage_string = (value.is_a?(Numeric) ? value.abs.to_s : value.to_s) bitmap = Bitmap.new(160, ($Requiem_ABS.damage_properties["Damage"][1]*3)+10) bitmap.font.name = $Requiem_ABS.damage_properties["Damage"][0] bitmap.font.size = $Requiem_ABS.damage_properties["Damage"][1] bitmap.font.bold = $Requiem_ABS.damage_properties["Damage"][2] bitmap.font.italic = $Requiem_ABS.damage_properties["Damage"][3] bitmap.font.color.set(0,0,0) bitmap.draw_text(1, ($Requiem_ABS.damage_properties["Damage"][1]*2)+10, 160, $Requiem_ABS.damage_properties["Damage"][1], damage_string, 1) if value.is_a?(Numeric) and value <= 0 bitmap.font.color = $Requiem_ABS.damage_properties["Colors"][1] else bitmap.font.color = $Requiem_ABS.damage_properties["Colors"][0] end bitmap.draw_text(0, ($Requiem_ABS.damage_properties["Damage"][1]*2)+8, 160, $Requiem_ABS.damage_properties["Damage"][1], damage_string, 1) if critical bitmap.font.color.set(0,0,0) bitmap.draw_text(1, $Requiem_ABS.damage_properties["Damage"][1]+5, 160, $Requiem_ABS.damage_properties["Damage"][1], $Requiem_ABS.damage_properties["Texts"][1], 1) bitmap.font.color = $Requiem_ABS.damage_properties["Colors"][2] bitmap.draw_text(0, $Requiem_ABS.damage_properties["Damage"][1]+4, 160, $Requiem_ABS.damage_properties["Damage"][1], $Requiem_ABS.damage_properties["Texts"][1], 1) end if combo bitmap.font.color.set(0,0,0) bitmap.draw_text(1, 1, 160, $Requiem_ABS.damage_properties["Damage"][1],$Requiem_ABS.damage_properties["Texts"][2], 1) bitmap.font.color = $Requiem_ABS.damage_properties["Colors"][3] bitmap.draw_text(0, 0, 160, $Requiem_ABS.damage_properties["Damage"][1],$Requiem_ABS.damage_properties["Texts"][2], 1) end if reflect bitmap.font.color.set(0,0,0) bitmap.draw_text(1, $Requiem_ABS.damage_properties["Damage"][1]+5, 160, $Requiem_ABS.damage_properties["Damage"][1], $Requiem_ABS.damage_properties["Texts"][6], 1) bitmap.font.color = $Requiem_ABS.damage_properties["Colors"][5] bitmap.draw_text(0, $Requiem_ABS.damage_properties["Damage"][1]+4, 160, $Requiem_ABS.damage_properties["Damage"][1], $Requiem_ABS.damage_properties["Texts"][6], 1) end @_damage_sprite = ::Sprite.new(self.viewport) @_damage_sprite.bitmap = bitmap @_damage_sprite.ox = 80 @_damage_sprite.oy = 20 @_damage_sprite.x = self.x @_damage_sprite.y = self.y-self.oy/2-60 @_damage_sprite.z = 99999 @_damage_duration = 30 end def hit(value) dispose_hit hit_string = (value.is_a?(Numeric) ? value.abs.to_s : value.to_s) bitmap = Bitmap.new(160, $Requiem_ABS.damage_properties["Hits"][1]) bitmap.font.name = $Requiem_ABS.damage_properties["Hits"][0] bitmap.font.size = $Requiem_ABS.damage_properties["Hits"][1] bitmap.font.bold = $Requiem_ABS.damage_properties["Hits"][2] bitmap.font.italic = $Requiem_ABS.damage_properties["Hits"][3] bitmap.font.color.set(0,0,0) bitmap.draw_text(1, 1, 160, 36,"#{hit_string}"+" "+"#{$Requiem_ABS.damage_properties["Texts"][5]}", 2) bitmap.font.color = $Requiem_ABS.damage_properties["Colors"][4] bitmap.draw_text(0, 0, 160, 36,"#{hit_string}"+" "+"#{$Requiem_ABS.damage_properties["Texts"][5]}", 2) @_hit_sprite = ::Sprite.new(self.viewport) @_hit_sprite.bitmap = bitmap @_hit_sprite.x = 374 @_hit_sprite.y = 208 - $Requiem_ABS.damage_properties["Hits"][1] @_hit_sprite.z = 99999 @_hit_duration = 60 end def show_reward(reward) dispose_reward bitmap = Bitmap.new(200, 16) bitmap.font.size = 16 bitmap.font.color = Color.new(0,0,0) bitmap.draw_text(1, 1, bitmap.width, 16, reward) bitmap.font.color = Color.new(255,255,255) bitmap.draw_text(0, 0, bitmap.width, 16, reward) @_reward_sprite = ::Sprite.new(self.viewport) @_reward_sprite.bitmap = bitmap @_reward_sprite.x = 10 @_reward_sprite.y = 200 @_reward_sprite.z = 99999 @_reward_duration = 300 end def dispose_damage return if @_damage_sprite.nil? @_damage_sprite.bitmap.dispose @_damage_sprite.dispose @_damage_sprite = nil end def dispose_hit return if @_hit_sprite.nil? @_hit_sprite.bitmap.dispose @_hit_sprite.dispose @_hit_sprite = nil end def dispose_reward return if @_reward_sprite.nil? @_reward_sprite.bitmap.dispose @_reward_sprite.dispose @_reward_sprite = nil end end#------------------------------------------------------------------------------# Sprite Drop#------------------------------------------------------------------------------class Sprite_Drop < Sprite_Base attr_accessor :character def initialize(viewport, character=nil) super(viewport) @character = character @htime_count = 0 update end def update super update_bitmap self.x = @character.screen_x self.y = @character.screen_y self.z = @character.screen_z self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth if @character.animation_id != 0 start_animation($data_animations[@character.animation_id]) @character.animation_id = 0 end end def update_bitmap return if @graphic_name == @character.graphic_name @graphic_name = @character.graphic_name self.bitmap = Cache.system(@graphic_name) self.ox = 12 self.oy = 24 sx = @character.graphic_index % 16 * 24 sy = @character.graphic_index / 16 * 24 self.src_rect.set(sx, sy, 24, 24) end def update_fzoom @htime_count += 1 zoom_value(0.01) if @htime_count <= 30 if @htime_count >= 30 zoom_value(-0.01) if self.zoom_x <= 1 self.zoom_x = 1; self.zoom_y = 1; @htime_count = 1 end end end def zoom_value(value) self.zoom_x += value self.zoom_y += value endend#------------------------------------------------------------------------------# Sprite Weapon#------------------------------------------------------------------------------class Sprite_Weapon < Sprite_Base attr_accessor :character def initialize(viewport, character=nil) super(viewport) @character = character self.visible = false create_bitmap update end def update super return unless $Requiem_ABS.allow_weapons_graphics return if @character.actor.nil? self.visible = @character.anime_attack > 0 update_src_rect change_direction end def create_bitmap self.bitmap = Cache.system("Iconset") self.ox = 12 self.oy = 24 self.zoom_x = 0.80 self.zoom_y = 0.80 end def update_src_rect sx = weapon_index % 16 * 24 sy = weapon_index / 16 * 24 self.src_rect.set(sx, sy, 24, 24) end def change_direction case @character.direction when 2 self.x = @character.screen_x-6 self.z = @character.screen_z+2 self.mirror = false change_angle(180, 135, 90) when 4 self.x = @character.screen_x-10 self.z = @character.screen_z-1 self.mirror = false change_angle(-45, 0, 45) when 6 self.x = @character.screen_x+10 self.z = @character.screen_z+2 self.mirror = true change_angle(45, 0, -45) when 8 self.x = @character.screen_x+10 self.z = @character.screen_z-1 self.mirror = true change_angle(45, 0, -45) end self.y = @character.screen_y-4 self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth end def change_angle(a, b, c) if @character.anime_attack >= 20 self.angle = a elsif @character.anime_attack >= 15 self.angle = b elsif @character.anime_attack >= 10 self.angle = c end end def weapon_index return 0 if @character.actor.nil? if @character.actor.is_a?(Game_Actor) and @character.right_attack_on and @character.actor.equips[0] != nil return @character.actor.equips[0].icon_index elsif @character.actor.is_a?(Game_Actor) and @character.left_attack_on if @character.actor.two_swords_style and @character.actor.equips[1] != nil return @character.actor.equips[1].icon_index elsif @character.actor.two_hands_legal? and @character.actor.equips[0] != nil and @character.actor.equips[0].ranged? return @character.actor.equips[0].icon_index end elsif @character.actor.is_a?(Game_Enemy) and @character.actor.weapon_icon > 0 return @character.actor.weapon_icon end return 0 end end#------------------------------------------------------------------------------# Sprite Shield#------------------------------------------------------------------------------class Sprite_Shield < Sprite_Base attr_accessor :character def initialize(viewport, character = nil) super(viewport) @character = character self.visible = false create_bitmap update end def update super return unless $Requiem_ABS.allow_shields_graphics return if @character.actor.nil? self.visible = @character.actor.defending update_src_rect change_direction moving_with_shield end def create_bitmap self.bitmap = Cache.system("Iconset") self.ox = 12 self.oy = 24 self.zoom_x = 0.80 self.zoom_y = 0.80 end def update_src_rect sx = shield_index % 16 * 24 sy = shield_index / 16 * 24 self.src_rect.set(sx, sy, 24, 24) end def change_direction case @character.direction when 2 self.mirror = true self.x = @character.screen_x+6 self.z = @character.screen_z+1 when 4 self.mirror = false self.x = @character.screen_x-6 self.z = @character.screen_z+1 when 6 self.mirror = true self.x = @character.screen_x+6 self.z = @character.screen_z-1 when 8 self.mirror = false self.x = @character.screen_x-6 self.z = @character.screen_z-1 end self.y = @character.screen_y self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth end def moving_with_shield if @character.moving? self.wave_amp = 1 self.wave_length = 1 self.wave_speed = 6 else self.wave_amp = 0 end end def shield_index return 0 if @character.actor.nil? if @character.actor.is_a?(Game_Actor) and !@character.actor.two_swords_style and @character.actor.armor1_id > 0 return $data_armors[@character.actor.armor1_id].icon_index elsif @character.actor.is_a?(Game_Enemy) and @character.actor.shield_icon > 0 return @character.actor.shield_icon end return 0 end end#--------------------------------------------------class Sprite_Icon_Char < Sprite_Base def initialize(viewport, character = nil) super(viewport) @character = character self.visible = false @time_v = 0 update end def update super self.visible = @character.icon_char_visible if @character.icon_char_visible @time_v += 1 if @time_v == 25 @character.icon_char_visible = false @time_v = 0 end end self.x = @character.screen_x self.y = @character.screen_y self.z = @character.screen_z + 150 self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth update_bitmap update_src_rect end def update_bitmap if @icon_char != @character.icon_char @icon_char = @character.icon_char self.bitmap = Cache.character(@character.icon_char) #@character.icon_char sign = @character.icon_char[/^[\!\$]./] if sign != nil and sign.include?('$') @cw = bitmap.width / 3 @ch = bitmap.height / 4 else @cw = bitmap.width / 12 @ch = bitmap.height / 8 end self.ox = @cw / 2 self.oy = @ch end end def update_src_rect index = 0 pattern = @character.pattern < 3 ? @character.pattern : 1 sx = (index % 4 * 3 + pattern) * @cw sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch self.src_rect.set(sx, sy, @cw, @ch) endend#------------------------------------------------------------------------------# Spriteset Map#------------------------------------------------------------------------------class Spriteset_Map attr_accessor :viewport3 attr_accessor :viewport1 alias requiem_abs_sp_map_create_characters create_characters alias requiem_abs_sp_map_dispose_characters dispose_characters def create_characters @range_sprites = [] for range in $game_range next if range.nil? or !$game_map.in_range?(range) @range_sprites.push(Sprite_Character.new(@viewport1, range)) p range end @drop_sprites = [] for drop in $game_drop next if drop.nil? or !$game_map.in_range?(drop) @drop_sprites.push(Sprite_Drop.new(@viewport1, drop)) end for bomb in $game_bomb next if bomb.nil? or !$game_map.in_range?(bomb) @drop_sprites.push(Sprite_Drop.new(@viewport1, bomb)) end @weapon_sprites = [] @weapon_sprites.push(Sprite_Weapon.new(@viewport1, $game_player)) @shield_sprites = [] @shield_sprites.push(Sprite_Shield.new(@viewport1, $game_player)) #Icon char sprites @icon_char = [] for i in $game_map.events.keys.sort @icon_char.push(Sprite_Icon_Char.new(@viewport1, $game_map.events[i])) end @icon_char.push(Sprite_Icon_Char.new(@viewport1, $game_player)) for i in $game_map.events.keys.sort @weapon_sprites.push(Sprite_Weapon.new(@viewport1, $game_map.events[i])) @shield_sprites.push(Sprite_Shield.new(@viewport1, $game_map.events[i])) end requiem_abs_sp_map_create_characters end def update_characters for sprite in @character_sprites if sprite.character.is_a?(Game_Event) if $game_map.in_range?(sprite.character) or sprite.character.check_comment("Force Update") sprite.update else sprite.visible = false end else sprite.update end end for char in @icon_char char.update end for range in @range_sprites next if range.nil? or !$game_map.in_range?(range.character) range.update end for drop in @drop_sprites next if drop.nil? next if !$game_map.in_range?(drop.character) drop.update drop.update_fzoom end for weapon in @weapon_sprites next if weapon.nil? or !$game_map.in_range?(weapon.character) weapon.update end for shield in @shield_sprites next if shield.nil? or !$game_map.in_range?(shield.character) shield.update end for range in $game_range next if range.nil? or !$game_map.in_range?(range) unless range.draw @range_sprites.push(Sprite_Character.new(@viewport1, range)) range.draw = true end if range.destroy range.character_name = "" $game_range.delete(range) for s in @range_sprites next if s.nil? if s.character.destroy @range_sprites.delete(s) s.dispose end end end end for drop in $game_drop next if drop.nil? or !$game_map.in_range?(drop) unless drop.draw @drop_sprites.push(Sprite_Drop.new(@viewport1, drop)) drop.draw = true end if drop.destroy drop.graphic_name = "" $game_drop.delete(drop) for d in @drop_sprites next if d.nil? if d.character.destroy @drop_sprites.delete(d) d.dispose end end end end for bomb in $game_bomb next if bomb.nil? or !$game_map.in_range?(bomb) unless bomb.draw @drop_sprites.push(Sprite_Drop.new(@viewport1, bomb)) bomb.draw = true end if bomb.destroy bomb.graphic_name = "" $game_drop.delete(bomb) end end end def dispose_characters requiem_abs_sp_map_dispose_characters for char in @icon_char char.dispose end for range in @range_sprites next if range.nil? range.dispose end for drop in @drop_sprites next if drop.nil? drop.dispose end for weapon in @weapon_sprites next if weapon.nil? weapon.dispose end for shield in @shield_sprites next if shield.nil? shield.dispose end end end#------------------------------------------------------------------------------# Window Base#------------------------------------------------------------------------------class Window_Base < Window def draw_actor_head(actor, x, y, enabled=true) char_name = actor.character_name char_index = actor.character_index bitmap = Cache.character(char_name) sign = char_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end enbl = (enabled ? 255 : 128) src_rect = Rect.new((char_index%4*3+1)*cw, (char_index/4*4)*ch, cw, ch/3*2) self.contents.blt(x,y,bitmap,src_rect,enbl) end end#------------------------------------------------------------------------------# Scene Map#------------------------------------------------------------------------------class Scene_Map < Scene_Base alias requiem_abs_smap_update update alias requiem_abs_smap_terminate terminate def update requiem_abs_smap_update for range in $game_range next if range.nil? or !$game_map.in_range?(range) range.update end for drop in $game_drop next if drop.nil? or !$game_map.in_range?(drop) drop.update end for bomb in $game_bomb next if bomb.nil? or !$game_map.in_range?(bomb) bomb.update end end def update_encounter endend#------------------------------------------------------------------------------# Game Range#------------------------------------------------------------------------------class Game_Range < Game_Character attr_accessor :draw attr_accessor :destroy # editado def initialize(parent, chara_name="", chara_index=0, speed=4, range=5, type=3) super() @parent = parent @character_name = chara_name @character_index = chara_index @move_speed = speed @range = range @type = type @step = 0 @atime = 0 @destroy = false @draw = false @moving = false @direction = @parent.direction @through = true moveto(@parent.x, @parent.y) case @type when 1 @item = @parent.actor.equips[0] when 2 if @parent.actor.two_hands_legal? @item = @parent.actor.equips[0] else @item = @parent.actor.equips[1] end when 3...5 @item = @parent.assigned_skill when 5...7 @item = @parent.assigned_item end end # editado def update super return if @destroy @destroy = (@step > @range) return unless stopping? if in_screen?(self) and @item.path == "Line" @destroy = true end if @item.animation != nil @atime += 1 case @atime when 2 self.animation_id = @item.animation when 12 @atime = 0 end end case @item.path when "Line" unless @moving @move_route = RPG::MoveRoute.new for i in 0...@range @move_route.list.insert(0, RPG::MoveCommand.new(12)) end @moving = true end when "Boom" unless @moving @move_route = RPG::MoveRoute.new @move_route.list = [ RPG::MoveCommand.new(12), RPG::MoveCommand.new(12), RPG::MoveCommand.new(12), RPG::MoveCommand.new(12), RPG::MoveCommand.new(12), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new(10), RPG::MoveCommand.new()] @range = @move_route.list.size-1 @moving = true end when "Circle" unless @moving #$game_player.anime_attack = 70 @move_route = RPG::MoveRoute.new @move_route.list = [ RPG::MoveCommand.new(37), RPG::MoveCommand.new(4), RPG::MoveCommand.new(2), RPG::MoveCommand.new(1), RPG::MoveCommand.new(1), RPG::MoveCommand.new(3), RPG::MoveCommand.new(3), RPG::MoveCommand.new(4), RPG::MoveCommand.new(4), RPG::MoveCommand.new(2), RPG::MoveCommand.new()] @range = @move_route.list.size-1 @moving = true end when "Jump" unless @moving @move_route = RPG::MoveRoute.new case @parent.direction when 2; dir = 0, 3 when 4; dir = -3, 0 when 6; dir = 3, 0 when 8; dir = 0, -3 end @move_route.list = [ RPG::MoveCommand.new(14, [dir[0], dir[1]]), RPG::MoveCommand.new()] @moving = true end when "Random" unless @moving @move_route = RPG::MoveRoute.new for i in 0...@range @move_route.list.insert(0, RPG::MoveCommand.new(9)) end @moving = true end when "Circle Doble" unless @moving @move_route = RPG::MoveRoute.new @move_route.list = [ RPG::MoveCommand.new(37), RPG::MoveCommand.new(4), RPG::MoveCommand.new(2), RPG::MoveCommand.new(1), RPG::MoveCommand.new(1), RPG::MoveCommand.new(3), RPG::MoveCommand.new(3), RPG::MoveCommand.new(4), RPG::MoveCommand.new(4), RPG::MoveCommand.new(2), RPG::MoveCommand.new(2), RPG::MoveCommand.new(1), RPG::MoveCommand.new(1), RPG::MoveCommand.new(3), RPG::MoveCommand.new(3), RPG::MoveCommand.new(4), RPG::MoveCommand.new(4), RPG::MoveCommand.new(2), RPG::MoveCommand.new()] @range = @move_route.list.size-1 @moving = true end end @move_route.skippable = true move_type_custom x = (@direction == 4 ? -1 : @direction == 6 ? 1 : 0) y = (@direction == 2 ? 1 : @direction == 8 ? -1 : 0) check_event_trigger_touch(@x+x, @y+y) unless jumping? @step += 1 end def check_event_trigger_touch(x, y) return if @destroy if @type == 3 and @parent.is_a?(Game_Event) if @parent.assigned_skill.tool_size > 1 hurt_hero if area_size?(self, $game_player, @parent.assigned_skill.tool_size) else; hurt_hero if $game_player.pos?(x, y) end end for event in $game_map.events.values next unless event.in_battle if @item.tool_size > 1 and !@parent.is_a?(Game_Event) next unless area_size?(self, event, @item.tool_size) else; next unless event.pos?(x, y) end self.through = false if @item.multihitx2? case @type when 1 hurt_enemy_weapon_right(event) when 2 hurt_enemy_weapon_left(event) when 3 hurt_enemy_skill(event) when 4 hurt_enemy_skill_explode when 5 hurt_enemy_item(event) when 6 hurt_enemy_item_explode end end end def hurt_hero if @parent.assigned_skill.multihit? $game_player.token_active[0] = 5 $game_player.token_active[1].push($game_player) else @destroy = true end return if $game_player.freeze_state $game_player.hurt_action[0].push($game_player) $game_player.hurt_action[1] = @parent.assigned_skill.hit_delay $game_player.hurt_action[2] = @parent.assigned_skill.frezar? step_back_action($game_player, self, @parent.assigned_skill.step_back) $game_map.screen.start_shake(7, 5, 30) if @parent.assigned_skill.shake? $game_player.animation_id = @parent.assigned_skill.animation_id $game_player.actor.skill_effect(@parent.actor, @parent.assigned_skill) $game_player.jump(0,0) $game_player.blink_time = 30 end def hurt_enemy_weapon_right(enemy) return unless apply_tool_effect?(enemy, @parent.actor.equips[0], 1) if @parent.actor.equips[0].multihit? enemy.token_active[0] = 5 enemy.token_active[1].push(enemy) else @destroy = true end return if enemy.actor.dead? or enemy.object return if enemy.freeze_state enemy.hurt_action[0].push(enemy) enemy.hurt_action[1] = @parent.actor.equips[0].hit_delay enemy.hurt_action[2] = @parent.actor.equips[0].frezar? !@parent.actor.equips[0].ultra.nil? ? $game_player.gain_ultra(@parent.actor.equips[0].ultra) : $game_player.gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if @parent.actor.equips[0].shake? and !enemy.puzzle if enemy.puzzle enemy.start else; enemy.animation_id = @parent.actor.equips[0].ammo1.animation_id if @parent.actor.equips[0].ammo1 != nil end enemy.actor.attack_effect(@parent.actor, enemy.puzzle) return if enemy.puzzle enemy.jump(0,0) enemy.blink_time = enemy.enemy_actor.blink return if enemy.backward_disable step_back_action(enemy, self, @parent.actor.equips[0].step_back) end def hurt_enemy_weapon_left(enemy) @destroy = true return if enemy.actor.dead? or enemy.object return if enemy.freeze_state if @parent.actor.two_swords_style @weapon = @parent.actor.equips[1] else @weapon = @parent.actor.equips[0] end enemy.hurt_action[0].push(enemy) enemy.hurt_action[1] = @parent.actor.equips[1].hit_delay enemy.hurt_action[2] = @parent.actor.equips[1].frezar? !@parent.actor.equips[1].ultra.nil? ? $game_player.gain_ultra(@parent.actor.equips[1].ultra) : $game_player.gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if @parent.actor.equips[1].shake? and !enemy.puzzle if enemy.puzzle enemy.start else; enemy.animation_id = @weapon.ammo2.animation_id if @weapon.ammo2 != nil end enemy.actor.attack_effect(@parent.actor, enemy.puzzle) enemy.jump(0,0) unless enemy.puzzle enemy.blink_time = enemy.enemy_actor.blink end def hurt_enemy_skill(enemy) return unless apply_tool_effect?(enemy, @parent.assigned_skill, 3) if @parent.assigned_skill.multihit? enemy.token_active[0] = 5 enemy.token_active[1].push(enemy) else @destroy = true end return if enemy.actor.dead? or enemy.object return if enemy.freeze_state enemy.hurt_action[0].push(enemy) enemy.hurt_action[1] = @parent.assigned_skill.hit_delay enemy.hurt_action[2] = @parent.assigned_skill.frezar? !@parent.assigned_skill.ultra.nil? ? $game_player.gain_ultra(@parent.assigned_skill.ultra) : $game_player.gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if @parent.assigned_skill.shake? and !enemy.puzzle if enemy.puzzle enemy.start else; enemy.animation_id = @parent.assigned_skill.animation_id end enemy.actor.skill_effect(@parent.actor, @parent.assigned_skill, enemy.puzzle) return if enemy.puzzle enemy.jump(0,0) enemy.blink_time = enemy.enemy_actor.blink return if enemy.backward_disable step_back_action(enemy, self, @parent.assigned_skill.step_back) end def hurt_enemy_item(enemy) return unless apply_tool_effect?(enemy, @parent.assigned_item, 2) if @parent.assigned_item.multihit? enemy.token_active[0] = 5 enemy.token_active[1].push(enemy) else @destroy = true end return if enemy.actor.dead? or enemy.object return if enemy.freeze_state enemy.hurt_action[0].push(enemy) enemy.hurt_action[1] = @parent.assigned_item.hit_delay enemy.hurt_action[2] = @parent.assigned_item.frezar? !@parent.assigned_item.ultra.nil? ? $game_player.gain_ultra(@parent.assigned_item.ultra) : $game_player.gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if @parent.assigned_item.shake? and !enemy.puzzle if enemy.puzzle enemy.start else; enemy.animation_id = @parent.assigned_item.animation_id end enemy.actor.item_effect(@parent.actor, @parent.assigned_item, enemy.puzzle) return if enemy.puzzle enemy.jump(0,0) enemy.blink_time = enemy.enemy_actor.blink return if enemy.backward_disable step_back_action(enemy, self, @parent.assigned_item.step_back) end def hurt_enemy_skill_explode for event in $game_map.events.values next unless event.in_battle next unless in_range?(self, event, @parent.assigned_skill.area) next if event.freeze_state return if event.actor.dead? or event.object next unless apply_tool_effect?(event, @parent.assigned_skill, 3) @destroy = true if !@parent.assigned_skill.multihit? $game_map.screen.start_shake(7, 5, 30) if @parent.assigned_skill.shake? and !event.puzzle !@parent.assigned_skill.ultra.nil? ? $game_player.gain_ultra(@parent.assigned_skill.ultra) : $game_player.gain_ultra(1) if @parent.assigned_skill.multihit? event.token_active[0] = 5 event.token_active[1].push(event) else @destroy = true end event.hurt_action[0].push(event) event.hurt_action[1] = @parent.assigned_skill.hit_delay event.hurt_action[2] = @parent.assigned_skill.frezar? if event.puzzle event.start else; event.animation_id = @parent.assigned_skill.animation_id end event.actor.skill_effect(@parent.actor, @parent.assigned_skill) return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, @parent.assigned_skill.step_back) end end def hurt_enemy_item_explode for event in $game_map.events.values next unless event.in_battle and in_range?(self, event, @parent.assigned_item.area) next if event.freeze_state return if event.actor.dead? or event.object return unless apply_tool_effect?(enemy, @parent.assigned_item, 2) @destroy = true if !@parent.assigned_skill.multihit? !@parent.assigned_item.ultra.nil? ? $game_player.gain_ultra(@parent.assigned_item.ultra) : $game_player.gain_ultra(1) $game_map.screen.start_shake(7, 5, 30) if @parent.assigned_item.shake? and !event.puzzle if @parent.assigned_item.multihit? event.token_active[0] = 5 event.token_active[1].push(event) else @destroy = true end event.hurt_action[0].push(event) event.hurt_action[1] = @parent.assigned_item.hit_delay event.hurt_action[2] = @parent.assigned_item.frezar? if event.puzzle event.start else; event.animation_id = @parent.assigned_item.animation_id end event.actor.item_effect(@parent.actor, @parent.assigned_item, event.puzzle) return if event.puzzle event.jump(0,0) event.blink_time = event.enemy_actor.blink return if event.backward_disable step_back_action(event, self, @parent.assigned_item.step_back) end end def map_passable?(x, y) return $game_map.range_passable?(x, y) endend#------------------------------------------------------------------------------# High Priority#------------------------------------------------------------------------------Win32API.new("kernel32", "SetPriorityClass", "pi", "i").call(-1, 0x80)#------------------------------------------------------------------------------# End of ABS#------------------------------------------------------------------------------$Requiem_ABS = Requiem_ABS.newendclass Sprite_Base < Sprite alias fal991_update update def updateif !@animation.nil? if @animation.position == 3if viewport == nil @animation_ox = Graphics.width / 2 @animation_oy = Graphics.height / 2else @animation_ox = viewport.rect.width / 2 @animation_oy = viewport.rect.height / 2end else@animation_ox = x - ox + width / 2@animation_oy = y - oy + height / 2if @animation.position == 0 @animation_oy -= height / 2elsif @animation.position == 2 @animation_oy += height / 2end endendfal991_update endendResponder Con Cita

View the original article here

  • Digg
  • del.icio.us
  • StumbleUpon
  • Yahoo! Buzz
  • Technorati
  • Facebook
  • TwitThis
  • MySpace
  • LinkedIn
  • Live
  • Google
  • Reddit
  • Sphinn
  • Propeller
  • Slashdot
  • Netvibes

0 comments:

Post a Comment