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.

Rune Magic Script

Rayen

Sponsor

Here is the full graphics sheet: http://a.imageshack.us/img801/941/foean ... aphics.png

systemmockup.png

What's Expected:
Must Have:
  • Change "Save" -> "Runes"
  • Only 1 character is able to use the grid, so if possible, make it so that when this character is not in the party, the "Runes" option is grayed out.
  • For convenience, whenever you place a "correct" gem combination, a message pops up saying something like "Accessed the _____ Element spell _____!"
    • Once the spell has been learned permanently through leveling, the message changes to say "Spell already learned."

Would Like:
  • If possible, we would like an option that allows you to save their current gem setup for future use.
    • Ex: Say you placed the correct combination of gems that result in the use of a Triple Element: Fire + Water + Wind spell. For ease of use, we'd like for the script to allow you to save that setup and be able to reload it whenever you want. What we want would be a side-menu with all the correct combos for each spell. If you have never correctly placed a gem combo for a spell on the grid before, that spell would be grayed out until you have.
    • If it is too difficult to script a way to save your own custom setup, then just make a default setup for each spell, using the least amount of gems possible.

In-depth Information:

The Spells

Currently, what we have in terms of spells is:
  • 12 Single Element spells
    Single Element spells are learned permanently through leveling, though you may use the Field of Elements grid to prematurely access Tiers 1 and 2 earlier than you'd be able learn them. Tier 3 is learned exclusively by leveling.

    Tier 1
    • Fire 1 = learned at lvl 3
    • Water 1 = starting spell**
    • Wind 1 = learned at lvl 7
    • Earth 1 = learned at lvl 11

    Tier 2
    • Fire 2 = learned at lvl 14
    • Water 2 = learned at lvl 17
    • Wind 2 = learned at lvl 20
    • Earth 2 = learned at lvl 22

    Tier 3
    • Fire 3 = learned at lvl 25
    • Water 3 = learned at lvl 28
    • Wind 3 = learned at lvl 31
    • Earth 3 = learned at lvl 33
  • 6 Dual Element spells
    To be able to use a Dual Element spell, Element1's power must equal Element2's power, except if an Element3 is present and dominant on the grid (thus resulting in a Triple Element spell*). Element1 and Element2 each must have a Power Output greater than or equal to 50%. Refer to power list below.

    Elemental Gem Power List:
    (Gem Size) = (Power Output)
    • Big Square Gem = 100%
    • Big Rect. Gem = 75%
    • Medium Square Gem = 50%
    • Small Rect. Gem = 25%
    • Small Square Gem = 10%

    Spells:
    • Fire + Water
    • Fire + Wind
    • Fire + Earth
    • Water + Wind
    • Water + Earth
    • Wind + Earth

    * A more in-depth explanation will be included in the Field of Elements section of the guide.
  • 12 Triple Element spells, and
    In order to use a Triple Element spell, 3 different elements must be present on the grid, 1 of which should have a greater power output than the other 2 elements. These spells are divided by the dominant element and then split into 2 or 3 parts (Primary, Secondary, and/or Tertiary) depending on the power output. Battle damage is determined by the total power output per element on the grid at the time*. Refer to power list below.

    Elemental Gem Power List:
    (Gem Size) = (Power Output)
    • Big Square Gem = 100%
    • Long Rect. Gem = 75%
    • Medium Square Gem = 50%
    • Small Rect. Gem = 25%
    • Small Square Gem = 10%

    Spells:
    • FIRE DOMINANT:
      • Fire + Water + Wind
      • Fire + Water + Earth
      • Fire + Wind + Earth

    • WATER DOMINANT:
      • Water + Wind + Fire
      • Water + Wind + Earth
      • Water + Fire + Earth

    • WIND DOMINANT:
      • Wind + Earth + Water
      • Wind + Earth + Fire
      • Wind + Water + Fire

    • EARTH DOMINANT:
      • Earth + Fire + Water
      • Earth + Fire + Wind
      • Earth + Water + Wind

    * A more in-depth explanation will be included in the Field of Elements section of the guide.
  • 1 Quadruple Element spell.
    In order to use the Quadruple Element spell, 4 different elements must be present on the grid and have an equal power output that is =50% across each gem. This can only be achieved by placing 4 Medium Square gems of each element on the grid.

    Spell:
    Fire + Water + Wind + Earth

The Rune Magic System

The Gems

Uses in the grids; * = Primary use
gemoverview.png


The Field of Elements (FoE) Grid

foegrids.png


The Field of Elements grid is used to gain access to spells earlier than you would gain them through leveling. The grid expands as you level, allowing you access to new spells sets. Single Element Tiers 1 and 2 are available for early access through the grid, but only on a temporary basis. The only way to permanently gain these spells is through regular leveling. Once each spell is learned, the corresponding gem combination on the grid is rendered useless.

Levels 1-8
Gem sizes you can place:
  • Small Square
  • Small Rectangle
  • Medium Square (useless on this level)
Spells you can access:
  • 1-4 Single Element Tier 1 spells, AND/OR
  • 1-2 Single Element Tier 2 spells

By level 11, all SE Tier 1 spells will have been learned permanently, allowing premature access to Tier 2 spells. After all Tier 1 spells have been learned, Small Square gems will be rendered useless on FoE Level 1.

Examples:
foe1ex.png

1: Gain access to Fire 1
2: Gain access to Fire 2, Water 1, and Earth 1
3: Gain access to Fire 2 and Earth 2
Levels 9-18
Gem sizes you can place:
  • Small Square (useless on this level after lvl 11)
  • Small Rectangle (useless on this level after lvl 22)
  • Medium Square (useless on this level)
  • Big Rectangle (useless on this level)
Spells you can access:
  • 1-4 Single Element Tier 1 spells (until lvl 11), OR
  • 1-2 Single Element Tier 2 spells

By level 22, all SE Tier 2 spells will have been learned permanently. Premature access to Tier 3 spells is not given through the FoE grid. These are only gained through leveling. After level 22, Small Rectangles will be rendered useless on FoE Level 2.

Examples:
foe2ex.png

1: Gain access to Earth 1 (until lvl 11), Water 2 (until lvl 17), Wind gem unused
2: Gain access to no spell, as Dual Element spells are only available after lvl 33.
3: Gain access to Fire 2, Water 2, Wind 2, and Earth 2 (until lvl 22, when all Tier 2 spells are learned)
Levels 19-33+
Gem sizes you can place:
  • Small Square
  • Small Rectangle (useless after lvl 22 to learn Tier 2 spells.)
  • Medium Square
  • Big Rectangle (useless on this level until 33+)
Spells you can access:
  • 1-3 Single Element Tier 2 spells, AND
  • 1 Dual Element spell

By level 33, all SE Tier 3 spells will have been learned permanently, allowing premature access to Dual Element spells. Dual Element spells are learned permanently through sidequests only. To be able to use a Dual Element spell, Element1's power must equal Element2's power. Element1 and Element2 each must have a Power Output greater than or equal to 50%. Refer to power list below:

Elemental Gem Power List:
(Gem Size) = (Power Output)
  • Big Square Gem = 100%
  • Big Rect. Gem = 75%
  • Medium Square Gem = 50%
  • Small Rect. Gem = 25%
  • Small Square Gem = 10%

Examples:
foe3ex.png
foe3ex2.png

1: Gain access to the Dual Element spell Earth + Wind
2: Gain access to the Dual Element spell Water + Wind
3 & 4: Gain access to the Dual Element spell Fire + Wind; although you are able to place 4 Small Square gems for two different elements on the grid, it is not recommended as it is rather inconvenient.
Levels 33+
Gem sizes you can place:
  • Small Square
  • Small Rectangle
  • Medium Square
  • Big Rectangle
  • Big Square
Spells you can access:
  • 1-2 Dual Element spells, AND/OR
  • 12 Triple Element spells, OR
  • 1 Quadruple Element spell

This grid can only be unlocked through a sidequest. This is where things become a little more complex. In FoE Level 4, you are given access to Triple Element spell set and the Quadruple Element spell. These spells can never be permanently learned.

Dual Elements
  • To be able to use a Dual Element spell, these requirements must be fulfilled:
    • Element1's power must equal Element2's power, except if an Element3 is present and dominant on the grid (thus resulting in a Triple Element spell).
    • Element1 and Element2 each must have a Power Output greater than or equal to 50%.

Triple Elements
  • To be able to use a Triple Element spell, these requirements must be fulfilled:
    • 3 different elements must be present on the grid
    • 1 element’s power must be dominant (Primary), and only 1 can be dominant at one time.
      • Spells are divided up based on the dominant element, and are split into 2 or 3 parts based on total power output on the grid (refer to the Elemental Gem Power List below).
        • Ex: Fire (100%) + Water (75%) + Wind (25%)
          • Primary: Fire, Secondary: Water, Tertiary: Wind
        • Ex2: Fire (100%) + Water (25%) + Wind (25%)
          • Primary: Fire, Secondary: Water & Wind
  • In the case of a Triple Element spell with 2 Secondary elements, the Secondary elements’ power outputs must be >=50% to allow you access to the respective Dual Element spell.
  • The spell’s damage in battle is based upon the element’s total power output on the grid (refer to the Elemental Gem Power List below).
    • Ex: If you have 1 Big Square fire gem, and 2 Small Rectangle water and earth gems placed on the grid:
      • In battle, Fire damage would be at 100% power, Water at 25%, and Wind at 25%
    • Any 4th element placed on the grid is considered useless, and is to be excluded from the battle damage equation.

Elemental Gem Power List:
(Gem Size) = (Power Output)
  • Big Square Gem = 100%
  • Big Rect. Gem = 75%
  • Medium Square Gem = 50%
  • Small Rect. Gem = 25%
  • Small Square Gem = 10%

Examples:
foe4ex.png


1: Gain access to the Triple Element spell Fire + Water + Wind. How? You calculate the total power output for each element.
  • Fire: 100% + 25% = 125%
    • Making Fire the dominant element.
  • Water: 25%
  • Wind: 25%
    • Water and wind are equal, but since their power output is <50%, no Dual Element spell is accessed.
  • Earth: 10%
    • Although not necessary, it is possible to place a 4th element on the grid. But since the power output is so small, Earth is excluded from the battle damage.
2: Gain access to the Dual Element spell Wind + Water, and the Triple Element spell Earth + Wind + Water.
  • Earth: 75%
    • Dominant element
  • Wind: 50%
  • Water: 50%
    • Wind & Water powers are equal to each other, granting access to the Dual Element spell.
  • Fire: 10%
    • Fire is excluded from battle damage.
3: Gain access to the Dual Element spell Water + Wind
  • Water: 75%
  • Wind: 75%
    • There are 2 Primary elements. In this case, it only grants access to the respective Dual Element spell, as Triple Element spells require that there must be only 1 Primary element.
  • Earth: 50%
    • Earth is excluded from the battle damage.

Quadruple Element
  • To be able to use a Quadruple Element spell, these requirements must be fulfilled:
    • 4 different elements must be present on the grid
    • All 4 elements must have an equal power output across each gem.
      • Power output must =50% each
      • This can only be achieved by placing 4 Medium Square gems of each element on the grid.
        • Although this is possible to achieve on FoE Level 1, FoE Level 4 is the only grid that will grant you access to this spell.

If anyone has any additional questions, feel free to ask.
 
I'm sorry for making another post that doesn't say much more than "nice idea", however I really feel like complimenting your request way... you got provided graphics, examples, a very good explanation of what should be going on and what needs to be possible with the script... things I don't see in many Support forum posters, for example.
The one thing that isn't perfectly clear to me is what range these boards apply to... is it one board per actor, or one board per spell? Should be interesting for the person taking the request. (EDIT: I read too carelessly, I noticed the materia sentence now ^^" )

So, while I don't do RMXP stuff anymore (which is a shame, as that's one of the few requests that meet my "has to be interesting" condition), what I'll do instead is replace that silly egoistical Waiting Event System ad in my signature with some linkage to this topic, hoping that will get a few more scripters looking at it... I dunno if it'll do much, but it can't hurt, right? :fap:
 
Im already planning on doing a rune system for the public, granted its almost similar to this, other than the general layout of the "board" and the graphics. But the features are almost identical. When i've finished my Rune system, i can try to modify it to meet your requirements.

Im not discouraging any other scripter to try though, so feel free to also try this request.

And thanks bluescope, i wouldn't have come across this without clicking your sig image aha. So you did some help ^_^
 

Rayen

Sponsor

@ BlueScope: Hah, thanks for the interest and support! Only one char in the party uses rune magic, so it's just one grid overall. The grids were originally supposed to expand (or "level up") through different sidequests, that's why there's 4 different ones. Depending on the gems you place onto the FoE grid, you're able to cast certain spells. I was gonna explain it to you in-depth when I first read your post yesterday, but it was at that point I started to question the entire way it worked and realized that I actually had no idea. XD So, thank you. If it weren't for your question, my friend and I wouldn't have noticed that pretty much the entire system was flawed. (Btw, not that's it's entirely important, I'm female, not male. ;P )

Took about a day, but the system's been reworked now, so I updated the first post with a Word document link to try to explain it. I'd.. I'd edit it in BB code for use on the forum, but it's.. a lot of text to re-format. If someone wants me to post it in BBcode, I'll try. :/

EDIT: OP now includes all information that was in Word document, formatted in BBcode. Hoo, boy, did that take a while. :crazy:
 
The idea and the script are nice. Now im making my own hability system that will serve as a basis for this. But my questions are about you project, ¿you can put some description or something? ¿how manyy are you wotrkig? ¿progres?

the thing is that i dont want to script a system for nothing, and also know for what is it-.
 

Rayen

Sponsor

There's only 2 of us working on this game so far. Sadly, my friend - the game's story writer - hasn't written up a summary for our game, as the story itself isn't entirely complete. So far the game's first 2 towns (here, and here), and a part of the 1st dungeon (here) have been mapped out and I'm working on spriting our characters. I've put in too many hours of work for this game for it all to be in vain. :crazy:
 
Sekai":37pondt7 said:
There's only 2 of us working on this game so far. Sadly, my friend - the game's story writer - hasn't written up a summary for our game, as the story itself isn't entirely complete. So far the game's first 2 towns (here, and here), and a part of the 1st dungeon (here) have been mapped out and I'm working on spriting our characters. I've put in too many hours of work for this game for it all to be in vain. :crazy:

Just make an introduction,xD. You dont have to use his summary.
 
I've seen that dungeon somewhere before! Did you post it on Freebird Games?

Also, would you mind posting that Port Town Tileset... and perhaps the sitting down sprites? I'd be very greatful!

As for the script; this is one of the greatest requests I've seen. I'm only just now learning RGSS so I can't help you with this, but I really wish I could.

Good luck!
 
Well you cant thank BlueScope enough. XD

Anyone doing this?

It got me interested that's surely. Here's how far I've got with the script. I've modified places in your graphic sheet a bit to suit the programming better. And also since I've got a bit lazy when modifying the picture instead of doing copy-paste of each of your element colors I just re-made them in photoshop, so sorry if it's not exactly the same.

You could say that I've done worst part of this job which is designing that Field of Elements rune placement. XD And the rest is more fun than this.

You can check the project here:
http://www.mediafire.com/?1thhmfuccmh1oo1

Now few questions:

1. Spells are going to be learned based on the number of runes there are in Field of Elements? So if I got this right, it means that if you add water, fire, and water, you will get a water skill? So I can make it like this -> The script will check the elements of each rune and add them to element counter (in programming it means one variable per each element), and then find the dominant one an add that skill? I of course know the part with special spells you mentioned up there which needs special combination, that's much easier to do than the thing I've said up there.

I don't quite get the part with Fire 1 + Wind 1 + Water 1, does that mean the character learns all three skills separately or one skill called 'Fire 1 + Wind 1 + Water 1' ?
 

Rayen

Sponsor

@ Kiriashi: Yes, I've posted those screenshots over at Freebird Games, before. I got some of the stuff for my port town from Venetia's "RTP Crap" here: http://pixelcocktail.com/hosted_items/Vens_RTP_Crap.zip

@ Drago del Fato: It's okay if you changed the graphic layout. I don't mind.
Drago del Fato":3x4f26d1 said:
1. Spells are going to be learned based on the number of runes there are in Field of Elements? So if I got this right, it means that if you add water, fire, and water, you will get a water skill? So I can make it like this -> The script will check the elements of each rune and add them to element counter (in programming it means one variable per each element), and then find the dominant one an add that skill? I of course know the part with special spells you mentioned up there which needs special combination, that's much easier to do than the thing I've said up there.
The spells you are able to learn are largely dependant on the level of the Field of Elements you currently have access to. I'm going to assume your question is about FoE Level 4, since you're talking about dominant elements. If that's the case, then it all depends on the total power output.

Elemental Gem Power List:
(Gem Size) = (Power Output)

  • Big Square Gem = 100%
  • Big Rect. Gem = 75%
  • Medium Square Gem = 50%
  • Small Rect. Gem = 25%
  • Small Square Gem = 10%

Example:
1 Big Rectangle fire gem, and 2 Small Rectangle water gems.
- According to the Power List, Big Rectangle gems each = 75% of the element's power, and Small Rectangle gems each = 25%. Fire = 75%, Water = 50%
- So even if you have 2 water gems on the FoE grid, that doesn't mean it automatically becomes the dominant element. You'd have to do a bit of math to figure out which is the true dominant element.
- This certain combination won't result in any spell on FoE Level 4, as there is neither a 3rd element for a Triple Element spell, or an equal power output between Fire and Water to become the Dual Element spell "Fire + Water".

Drago del Fato":3x4f26d1 said:
I don't quite get the part with Fire 1 + Wind 1 + Water 1, does that mean the character learns all three skills separately or one skill called 'Fire 1 + Wind 1 + Water 1' ?
- If you mean FoE Level 1, then it'd be the 3 seperate spells Fire 1, Wind 1, and Water 1.
- If you mean on FoE Level 4, then it'd be considered just the one spell "Fire + Wind + Water".

Btw, great start! :thumb: I'm really anxious to see this completed.
 
That download doesn't work for me. Would you mind uploading it to mediafire? :cute:


Drago, it seems like you have the core of the script completed. Maneuvering around the gems is the hardest part is it not?
 
Well I guess it's finished. Sekai did a great job for sure. :)

Here's a script:

[rgss] 
#============================================================================
# Rune System
# Version 1.8.1
# RPG Maker Version: RPG Maker XP
# Author: Drago del Fato
#----------------------------------------------------------------------------
# Copyright by Drago del Fato. Any kind of commercial use of this project
# without explcit consent of the author is prohibited.
#============================================================================
 
module RuneSystemOptions
 
     
   # Spell and Character ID's
   
   # Description:
   # When you create a spell in database put the ID number of the spell
   # For instance lets say that in database a Fire 1 spell looks like this
   # 001: Fire 1
   # This 001 is the ID number which you need to put, but without zero's so
   # you put number 1 below to FR1.
   # The same applies when you want to change Character ID.
 
   # Command Text
   CMD_ADD = "Add to FOE"
   CMD_REM = "Remove from FOE"
   CMD_CMB = "Recent"
   CMD_RET = "Exit"
   
   # Help Text
   HELP_ADD_FOE = "Add one rune to Field of Elements."
   HELP_REM_FOE = "Remove one rune from Field of Elements."
   HELP_COMB = "Use one of the recent combinations."
   HELP_EXIT = "Return to main menu."
 
   # Accessed Window Text
   ACCESSED = "Accessed"
   LOST = "Lost"
   LOST_ME = "006-Defeat02"
   ACCESSED_POSITION = 1
   ACCESSED_OK = "OK"
   ACCESSED_ME = "007-Fanfare01"
   
   # No Runes Text
   NO_RUNES = "No runes."
 
   # Rune flipping key
   SWITCHING_KEY = Input::A
 
   # Character ID
   CHAR_ID = 8
   
   # Combinations
   COMBINATIONS_ICON = "044-Skill01"
   COMBINATIONS_RECENT = "Recent Saved Combination "
   
   # Combinations Fire/Water/Wind/Earth Icons
   COMBINATIONS_FIRE = "icon_fire"
   COMBINATIONS_WIND = "icon_wind"
   COMBINATIONS_EARTH = "icon_earth"
   COMBINATIONS_WATER = "icon_water"
   
   # Background Image Location
   BACK_FILE =  "./Graphics/Pictures/rune_bg.jpg" # type nil without "" for no background
   
   # Graphic Tiles used for runes
   GRAPHICS_FILE = "./Graphics/Pictures/graphics.png"
   
   # Field of Elemets levels
   FOE_2_START_LEVEL = 9
   FOE_3_START_LEVEL = 19
   FOE_4_START_LEVEL = 33
   
   # A switch which when turned on will allow FOE level 4
   FOE_4_SWITCH_ID = 5
   
   # Rune Power Information
   SS_P = 10  # Small Square Gem
   SR_P = 25  # Small Rect. Gem
   MS_P = 50  # Medium Square Gem
   BR_P = 75  # Big Rect. Gem
   BS_P = 100  # Big Square Gem
   
   # If you havent changed elements (Database->System) which are used to
   # sort runes out then leave this at it is.
   ELEMENTS_ID = {
    "FIRE" => 1,
    "WATER" => 4,
    "WIND" => 6,
    "EARTH" => 5
    }
 
   # Shortcuts explanation:
   # FR - Fire
   # WN - Wind
   # EH - Earth
   # WR - Water
   # Combinations are interpreted the same:
   # For example:
   # FRWR - Fire + Water
   
   # Single Element Spells
   SINGLE_EL = {
     #Tier 1
     "FR1" => 1,
     "WN1" => 2,
     "WR1" => 3,
     "EH1" => 4,
     #Tier 2
     "FR2" => 5,
     "WN2" => 6,
     "WR2" => 7,
     "EH2" => 8
    }
   
   # Dual Element Spells
   DUAL_EL = {
     "FRWR" => 9,
     "FRWN" => 10,
     "FREH" => 11,
     
     "WRWN" => 12,
     "WREH" => 13,
     "WNEH" => 14
    }
   
   # Triple Elemet Spell IDs
   TRIPLE_EL = {
     # Water Dominant
     "WRWNFR" => 15,
     "WRWNEH" => 16,
     "WRFREH" => 17,
     
     # Wind Dominant
     "WNEHWR" => 18,
     "WNEHFR" => 19,
     "WNWRFR" => 20,
     
     # Fire Dominant
     "FRWRWN" => 21,
     "FRWREH" => 22,
     "FRWNEH" => 23,
     
     # Earth Dominant
     "EHFRWR" => 24,
     "EHFRWN" => 25,
     "EHWRWN" => 26
     
     }
   
   
   # Quad Element Spell ID
   # just put the ID instead of 27, no , needed.
   QUAD_EL_ID = 27
 
 end
 
 
 # Actual Rune System Script Starts here, do not modify if you do not know
 # what you're doing.
 
class Scene_Title
 
  alias new_command_new_game command_new_game
 
 def command_new_game
   $game_runes =  Game_Runes.new
   new_command_new_game
  end
 
end
 
 
class Scene_Menu
 
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Runes"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If runes is disabled
    @runes_disabled = true
    for i in 0..$game_party.actors.size - 1
      if $game_party.actors.id == RuneSystemOptions::CHAR_ID
        @runes_disabled = false
      end
    end
    @command_window.disable_item(4) if @runes_disabled
   
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
 
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # save
        # Check if Runes are disabled
          if !@runes_disabled
           $scene = Scene_Rune.new
          else
           $game_system.se_play($data_system.buzzer_se)
           return
          end
      when 5  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
 
end
 
# Game Party
 
class Game_Party
 
    def gain_item(item_id, n)
    if $game_runes.rune_exists?(item_id)
      $game_runes.change_amount(item_id, n)
    else
    if item_id > 0
      @items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
     
      if item_number(item_id) > 0 && $data_items[item_id].name.scan(/(\d)(.?+)/)[0] != nil
         if !$game_runes.rune_exists?(item_id)
         $game_runes.add_rune(Game_RuneItem.new($data_items[item_id], n,
                              $data_items[item_id].name.scan(/(\d)(.?+)/)[0][0].to_i))        
         @items[item_id] = 0
       end
     end
     end
 
    end
  end
   
end
 
# Saving/Loading Modification
 
class Scene_Save < Scene_File
   
  def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
 
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
 
    $game_system.magic_number = $data_system.magic_number
 
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_runes, file)    
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
  end
end
 
 
class Scene_Load < Scene_File
  def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_runes         = Marshal.load(file)  
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
 
 
    if $game_system.magic_number != $data_system.magic_number
 
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
 
    $game_party.refresh
  end
end
 
 
class Game_Battler
 
  alias rune_skill_effect skill_effect
 
  def skill_effect(user, skill)
    @rune_user = nil
    if !user.is_a?(Game_Enemy) && user.id == RuneSystemOptions::CHAR_ID
     @rune_user = user
    end
    rune_skill_effect(user, skill)
  end
 
 end
 
