Night.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Sorties: "Dread Mac Farlane", (...) / Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

528 connectés actuellement

29445740 visiteurs
depuis l'ouverture

11623 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

ConsoleFun

Leo-Games

Le Temple de Valor

Eclipso

RPG Maker VX

Tous nos partenaires

Devenir
partenaire



Modification de l'affichage des dégâts

Permet de personnaliser l'affichage des dégâts dans un combat.

Script pour RPG Maker XP
Ecrit par Corbaque
Publié par tfkmaster (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Auteur : Corbaque
Logiciel : RPG Maker XP
Nombre de scripts : 1

Installation
A placer au-dessus de Main.

Utilisation
Vous pouvez modifier la police d'écriture, sa taille et sa couleur (rouge, vert, bleu, saturation) en début de script.

Portion de code : Tout sélectionner

1
2
3
  POLICE_DES_LETTRES = "Arial"
  COULEUR_DES_LETTRES = Color.new(255, 255, 255)
  COULEUR_DU_CONTOUR = Color.new(0, 0, 0)



Portion de code : Tout sélectionner

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
#===================================
# Créé par Corbaque
#---------------------------------------------------------------
# Le 19/08/2006
#---------------------------------------------------------------
# Modification de l'affichage des dégâts.
#---------------------------------------------------------------
# Version 1.0
#===================================
module RPG
  # ces trois constantes sont modifiables
  POLICE_DES_LETTRES = "Arial"
  COULEUR_DES_LETTRES = Color.new(255, 255, 255)
  COULEUR_DU_CONTOUR = Color.new(0, 0, 0)
  # Modification de la classe sprite
  class Sprite < ::Sprite
    @@_animations = []
    @@_reference_count = {}
    def initialize(viewport = nil)
      super(viewport)
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
      @_damage_duration = 0
      @_animation_duration = 0
      @_blink = false
    end
    def dispose
      dispose_damage
      dispose_animation
      dispose_loop_animation
      super
    end
    def whiten
      self.blend_type = 0
      self.color.set(255, 255, 255, 128)
      self.opacity = 255
      @_whiten_duration = 16
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
    end
    def appear
      self.blend_type = 0
      self.color.set(0, 0, 0, 0)
      self.opacity = 0
      @_appear_duration = 16
      @_whiten_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
    end
    def escape
      self.blend_type = 0
      self.color.set(0, 0, 0, 0)
      self.opacity = 255
      @_escape_duration = 32
      @_whiten_duration = 0
      @_appear_duration = 0
      @_collapse_duration = 0
    end
    def collapse
      self.blend_type = 1
      self.color.set(255, 64, 64, 255)
      self.opacity = 255
      @_collapse_duration = 48
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
    end
    #-----------------------------------------------------------
    # Redéfinition de la methode damage
    #-----------------------------------------------------------
    def damage(value, critical)
      # Suprime le dernier affichage de
      # dommage si ce n'est pas fait
      dispose_damage
      # Transforme la valeur en chaine de caractère
      if value.is_a?(Numeric)
        damage_string = value.abs.to_s
      else
        damage_string = value.to_s
      end
      # définition du bitmap
      bitmap = Bitmap.new(160, 48)
      bitmap.font.name = POLICE_DES_LETTRES
      bitmap.font.size = 32
      bitmap.font.color = COULEUR_DU_CONTOUR
      bitmap.draw_text(-1, 12, 160, 36, damage_string, 1)
      bitmap.draw_text(0, 13, 160, 36, damage_string, 1)
      bitmap.draw_text(1, 13, 160, 36, damage_string, 1)
      bitmap.draw_text(1, 12, 160, 36, damage_string, 1)
      if value.is_a?(Numeric) and value < 0
        bitmap.font.color.set(176, 255, 144)
      else
        bitmap.font.color = COULEUR_DES_LETTRES
      end
      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
      if critical
        bitmap.font.size = 20
        bitmap.font.color = COULEUR_DU_CONTOUR
        bitmap.draw_text(-1, -1, 160, 20, "COUP CRITIQUE", 1)
        bitmap.draw_text(+1, -1, 160, 20, "COUP CRITIQUE", 1)
        bitmap.draw_text(-1, +1, 160, 20, "COUP CRITIQUE", 1)
        bitmap.draw_text(+1, +1, 160, 20, "COUP CRITIQUE", 1)
        bitmap.font.color = COULEUR_DES_LETTRES
        bitmap.draw_text(0, 0, 160, 20, "COUP CRITIQUE", 1)
      end
      # Définition du sprite
      @_damage_sprite = ::Sprite.new(self.viewport)
      @_damage_sprite.bitmap = bitmap
      @_damage_sprite.ox = 80
      @_damage_sprite.oy = 20
      @_damage_sprite.x = self.x
      @_damage_sprite.y = self.y - self.oy / 2
      @_damage_sprite.z = 3000
      @_damage_sprite.zoom_x = 0
      @_damage_sprite.zoom_y = 0
      @_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(self.viewport)
          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(self.viewport)
        sprite.bitmap = bitmap
        sprite.visible = false
        @_loop_animation_sprites.push(sprite)
      end
      update_loop_animation
    end
    def dispose_damage
      if @_damage_sprite != nil
        @_damage_sprite.bitmap.dispose
        @_damage_sprite.dispose
        @_damage_sprite = nil
        @_damage_duration = 0
      end
    end
    def dispose_animation
      if @_animation_sprites != nil
        sprite = @_animation_sprites[0]
        if sprite != nil
          @@_reference_count[sprite.bitmap] -= 1
          if @@_reference_count[sprite.bitmap] == 0
            sprite.bitmap.dispose
          end
        end
        for sprite in @_animation_sprites
          sprite.dispose
        end
        @_animation_sprites = nil
        @_animation = nil
      end
    end
    def dispose_loop_animation
      if @_loop_animation_sprites != nil
        sprite = @_loop_animation_sprites[0]
        if sprite != nil
          @@_reference_count[sprite.bitmap] -= 1
          if @@_reference_count[sprite.bitmap] == 0
            sprite.bitmap.dispose
          end
        end
        for sprite in @_loop_animation_sprites
          sprite.dispose
        end
        @_loop_animation_sprites = nil
        @_loop_animation = nil
      end
    end
    def blink_on
      unless @_blink
        @_blink = true
        @_blink_count = 0
      end
    end
    def blink_off
      if @_blink
        @_blink = false
        self.color.set(0, 0, 0, 0)
      end
    end
    def blink?
      @_blink
    end
    def effect?
      @_whiten_duration > 0 or
      @_appear_duration > 0 or
      @_escape_duration > 0 or
      @_collapse_duration > 0 or
      @_damage_duration > 0 or
      @_animation_duration > 0
    end
    #-----------------------------------------------------------
    # Redéfinition de la methode update
    #-----------------------------------------------------------
    def update
      # Appel la class superieur (::Sprite)
      super
      #################################
      #       Mise à jour des autres éléments        #
      #################################
      if @_whiten_duration > 0
        @_whiten_duration -= 1
        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
      end
      if @_appear_duration > 0
        @_appear_duration -= 1
        self.opacity = (16 - @_appear_duration) * 16
      end
      if @_escape_duration > 0
        @_escape_duration -= 1
        self.opacity = 256 - (32 - @_escape_duration) * 10
      end
      if @_collapse_duration > 0
        @_collapse_duration -= 1
        self.opacity = 256 - (48 - @_collapse_duration) * 6
      end
      #################################
      # Mouvement du sprite
      if @_damage_duration > 0
        @_damage_duration -= 1
        case @_damage_duration
        when 28..39
          # Modification de la position du sprite
          @_damage_sprite.x += 30 * Math.cos(@_damage_duration * Math::PI / 5)
          @_damage_sprite.y += 15 * Math.sin(@_damage_duration * Math::PI / 5)
          @_damage_sprite.zoom_x += 0.1
          @_damage_sprite.zoom_y += 0.1
        end
        # fondu d'opacitée
        @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
        # supprime le sprite si l'effet est terminé
        if @_damage_duration == 0
          dispose_damage
        end
      end
      #################################
      #       Mise à jour des autres éléments        #
      #################################
      if @_animation != nil and (Graphics.frame_count % 2 == 0)
        @_animation_duration -= 1
        update_animation
      end
      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
        update_loop_animation
        @_loop_animation_index += 1
        @_loop_animation_index %= @_loop_animation.frame_max
      end
      if @_blink
        @_blink_count = (@_blink_count + 1) % 32
        if @_blink_count < 16
          alpha = (16 - @_blink_count) * 6
        else
          alpha = (@_blink_count - 16) * 6
        end
        self.color.set(255, 255, 255, alpha)
      end
      @@_animations.clear
      #################################
    end
    def update_animation
      if @_animation_duration > 0
        frame_index = @_animation.frame_max - @_animation_duration
        cell_data = @_animation.frames[frame_index].cell_data
        position = @_animation.position
        animation_set_sprites(@_animation_sprites, cell_data, position)
        for timing in @_animation.timings
          if timing.frame == frame_index
            animation_process_timing(timing, @_animation_hit)
          end
        end
      else
        dispose_animation
      end
    end
    def update_loop_animation
      frame_index = @_loop_animation_index
      cell_data = @_loop_animation.frames[frame_index].cell_data
      position = @_loop_animation.position
      animation_set_sprites(@_loop_animation_sprites, cell_data, position)
      for timing in @_loop_animation.timings
        if timing.frame == frame_index
          animation_process_timing(timing, true)
        end
      end
    end
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites[i]
        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.ox + self.src_rect.width / 2
          sprite.y = self.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
    def animation_process_timing(timing, hit)
      if (timing.condition == 0) or
         (timing.condition == 1 and hit == true) or
         (timing.condition == 2 and hit == false)
        if timing.se.name != ""
          se = timing.se
          Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
        end
        case timing.flash_scope
        when 1
          self.flash(timing.flash_color, timing.flash_duration * 2)
        when 2
          if self.viewport != nil
            self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
          end
        when 3
          self.flash(nil, timing.flash_duration * 2)
        end
      end
    end
    def x=(x)
      sx = x - self.x
      if sx != 0
        if @_animation_sprites != nil
          for i in 0..15
            @_animation_sprites[i].x += sx
          end
        end
        if @_loop_animation_sprites != nil
          for i in 0..15
            @_loop_animation_sprites[i].x += sx
          end
        end
      end
      super
    end
    def y=(y)
      sy = y - self.y
      if sy != 0
        if @_animation_sprites != nil
          for i in 0..15
            @_animation_sprites[i].y += sy
          end
        end
        if @_loop_animation_sprites != nil
          for i in 0..15
            @_loop_animation_sprites[i].y += sy
          end
        end
      end
      super
    end
  end
end






Exemples - posté le 23/02/2010 à 10:58:34 (2021 messages postés)

❤ 0

Pff.

A quoi ça sert?
Y'aurait pas un pt'it screen?
RPG XP ou VX?
Une petite description serait la bienvenue, je pense. :hihi

Bouh.


Lufia - posté le 23/02/2010 à 11:09:26 (5792 messages postés)

❤ 0

Un Oniromancien. PVs 1, Attaque 0, Défense 0.

Ce genre de commentaire commence à me saouler. Le script est dans la section XP et y'a une description juste en dessous de son titre sur la page des scripts.

Une signature ? Pour quoi faire ?


Rockmik - posté le 23/02/2010 à 11:41:55 (12689 messages postés)

❤ 0

En ligne

exemples a dit:

A quoi ça sert?
Y'aurait pas un pt'it screen?
RPG XP ou VX?
Une petite description serait la bienvenue, je pense.


Un ban pour montrer l'exemple ? :F

Les ramens, c'est délicieux.


Navarro - posté le 23/02/2010 à 11:54:05 (57322 messages postés)

❤ 0

Vive le homebrew

Les gens sont tellement habituer qu'on leurs donne des captures d'écran, qu'on fasse leurs boulots à leurs places, qu'on fasse de l'assistanat, qu'ils ne sont plus capables de copier coller un vulgaire script pour voir si c'est compatible, et les effets de la chose !

VDM !

Signer du nez ?


Exemples - posté le 23/02/2010 à 14:38:19 (2021 messages postés)

❤ 0

Pff.

Ohlala c'est bon! J'ai le droit de savoir non? :hum
On est bani quand on demande une description plus claire?

Citation:

Les gens sont tellement habituer qu'on leurs donne des captures d'écran, qu'on fasse leurs boulots à leurs places, qu'on fasse de l'assistanat, qu'ils ne sont plus capables de copier coller un vulgaire script pour voir si c'est compatible, et les effets de la chose !

Je ne demande pas qu'on m'assiste, mais qu'on m'explique en détail à quoi sert le script.
Tout ceci sans animosité aucune, bien sur :)

