Kadafi - UsableItem Disable State
UsableItem Disable StateBy : Kadafi
Version: 1.0
Introduction
This script allows you to disable the use of UsableItem such as Item / Skill according to the actor state.
How to Use
[*]Notetag at item / skill note box: <disable_state: state_id>
Script
Spoiler#=============================================================================# 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::BaseItemdef disable_state return @disable_state if @disable_state note[/<disable_state\s*:\s*(\d+)/i] @disable_state = $1.to_i return @disable_stateendend class Window_BattleItem < Window_ItemListdef enable?(item) !BattleManager.actor.state?(item.disable_state)endend class Window_SkillList < Window_Selectabledef enable?(item) @actor && @actor.usable?(item) && !BattleManager.actor.state?(item.disable_state)endend
Credit and Thanks
Kadafi
本贴来自国际rpgmaker官方论坛作者:Kadafi处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/kadafi-usableitem-disable-state.35148/
页:
[1]