class Game_Enemy < Game_Battler
 
    def element_rate(element_id)
    # Get a numerical value corresponding to element effectiveness
    table = [0,200,150,100,50,0,-100]
    result = table[$data_enemies[@enemy_id].element_ranks[element_id]]
    # If protected by state, this element is reduced by half
    for i in @states
      if $data_states.guard_element_set.include?(element_id)
        result /= 2
      end
    end
   
    # Check for Rune USER
    if @rune_user != nil
     rune_power = $game_runes.get_element_count
     case element_id
     when RuneSystemOptions::ELEMENTS_ID["WATER"]
       result += rune_power[0]
     when RuneSystemOptions::ELEMENTS_ID["WIND"]
       result += rune_power[1]
     when RuneSystemOptions::ELEMENTS_ID["FIRE"]
       result += rune_power[2]
     when RuneSystemOptions::ELEMENTS_ID["EARTH"]
       result += rune_power[3]
     end
    end
   
    # End Method
    return result
  end
 
end
 
# Class definitions
 
class Game_Rune
 
  attr_reader :type # Type of the Rune
  attr_reader :size # Size of the Rune
  attr_reader :element_water # How much the rune adds to water element
  attr_reader :element_fire  # How much the rune adds to fire element
  attr_reader :element_wind  # How much the rune adds to wind element
  attr_reader :element_earth # How much the rune adds to earth element
  attr_accessor :x # Position X in the FOE
  attr_accessor :y # Position Y in the FOE
  attr_reader :item_id # Item from which the Rune was made (codewise)
 
  def initialize(item_id ,type, size, wa, fi, wi, ea, x, y, flipped = 0)
    @item_id = item_id
    @type = type
    @size = size
    @element_water = wa
    @element_fire = fi
    @element_wind = wi
    @element_earth = ea
    @flipped = flipped
    @x = x
    @y = y
  end
 
  def get_sprite_info
    info = [0, 0]
   
    case @size
    when 1 # Small Square
      info[1] = 0
    when 2 # Small Rect
      info[1] = 1 + @flipped
    when 3 # Medium Square
      info[1] = 3
    when 4 # Medium Rect
      info[1] = 4 + @flipped
    when 5 # Big Square
      info[1] = 6
    end
     
     info[0] = type
   
     return info
  end
 
 
end
 
class Game_Runes
 
  attr_accessor :foe
  attr_reader :runes
  attr_accessor :combinations
 
  def initialize
    @runes = [] # All available runes
    @foe = [] # Runes currently in FOE
    @combinations = Combinations.new
  end
 
  def get_foe_level
    level = $game_actors[RuneSystemOptions::CHAR_ID].level
    foe = 0 if level < RuneSystemOptions::FOE_2_START_LEVEL
    foe = 1 if level < RuneSystemOptions::FOE_3_START_LEVEL && level >=
 
RuneSystemOptions::FOE_2_START_LEVEL
    foe = 2 if level >= RuneSystemOptions::FOE_3_START_LEVEL && !$game_switches
 
[RuneSystemOptions::FOE_4_SWITCH_ID]
    foe = 3 if level >= RuneSystemOptions::FOE_4_START_LEVEL && $game_switches
 
[RuneSystemOptions::FOE_4_SWITCH_ID]
    return foe
   end
 
  def get_element_count(size = nil)
    elements = [0, 0, 0, 0]
    return elements if @foe.size == 0
    for i in 0..@foe.size - 1
      if (size == nil)
        elements[0] += @foe.element_water # Grab all water elements from FOE
        elements[1] += @foe.element_wind  # Grab all wind elements from FOE
        elements[2] += @foe.element_fire  # Grab all fire elements from FOE
        elements[3] += @foe.element_earth # Grab all earth elements from FOE
      elsif @foe.size == size
        elements[0] += @foe.element_water # Grab all water elements from FOE
        elements[1] += @foe.element_wind  # Grab all wind elements from FOE
        elements[2] += @foe.element_fire  # Grab all fire elements from FOE
        elements[3] += @foe.element_earth # Grab all earth elements from FOE
      end
    end
    return elements
  end
 
  def get_dominant_element(max_check = nil)
    elements = get_element_count
    top_index = 0
    for i in 0..elements.size - 1
      top_index = i if elements[top_index] < elements and max_check == nil
      top_index = i if max_check != nil and elements[top_index] < elements and elements <
 
max_check
    end
    return top_index
  end
 
  def change_amount(item_id, value)
    index = nil
    for i in 0..@runes.size - 1
     index = i if @runes.item_id == item_id
    end
    @runes[index].amount += value if index != nil
    @runes[index].amount = [@runes[index].amount, 99].min # Set max to 99
    check_values
  end
 
  def check_values
   
    for i in 0..@runes.size - 1
      @runes = nil if @runes.amount <= 0
    end
    @runes.compact!
  end
 
  def rune_exists?(item_id)
    exist = false
    for i in 0..@runes.size - 1
     exist = true if @runes.item_id == item_id
    end
    return exist
  end
 
  def [](value)
    return @runes[value]
  end
 
  def add_to_foe(rune)
    return if not rune.is_a?(Game_Rune)
    change_amount(rune.item_id, -1)
    @foe.push(rune)
  end
 
  def remove_from_foe(rune_index)
    item_id = @foe[rune_index].item_id
    if rune_exists?(item_id)
     change_amount(item_id, 1)
   else
     add_rune(Game_RuneItem.new($data_items[item_id], 1, $data_items[item_id].name.scan(/(\d)(.?+)/)
 
[0][0].to_i))        
    end
    @foe.delete_at(rune_index)
  end
 
  def add_rune(rune)
   return if not rune.is_a?(Game_RuneItem)
    @runes.push(rune)
  end
 
 
 
end
 
class Game_RuneItem
 
  attr_accessor :amount
  attr_reader :name
  attr_reader :size
 
  def initialize(item, amount, size)
    @item = item.clone
    @size = size
    @name = @item.name[2..@item.name.length]
    @amount = amount
  end
 
  def description
   return @item.description
  end
 
  def icon_name
   return @item.icon_name
  end
 
  def item_id
    return @item.id
  end
 
  def level
    case @size
    when 1 # Small Square
      return 1
    when 2 # Small Rect
      return 1
    when 3 # Medium Square
      return 3
    when 4 # Medium Rect
      return $game_actors[RuneSystemOptions::CHAR_ID].level < 33 ? 9 : 3
    when 5 # Big Square (usable only on FOE 4)
      return 4
    end
  end
 
  def get_power
    case @size
    when 1 # Small Square
      return RuneSystemOptions::SS_P
    when 2 # Small Rect
      return RuneSystemOptions::SR_P
    when 3 # Medium Square
      return RuneSystemOptions::MS_P
    when 4 # Medium Rect
      return RuneSystemOptions::BR_P
    when 5 # Big Square
      return RuneSystemOptions::BS_P
    end
  end
 
  # Get necessary information
  # to form a sprite
  def get_sprite_info
    info = [0, 0]
   
    case @size
    when 1 # Small Square
      info[1] = 0
    when 2 # Small Rect
      info[1] = 1
    when 3 # Medium Square
      info[1] = 3
    when 4 # Medium Rect
      info[1] = 4
    when 5 # Big Square
      info[1] = 6
    end
   
    case @item.element_set[0]
     when RuneSystemOptions::ELEMENTS_ID["WATER"]
       info[0] = 0
     when RuneSystemOptions::ELEMENTS_ID["FIRE"]
       info[0] = 1
     when RuneSystemOptions::ELEMENTS_ID["WIND"]
       info[0] = 2
     when RuneSystemOptions::ELEMENTS_ID["EARTH"]
       info[0] = 3
     end
 
     return info
  end
 
  # Transform Item to Rune Information
  # Array information:
  # ---------------------------------
  # 0 - Water Element Strength
  # 1 - Fire Element Strength
  # 2 - Wind Element Strength
  # 3 - Earth Element Strength
  def to_rune(foe_x, foe_y, flipped = 0)
    info = [0, 0, 0, 0]
    type = 0
   
    case @item.element_set[0]
     when RuneSystemOptions::ELEMENTS_ID["WATER"]
       type = 0
       info[0] = get_power
     when RuneSystemOptions::ELEMENTS_ID["FIRE"]
       type = 1
       info[1] = get_power
     when RuneSystemOptions::ELEMENTS_ID["WIND"]
       type = 2
       info[2] = get_power
     when RuneSystemOptions::ELEMENTS_ID["EARTH"]
       type = 3
       info[3] = get_power
     end
     
    return Game_Rune.new(@item.id ,type, @size, info[0], info[1], info[2],
                         info[3], foe_x, foe_y, flipped)
  end
 
