Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Sneak States Addon for Falcao's Pearl ABS Liquid v3
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.3
- # * Updated: 06/01/2016
- # * Requires: Falcao's Pearl ABS Liquid v3
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (24/10/2015)
- # - Initial release.
- # * Version 1.1 (25/10/2015)
- # - Added opacity change settings for sneaking mode.
- # * Version 1.2 (03/11/2015)
- # - Added a script call to check if the player got any sneak states inflicted
- # or not.
- # * Version 1.3 (06/01/2016)
- # - Added a compatibility edit for my Multi-Elements script.
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * This script will let you make sneak states.
- # Enemies will not be able to see you if you got the sneak state inflicted
- # on your party leader.
- # * Can setup a blend effect for showing that the player is in sneaking mode.
- # If the blend effect is not enough, you can change the opacity of the
- # sneaking character too.
- # * Can add bonus effects for tools executed during sneak mode. The effects are:
- # Hit Rate, Critical Rate, Damage, and Critical Damage multipliers!
- # * Can set up enemies which ignore the sneaking mode.
- # * Can also set up tools which ignore the sneaking effects.
- #-------------------------------------------------------------------------------
- # * < Note-Tags >
- #-------------------------------------------------------------------------------
- # * If you don't want a tool to gain any sneaking bonuses, or if you want an
- # enemy to ignore the sneaking effect, you can tag your tools/enemies with the
- # following note-tag:
- #
- # <ignore sneak>
- #
- # Enemies with this note-tag will still chase you even if you are in
- # sneaking mode!
- # Tools with this note-tag will not give any bonus effects even if you are in
- # sneaking mode!
- #-------------------------------------------------------------------------------
- # * < Script Calls >
- #-------------------------------------------------------------------------------
- # * To check if the player is in sneak mode (got any sneak states inflicted),
- # you can use this script call in conditional branches:
- #
- # player_sneaking?
- #
- # It returns true if the player got a sneaking state inflicted, otherwise
- # it returns false.
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * Place this scipt below the last script from Falcao's Pearl ABS Liquid v3
- # script series but above Main!
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * No known issues.
- #-------------------------------------------------------------------------------
- # * < 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["SixthSneakStates"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module SneakStates
- #-----------------------------------------------------------------------------
- # Sneak State Settings:
- #-----------------------------------------------------------------------------
- # Any state IDs entered in the array below will be marked as a sneak state.
- #-----------------------------------------------------------------------------
- States = [44]
- #-----------------------------------------------------------------------------
- # Sneak Effect Settings:
- #-----------------------------------------------------------------------------
- # You can set up a visual effect for your sneaking characters and some extra
- # effects for the attacks made while in sneaking mode.
- # The sneak state will be removed immediately if the player uses a tool!
- # But the tool used in sneaking mode can give additional benefits, such as
- # extra damage, hit and critical rate.
- # All of the effect settings are multiplier settings! This means that the
- # default value will be used to determine the bonus effects by multiplying
- # that value with the one you set up here. The result of this calculation
- # will be added to the final result.
- # So, anything above 0 will be considered as a bonus value, anything below 0
- # will be considered as a negative bonus, and 0 will not change anything.
- #-----------------------------------------------------------------------------
- Effects = {
- :blend => 2, # blend mode, can be: 0 - normal, 1 - add, 2 - sub
- :opacity => 150, # opacity of the characters on sneak state
- :damage => 1.0, # 1.0 means +100% damage bonus
- :hit => 1.0, # 1.0 means +100% hit bonus
- :crit => 2.5, # 2.5 means +250% critical rate
- :cridmg => 5.0 # 1.0 means +100% critical damage
- }
- end
- #===============================================================================
- # End of Settings! Do not edit below this line unless pink pigs are flying!
- #===============================================================================
- class Game_Interpreter
- def player_sneaking?
- return SneakStates::States.any? {|st| $game_party.leader.state?(st)}
- end
- end
- class RPG::UsableItem < RPG::BaseItem
- attr_accessor :ignore_sneak
- def ignore_sneak
- set_ignore_sneak if @ignore_sneak.nil?
- return @ignore_sneak
- end
- def set_ignore_sneak
- @ignore_sneak = @note.include?("<ignore sneak>")
- end
- end
- class Game_Battler < Game_BattlerBase
- attr_accessor :sneak_effect
- alias kill_sneak_effects0086 use_item
- def use_item(item)
- if !item.ignore_sneak && SneakStates::States.any? {|st| state?(st)}
- @sneak_effect = true
- else
- @sneak_effect = false
- end
- kill_sneak_effects0086(item)
- SneakStates::States.each {|st| remove_state(st) if state?(st)}
- end
- alias add_sneak_eff4432 item_hit
- def item_hit(user, item)
- val = add_sneak_eff4432(user, item)
- if user.sneak_effect
- val += val * SneakStates::Effects[:hit]
- end
- return val
- end
- alias add_sneak_eff5532 item_cri
- def item_cri(user, item)
- val = add_sneak_eff5532(user, item)
- if user.sneak_effect
- val += val * SneakStates::Effects[:crit]
- end
- return val
- end
- alias add_sneak_eff6632 item_element_rate
- def item_element_rate(*args)
- user = args[0]
- val = add_sneak_eff6632(*args)
- if user.sneak_effect
- val += val * SneakStates::Effects[:damage]
- end
- return val
- end
- alias add_sneak_eff7732 apply_critical
- def apply_critical(damage)
- val = add_sneak_eff7732(damage)
- if @sneak_effect
- val += damage * SneakStates::Effects[:cridmg]
- end
- return val
- end
- end
- class Sprite_Character < Sprite_Base
- alias add_sneak_effect6654 update
- def update
- add_sneak_effect6654
- if @character && @character.is_a?(Game_Player) || @character.is_a?(Game_Follower)
- update_sneak_effect
- end
- end
- def update_sneak_effect
- if SneakStates::States.any? {|st| $game_player.battler.state?(st)}
- if self.blend_type != SneakStates::Effects[:blend]
- @old_blend = self.blend_type
- self.blend_type = SneakStates::Effects[:blend]
- end
- if self.opacity != SneakStates::Effects[:opacity]
- @old_opa = self.opacity
- self.opacity = SneakStates::Effects[:opacity]
- end
- else
- if @old_blend && self.blend_type != @old_blend
- self.blend_type = @old_blend
- @old_blend = nil
- end
- if @old_opa && self.opacity != @old_opa
- self.opacity = @old_opa
- @old_opa = nil
- end
- end
- end
- end
- class Game_Event < Game_Character
- def ignore_sneak
- return false unless @enemy
- return @enemy.enemy.note.include?("<ignore sneak>")
- end
- alias add_sneak_eff8875 update_enemy_sensor
- def update_enemy_sensor
- if !ignore_sneak && SneakStates::States.any? {|st| $game_player.battler.state?(st)}
- return if @hookshoting[0]
- return if @epassive
- return if collapsing?
- data = [$game_map.map_id, @id, PearlKernel::Enemy_Sensor]
- $game_self_switches[data] = false if $game_self_switches[data]
- @inrangeev = nil if @inrangeev
- else
- add_sneak_eff8875
- end
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement