Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Status transfer for Atoa's Battle System

Save-Point

Full Version: Status transfer for Atoa's Battle System
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there! I would like to make a skill to STEAL STATES from an enemy, and another that transfers states to a target.

I use Atoa's battle system and I have two scripts from LockeZ, one to inflict states and another one to remove them. However, I do not know how to check if the enemy has the state and merge both options.

These are the scripts

LockeZ inflict states:

Removed because it was no longer necessary

LockeZ Remove States

Removed because it was no longer necessary

Thanks before hand!
:Eep. Um , recheck the scripts. Line breaks are all screwed up.

I wouldn't be at all surprised that Victor Sant couldn't or didn't write his own variants of these (Vic == Atoa).
Yeah, I don't know why but when I post it as a code the breaks disappear. I can only post it as a quotation :/ Sorry about that.
Missing the 'Remove States' you previously posted.
Really long post now :O hope it helps!
EDIT:
I managed to finish the script and make it 100% functional, I'll share it but I think it only works with Atoa's Battle System

Quote:#==============================================================================
# State Transfer v1.5
# By Iqus (Based on Atoa's & LockeZ scripts)
#==============================================================================
# This script allows you to create skills that transfer states
# on either the allies or enemies.
#==============================================================================

module Atoa
# Do not remove this line
State_Transfer = {'Skill' => {}}
# Do not remove this line

# State_Transfer[action_type][id] = {state_id => [chance, target1, target2, exclusive],
# state_id => [chance, target1, target2, exclusive]}
# action_type = action type
# action_type = 'Skill' for skills
# id = ID of the skill
#
# state_id = id of the state to be inflicted
#
# chance = chance of transfering the state; normal resistance is considered also,
# so this can fail even if it's 100%, unless the state is marked
# as 'nonresistance'
# target1 = who the state is transfered to, possible values are 'user' and 'enemy'
# target2 = who is losing the state, possible values are 'user' and 'enemy'
# exclusive = set to 'exclusive' if the skill randomly selects only one state
# to transfer out of a set of states, set to nil or leave off otherwise
# Useful if you want to randomly either transfer poison or blind, but
# not both on the same round

#CHIMERA - Transfers a user's debuff to an ally
State_Transfer['Skill'][25] = {2 => [100, 'target', 'user', 'exclusive'],
3 => [100, 'target', 'user', 'exclusive'],
4 => [100, 'target', 'user', 'exclusive'],
9 => [100, 'target', 'user', 'exclusive'],
10 => [100, 'target', 'user', 'exclusive'],
11 => [100, 'target', 'user', 'exclusive'],
14 => [100, 'target', 'user', 'exclusive'],
16 => [100, 'target', 'user', 'exclusive'],
17 => [100, 'target', 'user', 'exclusive'],
19 => [100, 'target', 'user', 'exclusive'],
20 => [100, 'target', 'user', 'exclusive'],
29 => [100, 'target', 'user', 'exclusive'],
30 => [100, 'target', 'user', 'exclusive'],
43 => [100, 'target', 'user', 'exclusive'],
44 => [100, 'target', 'user', 'exclusive']}
#STEAL AURA - Steals a buff from an enemy
State_Transfer['Skill'][14] = {31 => [100, 'user', 'target', 'exclusive'],
32 => [100, 'user', 'target', 'exclusive'],
34 => [100, 'user', 'target', 'exclusive'],
35 => [100, 'user', 'target', 'exclusive'],
36 => [100, 'user', 'target', 'exclusive'],
37 => [100, 'user', 'target', 'exclusive'],
40 => [100, 'user', 'target', 'exclusive'],
41 => [100, 'user', 'target', 'exclusive'],
42 => [100, 'user', 'target', 'exclusive']}

end

#==============================================================================
# ** Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Iqus State Transfer'] = true


#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# * Update battler phase 4 (part 3)
# battler : active battler
#--------------------------------------------------------------------------
alias step4_part3_state_transfer step4_part3
def step4_part3(battler)
step4_part3_state_transfer(battler)
action = battler.now_action
if action != nil and State_Transfer[action.type_name] != nil and
State_Transfer[action.type_name].include?(action_id(action))
state_transfer(battler, State_Transfer[action.type_name][action_id(action)].dup)
end
end
#--------------------------------------------------------------------------
# Inflict all appropriate states on all appropriate battlers
# battler : active battler
# action : action
#--------------------------------------------------------------------------
def state_transfer(battler, action)
possible_states = []
exclusive_states = []
for state in action.keys
# IF THE USER IS RECEIVING THE STATE
if action[state][1] == 'user'
for target in battler.target_battlers
# IF TARGET HAS THE STATE
if target.state?(state)
if action[state][3] == 'exclusive'
exclusive_states += [state]
else
possible_states += [state]
end
end
end
end
end
# CHOSE AMONGST THE STATES THE TARGET HAS
if exclusive_states.size > 0
chosen_state = exclusive_states[rand(exclusive_states.size)]
possible_states += [chosen_state]
end
# IF THE TARGET IS RECEIVING THE STATE
for state in action.keys
if action[state][1] == 'target'
# IF USER HAS THE STATE
if battler.state?(state)
if action[state][3] == 'exclusive'
exclusive_states += [state]
else
possible_states += [state]
end
end
end
end
# CHOSE AMONGST THE STATES THE USER HAS
if exclusive_states.size > 0
chosen_state = exclusive_states[rand(exclusive_states.size)]
possible_states += [chosen_state]
end
# LOOP THAT CHECKS ALL THE STATES
for state in possible_states
# IF THE USER IS RECEIVING THE STATE
if action[state][1] == 'user'
if action[state][0] >= rand(100)
for target in battler.target_battlers
# INFLICT ON USER
inflict_transfered_state(target, battler, state)
# IF THE STATE COMES FROM THE TARGET
if action[state][2] == 'target'
for target in battler.target_battlers
# REMOVE FROM TARGET
remove_transfered_state(battler, target, state)
end
end
end
end
# IF THE TARGET IS RECEIVING THE STATE
elsif action[state][1] == 'target'
if action[state][0] >= rand(100)
for target in battler.target_battlers
# INFLICT ON TARGET
inflict_transfered_state(battler, target, state)
# IF THE STATE COMES FROM USER
if action[state][2] == 'user'
for target in battler.target_battlers
# REMOVE FROM USER
remove_transfered_state(target, battler, state)
end
end
end
end
end
end
end
#--------------------------------------------------------------------------
# Inflict a state on a battler
# user : active battler
# target : battler being inflicted
# state : id of state to inflict
#--------------------------------------------------------------------------
def inflict_transfered_state(user, target, state)
unless target.state_guard?(state)
if user.state?(state)
if $data_states[state].nonresistance
target.add_state(state)
#user.remove_state(state)
elsif target.state_full?(state) == false
if target.check_add_state(state)
target.add_state(state)
#user.remove_state(state)
end
end
end
end
end
#--------------------------------------------------------------------------
# Remove a state on a battler
# user : active battler
# target : battler being inflicted
# state : id of state to inflict
#--------------------------------------------------------------------------
def remove_transfered_state(user, target, state)
if user.state?(state)
target.remove_state(state)
end
end
end


Any doubts on how this works, feel free to ask! ^^