end
 
class Combination
 
  attr_reader :name
  attr_accessor :foe
 
  def initialize(name, foe, unlocked = false)
    @foe = foe
    @name = name
  end
 
end
 
class Combinations
 
 
  def initialize
    @all_combinations = [Combination.new(RuneSystemOptions::COMBINATIONS_RECENT + " 1", []),
                         Combination.new(RuneSystemOptions::COMBINATIONS_RECENT + " 2", []),
                         Combination.new(RuneSystemOptions::COMBINATIONS_RECENT + " 3", []),
                         Combination.new(RuneSystemOptions::COMBINATIONS_RECENT + " 4", []),
                         Combination.new(RuneSystemOptions::COMBINATIONS_RECENT + " 5", [])]
    @current_index = 0
  end
 
  def add_from_foe
    add($game_runes.foe)
  end
 
  def max
    return @all_combinations.size
  end
 
  def add(foe)
    @all_combinations[@current_index].foe = foe.clone
    @current_index = (@current_index + 1) % 5
  end
 
  def get(index)
    return @all_combinations[index]
  end
 
  def get_element_count(index)
    combination = get(index)
    elements = [0, 0, 0, 0]
    return elements if combination.foe.size == 0
    for i in 0..combination.foe.size - 1
      elements[0] += combination.foe.element_water # Grab all water elements from FOE
      elements[1] += combination.foe.element_wind  # Grab all wind elements from FOE
      elements[2] += combination.foe.element_fire  # Grab all fire elements from FOE
      elements[3] += combination.foe.element_earth # Grab all earth elements from FOE
    end
    combination = nil
    return elements
  end
 
  def check_if_available(index)
   
    combination = get(index)
   
    return false if combination.foe.size == 0
   
    contains = 0
    for i in 0..combination.foe.size - 1
      for j in 0..$game_runes.runes.size - 1
        if combination.foe.item_id == $game_runes.runes[j].item_id
          contains += 1
        end
      end
    end
   
    if contains == combination.foe.size
     return true  
    else
     return false
    end
  end
 
 
end
 
