Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Falcao's ABS + Victor's Pixel Movement Patch
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.0
- # * Updated: 08/05/2016
- # * Requires: Falcao's Pearl ABS Liquid v3
- # Victor's Pixel Movement
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (08/05/2016)
- # - Initial release.
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * This script aims to fix the collision issues with Victor's pixel movement
- # system in Falcao's ABS. It is far from being fully functional, but most
- # of the tools should work.
- #-------------------------------------------------------------------------------
- # * < Note-tags >
- #-------------------------------------------------------------------------------
- # * To add a custom size for your tools, use this note-tag:
- #
- # <proj size: width, height>
- #
- # The width and height are measured in pixels.
- #
- # If you don't set this up, the default size will be used, which is gotten
- # from the image size of the projectile, I guess... Not sure, never really
- # tested it, but it uses the same method Victor used in his pixel movement
- # script, so whatever that does, it will do with your projectiles too.
- #
- # NOTE:
- #
- # The width and height you set up means the width and height of the
- # character/projectile when it is facing up or down!
- # If the character/projectile is facing left or right, the width and height
- # will be inverted! This is to enable you to make events/projectiles which
- # change their collision size based on their direction.
- # This behaviour is true for the player, followers, events and projectiles!
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * Place this script below all of Falcao's ABS scripts but above Main!
- # * If you are using my Bugfixes script for Falcao's ABS, you must put this
- # script below that one!
- # * If you plan to use Pikakapi's Battle Royale Addon for Falcao's ABS, you must
- # put this script below that one (and below the Bugfixes + Battle Royal patch
- # if you use my Bugfixes script)!
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * The hookshot and boomerang special tool types will NOT work!
- # Can't promise a fix for this, just a "maybe sometimes"...
- #-------------------------------------------------------------------------------
- # * < Terms of Use >
- #-------------------------------------------------------------------------------
- # * Free to use for whatever purposes you want.
- # * Credit me (Sixth) in your game, pretty please! :P
- # * Posting modified versions of this script is allowed as long as you notice me
- # about it with a link to it!
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["SixthFABSPlusVPixel"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module FABS_VPixel
- # This is a simple enable/disable option.
- # If you use Pikakapi's Battle Royale addon for Falcao's ABS, you must set
- # this to true or else that addon will not function properly!
- # If you don't use that addon, leave this on false, or else your game will
- # crash as soon as a tool hits a target!
- BattleRoyale = false
- end
- #===============================================================================
- # End of Settings! Editing anything below may lead to... you know it, right?
- #===============================================================================
- class Projectile < Game_Character
- def bw
- case @direction
- when 2, 8
- init_size if @bw.nil?
- return @bw
- when 4, 6
- init_size if @bh.nil?
- return @bh
- end
- end
- def bh
- case @direction
- when 2, 8
- init_size if @bh.nil?
- return @bh
- when 4, 6
- init_size if @bw.nil?
- return @bw
- end
- end
- def init_size
- if @item.note =~ /<proj size: (\d+), (\d+)>/i
- setup_custom_dimension($1.to_i, $2.to_i)
- else
- setup_bitmap_dimension
- end
- end
- def setup_custom_dimension(x, y)
- x1 = (x / 8).to_i
- y1 = (y / 8).to_i
- @bw = x1 / 4.0
- @bh = y1 / 4.0
- end
- def apply_damageto_enemy
- return if @tool_effect_delay > 0
- $game_map.event_enemies.each do |event|
- next if event.collapsing?
- if FABS_VPixel::BattleRoyale == true
- unless @tool_selfdamage
- if @user.battler.is_a?(Game_Enemy)
- next if @user.ally_battler?(event)
- elsif @user.battler.is_a?(Game_Actor)
- next if event.ally?
- end
- end
- end
- if obj_size?(event, @tool_size) and event.just_hitted == 0
- event.just_hitted = @tool_inv_time.nil? ? 20 : @tool_inv_time
- next if event.page.nil?
- if !enable_dame_execution?(event.battler)
- unless event.battler.object
- RPG::SE.new(Key::GuardSe, 80).play
- event.pop_damage('Guard')
- play_hit_animation(event)
- end
- return
- end
- execute_damageto_enemy(event)
- end
- end
- end
- end
- class Game_CharacterBase
- def bw
- case @direction
- when 2, 8
- setup_bitmap_dimension unless @bw && character_name == @character_name_wh
- @bw
- when 4, 6
- setup_bitmap_dimension unless @bh && character_name == @character_name_wh
- @bh
- end
- end
- def bh
- case @direction
- when 2, 8
- setup_bitmap_dimension unless @bh && character_name == @character_name_wh
- @bh
- when 4, 6
- setup_bitmap_dimension unless @bw && character_name == @character_name_wh
- @bw
- end
- end
- alias add_proj_collision9382 obj_size?
- def obj_size?(target, size)
- return false if target.nil?
- result = add_proj_collision9382(target, size) || proj_collision?(target)
- return result
- end
- def proj_collision?(target)
- return target.collision?(@x, @y, bw, bh)
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement