rpg-maker-rgss3 1.02.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,35 @@
1
+ module RPG
2
+ class Class < BaseItem
3
+ def initialize
4
+ super
5
+ @exp_params = [30,20,30,30]
6
+ @params = Table.new(8,100)
7
+ (1..99).each do |i|
8
+ @params[0,i] = 400+i*50
9
+ @params[1,i] = 80+i*10
10
+ (2..5).each {|j| @params[j,i] = 15+i*5/4 }
11
+ (6..7).each {|j| @params[j,i] = 30+i*5/2 }
12
+ end
13
+ @learnings = []
14
+ @features.push(RPG::BaseItem::Feature.new(23, 0, 1))
15
+ @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
16
+ @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
17
+ @features.push(RPG::BaseItem::Feature.new(22, 2, 0.04))
18
+ @features.push(RPG::BaseItem::Feature.new(41, 1))
19
+ @features.push(RPG::BaseItem::Feature.new(51, 1))
20
+ @features.push(RPG::BaseItem::Feature.new(52, 1))
21
+ end
22
+ def exp_for_level(level)
23
+ lv = level.to_f
24
+ basis = @exp_params[0].to_f
25
+ extra = @exp_params[1].to_f
26
+ acc_a = @exp_params[2].to_f
27
+ acc_b = @exp_params[3].to_f
28
+ return (basis*((lv-1)**(0.9+acc_a/250))*lv*(lv+1)/
29
+ (6+lv**2/50/acc_b)+(lv-1)*extra).round.to_i
30
+ end
31
+ attr_accessor :exp_params
32
+ attr_accessor :params
33
+ attr_accessor :learnings
34
+ end
35
+ end
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class Class < BaseItem
3
+ class Learning
4
+ def initialize
5
+ @level = 1
6
+ @skill_id = 1
7
+ @note = ''
8
+ end
9
+ attr_accessor :level
10
+ attr_accessor :skill_id
11
+ attr_accessor :note
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ module RPG
2
+ class CommonEvent
3
+ def initialize
4
+ @id = 0
5
+ @name = ''
6
+ @trigger = 0
7
+ @switch_id = 1
8
+ @list = [RPG::EventCommand.new]
9
+ end
10
+ def autorun?
11
+ @trigger == 1
12
+ end
13
+ def parallel?
14
+ @trigger == 2
15
+ end
16
+ attr_accessor :id
17
+ attr_accessor :name
18
+ attr_accessor :trigger
19
+ attr_accessor :switch_id
20
+ attr_accessor :list
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ module RPG
2
+ class Enemy < BaseItem
3
+ def initialize
4
+ super
5
+ @battler_name = ''
6
+ @battler_hue = 0
7
+ @params = [100,0,10,10,10,10,10,10]
8
+ @exp = 0
9
+ @gold = 0
10
+ @drop_items = Array.new(3) { RPG::Enemy::DropItem.new }
11
+ @actions = [RPG::Enemy::Action.new]
12
+ @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
13
+ @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
14
+ @features.push(RPG::BaseItem::Feature.new(31, 1, 0))
15
+ end
16
+ attr_accessor :battler_name
17
+ attr_accessor :battler_hue
18
+ attr_accessor :params
19
+ attr_accessor :exp
20
+ attr_accessor :gold
21
+ attr_accessor :drop_items
22
+ attr_accessor :actions
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ module RPG
2
+ class Enemy
3
+ class Action
4
+ def initialize
5
+ @skill_id = 1
6
+ @condition_type = 0
7
+ @condition_param1 = 0
8
+ @condition_param2 = 0
9
+ @rating = 5
10
+ end
11
+ attr_accessor :skill_id
12
+ attr_accessor :condition_type
13
+ attr_accessor :condition_param1
14
+ attr_accessor :condition_param2
15
+ attr_accessor :rating
16
+ end
17
+ end
18
+ end
19
+
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class Enemy
3
+ class DropItem
4
+ def initialize
5
+ @kind = 0
6
+ @data_id = 1
7
+ @denominator = 1
8
+ end
9
+ attr_accessor :kind
10
+ attr_accessor :data_id
11
+ attr_accessor :denominator
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module RPG
2
+ class EquipItem < BaseItem
3
+ def initialize
4
+ super
5
+ @price = 0
6
+ @etype_id = 0
7
+ @params = [0] * 8
8
+ end
9
+ attr_accessor :price
10
+ attr_accessor :etype_id
11
+ attr_accessor :params
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ module RPG
2
+ class Event
3
+ def initialize(x, y)
4
+ @id = 0
5
+ @name = ''
6
+ @x = x
7
+ @y = y
8
+ @pages = [RPG::Event::Page.new]
9
+ end
10
+ attr_accessor :id
11
+ attr_accessor :name
12
+ attr_accessor :x
13
+ attr_accessor :y
14
+ attr_accessor :pages
15
+ end
16
+ end
@@ -0,0 +1,34 @@
1
+ module RPG
2
+ class Event
3
+ class Page
4
+ def initialize
5
+ @condition = RPG::Event::Page::Condition.new
6
+ @graphic = RPG::Event::Page::Graphic.new
7
+ @move_type = 0
8
+ @move_speed = 3
9
+ @move_frequency = 3
10
+ @move_route = RPG::MoveRoute.new
11
+ @walk_anime = true
12
+ @step_anime = false
13
+ @direction_fix = false
14
+ @through = false
15
+ @priority_type = 0
16
+ @trigger = 0
17
+ @list = [RPG::EventCommand.new]
18
+ end
19
+ attr_accessor :condition
20
+ attr_accessor :graphic
21
+ attr_accessor :move_type
22
+ attr_accessor :move_speed
23
+ attr_accessor :move_frequency
24
+ attr_accessor :move_route
25
+ attr_accessor :walk_anime
26
+ attr_accessor :step_anime
27
+ attr_accessor :direction_fix
28
+ attr_accessor :through
29
+ attr_accessor :priority_type
30
+ attr_accessor :trigger
31
+ attr_accessor :list
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+ module RPG
2
+ class Event
3
+ class Page
4
+ class Condition
5
+ def initialize
6
+ @switch1_valid = false
7
+ @switch2_valid = false
8
+ @variable_valid = false
9
+ @self_switch_valid = false
10
+ @item_valid = false
11
+ @actor_valid = false
12
+ @switch1_id = 1
13
+ @switch2_id = 1
14
+ @variable_id = 1
15
+ @variable_value = 0
16
+ @self_switch_ch = 'A'
17
+ @item_id = 1
18
+ @actor_id = 1
19
+ end
20
+ attr_accessor :switch1_valid
21
+ attr_accessor :switch2_valid
22
+ attr_accessor :variable_valid
23
+ attr_accessor :self_switch_valid
24
+ attr_accessor :item_valid
25
+ attr_accessor :actor_valid
26
+ attr_accessor :switch1_id
27
+ attr_accessor :switch2_id
28
+ attr_accessor :variable_id
29
+ attr_accessor :variable_value
30
+ attr_accessor :self_switch_ch
31
+ attr_accessor :item_id
32
+ attr_accessor :actor_id
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,20 @@
1
+ module RPG
2
+ class Event
3
+ class Page
4
+ class Graphic
5
+ def initialize
6
+ @tile_id = 0
7
+ @character_name = ''
8
+ @character_index = 0
9
+ @direction = 2
10
+ @pattern = 0
11
+ end
12
+ attr_accessor :tile_id
13
+ attr_accessor :character_name
14
+ attr_accessor :character_index
15
+ attr_accessor :direction
16
+ attr_accessor :pattern
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,12 @@
1
+ module RPG
2
+ class EventCommand
3
+ def initialize(code = 0, indent = 0, parameters = [])
4
+ @code = code
5
+ @indent = indent
6
+ @parameters = parameters
7
+ end
8
+ attr_accessor :code
9
+ attr_accessor :indent
10
+ attr_accessor :parameters
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ module RPG
2
+ class Item < UsableItem
3
+ def initialize
4
+ super
5
+ @scope = 7
6
+ @itype_id = 1
7
+ @price = 0
8
+ @consumable = true
9
+ end
10
+ def key_item?
11
+ @itype_id == 2
12
+ end
13
+ attr_accessor :itype_id
14
+ attr_accessor :price
15
+ attr_accessor :consumable
16
+ end
17
+ end
@@ -0,0 +1,54 @@
1
+ module RPG
2
+ class Map
3
+ def initialize(width, height)
4
+ @display_name = ''
5
+ @tileset_id = 1
6
+ @width = width
7
+ @height = height
8
+ @scroll_type = 0
9
+ @specify_battleback = false
10
+ @battleback_floor_name = ''
11
+ @battleback_wall_name = ''
12
+ @autoplay_bgm = false
13
+ @bgm = RPG::BGM.new
14
+ @autoplay_bgs = false
15
+ @bgs = RPG::BGS.new('', 80)
16
+ @disable_dashing = false
17
+ @encounter_list = []
18
+ @encounter_step = 30
19
+ @parallax_name = ''
20
+ @parallax_loop_x = false
21
+ @parallax_loop_y = false
22
+ @parallax_sx = 0
23
+ @parallax_sy = 0
24
+ @parallax_show = false
25
+ @note = ''
26
+ @data = Table.new(width, height, 4)
27
+ @events = {}
28
+ end
29
+ attr_accessor :display_name
30
+ attr_accessor :tileset_id
31
+ attr_accessor :width
32
+ attr_accessor :height
33
+ attr_accessor :scroll_type
34
+ attr_accessor :specify_battleback
35
+ attr_accessor :battleback1_name
36
+ attr_accessor :battleback2_name
37
+ attr_accessor :autoplay_bgm
38
+ attr_accessor :bgm
39
+ attr_accessor :autoplay_bgs
40
+ attr_accessor :bgs
41
+ attr_accessor :disable_dashing
42
+ attr_accessor :encounter_list
43
+ attr_accessor :encounter_step
44
+ attr_accessor :parallax_name
45
+ attr_accessor :parallax_loop_x
46
+ attr_accessor :parallax_loop_y
47
+ attr_accessor :parallax_sx
48
+ attr_accessor :parallax_sy
49
+ attr_accessor :parallax_show
50
+ attr_accessor :note
51
+ attr_accessor :data
52
+ attr_accessor :events
53
+ end
54
+ end
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class Map
3
+ class Encounter
4
+ def initialize
5
+ @troop_id = 1
6
+ @weight = 10
7
+ @region_set = []
8
+ end
9
+ attr_accessor :troop_id
10
+ attr_accessor :weight
11
+ attr_accessor :region_set
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module RPG
2
+ class MapInfo
3
+ def initialize
4
+ @name = ''
5
+ @parent_id = 0
6
+ @order = 0
7
+ @expanded = false
8
+ @scroll_x = 0
9
+ @scroll_y = 0
10
+ end
11
+ attr_accessor :name
12
+ attr_accessor :parent_id
13
+ attr_accessor :order
14
+ attr_accessor :expanded
15
+ attr_accessor :scroll_x
16
+ attr_accessor :scroll_y
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ module RPG
2
+ class ME < AudioFile
3
+ def play
4
+ if @name.empty?
5
+ Audio.me_stop
6
+ else
7
+ Audio.me_play('Audio/ME/' + @name, @volume, @pitch)
8
+ end
9
+ end
10
+ def self.stop
11
+ Audio.me_stop
12
+ end
13
+ def self.fade(time)
14
+ Audio.me_fade(time)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ module RPG
2
+ class MoveCommand
3
+ def initialize(code = 0, parameters = [])
4
+ @code = code
5
+ @parameters = parameters
6
+ end
7
+ attr_accessor :code
8
+ attr_accessor :parameters
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module RPG
2
+ class MoveRoute
3
+ def initialize
4
+ @repeat = true
5
+ @skippable = false
6
+ @wait = false
7
+ @list = [RPG::MoveCommand.new]
8
+ end
9
+ attr_accessor :repeat
10
+ attr_accessor :skippable
11
+ attr_accessor :wait
12
+ attr_accessor :list
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ module RPG
2
+ class SE < AudioFile
3
+ def play
4
+ unless @name.empty?
5
+ Audio.se_play('Audio/SE/' + @name, @volume, @pitch)
6
+ end
7
+ end
8
+ def self.stop
9
+ Audio.se_stop
10
+ end
11
+ end
12
+ end