Galv's Magic Shards Add On

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
574
Reaction score
196
First Language
English
Primarily Uses
RMMV
Howdy! :kaopride:

I was wondering if someone could help me create a small add on for Galv's Magic Shards script.

As it stands, the script is able to check if there's a combination of 2 shards equipped, and if so, you can unlock a bonus skill. I'm hoping to expand this to allow for a 3-part combo of equipped shards, alongside the existing 2.

Thanks!
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Try this - place below galv shards
Code:
#------------------------------------------------------------------------------#
#  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
 
Last edited:
  • Like
Reactions: Low

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
574
Reaction score
196
First Language
English
Primarily Uses
RMMV
Sorry for the late reply. Low key forgot topics weren't automatically followed...:kaoswt:

Seems to be working for me though, thanks a ton!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top