#=============================================================================== # Additional Animations [JVBS] # By Jet10985 (Jet) #=============================================================================== # This script will allow the displaying of additional animations for different # actions in battle. This animation will take place before the action is taken. # This script has: 3 customization options. #=============================================================================== # Overwritten Methods: # None #------------------------------------------------------------------------------- # Aliased methods: # Scene_Battle: use_item # Game_Battler: add_state #=============================================================================== =begin To specify an pre-animation for a item, state, or skill, use this in the object's notebox: Replace 50 with the id of the animation =end module Jet module VBS # This animation will play on the battler before he uses an item by default ITEM_ANIMATION = 43 # This animation will play on the battler before he uses a skill by default SKILL_ANIMATION = 43 # This is he default state animation that will play if no specific # one is specified. STATE_ANIMATION = 0 end end #=============================================================================== # DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO. #=============================================================================== module RPG class State def animation (f = note.match(//i)) ? f[1].to_i : Jet::VBS::STATE_ANIMATION end end class Skill def animation (f = note.match(//i)) ? f[1].to_i : Jet::VBS::SKILL_ANIMATION end end class Item def animation (f = note.match(//i)) ? f[1].to_i : Jet::VBS::ITEM_ANIMATION end end end class Scene_Battle attr_reader :spriteset alias jet8456_use_item use_item def use_item(*args, &block) n = $data_animations[@subject.current_action.item.animation] sprite = @spriteset.battler_to_sprite(@subject) sprite.start_animation(n) if sprite wait_for_animation jet8456_use_item(*args, &block) end end class Spriteset_Battle def battler_to_sprite(actor) battler_sprites.each {|a| return a if a.battler == actor } return false end end class Game_Battler alias jet3467_add_state add_state def add_state(id) before = state?(id) jet3467_add_state(id) return unless SceneManager.scene_is?(Scene_Battle) if before != state?(id) && state?(id) sprite = SceneManager.scene.spriteset.battler_to_sprite(self) sprite.start_animation($data_animations[$data_states[id].animation]) if sprite end end end class Game_Action def guard? item == $data_skills[subject.guard_skill_id] end end