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
| module BI
module CHAP
#=============================================================================
# **Debut de la Configuration** #
#=============================================================================
# Mettez ici le nom de tout les chapitres ainsi que leurs ids !
Chapitre = {
1 => "Proloque",
2 => "La Fin"
} #Laissez ça !
#Image de fond. Mettez nil pour ne pas en avoir
IMG_FOND = nil
#Mettez ici les interrupteurs qui permettent d'afficher les chapitres
Interrupteur = {
1 => 1,
2 => 2
} # Laissez ça !
Act_Page_2 = {
1 => false,
2 => false
}
# Mettez ici les treizes lignes de la première Page !
Page1 = {
1 => [Ligne1 = "Chapitre1.",
Ligne2 = "Un jeune garçon et arriver et trouva ",
Ligne3 = " une pierre précieux. ",
Ligne4 = "Donc il parta a l'aventure!!",
Ligne5 = "Il se demande ou commencez ",
Ligne6 = "a vous dire... "
],
2 => [Ligne1 = "Une belle fin.",
Ligne2 = "L2",
Ligne3 = "L3",
Ligne4 = "L4",
Ligne5 = "L5",
Ligne6 = "L6",
Ligne7 = "L7",
Ligne8 = "L8",
Ligne9 = "L9",
Ligne10 = "L10",
Ligne11 = "L11",
Ligne12 = "L12",
Ligne13 = "L13",
]
} # Laissez ça !
# Mettez ici les treizes lignes de la deuxième page !
Page2 = {
3 => [Ligne1 = "Un très beau début !",
Ligne2 = "L2",
Ligne3 = "L3",
Ligne4 = "L4",
Ligne5 = "L5",
Ligne6 = "L6",
Ligne7 = "L7",
Ligne8 = "L8",
Ligne9 = "L9",
Ligne10 = "L10",
Ligne11 = "L11",
Ligne12 = "L12",
Ligne13 = "L13",
],
2 => [Ligne1 = "Une très belle fin !",
Ligne2 = "L2",
Ligne3 = "L3",
Ligne4 = "L4",
Ligne5 = "L5",
Ligne6 = "L6",
Ligne7 = "L7",
Ligne8 = "L8",
Ligne9 = "L9",
Ligne10 = "L10",
Ligne11 = "L11",
Ligne12 = "L12",
Ligne13 = "L13",
]
} # Laissez ça !
#=============================================================================
# **Fin de la Configuration** #
#=============================================================================
end
end
class Chapitre < Scene_Base
def start
create_menu_background
@choix = []
@commands = []
@page = 0
for i in 1..BI::CHAP::Chapitre.size
if $game_switches[BI::CHAP::Interrupteur[i]] == true
@commands.push(BI::CHAP::Chapitre[i])
end # if
end # for
@choix = Window_Command.new(150, @commands)
@win_name = Window_Chapitre_Name.new
@win_page = Window_Chapitre_Page.new
@win_text = Window_Chapitre_Text.new
if BI::CHAP::IMG_FOND != nil
@sprite = Sprite.new
@sprite.bitmap = Cache.picture(BI::CHAP::IMG_FOND)
@win_name.opacity = 0
@win_page.opacity = 0
@win_text.opacity = 0
@choix.opacity = 0
end
@y = -200
end # start
def terminate
dispose_menu_background
@choix.dispose
@win_name.dispose
@win_page.dispose
@win_text.dispose
if BI::CHAP::IMG_FOND != nil
@sprite.dispose
end
end # Terminate
def update
@choix.update
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Menu.new(4)
end # if
if Input.trigger?(Input::C) and @commands != []
@page = 0
@y = -200
@win_name.contents.clear
@win_page.contents.clear
@win_text.contents.clear
@win_name.contents.draw_text(75, -200, 544, 416, BI::CHAP::Chapitre[@choix.index + 1], 0)
if @page == 0
@tab = BI::CHAP::Page1
if BI::CHAP::Act_Page_2[@choix.index + 1] == true
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/2"), 0)
else
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/1"), 0)
end
end
if @page == 1
@tab = BI::CHAP::Page2
end # if
for i in 0..@tab[@page + 1].size
@win_text.contents.draw_text(0, @y, 544, 416, @tab[@choix.index + 1][i .to_i], 0)
@y += 25
end # for
end # if
if Input.trigger?(Input::RIGHT) and @page != 1 and BI::CHAP::Act_Page_2[@choix.index + 1] == true and @commands != []
@y = -200
@page += 1
@win_text.contents.clear
@win_page.contents.clear
@win_name.contents.clear
@win_name.contents.draw_text(75, -200, 544, 416, BI::CHAP::Chapitre[@choix.index + 1], 0)
if @page == 0
@tab = BI::CHAP::Page1
if BI::CHAP::Act_Page_2[@choix.index + 1] == true
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/2"), 0)
else
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/1"), 0)
end
end
if @page == 1
@tab = BI::CHAP::Page2
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/2"), 0)
end # if
for i in 0..@tab[@page.to_i + 1].size
@win_text.contents.draw_text(0, @y, 544, 416, @tab[@choix.index + 1][i .to_i], 0)
@y += 25
end # for
end
if Input.trigger?(Input::LEFT) and @page != 0 and @commands != []
@y = -200
@page -= 1
@win_text.contents.clear
@win_page.contents.clear
@win_name.contents.clear
@win_name.contents.draw_text(75, -200, 544, 416, BI::CHAP::Chapitre[@choix.index + 1], 0)
if @page == 0
@tab = BI::CHAP::Page1
if BI::CHAP::Act_Page_2[@choix.index + 1] == true
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/2"), 0)
else
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/1"), 0)
end
end
if @page == 1
@tab = BI::CHAP::Page2
@win_page.contents.draw_text(15, -200, 544, 416, ((@page.to_i + 1).to_s + "/2"), 0)
end # if
for i in 0..@tab[@page + 1].size
@win_text.contents.draw_text(0, @y, 544, 416, @tab[@choix.index + 1][i .to_i], 0)
@y += 25
end # for
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@page = 0
@win_text.contents.clear
@win_page.contents.clear
@win_name.contents.clear
end
end # Update
end # Chapitre
class Window_Chapitre_Name < Window_Base
def initialize
super(150, 0, 300, 56)
end
end
class Window_Chapitre_Page < Window_Base
def initialize
super(150+300, 0, 94, 56)
end
end
class Window_Chapitre_Text < Window_Base
def initialize
super(150, 56, 544-150, 416-56)
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s7 = "Chapitre"
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s7, s5, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(5, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4
$scene = Chapitre.new
when 5 # Save
$scene = Scene_File.new(true, false, false)
when 6 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end |