deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Fenêtre de niveau après le combat Mer 25 Juil 2007, 17:42 | |
| Auteur: David Schooley Fonction: Permet de mettre une fenêtre où il y a le niveau, l'expérience et le gain affiché ainsi que les compétence acquises Démo: iciScreen: Ensuite, ouvrez l'éditeur de scripts (F11), au dessus de " Main" créez un nouveau script et nommez-le " Window_LevelUp" et collez le code ci-dessous: - Code:
-
#================================= #Window_LevelUp # Written by: David Schooley #=================================
class Window_LevelUp < Window_Base
#---------------------------------------------------------------- def initialize(actor, pos) @actor = actor y = (pos * 120) super(280, y, 360, 120) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.back_opacity = 255 if $d_dum == false refresh end end
#---------------------------------------------------------------- def dispose super end
#---------------------------------------------------------------- def refresh self.contents.clear draw_actor_graphic(@actor, 260, 75) draw_actor_name(@actor, 0, 0) draw_actor_level(@actor, 75, 0) self.contents.font.color = system_color self.contents.draw_text(0, 30, 80, 32, "EXP") self.contents.draw_text(0, 60, 80, 32, "NEXT") self.contents.font.color = normal_color self.contents.draw_text(84, 30, 84, 32, @actor.exp_s, 2) self.contents.draw_text(84, 60, 84, 32, @actor.next_rest_exp_s, 2) end
#---------------------------------------------------------------- def level_up self.contents.font.color = system_color self.contents.draw_text(230, 55, 80, 32, "LEVEL UP!") end
#---------------------------------------------------------------- def learn_skill(skill) self.contents.font.color = normal_color self.contents.draw_text(160, 0, 80, 32, "Learned:") self.contents.font.color = system_color self.contents.draw_text(235, 0, 90, 32, skill) end
#---------------------------------------------------------------- def draw_shadow # Draw Shadow end
#---------------------------------------------------------------- def update super end end # of Window_LevelUp Après, au dessus de " Main" faites un nouveau script et nommez-le " Window_EXP" et collez le code ci-dessous: - Code:
-
#================================= #Window_EXP # Written by: David Schooley #=================================
class Window_EXP < Window_Base
#---------------------------------------------------------------- def initialize(exp) super(0, 0, 280, 60) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.back_opacity = 255 refresh(exp) end
#---------------------------------------------------------------- def dispose super end
#---------------------------------------------------------------- def refresh(exp) self.contents.clear self.contents.font.color = system_color self.contents.draw_text(0, 0, 150, 32, "Exp Earned:") self.contents.font.color = normal_color self.contents.draw_text(180, 0, 54, 32, exp.to_s, 2) end
#---------------------------------------------------------------- def draw_shadow # Draw Shadow end
#---------------------------------------------------------------- def update super end end # of Window_EXP Puis, toujours au dessus de " Main", créez un script et appellez-le " Window_Money_Items" et collez ceci en dessous: - Code:
-
#================================= #Window_Money_Items # Written by: David Schooley #=================================
class Window_Money_Items < Window_Base
#---------------------------------------------------------------- def initialize(money, treasures) @treasures = treasures super(0, 60, 280, 420) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.back_opacity = 255 refresh(money) end
#---------------------------------------------------------------- def dispose super end
#---------------------------------------------------------------- def refresh(money) @money = money self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 4, 100, 32, "Items Found:") self.contents.font.color = normal_color y = 32 for item in @treasures draw_item_name(item, 4, y) y += 32 end cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 340, 220-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(4, 300, 220-cx-2, 32, "+ " + @money.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 340, cx + 100, 32, $data_system.words.gold, 2) end
#---------------------------------------------------------------- def draw_shadow # Draw Shadow end
#---------------------------------------------------------------- def update super end end # of Window_Money_Items | |
|
deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Re: Fenêtre de niveau après le combat Mer 25 Juil 2007, 17:44 | |
| Et pour finir, faites au dessus de " Main" un script et nommez-le " Scene_Battle D" et collez ce script: - Code:
-
#============================================================================== # Scene_Battle D # Written by: David Schooley #==============================================================================
class Scene_Battle def display_lv_up(exp, gold, treasures) $d_dum = false d_extra = 0 i = 0 for actor in $game_party.actors # Fill up the Lv up windows @lvup_window[i] = Window_LevelUp.new($game_party.actors[i], i) i += 1 end
# Make Dummies if @show_dummies == true $d_dum = true for m in i..3 @lvup_window[m] = Window_LevelUp.new(m, m) end end @exp_window = Window_EXP.new(exp) @m_i_window = Window_Money_Items.new(gold, treasures) @press_enter = nil gainedexp = exp @level_up = [0, 0, 0, 0] @d_new_skill = ["", "", "", ""] @d_breakout = false @m_i_window.refresh(gold) wait_for_OK
@d_remember = $game_system.bgs_memorize Audio.bgs_play("Audio/SE/032-Switch01.ogg", 100, 300) # NEW - David for n in 0..gainedexp - 1 exp -= 1 if @d_breakout == false Input.update end for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false last_level = actor.level actor.exp += 1
# Fill up the Lv up windows if @d_breakout == false @lvup_window[i].refresh @exp_window.refresh(exp) end if actor.level > last_level @level_up[i] = 10 Audio.se_play("Audio/SE/056-Right02.ogg", 70, 150) if $d_new_skill @d_new_skill[i] = $d_new_skill end end if @level_up[i] == 0 @d_new_skill[i] = "" end if @level_up[i] > 0 @lvup_window[i].level_up if @d_new_skill[i] != "" @lvup_window[i].learn_skill(@d_new_skill[i]) end end if Input.trigger?(Input::C) @d_breakout = true end end
if @d_breakout == false if @level_up[i] >0 @level_up[i] -= 1 end Graphics.update end end if @d_breakout == true for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false actor.exp += exp end end exp = 0 break end end
Audio.bgs_stop @d_remember = $game_system.bgs_restore
for i in 0...$game_party.actors.size @lvup_window[i].refresh end @exp_window.refresh(exp)
Audio.se_play("Audio/SE/006-System06.ogg", 70, 150) $game_party.gain_gold(gold) @m_i_window.refresh(0) Graphics.update
end
def trash_lv_up # NEW - David i=0 for i in 0 ... 4 @lvup_window[i].visible = false end @exp_window.visible = false @m_i_window.visible = false @lvup_window = nil @exp_window = nil @m_i_window = nil
end
# Wait until OK key is pressed def wait_for_OK loop do Input.update Graphics.update if Input.trigger?(Input::C) break end end end
end | |
|