01-20-2004, 01:00 PM
Mining Engine and Smithing Engine
by Near Fantastica
Jan 20, 2004
Features:
Lets the player dig for Gems and Ore when the A key is depressed. The script calculates the finding of objects based on terrain value if it is Zero then is randomly chooses if you fine a Gem based on your Mining Level. If it higher then Zero then is generates a random number based on the terrain 1 to 4 for Copper, Silver, Gold, and Mithril and your Mining level.
As well there is the shop window where you can customize the party’s weapons. With in that window you can upgrade weapons and amour. Upgrading weapons and armor adds more slots and makes the weapons do more damage and makes the armor more affective. Adding a Gem to a slot adds and Elemental effect to each weapon in the party. But if you remove the Gem you lose that Elemental effect and the Gem.
Development:
This is a Basic Script I purposely strip it down the bare basic so that people could easily customize it to what ever they wanted… I challenge anyone and everyone to improve this script to the best it can be… there is so much more that could be added to this script¦
Instructions:
Create a new page call it Smiting_Engine and add the following code to it¦
Syntax:
To use this script add the following into a event script call or a menu item..
To dig for Gems and Ore press the A key
Take Care,
Near
by Near Fantastica
Jan 20, 2004
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
Features:
Lets the player dig for Gems and Ore when the A key is depressed. The script calculates the finding of objects based on terrain value if it is Zero then is randomly chooses if you fine a Gem based on your Mining Level. If it higher then Zero then is generates a random number based on the terrain 1 to 4 for Copper, Silver, Gold, and Mithril and your Mining level.
As well there is the shop window where you can customize the party’s weapons. With in that window you can upgrade weapons and amour. Upgrading weapons and armor adds more slots and makes the weapons do more damage and makes the armor more affective. Adding a Gem to a slot adds and Elemental effect to each weapon in the party. But if you remove the Gem you lose that Elemental effect and the Gem.
Development:
This is a Basic Script I purposely strip it down the bare basic so that people could easily customize it to what ever they wanted… I challenge anyone and everyone to improve this script to the best it can be… there is so much more that could be added to this script¦
Instructions:
Create a new page call it Smiting_Engine and add the following code to it¦
Code:
#==============================================================================
# ** Mining Engine and Smithing Engine
#------------------------------------------------------------------------------
#  By: Near Fantastica
# Date: 20/1/04
# Press X to dig for jems and ore calculates return based on terrian values and mining Level
# Upgrade a weapon with ore and gold for higher damage and more alment slots
# Alment a weapon with jems to add elemental damge to it
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# â—? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias scene_title_command_new_game command_new_game
#--------------------------------------------------------------------------
# â—? Sets up mining engine
#--------------------------------------------------------------------------
def command_new_game
$mining_engine = Mining_Engine.new
scene_title_command_new_game
end
end
class Scene_Map
#--------------------------------------------------------------------------
# â—? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias scene_map_update update
#--------------------------------------------------------------------------
# â—? Sets up mining engine
#--------------------------------------------------------------------------
def update
# X ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::X)
$mining_engine.dig
end
scene_map_update
end
end
class Mining_Engine
#--------------------------------------------------------------------------
# â—? Open instance variable
#--------------------------------------------------------------------------
attr_accessor :ore
attr_accessor :jems
attr_accessor :amour_slots
attr_accessor :weapon_slots
attr_accessor :weapon_level
attr_accessor :armour_level
#--------------------------------------------------------------------------
# â—? Activate
#--------------------------------------------------------------------------
def initialize
@ore = {}
@ore[0] = 0
@ore[1] = 0
@ore[2] = 0
@ore[3] = 0
@jems = {}
@jems[0] = 0
@jems[1] = 0
@jems[2] = 0
@jems[3] = 0
@jems[4] = 0
@jems[5] = 0
@jems[6] = 0
@jems[7] = 0
@mining_level = 100
@amour_slots = {}
@amour_slots[0] = "Slot One"
@amour_slots[1] = "Slot Two"
@amour_slots[2] = "Slot Three"
@amour_slots[3] = "Slot Four"
@amour_slots[4] = "Slot Five"
@weapon_slots = {}
@weapon_slots[0] = "Slot One"
@weapon_slots[1] = "Slot Two"
@weapon_slots[2] = "Slot Three"
@weapon_slots[3] = "Slot Four"
@weapon_slots[4] = "Slot Five"
@weapon_level = 0
@armour_level = 0
end
#--------------------------------------------------------------------------
# â—? Dig
#--------------------------------------------------------------------------
def dig
#Check Terrain
if $game_map.terrain_tag($game_player.x, $game_player.y) == 0
# Check mining for Jems
if @mining_level >= rand(1000)
@jems[rand(8)] += 1
@mining_level += 1
end
else
#Check mining for Ore
if @mining_level >= rand(1000)
@ore[rand($game_map.terrain_tag($game_player.x, $game_player.y))] += 1
@mining_level += 1
end
end
end
end
#==============================================================================
# â–� Window_Jem_Command
#------------------------------------------------------------------------------
#  It is the window which does jem command selection.
#==============================================================================
class Window_Jem_Command < Window_Selectable
#--------------------------------------------------------------------------
# â—? Object initialization
# width : Width of window
# height : Height of window
# commands : Arrangement in command character string
#--------------------------------------------------------------------------
def initialize(width, height, commands)
# Calculating the height of the window from the quantity of command
super(0, 0, width, height)
@item_max = commands.size
@column_max = 2
@commands = commands
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# â—? Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# â—? Drawing of item
# index : Item number
# color : Letter color
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
self.contents.clear
self.contents.draw_text(50, 0, 220, 32, "Ruby")
self.contents.draw_text(0, 0, 180, 32, $mining_engine.jems[0].to_s, 2)
self.contents.draw_text(270, 0, 220, 32, "Iolite")
self.contents.draw_text(220, 0, 180, 32, $mining_engine.jems[1].to_s, 2)
self.contents.draw_text(50, 32, 220, 32, "Amethyist")
self.contents.draw_text(0, 32, 180, 32, $mining_engine.jems[2].to_s, 2)
self.contents.draw_text(270, 32, 220, 32, "Saphire")
self.contents.draw_text(220, 32, 180, 32, $mining_engine.jems[3].to_s, 2)
self.contents.draw_text(50, 64, 220, 32, "Topaz")
self.contents.draw_text(0, 64, 180, 32, $mining_engine.jems[4].to_s, 2)
self.contents.draw_text(270, 64, 220, 32, "Emerald")
self.contents.draw_text(220, 64, 180, 32, $mining_engine.jems[5].to_s, 2)
self.contents.draw_text(50, 96, 220, 32, "Diamond")
self.contents.draw_text(0, 96, 180, 32, $mining_engine.jems[6].to_s, 2)
self.contents.draw_text(270, 96, 220, 32, "Oblivion")
self.contents.draw_text(220, 96, 180, 32, $mining_engine.jems[7].to_s, 2)
end
#--------------------------------------------------------------------------
# â—? Nullfication of item
# index : Item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
#==============================================================================
# â–� Window_Wepon
#------------------------------------------------------------------------------
#  Spacer Window for Wepon
#==============================================================================
class Window_Wepon_Spacer < Window_Base
#--------------------------------------------------------------------------
# â—? Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 60, 190)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
# â—? Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 120, 32, "W")
self.contents.draw_text(0, 25, 120, 32, "E")
self.contents.draw_text(0, 50, 120, 32, "A")
self.contents.draw_text(0, 75, 120, 32, "P")
self.contents.draw_text(0, 100, 120, 32, "O")
self.contents.draw_text(0, 125, 120, 32, "N")
end
end
#==============================================================================
# â–� Window_Armor
#------------------------------------------------------------------------------
#  Spacer Window for Armor
#==============================================================================
class Window_Armor_Spacer < Window_Base
#--------------------------------------------------------------------------
# â—? Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 60, 190)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
# â—? Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 120, 32, "A")
self.contents.draw_text(0, 30, 120, 32, "R")
self.contents.draw_text(0, 60, 120, 32, "M")
self.contents.draw_text(0, 90, 120, 32, "O")
self.contents.draw_text(0, 120, 120, 32, "R")
end
end
#==============================================================================
# â–� Window_Smithing_Gold
#------------------------------------------------------------------------------
#  It is the window which indicates the gold
#==============================================================================
class Window_Synthesis_Gold < Window_Base
#--------------------------------------------------------------------------
# â—? Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
# â—? Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(50, 0, 160, 32, "Gold")
self.contents.draw_text(50, 0, 120, 32, $game_party.gold.to_s, 2)
end
end
#==============================================================================
# â–� Window_Ore
#------------------------------------------------------------------------------
#  Calcucates the ore the player has a draws the vaule
#==============================================================================
class Window_Ore < Window_Base
#--------------------------------------------------------------------------
# â—? Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 200, 230)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
# â—? Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, 20, 160, 32, "Copper",1)
self.contents.draw_text(4, 20, 160, 32, $mining_engine.ore[0].to_s, 2)
self.contents.draw_text(4, 60, 160, 32, "Silver",1)
self.contents.draw_text(4, 60, 160, 32, $mining_engine.ore[1].to_s, 2)
self.contents.draw_text(4, 100, 160, 32, "Gold",1)
self.contents.draw_text(4, 100, 160, 32, $mining_engine.ore[2].to_s, 2)
self.contents.draw_text(4, 140, 160, 32, "Mithril",1)
self.contents.draw_text(4, 140, 160, 32, $mining_engine.ore[3].to_s, 2)
end
end
#==============================================================================
# â–� Scene_Synthesis
#------------------------------------------------------------------------------
#  Shop window for Wepon and Armor Synthesis
#==============================================================================
class Scene_Synthesis
#--------------------------------------------------------------------------
# â—? Object initialization
# menu_index : Cursor initial position of command
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# â—? Main processing
#--------------------------------------------------------------------------
def main
# refreshment of windows
refresh
# Transition execution
Graphics.transition
# Main loop
loop do
# Renewing the game picture
Graphics.update
# Updating the information of input
Input.update
# フレー� 更新
update
# When the picture changes, discontinuing the loop
if $scene != self
break
end
end
# Transition preparation
Graphics.freeze
# Releasing the windows
@command_window.dispose
@wepon_window.dispose
@wepon_spacer_window.dispose
@armour_window.dispose
@armor_spacer_window.dispose
@gold_window.dispose
@ore_window.dispose
@jem_window.dispose
end
#--------------------------------------------------------------------------
# â—? Refreshment
#--------------------------------------------------------------------------
def refresh
# Drawing up the command window
s1 = "Upgrade Wepon"
s2 = "Upgrade Armor"
s3 = "Alment Wepon"
s4 = "Alment Armour"
s5 = "Back"
@command_window = Window_Command.new(200, [s1, s2, s3, s4,s5])
@command_window.x = 0
@command_window.y = 0
# Drawing up the weapon spacer window
@wepon_spacer_window = Window_Wepon_Spacer.new
@wepon_spacer_window.x = 200
@wepon_spacer_window.y = 0
# Drawing up the weapon window
@weapon = {}
@weapon[0] = ""
@weapon[1] = ""
@weapon[2] = ""
@weapon[3] = ""
@weapon[4] = ""
for i in 0..$mining_engine.weapon_level
@weapon[i] = $mining_engine.weapon_slots[i]
end
@wepon_window = Window_Command.new(160, @weapon)
@wepon_window.active = false
@wepon_window.index = -1
@wepon_window.x = 260
@wepon_window.y = 0
# Drawing up the armor spacer window
@armor_spacer_window = Window_Armor_Spacer.new
@armor_spacer_window.x = 420
@armor_spacer_window.y = 0
# Drawing up the armor window
@armour = {}
@armour[0] = ""
@armour[1] = ""
@armour[2] = ""
@armour[3] = ""
@armour[4] = ""
for i in 0..$mining_engine.armour_level
@armour[i] = $mining_engine.amour_slots[i]
end
@armour_window = Window_Command.new(160, @armour)
@armour_window.active = false
@armour_window.index = -1
@armour_window.x = 480
@armour_window.y = 0
# Drawing up the gold window
@gold_window = Window_Synthesis_Gold .new
@gold_window.x = 0
@gold_window.y = 420
# Drawing up the ore window
@ore_window = Window_Ore.new
@ore_window.x = 0
@ore_window.y = 190
# Drawing up the jems window
@jems = {}
@jems[0] = "Ruby"
@jems[1] = "Iolite"
@jems[2] = "Amethyist"
@jems[3] = "Saphire"
@jems[4] = "Topaz"
@jems[5] = "Emerald"
@jems[6] = "Diamond"
@jems[7] = "Oblivion"
@jem_window = Window_Jem_Command.new(440, 230,@jems)
@jem_window.active = false
@jem_window.index = -1
@jem_window.x = 200
@jem_window.y = 190
end
#--------------------------------------------------------------------------
# â—? Frame renewal
#--------------------------------------------------------------------------
def update
# Renewing the window
@command_window.update
@jem_window.update
@wepon_window.update
@armour_window.update
@gold_window.update
@ore_window.update
# When the command window is active,: update_command is called
if @command_window.active
update_command
return
end
#When the jem window is active,: update_jems is called
if @jem_window.active
update_jems
return
end
#When the weapon window is active,: update_wepon is called
if @wepon_window.active
update_wepon
return
end
#When the armour window is active,: update_armour is called
if @armour_window.active
update_armour
return
end
end
#--------------------------------------------------------------------------
# â—? When frame renewal (the command window is active)
#--------------------------------------------------------------------------
def update_command
# B When the button is pushed
if Input.trigger?(Input::B)
# Performing cancellation SE
$game_system.se_play($data_system.cancel_se)
# Change to menu picture
$scene = Scene_Menu.new
return
end
# When C button is pushed
if Input.trigger?(Input::C)
# It diverges at cursor position of the command window
case @command_window.index
when 0
case $mining_engine.weapon_level
when -1
# Upgrade weapon to level 1
if $game_party.gold == 10
$game_system.se_play($data_system.decision_se)
$mining_engine.weapon_level += 1
$data_weapons[$data_actors[1].weapon_id].atk += 20
else
$game_system.se_play($data_system.buzzer_se)
end
when 0
# Upgrade weapon to level 2
if $game_party.gold == 20
if $mining_engine.ore[0] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.weapon_level += 1
$data_weapons[$data_actors[1].weapon_id].atk += 40
end
else
$game_system.se_play($data_system.buzzer_se)
end
when 1
# Upgrade weapon to level 3
if $game_party.gold == 40
if $mining_engine.ore[1] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.weapon_level += 1
$data_weapons[$data_actors[1].weapon_id].atk += 80
end
else
$game_system.se_play($data_system.buzzer_se)
end
when 2
# Upgrade weapon to level 4
if $game_party.gold == 80
if $mining_engine.ore[2] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.weapon_level += 1
$data_weapons[$data_actors[1].weapon_id].atk += 120
end
else
$game_system.se_play($data_system.buzzer_se)
end
when 3
# Upgrade weapon to level 5
if $game_party.gold == 120
if $mining_engine.ore[3] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.weapon_level += 1
$data_weapons[$data_actors[1].weapon_id].atk += 320
end
else
$game_system.se_play($data_system.buzzer_se)
end
end
# Releasing the windows
@command_window.dispose
@wepon_window.dispose
@wepon_spacer_window.dispose
@armour_window.dispose
@armor_spacer_window.dispose
@gold_window.dispose
@ore_window.dispose
@jem_window.dispose
refresh
when 1
case $mining_engine.armour_level
when -1
# Upgrade armour to level 1
if $game_party.gold == 10
$game_system.se_play($data_system.decision_se)
$mining_engine.armour_level += 1
$data_armours[$data_actors[1].armour_id].pdef += 20
else
$game_system.se_play($data_system.buzzer_se)
end
when 0
# Upgrade armour to level 2
if $game_party.gold == 20
if $mining_engine.ore[0] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.armour_level += 1
$data_armours[$data_actors[1].armour_id].pdef += 40
end
else
$game_system.se_play($data_system.buzzer_se)
end
when 1
# Upgrade armour to level 3
if $game_party.gold == 40
if $mining_engine.ore[1] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.armour_level += 1
$data_armours[$data_actors[1].armour_id].pdef += 80
end
else
$game_system.se_play($data_system.buzzer_se)
end
when 2
# Upgrade armour to level 4
if $game_party.gold == 80
if $mining_engine.ore[2] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.armour_level += 1
$data_armours[$data_actors[1].armour_id].pdef += 120
end
else
$game_system.se_play($data_system.buzzer_se)
end
when 3
# Upgrade armour to level 5
if $game_party.gold == 120
if $mining_engine.ore[3] == 50
$game_system.se_play($data_system.decision_se)
$mining_engine.armour_level += 1
$data_armours[$data_actors[1].armour_id].pdef += 320
end
else
$game_system.se_play($data_system.buzzer_se)
end
end
# Releasing the windows
@command_window.dispose
@wepon_window.dispose
@wepon_spacer_window.dispose
@armour_window.dispose
@armor_spacer_window.dispose
@gold_window.dispose
@ore_window.dispose
@jem_window.dispose
refresh
when 2
$game_system.se_play($data_system.decision_se)
# The jem window is made active
@command_window.active = false
@jem_window.active = true
@jem_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
# The jem window is made active
@command_window.active = false
@jem_window.active = true
@jem_window.index = 0
end
return
end
end
#--------------------------------------------------------------------------
# â—? When frame renewal (the jems window is active)
#--------------------------------------------------------------------------
def update_jems
# B When the button is pushed
if Input.trigger?(Input::B)
# Performing cancellation SE
$game_system.se_play($data_system.cancel_se)
# The command window is made active
@command_window.active = true
@jem_window.active = false
@jem_window.index = -1
return
end
# When C button is pushed,
if Input.trigger?(Input::C)
# It diverges at cursor position of the command window
case @jem_window.index
when 0
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 1
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 2
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 3
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 4
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 5
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 6
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
when 7
if $mining_engine.jems[@jem_window.index] == 0
# Performing decision SE
$game_system.se_play($data_system.buzzer_se)
else
# Performing decision SE
$game_system.se_play($data_system.decision_se)
# determining weapon or armour active
if @command_window.index == 2
@wepon_window.active = true
@wepon_window.index = 0
@jem_window.active = false
else
@armour_window.active = true
@armour_window.index = 0
@jem_window.active = false
end
end
end
return
end
end
#--------------------------------------------------------------------------
# â—? When frame renewal (the weapon window is active)
#--------------------------------------------------------------------------
def update_wepon
# The B when button is pushed
if Input.trigger?(Input::B)
# Performing cancellation SE
$game_system.se_play($data_system.cancel_se)
# The jem window is made active
@jem_window.active = true
@wepon_window.active = false
@wepon_window.index = -1
return
end
# When C button is pushed,
if Input.trigger?(Input::C)
# if weapon dose equal nothing then add Alment
if @weapon[@wepon_window.index] != ""
remove_wepon_alment(@wepon_window.index)
add_wepon_alment(@wepon_window.index, @jem_window.index)
refresh
end
end
end
#--------------------------------------------------------------------------
# â—? When frame renewal (the armor window is active)
#--------------------------------------------------------------------------
def update_armour
# The B when button is pushed,
if Input.trigger?(Input::B)
# Performing cancellation SE
$game_system.se_play($data_system.cancel_se)
# The jem window is made active
@jem_window.active = true
@armour_window.active = false
@armour_window.index = -1
return
end
# When C button is pushed,
if Input.trigger?(Input::C)
# if armour dose equal nothing then add Alment
if @armour[@armour_window.index] != ""
remove_armour_alment(@wepon_window.index)
add_armour_alment(@armour_window.index, @jem_window.index)
refresh
end
end
end
#--------------------------------------------------------------------------
# â—? Add Armour Alment
#--------------------------------------------------------------------------
def add_armour_alment(place, attribute)
$data_armors[$data_actors[1].armor3_id].element_set[place] = attribute
$data_armors[$data_actors[2].armor3_id].element_set[place] = attribute
$data_armors[$data_actors[3].armor3_id].element_set[place] = attribute
$data_armors[$data_actors[4].armor3_id].element_set[place] = attribute
$mining_engine.armour_slots[@armour_window.index] = @jems[@jem_window.index]
$mining_engine.jems[@jem_window.index] -= 1
# Releasing the windows
@command_window.dispose
@wepon_window.dispose
@wepon_spacer_window.dispose
@armour_window.dispose
@armor_spacer_window.dispose
@gold_window.dispose
@ore_window.dispose
@jem_window.dispose
end
#--------------------------------------------------------------------------
# â—? Add Wepon Alment
#--------------------------------------------------------------------------
def add_wepon_alment(place, attribute)
$data_weapons[$data_actors[1].weapon_id].element_set[place] = attribute
$data_weapons[$data_actors[2].weapon_id].element_set[place] = attribute
$data_weapons[$data_actors[3].weapon_id].element_set[place] = attribute
$data_weapons[$data_actors[4].weapon_id].element_set[place] = attribute
$mining_engine.weapon_slots[@wepon_window.index] = @jems[@jem_window.index]
$mining_engine.jems[@jem_window.index] -= 1
# Releasing the windows
@command_window.dispose
@wepon_window.dispose
@wepon_spacer_window.dispose
@armour_window.dispose
@armor_spacer_window.dispose
@gold_window.dispose
@ore_window.dispose
@jem_window.dispose
end
#--------------------------------------------------------------------------
# â—? Remove Wepon Alment
#--------------------------------------------------------------------------
def remove_wepon_alment(place)
$data_weapons[$data_actors[1].weapon_id].element_set[place] = nil
$data_weapons[$data_actors[2].weapon_id].element_set[place] = nil
$data_weapons[$data_actors[3].weapon_id].element_set[place] = nil
$data_weapons[$data_actors[4].weapon_id].element_set[place] = nil
end
#--------------------------------------------------------------------------
# â—? Remove Armour Alment
#--------------------------------------------------------------------------
def add_armour_alment(place, attribute)
$data_armors[$data_actors[1].armor3_id].element_set[place] = nil
$data_armors[$data_actors[2].armor3_id].element_set[place] = nil
$data_armors[$data_actors[3].armor3_id].element_set[place] = nil
$data_armors[$data_actors[4].armor3_id].element_set[place] = nil
end
end
Syntax:
To use this script add the following into a event script call or a menu item..
Code:
$scene = Scene_Synthesis.new
To dig for Gems and Ore press the A key
Take Care,
Near