IceDragon200

[VX]RGSS2-Library

Jun 20th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 24.76 KB | None | 0 0
  1. module RPG
  2.   class AudioFile
  3.     def initialize(name = "", volume = 100, pitch = 100)
  4.       @name = name
  5.       @volume = volume
  6.       @pitch = pitch
  7.     end
  8.     attr_accessor :name
  9.     attr_accessor :volume
  10.     attr_accessor :pitch
  11.   end
  12. end
  13. module RPG
  14.   class BGM < AudioFile
  15.     @@last = BGM.new
  16.     def play
  17.       if @name.empty?
  18.         Audio.bgm_stop
  19.         @@last = BGM.new
  20.       else
  21.         Audio.bgm_play("Audio/BGM/" + @name, @volume, @pitch)
  22.         @@last = self
  23.       end
  24.     end
  25.     def self.stop
  26.       Audio.bgm_stop
  27.       @@last = BGM.new
  28.     end
  29.     def self.fade(time)
  30.       Audio.bgm_fade(time)
  31.       @@last = BGM.new
  32.     end
  33.     def self.last
  34.       @@last
  35.     end
  36.   end
  37. end
  38. module RPG
  39.   class BGS < AudioFile
  40.     @@last = BGS.new
  41.     def play
  42.       if @name.empty?
  43.         Audio.bgs_stop
  44.         @@last = BGS.new
  45.       else
  46.         Audio.bgs_play("Audio/BGS/" + @name, @volume, @pitch)
  47.         @@last = self
  48.       end
  49.     end
  50.     def self.stop
  51.       Audio.bgs_stop
  52.       @@last = BGS.new
  53.     end
  54.     def self.fade(time)
  55.       Audio.bgs_fade(time)
  56.       @@last = BGS.new
  57.     end
  58.     def self.last
  59.       @@last
  60.     end
  61.   end
  62. end
  63. module RPG
  64.   class ME < AudioFile
  65.     def play
  66.       if @name.empty?
  67.         Audio.me_stop
  68.       else
  69.         Audio.me_play("Audio/ME/" + @name, @volume, @pitch)
  70.       end
  71.     end
  72.     def self.stop
  73.       Audio.me_stop
  74.     end
  75.     def self.fade(time)
  76.       Audio.me_fade(time)
  77.     end
  78.   end
  79. end
  80. module RPG
  81.   class SE < AudioFile
  82.     def play
  83.       unless @name.empty?
  84.         Audio.se_play("Audio/SE/" + @name, @volume, @pitch)
  85.       end
  86.     end
  87.     def self.stop
  88.       Audio.se_stop
  89.     end
  90.   end
  91. end
  92. module RPG
  93.   class Animation
  94.     def initialize
  95.       @id = 0
  96.       @name = ""
  97.       @animation1_name = ""
  98.       @animation1_hue = 0
  99.       @animation2_name = ""
  100.       @animation2_hue = 0
  101.       @position = 1
  102.       @frame_max = 1
  103.       @frames = [RPG::Animation::Frame.new]
  104.       @timings = []
  105.     end
  106.     attr_accessor :id
  107.     attr_accessor :name
  108.     attr_accessor :animation1_name
  109.     attr_accessor :animation1_hue
  110.     attr_accessor :animation2_name
  111.     attr_accessor :animation2_hue
  112.     attr_accessor :position
  113.     attr_accessor :frame_max
  114.     attr_accessor :frames
  115.     attr_accessor :timings
  116.   end
  117. end
  118. module RPG
  119.   class Animation
  120.     class Frame
  121.       def initialize
  122.         @cell_max = 0
  123.         @cell_data = Table.new(0, 0)
  124.       end
  125.       attr_accessor :cell_max
  126.       attr_accessor :cell_data
  127.     end
  128.   end
  129. end
  130. module RPG
  131.   class Animation
  132.     class Timing
  133.       def initialize
  134.         @frame = 0
  135.         @se = RPG::AudioFile.new("", 80)
  136.         @flash_scope = 0
  137.         @flash_color = Color.new(255,255,255,255)
  138.         @flash_duration = 5
  139.       end
  140.       attr_accessor :frame
  141.       attr_accessor :se
  142.       attr_accessor :flash_scope
  143.       attr_accessor :flash_color
  144.       attr_accessor :flash_duration
  145.     end
  146.   end
  147. end
  148. module RPG
  149.   class Area
  150.     def initialize
  151.       @id = 0
  152.       @name = ""
  153.       @map_id = 0
  154.       @rect = Rect.new(0,0,0,0)
  155.       @encounter_list = []
  156.       @order = 0
  157.     end
  158.     attr_accessor :id
  159.     attr_accessor :name
  160.     attr_accessor :map_id
  161.     attr_accessor :rect
  162.     attr_accessor :encounter_list
  163.     attr_accessor :order
  164.   end
  165. end
  166. module RPG
  167.   class BaseItem
  168.     def initialize
  169.       @id = 0
  170.       @name = ""
  171.       @icon_index = 0
  172.       @description = ""
  173.       @note = ""
  174.     end
  175.     attr_accessor :id
  176.     attr_accessor :name
  177.     attr_accessor :icon_index
  178.     attr_accessor :description
  179.     attr_accessor :note
  180.   end
  181. end
  182. module RPG
  183.   class Armor < BaseItem
  184.     def initialize
  185.       super
  186.       @kind = 0
  187.       @price = 0
  188.       @eva = 0
  189.       @atk = 0
  190.       @def = 0
  191.       @spi = 0
  192.       @agi = 0
  193.       @prevent_critical = false
  194.       @half_mp_cost = false
  195.       @double_exp_gain = false
  196.       @auto_hp_recover = false
  197.       @element_set = []
  198.       @state_set = []
  199.     end
  200.     attr_accessor :kind
  201.     attr_accessor :price
  202.     attr_accessor :eva
  203.     attr_accessor :atk
  204.     attr_accessor :def
  205.     attr_accessor :spi
  206.     attr_accessor :agi
  207.     attr_accessor :prevent_critical
  208.     attr_accessor :half_mp_cost
  209.     attr_accessor :double_exp_gain
  210.     attr_accessor :auto_hp_recover
  211.     attr_accessor :element_set
  212.     attr_accessor :state_set
  213.   end
  214. end
  215. module RPG
  216.   class Weapon < BaseItem
  217.     def initialize
  218.       super
  219.       @animation_id = 0
  220.       @price = 0
  221.       @hit = 95
  222.       @atk = 0
  223.       @def = 0
  224.       @spi = 0
  225.       @agi = 0
  226.       @two_handed = false
  227.       @fast_attack = false
  228.       @dual_attack = false
  229.       @critical_bonus = false
  230.       @element_set = []
  231.       @state_set = []
  232.     end
  233.     attr_accessor :animation_id
  234.     attr_accessor :price
  235.     attr_accessor :hit
  236.     attr_accessor :atk
  237.     attr_accessor :def
  238.     attr_accessor :spi
  239.     attr_accessor :agi
  240.     attr_accessor :two_handed
  241.     attr_accessor :fast_attack
  242.     attr_accessor :dual_attack
  243.     attr_accessor :critical_bonus
  244.     attr_accessor :element_set
  245.     attr_accessor :state_set
  246.   end
  247. end
  248. module RPG
  249.   class UsableItem < BaseItem
  250.     def initialize
  251.       super
  252.       @scope = 0
  253.       @occasion = 0
  254.       @speed = 0
  255.       @animation_id = 0
  256.       @common_event_id = 0
  257.       @base_damage = 0
  258.       @variance = 20
  259.       @atk_f = 0
  260.       @spi_f = 0
  261.       @physical_attack = false
  262.       @damage_to_mp = false
  263.       @absorb_damage = false
  264.       @ignore_defense = false
  265.       @element_set = []
  266.       @plus_state_set = []
  267.       @minus_state_set = []
  268.     end
  269.     def for_opponent?
  270.       return [1, 2, 3, 4, 5, 6].include?(@scope)
  271.     end
  272.     def for_friend?
  273.       return [7, 8, 9, 10, 11].include?(@scope)
  274.     end
  275.     def for_dead_friend?
  276.       return [9, 10].include?(@scope)
  277.     end
  278.     def for_user?
  279.       return [11].include?(@scope)
  280.     end
  281.     def for_one?
  282.       return [1, 3, 4, 7, 9, 11].include?(@scope)
  283.     end
  284.     def for_two?
  285.       return [5].include?(@scope)
  286.     end
  287.     def for_three?
  288.       return [6].include?(@scope)
  289.     end
  290.     def for_random?
  291.       return [4, 5, 6].include?(@scope)
  292.     end
  293.     def for_all?
  294.       return [2, 8, 10].include?(@scope)
  295.     end
  296.     def dual?
  297.       return [3].include?(@scope)
  298.     end
  299.     def need_selection?
  300.       return [1, 3, 7, 9].include?(@scope)
  301.     end
  302.     def battle_ok?
  303.       return [0, 1].include?(@occasion)
  304.     end
  305.     def menu_ok?
  306.       return [0, 2].include?(@occasion)
  307.     end
  308.     attr_accessor :scope
  309.     attr_accessor :occasion
  310.     attr_accessor :speed
  311.     attr_accessor :animation_id
  312.     attr_accessor :common_event_id
  313.     attr_accessor :base_damage
  314.     attr_accessor :variance
  315.     attr_accessor :atk_f
  316.     attr_accessor :spi_f
  317.     attr_accessor :physical_attack
  318.     attr_accessor :damage_to_mp
  319.     attr_accessor :absorb_damage
  320.     attr_accessor :ignore_defense
  321.     attr_accessor :element_set
  322.     attr_accessor :plus_state_set
  323.     attr_accessor :minus_state_set
  324.   end
  325. end
  326. module RPG
  327.   class Item < UsableItem
  328.     def initialize
  329.       super
  330.       @scope = 7
  331.       @price = 0
  332.       @consumable = true
  333.       @hp_recovery_rate = 0
  334.       @hp_recovery = 0
  335.       @mp_recovery_rate = 0
  336.       @mp_recovery = 0
  337.       @parameter_type = 0
  338.       @parameter_points = 0
  339.     end
  340.     attr_accessor :price
  341.     attr_accessor :consumable
  342.     attr_accessor :hp_recovery_rate
  343.     attr_accessor :hp_recovery
  344.     attr_accessor :mp_recovery_rate
  345.     attr_accessor :mp_recovery
  346.     attr_accessor :parameter_type
  347.     attr_accessor :parameter_points
  348.   end
  349. end
  350. module RPG
  351.   class Skill < UsableItem
  352.     def initialize
  353.       super
  354.       @scope = 1
  355.       @mp_cost = 0
  356.       @hit = 100
  357.       @message1 = ""
  358.       @message2 = ""
  359.     end
  360.     attr_accessor :mp_cost
  361.     attr_accessor :hit
  362.     attr_accessor :message1
  363.     attr_accessor :message2
  364.   end
  365. end
  366. module RPG
  367.   class Actor
  368.     def initialize
  369.       @id = 0
  370.       @name = ""
  371.       @class_id = 1
  372.       @initial_level = 1
  373.       @exp_basis = 25
  374.       @exp_inflation = 35
  375.       @character_name = ""
  376.       @character_index = 0
  377.       @face_name = ""
  378.       @face_index = 0
  379.       @parameters = Table.new(6,100)
  380.       for i in 1..99
  381.         @parameters[0,i] = 400+i*50
  382.         @parameters[1,i] = 80+i*10
  383.         @parameters[2,i] = 15+i*5/4
  384.         @parameters[3,i] = 15+i*5/4
  385.         @parameters[4,i] = 20+i*5/2
  386.         @parameters[5,i] = 20+i*5/2
  387.       end
  388.       @weapon_id = 0
  389.       @armor1_id = 0
  390.       @armor2_id = 0
  391.       @armor3_id = 0
  392.       @armor4_id = 0
  393.       @two_swords_style = false
  394.       @fix_equipment = false
  395.       @auto_battle = false
  396.       @super_guard = false
  397.       @pharmacology = false
  398.       @critical_bonus = false
  399.     end
  400.     attr_accessor :id
  401.     attr_accessor :name
  402.     attr_accessor :class_id
  403.     attr_accessor :initial_level
  404.     attr_accessor :exp_basis
  405.     attr_accessor :exp_inflation
  406.     attr_accessor :character_name
  407.     attr_accessor :character_index
  408.     attr_accessor :face_name
  409.     attr_accessor :face_index
  410.     attr_accessor :parameters
  411.     attr_accessor :weapon_id
  412.     attr_accessor :armor1_id
  413.     attr_accessor :armor2_id
  414.     attr_accessor :armor3_id
  415.     attr_accessor :armor4_id
  416.     attr_accessor :two_swords_style
  417.     attr_accessor :fix_equipment
  418.     attr_accessor :auto_battle
  419.     attr_accessor :super_guard
  420.     attr_accessor :pharmacology
  421.     attr_accessor :critical_bonus
  422.   end
  423. end
  424. module RPG
  425.   class Enemy
  426.     def initialize
  427.       @id = 0
  428.       @name = ""
  429.       @battler_name = ""
  430.       @battler_hue = 0
  431.       @maxhp = 10
  432.       @maxmp = 10
  433.       @atk = 10
  434.       @def = 10
  435.       @spi = 10
  436.       @agi = 10
  437.       @hit = 95
  438.       @eva = 5
  439.       @exp = 0
  440.       @gold = 0
  441.       @drop_item1 = RPG::Enemy::DropItem.new
  442.       @drop_item2 = RPG::Enemy::DropItem.new
  443.       @levitate = false
  444.       @has_critical = false
  445.       @element_ranks = Table.new(1)
  446.       @state_ranks = Table.new(1)
  447.       @actions = [RPG::Enemy::Action.new]
  448.       @note = ""
  449.     end
  450.     attr_accessor :id
  451.     attr_accessor :name
  452.     attr_accessor :battler_name
  453.     attr_accessor :battler_hue
  454.     attr_accessor :maxhp
  455.     attr_accessor :maxmp
  456.     attr_accessor :atk
  457.     attr_accessor :def
  458.     attr_accessor :spi
  459.     attr_accessor :agi
  460.     attr_accessor :hit
  461.     attr_accessor :eva
  462.     attr_accessor :exp
  463.     attr_accessor :gold
  464.     attr_accessor :drop_item1
  465.     attr_accessor :drop_item2
  466.     attr_accessor :levitate
  467.     attr_accessor :has_critical
  468.     attr_accessor :element_ranks
  469.     attr_accessor :state_ranks
  470.     attr_accessor :actions
  471.     attr_accessor :note
  472.   end
  473. end
  474. module RPG
  475.   class Enemy
  476.     class Action
  477.       def initialize
  478.         @kind = 0
  479.         @basic = 0
  480.         @skill_id = 1
  481.         @condition_type = 0
  482.         @condition_param1 = 0
  483.         @condition_param2 = 0
  484.         @rating = 5
  485.       end
  486.       def skill?
  487.         return @kind == 1
  488.       end
  489.       attr_accessor :kind
  490.       attr_accessor :basic
  491.       attr_accessor :skill_id
  492.       attr_accessor :condition_type
  493.       attr_accessor :condition_param1
  494.       attr_accessor :condition_param2
  495.       attr_accessor :rating
  496.     end
  497.   end
  498. end
  499. module RPG
  500.   class Enemy
  501.     class DropItem
  502.       def initialize
  503.         @kind = 0
  504.         @item_id = 1
  505.         @weapon_id = 1
  506.         @armor_id = 1
  507.         @denominator = 1
  508.       end
  509.       attr_accessor :kind
  510.       attr_accessor :item_id
  511.       attr_accessor :weapon_id
  512.       attr_accessor :armor_id
  513.       attr_accessor :denominator
  514.     end
  515.   end
  516. end
  517. module RPG
  518.   class Class
  519.     def initialize
  520.       @id = 0
  521.       @name = ""
  522.       @position = 0
  523.       @weapon_set = []
  524.       @armor_set = []
  525.       @element_ranks = Table.new(1)
  526.       @state_ranks = Table.new(1)
  527.       @learnings = []
  528.       @skill_name_valid = false
  529.       @skill_name = ""
  530.     end
  531.     attr_accessor :id
  532.     attr_accessor :name
  533.     attr_accessor :position
  534.     attr_accessor :weapon_set
  535.     attr_accessor :armor_set
  536.     attr_accessor :element_ranks
  537.     attr_accessor :state_ranks
  538.     attr_accessor :learnings
  539.     attr_accessor :skill_name_valid
  540.     attr_accessor :skill_name
  541.   end
  542. end
  543. module RPG
  544.   class Class
  545.     class Learning
  546.       def initialize
  547.         @level = 1
  548.         @skill_id = 1
  549.       end
  550.       attr_accessor :level
  551.       attr_accessor :skill_id
  552.     end
  553.   end
  554. end
  555. module RPG
  556.   class State
  557.     def initialize
  558.       @id = 0
  559.       @name = ""
  560.       @icon_index = 0
  561.       @restriction = 0
  562.       @priority = 5
  563.       @atk_rate = 100
  564.       @def_rate = 100
  565.       @spi_rate = 100
  566.       @agi_rate = 100
  567.       @nonresistance = false
  568.       @offset_by_opposite = false
  569.       @slip_damage = false
  570.       @reduce_hit_ratio = false
  571.       @battle_only = true
  572.       @release_by_damage = false
  573.       @hold_turn = 0
  574.       @auto_release_prob = 0
  575.       @message1 = ""
  576.       @message2 = ""
  577.       @message3 = ""
  578.       @message4 = ""
  579.       @element_set = []
  580.       @state_set = []
  581.       @note = ""
  582.     end
  583.     attr_accessor :id
  584.     attr_accessor :name
  585.     attr_accessor :icon_index
  586.     attr_accessor :restriction
  587.     attr_accessor :priority
  588.     attr_accessor :atk_rate
  589.     attr_accessor :def_rate
  590.     attr_accessor :spi_rate
  591.     attr_accessor :agi_rate
  592.     attr_accessor :nonresistance
  593.     attr_accessor :offset_by_opposite
  594.     attr_accessor :slip_damage
  595.     attr_accessor :reduce_hit_ratio
  596.     attr_accessor :battle_only
  597.     attr_accessor :release_by_damage
  598.     attr_accessor :hold_turn
  599.     attr_accessor :auto_release_prob
  600.     attr_accessor :message1
  601.     attr_accessor :message2
  602.     attr_accessor :message3
  603.     attr_accessor :message4
  604.     attr_accessor :element_set
  605.     attr_accessor :state_set
  606.     attr_accessor :note
  607.   end
  608. end
  609. module RPG
  610.   class EventCommand
  611.     def initialize(code = 0, indent = 0, parameters = [])
  612.       @code = code
  613.       @indent = indent
  614.       @parameters = parameters
  615.     end
  616.     attr_accessor :code
  617.     attr_accessor :indent
  618.     attr_accessor :parameters
  619.   end
  620. end
  621. module RPG
  622.   class CommonEvent
  623.     def initialize
  624.       @id = 0
  625.       @name = ""
  626.       @trigger = 0
  627.       @switch_id = 1
  628.       @list = [RPG::EventCommand.new]
  629.     end
  630.     attr_accessor :id
  631.     attr_accessor :name
  632.     attr_accessor :trigger
  633.     attr_accessor :switch_id
  634.     attr_accessor :list
  635.   end
  636. end
  637. module RPG
  638.   class Event
  639.     def initialize(x, y)
  640.       @id = 0
  641.       @name = ""
  642.       @x = x
  643.       @y = y
  644.       @pages = [RPG::Event::Page.new]
  645.     end
  646.     attr_accessor :id
  647.     attr_accessor :name
  648.     attr_accessor :x
  649.     attr_accessor :y
  650.     attr_accessor :pages
  651.   end
  652. end
  653. module RPG
  654.   class Event
  655.     class Page
  656.       def initialize
  657.         @condition = RPG::Event::Page::Condition.new
  658.         @graphic = RPG::Event::Page::Graphic.new
  659.         @move_type = 0
  660.         @move_speed = 3
  661.         @move_frequency = 3
  662.         @move_route = RPG::MoveRoute.new
  663.         @walk_anime = true
  664.         @step_anime = false
  665.         @direction_fix = false
  666.         @through = false
  667.         @priority_type = 0
  668.         @trigger = 0
  669.         @list = [RPG::EventCommand.new]
  670.       end
  671.       attr_accessor :condition
  672.       attr_accessor :graphic
  673.       attr_accessor :move_type
  674.       attr_accessor :move_speed
  675.       attr_accessor :move_frequency
  676.       attr_accessor :move_route
  677.       attr_accessor :walk_anime
  678.       attr_accessor :step_anime
  679.       attr_accessor :direction_fix
  680.       attr_accessor :through
  681.       attr_accessor :priority_type
  682.       attr_accessor :trigger
  683.       attr_accessor :list
  684.     end
  685.   end
  686. end
  687. module RPG
  688.   class Event
  689.     class Page
  690.       class Condition
  691.         def initialize
  692.           @switch1_valid = false
  693.           @switch2_valid = false
  694.           @variable_valid = false
  695.           @self_switch_valid = false
  696.           @item_valid = false
  697.           @actor_valid = false
  698.           @switch1_id = 1
  699.           @switch2_id = 1
  700.           @variable_id = 1
  701.           @variable_value = 0
  702.           @self_switch_ch = "A"
  703.           @item_id = 1
  704.           @actor_id = 1
  705.         end
  706.         attr_accessor :switch1_valid
  707.         attr_accessor :switch2_valid
  708.         attr_accessor :variable_valid
  709.         attr_accessor :self_switch_valid
  710.         attr_accessor :item_valid
  711.         attr_accessor :actor_valid
  712.         attr_accessor :switch1_id
  713.         attr_accessor :switch2_id
  714.         attr_accessor :variable_id
  715.         attr_accessor :variable_value
  716.         attr_accessor :self_switch_ch
  717.         attr_accessor :item_id
  718.         attr_accessor :actor_id
  719.       end
  720.     end
  721.   end
  722. end
  723. module RPG
  724.   class Event
  725.     class Page
  726.       class Graphic
  727.         def initialize
  728.           @tile_id = 0
  729.           @character_name = ""
  730.           @character_index = 0
  731.           @direction = 2
  732.           @pattern = 0
  733.         end
  734.         attr_accessor :tile_id
  735.         attr_accessor :character_name
  736.         attr_accessor :character_index
  737.         attr_accessor :direction
  738.         attr_accessor :pattern
  739.       end
  740.     end
  741.   end
  742. end
  743. module RPG
  744.   class MoveCommand
  745.     def initialize(code = 0, parameters = [])
  746.       @code = code
  747.       @parameters = parameters
  748.     end
  749.     attr_accessor :code
  750.     attr_accessor :parameters
  751.   end
  752. end
  753. module RPG
  754.   class MoveRoute
  755.     def initialize
  756.       @repeat = true
  757.       @skippable = false
  758.       @wait = false
  759.       @list = [RPG::MoveCommand.new]
  760.     end
  761.     attr_accessor :repeat
  762.     attr_accessor :skippable
  763.     attr_accessor :wait
  764.     attr_accessor :list
  765.   end
  766. end
  767. module RPG
  768.   class Map
  769.     def initialize(width, height)
  770.       @width = width
  771.       @height = height
  772.       @scroll_type = 0
  773.       @autoplay_bgm = false
  774.       @bgm = RPG::AudioFile.new
  775.       @autoplay_bgs = false
  776.       @bgs = RPG::AudioFile.new("", 80)
  777.       @disable_dashing = false
  778.       @encounter_list = []
  779.       @encounter_step = 30
  780.       @parallax_name = ""
  781.       @parallax_loop_x = false
  782.       @parallax_loop_y = false
  783.       @parallax_sx = 0
  784.       @parallax_sy = 0
  785.       @parallax_show = false
  786.       # // NOTE - RGSS3 tilemap needs 4 layers, you'll get weird Shadow errors otherwise
  787.       @data = Table.new(width, height, 4)
  788.       @events = {}
  789.     end
  790.     attr_accessor :width
  791.     attr_accessor :height
  792.     attr_accessor :scroll_type
  793.     attr_accessor :autoplay_bgm
  794.     attr_accessor :bgm
  795.     attr_accessor :autoplay_bgs
  796.     attr_accessor :bgs
  797.     attr_accessor :disable_dashing
  798.     attr_accessor :encounter_list
  799.     attr_accessor :encounter_step
  800.     attr_accessor :parallax_name
  801.     attr_accessor :parallax_loop_x
  802.     attr_accessor :parallax_loop_y
  803.     attr_accessor :parallax_sx
  804.     attr_accessor :parallax_sy
  805.     attr_accessor :parallax_show
  806.     attr_accessor :data
  807.     attr_accessor :events
  808.   end
  809. end
  810. module RPG
  811.   class MapInfo
  812.     def initialize
  813.       @name = ""
  814.       @parent_id = 0
  815.       @order = 0
  816.       @expanded = false
  817.       @scroll_x = 0
  818.       @scroll_y = 0
  819.     end
  820.     attr_accessor :name
  821.     attr_accessor :parent_id
  822.     attr_accessor :order
  823.     attr_accessor :expanded
  824.     attr_accessor :scroll_x
  825.     attr_accessor :scroll_y
  826.   end
  827. end
  828. module RPG
  829.   class Troop
  830.     def initialize
  831.       @id = 0
  832.       @name = ""
  833.       @members = []
  834.       @pages = [RPG::BattleEventPage.new]
  835.     end
  836.     attr_accessor :id
  837.     attr_accessor :name
  838.     attr_accessor :members
  839.     attr_accessor :pages
  840.   end
  841. end
  842. module RPG
  843.   class Troop
  844.     class Member
  845.       def initialize
  846.         @enemy_id = 1
  847.         @x = 0
  848.         @y = 0
  849.         @hidden = false
  850.         @immortal = false
  851.       end
  852.       attr_accessor :enemy_id
  853.       attr_accessor :x
  854.       attr_accessor :y
  855.       attr_accessor :hidden
  856.       attr_accessor :immortal
  857.     end
  858.   end
  859. end
  860. module RPG
  861.   class Troop
  862.     class Page
  863.       def initialize
  864.         @condition = RPG::Troop::Page::Condition.new
  865.         @span = 0
  866.         @list = [RPG::EventCommand.new]
  867.       end
  868.       attr_accessor :condition
  869.       attr_accessor :span
  870.       attr_accessor :list
  871.     end
  872.   end
  873. end
  874. module RPG
  875.   class Troop
  876.     class Page
  877.       class Condition
  878.         def initialize
  879.           @turn_ending = false
  880.           @turn_valid = false
  881.           @enemy_valid = false
  882.           @actor_valid = false
  883.           @switch_valid = false
  884.           @turn_a = 0
  885.           @turn_b = 0
  886.           @enemy_index = 0
  887.           @enemy_hp = 50
  888.           @actor_id = 1
  889.           @actor_hp = 50
  890.           @switch_id = 1
  891.         end
  892.         attr_accessor :turn_ending
  893.         attr_accessor :turn_valid
  894.         attr_accessor :enemy_valid
  895.         attr_accessor :actor_valid
  896.         attr_accessor :switch_valid
  897.         attr_accessor :turn_a
  898.         attr_accessor :turn_b
  899.         attr_accessor :enemy_index
  900.         attr_accessor :enemy_hp
  901.         attr_accessor :actor_id
  902.         attr_accessor :actor_hp
  903.         attr_accessor :switch_id
  904.       end
  905.     end
  906.   end
  907. end
  908. module RPG
  909.   class System
  910.     def initialize
  911.       @game_title = ""
  912.       @version_id = 0
  913.       @party_members = [1]
  914.       @elements = [nil, ""]
  915.       @switches = [nil, ""]
  916.       @variables = [nil, ""]
  917.       @passages = Table.new(8192)
  918.       @boat = RPG::System::Vehicle.new
  919.       @ship = RPG::System::Vehicle.new
  920.       @airship = RPG::System::Vehicle.new
  921.       @title_bgm = RPG::BGM.new
  922.       @battle_bgm = RPG::BGM.new
  923.       @battle_end_me = RPG::ME.new
  924.       @gameover_me = RPG::ME.new
  925.       @sounds = []
  926.       20.times { @sounds.push(RPG::AudioFile.new) }
  927.       @test_battlers = []
  928.       @test_troop_id = 1
  929.       @start_map_id = 1
  930.       @start_x = 0
  931.       @start_y = 0
  932.       @terms = RPG::System::Terms.new
  933.       @battler_name = ""
  934.       @battler_hue = 0
  935.       @edit_map_id = 1
  936.     end
  937.     attr_accessor :game_title
  938.     attr_accessor :version_id
  939.     attr_accessor :party_members
  940.     attr_accessor :elements
  941.     attr_accessor :switches
  942.     attr_accessor :variables
  943.     attr_accessor :passages
  944.     attr_accessor :boat
  945.     attr_accessor :ship
  946.     attr_accessor :airship
  947.     attr_accessor :title_bgm
  948.     attr_accessor :battle_bgm
  949.     attr_accessor :battle_end_me
  950.     attr_accessor :gameover_me
  951.     attr_accessor :sounds
  952.     attr_accessor :test_battlers
  953.     attr_accessor :test_troop_id
  954.     attr_accessor :start_map_id
  955.     attr_accessor :start_x
  956.     attr_accessor :start_y
  957.     attr_accessor :terms
  958.     attr_accessor :battler_name
  959.     attr_accessor :battler_hue
  960.     attr_accessor :edit_map_id
  961.   end
  962. end
  963. module RPG
  964.   class System
  965.     class Terms
  966.       def initialize
  967.         @level = ""
  968.         @level_a = ""
  969.         @hp = ""
  970.         @hp_a = ""
  971.         @mp = ""
  972.         @mp_a = ""
  973.         @atk = ""
  974.         @def = ""
  975.         @spi = ""
  976.         @agi = ""
  977.         @weapon = ""
  978.         @armor1 = ""
  979.         @armor2 = ""
  980.         @armor3 = ""
  981.         @armor4 = ""
  982.         @weapon1 = ""
  983.         @weapon2 = ""
  984.         @attack = ""
  985.         @skill = ""
  986.         @guard = ""
  987.         @item = ""
  988.         @equip = ""
  989.         @status = ""
  990.         @save = ""
  991.         @game_end = ""
  992.         @fight = ""
  993.         @escape = ""
  994.         @new_game = ""
  995.         @continue = ""
  996.         @shutdown = ""
  997.         @to_title = ""
  998.         @cancel = ""
  999.         @gold = ""
  1000.       end
  1001.       attr_accessor :level
  1002.       attr_accessor :level_a
  1003.       attr_accessor :hp
  1004.       attr_accessor :hp_a
  1005.       attr_accessor :mp
  1006.       attr_accessor :mp_a
  1007.       attr_accessor :atk
  1008.       attr_accessor :def
  1009.       attr_accessor :spi
  1010.       attr_accessor :agi
  1011.       attr_accessor :weapon
  1012.       attr_accessor :armor1
  1013.       attr_accessor :armor2
  1014.       attr_accessor :armor3
  1015.       attr_accessor :armor4
  1016.       attr_accessor :weapon1
  1017.       attr_accessor :weapon2
  1018.       attr_accessor :attack
  1019.       attr_accessor :skill
  1020.       attr_accessor :guard
  1021.       attr_accessor :item
  1022.       attr_accessor :equip
  1023.       attr_accessor :status
  1024.       attr_accessor :save
  1025.       attr_accessor :game_end
  1026.       attr_accessor :fight
  1027.       attr_accessor :escape
  1028.       attr_accessor :new_game
  1029.       attr_accessor :continue
  1030.       attr_accessor :shutdown
  1031.       attr_accessor :to_title
  1032.       attr_accessor :cancel
  1033.       attr_accessor :gold
  1034.     end
  1035.   end
  1036. end
  1037. module RPG
  1038.   class System
  1039.     class TestBattler
  1040.       def initialize
  1041.         @actor_id = 1
  1042.         @level = 1
  1043.         @weapon_id = 0
  1044.         @armor1_id = 0
  1045.         @armor2_id = 0
  1046.         @armor3_id = 0
  1047.         @armor4_id = 0
  1048.       end
  1049.       attr_accessor :actor_id
  1050.       attr_accessor :level
  1051.       attr_accessor :weapon_id
  1052.       attr_accessor :armor1_id
  1053.       attr_accessor :armor2_id
  1054.       attr_accessor :armor3_id
  1055.       attr_accessor :armor4_id
  1056.     end
  1057.   end
  1058. end
  1059. module RPG
  1060.   class System
  1061.     class Vehicle
  1062.       def initialize
  1063.         @character_name = ""
  1064.         @character_index = 0
  1065.         @bgm = RPG::AudioFile.new
  1066.         @start_map_id = 0
  1067.         @start_x = 0
  1068.         @start_y = 0
  1069.       end
  1070.       attr_accessor :character_name
  1071.       attr_accessor :character_index
  1072.       attr_accessor :bgm
  1073.       attr_accessor :start_map_id
  1074.       attr_accessor :start_x
  1075.       attr_accessor :start_y
  1076.     end
  1077.   end
  1078. end
Advertisement
Add Comment
Please, Sign In to add comment