IceDragon200

[VXA]RGSS3-Library

Jun 20th, 2012
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 21.18 KB | None | 0 0
  1. class RPG::AudioFile
  2.   def initialize(name = '', volume = 100, pitch = 100)
  3.     @name = name
  4.     @volume = volume
  5.     @pitch = pitch
  6.   end
  7.   attr_accessor :name
  8.   attr_accessor :volume
  9.   attr_accessor :pitch
  10. end
  11.  
  12.  
  13. class RPG::BGM < RPG::AudioFile
  14.   @@last = RPG::BGM.new
  15.   def play(pos = 0)
  16.     if @name.empty?
  17.       Audio.bgm_stop
  18.       @@last = RPG::BGM.new
  19.     else
  20.       Audio.bgm_play('Audio/BGM/' + @name, @volume, @pitch, pos)
  21.       @@last = self.clone
  22.     end
  23.   end
  24.   def replay
  25.     play(@pos)
  26.   end
  27.   def self.stop
  28.     Audio.bgm_stop
  29.     @@last = RPG::BGM.new
  30.   end
  31.   def self.fade(time)
  32.     Audio.bgm_fade(time)
  33.     @@last = RPG::BGM.new
  34.   end
  35.   def self.last
  36.     @@last.pos = Audio.bgm_pos
  37.     @@last
  38.   end
  39.   attr_accessor :pos
  40. end
  41.  
  42.  
  43. class RPG::BGS < RPG::AudioFile
  44.   @@last = RPG::BGS.new
  45.   def play(pos = 0)
  46.     if @name.empty?
  47.       Audio.bgs_stop
  48.       @@last = RPG::BGS.new
  49.     else
  50.       Audio.bgs_play('Audio/BGS/' + @name, @volume, @pitch, pos)
  51.       @@last = self.clone
  52.     end
  53.   end
  54.   def replay
  55.     play(@pos)
  56.   end
  57.   def self.stop
  58.     Audio.bgs_stop
  59.     @@last = RPG::BGS.new
  60.   end
  61.   def self.fade(time)
  62.     Audio.bgs_fade(time)
  63.     @@last = RPG::BGS.new
  64.   end
  65.   def self.last
  66.     @@last.pos = Audio.bgs_pos
  67.     @@last
  68.   end
  69.   attr_accessor :pos
  70. end
  71.  
  72.  
  73. class RPG::ME < RPG::AudioFile
  74.   def play
  75.     if @name.empty?
  76.       Audio.me_stop
  77.     else
  78.       Audio.me_play('Audio/ME/' + @name, @volume, @pitch)
  79.     end
  80.   end
  81.   def self.stop
  82.     Audio.me_stop
  83.   end
  84.   def self.fade(time)
  85.     Audio.me_fade(time)
  86.   end
  87. end
  88.  
  89.  
  90. class RPG::SE < RPG::AudioFile
  91.   def play
  92.     unless @name.empty?
  93.       Audio.se_play('Audio/SE/' + @name, @volume, @pitch)
  94.     end
  95.   end
  96.   def self.stop
  97.     Audio.se_stop
  98.   end
  99. end
  100.  
  101.  
  102. class RPG::Tileset
  103.   def initialize
  104.     @id = 0
  105.     @mode = 1
  106.     @name = ''
  107.     @tileset_names = Array.new(9).collect{''}
  108.     @flags = Table.new(8192)
  109.     @flags[0] = 0x0010
  110.     (2048..2815).each {|i| @flags[i] = 0x000F}
  111.     (4352..8191).each {|i| @flags[i] = 0x000F}
  112.     @note = ''
  113.   end
  114.   attr_accessor :id
  115.   attr_accessor :mode
  116.   attr_accessor :name
  117.   attr_accessor :tileset_names
  118.   attr_accessor :flags
  119.   attr_accessor :note
  120. end  
  121. class RPG::Map
  122.   def initialize(width, height)
  123.     @display_name = ''
  124.     @tileset_id = 1
  125.     @width = width
  126.     @height = height
  127.     @scroll_type = 0
  128.     @specify_battleback = false
  129.     @battleback_floor_name = ''
  130.     @battleback_wall_name = ''
  131.     @autoplay_bgm = false
  132.     @bgm = RPG::BGM.new
  133.     @autoplay_bgs = false
  134.     @bgs = RPG::BGS.new('', 80)
  135.     @disable_dashing = false
  136.     @encounter_list = []
  137.     @encounter_step = 30
  138.     @parallax_name = ''
  139.     @parallax_loop_x = false
  140.     @parallax_loop_y = false
  141.     @parallax_sx = 0
  142.     @parallax_sy = 0
  143.     @parallax_show = false
  144.     @note = ''
  145.     @data = Table.new(width, height, 4)
  146.     @events = {}
  147.   end
  148.   attr_accessor :display_name
  149.   attr_accessor :tileset_id
  150.   attr_accessor :width
  151.   attr_accessor :height
  152.   attr_accessor :scroll_type
  153.   attr_accessor :specify_battleback
  154.   attr_accessor :battleback1_name
  155.   attr_accessor :battleback2_name
  156.   attr_accessor :autoplay_bgm
  157.   attr_accessor :bgm
  158.   attr_accessor :autoplay_bgs
  159.   attr_accessor :bgs
  160.   attr_accessor :disable_dashing
  161.   attr_accessor :encounter_list
  162.   attr_accessor :encounter_step
  163.   attr_accessor :parallax_name
  164.   attr_accessor :parallax_loop_x
  165.   attr_accessor :parallax_loop_y
  166.   attr_accessor :parallax_sx
  167.   attr_accessor :parallax_sy
  168.   attr_accessor :parallax_show
  169.   attr_accessor :note
  170.   attr_accessor :data
  171.   attr_accessor :events
  172. end
  173.  
  174. class RPG::Map::Encounter
  175.   def initialize
  176.     @troop_id = 1
  177.     @weight = 10
  178.     @region_set = []
  179.   end
  180.   attr_accessor :troop_id
  181.   attr_accessor :weight
  182.   attr_accessor :region_set
  183. end
  184.  
  185.  
  186. class RPG::MapInfo
  187.   def initialize
  188.     @name = ''
  189.     @parent_id = 0
  190.     @order = 0
  191.     @expanded = false
  192.     @scroll_x = 0
  193.     @scroll_y = 0
  194.   end
  195.   attr_accessor :name
  196.   attr_accessor :parent_id
  197.   attr_accessor :order
  198.   attr_accessor :expanded
  199.   attr_accessor :scroll_x
  200.   attr_accessor :scroll_y
  201. end
  202.  
  203.  
  204. class RPG::Event
  205.   def initialize(x, y)
  206.     @id = 0
  207.     @name = ''
  208.     @x = x
  209.     @y = y
  210.     @pages = [RPG::Event::Page.new]
  211.   end
  212.   attr_accessor :id
  213.   attr_accessor :name
  214.   attr_accessor :x
  215.   attr_accessor :y
  216.   attr_accessor :pages
  217. end
  218.  
  219.  
  220. class RPG::Event::Page
  221.   def initialize
  222.     @condition = RPG::Event::Page::Condition.new
  223.     @graphic = RPG::Event::Page::Graphic.new
  224.     @move_type = 0
  225.     @move_speed = 3
  226.     @move_frequency = 3
  227.     @move_route = RPG::MoveRoute.new
  228.     @walk_anime = true
  229.     @step_anime = false
  230.     @direction_fix = false
  231.     @through = false
  232.     @priority_type = 0
  233.     @trigger = 0
  234.     @list = [RPG::EventCommand.new]
  235.   end
  236.   attr_accessor :condition
  237.   attr_accessor :graphic
  238.   attr_accessor :move_type
  239.   attr_accessor :move_speed
  240.   attr_accessor :move_frequency
  241.   attr_accessor :move_route
  242.   attr_accessor :walk_anime
  243.   attr_accessor :step_anime
  244.   attr_accessor :direction_fix
  245.   attr_accessor :through
  246.   attr_accessor :priority_type
  247.   attr_accessor :trigger
  248.   attr_accessor :list
  249. end
  250.  
  251.  
  252. class RPG::Event::Page::Condition
  253.   def initialize
  254.     @switch1_valid = false
  255.     @switch2_valid = false
  256.     @variable_valid = false
  257.     @self_switch_valid = false
  258.     @item_valid = false
  259.     @actor_valid = false
  260.     @switch1_id = 1
  261.     @switch2_id = 1
  262.     @variable_id = 1
  263.     @variable_value = 0
  264.     @self_switch_ch = 'A'
  265.     @item_id = 1
  266.     @actor_id = 1
  267.   end
  268.   attr_accessor :switch1_valid
  269.   attr_accessor :switch2_valid
  270.   attr_accessor :variable_valid
  271.   attr_accessor :self_switch_valid
  272.   attr_accessor :item_valid
  273.   attr_accessor :actor_valid
  274.   attr_accessor :switch1_id
  275.   attr_accessor :switch2_id
  276.   attr_accessor :variable_id
  277.   attr_accessor :variable_value
  278.   attr_accessor :self_switch_ch
  279.   attr_accessor :item_id
  280.   attr_accessor :actor_id
  281. end
  282.  
  283.  
  284. class RPG::Event::Page::Graphic
  285.   def initialize
  286.     @tile_id = 0
  287.     @character_name = ''
  288.     @character_index = 0
  289.     @direction = 2
  290.     @pattern = 0
  291.   end
  292.   attr_accessor :tile_id
  293.   attr_accessor :character_name
  294.   attr_accessor :character_index
  295.   attr_accessor :direction
  296.   attr_accessor :pattern
  297. end
  298.  
  299.  
  300. class RPG::EventCommand
  301.   def initialize(code = 0, indent = 0, parameters = [])
  302.     @code = code
  303.     @indent = indent
  304.     @parameters = parameters
  305.   end
  306.   attr_accessor :code
  307.   attr_accessor :indent
  308.   attr_accessor :parameters
  309. end
  310.  
  311.  
  312. class RPG::MoveRoute
  313.   def initialize
  314.     @repeat = true
  315.     @skippable = false
  316.     @wait = false
  317.     @list = [RPG::MoveCommand.new]
  318.   end
  319.   attr_accessor :repeat
  320.   attr_accessor :skippable
  321.   attr_accessor :wait
  322.   attr_accessor :list
  323. end
  324. class RPG::MoveCommand
  325.   def initialize(code = 0, parameters = [])
  326.     @code = code
  327.     @parameters = parameters
  328.   end
  329.   attr_accessor :code
  330.   attr_accessor :parameters
  331. end
  332.  
  333.  
  334. class RPG::CommonEvent
  335.   def initialize
  336.     @id = 0
  337.     @name = ''
  338.     @trigger = 0
  339.     @switch_id = 1
  340.     @list = [RPG::EventCommand.new]
  341.   end
  342.   def autorun?
  343.     @trigger == 1
  344.   end
  345.   def parallel?
  346.     @trigger == 2
  347.   end
  348.   attr_accessor :id
  349.   attr_accessor :name
  350.   attr_accessor :trigger
  351.   attr_accessor :switch_id
  352.   attr_accessor :list
  353. end
  354. class RPG::BaseItem
  355.   def initialize
  356.     @id = 0
  357.     @name = ''
  358.     @icon_index = 0
  359.     @description = ''
  360.     @features = []
  361.     @note = ''
  362.   end
  363.   attr_accessor :id
  364.   attr_accessor :name
  365.   attr_accessor :icon_index
  366.   attr_accessor :description
  367.   attr_accessor :features
  368.   attr_accessor :note
  369. end
  370.  
  371.  
  372. class RPG::BaseItem::Feature
  373.   def initialize(code = 0, data_id = 0, value = 0)
  374.     @code = code
  375.     @data_id = data_id
  376.     @value = value
  377.   end
  378.   attr_accessor :code
  379.   attr_accessor :data_id
  380.   attr_accessor :value
  381. end
  382.  
  383.  
  384. class RPG::Actor < RPG::BaseItem
  385.   def initialize
  386.     super
  387.     @nickname = ''
  388.     @class_id = 1
  389.     @initial_level = 1
  390.     @max_level = 99
  391.     @character_name = ''
  392.     @character_index = 0
  393.     @face_name = ''
  394.     @face_index = 0
  395.     @equips = [0,0,0,0,0]
  396.   end
  397.   attr_accessor :nickname
  398.   attr_accessor :class_id
  399.   attr_accessor :initial_level
  400.   attr_accessor :max_level
  401.   attr_accessor :character_name
  402.   attr_accessor :character_index
  403.   attr_accessor :face_name
  404.   attr_accessor :face_index
  405.   attr_accessor :equips
  406. end
  407. class RPG::Class < RPG::BaseItem
  408.   def initialize
  409.     super
  410.     @exp_params = [30,20,30,30]
  411.     @params = Table.new(8,100)
  412.     (1..99).each do |i|
  413.       @params[0,i] = 400+i*50
  414.       @params[1,i] = 80+i*10
  415.       (2..5).each {|j| @params[j,i] = 15+i*5/4 }
  416.       (6..7).each {|j| @params[j,i] = 30+i*5/2 }
  417.     end
  418.     @learnings = []
  419.     @features.push(RPG::BaseItem::Feature.new(23, 0, 1))
  420.     @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
  421.     @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
  422.     @features.push(RPG::BaseItem::Feature.new(22, 2, 0.04))
  423.     @features.push(RPG::BaseItem::Feature.new(41, 1))
  424.     @features.push(RPG::BaseItem::Feature.new(51, 1))
  425.     @features.push(RPG::BaseItem::Feature.new(52, 1))
  426.   end
  427.   def exp_for_level(level)
  428.     lv = level.to_f
  429.     basis = @exp_params[0].to_f
  430.     extra = @exp_params[1].to_f
  431.     acc_a = @exp_params[2].to_f
  432.     acc_b = @exp_params[3].to_f
  433.     return (basis*((lv-1)**(0.9+acc_a/250))*lv*(lv+1)/
  434.       (6+lv**2/50/acc_b)+(lv-1)*extra).round.to_i
  435.   end
  436.   attr_accessor :exp_params
  437.   attr_accessor :params
  438.   attr_accessor :learnings
  439. end
  440.  
  441.  
  442. class RPG::Class::Learning
  443.   def initialize
  444.     @level = 1
  445.     @skill_id = 1
  446.     @note = ''
  447.   end
  448.   attr_accessor :level
  449.   attr_accessor :skill_id
  450.   attr_accessor :note
  451. end
  452.  
  453.  
  454. class RPG::UsableItem < RPG::BaseItem
  455.   def initialize
  456.     super
  457.     @scope = 0
  458.     @occasion = 0
  459.     @speed = 0
  460.     @success_rate = 100
  461.     @repeats = 1
  462.     @tp_gain = 0
  463.     @hit_type = 0
  464.     @animation_id = 0
  465.     @damage = RPG::UsableItem::Damage.new
  466.     @effects = []
  467.   end
  468.   def for_opponent?
  469.     [1, 2, 3, 4, 5, 6].include?(@scope)
  470.   end
  471.   def for_friend?
  472.     [7, 8, 9, 10, 11].include?(@scope)
  473.   end
  474.   def for_dead_friend?
  475.     [9, 10].include?(@scope)
  476.   end
  477.   def for_user?
  478.     @scope == 11
  479.   end
  480.   def for_one?
  481.     [1, 3, 7, 9, 11].include?(@scope)
  482.   end
  483.   def for_random?
  484.     [3, 4, 5, 6].include?(@scope)
  485.   end
  486.   def number_of_targets
  487.     for_random? ? @scope - 2 : 0
  488.   end
  489.   def for_all?
  490.     [2, 8, 10].include?(@scope)
  491.   end
  492.   def need_selection?
  493.     [1, 7, 9].include?(@scope)
  494.   end
  495.   def battle_ok?
  496.     [0, 1].include?(@occasion)
  497.   end
  498.   def menu_ok?
  499.     [0, 2].include?(@occasion)
  500.   end
  501.   def certain?
  502.     @hit_type == 0
  503.   end
  504.   def physical?
  505.     @hit_type == 1
  506.   end
  507.   def magical?
  508.     @hit_type == 2
  509.   end
  510.   attr_accessor :scope
  511.   attr_accessor :occasion
  512.   attr_accessor :speed
  513.   attr_accessor :animation_id
  514.   attr_accessor :success_rate
  515.   attr_accessor :repeats
  516.   attr_accessor :tp_gain
  517.   attr_accessor :hit_type
  518.   attr_accessor :damage
  519.   attr_accessor :effects
  520. end
  521.  
  522.  
  523. class RPG::UsableItem::Damage
  524.   def initialize
  525.     @type = 0
  526.     @element_id = 0
  527.     @formula = '0'
  528.     @variance = 20
  529.     @critical = false
  530.   end
  531.   def none?
  532.     @type == 0
  533.   end
  534.   def to_hp?
  535.     [1,3,5].include?(@type)
  536.   end
  537.   def to_mp?
  538.     [2,4,6].include?(@type)
  539.   end
  540.   def recover?
  541.     [3,4].include?(@type)
  542.   end
  543.   def drain?
  544.     [5,6].include?(@type)
  545.   end
  546.   def sign
  547.     recover? ? -1 : 1
  548.   end
  549.   def eval(a, b, v)
  550.     [Kernel.eval(@formula), 0].max * sign rescue 0
  551.   end
  552.   attr_accessor :type
  553.   attr_accessor :element_id
  554.   attr_accessor :formula
  555.   attr_accessor :variance
  556.   attr_accessor :critical
  557. end
  558.  
  559.  
  560. class RPG::UsableItem::Effect
  561.   def initialize(code = 0, data_id = 0, value1 = 0, value2 = 0)
  562.     @code = code
  563.     @data_id = data_id
  564.     @value1 = value1
  565.     @value2 = value2
  566.   end
  567.   attr_accessor :code
  568.   attr_accessor :data_id
  569.   attr_accessor :value1
  570.   attr_accessor :value2
  571. end
  572.  
  573.  
  574. class RPG::Skill < RPG::UsableItem
  575.   def initialize
  576.     super
  577.     @scope = 1
  578.     @stype_id = 1
  579.     @mp_cost = 0
  580.     @tp_cost = 0
  581.     @message1 = ''
  582.     @message2 = ''
  583.     @required_wtype_id1 = 0
  584.     @required_wtype_id2 = 0
  585.   end
  586.   attr_accessor :stype_id
  587.   attr_accessor :mp_cost
  588.   attr_accessor :tp_cost
  589.   attr_accessor :message1
  590.   attr_accessor :message2
  591.   attr_accessor :required_wtype_id1
  592.   attr_accessor :required_wtype_id2
  593. end
  594. class RPG::Item < RPG::UsableItem
  595.   def initialize
  596.     super
  597.     @scope = 7
  598.     @itype_id = 1
  599.     @price = 0
  600.     @consumable = true
  601.   end
  602.   def key_item?
  603.     @itype_id == 2
  604.   end
  605.   attr_accessor :itype_id
  606.   attr_accessor :price
  607.   attr_accessor :consumable
  608. end
  609.  
  610.  
  611. class RPG::EquipItem < RPG::BaseItem
  612.   def initialize
  613.     super
  614.     @price = 0
  615.     @etype_id = 0
  616.     @params = [0] * 8
  617.   end
  618.   attr_accessor :price
  619.   attr_accessor :etype_id
  620.   attr_accessor :params
  621. end
  622. class RPG::Weapon < RPG::EquipItem
  623.   def initialize
  624.     super
  625.     @wtype_id = 0
  626.     @animation_id = 0
  627.     @features.push(RPG::BaseItem::Feature.new(31, 1, 0))
  628.     @features.push(RPG::BaseItem::Feature.new(22, 0, 0))
  629.   end
  630.   def performance
  631.     params[2] + params[4] + params.inject(0) {|r, v| r += v }
  632.   end
  633.   attr_accessor :wtype_id
  634.   attr_accessor :animation_id
  635. end
  636.  
  637.  
  638. class RPG::Armor < RPG::EquipItem
  639.   def initialize
  640.     super
  641.     @atype_id = 0
  642.     @etype_id = 1
  643.     @features.push(RPG::BaseItem::Feature.new(22, 1, 0))
  644.   end
  645.   def performance
  646.     params[3] + params[5] + params.inject(0) {|r, v| r += v }
  647.   end
  648.   attr_accessor :atype_id
  649. end
  650.  
  651.  
  652. class RPG::Enemy < RPG::BaseItem
  653.   def initialize
  654.     super
  655.     @battler_name = ''
  656.     @battler_hue = 0
  657.     @params = [100,0,10,10,10,10,10,10]
  658.     @exp = 0
  659.     @gold = 0
  660.     @drop_items = Array.new(3) { RPG::Enemy::DropItem.new }
  661.     @actions = [RPG::Enemy::Action.new]
  662.     @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
  663.     @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
  664.     @features.push(RPG::BaseItem::Feature.new(31, 1, 0))
  665.   end
  666.   attr_accessor :battler_name
  667.   attr_accessor :battler_hue
  668.   attr_accessor :params
  669.   attr_accessor :exp
  670.   attr_accessor :gold
  671.   attr_accessor :drop_items
  672.   attr_accessor :actions
  673. end
  674.  
  675.  
  676. class RPG::Enemy::DropItem
  677.   def initialize
  678.     @kind = 0
  679.     @data_id = 1
  680.     @denominator = 1
  681.   end
  682.   attr_accessor :kind
  683.   attr_accessor :data_id
  684.   attr_accessor :denominator
  685. end
  686.  
  687.  
  688. class RPG::Enemy::Action
  689.   def initialize
  690.     @skill_id = 1
  691.     @condition_type = 0
  692.     @condition_param1 = 0
  693.     @condition_param2 = 0
  694.     @rating = 5
  695.   end
  696.   attr_accessor :skill_id
  697.   attr_accessor :condition_type
  698.   attr_accessor :condition_param1
  699.   attr_accessor :condition_param2
  700.   attr_accessor :rating
  701. end
  702.  
  703.  
  704. class RPG::State < RPG::BaseItem
  705.   def initialize
  706.     super
  707.     @restriction = 0
  708.     @priority = 50
  709.     @remove_at_battle_end = false
  710.     @remove_by_restriction = false
  711.     @auto_removal_timing = 0
  712.     @min_turns = 1
  713.     @max_turns = 1
  714.     @remove_by_damage = false
  715.     @chance_by_damage = 100
  716.     @remove_by_walking = false
  717.     @steps_to_remove = 100
  718.     @message1 = ''
  719.     @message2 = ''
  720.     @message3 = ''
  721.     @message4 = ''
  722.   end
  723.   attr_accessor :restriction
  724.   attr_accessor :priority
  725.   attr_accessor :remove_at_battle_end
  726.   attr_accessor :remove_by_restriction
  727.   attr_accessor :auto_removal_timing
  728.   attr_accessor :min_turns
  729.   attr_accessor :max_turns
  730.   attr_accessor :remove_by_damage
  731.   attr_accessor :chance_by_damage
  732.   attr_accessor :remove_by_walking
  733.   attr_accessor :steps_to_remove
  734.   attr_accessor :message1
  735.   attr_accessor :message2
  736.   attr_accessor :message3
  737.   attr_accessor :message4
  738. end
  739.  
  740.  
  741. class RPG::Troop
  742.   def initialize
  743.     @id = 0
  744.     @name = ''
  745.     @members = []
  746.     @pages = [RPG::Troop::Page.new]
  747.   end
  748.   attr_accessor :id
  749.   attr_accessor :name
  750.   attr_accessor :members
  751.   attr_accessor :pages
  752. end
  753.  
  754.  
  755. class RPG::Troop::Member
  756.   def initialize
  757.     @enemy_id = 1
  758.     @x = 0
  759.     @y = 0
  760.     @hidden = false
  761.   end
  762.   attr_accessor :enemy_id
  763.   attr_accessor :x
  764.   attr_accessor :y
  765.   attr_accessor :hidden
  766. end
  767.  
  768.  
  769. class RPG::Troop::Page
  770.   def initialize
  771.     @condition = RPG::Troop::Page::Condition.new
  772.     @span = 0
  773.     @list = [RPG::EventCommand.new]
  774.   end
  775.   attr_accessor :condition
  776.   attr_accessor :span
  777.   attr_accessor :list
  778. end
  779.  
  780.  
  781. class RPG::Troop::Page::Condition
  782.   def initialize
  783.     @turn_ending = false
  784.     @turn_valid = false
  785.     @enemy_valid = false
  786.     @actor_valid = false
  787.     @switch_valid = false
  788.     @turn_a = 0
  789.     @turn_b = 0
  790.     @enemy_index = 0
  791.     @enemy_hp = 50
  792.     @actor_id = 1
  793.     @actor_hp = 50
  794.     @switch_id = 1
  795.   end
  796.   attr_accessor :turn_ending
  797.   attr_accessor :turn_valid
  798.   attr_accessor :enemy_valid
  799.   attr_accessor :actor_valid
  800.   attr_accessor :switch_valid
  801.   attr_accessor :turn_a
  802.   attr_accessor :turn_b
  803.   attr_accessor :enemy_index
  804.   attr_accessor :enemy_hp
  805.   attr_accessor :actor_id
  806.   attr_accessor :actor_hp
  807.   attr_accessor :switch_id
  808. end
  809.  
  810.  
  811. class RPG::Animation
  812.   def initialize
  813.     @id = 0
  814.     @name = ''
  815.     @animation1_name = ''
  816.     @animation1_hue = 0
  817.     @animation2_name = ''
  818.     @animation2_hue = 0
  819.     @position = 1
  820.     @frame_max = 1
  821.     @frames = [RPG::Animation::Frame.new]
  822.     @timings = []
  823.   end
  824.   def to_screen?
  825.     @position == 3
  826.   end
  827.   attr_accessor :id
  828.   attr_accessor :name
  829.   attr_accessor :animation1_name
  830.   attr_accessor :animation1_hue
  831.   attr_accessor :animation2_name
  832.   attr_accessor :animation2_hue
  833.   attr_accessor :position
  834.   attr_accessor :frame_max
  835.   attr_accessor :frames
  836.   attr_accessor :timings
  837. end
  838.  
  839.  
  840. class RPG::Animation::Frame
  841.   def initialize
  842.     @cell_max = 0
  843.     @cell_data = Table.new(0, 0)
  844.   end
  845.   attr_accessor :cell_max
  846.   attr_accessor :cell_data
  847. end
  848.  
  849.  
  850. class RPG::Animation::Timing
  851.   def initialize
  852.     @frame = 0
  853.     @se = RPG::SE.new('', 80)
  854.     @flash_scope = 0
  855.     @flash_color = Color.new(255,255,255,255)
  856.     @flash_duration = 5
  857.   end
  858.   attr_accessor :frame
  859.   attr_accessor :se
  860.   attr_accessor :flash_scope
  861.   attr_accessor :flash_color
  862.   attr_accessor :flash_duration
  863. end
  864.  
  865.  
  866. class RPG::System
  867.   def initialize
  868.     @game_title = ''
  869.     @version_id = 0
  870.     @japanese = true
  871.     @party_members = [1]
  872.     @currency_unit = ''
  873.     @elements = [nil, '']
  874.     @skill_types = [nil, '']
  875.     @weapon_types = [nil, '']
  876.     @armor_types = [nil, '']
  877.     @switches = [nil, '']
  878.     @variables = [nil, '']
  879.     @boat = RPG::System::Vehicle.new
  880.     @ship = RPG::System::Vehicle.new
  881.     @airship = RPG::System::Vehicle.new
  882.     @title1_name = ''
  883.     @title2_name = ''
  884.     @opt_draw_title = true
  885.     @opt_use_midi = false
  886.     @opt_transparent = false
  887.     @opt_followers = true
  888.     @opt_slip_death = false
  889.     @opt_floor_death = false
  890.     @opt_display_tp = true
  891.     @opt_extra_exp = false
  892.     @window_tone = Tone.new(0,0,0)
  893.     @title_bgm = RPG::BGM.new
  894.     @battle_bgm = RPG::BGM.new
  895.     @battle_end_me = RPG::ME.new
  896.     @gameover_me = RPG::ME.new
  897.     @sounds = Array.new(24) { RPG::SE.new }
  898.     @test_battlers = []
  899.     @test_troop_id = 1
  900.     @start_map_id = 1
  901.     @start_x = 0
  902.     @start_y = 0
  903.     @terms = RPG::System::Terms.new
  904.     @battleback1_name = ''
  905.     @battleback2_name = ''
  906.     @battler_name = ''
  907.     @battler_hue = 0
  908.     @edit_map_id = 1
  909.   end
  910.   attr_accessor :game_title
  911.   attr_accessor :version_id
  912.   attr_accessor :japanese
  913.   attr_accessor :party_members
  914.   attr_accessor :currency_unit
  915.   attr_accessor :skill_types
  916.   attr_accessor :weapon_types
  917.   attr_accessor :armor_types
  918.   attr_accessor :elements
  919.   attr_accessor :switches
  920.   attr_accessor :variables
  921.   attr_accessor :boat
  922.   attr_accessor :ship
  923.   attr_accessor :airship
  924.   attr_accessor :title1_name
  925.   attr_accessor :title2_name
  926.   attr_accessor :opt_draw_title
  927.   attr_accessor :opt_use_midi
  928.   attr_accessor :opt_transparent
  929.   attr_accessor :opt_followers
  930.   attr_accessor :opt_slip_death
  931.   attr_accessor :opt_floor_death
  932.   attr_accessor :opt_display_tp
  933.   attr_accessor :opt_extra_exp
  934.   attr_accessor :window_tone
  935.   attr_accessor :title_bgm
  936.   attr_accessor :battle_bgm
  937.   attr_accessor :battle_end_me
  938.   attr_accessor :gameover_me
  939.   attr_accessor :sounds
  940.   attr_accessor :test_battlers
  941.   attr_accessor :test_troop_id
  942.   attr_accessor :start_map_id
  943.   attr_accessor :start_x
  944.   attr_accessor :start_y
  945.   attr_accessor :terms
  946.   attr_accessor :battleback1_name
  947.   attr_accessor :battleback2_name
  948.   attr_accessor :battler_name
  949.   attr_accessor :battler_hue
  950.   attr_accessor :edit_map_id
  951. end
  952.  
  953.  
  954. class RPG::System::Vehicle
  955.   def initialize
  956.     @character_name = ''
  957.     @character_index = 0
  958.     @bgm = RPG::BGM.new
  959.     @start_map_id = 0
  960.     @start_x = 0
  961.     @start_y = 0
  962.   end
  963.   attr_accessor :character_name
  964.   attr_accessor :character_index
  965.   attr_accessor :bgm
  966.   attr_accessor :start_map_id
  967.   attr_accessor :start_x
  968.   attr_accessor :start_y
  969. end
  970.  
  971.  
  972. class RPG::System::Terms
  973.   def initialize
  974.     @basic = Array.new(8) {''}
  975.     @params = Array.new(8) {''}
  976.     @etypes = Array.new(5) {''}
  977.     @commands = Array.new(23) {''}
  978.   end
  979.   attr_accessor :basic
  980.   attr_accessor :params
  981.   attr_accessor :etypes
  982.   attr_accessor :commands
  983. end
  984.  
  985.  
  986. class RPG::System::TestBattler
  987.   def initialize
  988.     @actor_id = 1
  989.     @level = 1
  990.     @equips = [0,0,0,0,0]
  991.   end
  992.   attr_accessor :actor_id
  993.   attr_accessor :level
  994.   attr_accessor :equips
  995. end
Advertisement
Add Comment
Please, Sign In to add comment