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[index]
    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[slot_id].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[var_id] = 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[pos]]
  end
end

Terms & Conditions

Free for use in any game.
Due credit is mandatory.
Don't piss me off! 😛
That's it!
OMG literally the other day I was thinking about a mechanic like this for my game. Do you read minds?
Anyways, I'm not very smart, so I'm not sure if this script can be used as I planed, so:

Can I use this script for skills for enemies that will remove the equipment of the characters for that battle, but it could be re-equiped later on? (once the battle is done)
Actually nope. It doesn't go that far... but it could in the (not so near) future. I'd need to check the default ACE skill features and choose some convenient note tags for it.

Original thread: https://forums.rpgmakerweb.com/threads/kloseequip-ace.158698/