12-15-2022, 09:08 PM
Hand Over De-Buffs ACE
by Kyonides Arkanthes
Introduction

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

