KLoseEquip ACE
#1
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! Shocked
You can make them lose SOME or ALL of their pieces of equipment!

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

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!

The Script

Code:
# * 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. Gamer 
Due credit is mandatory.
Don't piss me off! Tongue sticking out
That's it!
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }




Users browsing this thread: 1 Guest(s)