Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

SOS Passive Abilities - [RESOLVED]

Code:
#==============================================================================

# ** Notes Field System

#------------------------------------------------------------------------------

# By Syvkal

# Version 1.6

# 05-29-08

#==============================================================================

 

module NOTES

  

  def get_tag(field, tag, extra_tag = "")

    note = ""+field

    note = note.split("\r\n")

    for i in 0...note.size

      if note[i].include?(tag + extra_tag)

        tags = note[i]

        tags.slice!(tag)

        if extra_tag != ""

          tags.slice!(extra_tag)

        end

        tags = tags.split(/,\s*/)

        return tags

      end

    end

    return nil

  end

  

  def get_multiple_tag(field, tag, extra_tag = "")

    note = ""+field

    note = note.split("\r\n")

    for i in 0...note.size

      if note[i].include?(tag + extra_tag)

        tags = note[i]

        tags.slice!(tag)

        if extra_tag != ""

          tags.slice!(extra_tag)

        end

        tags = tags.split(/,\s*/)

        for i in 0...tags.size

          if tags[i].include?('&')

            tags[i] = tags[i].split(/\s*\&\s*/)

          end

        end

        return tags

      end

    end

    return nil

  end

  

  def has_tag?(field, tag, extra_tag = "")

    note = ""+field

    if note.include?(tag + extra_tag)

      return true

    end

    return false

  end

  

  def get_tag_area(field, area_tags)

    note = ""+field

    if note.include?(area_tags)

      @yes = false

      note = note.split(/#{area_tags}/)

      note = note[1]

      return note

    else

      return ""

    end

  end

  

end

I've been working with Syvkal's Passive Skill script recently, and it's sufficient on most fronts. I have three complaints with it, however, that I'd like some help with sorting out.

First, and the main subject of this post, is a seeming unability to support SOS Passives - that is, passives that only generate their effect when HP falls below a given %. I'd like someone to help add a function for the note tags "SOS X" and "SOS X%", where X is the HP threshold that triggers the skill. If you could, I'd also appreciate some idiot-proofing via comments.

Second, there seems to be an issue where the script won't recognizes passives immediately after loading a saved game - it only converts them into passives upon level manipulation, via EXP gain or direct event-based change. This is low priority though, since I can picture an event-based shortcut around this.

Third, and this is far from necessary, could someone modify this so that checking an element box and adding a "RESIST" tag to the notebox enhances resistance to that element, rather than adding it to the user's basic attack?

Big thanks and credit to whoever can get this done for me.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top