Oniromancie: Scripts - [Combat]Battle Pop-Ups


Comment ça marche?

Acsiosa
Par ThrillerProd

Aëdemphia
Par Sylvanor

Chemin de Croix
Par Mr Bambou

Darkange
Par Scythe Darklight

Evil Myst
Par oxion_garden

Geex Maker
Par roys

La Légende d'Ibabou
Par Zaitan

Les Ombres d'Ymirs
Par Lakitorai

Lije
Par Gaetz

Omega Cerberus
Par Sill Valt

Oyönna
Par Tata Monos

Sarcia
Par Kaëlar

News: OFF chez Indiegames.com / Scripts: Niveau pour équiper une arme / Scripts: Anti-"No such file" [VX Ace] / Scripts: Scroll Pictures / News: Legalize our games ! /

Chat ( connectés)

Bienvenue
visiteur !





publicité RPG Maker!

Statistiques

Liste des
membres


Contact

35 connectés actuellement

4596863 visiteurs
depuis l'ouverture

10 visiteurs
aujourd'hui

Groupe Facebook

Barre de séparation

Partenaires




TOP GAMEMAKING


Les 5 plus
visités

Guelnika - E Magination

ImagieNation

Level Up!

Alex d'Or

RPG Maker Powa

Au hasard

Faremout'Games

FrGraph-X

Make-rpg

Les deux derniers

FreankExpo

Le Palais du Making

Nos autres partenaires

Devenir
partenaire


Barre de séparation

Un site du réseau
War Paradise

Annuaires référenceurs




[Combat]Battle Pop-Ups
Script pour RPG Maker VXACE
Ecrit par Tata Monos

image

Ecrit par Jet, ce script vous permet d'afficher des pops up de dégat, de statut et autre pendant les combats.
Source : Lien


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
#=============================================================
# Battle Pop-Ups
# By Jet10985 (Jet)
#=================================================================
# This script will create and show pop-ups for multiple battle events such as
# hp/mp/tp loss and being inflicted with states.
# This script has: 25 customization options.
#=================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Actor: level_up, gain_exp
# Game_Battler: add_state
# Sprite_Battler: initialize, update, dispose, start_new_effect
#=================================================================
 
module Jet
  module BattlePopUps
    
    # This is the name of the font you want to use for pop-ups.
    POPUP_FONT = "Verdana"
    
    # The text and color shown when a character is knocked out (dies).
    KNOCKOUT_TEXT = "Knockout"
    KNOCKOUT_COLOR = Color.new(255, 167, 0)
 
    # The text and color shown when a character takes damage.
    # The actual damage is appended to the end.
    HURT_TEXT = "Damage +"
    HURT_COLOR = Color.new(255, 0, 0)
    HURT_TEXT_MP = "Mana -"
    HURT_COLOR_MP = Color.new(225, 30, 255)
    HURT_TEXT_TP = "TP -"
    HURT_COLOR_TP = Color.new(225, 30, 35)
    
    # The text and color shown when a character heals health.
    # The actual health is appended to the end.
    HEAL_TEXT = "Heal +"
    HEAL_COLOR = Color.new(0, 255, 0)
    HEAL_TEXT_MP = "Mana +"
    HEAL_COLOR_MP = Color.new(35, 200, 255)
    HEAL_TEXT_TP = "TP +"
    HEAL_COLOR_TP = Color.new(35, 35, 255)
    
    # The text and color shown when a character gains exp.
    # The actual exp is appended to the end.
    EXP_PLUS_TEXT = "EXP +"
    EXP_PLUS_COLOR = Color.new(167, 167, 0)
    
    # The text and color shown when an attack is critical.
    CRITICAL_TEXT = "Critical"
    CRITICAL_COLOR = Color.new(255, 106, 43)
    
    # The text and color shown when an attack misses.
    MISSED_TEXT = "Miss"
    MISS_COLOR = Color.new(45, 78, 99)
    
    # The text and color shown when an attack is evaded.
    EVADED_TEXT = "Evaded"
    EVADE_COLOR = Color.new(156, 187, 255)
      
    # The text, color, and animation shown when a character levels up.
    # For no animation, use 0.
    LEVEL_TEXT = "Level Up"
    LEVEL_COLOR = Color.new(167, 255, 52)
      
    # These are the colors used for displaying when a state is added.
    # It follows this format: state_id => Color.new(r, g, b)
    STATE_ADDED_COLORS = {
    
      2 => Color.new(128, 0, 255),
      3 => Color.new(128, 0, 255),
      4 => Color.new(128, 0, 255)
      
    }
    
    # This is the default state added color.
    STATE_ADDED_COLORS.default = Color.new(128, 0, 255)
    
  end
end
 
#=================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#=================================================================
 
($imported ||= {})[:jet] ||= {}
$imported[:jet][:BattlePopUps] = true
 
