#===============================================================================
# RAFAEL_SOL_MAKER's RGSS2 DATA STRUCTURE FOR ACE (BETA)
# SLIM VERSION: LESS 542 LINES IF COMPARED WITH THE PREVIOUS VERSION
#_______________________________________________________________________________
# Description | It's simply part of the RPG Module Data Structure, extracted
# | originally from RPG Maker VX Help file. This version is
# | tweaked and intended to run only with the RGSS3 game player.
#________________|______________________________________________________________
# Usage | Just plug it before any other scripts, including the ones
# | from default game engine. Yes, this will be the very first!
#________________|______________________________________________________________
# Specifications | Difficulty to Use:
# | * (almost none at all, just plug it correctly)
# | Scripting Difficulty:
# | * (few, it's only a data structure after all)
# | Compatibility:
# | ??? (it's already made to create compatibility!)
# | New Methods:
# | - (none, only old methods already made for RPG Module)
# | Overwritten Methods:
# | - (depends on what are you using for)
# | Aliased Methods:
# | - RPG::Actor.new
# | - RPG::UsableItem.new
# | - RPG::Skill.new
# | - RPG::Item.new
# | - RPG::EquipItem.new
# | - RPG::Weapon.new
# | - RPG::Enemy.new
# | - RPG::Troop.new
# | - RPG::State.new
# | - RPG::System.new
# | - RPG::System::TestBattler.new
#________________|______________________________________________________________
# Special Thanks | -
#________________|______________________________________________________________
#===============================================================================
module RPG
class Area
def initialize
@id = 0
@name = ""
@map_id = 0
@rect = Rect.new(0,0,0,0)
@encounter_list = []
@order = 0
end
attr_accessor :id
attr_accessor :name
attr_accessor :map_id
attr_accessor :rect
attr_accessor :encounter_list
attr_accessor :order
end
class Actor
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
@id = 0
@name = ""
@exp_basis = 25
@exp_inflation = 35
@parameters = Table.new(6,100)
for i in 1..99
@parameters[0,i] = 400+i*50
@parameters[1,i] = 80+i*10
@parameters[2,i] = 15+i*5/4
@parameters[3,i] = 15+i*5/4
@parameters[4,i] = 20+i*5/2
@parameters[5,i] = 20+i*5/2
end
@weapon_id = 0
@armor1_id = 0
@armor2_id = 0
@armor3_id = 0
@armor4_id = 0
@two_swords_style = false
@fix_equipment = false
@auto_battle = false
@super_guard = false
@pharmacology = false
@critical_bonus = false
end
attr_accessor :id
attr_accessor :name
attr_accessor :exp_basis
attr_accessor :exp_inflation
attr_accessor :parameters
attr_accessor :weapon_id
attr_accessor :armor1_id
attr_accessor :armor2_id
attr_accessor :armor3_id
attr_accessor :armor4_id
attr_accessor :two_swords_style
attr_accessor :fix_equipment
attr_accessor :auto_battle
attr_accessor :super_guard
attr_accessor :pharmacology
attr_accessor :critical_bonus
end
class Class
def initialize
@id = 0
@name = ""
@position = 0
@weapon_set = []
@armor_set = []
@element_ranks = Table.new(1)
@state_ranks = Table.new(1)
@learnings = []
@skill_name_valid = false
@skill_name = ""
end
attr_accessor :id
attr_accessor :name
attr_accessor :position
attr_accessor :weapon_set
attr_accessor :armor_set
attr_accessor :element_ranks
attr_accessor :state_ranks
attr_accessor :learnings
attr_accessor :skill_name_valid
attr_accessor :skill_name
end
class UsableItem < BaseItem
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
super
@common_event_id = 0
@base_damage = 0
@variance = 20
@atk_f = 0
@spi_f = 0
@physical_attack = false
@damage_to_mp = false
@absorb_damage = false
@ignore_defense = false
@element_set = []
@plus_state_set = []
@minus_state_set = []
end
def for_one? # Overwrite: +4
return [1, 3, 4, 7, 9, 11].include?(@scope)
end
def for_two?
return [5].include?(@scope)
end
def for_three?
return [6].include?(@scope)
end
def for_random? # Overwrite: -3
return [4, 5, 6].include?(@scope)
end
def dual?
return [3].include?(@scope)
end
def need_selection? # Overwrite: +3
return [1, 3, 7, 9].include?(@scope)
end
attr_accessor :common_event_id
attr_accessor :base_damage
attr_accessor :variance
attr_accessor :atk_f
attr_accessor :spi_f
attr_accessor :physical_attack
attr_accessor :damage_to_mp
attr_accessor :absorb_damage
attr_accessor :ignore_defense
attr_accessor :element_set
attr_accessor :plus_state_set
attr_accessor :minus_state_set
end
class Skill < UsableItem
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
super
@hit = 100
end
attr_accessor :hit
end
class Item < UsableItem
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
super
@hp_recovery_rate = 0
@hp_recovery = 0
@mp_recovery_rate = 0
@mp_recovery = 0
@parameter_type = 0
@parameter_points = 0
end
attr_accessor :hp_recovery_rate
attr_accessor :hp_recovery
attr_accessor :mp_recovery_rate
attr_accessor :mp_recovery
attr_accessor :parameter_type
attr_accessor :parameter_points
end
class EquipItem < BaseItem
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
super
@atk = 0
@def = 0
@spi = 0
@agi = 0
@element_set = []
@state_set = []
end
attr_accessor :atk
attr_accessor :def
attr_accessor :spi
attr_accessor :agi
attr_accessor :element_set
attr_accessor :state_set
end
class Weapon < EquipItem
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
super
@hit = 95
@two_handed = false
@fast_attack = false
@dual_attack = false
@critical_bonus = false
end
attr_accessor :hit
attr_accessor :two_handed
attr_accessor :fast_attack
attr_accessor :dual_attack
attr_accessor :critical_bonus
end
class Armor < EquipItem
def initialize
super
@kind = 0
@eva = 0
@prevent_critical = false
@half_mp_cost = false
@double_exp_gain = false
@auto_hp_recover = false
end
attr_accessor :kind
attr_accessor :eva
attr_accessor :prevent_critical
attr_accessor :half_mp_cost
attr_accessor :double_exp_gain
attr_accessor :auto_hp_recover
end
class Enemy
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
@id = 0
@name = ""
@maxhp = 10
@maxmp = 10
@atk = 10
@def = 10
@spi = 10
@agi = 10
@hit = 95
@eva = 5
@drop_item1 = RPG::Enemy::DropItem.new
@drop_item2 = RPG::Enemy::DropItem.new
@levitate = false
@has_critical = false
@element_ranks = Table.new(1)
@state_ranks = Table.new(1)
@note = ""
end
attr_accessor :id
attr_accessor :name
attr_accessor :maxhp
attr_accessor :maxmp
attr_accessor :atk
attr_accessor :def
attr_accessor :spi
attr_accessor :agi
attr_accessor :hit
attr_accessor :eva
attr_accessor :drop_item1
attr_accessor :drop_item2
attr_accessor :levitate
attr_accessor :has_critical
attr_accessor :element_ranks
attr_accessor :state_ranks
attr_accessor :note
class DropItem
def initialize
@kind = 0
@item_id = 1
@weapon_id = 1
@armor_id = 1
@denominator = 1
end
attr_accessor :kind
attr_accessor :item_id
attr_accessor :weapon_id
attr_accessor :armor_id
attr_accessor :denominator
end
class Action
def initialize
@kind = 0
@basic = 0
@skill_id = 1
@condition_type = 0
@condition_param1 = 0
@condition_param2 = 0
@rating = 5
end
def skill?
return @kind == 1
end
attr_accessor :kind
attr_accessor :basic
attr_accessor :skill_id
attr_accessor :condition_type
attr_accessor :condition_param1
attr_accessor :condition_param2
attr_accessor :rating
end
end
class Troop
class Member
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
@immortal = false
end
attr_accessor :immortal
end
end
class State
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
@id = 0
@name = ""
@icon_index = 0
@priority = 5 # Overwrite: 5 instead 50
@atk_rate = 100
@def_rate = 100
@spi_rate = 100
@agi_rate = 100
@nonresistance = false
@offset_by_opposite = false
@slip_damage = false
@reduce_hit_ratio = false
@battle_only = true
@release_by_damage = false
@hold_turn = 0
@auto_release_prob = 0
@element_set = []
@state_set = []
@note = ""
end
attr_accessor :id
attr_accessor :name
attr_accessor :icon_index
attr_accessor :atk_rate
attr_accessor :def_rate
attr_accessor :spi_rate
attr_accessor :agi_rate
attr_accessor :nonresistance
attr_accessor :offset_by_opposite
attr_accessor :slip_damage
attr_accessor :reduce_hit_ratio
attr_accessor :battle_only
attr_accessor :release_by_damage
attr_accessor :hold_turn
attr_accessor :auto_release_prob
attr_accessor :element_set
attr_accessor :state_set
attr_accessor :note
end
class System
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
@passages = Table.new(8192)
end
attr_accessor :passages
class Terms
def initialize
@level = ""
@level_a = ""
@hp = ""
@hp_a = ""
@mp = ""
@mp_a = ""
@atk = ""
@def = ""
@spi = ""
@agi = ""
@weapon = ""
@armor1 = ""
@armor2 = ""
@armor3 = ""
@armor4 = ""
@weapon1 = ""
@weapon2 = ""
@attack = ""
@skill = ""
@guard = ""
@item = ""
@equip = ""
@status = ""
@save = ""
@game_end = ""
@fight = ""
@escape = ""
@new_game = ""
@continue = ""
@shutdown = ""
@to_title = ""
@cancel = ""
@gold = ""
end
attr_accessor :level
attr_accessor :level_a
attr_accessor :hp
attr_accessor :hp_a
attr_accessor :mp
attr_accessor :mp_a
attr_accessor :atk
attr_accessor :def
attr_accessor :spi
attr_accessor :agi
attr_accessor :weapon
attr_accessor :armor1
attr_accessor :armor2
attr_accessor :armor3
attr_accessor :armor4
attr_accessor :weapon1
attr_accessor :weapon2
attr_accessor :attack
attr_accessor :skill
attr_accessor :guard
attr_accessor :item
attr_accessor :equip
attr_accessor :status
attr_accessor :save
attr_accessor :game_end
attr_accessor :fight
attr_accessor :escape
attr_accessor :new_game
attr_accessor :continue
attr_accessor :shutdown
attr_accessor :to_title
attr_accessor :cancel
attr_accessor :gold
class TestBattler
alias rgss2to3_initialize initialize
def initialize
rgss2to3_initialize
@weapon_id = 0
@armor1_id = 0
@armor2_id = 0
@armor3_id = 0
@armor4_id = 0
end
attr_accessor :weapon_id
attr_accessor :armor1_id
attr_accessor :armor2_id
attr_accessor :armor3_id
attr_accessor :armor4_id
end
end
end
end