rpg-maker-rgss3 1.02.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +162 -0
  3. data/Gemfile +4 -0
  4. data/README.md +34 -0
  5. data/Rakefile +3 -0
  6. data/lib/audio.rb +61 -0
  7. data/lib/bitmap.rb +81 -0
  8. data/lib/color.rb +19 -0
  9. data/lib/font.rb +46 -0
  10. data/lib/functions.rb +28 -0
  11. data/lib/graphics.rb +59 -0
  12. data/lib/input.rb +70 -0
  13. data/lib/plane.rb +39 -0
  14. data/lib/rect.rb +23 -0
  15. data/lib/rgss_error.rb +2 -0
  16. data/lib/rgss_reset.rb +2 -0
  17. data/lib/rpg.rb +48 -0
  18. data/lib/rpg/actor.rb +25 -0
  19. data/lib/rpg/animation.rb +29 -0
  20. data/lib/rpg/animation/frame.rb +12 -0
  21. data/lib/rpg/animation/timing.rb +19 -0
  22. data/lib/rpg/armor.rb +14 -0
  23. data/lib/rpg/audio_file.rb +12 -0
  24. data/lib/rpg/base_item.rb +18 -0
  25. data/lib/rpg/base_item/feature.rb +14 -0
  26. data/lib/rpg/bgm.rb +30 -0
  27. data/lib/rpg/bgs.rb +30 -0
  28. data/lib/rpg/class.rb +35 -0
  29. data/lib/rpg/class/learning.rb +14 -0
  30. data/lib/rpg/common_event.rb +22 -0
  31. data/lib/rpg/enemy.rb +24 -0
  32. data/lib/rpg/enemy/action.rb +19 -0
  33. data/lib/rpg/enemy/drop_item.rb +14 -0
  34. data/lib/rpg/equip_item.rb +13 -0
  35. data/lib/rpg/event.rb +16 -0
  36. data/lib/rpg/event/page.rb +34 -0
  37. data/lib/rpg/event/page/condition.rb +36 -0
  38. data/lib/rpg/event/page/graphic.rb +20 -0
  39. data/lib/rpg/event_command.rb +12 -0
  40. data/lib/rpg/item.rb +17 -0
  41. data/lib/rpg/map.rb +54 -0
  42. data/lib/rpg/map/encounter.rb +14 -0
  43. data/lib/rpg/map_info.rb +18 -0
  44. data/lib/rpg/me.rb +17 -0
  45. data/lib/rpg/move_command.rb +10 -0
  46. data/lib/rpg/move_route.rb +14 -0
  47. data/lib/rpg/se.rb +12 -0
  48. data/lib/rpg/skill.rb +22 -0
  49. data/lib/rpg/state.rb +37 -0
  50. data/lib/rpg/system.rb +88 -0
  51. data/lib/rpg/system/terms.rb +16 -0
  52. data/lib/rpg/system/test_battler.rb +14 -0
  53. data/lib/rpg/system/vehicle.rb +20 -0
  54. data/lib/rpg/tileset.rb +21 -0
  55. data/lib/rpg/troop.rb +14 -0
  56. data/lib/rpg/troop/member.rb +16 -0
  57. data/lib/rpg/troop/page.rb +14 -0
  58. data/lib/rpg/troop/page/condition.rb +34 -0
  59. data/lib/rpg/usable_item.rb +69 -0
  60. data/lib/rpg/usable_item/damage.rb +39 -0
  61. data/lib/rpg/usable_item/effect.rb +16 -0
  62. data/lib/rpg/weapon.rb +16 -0
  63. data/lib/rpg_maker_rgss3.rb +25 -0
  64. data/lib/sprite.rb +79 -0
  65. data/lib/table.rb +31 -0
  66. data/lib/tilemap.rb +35 -0
  67. data/lib/tone.rb +19 -0
  68. data/lib/viewport.rb +37 -0
  69. data/lib/window.rb +75 -0
  70. data/rpg-maker-rgss3.gemspec +21 -0
  71. metadata +146 -0
@@ -0,0 +1,22 @@
1
+ module RPG
2
+ class Skill < UsableItem
3
+ def initialize
4
+ super
5
+ @scope = 1
6
+ @stype_id = 1
7
+ @mp_cost = 0
8
+ @tp_cost = 0
9
+ @message1 = ''
10
+ @message2 = ''
11
+ @required_wtype_id1 = 0
12
+ @required_wtype_id2 = 0
13
+ end
14
+ attr_accessor :stype_id
15
+ attr_accessor :mp_cost
16
+ attr_accessor :tp_cost
17
+ attr_accessor :message1
18
+ attr_accessor :message2
19
+ attr_accessor :required_wtype_id1
20
+ attr_accessor :required_wtype_id2
21
+ end
22
+ end
@@ -0,0 +1,37 @@
1
+ module RPG
2
+ class State < BaseItem
3
+ def initialize
4
+ super
5
+ @restriction = 0
6
+ @priority = 50
7
+ @remove_at_battle_end = false
8
+ @remove_by_restriction = false
9
+ @auto_removal_timing = 0
10
+ @min_turns = 1
11
+ @max_turns = 1
12
+ @remove_by_damage = false
13
+ @chance_by_damage = 100
14
+ @remove_by_walking = false
15
+ @steps_to_remove = 100
16
+ @message1 = ''
17
+ @message2 = ''
18
+ @message3 = ''
19
+ @message4 = ''
20
+ end
21
+ attr_accessor :restriction
22
+ attr_accessor :priority
23
+ attr_accessor :remove_at_battle_end
24
+ attr_accessor :remove_by_restriction
25
+ attr_accessor :auto_removal_timing
26
+ attr_accessor :min_turns
27
+ attr_accessor :max_turns
28
+ attr_accessor :remove_by_damage
29
+ attr_accessor :chance_by_damage
30
+ attr_accessor :remove_by_walking
31
+ attr_accessor :steps_to_remove
32
+ attr_accessor :message1
33
+ attr_accessor :message2
34
+ attr_accessor :message3
35
+ attr_accessor :message4
36
+ end
37
+ end
@@ -0,0 +1,88 @@
1
+ module RPG
2
+ class System
3
+ def initialize
4
+ @game_title = ''
5
+ @version_id = 0
6
+ @japanese = true
7
+ @party_members = [1]
8
+ @currency_unit = ''
9
+ @elements = [nil, '']
10
+ @skill_types = [nil, '']
11
+ @weapon_types = [nil, '']
12
+ @armor_types = [nil, '']
13
+ @switches = [nil, '']
14
+ @variables = [nil, '']
15
+ @boat = RPG::System::Vehicle.new
16
+ @ship = RPG::System::Vehicle.new
17
+ @airship = RPG::System::Vehicle.new
18
+ @title1_name = ''
19
+ @title2_name = ''
20
+ @opt_draw_title = true
21
+ @opt_use_midi = false
22
+ @opt_transparent = false
23
+ @opt_followers = true
24
+ @opt_slip_death = false
25
+ @opt_floor_death = false
26
+ @opt_display_tp = true
27
+ @opt_extra_exp = false
28
+ @window_tone = Tone.new(0,0,0)
29
+ @title_bgm = RPG::BGM.new
30
+ @battle_bgm = RPG::BGM.new
31
+ @battle_end_me = RPG::ME.new
32
+ @gameover_me = RPG::ME.new
33
+ @sounds = Array.new(24) { RPG::SE.new }
34
+ @test_battlers = []
35
+ @test_troop_id = 1
36
+ @start_map_id = 1
37
+ @start_x = 0
38
+ @start_y = 0
39
+ @terms = RPG::System::Terms.new
40
+ @battleback1_name = ''
41
+ @battleback2_name = ''
42
+ @battler_name = ''
43
+ @battler_hue = 0
44
+ @edit_map_id = 1
45
+ end
46
+ attr_accessor :game_title
47
+ attr_accessor :version_id
48
+ attr_accessor :japanese
49
+ attr_accessor :party_members
50
+ attr_accessor :currency_unit
51
+ attr_accessor :skill_types
52
+ attr_accessor :weapon_types
53
+ attr_accessor :armor_types
54
+ attr_accessor :elements
55
+ attr_accessor :switches
56
+ attr_accessor :variables
57
+ attr_accessor :boat
58
+ attr_accessor :ship
59
+ attr_accessor :airship
60
+ attr_accessor :title1_name
61
+ attr_accessor :title2_name
62
+ attr_accessor :opt_draw_title
63
+ attr_accessor :opt_use_midi
64
+ attr_accessor :opt_transparent
65
+ attr_accessor :opt_followers
66
+ attr_accessor :opt_slip_death
67
+ attr_accessor :opt_floor_death
68
+ attr_accessor :opt_display_tp
69
+ attr_accessor :opt_extra_exp
70
+ attr_accessor :window_tone
71
+ attr_accessor :title_bgm
72
+ attr_accessor :battle_bgm
73
+ attr_accessor :battle_end_me
74
+ attr_accessor :gameover_me
75
+ attr_accessor :sounds
76
+ attr_accessor :test_battlers
77
+ attr_accessor :test_troop_id
78
+ attr_accessor :start_map_id
79
+ attr_accessor :start_x
80
+ attr_accessor :start_y
81
+ attr_accessor :terms
82
+ attr_accessor :battleback1_name
83
+ attr_accessor :battleback2_name
84
+ attr_accessor :battler_name
85
+ attr_accessor :battler_hue
86
+ attr_accessor :edit_map_id
87
+ end
88
+ end
@@ -0,0 +1,16 @@
1
+ module RPG
2
+ class System
3
+ class Terms
4
+ def initialize
5
+ @basic = Array.new(8) {''}
6
+ @params = Array.new(8) {''}
7
+ @etypes = Array.new(5) {''}
8
+ @commands = Array.new(23) {''}
9
+ end
10
+ attr_accessor :basic
11
+ attr_accessor :params
12
+ attr_accessor :etypes
13
+ attr_accessor :commands
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class System
3
+ class TestBattler
4
+ def initialize
5
+ @actor_id = 1
6
+ @level = 1
7
+ @equips = [0,0,0,0,0]
8
+ end
9
+ attr_accessor :actor_id
10
+ attr_accessor :level
11
+ attr_accessor :equips
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ module RPG
2
+ class System
3
+ class Vehicle
4
+ def initialize
5
+ @character_name = ''
6
+ @character_index = 0
7
+ @bgm = RPG::BGM.new
8
+ @start_map_id = 0
9
+ @start_x = 0
10
+ @start_y = 0
11
+ end
12
+ attr_accessor :character_name
13
+ attr_accessor :character_index
14
+ attr_accessor :bgm
15
+ attr_accessor :start_map_id
16
+ attr_accessor :start_x
17
+ attr_accessor :start_y
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ module RPG
2
+ class Tileset
3
+ def initialize
4
+ @id = 0
5
+ @mode = 1
6
+ @name = ''
7
+ @tileset_names = Array.new(9).collect{''}
8
+ @flags = Table.new(8192)
9
+ @flags[0] = 0x0010
10
+ (2048..2815).each {|i| @flags[i] = 0x000F}
11
+ (4352..8191).each {|i| @flags[i] = 0x000F}
12
+ @note = ''
13
+ end
14
+ attr_accessor :id
15
+ attr_accessor :mode
16
+ attr_accessor :name
17
+ attr_accessor :tileset_names
18
+ attr_accessor :flags
19
+ attr_accessor :note
20
+ end
21
+ end
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class Troop
3
+ def initialize
4
+ @id = 0
5
+ @name = ''
6
+ @members = []
7
+ @pages = [RPG::Troop::Page.new]
8
+ end
9
+ attr_accessor :id
10
+ attr_accessor :name
11
+ attr_accessor :members
12
+ attr_accessor :pages
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ module RPG
2
+ class Troop
3
+ class Member
4
+ def initialize
5
+ @enemy_id = 1
6
+ @x = 0
7
+ @y = 0
8
+ @hidden = false
9
+ end
10
+ attr_accessor :enemy_id
11
+ attr_accessor :x
12
+ attr_accessor :y
13
+ attr_accessor :hidden
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class Troop
3
+ class Page
4
+ def initialize
5
+ @condition = RPG::Troop::Page::Condition.new
6
+ @span = 0
7
+ @list = [RPG::EventCommand.new]
8
+ end
9
+ attr_accessor :condition
10
+ attr_accessor :span
11
+ attr_accessor :list
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,34 @@
1
+ module RPG
2
+ class Troop
3
+ class Page
4
+ class Condition
5
+ def initialize
6
+ @turn_ending = false
7
+ @turn_valid = false
8
+ @enemy_valid = false
9
+ @actor_valid = false
10
+ @switch_valid = false
11
+ @turn_a = 0
12
+ @turn_b = 0
13
+ @enemy_index = 0
14
+ @enemy_hp = 50
15
+ @actor_id = 1
16
+ @actor_hp = 50
17
+ @switch_id = 1
18
+ end
19
+ attr_accessor :turn_ending
20
+ attr_accessor :turn_valid
21
+ attr_accessor :enemy_valid
22
+ attr_accessor :actor_valid
23
+ attr_accessor :switch_valid
24
+ attr_accessor :turn_a
25
+ attr_accessor :turn_b
26
+ attr_accessor :enemy_index
27
+ attr_accessor :enemy_hp
28
+ attr_accessor :actor_id
29
+ attr_accessor :actor_hp
30
+ attr_accessor :switch_id
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,69 @@
1
+ module RPG
2
+ class UsableItem < BaseItem
3
+ def initialize
4
+ super
5
+ @scope = 0
6
+ @occasion = 0
7
+ @speed = 0
8
+ @success_rate = 100
9
+ @repeats = 1
10
+ @tp_gain = 0
11
+ @hit_type = 0
12
+ @animation_id = 0
13
+ @damage = RPG::UsableItem::Damage.new
14
+ @effects = []
15
+ end
16
+ def for_opponent?
17
+ [1, 2, 3, 4, 5, 6].include?(@scope)
18
+ end
19
+ def for_friend?
20
+ [7, 8, 9, 10, 11].include?(@scope)
21
+ end
22
+ def for_dead_friend?
23
+ [9, 10].include?(@scope)
24
+ end
25
+ def for_user?
26
+ @scope == 11
27
+ end
28
+ def for_one?
29
+ [1, 3, 7, 9, 11].include?(@scope)
30
+ end
31
+ def for_random?
32
+ [3, 4, 5, 6].include?(@scope)
33
+ end
34
+ def number_of_targets
35
+ for_random? ? @scope - 2 : 0
36
+ end
37
+ def for_all?
38
+ [2, 8, 10].include?(@scope)
39
+ end
40
+ def need_selection?
41
+ [1, 7, 9].include?(@scope)
42
+ end
43
+ def battle_ok?
44
+ [0, 1].include?(@occasion)
45
+ end
46
+ def menu_ok?
47
+ [0, 2].include?(@occasion)
48
+ end
49
+ def certain?
50
+ @hit_type == 0
51
+ end
52
+ def physical?
53
+ @hit_type == 1
54
+ end
55
+ def magical?
56
+ @hit_type == 2
57
+ end
58
+ attr_accessor :scope
59
+ attr_accessor :occasion
60
+ attr_accessor :speed
61
+ attr_accessor :animation_id
62
+ attr_accessor :success_rate
63
+ attr_accessor :repeats
64
+ attr_accessor :tp_gain
65
+ attr_accessor :hit_type
66
+ attr_accessor :damage
67
+ attr_accessor :effects
68
+ end
69
+ end
@@ -0,0 +1,39 @@
1
+ module RPG
2
+ class UsableItem
3
+ class Damage
4
+ def initialize
5
+ @type = 0
6
+ @element_id = 0
7
+ @formula = '0'
8
+ @variance = 20
9
+ @critical = false
10
+ end
11
+ def none?
12
+ @type == 0
13
+ end
14
+ def to_hp?
15
+ [1,3,5].include?(@type)
16
+ end
17
+ def to_mp?
18
+ [2,4,6].include?(@type)
19
+ end
20
+ def recover?
21
+ [3,4].include?(@type)
22
+ end
23
+ def drain?
24
+ [5,6].include?(@type)
25
+ end
26
+ def sign
27
+ recover? ? -1 : 1
28
+ end
29
+ def eval(a, b, v)
30
+ [Kernel.eval(@formula), 0].max * sign rescue 0
31
+ end
32
+ attr_accessor :type
33
+ attr_accessor :element_id
34
+ attr_accessor :formula
35
+ attr_accessor :variance
36
+ attr_accessor :critical
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,16 @@
1
+ module RPG
2
+ class UsableItem
3
+ class Effect
4
+ def initialize(code = 0, data_id = 0, value1 = 0, value2 = 0)
5
+ @code = code
6
+ @data_id = data_id
7
+ @value1 = value1
8
+ @value2 = value2
9
+ end
10
+ attr_accessor :code
11
+ attr_accessor :data_id
12
+ attr_accessor :value1
13
+ attr_accessor :value2
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module RPG
2
+ class Weapon < EquipItem
3
+ def initialize
4
+ super
5
+ @wtype_id = 0
6
+ @animation_id = 0
7
+ @features.push(RPG::BaseItem::Feature.new(31, 1, 0))
8
+ @features.push(RPG::BaseItem::Feature.new(22, 0, 0))
9
+ end
10
+ def performance
11
+ params[2] + params[4] + params.inject(0) {|r, v| r += v }
12
+ end
13
+ attr_accessor :wtype_id
14
+ attr_accessor :animation_id
15
+ end
16
+ end