Bienvenue visiteur !
|
Statistiques
Liste des membres
Contact
Mentions légales
616 connectés actuellement
30732842 visiteurs depuis l'ouverture
2821 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
Messages postés par pourquoi Nombre de messages référencés sur Oniromancie (non supprimés): 24 Aller à la page: 1
Posté dans Scripts - Light Effects 1.3 |
pourquoi -
posté le 12/09/2009 à 11:14:21. (24 messages postés) |
| Nouvel évenement en processus parallèle>modifier le ton de l'écran> (R:-120,V:-120,B:-120,G:100)>suprimer cet évenement.
Et voila
|
Posté dans Tutoriels - Inspirations pour préparer son scénario |
pourquoi -
posté le 04/09/2009 à 18:30:53. (24 messages postés) |
| franchement je suis litéralement scié par la richesse de ton scénario!
Il explique exactement ce que je cherchais, même si je n'ai pas encore trouvé de scénario à mon gout. En tout cas, bravo
|
Posté dans Tutoriels - L'onglet Système dans la Base de données de RPG Maker 2003 |
pourquoi -
posté le 25/08/2009 à 11:34:04. (24 messages postés) |
| C'est un bon tuto, mais est-ce que tu peux indiquer quel logiciel utiliser pour changer la police?
Citation: -Et le choix entre deux polices. (Attention c'est pas obligatoirement le vrais nom des polices. Car avec un logiciel on peux changer les polices d'écritures.) |
|
Posté dans Scripts - Scene_Cook |
pourquoi -
posté le 03/08/2009 à 19:44:25. (24 messages postés) |
| Mais il est complètement GÉ-NI-AL!!!!!!!!!
C'est super pour mon projet, avec l'event de pêche. Comme ça je peux faire des tartares de Truite ou de vairon...
Hey, respect.
Par contre j'ai un problème: la démo n'est pas compatible avec ma version de RPGMXP
D'ailleurs, ton problème y doit venir d ton script, pasque moi, quand j'ai que un vairon mais un citron, sa marche pas (pasqu'il faut avoir 2 vairon)
|
Posté dans Scripts - Article supprimé |
pourquoi -
posté le 03/08/2009 à 16:03:09. (24 messages postés) |
| Y'x)a Peut-être un peutXD beaucoup de smileys dans ces scripts!
Mais voilà: j'ai corigé!
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
| #===============================================================================
# ¦ New_Battle
#-------------------------------------------------------------------------------
# Compiled By : Radius
#===============================================================================
# by fukuyama
# Battle_End_Recovery
module Battle_End_Recovery
module Scene_Battle_Module
# ‰ñ•œ—¦•Ï”‚ÌID
@@recovery_rate_variable_id = nil
# ‰ñ•œ—¦‚̎擾
def battle_end_recovery_rate
if @@recovery_rate_variable_id.nil?
@@recovery_rate_variable_id =
$data_system.variables.index '퓬Œã‚̉ñ•œ—¦'
if @@recovery_rate_variable_id.nil?
@@recovery_rate_variable_id = false
end
end
return 0 unless @@recovery_rate_variable_id
return $game_variables[@@recovery_rate_variable_id]
end
# 퓬Œã‚̉ñ•œˆ—
def battle_end_recovery
# ‰ñ•œ—¦
recovery_rate = battle_end_recovery_rate
# ‰ñ•œ—¦•Ï”‚ª‚OˆÈŠO‚©‚ƒAƒNƒ^[‚ª¶‘¶‚µ‚Ä‚¢‚éê‡A퓬Œã‚̉ñ•œˆ—‚ðs‚¤
if recovery_rate != 0 and not actor.dead?
# ƒp[ƒeƒB‚̃AƒNƒ^[–ˆ‚Ƀ‹[ƒv
$game_party.actors.each do |actor|
# ‰ñ•œ—ÊŒvŽZ
recovery_hp = (actor.maxhp / 100.0 * recovery_rate).truncate
recovery_sp = (actor.maxsp / 100.0 * recovery_rate).truncate
# ŽÀۂɉñ•œ
actor.hp += recovery_hp
actor.sp += recovery_sp
# ƒAƒjƒ[ƒVƒ‡ƒ“Ý’è
actor.damage = - recovery_hp
actor.damage_pop = true
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðXV
@status_window.refresh
end
end
end # module Scene_Battle_Module
end # module Battle_End_Recovery
#------------------------------
# 퓬ƒV[ƒ“‚ÌÄ’è‹`
#------------------------------
class Scene_Battle
# Scene_Battle—pƒ‚ƒWƒ…[ƒ‹‚ðƒCƒ“ƒNƒ‹[ƒh
include Battle_End_Recovery::Scene_Battle_Module
# Œ³‚̃tƒF[ƒY‚TŠJŽn‚É•Ê–¼‚ð‚‚¯‚é
alias battle_end_recovery_original_start_phase5 start_phase5
# ƒtƒF[ƒY‚TŠJŽn‚ðÄ’è‹`
def start_phase5
# 퓬Œã‚̉ñ•œˆ—‚ðŒÄ‚Ño‚·
battle_end_recovery
# Œ³‚̃tƒF[ƒY‚TŠJŽn‚ðŒÄ‚Ño‚·
battle_end_recovery_original_start_phase5
end
end
# Battle_End_Recovery
# ¥£¥ XRXS_BP10. LEVEL UP!ƒEƒBƒ“ƒhƒE ¥£¥
# by ÷‰ë Ý“y
$data_system_level_up_se = "" # ƒŒƒxƒ‹ƒAƒbƒvSEB""‚Å–³‚µB
$data_system_level_up_me = "Audio/ME/007-Fanfare01" # ƒŒƒxƒ‹ƒAƒbƒvME
#=====================
# ¡ Window_LevelUpWindow
#------------------------------------------------------------------------------
# @ƒoƒgƒ‹I—¹ŽžAƒŒƒxƒ‹ƒAƒbƒv‚µ‚½ê‡‚ɃXƒe[ƒ^ƒX‚𕎦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#=====================
class Window_LevelUpWindow < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 14
self.contents.draw_text( 0, 0, 160, 24, "LEVEL UP!!!")
self.contents.font.size = 18
self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
self.contents.draw_text(92, 0, 128, 24, "¨")
self.contents.draw_text(76, 28, 128, 24, "=")
self.contents.draw_text(76, 50, 128, 24, "=")
self.contents.draw_text(76, 72, 128, 24, "=")
self.contents.draw_text(76, 94, 128, 24, "=")
self.contents.draw_text(76, 116, 128, 24, "=")
self.contents.draw_text(76, 138, 128, 24, "=")
self.contents.font.color = normal_color
self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
end
end
#=====================
# ¡ Window_BattleStatus
#=====================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# œ ’ljÁEŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :level_up_flags # LEVEL UP!•Ž¦
end
#=====================
# ¡ Game_Battler
#=====================
class Game_Battler
#--------------------------------------------------------------------------
# œ ’ljÁEŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :exp_gain_ban # EXPŽæ“¾ˆêŽž‹ÖŽ~
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias xrxs_bp10_initialize initialize
def initialize
@exp_gain_ban = false
xrxs_bp10_initialize
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg [EXP ‚ðŠl“¾‚Å‚«‚È‚¢] ”»’è
#--------------------------------------------------------------------------
alias xrxs_bp10_cant_get_exp? cant_get_exp?
def cant_get_exp?
if @exp_gain_ban == true
return true
else
return xrxs_bp10_cant_get_exp?
end
end
end
#=====================
# ¡ Scene_Battle
#=====================
class Scene_Battle
#--------------------------------------------------------------------------
# œ ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
alias xrxs_bp10_start_phase5 start_phase5
def start_phase5
# EXP Šl“¾‹ÖŽ~
for i in 0...$game_party.actors.size
$game_party.actors.exp_gain_ban = true
end
xrxs_bp10_start_phase5
# EXP Šl“¾‹ÖŽ~‚̉ðœ
for i in 0...$game_party.actors.size
$game_party.actors.exp_gain_ban = false
end
# EXP‚ð‰Šú‰»
@exp_gained = 0
for enemy in $game_troop.enemies
# Šl“¾ EXP‚ð’ljÁ # ƒGƒlƒ~[‚ª‰B‚êó‘Ô‚Å‚È‚¢ê‡
@exp_gained += enemy.exp if not enemy.hidden
end
# Ý’è
@phase5_step = 0
@exp_gain_actor = -1
# ƒŠƒUƒ‹ƒgƒEƒBƒ“ƒhƒE‚𕎦
@result_window.y -= 64
@result_window.visible = true
# ƒŒƒxƒ‹ƒAƒbƒv”»’è‚Ö
phase5_next_levelup
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒY)
#--------------------------------------------------------------------------
alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
case @phase5_step
when 1
update_phase5_step1
else
xrxs_bp10_update_phase5
# ƒŒƒxƒ‹ƒAƒbƒv‚µ‚Ä‚¢‚éꇂ͋§ƒoƒgƒ‹I—¹
battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒY 1 : ƒŒƒxƒ‹ƒAƒbƒv)
#--------------------------------------------------------------------------
def update_phase5_step1
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚ÄŽŸ‚̃AƒNƒ^[‚Ö
@levelup_window.visible = false if @levelup_window != nil
@status_window.level_up_flags[@exp_gain_actor] = false
phase5_next_levelup
end
end
#--------------------------------------------------------------------------
# œ ŽŸ‚̃AƒNƒ^[‚̃Œƒxƒ‹ƒAƒbƒv•Ž¦‚Ö
#--------------------------------------------------------------------------
def phase5_next_levelup
begin
# ŽŸ‚̃AƒNƒ^[‚Ö
@exp_gain_actor += 1
# ÅŒã‚̃AƒNƒ^[‚Ìê‡
if @exp_gain_actor >= $game_party.actors.size
# ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
@phase5_step = 0
return
end
actor = $game_party.actors[@exp_gain_actor]
if actor.cant_get_exp? == false
# Œ»Ý‚Ì”—Í’l‚ð•ÛŽ
last_level = actor.level
last_maxhp = actor.maxhp
last_maxsp = actor.maxsp
last_str = actor.str
last_dex = actor.dex
last_agi = actor.agi
last_int = actor.int
# ŒoŒ±’lŽæ“¾‚ÌŒˆ’è“IuŠÔ(“ä
actor.exp += @exp_gained
# ”»’è
if actor.level > last_level
# ƒŒƒxƒ‹ƒAƒbƒv‚µ‚½ê‡
@status_window.level_up(@exp_gain_actor)
if $data_system_level_up_se != ""
Audio.se_stop
Audio.se_play($data_system_level_up_se)
end
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
@levelup_window = Window_LevelUpWindow.new(actor, last_level,
actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
@levelup_window.x = 160 * @exp_gain_actor
@levelup_window.visible = true
@phase5_wait_count = 40
@phase5_step = 1
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
return
end
end
end until false
end
end
# ¥£¥ XRXS_17. ƒXƒŠƒbƒvƒ_ƒ[ƒW–hŒä^Œø‰Ê—ÊÚ׉» ver.1.51 ¥£¥
# by ÷‰ë Ý“y, fukuyama
#=====================
# ¡ Game_Battler
#=====================
class Game_Battler
#--------------------------------------------------------------------------
# œ ƒXƒŠƒbƒvƒ_ƒ[ƒW‚ÌŒø‰Ê“K—p
#--------------------------------------------------------------------------
alias xrxs_bp7_slip_damage_effect slip_damage_effect
def slip_damage_effect
# ”’l‚̉Šú‰»
slip_damage_percent = 0
slip_damage_plus = 0
# Œ»Ý•t‰Á‚³‚ê‚Ä‚¢‚éƒXƒe[ƒg‚Ì’†‚©‚çƒXƒŠƒbƒvƒ_ƒ[ƒW—L‚è‚̃‚ƒm‚ð’T‚·
for i in @states
if $data_states.slip_damage
# ‚»‚̃Xƒe[ƒg‚ªŽ‚Á‚Ä‚¢‚éƒXƒŠƒbƒvƒ_ƒ[ƒW‚Ì
# Lvƒvƒ‰ƒXƒXƒe[ƒg‚Ü‚½‚ÍLvƒ}ƒCƒiƒXƒXƒe[ƒg‚ð”»’èB
for j in $data_states.plus_state_set
if $data_states[j] != nil
if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)(%|“)/
slip_damage_percent += $1.to_i
elsif $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)$/
slip_damage_plus += $1.to_i
end
end
end
for j in $data_states.minus_state_set
if $data_states[j] != nil
if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)(%|“)/
slip_damage_percent -= $1.to_i
elsif $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)$/
slip_damage_plus -= $1.to_i
end
end
end
end
end
if slip_damage_percent == 0 and slip_damage_plus == 0
xrxs_bp7_slip_damage_effect
else
# –h‹ï‚ªƒXƒŠƒbƒv–hŒä‚ª‚ ‚éꇂ𔻒è
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
next if armor == nil
for j in armor.guard_state_set
if $data_states[j] != nil
if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)(%|“)/
if slip_damage_percent > 0
slip_damage_percent = [slip_damage_percent - $1.to_i, 0].max
end
end
if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)$/
if slip_damage_percent > 0
slip_damage_plus = [slip_damage_plus - $1.to_i, 0].max
end
end
end
end
end
# ƒ_ƒ[ƒW‚ðÝ’è
self.damage = self.maxhp * slip_damage_percent / 100 + slip_damage_plus
# •ªŽU
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# HP ‚©‚çƒ_ƒ[ƒW‚ðŒ¸ŽZ
self.hp -= self.damage
# ƒƒƒbƒhI—¹
return true
end
end
end
# ¥£¥ XRXS_BP 1. CP§“±“ü ver.15 ¥£¥
# by ÷‰ë Ý“y, ˜aŠó, Jack-R
#=====================
# ¡ Scene_Battle_CP
#=====================
class Scene_Battle_CP
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :stop # CP‰ÁŽZƒXƒgƒbƒv
#----------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‚̉Šú‰»
#----------------------------------------------------------------------------
def initialize
@battlers = []
@cancel = false
@agi_total = 0
# ”z—ñ @count_battlers ‚ð‰Šú‰»
@count_battlers = []
# ƒGƒlƒ~[‚ð”z—ñ @count_battlers ‚ɒljÁ
for enemy in $game_troop.enemies
@count_battlers.push(enemy)
end
# ƒAƒNƒ^[‚ð”z—ñ @count_battlers ‚ɒljÁ
for actor in $game_party.actors
@count_battlers.push(actor)
end
for battler in @count_battlers
@agi_total += battler.agi
end
for battler in @count_battlers
battler.cp = [[65535 * (rand(15) + 85) / 100 * battler.agi / @agi_total * 4, 0].max, 65535].min
end
end
#----------------------------------------------------------------------------
# œ CPƒJƒEƒ“ƒg‚ÌŠJŽn
#----------------------------------------------------------------------------
def start
if @cp_thread != nil then
return
end
@cancel = false
@stop = false
# ‚±‚±‚©‚çƒXƒŒƒbƒh
@cp_thread = Thread.new do
while @cancel != true
if @stop != true
self.update # XV
sleep(0.05)
end
end
end
# ‚±‚±‚܂ŃXƒŒƒbƒh
end
#----------------------------------------------------------------------------
# œ CPƒJƒEƒ“ƒgƒAƒbƒv
#----------------------------------------------------------------------------
def update
if @count_battlers != nil then
for battler in @count_battlers
# s“®o—ˆ‚È‚¯‚ê‚Ζ³Ž‹
if battler.dead? == true #or battler.movable? == false then
battler.cp = 0
next
end
# ‚±‚±‚Ì 1.3‚ð•Ï‚¦‚邱‚Æ‚Å«ƒXƒs[ƒh‚ð•ÏX‰Â”B‚½‚¾‚µ¬”“_‚ÍŽg—p‚·‚邱‚ÆB
battler.cp = [[battler.cp + 1.3 * 4096 * battler.agi / @agi_total, 0].max, 65535].min
end
end
end
#----------------------------------------------------------------------------
# œ CPƒJƒEƒ“ƒg‚ÌŠJŽn
#----------------------------------------------------------------------------
def stop
@cancel = true
if @cp_thread != nil then
@cp_thread.join
@cp_thread = nil
end
end
end
#=====================
# ¡ Game_Battler
#=====================
class Game_Battler
attr_accessor :now_guarding # Œ»Ý–hŒä’†ƒtƒ‰ƒO
attr_accessor :cp # Œ»ÝCP
attr_accessor :slip_state_update_ban # ƒXƒŠƒbƒvEƒXƒe[ƒgŽ©“®ˆ—‚Ì‹ÖŽ~
#--------------------------------------------------------------------------
# œ ƒRƒ}ƒ“ƒh“ü—͉””»’è
#--------------------------------------------------------------------------
def inputable?
return (not @hidden and restriction <= 1 and @cp >=65535)
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg [ƒXƒŠƒbƒvƒ_ƒ[ƒW] ”»’è
#--------------------------------------------------------------------------
alias xrxs_bp1_slip_damage? slip_damage?
def slip_damage?
return false if @slip_state_update_ban
return xrxs_bp1_slip_damage?
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒgŽ©‘R‰ðœ (ƒ^[ƒ“‚²‚ƂɌĂÑo‚µ)
#--------------------------------------------------------------------------
alias xrxs_bp1_remove_states_auto remove_states_auto
def remove_states_auto
return if @slip_state_update_ban
xrxs_bp1_remove_states_auto
end
end
#=====================
# ¡ Game_Actor
#=====================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# œ ƒZƒbƒgƒAƒbƒv
#--------------------------------------------------------------------------
alias xrxs_bp1_setup setup
def setup(actor_id)
xrxs_bp1_setup(actor_id)
@hate = 100 # init-value is 100
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end
#=====================
# ¡ Game_Enemy
#=====================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias xrxs_bp1_initialize initialize
def initialize(troop_id, member_index)
xrxs_bp1_initialize(troop_id, member_index)
@hate = 100 # init-value is 100
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end
#=====================
# ¡ Window_BattleStatus
#=====================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :update_cp_only # CPƒ[ƒ^[‚Ì‚Ý‚ÌXV
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias xrxs_bp1_initialize initialize
def initialize
@update_cp_only = false
xrxs_bp1_initialize
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
alias xrxs_bp1_refresh refresh
def refresh
if @update_cp_only == false
xrxs_bp1_refresh
end
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 4
draw_actor_cp_meter(actor, actor_x, 96, 120, 0)
end
end
#--------------------------------------------------------------------------
# œ CPƒ[ƒ^[ ‚Ì•`‰æ
#--------------------------------------------------------------------------
def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
if actor.cp == nil
actor.cp = 0
end
w = width * [actor.cp,65535].min / 65535
self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
end
end
#=====================
# ¡ Scene_Battle
#=====================
class Scene_Battle
# ‚±‚±‚ÉŒø‰Ê‰¹‚ðÝ’è‚·‚é‚ÆAƒAƒNƒ^[ƒRƒ}ƒ“ƒh‚ªƒ|ƒbƒv‚µ‚½‚Æ‚«‚ÉŒø‰Ê‰¹‚ðĶ
$data_system_command_up_se = ""
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹I—¹
# result : Œ‹‰Ê (0:Ÿ—˜ 1:”s–k 2:“¦‘–)
#--------------------------------------------------------------------------
alias xrxs_bp1_battle_end battle_end
def battle_end(result)
# CPƒJƒEƒ“ƒg’âŽ~
@cp_thread.stop
xrxs_bp1_battle_end(result)
end
#--------------------------------------------------------------------------
# œ ƒvƒŒƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
alias xrxs_bp1_start_phase1 start_phase1
def start_phase1
@agi_total = 0
@cp_thread = Scene_Battle_CP.new
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðÄì¬
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, "Courir"])
@actor_command_window.y = 128
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
@actor_command_window.draw_item(4, $game_temp.battle_can_escape ? @actor_command_window.normal_color : @actor_command_window.disabled_color)
xrxs_bp1_start_phase1
end
#--------------------------------------------------------------------------
# œ ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
alias xrxs_bp1_start_phase2 start_phase2
def start_phase2
xrxs_bp1_start_phase2
@party_command_window.active = false
@party_command_window.visible = false
# ŽŸ‚Ö
start_phase3
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒY)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase2 update_phase2
def update_phase2
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒƒ‹ˆÊ’u‚Å•ªŠò
case @party_command_window.index
when 0 # 키
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
@cp_thread.start
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
start_phase3
end
return
end
xrxs_bp1_update_phase2
end
#--------------------------------------------------------------------------
# œ ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
#--------------------------------------------------------------------------
def phase3_next_actor
# ƒ‹[ƒv
begin
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_battler != nil
@active_battler.blink = false
end
# ÅŒã‚̃AƒNƒ^[‚Ìê‡
if @actor_index == $game_party.actors.size-1
# ƒƒCƒ“ƒtƒF[ƒYŠJŽn
@cp_thread.start
start_phase4
return
end
# ƒAƒNƒ^[‚̃Cƒ“ƒfƒbƒNƒX‚ði‚ß‚é
@actor_index += 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
if @active_battler.inputable? == false
@active_battler.current_action.kind = -1
end
# ƒAƒNƒ^[‚ªƒRƒ}ƒ“ƒh“ü—Í‚ðŽó‚¯•t‚¯‚È‚¢ó‘Ô‚È‚ç‚à‚¤ˆê“x
end until @active_battler.inputable?
@cp_thread.stop
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒZƒbƒgƒAƒbƒv
@active_battler.now_guarding = false
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# œ ‘O‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
#--------------------------------------------------------------------------
def phase3_prior_actor
# ƒ‹[ƒv
begin
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_battler != nil
@active_battler.blink = false
end
# ʼn‚̃AƒNƒ^[‚Ìê‡
if @actor_index == 0
# ʼn‚Ö–ß‚é
start_phase3
return
end
# ƒAƒNƒ^[‚̃Cƒ“ƒfƒbƒNƒX‚ð–ß‚·
@actor_index -= 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# ƒAƒNƒ^[‚ªƒRƒ}ƒ“ƒh“ü—Í‚ðŽó‚¯•t‚¯‚È‚¢ó‘Ô‚È‚ç‚à‚¤ˆê“x
end until @active_battler.inputable?
@cp_thread.stop
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒZƒbƒgƒAƒbƒv
@active_battler.now_guarding = false
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃ZƒbƒgƒAƒbƒv
#--------------------------------------------------------------------------
alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
# Œø‰Ê‰¹‚ÌĶ
Audio.se_play($data_system_command_up_se) if $data_system_command_up_se != ""
# –ß‚·
xrxs_bp1_phase3_setup_command_window
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : Šî–{ƒRƒ}ƒ“ƒh)
#--------------------------------------------------------------------------
alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒƒ‹ˆÊ’u‚Å•ªŠò
case @actor_command_window.index
when 4 # “¦‚°‚é
if $game_temp.battle_can_escape
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 4
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
else
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
xrxs_bsp1_update_phase3_basic_command
end
#--------------------------------------------------------------------------
# œ ƒƒCƒ“ƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
alias xrxs_bp1_start_phase4 start_phase4
def start_phase4
xrxs_bp1_start_phase4
# ƒGƒlƒ~[ƒAƒNƒVƒ‡ƒ“ì¬
for enemy in $game_troop.enemies
if enemy.cp < 65535
enemy.current_action.clear
enemy.current_action.kind = -1 # ƒ^[ƒ“”ò‚΂µB
next
end
enemy.make_action
end
# s“®‡˜ì¬
make_action_orders
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 1 : ƒAƒNƒVƒ‡ƒ“€”õ)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase4_step1 update_phase4_step1
def update_phase4_step1
# ‰Šú‰»
@phase4_act_continuation = 0
# Ÿ”s”»’è
if judge
@cp_thread.stop
# Ÿ—˜‚Ü‚½‚Í”s–k‚Ìê‡ : ƒƒƒbƒhI—¹
return
end
# –¢s“®ƒoƒgƒ‰[”z—ñ‚Ì擪‚©‚çŽæ“¾
@active_battler = @action_battlers[0]
# ƒXƒe[ƒ^ƒXXV‚ðCP‚¾‚¯‚ÉŒÀ’èB
@status_window.update_cp_only = true
# ƒXƒe[ƒgXV‚ð‹ÖŽ~B
@active_battler.slip_state_update_ban = true if @active_battler != nil
# –ß‚·
xrxs_bp1_update_phase4_step1
# ‹ÖŽ~‚ð‰ðœ
@status_window.update_cp_only = false
@active_battler.slip_state_update_ban = false if @active_battler != nil
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 2 : ƒAƒNƒVƒ‡ƒ“ŠJŽn)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# ‹§ƒAƒNƒVƒ‡ƒ“‚Å‚È‚¯‚ê‚Î
unless @active_battler.current_action.forcing
# CP‚ª‘«‚è‚Ä‚¢‚È‚¢ê‡
if @phase4_act_continuation == 0 and @active_battler.cp < 65535
@phase4_step = 6
return
end
# §–ñ‚ª [“G‚ð’ÊíUŒ‚‚·‚é] ‚© [–¡•û‚ð’ÊíUŒ‚‚·‚é] ‚Ìê‡
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# ƒAƒNƒVƒ‡ƒ“‚ÉUŒ‚‚ðÝ’è
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# §–ñ‚ª [s“®‚Å‚«‚È‚¢] ‚Ìê‡
if @active_battler.restriction == 4
# ƒAƒNƒVƒ‡ƒ“‹§‘Îۂ̃oƒgƒ‰[‚ðƒNƒŠƒA
$game_temp.forcing_battler = nil
if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
# ƒXƒe[ƒgŽ©‘R‰ðœ
@active_battler.remove_states_auto
# CPÁ”ï
@active_battler.cp = [(@active_battler.cp - 65535),0].max
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
end
# ƒXƒeƒbƒv 1 ‚ɈÚs
@phase4_step = 1
return
end
end
# ƒAƒNƒVƒ‡ƒ“‚ÌŽí•Ê‚Å•ªŠò
case @active_battler.current_action.kind
when 0
# UŒ‚¥–hŒäE“¦‚°‚éE‰½‚à‚µ‚È‚¢Žž‚Ì‹¤’ÊÁ”ïCP
@active_battler.cp -= 0 if @phase4_act_continuation == 0
when 1
# ƒXƒLƒ‹Žg—pŽž‚ÌÁ”ïCP
@active_battler.cp -= 65535 if @phase4_act_continuation == 0
when 2
# ƒAƒCƒeƒ€Žg—pŽž‚ÌÁ”ïCP
@active_battler.cp -= 65535 if @phase4_act_continuation == 0
when -1
# CP‚ª—‚Ü‚Á‚Ä‚¢‚È‚¢
@phase4_step = 6
return
end
# CP‰ÁŽZ‚ðˆêŽž’âŽ~‚·‚é
@cp_thread.stop = true
# ƒXƒe[ƒgŽ©‘R‰ðœ
@active_battler.remove_states_auto
xrxs_bp1_update_phase4_step2
end
#--------------------------------------------------------------------------
# œ Šî–{ƒAƒNƒVƒ‡ƒ“ Œ‹‰Êì¬
#--------------------------------------------------------------------------
alias xrxs_bp1_make_basic_action_result make_basic_action_result
def make_basic_action_result
# UŒ‚‚Ìê‡
if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
@active_battler.cp -= 65535 # UŒ‚Žž‚ÌCPÁ”ï
end
# –hŒä‚Ìê‡
if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
@active_battler.cp -= 32767 # –hŒäŽž‚ÌCPÁ”ï
end
# “G‚Ì“¦‚°‚é‚Ìê‡
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
@active_battler.cp -= 65535 # “¦‘–Žž‚ÌCPÁ”ï
end
# ‰½‚à‚µ‚È‚¢‚Ìê‡
if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
@active_battler.cp -= 32767 # ‰½‚à‚µ‚È‚¢Žž‚ÌCPÁ”ï
end
# “¦‚°‚é‚Ìê‡
if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
@active_battler.cp -= 65535 # “¦‘–Žž‚ÌCPÁ”ï
# “¦‘–‰Â”‚Å‚Í‚È‚¢ê‡
if $game_temp.battle_can_escape == false
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# “¦‘–ˆ—
update_phase2_escape
return
end
xrxs_bp1_make_basic_action_result
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 5 : ƒ_ƒ[ƒW•Ž¦)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase4_step5 update_phase4_step5
def update_phase4_step5
# ƒXƒŠƒbƒvƒ_ƒ[ƒW
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
xrxs_bp1_update_phase4_step5
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 6 : ƒŠƒtƒŒƒbƒVƒ…)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase4_step6 update_phase4_step6
def update_phase4_step6
# CP‰ÁŽZ‚ðÄŠJ‚·‚é
@cp_thread.stop = false
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ð‰B‚·
@help_window.visible = false
xrxs_bp1_update_phase4_step6
end
end
# ¥£¥ XRXS_BP 7. ƒoƒgƒ‹ƒXƒe[ƒ^ƒXEƒNƒŠƒAƒfƒUƒCƒ“ ver.1.02 ¥£¥
# by ÷‰ë Ý“y, TOMY
#=====================
# ¡ Window_BattleStatus
#=====================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :update_cp_only # CPƒ[ƒ^[‚Ì‚Ý‚ÌXV
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias xrxs_bp7_initialize initialize
def initialize
xrxs_bp7_initialize
# «Full-View‚Ìꇂ͉º“ñs‚Ì # ‚ðÁ‚µ‚Ä‚‚¾‚³‚¢B
#self.opacity = 0
#self.back_opacity = 0
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
alias xrxs_bp7_refresh refresh
def refresh
if @update_cp_only
xrxs_bp7_refresh
return
end
# •`ŽÊ‚ð‹ÖŽ~‚µ‚È‚ª‚ç–ß‚·
@draw_ban = true
xrxs_bp7_refresh
# •`ŽÊ‚Ì‹ÖŽ~‚ð‰ðœ
@draw_ban = false
# •`ŽÊ‚ðŠJŽn
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 21
# •àsƒLƒƒƒ‰ƒOƒ‰ƒtƒBƒbƒN‚Ì•`ŽÊ
draw_actor_graphic(actor, actor_x - 9, 116)
# HP/SPƒ[ƒ^[‚Ì•`ŽÊ
draw_actor_hp_meter_line(actor, actor_x, 72, 96, 12)
draw_actor_sp_meter_line(actor, actor_x, 104, 96, 12)
# HP”’l‚Ì•`ŽÊ
self.contents.font.size = 24 # HP/SP”’l‚Ì•¶Žš‚Ì‘å‚«‚³
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
draw_shadow_text(actor_x-2, 58, 96, 24, actor.hp.to_s, 2)
# SP”’l‚Ì•`ŽÊ
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
draw_shadow_text(actor_x-2, 90, 96, 24, actor.sp.to_s, 2)
# —pŒêuHPv‚Æ—pŒêuSPv‚Ì•`ŽÊ
self.contents.font.size = 12 # —pŒêuHP/SPv‚Ì•¶Žš‚Ì‘å‚«‚³
self.contents.font.color = system_color # —pŒêuHP/SPv‚Ì•¶Žš‚ÌF
draw_shadow_text(actor_x, 60, 96, 12, $data_system.words.hp)
draw_shadow_text(actor_x, 92, 96, 12, $data_system.words.sp)
draw_actor_state(actor, actor_x, 100)
end
end
end
#=====================
# ¡ Window_Base
#=====================
class Window_Base < Window
#--------------------------------------------------------------------------
# œ HPƒ[ƒ^[ ‚Ì•`‰æ
#--------------------------------------------------------------------------
def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.hp / actor.maxhp
hp_color_1 = Color.new(255, 0, 0, 192)
hp_color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end
#--------------------------------------------------------------------------
# œ SPƒ[ƒ^[ ‚Ì•`‰æ
#--------------------------------------------------------------------------
def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.sp / actor.maxsp
hp_color_1 = Color.new( 0, 0, 255, 192)
hp_color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end
#--------------------------------------------------------------------------
# œ –¼‘O‚Ì•`‰æ
#--------------------------------------------------------------------------
alias xrxs_bp7_draw_actor_name draw_actor_name
def draw_actor_name(actor, x, y)
xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg‚Ì•`‰æ
#--------------------------------------------------------------------------
alias xrxs_bp7_draw_actor_state draw_actor_state
def draw_actor_state(actor, x, y, width = 120)
xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
end
#--------------------------------------------------------------------------
# œ HP ‚Ì•`‰æ
#--------------------------------------------------------------------------
alias xrxs_bp7_draw_actor_hp draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
end
#--------------------------------------------------------------------------
# œ SP ‚Ì•`‰æ
#--------------------------------------------------------------------------
alias xrxs_bp7_draw_actor_sp draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
end
end
#=====================
# ž ŠO•”ƒ‰ƒCƒuƒ‰ƒŠ
#=====================
class Window_Base
#--------------------------------------------------------------------------
# œ ƒ‰ƒ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
#--------------------------------------------------------------------------
# œ ‰e•¶Žš•`‰æ by TOMY
#--------------------------------------------------------------------------
def draw_shadow_text(x, y, width, height, string, align = 0)
# Œ³‚ÌF‚ð•Û‘¶‚µ‚Ä‚¨‚
color = self.contents.font.color.dup
# •Žš‚ʼne•`‰æ
self.contents.font.color = Color.new(0, 0, 0)
self.contents.draw_text(x + 2, y + 2, width, height, string, align)
# Œ³‚ÌF‚É–ß‚µ‚Ä•`‰æ
self.contents.font.color = color
self.contents.draw_text(x, y, width, height, string, align)
end
end |
EDIT:Sa marche tjr pas --'
|
Posté dans Tutoriels - Afficher une image avec des variables |
pourquoi -
posté le 03/08/2009 à 13:10:53. (24 messages postés) |
| Moi j'ai plus simple : faut noter la position en carreaux où il faudra mettre l'image. Ensuite, faut mutiplier les deux nombres par 32.
Imaginez: au début du jeu, vous voulez faire apparaitre un personnage au centre de l'écran. L'écran fait 20,15, sois 640X480 pixels.. Le centre est donc 10,7(environs) sois 320X240pixels.
On met "afficher une image, définie par raport au pixel central, X:320 Y:240 et voilà: vous avez une image bien au centre
Pour ceux qui on pas comprix, ben tant pis
|
Posté dans Scripts - X Menu |
Pourquoi -
posté le 02/07/2009 à 13:09:11. (24 messages postés) |
| Je crois (J'ai bien dis je crois) que j'ai enlevétous les x) dans le script ;)x)XD
Spoiler (cliquez pour afficher) class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Statut"
s5 = "Sauvegarder"
s6 = "Quitter"
@command_window = Xcommand.new(640, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
@command_window.x = -640
@command_window.opacity = 220
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
@playtime_window = XPlayTime.new
@playtime_window.x = 640
@playtime_window.y = 64
@playtime_window.opacity = 220
@gold_window = XGold.new
@gold_window.x = 640
@gold_window.y = 320
@gold_window.opacity = 220
@location_window = Xlocation.new
@location_window.x = 640
@location_window.y = 160
@location_window.opacity = 220
@status_window = Xstatus.new
@status_window.x = -400
@status_window.y = 64
@status_window.opacity = 220
@realtime_window = Xtime.new
@realtime_window.x = 640
@realtime_window.y = 224
@realtime_window.opacity = 220
@title_window = Xtitle.new
@title_window.x = 640
@title_window.y = 384
@title_window.opacity = 220
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@location_window.dispose
@realtime_window.dispose
@spriteset.dispose
@title_window.dispose
end
def update
@command_window.update
if @command_window.x < 0
@command_window.x += 40
end
@playtime_window.update
if @playtime_window.x > 400
@playtime_window.x -= 40
end
@gold_window.update
if @realtime_window.x == 400
if @gold_window.x > 400
@gold_window.x -= 40
end
end
@status_window.update
if @status_window.x < 0
@status_window.x += 20
end
@location_window.update
if @playtime_window.x == 400
if @location_window.x > 400
@location_window.x -= 40
end
end
@realtime_window.update
if @location_window.x == 400
if @realtime_window.x > 400
@realtime_window.x -= 40
end
end
@title_window.update
if @gold_window.x == 400
if @title_window.x > 400
@title_window.x -= 40
end
end
if @title_window.x == 400
if @command_window.opacity > 180
@command_window.opacity -= 20
end
if @playtime_window.opacity > 180
@playtime_window.opacity -= 20
end
if @location_window.opacity > 180
@location_window.opacity -= 20
end
if @realtime_window.opacity > 180
@realtime_window.opacity -= 20
end
if @gold_window.opacity > 180
@gold_window.opacity -= 20
end
if @title_window.opacity > 180
@title_window.opacity -= 20
end
if @status_window.opacity > 180
@status_window.opacity -= 20
end
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item2.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End2.new
end
return
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = XskillScene.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip2.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status2.new(@status_window.index)
end
return
end
end
end
class XPlayTime < Window_Base
def initialize
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Temps")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
class XGold < Window_Base
def initialize
super(0, 0, 240, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
class Xtitle < Window_Base
def initialize
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Times New Roman"
self.contents.font.size = 30
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Times New Roman"
self.contents.font.color = normal_color
self.contents.font.size = 30
self.contents.draw_text(4, 0, 120, 32, "Ton titre ici")
self.contents.font.name = $fontface
self.contents.font.color = system_color
self.contents.font.size = 14
self.contents.draw_text(4, 0, 120, 100, "Appuiez que [Echap]")
end
def update
super
refresh
end
end
class Xtime < Window_Base
def initialize
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = $fontsize
self.contents.draw_text(4, 0, 120, 32, "Temps réel")
@time_string = Time.now
text = @time_string.strftime("%A %H:%M:%S")
self.contents.font.size = 18
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
end
def update
super
refresh
end
end
class Xlocation < Window_Base
def initialize
super(0, 0, 240, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.clear
self.contents.font.color = system_color
self.contents.font.color = normal_color
$maps = load_data("Data/MapInfos.rxdata")
@map_id = $game_map.map_id
@currmap = $maps[@map_id].name
self.contents.font.size = 16
self.contents.draw_text(4, 0, 64, 32, @currmap)
end
end
class Xcursor < Window_Base
attr_reader :index
attr_reader :_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
def index=(index)
@index = index
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end
def update_cursor_rect
row = @index / @column_max
cursor_width = 26
x = @index / @column_max * 90 - self.ox
y = 2
self.cursor_rect.set(x, y, cursor_width, 26)
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::RIGHT)
if (@row_max == 1 and Input.trigger?(Input::RIGHT)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max)
end
end
if Input.repeat?(Input::LEFT)
if (@row_max == 1 and Input.trigger?(Input::LEFT)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
if Input.repeat?(Input::UP)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
class Xcommand < Xcursor
def initialize(width, commands)
super(0, 0, width, 64)
@item_max = commands.size
@commands = commands
row_max = 1
column_max = 7
self.contents = Bitmap.new(width - 32, @item_max - 32)
self.contents.font.name = $fontface
self.contents.font.size = 12
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(90 * index + 29, -2, self.contents.width - 8, 30)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap1 = RPG::Cache.icon('034-Item03')
bitmap2 = RPG::Cache.icon('045-Skill02')
bitmap3 = RPG::Cache.icon('013-Body01')
bitmap4 = RPG::Cache.icon('040-Item09')
bitmap5 = RPG::Cache.icon('038-Item07')
bitmap6 = RPG::Cache.icon('048-Skill05')
self.contents.blt(0, 2, bitmap1, Rect.new(0, 0, 24, 24), opacity)
self.contents.blt(90, 2, bitmap2, Rect.new(0, 0, 24, 24), opacity)
self.contents.blt(180, 2, bitmap3, Rect.new(0, 0, 24, 24), opacity)
self.contents.blt(270, 2, bitmap4, Rect.new(0, 0, 24, 24), opacity)
self.contents.blt(360, 2, bitmap5, Rect.new(0, 0, 24, 24), opacity)
self.contents.blt(450, 2, bitmap6, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(rect, @commands[index])
end
def disable_item(index)
draw_item(index, disabled_color)
end
end
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
class Window_BaseX < Window_Base
alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_hp_original(actor, x, y, width)
end
alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_sp_original(actor, x, y, width)
end
alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
if actor.next_exp != 0
exp = (width + plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width + plus_width) * rate_width / 100
end
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_exp_original(actor, x, y)
end
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width - width) / 2
when 2
x += rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end
self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end
class Bitmap
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x)/ (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x)/ (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x)/ (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x)/ (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x)/ (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x)/ (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x)/ (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x)/ (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end
module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITIQUE", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITIQUE", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITIQUE", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITIQUE", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITIQUE", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end
class Xstatusselect < Window_BaseX
attr_reader :index
attr_reader :_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
def index=(index)
@index = index
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
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 = 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input:OWN)
if (@column_max == 1 and Input.trigger?(Input:OWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::UP)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
class Xstatus < Xstatusselect
def initialize
super(0, 0, 400, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 90
actor = $game_party.actors
draw_actor_face(actor, x + 200, y + 79)
draw_actor_graphic(actor, x - 50, y + 80)
self.contents.font.size = 18
draw_actor_name(actor, x - 60, y + 4)
self.contents.font.color = system_color
self.contents.draw_text(x - 5, y + 2, 120, 32, '-')
self.contents.font.color = normal_color
draw_actor_class(actor, x + 75, y + 4)
draw_actor_level(actor, x + 5, y + 4)
draw_actor_state(actor, x + 135, y + 4)
draw_actor_exp(actor, x - 35, y + 54)
draw_actor_hp(actor, x - 35, y + 32)
draw_actor_sp(actor, x + 115, y + 32)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(1, @index * 90 + 33, 26, 48)
end
end
def draw_actor_face(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = 90
src_rect = Rect.new(3, -1, fw, fh)
opacity = 180
self.contents.blt(x - fw / 23, y - fh, face, src_rect, opacity)
end
end
class Window_HelpItemSkill < Window_Base
def initialize
super(0, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
end
def set_text(text, align = 0)
if text != @text or align != @align
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = 18
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
class Xskill < Window_Selectable
def initialize(actor)
super(0, 128, 320, 352)
@actor = actor
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills]
if skill != nil
@data.push(skill)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
class Window_SkillStatus2 < Window_Base
def initialize(actor)
super(0, 64, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 18
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_state(@actor, 60, 0)
draw_actor_sp(@actor, 130, 0)
end
end
class Window_Item2 < Window_Selectable
def initialize
super(0, 64, 320, 416)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items)
end
end
unless $game_temp.in_battle
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons)
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors)
end
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
class XskillScene
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@spriteset = Spriteset_Map.new
@actor = $game_party.actors[@actor_index]
@help_window = Window_HelpItemSkill.new
@help_window.back_opacity = 160
@help_window.x = -320
@status_window = Window_SkillStatus2.new(@actor)
@status_window.back_opacity = 160
@status_window.x = -320
@skill_window = Xskill.new(@actor)
@skill_window.back_opacity = 160
@skill_window.help_window = @help_window
@skill_window.x = -320
@target_window = Window_Target2.new
@target_window.visible = false
@target_window.active = false
@target_window.back_opacity = 160
@target_window.y = 480
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
@spriteset.dispose
end
def update
@help_window.update
if @help_window.x < 0
@help_window.x += 10
end
@status_window.update
if @status_window.x < 0
@status_window.x += 10
end
@skill_window.update
if @skill_window.x < 0
@skill_window.x += 10
end
@target_window.update
if @target_window.y > 0
@target_window.y -= 15
end
if @skill_window.active
update_skill
return
end
if @target_window.active
update_target
return
end
end
def update_skill
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
return
end
if Input.trigger?(Input::C)
@skill = @skill_window.skill
if @skill == nil or not @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @skill.scope >= 3
@skill_window.active = false
@target_window.x = 320
@target_window.y = 480
@target_window.visible = true
@target_window.active = true
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
else
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
$scene = Scene_Map.new
return
end
end
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Skill.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Skill.new(@actor_index)
return
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
if @skill_window.active = true
@target_window.y = 480
end
return
end
if Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
if @target_window.index <= -2
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
class Window_Target2 < Window_Selectable
def initialize
super(0, 0, 320, 400)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 18
self.z += 10
@item_max = $game_party.actors.size
refresh
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 90
actor = $game_party.actors
draw_actor_face(actor, x, y + 70)
draw_actor_face2(actor, x + 200, y + 95)
draw_actor_name(actor, x + 40, y)
draw_actor_class(actor, x + 200, y + 32)
draw_actor_level(actor, x + 200, y + 64)
draw_actor_state(actor, x + 100, y)
draw_actor_hp(actor, x + 40, y + 32)
draw_actor_sp(actor, x + 40, y + 64)
end
end
def draw_actor_face(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 23, y - ch, bitmap, src_rect)
end
def draw_actor_face2(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = 90
src_rect = Rect.new(3, -1, fw, fh)
opacity = 160
self.contents.blt(x - fw / 23, y - fh, face, src_rect, opacity)
end
def update_cursor_rect
if @index <= -2
self.cursor_rect.set(0, (@index + 10) * 90, self.width - 32, 96)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 90 - 20)
else
self.cursor_rect.set(0, @index * 90 + 5, self.width - 32, 90)
end
end
end
class Scene_Item2
def main
@spriteset = Spriteset_Map.new
@help_window = Window_HelpItemSkill.new
@help_window.back_opacity = 160
@help_window.x = -320
@item_window = Window_Item2.new
@item_window.back_opacity = 160
@item_window.help_window = @help_window
@item_window.x = -320
@target_window = Window_Target2.new
@target_window.visible = false
@target_window.active = false
@target_window.back_opacity = 160
@target_window.y = 480
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@item_window.dispose
@target_window.dispose
@spriteset.dispose
end
def update
@help_window.update
if @help_window.x < 0
@help_window.x +=10
end
@item_window.update
if @item_window.x < 0
@item_window.x +=10
end
@target_window.update
if @target_window.y > 0
@target_window.y -= 15
end
if @item_window.active
update_item
return
end
if @target_window.active
update_target
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
if Input.trigger?(Input::C)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = 320
@target_window.y = 480
@target_window.visible = true
@target_window.active = true
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless $game_party.item_can_use?(@item.id)
@item_window.refresh
end
@item_window.active = true
@target_window.visible = false
@target_window.active = false
@target_window.y = 480
return
end
if Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.inde
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
class Window_Status2 < Window_Base
def initialize(actor)
super(0, 0, 430, 370)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_graphic(@actor, 20, 45)
draw_actor_face(@actor, 270, 250)
draw_actor_name(@actor, 4 + 40, 10)
draw_actor_class(@actor, 4 + 160 + 40, 10)
draw_actor_level(@actor, 96 + 40, 10)
draw_actor_state(@actor, 244+ 40, 10)
self.contents.font.size = 18
draw_actor_hp(@actor, 0, 100, 172)
draw_actor_sp(@actor, 0, 116, 172)
draw_actor_parameter(@actor, 0, 160, 0)
draw_actor_parameter(@actor, 0, 224 - 32, 1)
draw_actor_parameter(@actor, 0, 256 - 32, 2)
draw_actor_parameter(@actor, 0, 304 - 32, 3)
draw_actor_parameter(@actor, 0, 336 - 32, 4)
draw_actor_parameter(@actor, 0 + 200, 304 - 32, 5)
draw_actor_parameter(@actor, 0 + 200, 336 - 32, 6)
self.contents.font.color = system_color
self.contents.draw_text(0, 48, 80, 32, "EXP")
self.contents.draw_text(0, 64, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(0 + 80, 48, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(0 + 80, 64, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(200, 48, 96, 32, "Equipment")
draw_item_name($data_weapons[@actor.weapon_id], 200 + 4, 80)
draw_item_name($data_armors[@actor.armor1_id], 200 + 4, 128)
draw_item_name($data_armors[@actor.armor2_id], 200 + 4, 304 - 128)
draw_item_name($data_armors[@actor.armor3_id], 200 + 4, 352 - 128)
draw_item_name($data_armors[@actor.armor4_id], 200 + 4, 400 - 128)
end
def draw_actor_face(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(3, -1, fw, fh)
opacity = 120
self.contents.blt(x - fw / 23, y - fh, face, src_rect, opacity)
end
end
class Scene_Status2
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@spriteset = Spriteset_Map.new
@actor = $game_party.actors[@actor_index]
@status_window = Window_Status2.new(@actor)
@status_window.back_opacity = 160
@status_window.x = -430
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@status_window.dispose
@spriteset.dispose
end
def update
if @status_window.x < 0
@status_window.x +=10
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
end
end
class Scene_End2
def main
@spriteset = Spriteset_Map.new
s1 = "To Title"
s2 = "Shutdown"
s3 = "Cancel"
@command_window2 = Window_Command.new(192, [s1, s2, s3])
@command_window2.x = -192
@command_window2.y = 240 - @command_window2.height / 2
@command_window2.back_opacity = 160
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window2.dispose
@spriteset.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
def update
@command_window2.update
if@command_window2.x < 320 - @command_window2.width / 2
@command_window2.x += 10
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(8)
return
end
if Input.trigger?(Input::C)
case @command_window2.index
when 0
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = Scene_Title.new
when 1
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Menu.new(8)
end
return
end
end
end
class Window_EquipLeft2 < Window_Base
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_graphic(@actor, 20, 58)
draw_actor_face(@actor, 136, 360)
draw_actor_name(@actor, 52, 0)
draw_actor_level(@actor, 52, 32)
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
if @new_atk != nil
self.contents.font.name = "Arial"
self.contents.font.color = system_color
self.contents.draw_text(160, 64, 40, 32, "»", 1)
self.contents.font.color = normal_color
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 96, 40, 32, "»", 1)
self.contents.font.color = normal_color
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 128, 40, 32, "»", 1)
self.contents.font.color = normal_color
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
end
def set_new_parameters(new_atk, new_pdef, new_mdef)
self.contents.font.name = $fontface
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
refresh
end
end
def draw_actor_face(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(3, -1, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
class Window_EquipRight2 < Window_Selectable
def initialize(actor)
super(272, 64, 368, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
class Window_EquipItem2 < Window_Selectable
def initialize(actor, equip_type)
super(272, 256, 368, 224)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons)
end
end
end
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors.kind == @equip_type-1
@data.push($data_armors)
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max-1
draw_item(i)
end
end
def draw_item(index)
item = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
class Scene_Equip2
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
def main
@spriteset = Spriteset_Map.new
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.y = -100
@left_window = Window_EquipLeft2.new(@actor)
@left_window.back_opacity = 160
@left_window.x = -280
@right_window = Window_EquipRight2.new(@actor)
@right_window.back_opacity = 160
@right_window.x = 642
@item_window1 = Window_EquipItem2.new(@actor, 0)
@item_window1.back_opacity = 160
@item_window1.y = 486
@item_window2 = Window_EquipItem2.new(@actor, 1)
@item_window2.back_opacity = 160
@item_window2.y = 486
@item_window3 = Window_EquipItem2.new(@actor, 2)
@item_window3.back_opacity = 160
@item_window3.y = 486
@item_window4 = Window_EquipItem2.new(@actor, 3)
@item_window4.back_opacity = 160
@item_window4.y = 486
@item_window5 = Window_EquipItem2.new(@actor, 4)
@item_window5.back_opacity = 160
@item_window5.y = 486
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@right_window.index = @equip_index
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
@spriteset.dispose
end
def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil)
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
def update
if @help_window.y < 0
@help_window.y += 10
end
@left_window.update
if @left_window.x < 0
@left_window.x += 10
end
@right_window.update
if @right_window.x > 272
@right_window.x -= 10
end
@item_window.update
if @item_window1.y > 256
@item_window1.y -= 10
end
if @item_window2.y > 256
@item_window2.y -= 10
end
if @item_window3.y > 256
@item_window3.y -= 10
end
if @item_window4.y > 256
@item_window4.y -= 10
end
if @item_window5.y > 256
@item_window5.y -= 10
end
refresh
if @right_window.active
update_right
return
end
if @item_window.active
update_item
return
end
end
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
end
end
end
EDIT:
J'ai testé sur RMXP, sa marche tjr pas
|
Posté dans Scripts - Scene_Worldmap 0.9 |
Pourquoi -
posté le 02/07/2009 à 11:26:30. (24 messages postés) |
| Comme je suis très nul en script, vous pouvez me dire comment on appel ce script?
Et sa me met une erreur ligne 221: Citation: class Window_World < Window_Selectable |
|
Posté dans Scripts - Menu avec icônes |
Pourquoi -
posté le 30/06/2009 à 22:00:07. (24 messages postés) |
| T'as quoi contre 0malfrax0, Dayen?
Citation: Même pas foutu de savoir mettre des images. |
|
Posté dans Tutoriels - Ecran titre personnalisé |
Pourquoi -
posté le 30/06/2009 à 21:47:17. (24 messages postés) |
| Sans vouloir être méchant, je trouve ce tuto pourri.
-Pas précis du tout
-Le
Citation: A partir de là, a vous de jouer ! Animations, déplacement des textes, faites arriver votre titre selon vos envies. |
est pas très pratique pour les noobs comme moi
-Tu dis qu'il est utilisable pour Vx, donc t'aurais pu faire le screen de l'event à faire pour Vx
-Je sais pas si je suis le seul, mais j'ai rrrrrrrien compris
Voila, la partie critique est finie
|
Posté dans Scripts - Vie, Magie et Statut sur la map |
Pourquoi -
posté le 30/06/2009 à 20:47:05. (24 messages postés) |
| Super comme premier script! moi je vien de me mettre au RGSS, et j'arive même pas a afficher une immage
Bref, en gros, bravo
|
Posté dans Jeux - 2W Story Épisode 2 |
Pourquoi -
posté le 30/06/2009 à 20:01:34. (24 messages postés) |
| euuuh... j'arive pas à lancer le jeu
C'st un fichier *.ace et j'arive pas a le décompresser avec 7-Zip
plz
|
Posté dans Tutoriels - Chenille |
Pourquoi -
posté le 21/06/2009 à 17:24:57. (24 messages postés) |
| cool ce tuto, mais comme j'utilise que VX, sa va me servir a rien grâce au Script
|
Posté dans Tutoriels - Faire un CMSS |
Pourquoi -
posté le 09/06/2009 à 20:49:30. (24 messages postés) |
| Le probleme, c'est que j'utilise rm2k3, et comme la c'est écrit en anglais, j'arive pas a tout comprendre ( non, chu pas nul en anglais)
|
Aller à la page: 1
|
|
|