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
| #==============================================================================
# * Dragon Quest Church System
#------------------------------------------------------------------------------
# Par : xXDarkDragonxx / Capt. Malboro / Anemoi
# Version : 24 janvier 2008
#
# Special thanks to SephirothTDS for helping me out with some of the coding...
# and his inmense patience.
#==============================================================================
class DQCS_Command
#==============================================================================
# * Config
#==============================================================================
# Prix de la résurrection ?
REVIVE_COST = 200
# Prix de la restauration du statut ?
BLESSING_COST = 50
# ID du statut qui soigne
BLESSING_STATE = 9
#==============================================================================
# * Fin Config - Ne pas éditer en dessous, sauf si vous savez ce que vous faites !
#==============================================================================
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(383, 0) # Janela de dinheiro
@gold_window.back_opacity = 180
@gold_window.update
@heroes = []
for i in 0...$game_party.members.size
@heroes << $game_party.members[i].name
end
@heroes_command = Window_Command.new(140, @heroes) # Comandos principais
@heroes_command.back_opacity = 180
@heroes_command.x = 83
@heroes_command.y = 0
@heroes_command.visible = false
@heroes_command.active = false
@heroes_command.index = 0
@heroes_bendicion = Blessing_Command.new # 'Comandos' de benção.
@heroes_bendicion.back_opacity = 180
#@heroes_bendicion.x = 180
#@heroes_bendicion.y = 64
@heroes_bendicion.visible = false
@heroes_bendicion.active = false
@heroes_bendicion.index = 0
@dead_heroes = @heroes
#============================================================
# * Commandes
# Confesión = Guardar la Partida
# Resurreción = Revivir un aliado fallecido en combate
# Bendición = Librar de una maldición a un personaje
#============================================================
s1 = "Confesser"
s2 = "Ressussiter"
s3 = "Soigner"
s4 = "Rien"
@command_window = Window_Command.new(160, [s1, s2, s3, s4])
@command_window.back_opacity = 180
@command_window.x = 223
@command_window.y = 0
@command_window.index = @menu_index
if $game_party.gold < REVIVE_COST # Se não tiver Quantia definida...
@command_window.draw_item(1, false) # Desabilitar o comando ressucitar.
@revive_disable = true
else
@revive_disable = false
end
if $game_party.gold < BLESSING_COST # Se não tiver quantia definida para benção...
@command_window.draw_item(2, false) # Desabilitar comando benção.
@bendicion_disable = true
else
@bendicion_disable = false
end
if $game_system.save_disabled # Si los permisos de Save son desabilitados...
@command_window.draw_item(0, false) # Desabilitar comando confessar.
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@gold_window.dispose # 'Apagar' janela de dinheiro
@command_window.dispose # 'Apagar' Janela de comandos
@heroes_command.dispose # 'Apagar' janela de Ressureição (comandos)
@heroes_bendicion.dispose # 'Apagar' janela de Benção (comandos)
@spriteset.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@heroes_command.update
@heroes_bendicion.update
@command_window.update
@gold_window.update
#============================================================
# * Ressureição
#============================================================
if $game_party.gold < REVIVE_COST
@command_window.draw_item(1, false)
@revive_disable = true
else
@revive_disable = false
end
for i in 0...$game_party.members.size
if $game_party.members[i].hp != 0
@dead_heroes[i] = nil
end
end
$game_party.members.each do |actor|
if actor.hp == 0
@heroes_command.draw_item(actor.index, false)
end
end
#============================================================
# * Benção
#============================================================
if $game_party.gold < BLESSING_COST
@command_window.draw_item(2, false)
@bendicion_disable = true
else
@bendicion_disable = false
end
if @heroes_command.active
update_revive
return
end
if @heroes_bendicion.active
update_bendicion
return
end
if @command_window.active
update_command
return
end
end
#--------------------------------------------------------------------------
# * Update revive janela de Comando
#--------------------------------------------------------------------------
def update_revive
if Input.trigger?(Input::B)
@heroes_command.visible = false
@heroes_command.active = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
if $game_party.members[@heroes_command.index].hp == 0
$game_party.lose_gold(REVIVE_COST)
Sound.play_shop
@gold_window.refresh
$game_party.members[@heroes_command.index].recover_all
@heroes_command.draw_item(@heroes_command.index, Color.new(255, 255, 255, 255))
return
else
Sound.play_buzzer
end
end
end
#--------------------------------------------------------------------------
# * Update benção janela de comando
#--------------------------------------------------------------------------
def update_bendicion
if Input.trigger?(Input::B)
@heroes_bendicion.visible = false
@heroes_bendicion.active = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
Sound.play_buzzer if $game_party.gold < BLESSING_COST
Sound.play_buzzer if @heroes_bendicion.cursed_actors[@heroes_bendicion.index] == false
return unless $game_party.gold >= BLESSING_COST
if @heroes_bendicion.cursed_actors[@heroes_bendicion.index] == true
$game_party.lose_gold(BLESSING_COST)
Sound.play_shop
@gold_window.refresh
$game_party.members[@heroes_bendicion.index].remove_state(BLESSING_STATE)
@heroes_bendicion.verify_use
@heroes_bendicion.refresh
return
end
end
return
end
#--------------------------------------------------------------------------
# * Update janela de comando
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
end
case @command_window.index
when 0 # Confesión
if $game_system.save_disabled
Sound.play_buzzer
return
end
Sound.play_decision
$scene = Scene_File.new(true, false, false)
#when 1 # Divinación
#$game_system.se_play($data_system.cancel_se)
when 1 # Ressureição
if @revive_disable != true
Sound.play_decision
@heroes_command.visible = true
@heroes_command.active = true
@command_window.active = false
return
else
# Play buzzer SE
Sound.play_buzzer
return
end
when 2 # Benção
if @bendicion_disable != true
Sound.play_decision
@heroes_bendicion.visible = true
@heroes_bendicion.active = true
@command_window.active = false
return
else
# Play buzzer SE
Sound.play_buzzer
return
end
when 3 # Nada
Sound.play_decision
$scene = Scene_Map.new
end
return
end
end
#==============================================================================
# * Blessing Command Window
#------------------------------------------------------------------------------
# Janela que mostra os herois para o comando de benção
#==============================================================================
class Blessing_Command < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :cursed_actors # Variable flag for cursed actors
#--------------------------------------------------------------------------
# * Inicialização de Objetos
#--------------------------------------------------------------------------
def initialize
super(83, 0, 140, $game_party.members.size * 32)
@item_max = $game_party.members.size
@item_count = $game_party.members.size
self.height = @item_count * 32
@column_max = 1
self.contents = Bitmap.new(width - 32, [height - 32, row_max * WLH].max)
self.back_opacity = 180
self.index = 0
# Cursed state
@cursed_state = BLESSING_STATE
# Cursed actors array
@cursed_actors = []
refresh
end
#--------------------------------------------------------------------------
# * Verifica se o héroi pode ser usado
#--------------------------------------------------------------------------
def verify_use
$game_party.members.each {|x| @cursed_actors << x.state?(@cursed_state)}
return
end
#--------------------------------------------------------------------------
# * Atualiza
#--------------------------------------------------------------------------
def refresh
@cursed_actors.clear
self.contents.clear
verify_use
for i in 0...$game_party.members.size
@actor = $game_party.members[i]
x = 8
y = i * 24
self.contents.font.color = (@cursed_actors[i] == true ? disabled_color : normal_color)
self.contents.draw_text(x, y, 140, 24, @actor.name)
end
end
end
end |