Bouh.


tfkmaster - posté le 23/02/2010 à 16:04:09 (238 messages postés)

❤ 0

S.T.A.L.K.E.R for the life

Désolé mais je n'ai pas de screen et puis ca ne servirait pas à grand chose pour montrer le changement d'animation, mais cela pourrais être utile pour le changement de couleur ou de police, donc je n'en vois pas l'utilité


Exemples - posté le 23/02/2010 à 16:35:38 (2021 messages postés)

❤ 0

Pff.

Merci quand même ;)

Bouh.


Zeus81 - posté le 23/02/2010 à 17:02:40 (11071 messages postés)

❤ 0

Le truc Lufia c'est que dans la page du script on ne voit ni sa section ni sa description donc si on y accède via la page d'accueil on ne sait pas quand on est un noob.
Bon après oui c'est pas bien compliqué d'aller vérifier mais bon, ça serait pas plus mal si le log et la description étaient aussi affichés dans la page, faudrait demander à Sylvanor.


reelie - posté le 14/10/2010 à 22:41:07 (35 messages postés)

❤ 0

Marine

Ça à l'air pas mal...

Hell, it's about time !


Jakylla - posté le 30/04/2011 à 15:02:13 (45 messages postés)

❤ 0

Heureux

Mode chieur ON:

1e Essai, rien modifié, je n'ai aucun autre script ajoutés:

????? 'Aff_Degats' ? 337 ??? NoMethoderror ????????
undefinied method `visible=' for #<Array:0x49a5498>

Lignes 337 et 338

337: sprite.visible = true
338: sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)

Bienvenues à tous et bonne chance pour vos RPG !


simoncanas - posté le 10/07/2012 à 21:32:18 (84 messages postés)

❤ 0

Tu veux un glaçon ?

ah lala que de problème ce script
:hum

Choisi t'a destiné mais bas toi pour elle si tu ne veux pas la perdre a jamais

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers