#------------------------------------------------------------------------------#
# Galv's Magic Shards - addon
#------------------------------------------------------------------------------#
# For: RPGMAKER VX ACE
# Version - 1.8
# Thanks: Ocedic, DP3, Reactive Owl, LucidK for ideas, inspiration and/or help
#------------------------------------------------------------------------------#
# 2018-10-30 - Version 1.8 - added linking for 3 shards
#------------------------------------------------------------------------------#
=begin
#------------------------------------------------------------------------------#
# SHARD SETUP
#------------------------------------------------------------------------------#
# This is where you setup the skills learned when placing shards adjacent to
# each other. NOTE: Your shard id's must be lowest first, higest second
#------------------------------------------------------------------------------#
SHARDS = { # Don't touch
#------------------------------------------------------------------------------#
# [shard_id,shard_id] => skill_id,
[1,2,3] => 46, # fire and water and earth = skill 46
[2,3,4] => 24, # water and earth and lightning = skill 24
[3,4,5] => 13, # water and Lightning and healing = skill 13
[6,7] => 22, # K9 Tooth and Sleep = skill 22
[7,8] => 48, # Sleep and Blocking = skill 48
These are setup in Galv's script NOT HERE!
#------------------------------------------------------------------------------#
} # Don't touch
#------------------------------------------------------------------------------#
=end
class Game_Actor < Game_Battler
def shard_linked_skills_three
lst = Galv_Shard::SHARDS
return [] if !shards
sarray = []
shards.each_with_index { |s,i|
nxt = shards[i + 1].nil? ? 0 : i + 1
fst = shards[i - 1].nil? ? 0 : i - 1
next if s == :blank || shards[nxt] == :blank || shards[fst] == :blank
check_three = [shards[i].shard,shards[nxt].shard,shards[fst].shard].sort
sarray << lst[check_three] if lst.keys.include?(check_three)
}
sarray.compact
end
alias r2_galv_shards_ga_added_skills added_skills
def added_skills
r2_galv_shards_ga_added_skills + shard_linked_skills_three
end
end
class Scene_Shards < Scene_MenuBase
def do_shard_change
learned = @actor.shard_linked_skills - @actor.known_links && @actor.shard_linked_skills_three - @actor.known_links
forgot = @actor.known_links - @actor.shard_linked_skills && @actor.known_links - @actor.shard_linked_skills_three
learn_usable = []
forgot_usable = []
learned.each { |sid|
if @actor.added_skill_types.include?($data_skills[sid].stype_id)
learn_usable << sid
end
}
forgot.each { |sid|
if @actor.added_skill_types.include?($data_skills[sid].stype_id)
forgot_usable << sid
end
}
@info_window.display(learn_usable,forgot_usable)
@actor.known_links = @actor.shard_linked_skills && @actor.shard_linked_skills_three
end
end