class Window_CombinationInfo < Window_Selectable
 
  def initialize
    super(300, 0, 340, 480)
    self.z = 9998
    self.index = 0
    self.visible = false
    @item_max = $game_runes.combinations.max
    self.contents = Bitmap.new(width - 32, @item_max  * 80)
    self.opacity = 200
    refresh
  end
 
  def refresh
    self.contents.clear
    for i in 0..@item_max - 1
       draw_item(i)
    end
  end
 
  def draw_item(i)
    self.contents.font.color = normal_color
    combination = $game_runes.combinations.get(i)
    element_count = $game_runes.combinations.get_element_count(i)
    icon = RPG::Cache.icon(RuneSystemOptions::COMBINATIONS_ICON)
    self.contents.blt(4, 80 * i + 4, icon, Rect.new(0, 0, 24, 24))
    rect = Rect.new(32, 80 * i, self.contents.width - 8, 32)
    self.contents.draw_text(rect, combination.name)
    icon = RPG::Cache.icon(RuneSystemOptions::COMBINATIONS_FIRE)
    self.contents.draw_text(60, 80 * i + 36, 64, 32, element_count[2].to_s)
    self.contents.blt(32, 80 * i + 40, icon, Rect.new(0, 0, 24, 24))
    icon = RPG::Cache.icon(RuneSystemOptions::COMBINATIONS_WATER)
    self.contents.blt(96, 80 * i + 40, icon, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(124, 80 * i + 36, 64, 32, element_count[0].to_s)
    icon = RPG::Cache.icon(RuneSystemOptions::COMBINATIONS_WIND)
    self.contents.blt(160, 80 * i + 40, icon, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(188, 80 * i + 36, 64, 32, element_count[1].to_s)
    icon = RPG::Cache.icon(RuneSystemOptions::COMBINATIONS_EARTH)
    self.contents.blt(224, 80 * i + 40, icon, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(252, 80 * i + 36, 64, 32, element_count[3].to_s)
  end
   
  def usable?
    if $game_runes.combinations.check_if_available(self.index)
       return true
     else
       return false
     end
  end
 
 
    def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
    end
  end
 
 
end
 
 
class Window_Runes < Window_Selectable
 
 def initialize
    super(370, 64, 280, 352)
    self.visible = false
    @item_max = $game_runes.runes.size == 0 ? -1 : $game_runes.runes.size
    self.contents = Bitmap.new(width - 32, @item_max  * 32)
    self.index = self.index > @item_max - 1 ? 0 : self.index
    self.back_opacity = 200
    @foe = $game_runes.get_foe_level + 1
    refresh
  end
 
 def refresh
    self.contents.clear
    if $game_runes.runes.size != 0
     for i in 0..@item_max - 1
       if @foe < $game_runes.level
        draw_item($game_runes, i, disabled_color)
      else
        draw_item($game_runes, i, normal_color)
       end
     end
    else
     self.contents.font.color = normal_color
     rect = Rect.new(32, 0, self.contents.width - 8, 32)
     self.contents.draw_text(rect, RuneSystemOptions::NO_RUNES)
    end
  end
 
  def refresh_update
    @item_max = $game_runes.runes.size == 0 ? -1 : $game_runes.runes.size
    self.contents = nil
    self.contents = Bitmap.new(width - 32, @item_max  * 32)
    refresh
  end
 
  def draw_item(item, index, color)
    self.contents.font.color = color
    bit = RPG::Cache.icon(item.icon_name)
    self.contents.blt(4, 32 * index + 4, bit, Rect.new(0, 0, 24, 24))
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, item.name + " x" + item.amount.to_s)
  end
 
  def get_sprite_info
    return $game_runes[self.index].get_sprite_info
  end
 
  def usable?
    return false if $game_runes.runes.size == 0
    return @foe < $game_runes[self.index].level ? false : true
  end
 
  def get_help
    return "" if $game_runes.runes.size == 0
    return $game_runes.runes[self.index].description
  end
 
end
 
class Window_GainInfo < Window_Selectable
 
  def initialize(gain_array, lose = false)
    super(160, 140, 330, 230)
    self.contents = Bitmap.new(self.width - 32, 64 + gain_array.size * 32)
    @skill_array = gain_array
    @item_max = gain_array.size + 2
    self.z = 9998
    self.opacity = 200
    self.index = 1
    @up_text = lose ? RuneSystemOptions::LOST : RuneSystemOptions::ACCESSED
    refresh
  end
 
  def lose_arr(lose_array)
    @skill_array = lose_array
    @up_text = RuneSystemOptions::LOST
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, self.contents.width - 8, 32,
              @up_text, RuneSystemOptions::ACCESSED_POSITION)
    self.contents.font.color = normal_color
    for i in 0..@skill_array.size - 1
      skill = $data_skills[@skill_array]
      icon =  RPG::Cache.icon(skill.icon_name)
      self.contents.blt(4, 32 + 32 * i + 4, icon, Rect.new(0, 0, 24, 24))
      rect = Rect.new(32,32 + 32 * i, self.contents.width - 8, 32)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.draw_text(rect, skill.name)      
    end
    rect = Rect.new(0, 32 * (@item_max - 1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, RuneSystemOptions::ACCESSED_OK, 1)    
   end
                         
   alias new_update_cursor_rect update_cursor_rect
   
   def update_cursor_rect
     if self.index == 0
       self.index = 1
       self.oy = 0
     end
     
     if self.index > @item_max - 1
       self.index = @item_max - 1
     end
     
     new_update_cursor_rect
   end
 
   def ok_button?
     if self.index == @item_max - 1
       return true
     else
       return false
     end
   end
   
 
end
 
#==============================================================================
# Sprite_Rune
#-----------------------------------------------------------------------------
# Contains definitions on how a rune would be shown.
#==============================================================================
 
class Sprite_Rune < Sprite
 
  def initialize(size, type, viewport = nil)
    super(viewport)
    change_type(size, type)
    @current_size = size
    @current_type = type
    @flash_opacity = 0
    @sX, @sY = 0, 0
    @flash = false
    @back_z = self.z
   end
 
  def change_type(size, type)
    @current_size = size
    @current_type = type
    y = type * 190
    @rune_bitmap = Bitmap.new(RuneSystemOptions::GRAPHICS_FILE)
   
    case size
    when 0 # Small Square Runes
      set_bitmap(1, y, 38, 38)
    when 1 # Small Rect H Runes
      set_bitmap(39, y, 76, 38)
    when 2 # Small Rect V Runes
      set_bitmap(1, 38 + y, 38, 76)
    when 3 # Medium Square Runes
      set_bitmap(115, y, 76, 76)
    when 4 # Medium Square H Runes
      set_bitmap(191, y, 114, 76)
    when 5 # Medium Square V Runes
      set_bitmap(115, 76 + y, 76, 114)
    when 6 # Largest Rune
      set_bitmap(191, 76 + y, 114, 114)
    end
   
    @rune_bitmap.dispose
    @rune_bitmap = nil
    @z = -1
  end
 
  def set_start_pos(x, y)
   self.x = x
   self.y = y
   @sX = x
   @sY = y
  end
 
  def flip_hor_vert
   case @current_size
   when 1
    change_type(2, @current_type)
   when 2
    change_type(1, @current_type)
   when 4
    change_type(5, @current_type)
   when 5
    change_type(4, @current_type)
   end
   reset_position
  end
 
  def reset_position
   self.x = @sX
   self.y = @sY
  end
 
  def get_flipped
    case @current_size
    when 2
      return 1
    when 5
      return 1
    end
    return 0
  end
 
  def right_x
    return self.x + self.bitmap.width
  end
 
  def bottom_y
    return self.y + self.bitmap.height
  end  
   
 
  def set_type(type)
    hue = 0
    case type
    when 1
      hue = 120
    when 2
      hue = 220
    when 3
      hue = 240
    end
    self.bitmap.hue_change(hue)
  end
 
  def reset_flash
    self.color = Color.new(0, 0, 0, 0)
    self.z = @back_z
  end
 
  def update
   @z = self.z if @z == -1
   self.z = 3000
   self.color = Color.new(255, 255, 255, @flash_opacity)
   if @flash_opacity < 180 and @flash == false
    @flash_opacity += 18
    @flash = true if @flash_opacity > 179
   end
   if @flash_opacity > 0 and @flash == true
    @flash_opacity -= 18
    @flash = false if @flash_opacity < 1
   end
  end
 
  def set_bitmap(x, y, width, height)
    self.bitmap = Bitmap.new(width, height)
    d = Rect.new(x, y, width, height)
    self.bitmap.blt(0, 0, @rune_bitmap, d)
  end
end
 
# Class for checking spells
 
class Rune_SpellCheck
 
  attr_reader :lose_id_array # Lose Spell ID array
  attr_reader :gain_id_array  # Gain Spell ID array
  attr_reader :remove_id # For Window GainInfo to show which skills are lost
 
  def initialize
    # Initialize Spell Learn ID array
    @all_ids_array = []
    @spell_id_array = []
    @gain_id_array = []
    @remove_id = []
    @lose_id_array = []
   
    # Get Element Count
    @elements = $game_runes.get_element_count
   
    # Interpret FOE combination and fill spell ID
    get_spell_array
   
    # Fill all spell IDs
    fill_all_ids
   
    # Get already learned spells from character and remove them
    # from this array.
    fill_GL_arrays
  end
 
  def fill_GL_arrays
   
    # Fill Gain Array
    for i in 0..@spell_id_array.size - 1
      if !$game_actors[RuneSystemOptions::CHAR_ID].skills.include?(@spell_id_array)
        @gain_id_array.push(@spell_id_array)
      end
    end
   
    # Fill Lose Array
    for i in 0..@all_ids_array.size - 1
      if !@spell_id_array.include?(@all_ids_array) &&
         !can_learn_naturally?(@all_ids_array)
         
        @lose_id_array.push(@all_ids_array)
      end
    end    
   
    # Fill Remove ID array
    actor = $game_actors[RuneSystemOptions::CHAR_ID]
    for i in 0..@lose_id_array.size - 1
      if actor.skills.include?(@lose_id_array)
        @remove_id.push(@lose_id_array)
      end
    end    
   
  end
 
 
  def can_learn_naturally?(skill_id)
   
   actor_class_id = $game_actors[RuneSystemOptions::CHAR_ID].class_id
   actor_level = $game_actors[RuneSystemOptions::CHAR_ID].level
   
   can_learn = false
   
   for j in $data_classes[actor_class_id].learnings
     if j.level <= actor_level && j.skill_id == skill_id
       can_learn = true
     end
   end
 
   return can_learn
  end
 
 
  def fill_all_ids
   
   
   # Tier 1 and Tier 2 are special
   # if the character learns them normally then they should NOT
   # be removed.
   
   # Fill Tier 1 IDs
   
   
   
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["FR1"])
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["WN1"])
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["WR1"])
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["EH1"])
 
   # Fill Tier 2 IDs
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["FR2"])
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["WN2"])
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["WR2"])
   @all_ids_array.push(RuneSystemOptions::SINGLE_EL["EH2"])
   
   # Fill Dual Element IDs
   @all_ids_array.push(RuneSystemOptions::DUAL_EL["FRWR"])
   @all_ids_array.push(RuneSystemOptions::DUAL_EL["FRWN"])
   @all_ids_array.push(RuneSystemOptions::DUAL_EL["FREH"])
   @all_ids_array.push(RuneSystemOptions::DUAL_EL["WRWN"])
   @all_ids_array.push(RuneSystemOptions::DUAL_EL["WREH"])
   @all_ids_array.push(RuneSystemOptions::DUAL_EL["WNEH"])
   
   # Fill Triple Element Spell IDs
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["WRWNFR"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["WRWNEH"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["WRFREH"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["WNEHWR"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["WNEHFR"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["WNWRFR"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["FRWRWN"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["FRWREH"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["FRWNEH"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["EHFRWR"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["EHFRWN"])
   @all_ids_array.push(RuneSystemOptions::TRIPLE_EL["EHWRWN"])
   
   # Fill Quad Element ID
   @all_ids_array.push(RuneSystemOptions::QUAD_EL_ID)
  end
 
  def get_spell_array
   
    # Check Tier 1 and Tier 2
    check_foe_1_or_2
   
    # Check Quad Spell first
    if @elements[0] == 50 and @elements[1] == 50 and
       @elements[2] == 50 and @elements[3] == 50
       
     @spell_id_array.push(RuneSystemOptions::QUAD_EL_ID)
    else
   
    # Check for Dual Element Spells
    if $game_runes.get_foe_level > 1 &&
       $game_actors[RuneSystemOptions::CHAR_ID].level >= 33
     check_foe3_dual_element
    end
    # Check for Triple Element Spells
    check_foe3_triple_element if $game_runes.get_foe_level == 3
    end
  end
 
  def check_foe3_triple_element
   
    # Finding strongest elements
   
    p = 0 # Primary element index
    s = 0 # secondary element index
    t = 0 # tertirary element index
   
    chk = 0
   
    # Find the primary element
    for i in 0..@elements.size - 1
     if chk < @elements
       p = i
       chk = @elements
     end
   end
 
    chk = -1
   
    # Find the secondary element
    for i in 0..@elements.size - 1
     if chk < @elements and p != i
       s = i
       chk = @elements
     end
   end
   
    chk = -1
   
    # Find the tertriary element
    for i in 0..@elements.size - 1
     if chk < @elements and p != i and s != i
       t = i
       chk = @elements
     end
   end
 
   # Element check for case of Dual Element
   if (@elements[p] == @elements) and ((@elements[p] + @elements) >= 100)
     return
   elsif (@elements[t] == @elements[p]) and ((@elements[t] + @elements[p]) >= 100)
     return
   end
   
   # Exit the function if there is no secondary or tetriary element
   return if @elements == 0 or @elements[t] == 0
     
   case p
   when 0 # If Water is Primary
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["WRWNFR"]) if (s + t) == 3
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["WRWNEH"]) if (s + t) == 4
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["WRFREH"]) if (s + t) == 5
   when 1 # If Wind is Primary
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["WNEHWR"]) if (s + t) == 3
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["WNEHFR"]) if (s + t) == 5
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["WNWRFR"]) if (s + t) == 2
   when 2 # If Fire is Primary
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["FRWRWN"]) if (s + t) == 1
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["FRWREH"]) if (s + t) == 3
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["FRWNEH"]) if (s + t) == 4
   when 3 # If Earth is Primary
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["EHFRWR"]) if (s + t) == 2
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["EHFRWN"]) if (s + t) == 3
    @spell_id_array.push(RuneSystemOptions::TRIPLE_EL["EHWRWN"]) if (s + t) == 1
   end
 
  end
 
  def check_foe3_dual_element
   
    wa, wi, fi, ea = @elements[0], @elements[1], @elements[2], @elements[3]
   
    # Dual Element: Water + Wind
    if (wa + wi) >= 100 and wa == wi
      @spell_id_array.push(RuneSystemOptions::DUAL_EL["WRWN"])
    end
   
    # Dual Element: Water + Earth
    if (wa + ea) >= 100 and wa == ea
      @spell_id_array.push(RuneSystemOptions::DUAL_EL["WREH"])
    end
   
    # Dual Element: Wind + Earth
    if (wi + ea) >= 100 and wi == ea
      @spell_id_array.push(RuneSystemOptions::DUAL_EL["WNEH"])
    end
   
    # Dual Element: Fire + Wind
    if (fi + wi) >= 100 and fi == wi
      @spell_id_array.push(RuneSystemOptions::DUAL_EL["FRWN"])
    end
   
    # Dual Element: Fire + Water
    if (fi + wa) >= 100 and fi == wa
      @spell_id_array.push(RuneSystemOptions::DUAL_EL["FRWR"])
    end
   
    # Dual Element: Fire + Earth
    if (fi + ea) >= 100 and fi == ea
      @spell_id_array.push(RuneSystemOptions::DUAL_EL["FREH"])
    end
   
  end
 
 
 
  def check_foe_1_or_2
   
    elements = [0, 0, 0, 0]
   
    # Get small squre rune - elements
    ss_el_count = $game_runes.get_element_count(1)
   
    # Get small rectangle rune elements
    sr_el_count = $game_runes.get_element_count(2)
   
    # Check for Tier 1 spells
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["WR1"]) if ss_el_count[0] >= 10
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["WN1"]) if ss_el_count[1] >= 10
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["FR1"]) if ss_el_count[2] >= 10
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["EH1"]) if ss_el_count[3] >= 10
   
    # Check for Tier 2 spells
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["WR2"]) if sr_el_count[0] >= 25
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["WN2"]) if sr_el_count[1] >= 25
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["FR2"]) if sr_el_count[2] >= 25
    @spell_id_array.push(RuneSystemOptions::SINGLE_EL["EH2"]) if sr_el_count[3] >= 25
  end
 
