Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=============================================================================
- # Kadafi - Usable Item Disable State
- # Version : 1.0
- # Contact : http://www.facebook.com/xandalfi
- # =============================================================================
- ($imported ||= {})[:Kadafi_UsableItemDisableState] = true
- # =============================================================================
- # CHANGE LOGS:
- # -----------------------------------------------------------------------------
- # 2014.12.20 - Finished script
- # =============================================================================
- =begin
- Introduction :
- This script allow you to disable the use of UsableItem (item / skill)
- according to the actor state.
- How to Use :
- Notetag at item / skill note box: <disable_state: state_id>
- Terms of Use :
- 1. Credit me as Kadafi
- =end
- # =============================================================================
- # Don't edit below this line unless you know what to do.
- # =============================================================================
- class RPG::UsableItem < RPG::BaseItem
- def disable_state
- return @disable_state if @disable_state
- note[/<disable_state\s*:\s*(\d+)/i]
- @disable_state = $1.to_i
- return @disable_state
- end
- end
- class Window_BattleItem < Window_ItemList
- def enable?(item)
- !BattleManager.actor.state?(item.disable_state)
- end
- end
- class Window_SkillList < Window_Selectable
- def enable?(item)
- @actor && @actor.usable?(item) && !BattleManager.actor.state?(item.disable_state)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement