Bienvenue visiteur !
|
Statistiques
Liste des membres
Contact
Mentions légales
629 connectés actuellement
30729215 visiteurs depuis l'ouverture
2832 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
◂
| Rajouts de points avancé 2.4
Permet de rajouter des points à distribuer pour augmenter ses stats. Les points sont gagnés à la montée d'un niveau. Configuration de points gagnés et de la valeur des points par stats dans les paramètres. | Script pour RPG Maker XP Ecrit par Inconnu Publié par julienRPG (lui envoyer un message privé) Signaler un script cassé
|
▸
|
❤ 0 Auteur : Inconnu
Logiciel : RPG Maker XP
Nombre de scripts : 1
Voilà un script qui vous permettra d'attribuer des points de competence quand vous paser un Niveau
A mettre au dessus de Main et nommé le comme vous voulez :
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
| #=====================================================
# Rajout de points avancé
# Version 2.4
# Insérez un nouveau script au dessus de main et appelez le comme vous voulez.
# Lisez les explications un peu plus bas pour comprendre comment ce script fonctionne.
#=====================================================
PSPEND_LVUPTEXT = "Points de Compétence disponibles : "
PSPEND_SPTEXT = " Points de Compétence"
PSPEND_ANSWERS = ["Utiliser","Garder"]
PSPEND_HELP_TEXT = ["Améliorer la Force","Améliorer l'Agilite",
"Améliorer la Défense","Améliorer l'Intelligence","Améliorer les PV Max",
"Améliorer les PM Max","Rectifier la répartition","Valider la répartition"]
PSPEND_B1 = "Corriger"
PSPEND_B2 = "Terminer"
LVUP_TEXT = " 10 Points !"
DESC_TEXT = "Les points de compétences non utilisés seront conservés."
#=====================================================
SPADD = 10 #Nombre de point de compétence gagnés à chaque niveau
AGILITY_ADD = 1 #Nombre de point d'agilité gagnés pour un point de compétence
DEXTERITY_ADD = 1 #Nombre de point de défense gagnés pour un point de compétence
INTELIGENCE_ADD = 1 #Nombre de point d'intelligence gagnés pour un point de compétence
STRENGTH_ADD = 1 #Nombre de point de force gagnés pour un point de compétence
HP_ADD = 4 #Nombre de PV maximum gagnés pour un point de compétence
SP_ADD = 3 #Nombre de PM maximum gagnés pour un point de compétence
#=====================================================
$PSPEND_ADD = [1,1,1,1,1,1]
$PSPEND_ATTR = [1,1,1,1,1,1]
$PSPEND_RET = 0
#=====================================================
class PSPEND_GET_SET_ACTOR_ATRIBUTTES
def initialize(type)
if !$BTEST
case type
when 0
return
when 1
get_attributes
when 2
set_attributes
end
end
end
def get_attributes(actorid)
@actor = $game_actors[actorid]
$PSPEND_ATTR[1] = @actor.str
$PSPEND_ATTR[2] = @actor.agi
$PSPEND_ATTR[3] = @actor.dex
$PSPEND_ATTR[4] = @actor.int
$PSPEND_ATTR[5] = @actor.maxhp
$PSPEND_ATTR[6] = @actor.maxsp
end
def set_attributes(actorid)
@actor = $game_actors[actorid]
@actor.str = $PSPEND_ATTR[1]
@actor.agi = $PSPEND_ATTR[2]
@actor.dex = $PSPEND_ATTR[3]
@actor.int = $PSPEND_ATTR[4]
@actor.maxhp = $PSPEND_ATTR[5]
@actor.maxsp = $PSPEND_ATTR[6]
end
end
#============================================
class Game_Actor
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
$game_system.actor_attr.get_attributes(@actor_id)
@level += 1
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_POINTS[@actor_id - 1] += SPADD
$game_system.PSPEND_ACTORS[@actor_id - 1] = true
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
$game_system.actor_attr.get_attributes(@actor_id)
@level -= 1
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_ACTORS[@actor_id - 1] = false
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
def level=(level)
if level < self.level
$game_system.actor_attr.get_attributes(@actor_id)
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_ACTORS[@actor_id - 1] = false
self.exp = @exp_list[level]
return
end
$game_system.actor_attr.get_attributes(@actor_id)
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_POINTS[@actor_id - 1] += SPADD
$game_system.PSPEND_ACTORS[@actor_id - 1] = true
self.exp = @exp_list[level]
return
end
end
#============================================
class Scene_Title
def command_new_game
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_system.actor_attr = PSPEND_GET_SET_ACTOR_ATRIBUTTES.new(0)
for i in 0..$data_actors.size - 2
$game_system.PSPEND_ACTORS.push(false)
$game_system.PSPEND_POINTS.push(0)
end
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
def battle_test
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_system.actor_attr = PSPEND_GET_SET_ACTOR_ATRIBUTTES.new(0)
for i in 0..$data_actors.size - 2
$game_system.PSPEND_ACTORS.push(false)
$game_system.PSPEND_POINTS.push(0)
end
$game_party.setup_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$scene = Scene_Battle.new
end
end
#===========================================
class Window_Base < Window
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw =bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw,ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
cx = self.contents.text_size(actor.name).width
if $game_system.PSPEND_POINTS[actor.id - 1] != 0
self.contents.font.color = crisis_color
self.contents.draw_text(x + cx, y, 90, 32, " " + LVUP_TEXT)
end
self.contents.font.color = normal_color
end
end
#============================================
class PSPEND_CUSTOM_WINDOW < Window_Selectable
def initialize(winactorid)
super(0, 64, 640, 480 - 64)
commands = [1,2,3,4,5,6,7,8]
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32,height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = $game_actors[winactorid + 1]
@y = 10
$PSPEND_RET = $game_system.PSPEND_POINTS[@actor.id - 1]
refresh(true)
self.index = 0
end
def refresh(ret = false)
self.contents.clear
@y = 10
if ret
$PSPEND_ADD[1] = @actor.str
$PSPEND_ADD[2] = @actor.agi
$PSPEND_ADD[3] = @actor.dex
$PSPEND_ADD[4] = @actor.int
$PSPEND_ADD[5] = @actor.maxhp
$PSPEND_ADD[6] = @actor.maxsp
$game_system.PSPEND_POINTS[@actor.id - 1] = $PSPEND_RET
ret = false
end
draw_actor_battler(@actor,20 + 100,@y + 200)
draw_actor_name(@actor,20 + 32,@y + 220)
cx = self.contents.text_size(PSPEND_SPTEXT + $game_system.PSPEND_POINTS[@actor.id - 1].to_s).width
self.contents.draw_text(52,@y + 252,cx,32,PSPEND_SPTEXT + $game_system.PSPEND_POINTS[@actor.id - 1].to_s)
cx = self.contents.text_size(DESC_TEXT).width
self.contents.draw_text(52,self.height - 32 - 40,cx,32,DESC_TEXT)
@y += 150
@x = 260
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
if $game_system.PSPEND_POINTS[@actor.id - 1] <= 0
self.contents.font.color = disabled_color
else
self.contents.font.color = color
end
rect = Rect.new(@x, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
case index
when 0
self.contents.draw_text(rect, $data_system.words.str)
cx = self.contents.text_size(@actor.str.to_s + " > " + $PSPEND_ADD[1].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.str.to_s + " > " + $PSPEND_ADD[1].to_s)
when 1
self.contents.draw_text(rect, $data_system.words.agi )
cx = self.contents.text_size(@actor.agi.to_s + " > " + $PSPEND_ADD[2].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.agi.to_s + " > " + $PSPEND_ADD[2].to_s)
when 2
self.contents.draw_text(rect, $data_system.words.dex )
cx = self.contents.text_size( @actor.dex.to_s + " > " + $PSPEND_ADD[3].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 , @actor.dex.to_s + " > " + $PSPEND_ADD[3].to_s)
when 3
self.contents.draw_text(rect, $data_system.words.int )
cx = self.contents.text_size(@actor.int.to_s + " > " + $PSPEND_ADD[4].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.int.to_s + " > " + $PSPEND_ADD[4].to_s)
when 4
self.contents.draw_text(rect, $data_system.words.hp )
cx = self.contents.text_size( @actor.maxhp.to_s + " > " + $PSPEND_ADD[5].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 , @actor.maxhp.to_s + " > " + $PSPEND_ADD[5].to_s)
when 5
self.contents.draw_text(rect, $data_system.words.sp )
cx = self.contents.text_size(@actor.maxsp.to_s + " > " + $PSPEND_ADD[6].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.maxsp.to_s + " > " + $PSPEND_ADD[6].to_s)
when 6
self.contents.font.color = color
self.contents.draw_text(rect,PSPEND_B1)
when 7
self.contents.font.color = color
self.contents.draw_text(rect,PSPEND_B2)
end
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(@x - 10, y, self.width - @x - 17, 32)
end
end
#==========================================
class Scene_Status
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@actor = $game_party.actors[@actor_index]
$ACTORD = @actor
@status_window = Window_Status.new(@actor)
Graphics.transition
if $game_system.PSPEND_ACTORS[@actor.id - 1]
@h = Window_Help.new
@h.set_text(PSPEND_LVUPTEXT)
@h.y = 600
@h.z = 9997
@c = Window_Command.new(140,PSPEND_ANSWERS)
@c.y = 2
@c.x = 500
@c.z = 9998
loop do
Graphics.update
Input.update
update_pspend_lvup_win
if $scene != self
break
end
end
Graphics.freeze
@h.z = 0
@c.z = 1
@status_window.z = 2
@status_window.dispose
@h.dispose
@c.dispose
return
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@status_window.dispose
end
def update_pspend_lvup_win
@c.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_system.PSPEND_ACTORS[@actor.id - 1] = true
$scene = Scene_Menu.new
return
end
if Input.trigger?(Input::C)
case @c.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_PSPEND_Main_Screen.new(@actor.id - 1)
return
when 1
$game_system.se_play($data_system.cancel_se)
$game_system.PSPEND_ACTORS[@actor.id - 1] = true
$scene = Scene_Menu.new
return
end
end
end
end
#===========================================
class Scene_PSPEND_Main_Screen
def initialize(actor_id_index)
@actor_ind = actor_id_index
main
end
def main
@help = Window_Help.new
@spend = PSPEND_CUSTOM_WINDOW.new(@actor_ind)
@spend.y = 64
@spend.z = 99998
@help.z = 99998
Graphics.transition
loop do
Graphics.update
Input.update
update_spend_help_win
if $scene != self
break
end
end
Graphics.freeze
@spend.dispose
@help.dispose
end
def update_spend_help_win
@spend.update
@help.update
@help.set_text(PSPEND_HELP_TEXT[@spend.index])
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
$game_system.PSPEND_POINTS[@actor_ind] = $PSPEND_RET
$game_system.PSPEND_ACTORS[@actor_ind] = true
return
end
if Input.repeat?(Input::RIGHT)
unless $game_system.PSPEND_POINTS[@actor_ind] > 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cursor_se)
$game_system.PSPEND_POINTS[@actor_ind] -= 1
case @spend.index
when 0
$PSPEND_ADD[1] += STRENGTH_ADD
when 1
$PSPEND_ADD[2] += AGILITY_ADD
when 2
$PSPEND_ADD[3] += DEXTERITY_ADD
when 3
$PSPEND_ADD[4] += INTELIGENCE_ADD
when 4
$PSPEND_ADD[5] += HP_ADD
when 5
$PSPEND_ADD[6] += SP_ADD
when 6
$game_system.PSPEND_POINTS[@actor_ind] += 1
when 7
$game_system.PSPEND_POINTS[@actor_ind] += 1
end
@spend.refresh
return
end
if Input.repeat?(Input::LEFT)
unless $game_system.PSPEND_POINTS[@actor_ind] < $PSPEND_RET
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cursor_se)
case @spend.index
when 0
if $PSPEND_ADD[1] <= $ACTORD.str
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[1] -= STRENGTH_ADD
when 1
if $PSPEND_ADD[2] <= $ACTORD.agi
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[2] -= AGILITY_ADD
when 2
if $PSPEND_ADD[3] <= $ACTORD.dex
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[3] -= DEXTERITY_ADD
when 3
if $PSPEND_ADD[4] <= $ACTORD.int
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[4] -= INTELIGENCE_ADD
when 4
if $PSPEND_ADD[5] <= $ACTORD.maxhp
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[5] -= HP_ADD
when 5
if $PSPEND_ADD[6] <= $ACTORD.maxsp
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[6] -= SP_ADD
when 6
$game_system.PSPEND_POINTS[@actor_ind] -= 1
when 7
$game_system.PSPEND_POINTS[@actor_ind] -= 1
end
$game_system.PSPEND_POINTS[@actor_ind] += 1
@spend.refresh
return
end
if Input.trigger?(Input::C)
case @spend.index
when 6
@spend.refresh(true)
when 7
$ACTORD.str = $PSPEND_ADD[1]
$ACTORD.agi = $PSPEND_ADD[2]
$ACTORD.dex = $PSPEND_ADD[3]
$ACTORD.int = $PSPEND_ADD[4]
$ACTORD.maxhp = $PSPEND_ADD[5]
$ACTORD.maxsp = $PSPEND_ADD[6]
$game_system.se_play($data_system.decision_se)
$scene = Scene_Menu.new
$game_system.PSPEND_ACTORS[@actor_ind] = true
return
end
end
end
end
class Game_System
attr_accessor :actor_attr
attr_accessor :PSPEND_POINTS
attr_accessor :PSPEND_ACTORS
alias initialize_orig initialize
def initialize
initialize_orig
self.PSPEND_POINTS = []
self.PSPEND_ACTORS = []
end
end |
Mis à jour le 20 novembre 2020.
|
julbomb -
posté le 17/08/2008 à 12:08:43 (130 messages postés)
| | Pas mal ton script mais tu aurais du préciser que pour distribué le points de compétence il fallait aller dans le menu "Etat".
|
---Un conseil cliquez pas ici-----Affrontez ma brute-----Tiens mais qu'est ce que c'est que ça ?--- |
lejoyeuxcla -
posté le 17/08/2008 à 18:37:53 (12 messages postés)
| Lieu : Devant mon ordi Profession : Makeur | C'est un bon script mais des fois il y a des fautes d'orthographes et c'est plutôt gênant quand on veut publier le jeu.
EDIT : J'ai amélioré le script normalement il n'y a plus de fautes.
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
| #=====================================================
# Rajout de points avancé
# Version 2.4
# Insérez un nouveau script au dessus de main et appelez le comme vous voulez.
#Lisez les explications un peu plus bas pour comprendre comment ce script fonctionne.
#=====================================================
PSPEND_LVUPTEXT = "Points de Compétence disponibles : "
PSPEND_SPTEXT = " Points de Compétence"
PSPEND_ANSWERS = ["Utiliser","Garder"]
PSPEND_HELP_TEXT = ["Améliorer la Force","Améliorer l'Agilite",
"Améliorer la Défense","Améliorer l'Intelligence","Améliorer les PV Max",
"Améliorer les PM Max","Rectifier la répartition","Valider la répartition"]
PSPEND_B1 = "Corriger"
PSPEND_B2 = "Terminer"
LVUP_TEXT = " 10 Points !"
DESC_TEXT = "Les points de compétences non utilisés seront conservés."
#=====================================================
SPADD = 10 #Nombre de point de compétence gagnés à chaque niveau
AGILITY_ADD = 1 #Nombre de point d'agilité gagnés pour un point de compétence
DEXTERITY_ADD = 1 #Nombre de point de défense gagnés pour un point de compétence
INTELIGENCE_ADD = 1 #Nombre de point d'intelligence gagnés pour un point de compétence
STRENGTH_ADD = 1 #Nombre de point de force gagnés pour un point de compétence
HP_ADD = 4 #Nombre de PV maximum gagnés pour un point de compétence
SP_ADD = 3 #Nombre de PM maximum gagnés pour un point de compétence
#=====================================================
$PSPEND_ADD = [1,1,1,1,1,1]
$PSPEND_ATTR = [1,1,1,1,1,1]
$PSPEND_RET = 0
#=====================================================
class PSPEND_GET_SET_ACTOR_ATRIBUTTES
def initialize(type)
if !$BTEST
case type
when 0
return
when 1
get_attributes
when 2
set_attributes
end
end
end
def get_attributes(actorid)
@actor = $game_actors[actorid]
$PSPEND_ATTR[1] = @actor.str
$PSPEND_ATTR[2] = @actor.agi
$PSPEND_ATTR[3] = @actor.dex
$PSPEND_ATTR[4] = @actor.int
$PSPEND_ATTR[5] = @actor.maxhp
$PSPEND_ATTR[6] = @actor.maxsp
end
def set_attributes(actorid)
@actor = $game_actors[actorid]
@actor.str = $PSPEND_ATTR[1]
@actor.agi = $PSPEND_ATTR[2]
@actor.dex = $PSPEND_ATTR[3]
@actor.int = $PSPEND_ATTR[4]
@actor.maxhp = $PSPEND_ATTR[5]
@actor.maxsp = $PSPEND_ATTR[6]
end
end
#============================================
class Game_Actor
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
$game_system.actor_attr.get_attributes(@actor_id)
@level += 1
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_POINTS[@actor_id - 1] += SPADD
$game_system.PSPEND_ACTORS[@actor_id - 1] = true
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
$game_system.actor_attr.get_attributes(@actor_id)
@level -= 1
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_ACTORS[@actor_id - 1] = false
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
def level=(level)
if level < self.level
$game_system.actor_attr.get_attributes(@actor_id)
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_ACTORS[@actor_id - 1] = false
self.exp = @exp_list[level]
return
end
$game_system.actor_attr.get_attributes(@actor_id)
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
$game_system.actor_attr.set_attributes(@actor_id)
$game_system.PSPEND_POINTS[@actor_id - 1] += SPADD
$game_system.PSPEND_ACTORS[@actor_id - 1] = true
self.exp = @exp_list[level]
return
end
end
#============================================
class Scene_Title
def command_new_game
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_system.actor_attr = PSPEND_GET_SET_ACTOR_ATRIBUTTES.new(0)
for i in 0..$data_actors.size - 2
$game_system.PSPEND_ACTORS.push(false)
$game_system.PSPEND_POINTS.push(0)
end
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
def battle_test
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_system.actor_attr = PSPEND_GET_SET_ACTOR_ATRIBUTTES.new(0)
for i in 0..$data_actors.size - 2
$game_system.PSPEND_ACTORS.push(false)
$game_system.PSPEND_POINTS.push(0)
end
$game_party.setup_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$scene = Scene_Battle.new
end
end
#===========================================
class Window_Base < Window
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw =bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw,ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
cx = self.contents.text_size(actor.name).width
if $game_system.PSPEND_POINTS[actor.id - 1] != 0
self.contents.font.color = crisis_color
self.contents.draw_text(x + cx, y, 90, 32, " " + LVUP_TEXT)
end
self.contents.font.color = normal_color
end
end
#============================================
class PSPEND_CUSTOM_WINDOW < Window_Selectable
def initialize(winactorid)
super(0, 64, 640, 480 - 64)
commands = [1,2,3,4,5,6,7,8]
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32,height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = $game_actors[winactorid + 1]
@y = 10
$PSPEND_RET = $game_system.PSPEND_POINTS[@actor.id - 1]
refresh(true)
self.index = 0
end
def refresh(ret = false)
self.contents.clear
@y = 10
if ret
$PSPEND_ADD[1] = @actor.str
$PSPEND_ADD[2] = @actor.agi
$PSPEND_ADD[3] = @actor.dex
$PSPEND_ADD[4] = @actor.int
$PSPEND_ADD[5] = @actor.maxhp
$PSPEND_ADD[6] = @actor.maxsp
$game_system.PSPEND_POINTS[@actor.id - 1] = $PSPEND_RET
ret = false
end
draw_actor_battler(@actor,20 + 100,@y + 200)
draw_actor_name(@actor,20 + 32,@y + 220)
cx = self.contents.text_size(PSPEND_SPTEXT + $game_system.PSPEND_POINTS[@actor.id - 1].to_s).width
self.contents.draw_text(52,@y + 252,cx,32,PSPEND_SPTEXT + $game_system.PSPEND_POINTS[@actor.id - 1].to_s)
cx = self.contents.text_size(DESC_TEXT).width
self.contents.draw_text(52,self.height - 32 - 40,cx,32,DESC_TEXT)
@y += 150
@x = 260
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
if $game_system.PSPEND_POINTS[@actor.id - 1] <= 0
self.contents.font.color = disabled_color
else
self.contents.font.color = color
end
rect = Rect.new(@x, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
case index
when 0
self.contents.draw_text(rect, $data_system.words.str)
cx = self.contents.text_size(@actor.str.to_s + " > " + $PSPEND_ADD[1].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.str.to_s + " > " + $PSPEND_ADD[1].to_s)
when 1
self.contents.draw_text(rect, $data_system.words.agi )
cx = self.contents.text_size(@actor.agi.to_s + " > " + $PSPEND_ADD[2].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.agi.to_s + " > " + $PSPEND_ADD[2].to_s)
when 2
self.contents.draw_text(rect, $data_system.words.dex )
cx = self.contents.text_size( @actor.dex.to_s + " > " + $PSPEND_ADD[3].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 , @actor.dex.to_s + " > " + $PSPEND_ADD[3].to_s)
when 3
self.contents.draw_text(rect, $data_system.words.int )
cx = self.contents.text_size(@actor.int.to_s + " > " + $PSPEND_ADD[4].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.int.to_s + " > " + $PSPEND_ADD[4].to_s)
when 4
self.contents.draw_text(rect, $data_system.words.hp )
cx = self.contents.text_size( @actor.maxhp.to_s + " > " + $PSPEND_ADD[5].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 , @actor.maxhp.to_s + " > " + $PSPEND_ADD[5].to_s)
when 5
self.contents.draw_text(rect, $data_system.words.sp )
cx = self.contents.text_size(@actor.maxsp.to_s + " > " + $PSPEND_ADD[6].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.maxsp.to_s + " > " + $PSPEND_ADD[6].to_s)
when 6
self.contents.font.color = color
self.contents.draw_text(rect,PSPEND_B1)
when 7
self.contents.font.color = color
self.contents.draw_text(rect,PSPEND_B2)
end
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(@x - 10, y, self.width - @x - 17, 32)
end
end
#==========================================
class Scene_Status
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@actor = $game_party.actors[@actor_index]
$ACTORD = @actor
@status_window = Window_Status.new(@actor)
Graphics.transition
if $game_system.PSPEND_ACTORS[@actor.id - 1]
@h = Window_Help.new
@h.set_text(PSPEND_LVUPTEXT)
@h.y = 600
@h.z = 9997
@c = Window_Command.new(140,PSPEND_ANSWERS)
@c.y = 2
@c.x = 500
@c.z = 9998
loop do
Graphics.update
Input.update
update_pspend_lvup_win
if $scene != self
break
end
end
Graphics.freeze
@h.z = 0
@c.z = 1
@status_window.z = 2
@status_window.dispose
@h.dispose
@c.dispose
return
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@status_window.dispose
end
def update_pspend_lvup_win
@c.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_system.PSPEND_ACTORS[@actor.id - 1] = true
$scene = Scene_Menu.new
return
end
if Input.trigger?(Input::C)
case @c.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_PSPEND_Main_Screen.new(@actor.id - 1)
return
when 1
$game_system.se_play($data_system.cancel_se)
$game_system.PSPEND_ACTORS[@actor.id - 1] = true
$scene = Scene_Menu.new
return
end
end
end
end
#===========================================
class Scene_PSPEND_Main_Screen
def initialize(actor_id_index)
@actor_ind = actor_id_index
main
end
def main
@help = Window_Help.new
@spend = PSPEND_CUSTOM_WINDOW.new(@actor_ind)
@spend.y = 64
@spend.z = 99998
@help.z = 99998
Graphics.transition
loop do
Graphics.update
Input.update
update_spend_help_win
if $scene != self
break
end
end
Graphics.freeze
@spend.dispose
@help.dispose
end
def update_spend_help_win
@spend.update
@help.update
@help.set_text(PSPEND_HELP_TEXT[@spend.index])
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
$game_system.PSPEND_POINTS[@actor_ind] = $PSPEND_RET
$game_system.PSPEND_ACTORS[@actor_ind] = true
return
end
if Input.repeat?(Input::RIGHT)
unless $game_system.PSPEND_POINTS[@actor_ind] > 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cursor_se)
$game_system.PSPEND_POINTS[@actor_ind] -= 1
case @spend.index
when 0
$PSPEND_ADD[1] += STRENGTH_ADD
when 1
$PSPEND_ADD[2] += AGILITY_ADD
when 2
$PSPEND_ADD[3] += DEXTERITY_ADD
when 3
$PSPEND_ADD[4] += INTELIGENCE_ADD
when 4
$PSPEND_ADD[5] += HP_ADD
when 5
$PSPEND_ADD[6] += SP_ADD
when 6
$game_system.PSPEND_POINTS[@actor_ind] += 1
when 7
$game_system.PSPEND_POINTS[@actor_ind] += 1
end
@spend.refresh
return
end
if Input.repeat?(Input::LEFT)
unless $game_system.PSPEND_POINTS[@actor_ind] < $PSPEND_RET
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cursor_se)
case @spend.index
when 0
if $PSPEND_ADD[1] <= $ACTORD.str
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[1] -= STRENGTH_ADD
when 1
if $PSPEND_ADD[2] <= $ACTORD.agi
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[2] -= AGILITY_ADD
when 2
if $PSPEND_ADD[3] <= $ACTORD.dex
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[3] -= DEXTERITY_ADD
when 3
if $PSPEND_ADD[4] <= $ACTORD.int
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[4] -= INTELIGENCE_ADD
when 4
if $PSPEND_ADD[5] <= $ACTORD.maxhp
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[5] -= HP_ADD
when 5
if $PSPEND_ADD[6] <= $ACTORD.maxsp
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[6] -= SP_ADD
when 6
$game_system.PSPEND_POINTS[@actor_ind] -= 1
when 7
$game_system.PSPEND_POINTS[@actor_ind] -= 1
end
$game_system.PSPEND_POINTS[@actor_ind] += 1
@spend.refresh
return
end
if Input.trigger?(Input::C)
case @spend.index
when 6
@spend.refresh(true)
when 7
$ACTORD.str = $PSPEND_ADD[1]
$ACTORD.agi = $PSPEND_ADD[2]
$ACTORD.dex = $PSPEND_ADD[3]
$ACTORD.int = $PSPEND_ADD[4]
$ACTORD.maxhp = $PSPEND_ADD[5]
$ACTORD.maxsp = $PSPEND_ADD[6]
$game_system.se_play($data_system.decision_se)
$scene = Scene_Menu.new
$game_system.PSPEND_ACTORS[@actor_ind] = true
return
end
end
end
end
class Game_System
attr_accessor :actor_attr
attr_accessor :PSPEND_POINTS
attr_accessor :PSPEND_ACTORS
alias initialize_orig initialize
def initialize
initialize_orig
self.PSPEND_POINTS = []
self.PSPEND_ACTORS = []
end
end |
|
A quoi ça sert de travailler puisque c'est pas amusant ?... |
julienRPG -
posté le 18/08/2008 à 15:00:02 (29 messages postés)
| maker du dimanche | Désoler pour les erreur d'orthographe^^
|
Darkmianh -
posté le 25/09/2008 à 14:17:56 (103 messages postés)
| Pourquoi on dit toujours que les méchants sont pas gentils ?? | Pas mal comme script. C'est sympa pour personnaliser les héros.
Par contre si tu pouvais expliquer à quoi il sert précisémment et surtout comment on s'en sert plutot que de nous laisser découvrir par nous meme, ça serait sympa.
|
steph51300 -
posté le 30/11/2008 à 16:27:54 (5 messages postés)
| | grrrr sa marche pas en combat a temp réel
|
astyan -
posté le 09/02/2009 à 15:21:16 (4 messages postés)
| | Ce script est très bien, mais il risque de ralentir la vitesse de jeu, c'est dommage !
Pour ceux qui veulent, voici quelques petits screens du Rendu Final :
http://img205.imageshack.us/my.php?image=testscript1ph7.png
|
Dragonisien -
posté le 28/07/2010 à 01:27:59 (131 messages postés)
| | UP
Pourrait t'il etre adapter sur un A-rpg svp
Merci
Edit fonctionne en arpg
suffit de le mettre en tout dernier tel qu'il es ecrit merci ^^
| |
|
|