rgss3_default_scripts 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/README.md +9 -0
- data/Rakefile +2 -0
- data/lib/rgss3_default_scripts.rb +109 -0
- data/lib/rgss3_default_scripts/BattleManager.rb +392 -0
- data/lib/rgss3_default_scripts/Cache.rb +134 -0
- data/lib/rgss3_default_scripts/DataManager.rb +267 -0
- data/lib/rgss3_default_scripts/Game_Action.rb +262 -0
- data/lib/rgss3_default_scripts/Game_ActionResult.rb +159 -0
- data/lib/rgss3_default_scripts/Game_Actor.rb +696 -0
- data/lib/rgss3_default_scripts/Game_Actors.rb +22 -0
- data/lib/rgss3_default_scripts/Game_BaseItem.rb +51 -0
- data/lib/rgss3_default_scripts/Game_Battler.rb +824 -0
- data/lib/rgss3_default_scripts/Game_BattlerBase.rb +731 -0
- data/lib/rgss3_default_scripts/Game_Character.rb +396 -0
- data/lib/rgss3_default_scripts/Game_CharacterBase.rb +443 -0
- data/lib/rgss3_default_scripts/Game_CommonEvent.rb +41 -0
- data/lib/rgss3_default_scripts/Game_Enemy.rb +264 -0
- data/lib/rgss3_default_scripts/Game_Event.rb +308 -0
- data/lib/rgss3_default_scripts/Game_Follower.rb +74 -0
- data/lib/rgss3_default_scripts/Game_Followers.rb +112 -0
- data/lib/rgss3_default_scripts/Game_Interpreter.rb +1413 -0
- data/lib/rgss3_default_scripts/Game_Map.rb +704 -0
- data/lib/rgss3_default_scripts/Game_Message.rb +101 -0
- data/lib/rgss3_default_scripts/Game_Party.rb +418 -0
- data/lib/rgss3_default_scripts/Game_Picture.rb +161 -0
- data/lib/rgss3_default_scripts/Game_Pictures.rb +28 -0
- data/lib/rgss3_default_scripts/Game_Player.rb +488 -0
- data/lib/rgss3_default_scripts/Game_Screen.rb +234 -0
- data/lib/rgss3_default_scripts/Game_SelfSwitches.rb +35 -0
- data/lib/rgss3_default_scripts/Game_Switches.rb +35 -0
- data/lib/rgss3_default_scripts/Game_System.rb +122 -0
- data/lib/rgss3_default_scripts/Game_Temp.rb +45 -0
- data/lib/rgss3_default_scripts/Game_Timer.rb +56 -0
- data/lib/rgss3_default_scripts/Game_Troop.rb +205 -0
- data/lib/rgss3_default_scripts/Game_Unit.rb +131 -0
- data/lib/rgss3_default_scripts/Game_Variables.rb +34 -0
- data/lib/rgss3_default_scripts/Game_Vehicle.rb +193 -0
- data/lib/rgss3_default_scripts/SceneManager.rb +94 -0
- data/lib/rgss3_default_scripts/Scene_Base.rb +132 -0
- data/lib/rgss3_default_scripts/Scene_Battle.rb +693 -0
- data/lib/rgss3_default_scripts/Scene_Debug.rb +87 -0
- data/lib/rgss3_default_scripts/Scene_End.rb +61 -0
- data/lib/rgss3_default_scripts/Scene_Equip.rb +144 -0
- data/lib/rgss3_default_scripts/Scene_File.rb +203 -0
- data/lib/rgss3_default_scripts/Scene_Gameover.rb +85 -0
- data/lib/rgss3_default_scripts/Scene_Item.rb +75 -0
- data/lib/rgss3_default_scripts/Scene_ItemBase.rb +147 -0
- data/lib/rgss3_default_scripts/Scene_Load.rb +40 -0
- data/lib/rgss3_default_scripts/Scene_Map.rb +276 -0
- data/lib/rgss3_default_scripts/Scene_Menu.rb +127 -0
- data/lib/rgss3_default_scripts/Scene_MenuBase.rb +63 -0
- data/lib/rgss3_default_scripts/Scene_Name.rb +32 -0
- data/lib/rgss3_default_scripts/Scene_Save.rb +38 -0
- data/lib/rgss3_default_scripts/Scene_Shop.rb +299 -0
- data/lib/rgss3_default_scripts/Scene_Skill.rb +108 -0
- data/lib/rgss3_default_scripts/Scene_Status.rb +25 -0
- data/lib/rgss3_default_scripts/Scene_Title.rb +137 -0
- data/lib/rgss3_default_scripts/Sound.rb +135 -0
- data/lib/rgss3_default_scripts/Sprite_Base.rb +232 -0
- data/lib/rgss3_default_scripts/Sprite_Battler.rb +231 -0
- data/lib/rgss3_default_scripts/Sprite_Character.rb +226 -0
- data/lib/rgss3_default_scripts/Sprite_Picture.rb +82 -0
- data/lib/rgss3_default_scripts/Sprite_Timer.rb +77 -0
- data/lib/rgss3_default_scripts/Spriteset_Battle.rb +389 -0
- data/lib/rgss3_default_scripts/Spriteset_Map.rb +273 -0
- data/lib/rgss3_default_scripts/Spriteset_Weather.rb +184 -0
- data/lib/rgss3_default_scripts/Vocab.rb +145 -0
- data/lib/rgss3_default_scripts/Window_ActorCommand.rb +78 -0
- data/lib/rgss3_default_scripts/Window_Base.rb +571 -0
- data/lib/rgss3_default_scripts/Window_BattleActor.rb +38 -0
- data/lib/rgss3_default_scripts/Window_BattleEnemy.rb +70 -0
- data/lib/rgss3_default_scripts/Window_BattleItem.rb +40 -0
- data/lib/rgss3_default_scripts/Window_BattleLog.rb +425 -0
- data/lib/rgss3_default_scripts/Window_BattleSkill.rb +34 -0
- data/lib/rgss3_default_scripts/Window_BattleStatus.rb +111 -0
- data/lib/rgss3_default_scripts/Window_ChoiceList.rb +88 -0
- data/lib/rgss3_default_scripts/Window_Command.rb +152 -0
- data/lib/rgss3_default_scripts/Window_DebugLeft.rb +104 -0
- data/lib/rgss3_default_scripts/Window_DebugRight.rb +119 -0
- data/lib/rgss3_default_scripts/Window_EquipCommand.rb +36 -0
- data/lib/rgss3_default_scripts/Window_EquipItem.rb +78 -0
- data/lib/rgss3_default_scripts/Window_EquipSlot.rb +111 -0
- data/lib/rgss3_default_scripts/Window_EquipStatus.rb +97 -0
- data/lib/rgss3_default_scripts/Window_GameEnd.rb +38 -0
- data/lib/rgss3_default_scripts/Window_Gold.rb +47 -0
- data/lib/rgss3_default_scripts/Window_Help.rb +43 -0
- data/lib/rgss3_default_scripts/Window_HorzCommand.rb +106 -0
- data/lib/rgss3_default_scripts/Window_ItemCategory.rb +54 -0
- data/lib/rgss3_default_scripts/Window_ItemList.rb +117 -0
- data/lib/rgss3_default_scripts/Window_KeyItem.rb +55 -0
- data/lib/rgss3_default_scripts/Window_MapName.rb +96 -0
- data/lib/rgss3_default_scripts/Window_MenuActor.rb +43 -0
- data/lib/rgss3_default_scripts/Window_MenuCommand.rb +106 -0
- data/lib/rgss3_default_scripts/Window_MenuStatus.rb +85 -0
- data/lib/rgss3_default_scripts/Window_Message.rb +397 -0
- data/lib/rgss3_default_scripts/Window_NameEdit.rb +129 -0
- data/lib/rgss3_default_scripts/Window_NameInput.rb +253 -0
- data/lib/rgss3_default_scripts/Window_NumberInput.rb +148 -0
- data/lib/rgss3_default_scripts/Window_PartyCommand.rb +47 -0
- data/lib/rgss3_default_scripts/Window_SaveFile.rb +69 -0
- data/lib/rgss3_default_scripts/Window_ScrollText.rb +90 -0
- data/lib/rgss3_default_scripts/Window_Selectable.rb +442 -0
- data/lib/rgss3_default_scripts/Window_ShopBuy.rb +115 -0
- data/lib/rgss3_default_scripts/Window_ShopCommand.rb +36 -0
- data/lib/rgss3_default_scripts/Window_ShopNumber.rb +137 -0
- data/lib/rgss3_default_scripts/Window_ShopSell.rb +27 -0
- data/lib/rgss3_default_scripts/Window_ShopStatus.rb +124 -0
- data/lib/rgss3_default_scripts/Window_SkillCommand.rb +76 -0
- data/lib/rgss3_default_scripts/Window_SkillList.rb +121 -0
- data/lib/rgss3_default_scripts/Window_SkillStatus.rb +38 -0
- data/lib/rgss3_default_scripts/Window_Status.rb +125 -0
- data/lib/rgss3_default_scripts/Window_TitleCommand.rb +45 -0
- data/rgss3_default_scripts.gemspec +23 -0
- metadata +186 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
#==============================================================================
|
2
|
+
# ** Scene_Skill
|
3
|
+
#------------------------------------------------------------------------------
|
4
|
+
# This class performs skill screen processing. Skills are handled as items for
|
5
|
+
# the sake of process sharing.
|
6
|
+
#==============================================================================
|
7
|
+
|
8
|
+
class Scene_Skill < Scene_ItemBase
|
9
|
+
#--------------------------------------------------------------------------
|
10
|
+
# * Start Processing
|
11
|
+
#--------------------------------------------------------------------------
|
12
|
+
def start
|
13
|
+
super
|
14
|
+
create_help_window
|
15
|
+
create_command_window
|
16
|
+
create_status_window
|
17
|
+
create_item_window
|
18
|
+
end
|
19
|
+
#--------------------------------------------------------------------------
|
20
|
+
# * Create Command Window
|
21
|
+
#--------------------------------------------------------------------------
|
22
|
+
def create_command_window
|
23
|
+
wy = @help_window.height
|
24
|
+
@command_window = Window_SkillCommand.new(0, wy)
|
25
|
+
@command_window.viewport = @viewport
|
26
|
+
@command_window.help_window = @help_window
|
27
|
+
@command_window.actor = @actor
|
28
|
+
@command_window.set_handler(:skill, method(:command_skill))
|
29
|
+
@command_window.set_handler(:cancel, method(:return_scene))
|
30
|
+
@command_window.set_handler(:pagedown, method(:next_actor))
|
31
|
+
@command_window.set_handler(:pageup, method(:prev_actor))
|
32
|
+
end
|
33
|
+
#--------------------------------------------------------------------------
|
34
|
+
# * Create Status Window
|
35
|
+
#--------------------------------------------------------------------------
|
36
|
+
def create_status_window
|
37
|
+
y = @help_window.height
|
38
|
+
@status_window = Window_SkillStatus.new(@command_window.width, y)
|
39
|
+
@status_window.viewport = @viewport
|
40
|
+
@status_window.actor = @actor
|
41
|
+
end
|
42
|
+
#--------------------------------------------------------------------------
|
43
|
+
# * Create Item Window
|
44
|
+
#--------------------------------------------------------------------------
|
45
|
+
def create_item_window
|
46
|
+
wx = 0
|
47
|
+
wy = @status_window.y + @status_window.height
|
48
|
+
ww = Graphics.width
|
49
|
+
wh = Graphics.height - wy
|
50
|
+
@item_window = Window_SkillList.new(wx, wy, ww, wh)
|
51
|
+
@item_window.actor = @actor
|
52
|
+
@item_window.viewport = @viewport
|
53
|
+
@item_window.help_window = @help_window
|
54
|
+
@item_window.set_handler(:ok, method(:on_item_ok))
|
55
|
+
@item_window.set_handler(:cancel, method(:on_item_cancel))
|
56
|
+
@command_window.skill_window = @item_window
|
57
|
+
end
|
58
|
+
#--------------------------------------------------------------------------
|
59
|
+
# * Get Skill's User
|
60
|
+
#--------------------------------------------------------------------------
|
61
|
+
def user
|
62
|
+
@actor
|
63
|
+
end
|
64
|
+
#--------------------------------------------------------------------------
|
65
|
+
# * [Skill] Command
|
66
|
+
#--------------------------------------------------------------------------
|
67
|
+
def command_skill
|
68
|
+
@item_window.activate
|
69
|
+
@item_window.select_last
|
70
|
+
end
|
71
|
+
#--------------------------------------------------------------------------
|
72
|
+
# * Item [OK]
|
73
|
+
#--------------------------------------------------------------------------
|
74
|
+
def on_item_ok
|
75
|
+
@actor.last_skill.object = item
|
76
|
+
determine_item
|
77
|
+
end
|
78
|
+
#--------------------------------------------------------------------------
|
79
|
+
# * Item [Cancel]
|
80
|
+
#--------------------------------------------------------------------------
|
81
|
+
def on_item_cancel
|
82
|
+
@item_window.unselect
|
83
|
+
@command_window.activate
|
84
|
+
end
|
85
|
+
#--------------------------------------------------------------------------
|
86
|
+
# * Play SE When Using Item
|
87
|
+
#--------------------------------------------------------------------------
|
88
|
+
def play_se_for_item
|
89
|
+
Sound.play_use_skill
|
90
|
+
end
|
91
|
+
#--------------------------------------------------------------------------
|
92
|
+
# * Use Item
|
93
|
+
#--------------------------------------------------------------------------
|
94
|
+
def use_item
|
95
|
+
super
|
96
|
+
@status_window.refresh
|
97
|
+
@item_window.refresh
|
98
|
+
end
|
99
|
+
#--------------------------------------------------------------------------
|
100
|
+
# * Change Actors
|
101
|
+
#--------------------------------------------------------------------------
|
102
|
+
def on_actor_change
|
103
|
+
@command_window.actor = @actor
|
104
|
+
@status_window.actor = @actor
|
105
|
+
@item_window.actor = @actor
|
106
|
+
@command_window.activate
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#==============================================================================
|
2
|
+
# ** Scene_Status
|
3
|
+
#------------------------------------------------------------------------------
|
4
|
+
# This class performs the status screen processing.
|
5
|
+
#==============================================================================
|
6
|
+
|
7
|
+
class Scene_Status < Scene_MenuBase
|
8
|
+
#--------------------------------------------------------------------------
|
9
|
+
# * Start Processing
|
10
|
+
#--------------------------------------------------------------------------
|
11
|
+
def start
|
12
|
+
super
|
13
|
+
@status_window = Window_Status.new(@actor)
|
14
|
+
@status_window.set_handler(:cancel, method(:return_scene))
|
15
|
+
@status_window.set_handler(:pagedown, method(:next_actor))
|
16
|
+
@status_window.set_handler(:pageup, method(:prev_actor))
|
17
|
+
end
|
18
|
+
#--------------------------------------------------------------------------
|
19
|
+
# * Change Actors
|
20
|
+
#--------------------------------------------------------------------------
|
21
|
+
def on_actor_change
|
22
|
+
@status_window.actor = @actor
|
23
|
+
@status_window.activate
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
#==============================================================================
|
2
|
+
# ** Scene_Title
|
3
|
+
#------------------------------------------------------------------------------
|
4
|
+
# This class performs the title screen processing.
|
5
|
+
#==============================================================================
|
6
|
+
|
7
|
+
class Scene_Title < Scene_Base
|
8
|
+
#--------------------------------------------------------------------------
|
9
|
+
# * Start Processing
|
10
|
+
#--------------------------------------------------------------------------
|
11
|
+
def start
|
12
|
+
super
|
13
|
+
SceneManager.clear
|
14
|
+
Graphics.freeze
|
15
|
+
create_background
|
16
|
+
create_foreground
|
17
|
+
create_command_window
|
18
|
+
play_title_music
|
19
|
+
end
|
20
|
+
#--------------------------------------------------------------------------
|
21
|
+
# * Get Transition Speed
|
22
|
+
#--------------------------------------------------------------------------
|
23
|
+
def transition_speed
|
24
|
+
return 20
|
25
|
+
end
|
26
|
+
#--------------------------------------------------------------------------
|
27
|
+
# * Termination Processing
|
28
|
+
#--------------------------------------------------------------------------
|
29
|
+
def terminate
|
30
|
+
super
|
31
|
+
SceneManager.snapshot_for_background
|
32
|
+
dispose_background
|
33
|
+
dispose_foreground
|
34
|
+
end
|
35
|
+
#--------------------------------------------------------------------------
|
36
|
+
# * Create Background
|
37
|
+
#--------------------------------------------------------------------------
|
38
|
+
def create_background
|
39
|
+
@sprite1 = Sprite.new
|
40
|
+
@sprite1.bitmap = Cache.title1($data_system.title1_name)
|
41
|
+
@sprite2 = Sprite.new
|
42
|
+
@sprite2.bitmap = Cache.title2($data_system.title2_name)
|
43
|
+
center_sprite(@sprite1)
|
44
|
+
center_sprite(@sprite2)
|
45
|
+
end
|
46
|
+
#--------------------------------------------------------------------------
|
47
|
+
# * Create Foreground
|
48
|
+
#--------------------------------------------------------------------------
|
49
|
+
def create_foreground
|
50
|
+
@foreground_sprite = Sprite.new
|
51
|
+
@foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
|
52
|
+
@foreground_sprite.z = 100
|
53
|
+
draw_game_title if $data_system.opt_draw_title
|
54
|
+
end
|
55
|
+
#--------------------------------------------------------------------------
|
56
|
+
# * Draw Game Title
|
57
|
+
#--------------------------------------------------------------------------
|
58
|
+
def draw_game_title
|
59
|
+
@foreground_sprite.bitmap.font.size = 48
|
60
|
+
rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
|
61
|
+
@foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)
|
62
|
+
end
|
63
|
+
#--------------------------------------------------------------------------
|
64
|
+
# * Free Background
|
65
|
+
#--------------------------------------------------------------------------
|
66
|
+
def dispose_background
|
67
|
+
@sprite1.bitmap.dispose
|
68
|
+
@sprite1.dispose
|
69
|
+
@sprite2.bitmap.dispose
|
70
|
+
@sprite2.dispose
|
71
|
+
end
|
72
|
+
#--------------------------------------------------------------------------
|
73
|
+
# * Free Foreground
|
74
|
+
#--------------------------------------------------------------------------
|
75
|
+
def dispose_foreground
|
76
|
+
@foreground_sprite.bitmap.dispose
|
77
|
+
@foreground_sprite.dispose
|
78
|
+
end
|
79
|
+
#--------------------------------------------------------------------------
|
80
|
+
# * Move Sprite to Screen Center
|
81
|
+
#--------------------------------------------------------------------------
|
82
|
+
def center_sprite(sprite)
|
83
|
+
sprite.ox = sprite.bitmap.width / 2
|
84
|
+
sprite.oy = sprite.bitmap.height / 2
|
85
|
+
sprite.x = Graphics.width / 2
|
86
|
+
sprite.y = Graphics.height / 2
|
87
|
+
end
|
88
|
+
#--------------------------------------------------------------------------
|
89
|
+
# * Create Command Window
|
90
|
+
#--------------------------------------------------------------------------
|
91
|
+
def create_command_window
|
92
|
+
@command_window = Window_TitleCommand.new
|
93
|
+
@command_window.set_handler(:new_game, method(:command_new_game))
|
94
|
+
@command_window.set_handler(:continue, method(:command_continue))
|
95
|
+
@command_window.set_handler(:shutdown, method(:command_shutdown))
|
96
|
+
end
|
97
|
+
#--------------------------------------------------------------------------
|
98
|
+
# * Close Command Window
|
99
|
+
#--------------------------------------------------------------------------
|
100
|
+
def close_command_window
|
101
|
+
@command_window.close
|
102
|
+
update until @command_window.close?
|
103
|
+
end
|
104
|
+
#--------------------------------------------------------------------------
|
105
|
+
# * [New Game] Command
|
106
|
+
#--------------------------------------------------------------------------
|
107
|
+
def command_new_game
|
108
|
+
DataManager.setup_new_game
|
109
|
+
close_command_window
|
110
|
+
fadeout_all
|
111
|
+
$game_map.autoplay
|
112
|
+
SceneManager.goto(Scene_Map)
|
113
|
+
end
|
114
|
+
#--------------------------------------------------------------------------
|
115
|
+
# * [Continue] Command
|
116
|
+
#--------------------------------------------------------------------------
|
117
|
+
def command_continue
|
118
|
+
close_command_window
|
119
|
+
SceneManager.call(Scene_Load)
|
120
|
+
end
|
121
|
+
#--------------------------------------------------------------------------
|
122
|
+
# * [Shut Down] Command
|
123
|
+
#--------------------------------------------------------------------------
|
124
|
+
def command_shutdown
|
125
|
+
close_command_window
|
126
|
+
fadeout_all
|
127
|
+
SceneManager.exit
|
128
|
+
end
|
129
|
+
#--------------------------------------------------------------------------
|
130
|
+
# * Play Title Screen Music
|
131
|
+
#--------------------------------------------------------------------------
|
132
|
+
def play_title_music
|
133
|
+
$data_system.title_bgm.play
|
134
|
+
RPG::BGS.stop
|
135
|
+
RPG::ME.stop
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
#==============================================================================
|
2
|
+
# ** Sound
|
3
|
+
#------------------------------------------------------------------------------
|
4
|
+
# This module plays sound effects. It obtains sound effects specified in the
|
5
|
+
# database from the global variable $data_system, and plays them.
|
6
|
+
#==============================================================================
|
7
|
+
|
8
|
+
module Sound
|
9
|
+
|
10
|
+
# System Sound Effect
|
11
|
+
def self.play_system_sound(n)
|
12
|
+
$data_system.sounds[n].play
|
13
|
+
end
|
14
|
+
|
15
|
+
# Cursor Movement
|
16
|
+
def self.play_cursor
|
17
|
+
play_system_sound(0)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Decision
|
21
|
+
def self.play_ok
|
22
|
+
play_system_sound(1)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Cancel
|
26
|
+
def self.play_cancel
|
27
|
+
play_system_sound(2)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Buzzer
|
31
|
+
def self.play_buzzer
|
32
|
+
play_system_sound(3)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Equip
|
36
|
+
def self.play_equip
|
37
|
+
play_system_sound(4)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Save
|
41
|
+
def self.play_save
|
42
|
+
play_system_sound(5)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Load
|
46
|
+
def self.play_load
|
47
|
+
play_system_sound(6)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Battle Start
|
51
|
+
def self.play_battle_start
|
52
|
+
play_system_sound(7)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Escape
|
56
|
+
def self.play_escape
|
57
|
+
play_system_sound(8)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Enemy Attack
|
61
|
+
def self.play_enemy_attack
|
62
|
+
play_system_sound(9)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Enemy Damage
|
66
|
+
def self.play_enemy_damage
|
67
|
+
play_system_sound(10)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Enemy Collapse
|
71
|
+
def self.play_enemy_collapse
|
72
|
+
play_system_sound(11)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Boss Collapse 1
|
76
|
+
def self.play_boss_collapse1
|
77
|
+
play_system_sound(12)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Boss Collapse 2
|
81
|
+
def self.play_boss_collapse2
|
82
|
+
play_system_sound(13)
|
83
|
+
end
|
84
|
+
|
85
|
+
# Actor Damage
|
86
|
+
def self.play_actor_damage
|
87
|
+
play_system_sound(14)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Actor Collapse
|
91
|
+
def self.play_actor_collapse
|
92
|
+
play_system_sound(15)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Recovery
|
96
|
+
def self.play_recovery
|
97
|
+
play_system_sound(16)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Miss
|
101
|
+
def self.play_miss
|
102
|
+
play_system_sound(17)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Evasion
|
106
|
+
def self.play_evasion
|
107
|
+
play_system_sound(18)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Magic Evasion
|
111
|
+
def self.play_magic_evasion
|
112
|
+
play_system_sound(19)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Magic Reflection
|
116
|
+
def self.play_reflection
|
117
|
+
play_system_sound(20)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Shop
|
121
|
+
def self.play_shop
|
122
|
+
play_system_sound(21)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Use Item
|
126
|
+
def self.play_use_item
|
127
|
+
play_system_sound(22)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Use Skill
|
131
|
+
def self.play_use_skill
|
132
|
+
play_system_sound(23)
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
@@ -0,0 +1,232 @@
|
|
1
|
+
#==============================================================================
|
2
|
+
# ** Sprite_Base
|
3
|
+
#------------------------------------------------------------------------------
|
4
|
+
# A sprite class with animation display processing added.
|
5
|
+
#==============================================================================
|
6
|
+
|
7
|
+
class Sprite_Base < Sprite
|
8
|
+
#--------------------------------------------------------------------------
|
9
|
+
# * Class Variable
|
10
|
+
#--------------------------------------------------------------------------
|
11
|
+
@@ani_checker = []
|
12
|
+
@@ani_spr_checker = []
|
13
|
+
@@_reference_count = {}
|
14
|
+
#--------------------------------------------------------------------------
|
15
|
+
# * Object Initialization
|
16
|
+
#--------------------------------------------------------------------------
|
17
|
+
def initialize(viewport = nil)
|
18
|
+
super(viewport)
|
19
|
+
@use_sprite = true # Sprite use flag
|
20
|
+
@ani_duration = 0 # Remaining time of animation
|
21
|
+
end
|
22
|
+
#--------------------------------------------------------------------------
|
23
|
+
# * Free
|
24
|
+
#--------------------------------------------------------------------------
|
25
|
+
def dispose
|
26
|
+
super
|
27
|
+
dispose_animation
|
28
|
+
end
|
29
|
+
#--------------------------------------------------------------------------
|
30
|
+
# * Frame Update
|
31
|
+
#--------------------------------------------------------------------------
|
32
|
+
def update
|
33
|
+
super
|
34
|
+
update_animation
|
35
|
+
@@ani_checker.clear
|
36
|
+
@@ani_spr_checker.clear
|
37
|
+
end
|
38
|
+
#--------------------------------------------------------------------------
|
39
|
+
# * Determine if animation is being displayed
|
40
|
+
#--------------------------------------------------------------------------
|
41
|
+
def animation?
|
42
|
+
@animation != nil
|
43
|
+
end
|
44
|
+
#--------------------------------------------------------------------------
|
45
|
+
# * Start Animation
|
46
|
+
#--------------------------------------------------------------------------
|
47
|
+
def start_animation(animation, mirror = false)
|
48
|
+
dispose_animation
|
49
|
+
@animation = animation
|
50
|
+
if @animation
|
51
|
+
@ani_mirror = mirror
|
52
|
+
set_animation_rate
|
53
|
+
@ani_duration = @animation.frame_max * @ani_rate + 1
|
54
|
+
load_animation_bitmap
|
55
|
+
make_animation_sprites
|
56
|
+
set_animation_origin
|
57
|
+
end
|
58
|
+
end
|
59
|
+
#--------------------------------------------------------------------------
|
60
|
+
# * Set Animation Speed
|
61
|
+
#--------------------------------------------------------------------------
|
62
|
+
def set_animation_rate
|
63
|
+
@ani_rate = 4 # Fixed value by default
|
64
|
+
end
|
65
|
+
#--------------------------------------------------------------------------
|
66
|
+
# * Read (Load) Animation Graphics
|
67
|
+
#--------------------------------------------------------------------------
|
68
|
+
def load_animation_bitmap
|
69
|
+
animation1_name = @animation.animation1_name
|
70
|
+
animation1_hue = @animation.animation1_hue
|
71
|
+
animation2_name = @animation.animation2_name
|
72
|
+
animation2_hue = @animation.animation2_hue
|
73
|
+
@ani_bitmap1 = Cache.animation(animation1_name, animation1_hue)
|
74
|
+
@ani_bitmap2 = Cache.animation(animation2_name, animation2_hue)
|
75
|
+
if @@_reference_count.include?(@ani_bitmap1)
|
76
|
+
@@_reference_count[@ani_bitmap1] += 1
|
77
|
+
else
|
78
|
+
@@_reference_count[@ani_bitmap1] = 1
|
79
|
+
end
|
80
|
+
if @@_reference_count.include?(@ani_bitmap2)
|
81
|
+
@@_reference_count[@ani_bitmap2] += 1
|
82
|
+
else
|
83
|
+
@@_reference_count[@ani_bitmap2] = 1
|
84
|
+
end
|
85
|
+
Graphics.frame_reset
|
86
|
+
end
|
87
|
+
#--------------------------------------------------------------------------
|
88
|
+
# * Create Animation Spirtes
|
89
|
+
#--------------------------------------------------------------------------
|
90
|
+
def make_animation_sprites
|
91
|
+
@ani_sprites = []
|
92
|
+
if @use_sprite && !@@ani_spr_checker.include?(@animation)
|
93
|
+
16.times do
|
94
|
+
sprite = ::Sprite.new(viewport)
|
95
|
+
sprite.visible = false
|
96
|
+
@ani_sprites.push(sprite)
|
97
|
+
end
|
98
|
+
if @animation.position == 3
|
99
|
+
@@ani_spr_checker.push(@animation)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
@ani_duplicated = @@ani_checker.include?(@animation)
|
103
|
+
if !@ani_duplicated && @animation.position == 3
|
104
|
+
@@ani_checker.push(@animation)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
#--------------------------------------------------------------------------
|
108
|
+
# * Set Animation Origin
|
109
|
+
#--------------------------------------------------------------------------
|
110
|
+
def set_animation_origin
|
111
|
+
if @animation.position == 3
|
112
|
+
if viewport == nil
|
113
|
+
@ani_ox = Graphics.width / 2
|
114
|
+
@ani_oy = Graphics.height / 2
|
115
|
+
else
|
116
|
+
@ani_ox = viewport.rect.width / 2
|
117
|
+
@ani_oy = viewport.rect.height / 2
|
118
|
+
end
|
119
|
+
else
|
120
|
+
@ani_ox = x - ox + width / 2
|
121
|
+
@ani_oy = y - oy + height / 2
|
122
|
+
if @animation.position == 0
|
123
|
+
@ani_oy -= height / 2
|
124
|
+
elsif @animation.position == 2
|
125
|
+
@ani_oy += height / 2
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
#--------------------------------------------------------------------------
|
130
|
+
# * Free Animation
|
131
|
+
#--------------------------------------------------------------------------
|
132
|
+
def dispose_animation
|
133
|
+
if @ani_bitmap1
|
134
|
+
@@_reference_count[@ani_bitmap1] -= 1
|
135
|
+
if @@_reference_count[@ani_bitmap1] == 0
|
136
|
+
@ani_bitmap1.dispose
|
137
|
+
end
|
138
|
+
end
|
139
|
+
if @ani_bitmap2
|
140
|
+
@@_reference_count[@ani_bitmap2] -= 1
|
141
|
+
if @@_reference_count[@ani_bitmap2] == 0
|
142
|
+
@ani_bitmap2.dispose
|
143
|
+
end
|
144
|
+
end
|
145
|
+
if @ani_sprites
|
146
|
+
@ani_sprites.each {|sprite| sprite.dispose }
|
147
|
+
@ani_sprites = nil
|
148
|
+
@animation = nil
|
149
|
+
end
|
150
|
+
@ani_bitmap1 = nil
|
151
|
+
@ani_bitmap2 = nil
|
152
|
+
end
|
153
|
+
#--------------------------------------------------------------------------
|
154
|
+
# * Update Animation
|
155
|
+
#--------------------------------------------------------------------------
|
156
|
+
def update_animation
|
157
|
+
return unless animation?
|
158
|
+
@ani_duration -= 1
|
159
|
+
if @ani_duration % @ani_rate == 0
|
160
|
+
if @ani_duration > 0
|
161
|
+
frame_index = @animation.frame_max
|
162
|
+
frame_index -= (@ani_duration + @ani_rate - 1) / @ani_rate
|
163
|
+
animation_set_sprites(@animation.frames[frame_index])
|
164
|
+
@animation.timings.each do |timing|
|
165
|
+
animation_process_timing(timing) if timing.frame == frame_index
|
166
|
+
end
|
167
|
+
else
|
168
|
+
end_animation
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
#--------------------------------------------------------------------------
|
173
|
+
# * End Animation
|
174
|
+
#--------------------------------------------------------------------------
|
175
|
+
def end_animation
|
176
|
+
dispose_animation
|
177
|
+
end
|
178
|
+
#--------------------------------------------------------------------------
|
179
|
+
# * Set Animation Sprite
|
180
|
+
# frame : Frame data (RPG::Animation::Frame)
|
181
|
+
#--------------------------------------------------------------------------
|
182
|
+
def animation_set_sprites(frame)
|
183
|
+
cell_data = frame.cell_data
|
184
|
+
@ani_sprites.each_with_index do |sprite, i|
|
185
|
+
next unless sprite
|
186
|
+
pattern = cell_data[i, 0]
|
187
|
+
if !pattern || pattern < 0
|
188
|
+
sprite.visible = false
|
189
|
+
next
|
190
|
+
end
|
191
|
+
sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
|
192
|
+
sprite.visible = true
|
193
|
+
sprite.src_rect.set(pattern % 5 * 192,
|
194
|
+
pattern % 100 / 5 * 192, 192, 192)
|
195
|
+
if @ani_mirror
|
196
|
+
sprite.x = @ani_ox - cell_data[i, 1]
|
197
|
+
sprite.y = @ani_oy + cell_data[i, 2]
|
198
|
+
sprite.angle = (360 - cell_data[i, 4])
|
199
|
+
sprite.mirror = (cell_data[i, 5] == 0)
|
200
|
+
else
|
201
|
+
sprite.x = @ani_ox + cell_data[i, 1]
|
202
|
+
sprite.y = @ani_oy + cell_data[i, 2]
|
203
|
+
sprite.angle = cell_data[i, 4]
|
204
|
+
sprite.mirror = (cell_data[i, 5] == 1)
|
205
|
+
end
|
206
|
+
sprite.z = self.z + 300 + i
|
207
|
+
sprite.ox = 96
|
208
|
+
sprite.oy = 96
|
209
|
+
sprite.zoom_x = cell_data[i, 3] / 100.0
|
210
|
+
sprite.zoom_y = cell_data[i, 3] / 100.0
|
211
|
+
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
|
212
|
+
sprite.blend_type = cell_data[i, 7]
|
213
|
+
end
|
214
|
+
end
|
215
|
+
#--------------------------------------------------------------------------
|
216
|
+
# * SE and Flash Timing Processing
|
217
|
+
# timing : Timing data (RPG::Animation::Timing)
|
218
|
+
#--------------------------------------------------------------------------
|
219
|
+
def animation_process_timing(timing)
|
220
|
+
timing.se.play unless @ani_duplicated
|
221
|
+
case timing.flash_scope
|
222
|
+
when 1
|
223
|
+
self.flash(timing.flash_color, timing.flash_duration * @ani_rate)
|
224
|
+
when 2
|
225
|
+
if viewport && !@ani_duplicated
|
226
|
+
viewport.flash(timing.flash_color, timing.flash_duration * @ani_rate)
|
227
|
+
end
|
228
|
+
when 3
|
229
|
+
self.flash(nil, timing.flash_duration * @ani_rate)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|