end
 
#==============================================================================
# Sprite_FOE
#-----------------------------------------------------------------------------
# Contains definitions on Field of Elements would be shown.
#==============================================================================
 
class Sprite_FOE < Sprite
 
  attr_reader :level
 
  def initialize(level, viewport = nil)
    super(viewport)
    change_foe(level)
  end
 
  def change_foe(level)
    @level = level
    self.bitmap = Bitmap.new(156, 158)
    rune_bitmap = Bitmap.new(RuneSystemOptions::GRAPHICS_FILE)
   
    case level
    when 0
      d = Rect.new(312, 0, 156, 158)
      self.bitmap.blt(0, 0, rune_bitmap, d)
    when 1
      d = Rect.new(468, 0, 156, 158)
      self.bitmap.blt(0, 0, rune_bitmap, d)
    when 2
      d = Rect.new(312, 158, 156, 158)
      self.bitmap.blt(0, 0, rune_bitmap, d)
    when 3
      d = Rect.new(468, 158, 156, 158)
      self.bitmap.blt(0, 0, rune_bitmap, d)
    end
   
    rune_bitmap.dispose
    rune_bitmap = nil
  end
 
  def right_x
    return self.x + self.bitmap.width
  end
 
  def bottom_y
    return self.y + self.bitmap.height
  end  
 
end
 
class Scene_Rune
 
  def initialize
   
    Graphics.freeze
   
    # Load background
    if RuneSystemOptions::BACK_FILE != nil
     @back_rune = Sprite.new
     @back_rune.bitmap = Bitmap.new(RuneSystemOptions::BACK_FILE)
    end
   
    # Help window initialization
    @help_win = Window_Help.new
    @down_help = Window_Help.new
    @help_win.opacity = 160
    @down_help.opacity = 160
    @down_help.y = 416
    update_element_window
   
    # Create Add Window
    s1 = RuneSystemOptions::CMD_ADD
    s2 = RuneSystemOptions::CMD_REM
    s3 = RuneSystemOptions::CMD_CMB
    s4 = RuneSystemOptions::CMD_RET
 
    @add_window = Window_Command.new(250, [s1, s2, s3, s4])
    @add_window.y = 152
    @add_window.x = 50
 
    @add_window.opacity = 160
    @add_window.active = true
   
    # Make Add Rune Window
    @add_rune_win = Window_Runes.new
    @add_rune_win.active = false
   
    # Make Runes Array
    @runes = []
   
    # Create Field of Elements (FOE) sprite
    @foe = Sprite_FOE.new($game_runes.get_foe_level)
    @foe.x = 380
    @foe.y = 152
   
    @remove_current_index = 0
   
    # Create Combinations Window
    @combinations_win = Window_CombinationInfo.new
    @combinations_win.active = false
   
    # Reload Positions in FOE
    reload_foe
  end
 
 
  def reload_foe
    if $game_runes.foe.size > 0
     for i in 0..$game_runes.foe.size - 1
      rune_sprite_info = $game_runes.foe.get_sprite_info
      @runes.push(Sprite_Rune.new(rune_sprite_info[1], rune_sprite_info[0]))
      @runes[-1].x = $game_runes.foe.x
      @runes[-1].y = $game_runes.foe.y
     end
    end
  end
 
 
  def update_help
    if @add_window.active
     case @add_window.index
      when 0
        @help_win.set_text(RuneSystemOptions::HELP_ADD_FOE, 1)
      when 1
        @help_win.set_text(RuneSystemOptions::HELP_REM_FOE, 1)
      when 2
        @help_win.set_text(RuneSystemOptions::HELP_COMB, 1)
      when 3
        @help_win.set_text(RuneSystemOptions::HELP_EXIT, 1)
      end
    elsif @add_rune_win.active
      @help_win.set_text(@add_rune_win.get_help, 1)
    end
  end
 
     def update
     if @add_window.active
       @add_window.update
       
       if Input.trigger?(Input::C)
        case @add_window.index
        when 0
          $game_system.se_play($data_system.decision_se)
          @add_rune_win.index = 0
          @add_rune_win.visible = true
          @add_rune_win.active = true
          @add_window.active = false
        when 1
          if $game_runes.foe.size < 1
            $game_system.se_play($data_system.buzzer_se)
          else
            @add_window.active = false
          end
        when 2
          $game_system.se_play($data_system.decision_se)
          @combinations_win.active = true
          @combinations_win.visible = true
          @add_window.active = false
        when 3
          $game_system.se_play($data_system.decision_se)
          check_spells
          $scene = Scene_Menu.new(4)
          return
        end
       elsif Input.trigger?(Input::B)
        $game_system.se_play($data_system.buzzer_se)
        check_spells
        $scene = Scene_Menu.new(4)
        return
      end
     
    elsif !@add_window.active && @add_window.index == 1
      update_remove_rune
    elsif !@add_window.active && @combinations_win.active
      update_combinations
    elsif !@add_window.active && @add_rune_win.active
      update_add_rune_window
    else
     update_runes
   end
   
  end
   
  def update_combinations
    @combinations_win.update
 
    if Input.trigger?(Input::C)
       if @combinations_win.usable?
        foe = $game_runes.combinations.get(@combinations_win.index).foe
        $game_system.se_play($data_system.decision_se)
        remove_all_runes_from_foe
        for i in 0..foe.size - 1
          $game_runes.add_to_foe(foe)
        end
        reload_foe
        update_element_window
        @add_rune_win.refresh_update
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.trigger?(Input::B)
      @add_window.active = true
      @combinations_win.active = false
      @combinations_win.visible = false
    end
  end  
   
  def update_add_rune_window
   if @add_rune_win.active
    @add_rune_win.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      @add_rune_win.active = false
      @add_rune_win.visible = false
      @add_window.active = true
    elsif Input.trigger?(Input::C)
      if @add_rune_win.usable?
       $game_system.se_play($data_system.decision_se)
       @add_rune_win.visible = false
       @add_rune_win.active = false
       rune_sprite_info = @add_rune_win.get_sprite_info
       add_a_rune(rune_sprite_info[1], rune_sprite_info[0])
     else
       $game_system.se_play($data_system.buzzer_se)
     end
    end
   end
 end
 
  def check_spells
     spell_checker = Rune_SpellCheck.new
     actor = $game_actors[RuneSystemOptions::CHAR_ID]
     
     # Gain Skills
     for skill_id in spell_checker.gain_id_array
       actor.learn_skill(skill_id)
     end      
   
     # Lose Skills which are supposed to be lost
     for skill_id in spell_checker.lose_id_array
       actor.forget_skill(skill_id)
     end
     
     @add_window.active = false
                         
     if spell_checker.gain_id_array.size > 0    
     
      $game_runes.combinations.add_from_foe
      @gain_info = Window_GainInfo.new(spell_checker.gain_id_array)
      $game_system.me_play(RPG::AudioFile.new(RuneSystemOptions::ACCESSED_ME,
                          100, 100))
     
     loop do
        Graphics.update
        Input.update
        @gain_info.update
        if Input.trigger?(Input::C) && @gain_info.ok_button?
          $game_system.se_play($data_system.decision_se)
          break
        end
      end
     end
 
     if spell_checker.remove_id.size > 0              
      if @gain_info == nil
       @gain_info = Window_GainInfo.new(spell_checker.remove_id, true)
      else
       @gain_info.lose_arr(spell_checker.remove_id)
      end
     
      $game_system.me_play(RPG::AudioFile.new(RuneSystemOptions::LOST_ME,
                          100, 100))
     
     loop do
        Graphics.update
        Input.update
        @gain_info.update
        if Input.trigger?(Input::C) && @gain_info.ok_button?
          $game_system.se_play($data_system.decision_se)
          break
        end
      end
     end
 
  end
 
  def update_runes
    if Input.trigger?(Input::C)
     if check_for_runes_below
       $game_system.se_play($data_system.buzzer_se)
     else
       @runes[-1].reset_flash
       add_to_foe
       @add_window.active = true
       return
     end
    end
   
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      @runes[-1].dispose
      @runes.pop
      @add_rune_win.visible = true
      @add_rune_win.active = true
      return
    end      
    if @runes.size > 0
     @runes[-1].update
   
     @runes[-1].y += 38 if Input.repeat?(Input::DOWN)
     @runes[-1].y -= 38 if Input.repeat?(Input::UP)
     @runes[-1].x += 38 if Input.repeat?(Input::RIGHT)
     @runes[-1].x -= 38 if Input.repeat?(Input::LEFT)
     @runes[-1].flip_hor_vert if Input.repeat?(RuneSystemOptions::SWITCHING_KEY)
    end
    update_rune_boundaries
  end
 
 
   
  # Add rune to field of Elements
  def add_to_foe
    $game_runes.add_to_foe($game_runes[@add_rune_win.index].to_rune(@runes[-1].x,
                                           @runes[-1].y, @runes[-1].get_flipped))
    update_element_window
    # Update Rune Window
    @add_rune_win.refresh_update
  end
   
