Bienvenue visiteur !
|
Statistiques
Liste des membres
Contact
Mentions légales
870 connectés actuellement
30729510 visiteurs depuis l'ouverture
3127 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
❤ 0 Auteur : Kameo
Logiciel : RPG Maker XP
Nombre de scripts : 1
Permet d'avoir un overdrive (ou Limit Break), avec les jauges déja intégrées.
Installation
A placer au-dessus de Main.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
| # Script Overdrive (cf.FFX) traduit par Ojiro
# Voilà un script qui permet d'installer une jauge Overdrive
# qui se remplit selon les types : Aggressif, Tenace, Victorieux,
# Lâche, Solo, Leader ou Revenant.
# Le type peut être modifié en cours de jeu grâce à :
# $game_actors [ID].overdrive_type = x
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ?Overdrive - KGC_OverDrive? Traduit par Ojiro
#_/----------------------------------------------------------------------------
#_/ Jauge privée d'un joueur lui permettant d'activer une technique unique.
#_/============================================================================
#==============================================================================
# ? Paramètres ?
#==============================================================================
module KGC
# ?Jauge Max
# Indique la valeur pour que la jauge soit pleine
OD_jauge_MAX = 1000
# ?Progression de la barre Si
# Dépend du Drive Mode du joueur
# Pour le 0 et 1, le Drive s'effectue selon la valeurs des dommages reçus.
OD_GAIN_RATE = [10, 30, 200, 100, 160, 40, 160]
# ?Barre caché en non Combat / True (Vrai) ou False (Faux)
OD_jauge_HIDE = false
end
#???????????????????????????????????????
$game_special_elements = {}
$imported = {}
$data_states = load_data("Data/States.rxdata")
$data_system = load_data("Data/System.rxdata")
$imported["OverDrive"] = true
# OverDrive??
$game_special_elements["overdrive"] = $data_system.elements.index("Overdrive")
#???????????????????????????????????????
#==============================================================================
# ¦ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ? Exécute le processus d'origineExécute le processus d'origine?????
#--------------------------------------------------------------------------
attr_accessor :base_damage # Valeur des Dommmages de Base
#--------------------------------------------------------------------------
# ? Activation de l'Overdrive
#--------------------------------------------------------------------------
alias skill_can_use_KGC_OverDrive skill_can_use?
def skill_can_use?(skill_id)
# Activation de l'Overdrive
if self.is_a?(Game_Actor)
skill = $data_skills[skill_id]
if skill != nil && skill.element_set.include?($game_special_elements["overdrive"])
if self.overdrive < KGC::OD_jauge_MAX
return false
end
end
end
# Exécute le processus d'origine
return skill_can_use_KGC_OverDrive(skill_id)
end
#--------------------------------------------------------------------------
# ? Application effective d'une Aggresif normale
#--------------------------------------------------------------------------
alias attack_effect_KGC_OverDrive attack_effect
def attack_effect(attacker)
@base_damage = nil
# Exécute le processus d'origine
result = attack_effect_KGC_OverDrive(attacker)
if @base_damage == nil
# Retient les dommages de base d'origine
@base_damage = [attacker.atk - self.pdef / 2, 0].max *
(20 + attacker.str) / 20
end
# Dommages reçus
if result && self.damage.is_a?(Numeric)
# Augmentation d'Aggresif
if attacker.is_a?(Game_Actor) && self.is_a?(Game_Enemy) &&
attacker.overdrive_type == 0 && self.base_damage > 0
# Calcul du Drive
od_up = [[self.damage * KGC::OD_GAIN_RATE[0] * 10 / self.base_damage, 1].max, 160].min
# Drive
attacker.overdrive += od_up
# Lors des dégâts reçus
elsif attacker.is_a?(Game_Enemy) && self.is_a?(Game_Actor) &&
self.overdrive_type == 1 && self.base_damage > 0
od_up = [self.damage * KGC::OD_GAIN_RATE[1] * 10 / self.maxhp, 1].max
self.overdrive += od_up
end
end
return result
end
#--------------------------------------------------------------------------
# ? Application effective de la technique
#--------------------------------------------------------------------------
alias skill_effect_KGC_OverDrive skill_effect
def skill_effect(user, skill)
@base_damage = nil
# Exécute le processus d'origine
result = skill_effect_KGC_OverDrive(user, skill)
if @base_damage == nil
# Calcul de la Puissance
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# Calcul d'augmentation en pourcentage
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Retient les dommages de base
@base_damage = power * rate / 20
end
# Lors des Tenaces reçus
if result && self.damage.is_a?(Numeric)
# Augmentation des dégâts
if user.is_a?(Game_Actor) && self.is_a?(Game_Enemy) &&
user.overdrive_type == 0 && self.base_damage > 0
# Calcul du Drive
od_up = [[self.damage * KGC::OD_GAIN_RATE[0] * 10 / self.base_damage, 1].max, 160].min
# Drive
user.overdrive += od_up
# Lors des Tenaces reçus
elsif user.is_a?(Game_Enemy) && self.is_a?(Game_Actor) &&
self.overdrive_type == 1 && self.base_damage > 0
od_up = [self.damage * KGC::OD_GAIN_RATE[1] * 10 / self.maxhp, 1].max
self.overdrive += od_up
end
end
# Lors de l'utilisation de l'Overdrive
if user.is_a?(Game_Actor) && skill.element_set.include?($game_special_elements["overdrive"])
user.overdrive = 0
end
return result
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? Installation
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
# Exécute le processus d'origine
setup_KGC_OverDrive(actor_id)
@overdrive, @overdrive_type = 0, 0
end
#--------------------------------------------------------------------------
# ? Acquisition d'une jauge d'overdrive
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# ? Opération de la jauge Overdrive
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = 0 if @overdrive == nil
@overdrive = [[value, 0].max, KGC::OD_jauge_MAX].min
end
#--------------------------------------------------------------------------
# ? Acquisition du type d'Overdrive
#--------------------------------------------------------------------------
def overdrive_type
@overdrive_type = 0 if @overdrive_type == nil
return @overdrive_type
end
#--------------------------------------------------------------------------
# ? Opération du type d'Overdrive
#--------------------------------------------------------------------------
def overdrive_type=(value)
@overdrive_type = 0 if @overdrive_type == nil
@overdrive_type = value
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ? Initialisation
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive_Base initialize
def initialize(x, y, width, height)
# Exécute le processus d'origine
initialize_KGC_OverDrive_Base(x, y, width, height)
end
#--------------------------------------------------------------------------
# ? Nom
#--------------------------------------------------------------------------
alias draw_actor_name_KGC_OverDrive draw_actor_name
def draw_actor_name(actor, x, y)
unless (!$game_temp.in_battle && KGC::OD_jauge_HIDE)
draw_actor_od_jauge(actor, x + 4, y + 24, 120)
end
# Exécute le processus d'origine
draw_actor_name_KGC_OverDrive(actor, x, y)
end
#--------------------------------------------------------------------------
# ? Jauge OD
#--------------------------------------------------------------------------
def draw_actor_od_jauge(actor, x, y, width, height = 4)
# Jauge
if $game_temp.in_battle && self.is_a?(Window_BattleStatus)
@gs_od[actor.index] = actor.overdrive if @gs_od[actor.index] == nil
x = actor.screen_x - 75
w = actor.overdrive * 30 / (KGC::OD_jauge_MAX / 4)
maximum = @gs_od[actor.index] == KGC::OD_jauge_MAX
else
@jauge_x = 0
x = x
w = actor.overdrive * 30 / (KGC::OD_jauge_MAX / 4)
maximum = actor.overdrive == KGC::OD_jauge_MAX
end
if actor.overdrive == KGC::OD_jauge_MAX
od_color_1 = Color.new(255, 0, 0, 192)
od_color_2 = Color.new(255, 255, 0, 192)
else
od_color_1 = Color.new( 0, 0, 255, 192)
od_color_2 = Color.new( 0, 255, 255, 192)
end
self.contents.fill_rect(x+4, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, od_color_1, (height/4).floor, od_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+4, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, od_color_1, (height/4).ceil , od_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+4, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, od_color_1, (height/4).ceil , od_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+4, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, od_color_1, (height/4).floor, od_color_2)
end
#--------------------------------------------------------------------------
# œ ƒ‰ƒCƒ“•`‰æ by ÷‰ë Ý“y
#--------------------------------------------------------------------------
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
# •`ŽÊ‹——£‚ÌŒvŽZB‘å‚«‚ß‚É’¼ŠpŽž‚Ì’·‚³B
distance = (start_x - end_x).abs + (start_y - end_y).abs
# •`ŽÊŠJŽn
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
self.contents.fill_rect(x, y, width, width, start_color)
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ? Initialisation
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive initialize
def initialize
@jauge_x, @gs_od = 0, []
# Exécute du processus d'origine
initialize_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ? Rafraichissement
#--------------------------------------------------------------------------
alias refresh_KGC_OverDrive refresh
def refresh
# Exécute le processus d'origine
refresh_KGC_OverDrive
for i in 0...$game_party.actors.size
@gs_od[i] = $game_party.actors[i].overdrive
end
end
#--------------------------------------------------------------------------
# ? Renouvelement de la graduation
#--------------------------------------------------------------------------
alias update_KGC_OverDrive update
def update
# Exécute le processus d'origine
update_KGC_OverDrive
# L'image de la gauge est laissée
unless $imported["HPSPAlter"]
end
for i in 0...$game_party.actors.size
draw_actor_od_jauge($game_party.actors[i], 4, 24, 120)
end
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? Fin du combat
# result : Résultat (0:Victorieux 1:Lache 2Rire grinçantéfaite)
#--------------------------------------------------------------------------
alias battle_end_KGC_OverDrive battle_end
def battle_end(result)
case result
when 0 # Victorieux
for actor in $game_party.actors
next unless actor.exist?
# Quand le type d'OD est Victorieux
if actor.overdrive_type == 2
actor.overdrive += KGC::OD_GAIN_RATE[2]
end
end
when 1 # Lache
for actor in $game_party.actors
next unless actor.exist?
# Quand le type d'OD est Lache
if actor.overdrive_type == 3
actor.overdrive += KGC::OD_GAIN_RATE[3]
end
end
end
# Exécute le processus d'origine
battle_end_KGC_OverDrive(result)
end
#--------------------------------------------------------------------------
# ? Renouvelement de la graduation
#--------------------------------------------------------------------------
alias update_phase4_step2_KGC_OverDrive update_phase4_step2
def update_phase4_step2
if @active_battler.is_a?(Game_Actor)
# Augmentation
case @active_battler.overdrive_type
when 4 # Solo
alone = true
for actor in $game_party.actors
next if actor == @active_battler
# S'il y a un survivant, ce n'est pas considéré comme solo.
if actor.exist?
alone = false
break
end
end
od_up = alone ? KGC::OD_GAIN_RATE[4] : 0
when 5 # Action
od_up = KGC::OD_GAIN_RATE[5]
when 6 # Si Revenant
od_up = @active_battler.hp <= @active_battler.maxhp / 4 ? KGC::OD_GAIN_RATE[6] : 0
else
od_up = 0
end
@active_battler.overdrive += od_up
end
# Exécute le processus d'origine
update_phase4_step2_KGC_OverDrive
end
end |
Utilisation
1. Créez un attribut dans la base de données (onglet systeme) que vous nommerez overdrive
2. Créez un skill, celui que vous voulez, avec les dégats et les attributs souhaite, mais surtout mettez l'attribut overdrive
3. Apprenez ce skill à un de vos persos, sinon il sera pas vraiment utile ^^'
4. Selon le type d'overdrive (je vous explique après) vous verrez une jauge bleue se remplir et votre skill sera visible en combat mais vous ne pourrez pas l'utiliser ...
5. Tiens ? Plus de jauge bleue, bonjour la rouge =P Voilà, la jauge est pleine et change de couleur, vous pouvez utiliser l'overdrive ^^
Explication sur les types d'overdrive :
En cours de partie, mettez
1
| $game_actors [ID].overdrive_type = x |
pour changer de type d'overdrive. Remplacez ID par l'ID du héros, et x par :
0 = Aggressif, la jauge se remplit quand vous frapper;
1 = Tenace, la jauge se remplit quand vous vous prennez des coups;
2 = Victorieux, la jauge se remplit quand vous gagner un combat;
3 = Lâche, la jauge se remplit quand vous fuyez un combat;
4 = Solo, la jauge se remplit quand vous êtes seuls;
5 = Leader, la jauge se remplit quand vous êtes dans une équipe;
6 = Revenant, la jauge se remplit selon la vie qu'il vous reste a la fin dun combat.
Explication pour les valeurs (dans le script) :
A la ligne 21 vous avez
Remplacer 1000 par la valeur que vous souhaitez, cela corespond a la valeur max de la jauge d'overdrive.
A la ligne 25
1
| OD_GAIN_RATE = [10, 30, 200, 100, 160, 40, 160] |
Ce sont les points que gagnent le jauge selon le type d'ovredrive. Par défaut, 10 pour aggressif, 30 pour lache, 200 pour victorieux, etc
A la ligne 28
Si vous laissez false, vous verrez la jauge d'overdrive a chaque endroit ou se trouve un nom de héros, si vous mettez true, ce sera uniquement en combat.
Voila, j'espère que ce sera utile ^^
Mis à jour le 8 décembre 2020.
|
nuparu1997 -
posté le 11/11/2009 à 15:57:18 (222 messages postés)
| | waouh... génial...
Ca va servir a certains !!!
(preum's!!)
|
Alkanédon -
posté le 11/11/2009 à 17:12:09 (8351 messages postés)
- - | Citoyen d'Alent | Les scripts de KGC sont Génial, j'ai télécharger un pack de ses script et j"en reviens toutjours pas !
Mieux que MOG ?
|
Mes musiques |
Toitoinne -
posté le 11/11/2009 à 17:35:10 (236 messages postés)
| Experience the power of hammer | Ah tiens, ça tombe bien, le jour où je me demande comment on fait pour faire une jauge d'overdrive, il y a un tutoriel qui arrive sur ça. ^^
Très bon tutoriel, ça va en aider plus d'un.
|
Tu lis ma signature. |
ThrillerProd -
posté le 11/11/2009 à 19:08:17 (1121 messages postés)
| | Compatible avec le TBS ?
|
Actinium Studio : Youtube / (Rm2k3)(A-Rpg) Acsiosa |
Alkanédon -
posté le 11/11/2009 à 20:11:24 (8351 messages postés)
- - | Citoyen d'Alent | Citation:
Ah merde! C'est un script...
|
Mes musiques |
DrakeRoxas -
posté le 11/11/2009 à 21:23:34 (20 messages postés)
| | ThrillerProd, dit moi si ça marche avec ton TBS, sinon envois ton projet et tous ses scripts (suprime les maps si tu veux bien), j'essairais de l'adapter aux scripts ^^
|
ThrillerProd -
posté le 11/11/2009 à 21:56:23 (1121 messages postés)
| | Absolument impressionnant ! Il parfaitement compatible avec le TBS, je l'ai simplement copier coller, il marche sans aucun problème, rien à modifier !
Merci pour ce super script ! La jauge s'est même parfaitement placé !
Une screen pour montrer, la jauge est en dessous du nom, (ça fait un petit WIP pour mon projet :P, c'est une map de test) :
|
Actinium Studio : Youtube / (Rm2k3)(A-Rpg) Acsiosa |
tomoyos -
posté le 12/11/2009 à 16:49:32 (211 messages postés)
| les script sa bug les évent sa fonctionne ! | on peut programmé sa en A rpg à évent facilement en plus j'attendais de savoir comment j'allais programmé sa maintenant je le sais merci !
|
| Imaginer un jeu, c'est bien ... le finir, c'est mieux ... | Mouais, la seul utilité que je lui vois, c'est pour le TBS et pour ceux
qui ne savent pas utiliser l'ancien script, parce que pour mon cas
avec l'ancien on peut beaucoup mieux personnalisé les barres car
la je les trouvent pas terrible ...
|
Pour que votre rpg reste dans les mémoires = http://www.rpg-maker.fr/tutoriels-460-ce-qui-fait-quun-rpg-reste-emblematique-ou-pas-.html ; La réalité, c'est quand la gravité à raisons des gros boobs, le manga, c'est quand les gros boobs ont raisons de la gravité ... |
DrakeRoxas -
posté le 12/11/2009 à 18:17:35 (20 messages postés)
| | Je peux toujours tester de faire des effets du genre une couleur un peu différente a chaque ligne, le mettre plus grand et faire un effet 3D (avec justement le changement de couleur) ...
|
| Imaginer un jeu, c'est bien ... le finir, c'est mieux ... | Bas montre et je te dirai si sa vraiment de la gueule...;)
|
Pour que votre rpg reste dans les mémoires = http://www.rpg-maker.fr/tutoriels-460-ce-qui-fait-quun-rpg-reste-emblematique-ou-pas-.html ; La réalité, c'est quand la gravité à raisons des gros boobs, le manga, c'est quand les gros boobs ont raisons de la gravité ... |
DrakeRoxas -
posté le 23/11/2009 à 20:11:45 (20 messages postés)
| | Voila les même images (a peu près) avec la jauge version 3D ^^
Pour faire ça c'est simple, remplace les lignes 234 à 268 (juste avant le vert) par :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
| def draw_actor_od_jauge(actor, x, y, width, height = 6)
# Jauge
if $game_temp.in_battle && self.is_a?(Window_BattleStatus)
@gs_od[actor.index] = actor.overdrive if @gs_od[actor.index] == nil
x = actor.screen_x - 75
w = actor.overdrive * 30 / (KGC::OD_jauge_MAX / 4)
maximum = @gs_od[actor.index] == KGC::OD_jauge_MAX
else
@jauge_x = 0
x = x
w = actor.overdrive * 30 / (KGC::OD_jauge_MAX / 4)
maximum = actor.overdrive == KGC::OD_jauge_MAX
end
if actor.overdrive == KGC::OD_jauge_MAX
# 1
od_color_11 = Color.new(55, 0, 0, 255)
od_color_21 = Color.new(5, 5, 0, 255)
# 2
od_color_12 = Color.new(155, 0, 0, 255)
od_color_22 = Color.new(125, 125, 0, 255)
od_color_32 = Color.new(77, 0, 0, 255)
od_color_42 = Color.new(125, 125, 0, 255)
# 3
od_color_13 = Color.new(255, 0, 0, 255)
od_color_23 = Color.new(255, 255, 0, 255)
od_color_33 = Color.new(127, 0, 0, 255)
od_color_43 = Color.new(255, 255, 0, 255)
# 4
od_color_14 = Color.new(188, 0, 0, 255)
od_color_24 = Color.new(172, 172, 0, 255)
od_color_34 = Color.new(94, 0, 0, 255)
od_color_44 = Color.new(172, 172, 0, 255)
# 5
od_color_15 = Color.new(121, 0, 0, 255)
od_color_25 = Color.new(89, 89, 0, 255)
od_color_35 = Color.new(60, 0, 0, 255)
od_color_45 = Color.new(89, 89, 0, 255)
# 6
od_color_16 = Color.new(54, 0, 0, 255)
od_color_26 = Color.new(6, 6, 0, 255)
else
# 1
od_color_11 = Color.new( 0, 0, 55, 255)
od_color_21 = Color.new( 0, 5, 5, 255)
# 2
od_color_12 = Color.new( 0, 0, 155, 255)
od_color_22 = Color.new( 0, 125, 125, 255)
od_color_32 = Color.new( 0, 0, 77, 255)
od_color_42 = Color.new( 0, 63, 63, 255)
# 3
od_color_13 = Color.new( 0, 0, 255, 255)
od_color_23 = Color.new( 0, 255, 255, 255)
od_color_33 = Color.new( 0, 0, 127, 255)
od_color_43 = Color.new( 0, 127, 127, 255)
# 4
od_color_14 = Color.new( 0, 0, 188, 255)
od_color_24 = Color.new( 0, 172, 172, 255)
od_color_34 = Color.new( 0, 0, 94, 255)
od_color_44 = Color.new( 0, 86, 86, 255)
# 5
od_color_15 = Color.new( 0, 0, 121, 255)
od_color_25 = Color.new( 0, 89, 89, 255)
od_color_35 = Color.new( 0, 0, 60, 255)
od_color_45 = Color.new( 0, 45, 45, 255)
# 6
od_color_16 = Color.new( 0, 0, 54, 255)
od_color_26 = Color.new( 0, 6, 6, 255)
end
draw_line(x, y, x + w, y, od_color_11, (height/6).floor, od_color_21) # 1
y += (height/6).floor
draw_line(x, y, x + w, y, od_color_12, (height/6).ceil , od_color_22) # 2
y += (height/6).ceil
draw_line(x, y, x + w, y, od_color_13, (height/6).ceil , od_color_23) # 3
y += (height/6).ceil
draw_line(x, y, x + w, y, od_color_14, (height/6).floor, od_color_24) # 4
y += (height/6).ceil
draw_line(x, y, x + w, y, od_color_15, (height/6).floor, od_color_25) # 5
y += (height/6).ceil
draw_line(x, y, x + w, y, od_color_16, (height/6).floor, od_color_26) # 6
if actor.overdrive >= 1
y -= (height).floor
y += (height/3).floor
x2 = x
x3 = x + w
self.contents.fill_rect(x2, y, 1, (height/6).ceil , od_color_32)
self.contents.fill_rect(x3, y, 2, (height/6).ceil , od_color_42)
y += (height/6).floor
x2 -= 1
x3 += 1
self.contents.fill_rect(x2, y, 2, (height/6).ceil , od_color_33)
self.contents.fill_rect(x3, y, 2, (height/6).ceil , od_color_43)
y += (height/6).floor
self.contents.fill_rect(x2, y, 2, (height/6).ceil , od_color_34)
self.contents.fill_rect(x3, y, 2, (height/6).ceil , od_color_44)
x2 += 1
x3 -= 1
y += (height/6).floor
self.contents.fill_rect(x2, y, 1, (height/6).ceil , od_color_35)
self.contents.fill_rect(x3, y, 2, (height/6).ceil , od_color_45)
end
end
|
C'est très dur, après vous devez encore tester le jeu pour jouer avec vos nouvelles jauges =P
Par contre, désolé mais le coté jaune bug et je voit pas pourquoi, parce que si on inverse les couleurs, le jaune bug toujours, y a rien a faire -_-'
|
darckness2995 -
posté le 16/01/2010 à 12:21:07 (1 messages postés)
| | Hum... a vrai dire moi je ne comprend pas j'ai une erreur
Script 'overdrive' line35: Errno::ENOENT occurred.
No such file or directory - Data/States.rxdata
|
dramar -
posté le 06/04/2010 à 07:33:51 (42 messages postés)
| | Crée un element "overdrive" et pas un stat (Systeme) Et dans le script, Il doit te manquer une ligne vu que la ligne 51 c'est #--------------------------------------------------------------------------
|
Un maker qui revient du passé |
lenima51 -
posté le 24/04/2010 à 20:44:47 (1 messages postés)
| | Sa me met pareille que Darkness ...
Jdois faire comment ?
|
lemancool -
posté le 06/06/2010 à 14:34:31 (5 messages postés)
| | Bonjour à tous et à toutes,
Le script ne fonctionne pas, je n'ai pas la jauge mais je peux lancer l'overdrive quand je veux !!!
Merci
|
nol -
posté le 25/02/2012 à 15:49:13 (11 messages postés)
| | cool mais j'ai un souci ligne 644 nomethod error
|
DrakeRoxas -
posté le 29/03/2012 à 09:16:28 (20 messages postés)
| | Effectivement, il y a 2 erreurs dans le script ...
ligne 644 :
1
| @gs_od = $game_party.actors.overdrive |
à remplacer par :
1
| @gs_od = $game_party.actors[i].overdrive |
Et ligne 674 :
1
| draw_actor_od_jauge($game_party.actors, 4, 24, 120) |
à remplacer par :
1
| draw_actor_od_jauge($game_party.actors[i], 4, 24, 120) |
(Si un modérateur pouvait faire les modifications dans le script, ce serai cool ...)
|
MoufMouf -
posté le 20/05/2013 à 21:09:57 (9 messages postés)
| | Problème résolu, script incompatible avec mon script SBV
Bonjour a tous
J'utilise quand a moi VX et j'essaye de faire fonctionner le script suivant:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
| #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ Overdrive System - KGC_OverDrive ◆ VX ◆
#_/ ◇ Last update : 2008/03/13 ◇
#_/ ◆ Translation by Touchfuzzy ◆
#_/ ◆ Additional polish by Mr. Anonymous ◆
#_/-----------------------------------------------------------------------------
#_/ ★ 2008/04/09 UPDATE [MRA] ★
#_/ The defend command may now increase the Overdrive guage. Also added an
#_/ option to have sound effects when the guage becomes full.
#_/-----------------------------------------------------------------------------
#_/ ★ 2008/03/13 UPDATE [KCG] ★
#_/ Several minor bugs fixed.
#_/-----------------------------------------------------------------------------
#_/ This script allows the designer to create skills that are not usable in
#_/ battle until a character gains enough points from specified actions to use
#_/ them. To set up a skill as an "Overdrive" skill (which doesn't appear until
#_/ the Overdrive Gauge is full), go into the database, click the Skills tab,
#_/ locate the skill you desire, and then enter <overdrive> into the "Notes"
#_/ text box. Also, you may desire some skills to increase the Overdrive Gauge
#_/ more than others.
#_/ To do so, enter <OD_GAIN n%> (where n = a number) into the desired skill's
#_/ "Notes" box. Example: <OD_GAIN 200%> would increase Overdrive Points
#_/ gained from Attack Gain Rate (80 by default) by 200 percent (x2).
#_/ The formula for this is [attackgainrate * n / 100]
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#===============================================================================
# ★ Customization ★
#===============================================================================
module KGC
module OverDrive
# ◆ Maximum Gauge Points ◆
# This affects the amount of OP (Overdrive Points) required to fill the
# Overdrive Gauge. Default: GAUGE_MAX = 1000
GAUGE_MAX = 1000
# ◆ Default OP Gain Rates ◆
# You may specify the amount of OP battlers will be rewarded for specific
# actions performed.
GAIN_RATE = [
1000, # 0 Gained per attack.
500, # 1 Gained for taking damage.
# This is per 100% MHP of damage taken, so with 500 you would have
# to take 2 times your MHP to fill a 1000 GAUGE_MAX
200, # 2 Gained for defeating an enemy.
100, # 3 Gained each time you run away from a fight.
160, # 4 Gained for each round spent while fighting solo in battle, either
# being the only character or being the last one alive.
40, # 5 Gained for taking any action in a round
160, # 6 Gained for each round surviving with 25% or less HP remaining.
180, # 7 Gained for each round for guarding.
]
# ◆ Default Actor OD Increase Options ◆
# Default Overdrive types that affect player-characters. The numbers in the
# brackets [] are chosen from the GAIN_RATE above, to the right of the #.
# It appears these numbers "stack" when setting up an individual character's
# Overdrive parameters.
DEFAULT_ACTOR_DRIVE_TYPE = [0, 1, 6, 7]
# ◆ Default Enemy OD Increase Options ◆
# Default Overdrive types that affect enemies. The numbers in the brackets []
# are chosen from the GAIN_RATE above, to the right of the #.
DEFAULT_ENEMY_DRIVE_TYPE = [0, 1, 4, 5, 6]
# ◆ OD Gauge Colors ◆
# Allows you to change the color of the overdrive gauges.
# The color can also be determined by a numerical expression.
# Example: GAUGE_NORMAL_START_COLOR = Color.new(255, 0, 0) <- This is red.
# If you've worked with HTML or image editing software, this should be
# fairly familiar.
GAUGE_NORMAL_START_COLOR = 14
GAUGE_NORMAL_END_COLOR = 6
GAUGE_MAX_START_COLOR = 10
GAUGE_MAX_END_COLOR = 2
# ◆ Empty OD Gauge Upon Death ◆
# This toggle affects wether the OP Gauge is reset to zero once an actor
# dies. true = Reset to 0. false = Gauge remains persistant.
EMPTY_ON_DEAD = true
# ◆ Hide Actor OD Gauge ◆
# Hide the gauge for individual characters. The number of the character in
# the Actors Database is inserted in the brackets.
# Example: HIDE_GAUGE_ACTOR = [2] would always hide the gauge for the second
# actor in the database. (Simple stuff.)
HIDE_GAUGE_ACTOR = []
# ◆ Hide OD Gauge in Menu ◆
# This toggle allows you to hide the Overdrive gauge from the command menu.
# true = Gauge is hidden.
# false = Gauge remains persistant even in menu.
HIDE_GAUGE_NOT_IN_BATTLE = false
# ◆ Hide OD Gauge When Actor Lacks OD Skills ◆
# This toggle allows you to hide the gauge if a character has no Overdrive
# skills in his/her arsenal.
# true = Gauge is hidden.
# false = Gauge is not hidden.
HIDE_GAUGE_NO_OD_SKILLS = false
# ◆ Prevent Actors Without OD Skills From Gaining OP ◆
# This toggle stops OP from being gained for characters that have no Overdrive
# skills when HIDE_GAUGE_NO_OD_SKILLS = true.
NOT_GAIN_GAUGE_HIDING = false
# ◆ Hide OD Skills When Actor Lacks Max OP ◆
# This toggle allows you to specify wether skills that do not yet meet the
# required OP are visible.
# true = Skills are hidden
# false = skills are not hidden.
HIDE_SKILL_LACK_OF_GAUGE = true
# ◆ Play sound on OD Max ◆
# Play sound on gauge max.(Filename, Pitch, Volume)
ODMAX_SOUND = RPG::SE.new("FF7-Limit", 100, 150)
end
end
#------------------------------------------------------------------------------#
$imported = {} if $imported == nil
$imported["OverDrive"] = true
module KGC::OverDrive
module Type
ATTACK = 0
DAMAGE = 1
VICTORY = 2
ESCAPE = 3
ALONE = 4
ACTION = 5
FATAL = 6
GUARD = 7
end
module Regexp
module Skill
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Unless you know what you're doing, it's best not to alter anything beyond #
# this point, as this only affects the tags used for "Notes" in database. #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Whatever word(s) are after the separator ( | ) in the following lines are
# what are used to determine what is searched for in the "Notes" section of a
# skill to see if it is an Overdrive skill.
# Default Overdrive tag is <overdrive>
# Default OD_GAIN_RATE is <OD_GAIN>
OVER_DRIVE = /<(?:OVER_DRIVE|overdrive)[ ]*(\d+)?>/i
OD_GAIN_RATE = /<(?:OD_GAIN_RATE|odgain)[ ]*(\d+)[%%]?>/i
end
end
end
# In events if you wish to use scripting to increase the OD Gauge for a
# character you just use this line "gain_actor_od_gauge(ID, IG)"
# ID = Actor ID Number,
# IG = number of points to increase gauge
# Inserting -1 in ID makes it affect all characters.
# In events if you wish to use scripting to increase the OD Gauge for an
# enemy you just use this line "gain_enemy_od_gauge(ID, IG)"
# ID = Enemy ID Number in group 0-7
# IG = number of points to increase gauge
# Inserting -1 in ID makes it affect all enemies.
# In events if you wish to use scripting to change what increases the OD gauge
# for a character use this line "set_actor_drive_type(ID, [ODT])"
# ID = Actor ID Number
# ODT = numbers of types of Overdrive adders to use
# If the [ODT] is omitted it goes back to the defaults
# In events if you wish to use scripting to change what increases the OD gauge
# for an us this line "set_enemy_drive_type(ID, [ODT])"
# ID = Enemy ID Number in group 0-7
# ODT = numbers of types of Overdrive adders to use
# If the [ODT] is omitted it goes back to the defaults
#==============================================================================
# □ KGC::Commands
#==============================================================================
module KGC::Commands
module_function
#--------------------------------------------------------------------------
# ○ Actor Overdrive Gain Gauge
# actor_id : Actor ID (-1 : Entire Party)
# value : Increase Amount (Subtraction works as well)
#--------------------------------------------------------------------------
def gain_actor_od_gauge(actor_id, value)
if actor_id == -1
# A all living members gauge is operated.
$game_party.existing_members.each { |actor|
actor.overdrive += value
}
else
actor = $game_actors[actor_id]
actor.overdrive += value if actor != nil && actor.exist?
end
end
#--------------------------------------------------------------------------
# ○ Enemy Overdrive Gain Gauge
# enemy_index : Enemy index (-1 : All Enemies)
# value : Increase Amount (Subtraction works as well)
#--------------------------------------------------------------------------
def gain_enemy_od_gauge(enemy_index, value)
if enemy_index == -1
# A all living enemies gauge is operated.
$game_troop.existing_members.each { |enemy|
enemy.overdrive += value
}
else
enemy = $game_troop.members[enemy_index]
enemy.overdrive += value if enemy != nil && enemy.exist?
end
end
#--------------------------------------------------------------------------
# ○ Set Actor Drive Type
# actor_id : Actor ID (-1 : Entire Party)
# types : Array of drive type ( When omitted: Initialization. )
#--------------------------------------------------------------------------
def set_actor_drive_type(actor_id, types = nil)
if actor_id == -1
# A drive type all members is changed.
$game_party.members.each { |actor|
actor.drive_type = types
}
else
actor = $game_actors[actor_id]
actor.drive_type = types if actor != nil
end
end
#--------------------------------------------------------------------------
# ○ Set Enemy Drive Type
# actor_id : Enemy ID (-1 : All Enemies)
# types : Array of drive type ( When omitted: Initialization. )
#--------------------------------------------------------------------------
def set_enemy_drive_type(enemy_index, types = nil)
if enemy_index == -1
# A drive type all enemies is changed.
$game_troop.members.each { |enemy|
enemy.drive_type = types
}
else
enemy = $game_troop.members[enemy_index]
enemy.drive_type = types if enemy != nil
end
end
end
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# ○ Overdrive cache generation
#--------------------------------------------------------------------------
def create_overdrive_cache
@__is_overdrive = false
@__od_cost = KGC::OverDrive::GAUGE_MAX
@__od_gain_rate = 100
self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::OverDrive::Regexp::Skill::OVER_DRIVE
# Overdrive
@__is_overdrive = true
@__od_cost = $1.to_i if $1 != nil
when KGC::OverDrive::Regexp::Skill::OD_GAIN_RATE
# Gauge increase rate
@__od_gain_rate = $1.to_i
end
}
# Unless OverDrive doesn't consume gauge
unless @__is_overdrive
@__od_cost = 0
end
end
#--------------------------------------------------------------------------
# ○ OverDrive is a skill?
#--------------------------------------------------------------------------
def overdrive?
create_overdrive_cache if @__is_overdrive == nil
return @__is_overdrive
end
#--------------------------------------------------------------------------
# ○ Consumption of drive gauge
#--------------------------------------------------------------------------
def od_cost
create_overdrive_cache if @__od_cost == nil
return @__od_cost
end
#--------------------------------------------------------------------------
# ○ The drive gauge increase rate
#--------------------------------------------------------------------------
def od_gain_rate
create_overdrive_cache if @__od_gain_rate == nil
return @__od_gain_rate
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● Open Global Variable
#--------------------------------------------------------------------------
attr_writer :drive_type # Drive Type
#--------------------------------------------------------------------------
# ○ Acquire amount of drive gauge
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# ○ Drive gauge maximum amount acquisition
#--------------------------------------------------------------------------
def max_overdrive
return KGC::OverDrive::GAUGE_MAX
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの操作
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = [[value, max_overdrive].min, 0].max
end
#--------------------------------------------------------------------------
# ○ Sound played on gauge max
#--------------------------------------------------------------------------
def odmax_sound
return KGC::OverDrive::ODMAX_SOUND
end
#------------------------#
def odmax_sound_played?
return false
end
#------------------------#
#--------------------------------------------------------------------------
# ○ ドライブタイプの取得
#--------------------------------------------------------------------------
def drive_type
return []
end
#--------------------------------------------------------------------------
# ○ OverDrive スキル習得済み判定
#--------------------------------------------------------------------------
def overdrive_skill_learned?
return true
end
#--------------------------------------------------------------------------
# ○ ゲージ表示判定
#--------------------------------------------------------------------------
def od_gauge_visible?
return false
end
#--------------------------------------------------------------------------
# ○ ゲージ増加可否判定
#--------------------------------------------------------------------------
def can_gain_overdrive?
return true
end
#--------------------------------------------------------------------------
# ○ 攻撃時増加判定
#--------------------------------------------------------------------------
def drive_attack?
return drive_type.include?(KGC::OverDrive::Type::ATTACK)
end
#--------------------------------------------------------------------------
# ○ 被ダメージ時増加判定
#--------------------------------------------------------------------------
def drive_damage?
return drive_type.include?(KGC::OverDrive::Type::DAMAGE)
end
#--------------------------------------------------------------------------
# ○ 勝利時増加判定
#--------------------------------------------------------------------------
def drive_victory?
return drive_type.include?(KGC::OverDrive::Type::VICTORY)
end
#--------------------------------------------------------------------------
# ○ 逃走時増加判定
#--------------------------------------------------------------------------
def drive_escape?
return drive_type.include?(KGC::OverDrive::Type::ESCAPE)
end
#--------------------------------------------------------------------------
# ○ 孤独時増加判定
#--------------------------------------------------------------------------
def drive_alone?
return drive_type.include?(KGC::OverDrive::Type::ALONE)
end
#--------------------------------------------------------------------------
# ○ 行動時増加判定
#--------------------------------------------------------------------------
def drive_action?
return drive_type.include?(KGC::OverDrive::Type::ACTION)
end
#--------------------------------------------------------------------------
# ○ 瀕死時増加判定
#--------------------------------------------------------------------------
def drive_fatal?
return drive_type.include?(KGC::OverDrive::Type::FATAL)
end
#--------------------------------------------------------------------------
# ○ Determine guard
#--------------------------------------------------------------------------
def drive_guard?
return drive_type.include?(KGC::OverDrive::Type::GUARD)
end
#--------------------------------------------------------------------------
# ● ステートの付加
# state_id : ステート ID
#--------------------------------------------------------------------------
alias add_state_KGC_OverDrive add_state
def add_state(state_id)
add_state_KGC_OverDrive(state_id)
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ スキルの消費ドライブゲージ計算
# skill : スキル
#--------------------------------------------------------------------------
def calc_od_cost(skill)
return 0 unless skill.is_a?(RPG::Skill)
return skill.od_cost
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# skill : スキル
#--------------------------------------------------------------------------
alias skill_can_use_KGC_OverDrive? skill_can_use?
def skill_can_use?(skill)
return false unless skill_can_use_KGC_OverDrive?(skill)
return false if calc_od_cost(skill) > overdrive
return true
end
#--------------------------------------------------------------------------
# ● ダメージの反映
# user : スキルかアイテムの使用者
# 呼び出し前に @hp_damage、@mp_damage、@absorbed が設定されていること。
#--------------------------------------------------------------------------
alias execute_damage_KGC_OverDrive execute_damage
def execute_damage(user)
execute_damage_KGC_OverDrive(user)
increase_overdrive(user)
end
#--------------------------------------------------------------------------
# ○ 死亡時ドライブゲージ初期化処理
#--------------------------------------------------------------------------
def reset_overdrive_on_dead
return unless KGC::OverDrive::EMPTY_ON_DEAD
self.overdrive = 0
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ増加処理
# attacker : 攻撃者
#--------------------------------------------------------------------------
def increase_overdrive(attacker = nil)
return unless attacker.is_a?(Game_Battler) # 攻撃者がバトラーでない
return if self.class == attacker.class # 攻撃側と防御側が同じ
return if hp_damage == 0 && mp_damage == 0 # ダメージなし
if can_gain_overdrive?
increase_attacker_overdrive(attacker)
increase_defender_overdrive(attacker)
end
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ Increase Attacker's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_attacker_overdrive(attacker)
return unless attacker.drive_attack? # Drive type "Attack" none
od_gain = [KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ATTACK], 1].max
if attacker.action.kind == 1
rate = attacker.action.skill.od_gain_rate # Rate of the skill is applied.
od_gain = od_gain * rate / 100
end
attacker.overdrive += od_gain
# Added by Mr. Anonymous 4/9/08
# if attacker's overdrive = gauge_max
if attacker.overdrive == max_overdrive && odmax_sound_played? == false
odmax_sound.play
def odmax_sound_played?
return true
end
end
end
#--------------------------------------------------------------------------
# ○ Increase Defender's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_defender_overdrive(attacker)
return unless self.drive_damage? # No Drive Type "Damage"
rate = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::DAMAGE]
od_gain = hp_damage * rate / maxhp
od_gain += mp_damage * rate / maxmp if maxmp > 0
self.overdrive += [od_gain, 1].max
# Added by Mr. Anonymous 4/9/08
# if actor recieves damage leading to overdrive = gauge_max
if self.overdrive == max_overdrive && odmax_sound_played? == false
odmax_sound.play
def odmax_sound_played?
return true
end
end
end
#--------------------------------------------------------------------------
# ● Skill Effects
# user : User
# skill : Skill
#--------------------------------------------------------------------------
alias skill_effect_KGC_OverDrive skill_effect
def skill_effect(user, skill)
skill_effect_KGC_OverDrive(user, skill)
# If imported KGC_ReproduceFunctions & item used has execute skill tag...
if $imported["ReproduceFunctions"] && $game_temp.exec_skill_on_item
return
end
end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
setup_KGC_OverDrive(actor_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ OverDrive タイプの取得
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ACTOR_DRIVE_TYPE
end
return @drive_type
end
#--------------------------------------------------------------------------
# ○ OverDrive スキル習得済み判定
#--------------------------------------------------------------------------
def overdrive_skill_learned?
result = false
# 一時的に戦闘中フラグを解除
last_in_battle = $game_temp.in_battle
$game_temp.in_battle = false
self.skills.each { |skill|
if skill.overdrive?
result = true
break
end
}
$game_temp.in_battle = last_in_battle
return result
end
#--------------------------------------------------------------------------
# ○ ゲージ増加可否判定
#--------------------------------------------------------------------------
def can_gain_overdrive?
if KGC::OverDrive::NOT_GAIN_GAUGE_HIDING
# 非表示
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
end
if KGC::OverDrive::HIDE_GAUGE_NO_OD_SKILLS
# 未修得
return false unless overdrive_skill_learned?
end
return true
end
#--------------------------------------------------------------------------
# ○ ゲージ表示判定
#--------------------------------------------------------------------------
def od_gauge_visible?
# 戦闘中非表示
if KGC::OverDrive::HIDE_GAUGE_NOT_IN_BATTLE && !$game_temp.in_battle
return false
end
# 非表示
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
# ゲージ増加不可
return false unless can_gain_overdrive?
return true
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# index : 敵グループ内インデックス
# enemy_id : 敵キャラ ID
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive initialize
def initialize(index, enemy_id)
initialize_KGC_OverDrive(index, enemy_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ OverDrive タイプの取得
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ENEMY_DRIVE_TYPE
end
return @drive_type
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ○ ドライブゲージの通常時の色 1 の取得
#--------------------------------------------------------------------------
def od_gauge_normal_color1
color = KGC::OverDrive::GAUGE_NORMAL_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの通常時の色 2 の取得
#--------------------------------------------------------------------------
def od_gauge_normal_color2
color = KGC::OverDrive::GAUGE_NORMAL_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの最大時の色 1 の取得
#--------------------------------------------------------------------------
def od_gauge_max_color1
color = KGC::OverDrive::GAUGE_MAX_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの最大時の色 2 の取得
#--------------------------------------------------------------------------
def od_gauge_max_color2
color = KGC::OverDrive::GAUGE_MAX_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ● 名前の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
alias draw_actor_name_KGC_OverDrive draw_actor_name
def draw_actor_name(actor, x, y)
draw_actor_od_gauge(actor, x, y, 108)
draw_actor_name_KGC_OverDrive(actor, x, y)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 幅
#--------------------------------------------------------------------------
def draw_actor_od_gauge(actor, x, y, width = 120)
return unless actor.od_gauge_visible?
gw = width * actor.overdrive / actor.max_overdrive
gc1 = (gw == width ? od_gauge_max_color1 : od_gauge_normal_color1)
gc2 = (gw == width ? od_gauge_max_color2 : od_gauge_normal_color2)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
end
#==============================================================================
# ■ Window_Skill
#==============================================================================
if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# ○ スキルをリストに含めるかどうか
# skill : スキル
#--------------------------------------------------------------------------
unless $@
alias include_KGC_OverDrive? include? if method_defined?(:include?)
end
def include?(skill)
return false if skill == nil
if defined?(include_KGC_OverDrive?)
return false unless include_KGC_OverDrive?(skill)
end
return false unless skill.overdrive?
return (@actor.calc_od_cost(skill) <= @actor.overdrive)
end
if method_defined?(:include_KGC_OverDrive?)
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @actor.skills
next unless include?(skill)
@data.push(skill)
if skill.id == @actor.last_skill_id
self.index = @data.size - 1
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
end
end # <-- class
end # <-- if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE
#==============================================================================
# ■ Scene_Skill
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# ● Use Skill(The effects of use other than the ally object are applied.)
#--------------------------------------------------------------------------
alias use_skill_nontarget_KGC_OverDrive use_skill_nontarget
def use_skill_nontarget
consume_od_gauge
use_skill_nontarget_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ Consume Drive gauge when skill is used
#--------------------------------------------------------------------------
def consume_od_gauge
@actor.overdrive -= @actor.calc_od_cost(@skill)
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 戦闘終了
# result : 結果 (0:勝利 1:逃走 2:敗北)
#--------------------------------------------------------------------------
alias battle_end_KGC_OverDrive battle_end
def battle_end(result)
increase_overdrive_on_battle_end(result)
battle_end_KGC_OverDrive(result)
end
#--------------------------------------------------------------------------
# ○ 戦闘終了時のドライブゲージ増加処理
# result : 結果 (0:Victory 1:Escape 2:Defeat)
#--------------------------------------------------------------------------
def increase_overdrive_on_battle_end(result)
case result
when 0 # 勝利
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::VICTORY]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_victory?
}
when 1 # 逃走
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ESCAPE]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_escape?
}
end
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行
#--------------------------------------------------------------------------
alias execute_action_KGC_OverDrive execute_action
def execute_action
increase_overdrive_on_action
execute_action_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ Increase Gauge on Action
#--------------------------------------------------------------------------
def increase_overdrive_on_action
battler = @active_battler
od_gain = 0
unit = (battler.actor? ? $game_party : $game_troop)
# Alone
if battler.drive_alone? && unit.existing_members.size == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ALONE]
end
# Action
if battler.drive_action?
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ACTION]
end
# Fatal
if battler.drive_fatal? && battler.hp < battler.maxhp / 4
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::FATAL]
end
# Guard
if battler.drive_guard?
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::GUARD]
end
battler.overdrive += od_gain
end
#--------------------------------------------------------------------------
# ● Execution of battle action: Skill
#--------------------------------------------------------------------------
alias execute_action_skill_KGC_OverDrive execute_action_skill
def execute_action_skill
execute_action_skill_KGC_OverDrive
consume_od_gauge
end
#--------------------------------------------------------------------------
# ○ Drive gauge consumption when skill is used
#--------------------------------------------------------------------------
def consume_od_gauge
skill = @active_battler.action.skill
@active_battler.overdrive -= @active_battler.calc_od_cost(skill)
end
end
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ The original untranslated version of this script can be found here:
# http://f44.aaa.livedoor.jp/~ytomy/tkool/rpgtech/php/tech.php?tool=VX&cat=tech_vx/battle_system&tech=over_drive
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ |
Malheureusement, la jauge ne se réinitialise pas une fois le skill utilisé. Quelqu'un pour m'aider svp?
|
Fyrxx -
posté le 22/02/2014 à 11:29:03 (1 messages postés)
| | Euh j'ai un problème:
Quand je lance un combat avec ce Script un message apparait et dit :
Scrip "Overdrive" line 473: NameError occured
Merci de votre aide
|
Wolfy -
posté le 11/12/2020 à 02:47:33 (2 messages postés)
| Seul le Feu sauvera notre Clan | C'est quoi l'Overdrive ? C'est comme les Limit Breaks dans FF ?
|
Gari -
posté le 11/12/2020 à 10:33:58 (5901 messages postés)
- | | Oui.
Edit 14 juin 2021.
Le script présenté ne fonctionnant apparemment pas, voici la version traduite en anglais, qui est un peu différente (étendue par Mr Anonymous).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
| #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ OverDrive System - KGC_OverDrive ◆ VX ◆
#_/ ◇ Last Update: 2008/08/28 ◇
#_/ ◆ Original Translation by Touchfuzzy ◆
#_/ ◆ Extended Translation and Updates by Mr. Anonymous ◆
#_/ ◆ KGC Site: ◆
#_/ ◆ http://f44.aaa.livedoor.jp/~ytomy/ ◆
#_/ ◆ Translator's Blog: ◆
#_/ ◆ http://mraprojects.wordpress.com ◆
#_/-----------------------------------------------------------------------------
#_/ This script allows the designer to create skills that are not usable in
#_/ battle until a character gains enough points from specified actions to use
#_/ them. To set up a skill as an "Overdrive" skill (which doesn't appear until
#_/ the Overdrive Gauge is full), go into the database, click the Skills tab,
#_/ locate the skill you desire, and then enter <overdrive> into the "Notes"
#_/ text box. Also, you may desire some skills to increase the Overdrive Gauge
#_/ more than others.
#_/ To do so, enter <OD_gain n%> (where n = a number) into the desired skill's
#_/ "Notes" box. Example: <OD_gain 200%> would increase Overdrive Points
#_/ gained from Attack Gain Rate (80 by default) by 200 percent (x2).
#_/ The formula for this is [attackgainrate * n / 100]
#_/=============================================================================
#_/ ◆ Script Commands ◆
#_/ These commands are used in "Script" function in the third page of event
#_/ commands under "Advanced".
#_/
#_/ Increase OverDrive for an actor:
#_/ * gain_actor_od_gauge(ActorID, Increase)
#_/
#_/ Increase OverDrive for an enemy:
#_/ * gain_enemy_od_gauge(EnemyID, Increase)
#_/
#_/ Modify an actor's drive types:
#_/ * set_actor_drive_type(ActorID, [DriveTypes])
#_/
#_/ Modify an enemy's drive types:
#_/ * set_enemy_drive_type(EnemyID, [DriveTypes])
#_/
#_/ [ Quick Key: ]
#_/ [ ActorID = The ID number of the selected Actor in the database. ]
#_/ [ Setting this to -1 will effect all actors. ]
#_/ [ ]
#_/ [ EnemyID = The ID number of the selected Enemy in the current troop. 0-7 ]
#_/ [ Setting this to -1 will effect all enemies. ]
#_/ [ ]
#_/ [ Increase = The amount of OverDrive points to increase. ]
#_/ [ ]
#_/ [ DriveTypes = The drive types as seen below in the customization block ]
#_/ [ "DEFAULT_ACTOR_DRIVE_TYPE". If this is omitted, it's reset to default. ]
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#=============================================================================#
# ★ Customization ★ #
#=============================================================================#
module KGC
module OverDrive
# ◆ Maximum Gauge Points ◆
# This affects the amount of OP (Overdrive Points) required to fill the
# Overdrive Gauge. Default: GAUGE_MAX = 1000
GAUGE_MAX = 1000
# ◆ Default OP Gain Rates ◆
# You may specify the amount of OverDrive Points that battlers will be given
# for specific actions performed.
GAIN_RATE = [
100, # 0 Gained per attack.
500, # 1 Gained for taking damage.
# This is per 100% MaxHP of damage taken, so with 500 you would
# have to take 2 times your MaxHP to fill a 1,000 point GAUGE_MAX.
200, # 2 Gained for defeating an enemy.
100, # 3 Gained each time you run away from a fight.
160, # 4 Gained for each round spent while fighting solo in battle, either
# being the only character or being the last one alive.
40, # 5 Gained for taking any action in a round
160, # 6 Gained for each round surviving with 25% or less HP remaining.
180, # 7 Gained for each round for guarding.
] # ← No not remove these lines. Alter to your heart's content, though.
# ◆ Amount of Gauges ◆
# This allows you to specify how many gauges the actor has. These gauges stack
# meaning when that after the first gauge is maxed, OverDrive points are
# allocated to the next gauge. This also means that after using an OverDrive
# skill, OverDrive points are given for that action if applicable.
# As a final note, these gauges are displayed as one whole gauge.
DEFAULT_GAUGE_NUMBER = 1
# ◆ Default Actor OverDrive Increase Options ◆
# Default Overdrive types that affect player-characters. The numbers in the
# brackets [] are chosen from the GAIN_RATE above, to the right of the #.
# It appears these numbers "stack" when setting up an individual character's
# Overdrive parameters.
DEFAULT_ACTOR_DRIVE_TYPE = [0, 1, 6, 7]
# ◆ Default Enemy OverDrive Increase Options ◆
# Default Overdrive types that affect enemies. The numbers in the brackets []
# are chosen from the GAIN_RATE above, to the right of the #.
DEFAULT_ENEMY_DRIVE_TYPE = [0, 1, 4, 5, 6]
# ◆ OverDrive Gauge Colors ◆
# Allows you to change the color of the overdrive gauges.
# The color can also be determined by a red, green, and blue values.
# Example: GAUGE_NORMAL_START_COLOR = Color.new(255, 0, 0) <- This is red.
# This method of color assignment is much like Tint Screen event command.
# Gauge Start Color
GAUGE_NORMAL_START_COLOR = 14
# Gauge End Color
GAUGE_NORMAL_END_COLOR = 6
# Max Gauge Start Color
GAUGE_MAX_START_COLOR = 10
# Max Gauge End Color
GAUGE_MAX_END_COLOR = 2
# ◆ Gauge Y Coordinate ◆
# This allows you to adjust the Y coordinate(depth) of the overdrive gauge.
# Setting to -8 places the OD gauge at the same depth as the HP/MP gauges.
GAUGE_OFFSET_Y = -8
# ◆ Numerical Display of OverDrive Gauge Style ◆
# This function allows you to display a numerical representation of the
# current amount of OverDrive points an actor has.
# 0: No numerical amount is displayed.
# 1: Default - Displays the current amount as a straight number.
# 2: Ratio 1 --> x%
# 3: Ratio 2 --> x.x%
# 4: Ratio 3 --> x.xx%
# 5: Maxing - Amount of times the gauge has maxed since the battle started.
GAUGE_VALUE_STYLE = 2
# ◆ Numerical Display Font Size ◆
# This allows you to change the font size of the numerical display of the
# OverDrive gauge, as defined above.
GAUGE_VALUE_FONT_SIZE = 14
# ◆ Empty OD Gauge Upon Death ◆
# This toggle affects wether the OP Gauge is reset to zero once an actor
# dies. true = Reset to 0. false = Gauge remains persistant.
EMPTY_ON_DEAD = true
# ◆ Hide Actor OD Gauge ◆
# Hide the gauge for individual characters. The number of the character in
# the Actors Database is inserted in the brackets.
# Example: HIDE_GAUGE_ACTOR = [2] would always hide the gauge for the second
# actor in the database. (Simple stuff.)
HIDE_GAUGE_ACTOR = []
# ◆ Hide OD Gauge in Menu ◆
# This toggle allows you to hide the Overdrive gauge from the command menu.
# true = Gauge is hidden.
# false = Gauge remains persistant even in menu.
HIDE_GAUGE_NOT_IN_BATTLE = false
# ◆ Hide OD Gauge When Actor Lacks OD Skills ◆
# This toggle allows you to hide the gauge if a character has no Overdrive
# skills in his/her arsenal.
# true = Gauge is hidden.
# false = Gauge is not hidden.
HIDE_GAUGE_NO_OD_SKILLS = true
# ◆ Prevent Actors Without OD Skills From Gaining OP ◆
# This toggle stops OP from being gained for characters that have no Overdrive
# skills when HIDE_GAUGE_NO_OD_SKILLS = true.
NOT_GAIN_GAUGE_HIDING = true
# ◆ Hide OD Skills When Actor Lacks Max OP ◆
# This toggle allows you to specify wether skills that do not yet meet the
# required OP are visible.
# true = Skills are hidden
# false = skills are not hidden.
HIDE_SKILL_LACK_OF_GAUGE = false
# ◆ Use Image as Gauge Toggle ◆
# If set to true, the old-style system-drawn gauges are replaced by user
# created images. Note that as of now, using this option hides the numerical
# gauge display function. This MAY be fixed by adjusting GAUGE_OFFSET_Y as
# seen above, but hasn't been tested.
USE_IMAGE_GAUGE = true
# ◆ Gauge Image Graphic ◆
# This setting allows you to define the image you want to use as the drive
# gauge bar. The image must be located in the "Graphics\System" folder.
GAUGE_IMAGE = "gauge_od2"
# ◆ Menu Gauge Image Position [x, y] ◆
# Actor names are relative to the coordinates in the menu defined below.
GAUGE_POSITION = [-32, -8]
# ◆ Menu Gauge Image Length ◆
# For a longer or shorter gauge, increase or decrease this number.
GAUGE_LENGTH = 52
# ◆ Battle Gauge Image Position [x, y] ◆
# Actor names are relative to the coordinates during battle defined below.
GAUGE_POSITION_BATTLE = [-32, -8]
# ◆ Battle Gauge Image Length ◆
# For a longer or shorter gauge, increase or decrease this number.
GAUGE_LENGTH_BATTLE = 52
# ◆ OverDrive Max Sound Play ◆
# Sound played on overdrive gauge max. (Filename, Pitch, Volume)
# Sounds are selected from the Audio\SE folder.
ODMAX_SOUND = RPG::SE.new("Flash2", 100, 150)
end
end
#=============================================================================#
# ★ End Customization ★ #
#=============================================================================#
#=================================================#
# IMPORT #
#=================================================#
$imported = {} if $imported == nil
$imported["OverDrive"] = true
#=================================================#
module KGC::OverDrive
# Drive Increase Type Module
module Type
ATTACK = 0 # Attack
DAMAGE = 1 # Damage
VICTORY = 2 # Victory
ESCAPE = 3 # Escape
ALONE = 4 # Alone
ACTION = 5 # Action
FATAL = 6 # Fatal
GUARD = 7 # Guard
end
#=================================================#
# Numerical Display of OverDrive Gauge
module ValueStyle
NONE = 0 # None
IMMEDIATE = 1 # Immediate
RATE = 2 # Ratio 1
RATE_DETAIL1 = 3 # Ratio 2
RATE_DETAIL2 = 4 # Ratio 3
NUMBER = 5 # Gauge Number
end
#==============================================================================
# □ KGC::SkillCPSystem::Regexp
#==============================================================================
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Note Field Tag Strings #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Whatever word(s) are after the separator ( | ) in the following lines are
# what are used to determine what is searched for in the "Note" section of a
# skill.
# Regular Expressions Module
module Regexp
# Skill Module
module Skill
# OverDrive tag string
OVER_DRIVE = /<(?:OVER_DRIVE|overdrive)\s*(\d+)?>/i
# OverDrive Gain Rate tag string
OD_GAIN_RATE = /<(?:OD_GAIN_RATE|OD_gain)\s*(\d+)[%%]?>/i
end
end
end
#=================================================#
#==============================================================================
# □ KGC::Commands
#==============================================================================
module KGC
module Commands
module_function
#--------------------------------------------------------------------------
# ○ Actor Overdrive Gain Gauge
# actor_id : Actor ID (-1 : Entire Party)
# value : Increase Amount (Subtraction works as well)
#--------------------------------------------------------------------------
def gain_actor_od_gauge(actor_id, value)
if actor_id == -1
# All living party members gauge is operated.
$game_party.existing_members.each { |actor|
actor.overdrive += value
}
else
actor = $game_actors[actor_id]
actor.overdrive += value if actor != nil && actor.exist?
end
end
#--------------------------------------------------------------------------
# ○ Enemy Overdrive Gain Gauge
# enemy_index : Enemy index (-1 : All Enemies)
# value : Increase Amount (Subtraction works as well)
#--------------------------------------------------------------------------
def gain_enemy_od_gauge(enemy_index, value)
if enemy_index == -1
# All living enemies in troop's gauge is operated.
$game_troop.existing_members.each { |enemy|
enemy.overdrive += value
}
else
enemy = $game_troop.members[enemy_index]
enemy.overdrive += value if enemy != nil && enemy.exist?
end
end
#--------------------------------------------------------------------------
# ○ Get Actor OverDrive Gauge
# actor_id : Actor ID (-1 : Entire Party)
# variable_id : Variable ID
#--------------------------------------------------------------------------
def get_actor_od_gauge(actor_id, variable_id = 0)
actor = $game_actors[actor_id]
n = (actor != nil ? actor.overdrive : 0)
if variable_id > 0
$game_variables[variable_id] = n
end
return n
end
#--------------------------------------------------------------------------
# ○ Get Enemy OverDrive Gauge
# enemy_index : EnemyID (-1 : Entire Party)
# variable_id : Variable ID
#--------------------------------------------------------------------------
def get_enemy_od_gauge(enemy_index, variable_id = 0)
enemy = $game_troop.members[enemy_index]
n = (enemy != nil ? enemy.overdrive : 0)
if variable_id > 0
$game_variables[variable_id] = n
end
return n
end
#--------------------------------------------------------------------------
# ○ Set Actor Drive Number
# actor_id : Actor ID (-1 : Entire Party)
# number : Array of number type
#--------------------------------------------------------------------------
def set_actor_od_gauge_number(actor_id, number)
if actor_id == -1
# All living party members members gauge is operated.
$game_party.members.each { |actor|
actor.drive_gauge_number = number
}
else
actor = $game_actors[actor_id]
actor.drive_gauge_number = number if actor != nil
end
end
#--------------------------------------------------------------------------
# ○ Set Enemy Drive Number
# enemy_index : Enemy ID
# number : Array of number type
#--------------------------------------------------------------------------
def set_enemy_od_gauge_number(enemy_index, number)
if enemy_index == -1
# All living enemies in troop's gauge is operated.
$game_troop.members.each { |enemy|
enemy.drive_gauge_number = number
}
else
enemy = $game_troop.members[enemy_index]
enemy.drive_gauge_number = number if enemy != nil
end
end
#--------------------------------------------------------------------------
# ○ Determine Actor Drive Max
# actor_id : ActorID
#--------------------------------------------------------------------------
def actor_od_gauge_max?(actor_id)
actor = $game_actors[actor_id]
return false if actor == nil
return actor.overdrive == actor.max_overdrive
end
#--------------------------------------------------------------------------
# ○ Determine Enemy Drive Max
# enemy_index : Enemy Index
#--------------------------------------------------------------------------
def enemy_od_gauge_max?(enemy_index)
enemy = $game_troop.members[enemy_index]
return false if enemy == nil
return enemy.overdrive == enemy.max_overdrive
end
#--------------------------------------------------------------------------
# ○ Set Actor Drive Type
# actor_id : Actor ID (-1 : Entire Party)
# types : Array of drive type ( When omitted: Initialization. )
#--------------------------------------------------------------------------
def set_actor_drive_type(actor_id, types = nil)
if actor_id == -1
# Set all party members' drive types
$game_party.members.each { |actor|
actor.drive_type = types
}
else
actor = $game_actors[actor_id]
actor.drive_type = types if actor != nil
end
end
#--------------------------------------------------------------------------
# ○ Set Enemy Drive Type
# actor_id : Enemy ID (-1 : All Enemies)
# types : Array of drive type ( When omitted: Initialization. )
#--------------------------------------------------------------------------
def set_enemy_drive_type(enemy_index, types = nil)
if enemy_index == -1
# All enemies' gauge is operated.
$game_troop.members.each { |enemy|
enemy.drive_type = types
}
else
enemy = $game_troop.members[enemy_index]
enemy.drive_type = types if enemy != nil
end
end
end
end
#=================================================#
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# ○ Overdrive cache generation
#--------------------------------------------------------------------------
def create_overdrive_cache
@__is_overdrive = false
@__od_cost = KGC::OverDrive::GAUGE_MAX
@__od_gain_rate = 100
self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::OverDrive::Regexp::Skill::OVER_DRIVE
# Overdrive
@__is_overdrive = true
@__od_cost = $1.to_i if $1 != nil
when KGC::OverDrive::Regexp::Skill::OD_GAIN_RATE
# Gauge increase rate
@__od_gain_rate = $1.to_i
end
}
# Unless OverDrive doesn't consume gauge
unless @__is_overdrive
@__od_cost = 0
end
end
#--------------------------------------------------------------------------
# ○ OverDrive is a skill?
#--------------------------------------------------------------------------
def overdrive?
create_overdrive_cache if @__is_overdrive == nil
return @__is_overdrive
end
#--------------------------------------------------------------------------
# ○ Consumption of drive gauge
#--------------------------------------------------------------------------
def od_cost
create_overdrive_cache if @__od_cost == nil
return @__od_cost
end
#--------------------------------------------------------------------------
# ○ The drive gauge increase rate
#--------------------------------------------------------------------------
def od_gain_rate
create_overdrive_cache if @__od_gain_rate == nil
return @__od_gain_rate
end
end
#=================================================#
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● Public Instance Variables
#--------------------------------------------------------------------------
attr_writer :drive_type # Drive Type
attr_writer :odmax_sound_played # OverDrive Max Sound Flag
#--------------------------------------------------------------------------
# ○ Acquire amount of drive gauge
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# ○ Drive Gauge Max Acquisition
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = [[value, max_overdrive].min, 0].max
end
#--------------------------------------------------------------------------
# ○ Obtain Max OverDrive
#--------------------------------------------------------------------------
def max_overdrive
return KGC::OverDrive::GAUGE_MAX * drive_gauge_number
end
#--------------------------------------------------------------------------
# ○ Numerical Drive Gauge Definition
#--------------------------------------------------------------------------
def drive_gauge_number
if @drive_gauge_number == nil
@drive_gauge_number = KGC::OverDrive::DEFAULT_GAUGE_NUMBER
end
return @drive_gauge_number
end
#--------------------------------------------------------------------------
# ○ Aquire Numerical Drive Value
#--------------------------------------------------------------------------
def drive_gauge_number=(value)
@drive_gauge_number = [value, 1].max
end
#--------------------------------------------------------------------------
# ○ Define Drive Type
#--------------------------------------------------------------------------
def drive_type
return []
end
#--------------------------------------------------------------------------
# ○ Determine OverDrive Skill Aquired
#--------------------------------------------------------------------------
def overdrive_skill_learned?
return true
end
#--------------------------------------------------------------------------
# ○ Determine True/False Gauge Display
#--------------------------------------------------------------------------
def od_gauge_visible?
return false
end
#--------------------------------------------------------------------------
# ○ Determine True/False Gauge Increase
#--------------------------------------------------------------------------
def can_gain_overdrive?
return true
end
#--------------------------------------------------------------------------
# ○ Defined Sound Played on Gauge Max - Added by Mr. Anonymous 8/19/08
#--------------------------------------------------------------------------
def odmax_sound
return KGC::OverDrive::ODMAX_SOUND
end
#--------------------------------------------------------------------------
# ○ Defined Sound Played on Gauge Max - Added by Mr. Anonymous 8/19/08
#--------------------------------------------------------------------------
def odmax_sound_played
# return true
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Attack
#--------------------------------------------------------------------------
def drive_attack?
return drive_type.include?(KGC::OverDrive::Type::ATTACK)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Damage
#--------------------------------------------------------------------------
def drive_damage?
return drive_type.include?(KGC::OverDrive::Type::DAMAGE)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Victory
#--------------------------------------------------------------------------
def drive_victory?
return drive_type.include?(KGC::OverDrive::Type::VICTORY)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Escape
#--------------------------------------------------------------------------
def drive_escape?
return drive_type.include?(KGC::OverDrive::Type::ESCAPE)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Alone
#--------------------------------------------------------------------------
def drive_alone?
return drive_type.include?(KGC::OverDrive::Type::ALONE)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Action
#--------------------------------------------------------------------------
def drive_action?
return drive_type.include?(KGC::OverDrive::Type::ACTION)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Fatal
#--------------------------------------------------------------------------
def drive_fatal?
return drive_type.include?(KGC::OverDrive::Type::FATAL)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Guard
#--------------------------------------------------------------------------
def drive_guard?
return drive_type.include?(KGC::OverDrive::Type::GUARD)
end
#--------------------------------------------------------------------------
# ● State Addition
# state_id : State ID
#--------------------------------------------------------------------------
alias add_state_KGC_OverDrive add_state
def add_state(state_id)
add_state_KGC_OverDrive(state_id)
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ Calculate Skill Drive Gauge Consumption
# skill : Skill
#--------------------------------------------------------------------------
def calc_od_cost(skill)
return 0 unless skill.is_a?(RPG::Skill)
return skill.od_cost
end
#--------------------------------------------------------------------------
# ● Skill Use Determination
# skill : Skill
#--------------------------------------------------------------------------
alias skill_can_use_KGC_OverDrive? skill_can_use?
def skill_can_use?(skill)
return false unless skill_can_use_KGC_OverDrive?(skill)
return false if calc_od_cost(skill) > overdrive
return true
end
#--------------------------------------------------------------------------
# ● Execute Damage
# user : User of Skill or Item
# Before @hp_damage、@mp_damage、@absorbed is called, they must be set.
#--------------------------------------------------------------------------
alias execute_damage_KGC_OverDrive execute_damage
def execute_damage(user)
execute_damage_KGC_OverDrive(user)
increase_overdrive(user)
end
#--------------------------------------------------------------------------
# ○ Reset OverDrive on Death
#--------------------------------------------------------------------------
def reset_overdrive_on_dead
return unless KGC::OverDrive::EMPTY_ON_DEAD
self.overdrive = 0
end
#--------------------------------------------------------------------------
# ○ Increase Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_overdrive(attacker = nil)
return unless attacker.is_a?(Game_Battler) # Unless attacker is a battler
return if self.class == attacker.class # and attacker class is predefined
return if hp_damage == 0 && mp_damage == 0 # and they cannot attack,
# if they can gain overdrive...
if can_gain_overdrive?
# increase the overdrive.
increase_attacker_overdrive(attacker)
increase_defender_overdrive(attacker)
end
# If battler dies, reset overdrive.
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ Increase Attacker's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_attacker_overdrive(attacker)
return unless attacker.drive_attack? # Unless attack has od attack type
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ATTACK]
if attacker.action.kind == 1
rate = attacker.action.skill.od_gain_rate # obtain rate from od type
od_gain = od_gain * rate / 100
if rate > 0
od_gain = [od_gain, 1].max
elsif rate < 0
od_gain = [od_gain, -1].min
end
end
attacker.overdrive += od_gain
#----------------------------------------------------------------
# Determine OverDrive Max Sound's play state and play when maxed.
# Added by Mr. Anonymous 8/19/08
#----------------------------------------------------------------
# If Attacker's overdrive is greater than GAUGE_MAX...
if attacker.overdrive < KGC::OverDrive::GAUGE_MAX
# set attacker's overdrive max sound played flag to false.
attacker.odmax_sound_played = false
end
# If attacker's overdrive max sound played flag is set to false...
if attacker.odmax_sound_played == false
# and attacker's overdrive is equal to GAUGE_MAX...
if attacker.overdrive == KGC::OverDrive::GAUGE_MAX
# Play overdrive max sound...
odmax_sound.play
# set attacker's overdrive max sound played flag to true.
attacker.odmax_sound_played = true
end
end
#----------------------------------------------------------------
# End max OverDrive determination.
#----------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ○ Increase Attacker's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_defender_overdrive(attacker)
return unless self.drive_damage? # Unless attacker has od damage type
rate = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::DAMAGE]
od_gain = 0
od_gain += hp_damage * rate / maxhp if hp_damage > 0
od_gain += mp_damage * rate / maxmp if mp_damage > 0 && maxmp > 0
if rate > 0
od_gain = [od_gain, 1].max
elsif rate < 0
od_gain = [od_gain, -1].min
end
self.overdrive += od_gain
#----------------------------------------------------------------
# Determine OverDrive Max Sound's play state and play when maxed.
# Added by Mr. Anonymous 8/19/08
#----------------------------------------------------------------
# If defender's overdrive is greater than GAUGE_MAX...
if self.overdrive < KGC::OverDrive::GAUGE_MAX
# set defender's overdrive max sound played flag to false.
self.odmax_sound_played = false
end
# If defender's overdrive max sound played flag is set to false...
if self.odmax_sound_played == false
# and defender's overdrive is equal to GAUGE_MAX...
if self.overdrive == KGC::OverDrive::GAUGE_MAX
# Play overdrive max sound...
odmax_sound.play
# set defender's overdrive max sound played flag to true.
self.odmax_sound_played = true
end
end
#----------------------------------------------------------------
# End max OverDrive determination.
#----------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ● Skill Effects
# user : User
# skill : Skill
#--------------------------------------------------------------------------
alias skill_effect_KGC_OverDrive skill_effect
def skill_effect(user, skill)
skill_effect_KGC_OverDrive(user, skill)
# If imported KGC_ReproduceFunctions & item used has execute skill tag...
if $imported["ReproduceFunctions"] && $game_temp.exec_skill_on_item
return
end
end
end
#=================================================#
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Setup
# actor_id : ActorID
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
setup_KGC_OverDrive(actor_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ Aquire OverDrive Type
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ACTOR_DRIVE_TYPE
end
return @drive_type
end
#--------------------------------------------------------------------------
# ○ Determine OverDrive Skill Aquired
#--------------------------------------------------------------------------
def overdrive_skill_learned?
result = false
# Temporarily Cancel Battle Flag
last_in_battle = $game_temp.in_battle
$game_temp.in_battle = false
self.skills.each { |skill|
if skill.overdrive?
result = true
break
end
}
$game_temp.in_battle = last_in_battle
return result
end
#--------------------------------------------------------------------------
# ○ Determine Gauge Increase
#--------------------------------------------------------------------------
def can_gain_overdrive?
if KGC::OverDrive::NOT_GAIN_GAUGE_HIDING
# Hide
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
end
if KGC::OverDrive::HIDE_GAUGE_NO_OD_SKILLS
# No learned
return false unless overdrive_skill_learned?
end
return true
end
#--------------------------------------------------------------------------
# ○ Determine Gauge Display
#--------------------------------------------------------------------------
def od_gauge_visible?
# Hide gauge in Battle
if KGC::OverDrive::HIDE_GAUGE_NOT_IN_BATTLE && !$game_temp.in_battle
return false
end
# Hide Gauge
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
# Gauge amount doesn't increase.
return false unless can_gain_overdrive?
return true
end
end
#=================================================#
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● Object Initialization
# index : Index in enemy group
# enemy_id : EnemyID
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive initialize
def initialize(index, enemy_id)
initialize_KGC_OverDrive(index, enemy_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ Aquire OverDrive Type
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ENEMY_DRIVE_TYPE
end
return @drive_type
end
end
#=================================================#
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#----------------------------------------------------------------------
# Determine Gauge Image Type
# - Added by Mr. Anonymous 8/19/08
# If the user doesn't use gauge images, define system gauge properties.
#----------------------------------------------------------------------
if KGC::OverDrive::USE_IMAGE_GAUGE = false
#--------------------------------------------------------------------------
# ○ OD Gauge Normal Color 1
#--------------------------------------------------------------------------
def od_gauge_normal_color1
color = KGC::OverDrive::GAUGE_NORMAL_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ OD Gauge Normal Color 2
#--------------------------------------------------------------------------
def od_gauge_normal_color2
color = KGC::OverDrive::GAUGE_NORMAL_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ OD Gauge Max Color 1
#--------------------------------------------------------------------------
def od_gauge_max_color1
color = KGC::OverDrive::GAUGE_MAX_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ OD Gauge Max Color 2
#--------------------------------------------------------------------------
def od_gauge_max_color2
color = KGC::OverDrive::GAUGE_MAX_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
end # <- if KGC::OverDrive::USE_IMAGE_GAUGE = false
#--------------------------------------------------------------------------
# ● Draw Actor Name
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
#--------------------------------------------------------------------------
alias draw_actor_name_KGC_OverDrive draw_actor_name
def draw_actor_name(actor, x, y)
draw_actor_od_gauge(actor, x, y, 108)
draw_actor_name_KGC_OverDrive(actor, x, y)
end
#----------------------------------------------------------------------
# Determine Gauge Image Type
# - Added by Mr. Anonymous 8/19/08
# If the user doesn't use gauge images, draw system gauge.
#----------------------------------------------------------------------
if KGC::OverDrive::USE_IMAGE_GAUGE = false
#--------------------------------------------------------------------------
# ○ Draw Actor OverDrive Gauge
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
# width : Width
#--------------------------------------------------------------------------
def draw_actor_od_gauge(actor, x, y, width = 120)
return unless actor.od_gauge_visible?
n = actor.overdrive % KGC::OverDrive::GAUGE_MAX
n = KGC::OverDrive::GAUGE_MAX if actor.overdrive == actor.max_overdrive
gw = width * n / KGC::OverDrive::GAUGE_MAX
gc1 = (gw == width ? od_gauge_max_color1 : od_gauge_normal_color1)
gc2 = (gw == width ? od_gauge_max_color2 : od_gauge_normal_color2)
self.contents.fill_rect(x, y + WLH + KGC::OverDrive::GAUGE_OFFSET_Y,
width, 6, gauge_back_color)
self.contents.gradient_fill_rect(
x, y + WLH + KGC::OverDrive::GAUGE_OFFSET_Y, gw, 6, gc1, gc2)
draw_actor_od_gauge_value(actor, x, y, width)
end
#----------------------------------------------------------------------
# Determine Gauge Image Type
# - Added by Mr. Anonymous 8/19/08
# Else, the user IS using gauge images...
#----------------------------------------------------------------------
else
#--------------------------------------------------------------------------
# ○ Draw Actor OverDrive Gauge
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
# in_width : Inner Width
#--------------------------------------------------------------------------
def draw_actor_od_gauge(actor, x, y, in_width)
# Exit process if the OD Gauge isn't visible.
return unless actor.od_gauge_visible?
bitmap = self.contents
# Define the gauge image.
gauge = Bitmap.new("Graphics/System/" + KGC::OverDrive::GAUGE_IMAGE)
nx = x # X Coordinate
ny = y # Y Coordinate
nw = in_width # Inner image width
if $game_temp.in_battle # If inside a battle
# Pull customized battle values from the OverDrive module.
nx += KGC::OverDrive::GAUGE_POSITION_BATTLE[0]
ny += KGC::OverDrive::GAUGE_POSITION_BATTLE[1]
nw += KGC::OverDrive::GAUGE_LENGTH_BATTLE
else # when outside of battle
# Pull customized values from the OverDrive module.
nx += KGC::OverDrive::GAUGE_POSITION[0]
ny += KGC::OverDrive::GAUGE_POSITION[1]
nw += KGC::OverDrive::GAUGE_LENGTH
end
gauge_width = calc_od_gauge_width(actor, nw)
full = (gauge_width == nw - 64)
draw_od_gauge_back(bitmap, gauge, nx, ny, nw)
draw_od_gauge_inside(bitmap, gauge, nx, ny, nw, gauge_width, full)
draw_od_gauge_fore(bitmap, gauge, nx, ny, nw)
draw_actor_od_gauge_value(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ○ Draw Gauge Background
# bitmap : Draw Image At...
# image : Gauge Image
# in_width : Internal Width of Gauge
#--------------------------------------------------------------------------
def draw_od_gauge_back(bitmap, image, x, y, in_width)
src_rect = Rect.new(0, 0, 32, 32)
bitmap.blt(x, y, image, src_rect)
src_rect.set(32, 0, 96, 32)
dest_rect = Rect.new(x + 32, y, in_width - 64, 32)
bitmap.stretch_blt(dest_rect, image, src_rect)
src_rect.set(128, 0, 32, 32)
bitmap.blt(x + in_width - 32, y, image, src_rect)
end
#--------------------------------------------------------------------------
# ○ Draw Inner Drive Gauge
# bitmap : Draw Image At...
# image : Gauge Image
# in_width : Internal Width of Gauge
# gauge_width : Gauge External Width
# full : Full Gauge
#--------------------------------------------------------------------------
def draw_od_gauge_inside(bitmap, image, x, y, in_width, gauge_width, full)
src_rect = Rect.new(0, (full ? 64 : 32), 0, 32)
src_rect.width = gauge_width * 96 / (in_width - 64)
dest_rect = Rect.new(x + 32, y, gauge_width, 32)
bitmap.stretch_blt(dest_rect, image, src_rect)
end
#--------------------------------------------------------------------------
# ○ Draw Gauge Foreground
# bitmap : Draw Image At...
# image : Gauge Image
# in_width : Internal Width of Gauge
#--------------------------------------------------------------------------
def draw_od_gauge_fore(bitmap, image, x, y, in_width)
src_rect = Rect.new(160, 0, 32, 32)
bitmap.blt(x, y, image, src_rect)
src_rect.set(192, 0, 96, 32)
dest_rect = Rect.new(x + 32, y, in_width - 64, 32)
bitmap.stretch_blt(dest_rect, image, src_rect)
src_rect.set(288, 0, 32, 32)
bitmap.blt(x + in_width - 32, y, image, src_rect)
end
#--------------------------------------------------------------------------
# ○ Calculate Gauge Width
#--------------------------------------------------------------------------
def calc_od_gauge_width(actor, in_width)
gw = actor.overdrive * (in_width - 64) / KGC::OverDrive::GAUGE_MAX
return [[gw, 0].max, in_width - 64].min
end
#----------------------------------------------------------------------
# End Gauge Image Type Determination
# end ( if KGC::OverDrive::USE_IMAGE_GAUGE )
#----------------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ○ Draw Actor OverDrive Numerical Value
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
# width : Width
#--------------------------------------------------------------------------
def draw_actor_od_gauge_value(actor, x, y, width = 120)
text = ""
value = actor.overdrive * 100.0 / KGC::OverDrive::GAUGE_MAX
case KGC::OverDrive::GAUGE_VALUE_STYLE
when KGC::OverDrive::ValueStyle::IMMEDIATE
text = actor.overdrive.to_s
when KGC::OverDrive::ValueStyle::RATE
text = sprintf("%d%%", actor.overdrive * 100 / KGC::OverDrive::GAUGE_MAX)
when KGC::OverDrive::ValueStyle::RATE_DETAIL1
text = sprintf("%0.1f%%", value)
when KGC::OverDrive::ValueStyle::RATE_DETAIL2
text = sprintf("%0.2f%%", value)
when KGC::OverDrive::ValueStyle::NUMBER
text = "#{actor.overdrive / KGC::OverDrive::GAUGE_MAX}"
else
return
end
last_font_size = self.contents.font.size
new_font_size = KGC::OverDrive::GAUGE_VALUE_FONT_SIZE
self.contents.font.size = new_font_size
self.contents.draw_text(
x, y + WLH + KGC::OverDrive::GAUGE_OFFSET_Y - new_font_size / 2,
width, new_font_size, text, 2)
self.contents.font.size = last_font_size
end
end
#=================================================#
#==============================================================================
# ■ Window_Skill
#==============================================================================
if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# ○ Determine Skill in List
# skill : Skill
#--------------------------------------------------------------------------
unless $@
alias include_KGC_OverDrive? include? if method_defined?(:include?)
end
def include?(skill)
return false if skill == nil
if defined?(include_KGC_OverDrive?)
return false unless include_KGC_OverDrive?(skill)
end
if skill.overdrive?
return (@actor.calc_od_cost(skill) <= @actor.overdrive)
else
return true
end
end
if method_defined?(:include_KGC_OverDrive?)
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @actor.skills
next unless include?(skill)
@data.push(skill)
if skill.id == @actor.last_skill_id
self.index = @data.size - 1
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end # <-- for i in 0...@item_max
end # <-- refresh
end # <-- if method_defined?(:include_KGC_OverDrive?)
end # <-- class
end # <-- if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE
#=================================================#
#==============================================================================
# ■ Scene_Skill
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# ● Use Skill(The effects of use other than the ally object are applied.)
#--------------------------------------------------------------------------
alias use_skill_nontarget_KGC_OverDrive use_skill_nontarget
def use_skill_nontarget
consume_od_gauge
use_skill_nontarget_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ Consume Drive gauge when skill is used
#--------------------------------------------------------------------------
def consume_od_gauge
@actor.overdrive -= @actor.calc_od_cost(@skill)
end
end
#=================================================#
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● Battle End
# result : Result (0:Victory 1:Escape 2:Defeat)
#--------------------------------------------------------------------------
alias battle_end_KGC_OverDrive battle_end
def battle_end(result)
increase_overdrive_on_battle_end(result)
battle_end_KGC_OverDrive(result)
end
#--------------------------------------------------------------------------
# ○ Increase OverDrive on Battle End
# result : Result (0:Victory 1:Escape 2:Defeat)
#--------------------------------------------------------------------------
def increase_overdrive_on_battle_end(result)
case result
when 0 # Victory
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::VICTORY]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_victory?
}
when 1 # Escape
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ESCAPE]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_escape?
}
end
end
#--------------------------------------------------------------------------
# ● Execute Battle Action
#--------------------------------------------------------------------------
alias execute_action_KGC_OverDrive execute_action
def execute_action
increase_overdrive_on_action
execute_action_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ Increase Gauge on Action
#--------------------------------------------------------------------------
def increase_overdrive_on_action
battler = @active_battler
od_gain = 0
unit = (battler.actor? ? $game_party : $game_troop)
# Alone
if battler.drive_alone? && unit.existing_members.size == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ALONE]
end
# Action
if battler.drive_action?
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ACTION]
end
# Fatal
if battler.drive_fatal? && battler.hp < battler.maxhp / 4
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::FATAL]
end
# Guard
if battler.drive_guard? && battler.action.kind == 0 &&
battler.action.basic == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::GUARD]
end
battler.overdrive += od_gain
end
#--------------------------------------------------------------------------
# ● Execution of battle action: Skill
#--------------------------------------------------------------------------
alias execute_action_skill_KGC_OverDrive execute_action_skill
def execute_action_skill
execute_action_skill_KGC_OverDrive
consume_od_gauge
end
#--------------------------------------------------------------------------
# ○ Drive gauge consumption when skill is used
#--------------------------------------------------------------------------
def consume_od_gauge
skill = @active_battler.action.skill
@active_battler.overdrive -= @active_battler.calc_od_cost(skill)
end
end |
| |
|
|