じ☆ve冰风 发表于 2026-8-3 08:33:00

KLoseEquip ACE

KLoseEquip ACE

by Kyonides​

Introduction

Do you want to make your heroes lose their equipment just because you're an evil game developer?
Now you can make your evil dreams come true!

You can make them lose SOME or ALL of their pieces of equipment!

The script had a totally different name in the past, but I felt the new one is a lot more descriptive than Special Removal.


Warning!

The heroes will NEVER get their equipment back. It's gone. Like FOREVER!
OK, I lied about losing them forever because there are other calls that will keep them stored in the Game Variable of your choice!

                Ruby:       
# * KLoseEquip ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-06-25

# WARNING #

# ALL of these Script Calls will cause an Irreversible Loss of Equipment!

# actor will be treated by Game_Interpreter as a local variable.
# This means that once the event finishes processing the Call Script command,
# it will no longer exist.

# Use @actor instead if you need it to exist outside the Call Script command.
# Don't forget to add a Call Script command at the end of the process to clear
# that variable by entering: @actor = nil

# * Script Calls * #

# - Step 1: Find an Actor, namely a Teammate
#   actor = $game_party.member(ActorIndex)
# OR #
#   @actor = $game_party.member(ActorIndex)

# - Step 2: Use Any of the following Calls

# - Discard Equipment By Index (SlotID)
#   actor.discard_equip_by_index(SlotID)

# - Discard Many of Them By Indexes (SlotIDs)
#   actor.discard_equip_by_indexes(SlotID1, etc.)

# - Discard Equipment By Index (SlotID) and Store it in a Game Variable
#   actor.store_discarded_equip_by_index(VarID, SlotID)

# - Discard Many of Them By Indexes (SlotIDs)
#   -> It will store them in consecutive Game Variables!
#   actor.store_discarded_equip_by_indexes(VarID, SlotID1, etc.)

class Game_Actor
# Store Equipment ID or Name? :id or :name or :equip (the whole object)
EQUIP_VAR_MODE = :id
def discard_equip_by_index(index)
    this_equip = @equips
    this_equip.object = nil if this_equip.object
end

def discard_equip_by_indexes(*slot_ids)
    slot_ids.each {|slot_id| discard_equip_by_index(slot_id) }
end

def equip_id_or_name(slot_id)
    equip = @equips.object
    case EQUIP_VAR_MODE
    when :id
      equip ? equip.id : 0
    when :name
      equip ? equip.name : "?"
    when
      equip
    end
end

def store_discarded_equip_by_index(var_id, index)
    $game_variables = equip_id_or_name(index)
    discard_equip_by_index(index)
end

def store_discarded_equip_by_indexes(var_id, *slot_ids)
    slot_ids.each do |slot_id|
      store_discarded_equip_by_index(var_id, slot_id)
      var_id += 1
    end
end
end

class Game_Party
def member(pos)
    $game_actors[@actors]
end
end


Terms & Conditions

Free for use in any game.
Due credit is mandatory.
Don't piss me off!

That's it!


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