end    
 
class Scene_Rune
 
   def add_a_rune(rune_size, rune_type)
 
    @runes.push(Sprite_Rune.new(rune_size, rune_type))
   
    case @foe.level
    when 0
     @runes[-1].set_start_pos(@foe.x + 40, @foe.y + 42)
    when 1
     @runes[-1].set_start_pos(@foe.x + 2, @foe.y + 42)
    when 2
     @runes[-1].set_start_pos(@foe.x + 2, @foe.y + 42)
    when 3
     @runes[-1].set_start_pos(@foe.x + 2, @foe.y + 4)
   end
   
   end
 
 
    def main
    Graphics.transition
   
    loop do
      Input.update
      Graphics.update
     
      update_help
      update
     
      break if $scene != self
    end
   
    Graphics.freeze
   
    if @back_rune != nil
      @back_rune.bitmap.dispose
      @back_rune.dispose
    end
   
    @help_win.dispose
    @down_help.dispose
    @add_window.dispose
    @foe.dispose
    @gain_info.dispose if @gain_info != nil
   
    @runes.each{|rune|
                   rune.bitmap.dispose
                   rune = nil
               }
    @runes.compact!
    @runes = nil
  end
 
    # Remove Rune
  def update_remove_rune
     
    if @runes.size == 0
       @add_rune_win.refresh_update
       @add_window.active = true
       return
     end
     
     @runes[@remove_current_index].update
     
     if Input.repeat?(Input::RIGHT)
       @runes[@remove_current_index].reset_flash
       @remove_current_index += 1
     elsif Input.repeat?(Input::LEFT)
       @runes[@remove_current_index].reset_flash
       @remove_current_index -= 1
     end
   
     @remove_current_index = @runes.size - 1 if @remove_current_index < 0
     @remove_current_index = 0 if @remove_current_index > @runes.size - 1  
   
     if Input.trigger?(Input::C)
       @runes[@remove_current_index].bitmap.dispose
       @runes[@remove_current_index].dispose
       @runes.delete_at(@remove_current_index)
       $game_runes.remove_from_foe(@remove_current_index)
       @remove_current_index = 0
       update_element_window
     elsif Input.trigger?(Input::B)
       @runes.each{|rune| rune.reset_flash}
       @add_rune_win.refresh_update
       @add_window.active = true
     end
   end
   
  def remove_all_runes_from_foe
      for i in 0..@runes.size - 1
        @runes[0].bitmap.dispose
        @runes[0].dispose
        @runes.delete_at(0)
        $game_runes.remove_from_foe(0)
      end
      @add_rune_win.refresh_update
      update_element_window
  end
   
  def update_element_window
    elements = $game_runes.get_element_count
    help_string = "Water: " + elements[0].to_s + "%"
    help_string << "            "
    help_string << "Wind: " + elements[1].to_s + "%"
    help_string << "            "
    help_string << "Fire: " + elements[2].to_s + "%"
    help_string << "            "
    help_string << "Earth: " + elements[3].to_s + "%"
    @down_help.set_text(help_string, 1)
  end
 
      def check_for_runes_below
    below = false
    below2 = false
    for i in 0..@runes.size - 2
      below = collision_check(-1, i)
      below2 = collision_check(i, -1)
      break if below or below2
    end
     if below or below2
       return true
     else
       return false
     end
   end
   
  def update_rune_boundaries
    @runes.each{|rune|
     if @foe.level == 3 # On FOE level 4
      rune.x -= 38 if rune.right_x > @foe.right_x
      rune.x += 38 if rune.x < @foe.x
      rune.y -= 38 if rune.bottom_y > @foe.bottom_y
      rune.y += 38 if rune.y < @foe.y
     end
     if @foe.level == 2 # On FOE level 3
      rune.x -= 38 if rune.right_x > @foe.right_x
      rune.x += 38 if rune.x < @foe.x
      rune.y -= 38 if rune.bottom_y > @foe.bottom_y
      rune.y += 38 if rune.y < @foe.y
     
      rune.x += 38 if rune.x < @foe.x + 38 && rune.y == @foe.y + 4
      rune.x -= 38 if rune.right_x > @foe.right_x - 38 && rune.y == @foe.y + 4
      rune.y -= 38 if rune.x == @foe.x + 2 && rune.bottom_y > @foe.bottom_y - 38
      rune.y -= 38 if rune.right_x == @foe.right_x - 2 && rune.bottom_y > @foe.bottom_y - 38
     end
     if @foe.level == 1 # On FOE level 2
      rune.x -= 38 if rune.right_x > @foe.right_x
      rune.x += 38 if rune.x < @foe.x
      rune.y -= 38 if rune.bottom_y > @foe.bottom_y - 38
      rune.y += 38 if rune.y < @foe.y + 38
     end
     if @foe.level == 0 # On FOE level 1
      rune.x -= 38 if rune.right_x > @foe.right_x - 38
      rune.x += 38 if rune.x < @foe.x + 38
      rune.y -= 38 if rune.bottom_y > @foe.bottom_y - 38
      rune.y += 38 if rune.y < @foe.y + 38
     end  
    }
  end
 
  # Collision Checking before adding rune to FOE
  def collision_check(check_index, tested)
   
     y_s = @runes[tested].y + 1
     y_e = @runes[tested].bottom_y - 1
     cy = false
     cx = false
     for y in @runes[check_index].y..@runes[check_index].bottom_y
      if y_s == y
        cy = true
      end
      if y_e == y
        cy = true
      end
    end
   
     x_s = @runes[tested].x + 1
     x_e = @runes[tested].right_x - 1
     for x in @runes[check_index].x..@runes[check_index].right_x
      if x_s == x
        cx = true
      end
      if x_e == x
        cx = true
      end
     end
   
    if cx
      if cy
          return true
      end
    end
  end
   
end
 
[/rgss]

And here's a demo project:
http://www.mediafire.com/?55a1usbdd0byr1u
 

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