12-15-2022, 09:08 PM
(This post was last modified: 12-16-2022, 09:31 PM by kyonides.
Edit Reason: Shortened Script Name
)
Hand Over De-Buffs ACE
by Kyonides Arkanthes
Introduction
I think that the title is quite suggestive so I will simply leave the code below for you to use.
It also includes the notes you will need to leave at the skills' noteboxes to make the script work as intended.
You can only leave 1 of those 3 notes at any given time!
Code:
# * Hand Over De-Buffs ACE * #
# Scripter : Kyonides Arkanthes
# 2022-12-16
# * Instructions:
# Leave a skill note like the following:
# <handover buffs> or <handover debuffs> or <handover all buffs>
# You can only leave 1 of those 3 notes at any given time!
class Game_Battler
REGEX_BUFFS = /<handover buffs>/i
REGEX_DEBUFFS = /<handover debuffs>/i
REGEX_DE_BUFFS = /<handover all buffs/i
attr_reader :buffs, :buff_turns
alias :kyon_de_buffs_gm_btlr_iue :item_user_effect
def item_user_effect(user, item)
kyon_de_buffs_gm_btlr_iue(user, item)
return if
if item.note[REGEX_BUFFS]
hand_over_buffs(user)
elsif item.note[REGEX_DEBUFFS]
hand_over_debuffs(user)
elsif item.note[REGEX_DE_BUFFS]
hand_over_all_buffs(user)
end
end
def clear_buff(pos)
@buffs[pos] = 0
@buff_turns.delete(pos)
end
def hand_over_buffs(user)
user.buff_turns.keys.sort.each do |n|
next if user.buffs[n] < 0
@buffs = user.buffs[n]
@buff_turns = user.buff_turns[n]
user.clear_buff(n)
@result.added_buffs.push(n).uniq!
end
user.refresh
refresh
@result.success = true
end
def hand_over_debuffs(user)
user.buff_turns.keys.sort.each do |pos|
next if user.buffs[pos] >= 0
@buffs[pos] = user.buffs[pos]
@buff_turns[pos] = user.buff_turns[pos]
user.clear_buff(pos)
@result.added_debuffs.push(pos).uniq!
end
user.refresh
refresh
@result.success = true
end
def hand_over_all_buffs(user)
@buffs = user.buffs.dup
@buff_turns = user.buff_turns.dup
@buffs.size.times do |pos|
if user.buffs[pos] > 0
@result.added_buffs.push(n).uniq!
else
@result.added_debuffs.push(pos).uniq!
end
end
user.clear_buffs
user.refresh
refresh
@result.success = true
end
end
Terms & Conditions
Free for use in ANY kind of game.
Please include my nickname in your game credits!
I would love to see that this is not the only script of mine that you are using there.
Just in case one of your nicknames is Wulfo, let me tell you that is bad for your diet.
"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.
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!
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
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
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!
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