class Game_Actor
  
  alias jet4921_level_up level_up
  def level_up(*args, &block)
    jet4921_level_up(*args, &block)
    unless self.exp >= next_level_exp and next_level_exp > 0
      make_popup(Jet::BattlePopUps::LEVEL_TEXT, Jet::BattlePopUps::LEVEL_COLOR)
    end
  end
  
  alias jet1029_gain_exp gain_exp
  def gain_exp(exp)
    make_popup(Jet::BattlePopUps::EXP_PLUS_TEXT + exp.to_s, Jet::BattlePopUps::EXP_PLUS_COLOR)
    jet1029_gain_exp(exp)
  end
end
 
class Game_Battler
  
  alias jet8573_add_state add_state
  def add_state(sid)
    before = state?(sid)
    jet8573_add_state(sid)
    return if before == state?(sid)
    if sid == death_state_id
      make_popup(Jet::BattlePopUps::KNOCKOUT_TEXT, Jet::BattlePopUps::KNOCKOUT_COLOR)
    else
      make_popup("+#{$data_states[sid].name}", Jet::BattlePopUps::STATE_ADDED_COLORS[sid])
    end
  end
  
  def make_popup(text, color)
    return unless SceneManager.scene_is?(Scene_Battle)
    f = self.battle_sprite; return if f.nil?
    f.popups.unshift(Sprite_JetPopup.new(text.to_s, color, f)) if !f.nil?
  end
  
  def battle_sprite
    return nil unless SceneManager.scene_is?(Scene_Battle)
    SceneManager.scene.spriteset.battler_sprites.each {|a|
      return a if a.battler == self
    }
    return nil
  end
end
 
class Scene_Battle
  
  attr_reader <img src="smileys/louche.gif" alt=":s" />priteset
  
end
 
class Sprite_JetPopup < Sprite_Base
  
  def initialize(text, color, obj)
    super(nil)
    @text = text
    @color = color
    @character = obj
    self.visible = false
    @y_prog = 0
    form_self
  end
  
  def form_self
    samp = Bitmap.new(1, 1)
    self.bitmap = Bitmap.new(samp.text_size(@text).width, 24)
    self.bitmap.font.color = @color
    self.bitmap.font.name = Jet::BattlePopUps::POPUP_FONT
    self.bitmap.draw_text(0, 0, self.bitmap.width, 24, @text)
    self.x = @character.x - (self.bitmap.width / 2)
    self.x += (@character.src_rect.width / 2) if @character.battler.actor?
    self.y = @character.battler.enemy? ? @character.y : (@character.y + @character.src_rect.height)
    self.y += @character.src_rect.height if @character.battler.actor?
    samp.dispose
  end
  
  def update
    super
    self.x = @character.x - (self.bitmap.width / 2)
    if $imported[:jet][:AnimatedBattlers]
      self.x += (@character.src_rect.width / 2) if @character.battler.actor?
    end
    self.y = @character.y - 16 - @y_prog
    if $imported[:jet][:AnimatedBattlers]
      self.y += @character.src_rect.height if @character.battler.actor?
    end
    @y_prog += 1
    self.opacity -= 2.125
    if self.opacity <= 0
      self.dispose
    end
  end
end
 
class Sprite_Battler
  
  attr_accessor :popups
      
  alias jet4758_initialize initialize
  def initialize(*args, &block)
    @popups = []
    @updating_sprites = []
    @popup_wait = 0
    jet4758_initialize(*args, &block)
  end
      
  alias jet7467_update update
  def update(*args, &block)
    jet7467_update(*args, &block)
    if @popup_wait == 0
      if !@popups.empty?
        @updating_sprites.push(@popups.pop)
        @popup_wait = 30
      end
    else
      @popup_wait -= 1
    end
    @updating_sprites.each {|a|
      a.visible = true if !a.visible
      a.update
      @updating_sprites.delete(a) if a.disposed?
    }
  end
  
  alias jet5483_dispose dispose
  def dispose(*args, &block)
    (@updating_sprites + @popups).each {|a| a.dispose }
    jet5483_dispose(*args, &block)
  end
  
  alias jet3745_setup_new_effect setup_new_effect
  def setup_new_effect(*args, &block)
    jet3745_setup_new_effect(*args, &block)
    do_sprite_popups
  end
  
  def make_popup(text, color)
    @popups.unshift(Sprite_JetPopup.new(text.to_s, color, self))
  end
  
  def do_sprite_popups
    return if @battler.nil?
    if @battler_struct.nil?
      @battler_struct = Struct.new(:hp, :mp, :tp).new(0, 0, 0)
      @battler_struct.hp = @battler.hp
      @battler_struct.mp = @battler.mp
      @battler_struct.tp = @battler.tp
    end
    check_success_popup
    check_hp_popup
    check_mp_popup
    check_tp_popup
  end
  
  def check_success_popup
    if @battler.result.success
      if @battler.result.critical
        make_popup(Jet::BattlePopUps::CRITICAL_TEXT, Jet::BattlePopUps::CRITICAL_COLOR)
      elsif @battler.result.missed
        make_popup(Jet::BattlePopUps::MISSED_TEXT, Jet::BattlePopUps::MISS_COLOR)
      elsif @battler.result.evaded
        make_popup(Jet::BattlePopUps::EVADED_TEXT, Jet::BattlePopUps::EVADE_COLOR)
      end
      @battler.result.clear_hit_flags
    end
  end
  
  def check_hp_popup
    if @battler_struct.hp != @battler.hp
      f = @battler_struct.hp - @battler.hp
      if f > 0
        make_popup(Jet::BattlePopUps::HURT_TEXT + f.to_s, Jet::BattlePopUps::HURT_COLOR)
      elsif f < 0
        make_popup(Jet::BattlePopUps::HEAL_TEXT + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR)
      end
      @battler_struct.hp = @battler.hp
    end
  end
  
  def check_mp_popup
    if @battler_struct.mp != @battler.mp
      f = @battler_struct.mp - @battler.mp
      if f > 0
        make_popup(Jet::BattlePopUps::HURT_TEXT_MP + f.to_s, Jet::BattlePopUps::HURT_COLOR_MP)
      elsif f < 0
        make_popup(Jet::BattlePopUps::HEAL_TEXT_MP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_MP)
      end
      @battler_struct.mp = @battler.mp
    end
  end
  
  def check_tp_popup
    if @battler_struct.tp != @battler.tp
      f = (@battler_struct.tp - @battler.tp).round
      if f > 0
        make_popup(Jet::BattlePopUps::HURT_TEXT_TP + f.to_s, Jet::BattlePopUps::HURT_COLOR_TP)
      elsif f < 0
        make_popup(Jet::BattlePopUps::HEAL_TEXT_TP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_TP)
      end
      @battler_struct.tp = @battler.tp
    end
  end
end




aazzlaaroth - posté le 19/02/2012 à 13:55:50. (46 messages postés)

Support for S.I.D.A, pour un avenir meilleur(Propagandiste professionnel)

Ah Tata j'ai un souci :p

Ligne 139 visiblement, je me prends un "syntax error occured"

J'ai ouvert un nouveau projet pour tester le script et ce message m'empêche de réussir. Pourtant ton script à l'air pas mal, j'aimerais bien l'utiliser, quelqu'un pourrait-il m'aider? :)

Une clope, des chips au paprika, RMVXace, et normalement, c'est bon tu peux maker. Sauvez la planète, faites votre bonne action vis à vis de l'humanité ====> Soutenez le S.I.D.A !!


crackerwood - posté le 04/04/2012 à 11:18:13. (133 messages postés)

Remplace la ligne 139 par

Portion de code : Tout sélectionner

1
  attr_reader :spriteset

.
C'est un bug de la balise code

http://www.rpg-maker.fr/tutoriels-394-cms-en-event.html----http://www.rpg-maker.fr/tutoriels-363-systeme-de-phs.html----http://www.rpg-maker.fr/tutoriels-399-blackjack.html----http://www.rpg-maker.fr/tutoriels-470-phs-event-rmvx.html


aazzlaaroth - posté le 11/04/2012 à 17:17:30. (46 messages postés)

Support for S.I.D.A, pour un avenir meilleur(Propagandiste professionnel)

Oki merki ^^

Une clope, des chips au paprika, RMVXace, et normalement, c'est bon tu peux maker. Sauvez la planète, faites votre bonne action vis à vis de l'humanité ====> Soutenez le S.I.D.A !!


Chaös17 - posté le 12/04/2012 à 15:04:21. (224 messages postés)

Il n'est pas comptable avec le script suivant : http://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/

Blog of Chaos17

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

Plan du site:

Activité: Accueil | News | Forum | Flash-news | Chat | Commentaires | Galerie | Screen de la semaine | Sorties | Articles perso | Livre d'or | Recherche
Jeux: Index jeux séparés | Top Classiques | Top Originaux | Les autres | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | Autres | Jeux complets | Proposer
Rubriques: Le Wiki | Collection Oniro | Tutoriaux | Scripts | Guides | Gaming-Live | Tests | Previews | Making-of | Interviews | Articles perso | OST | L'Annuaire | Divers | Palmarès
Hébergés: Acsiosa | Aëdemphia | Chemin de Croix | Darkange | Evil Myst | Geex Maker | La Légende d'Ibabou | Les Ombres d'Ymirs | Lije | Omega Cerberus | Oyönna | Sarcia
Ressources: Jeux | Programmes | Packs de ressources | Midis | Eléments séparés | Sprites
RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes