じ☆ve冰风 发表于 2026-8-2 10:44:52

Item Charges

Item Charges
Selchar​
Introduction
This script allows for giving items multiple uses before they are consumed. It is to be used alongside Tsukihime's Instance Items.

Features
- Adds Item Charges
- Items can transform into other items when their charge reaches 0
- Items can be preserved with 0 charges(but unusable) if desired for some reason.

How to Use
Place the script below ▼ Materials, below Tsukihime's Instance Items, but above ▼ Main Process. Use the provided notetags to set individual item charge settings. Be sure to set Tsukihime's Instance Item's Enable Items to true.

Script
>Required<
Item Charges
Recharge Item Scene

FAQ
Q: What are the terms of use?
A: My terms are, anything goes, while the terms for Tsukihime's scripts can be found here

Q: Are there compatibility problems with any scripts?
A: None known at this time except for Kread's Actor Inventories, to which I have a patch for down below.

Credit and Thanks
- Selchar
- Tsukihime for the Instance Items Base

Compatibility Patches
Kread's Actor Inventory
Spoiler                Code:       
#===============================================================================
# Selchar's Item Charges Compatibility Patch with Kread's Actor Inventory
#===============================================================================
class Game_Battler < Game_BattlerBase
alias :kread_actor_inventory_sel_item_charge_consume:consume_equip_item
def consume_equip_item(item)
    return if self.enemy?
    return unless item.consumable
    item.current_charge -= 1
    item.refresh_name
    item.refresh_price
    if item.current_charge.zero?
      kread_actor_inventory_sel_item_charge_consume(item) unless item.no_charge_keep
      $game_party.gain_item(InstanceManager.get_instance($data_items), 1) if item.no_charge_transform
    end
end
end

class Game_Party < Game_Unit
alias :kread_actor_inventory_sel_item_charge_consume :consume_item
def consume_item(item)
    if $imported['KRX-ActorInventory'] && SceneManager.scene.is_a?(Scene_Battle)
      item_charge_consume_item(item)
    else
      kread_actor_inventory_sel_item_charge_consume(item)
    end
end
end

class Window_ActorItem < Window_EquipSlot
def enable?(index)
    item = @actor.equips
    return false if item.is_a?(RPG::Item) && item.current_charge.zero?
    item.is_a?(RPG::Item) && item.battle_ok?
end
end








本贴来自国际rpgmaker官方论坛作者:Selchar处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/item-charges.22121/
页: [1]
查看完整版本: Item Charges