Invité
| Sujet: Script XP => vx Dim 31 Aoû 2008 - 15:31 | |
| Hell0w Voici ma requête: Voici un script pour xp => permet de voir les caractéristique en fin de combat - Code:
-
class Scene_Battle def main $game_temp.in_battle = true $game_temp.battle_turn = 0 $game_temp.battle_event_flags.clear $game_temp.battle_abort = false $game_temp.battle_main_phase = false $game_temp.battleback_name = $game_map.battleback_name $game_temp.forcing_battler = nil $game_system.battle_interpreter.setup(nil, 0) @troop_id = $game_temp.battle_troop_id $game_troop.setup(@troop_id) 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]) @actor_command_window.y = 160 @actor_command_window.back_opacity = 160 @actor_command_window.active = false @actor_command_window.visible = false @party_command_window = Window_PartyCommand.new @help_window = Window_Help.new @help_window.back_opacity = 160 @help_window.visible = false @status_window = Window_BattleStatus.new @message_window = Window_Message.new @spriteset = Spriteset_Battle.new @wait_count = 0 if $data_system.battle_transition == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition) end start_phase1 loop do Graphics.update Input.update update if $scene != self break end end $game_map.refresh Graphics.freeze @actor_command_window.dispose @party_command_window.dispose @help_window.dispose @status_window.dispose @message_window.dispose if @skill_window != nil @skill_window.dispose end if @item_window != nil @item_window.dispose end if @result_window != nil @result_window.dispose end @spriteset.dispose ### Début de l'ajout par Krazplay pour sa nouvelle fenêtre d'exp ### if @levelup != nil #Correction du bug de fuite @fond = Window_Base.new(0,0,640,480) coordx = [5,320, 5,320] coordy = [12, 12, 248, 248] @window = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] @window[i] = Window_Result.new(coordx[i], coordy[i]) @window[i].refresh(actor,0) if @levelup[i] != nil #correction d'un bug, n'oubliez pas le end plus bas if @levelup[i] > 0 @window[i].refresh(actor, @levelup[i]) @window[i].showlvlup(actor) end end #voila le end qui va avec la correction end if $data_system.battle_transition == "" Graphics.transition(20) else Graphics.transition(20, "Graphics/Transitions/" + $data_system.battle_transition) end loop do Graphics.update Input.update if Input.trigger?(Input::C) break end end for i in 0...$game_party.actors.size @window[i].dispose end @fond.dispose end # end de la correction du bug de fuite ### Fin de l'ajout par Krazplay pour sa nouvelle fenêtre d'exp ### if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end if $BTEST and not $scene.is_a?(Scene_Gameover) $scene = nil end end
def start_phase5 @phase = 5 $game_system.me_play($game_system.battle_end_me) $game_system.bgm_play($game_temp.map_bgm) exp = 0 gold = 0 treasures = [] for enemy in $game_troop.enemies unless enemy.hidden exp += enemy.exp gold += enemy.gold if rand(100) < enemy.treasure_prob if enemy.item_id > 0 treasures.push($data_items[enemy.item_id]) end if enemy.weapon_id > 0 treasures.push($data_weapons[enemy.weapon_id]) end if enemy.armor_id > 0 treasures.push($data_armors[enemy.armor_id]) end end end end treasures = treasures[0..5] @levelup = [] # Cette ligne-là est à ajouter si vous ne voullez pas copier # tout le scrîpt 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 += exp @levelup[i] = actor.level - last_level # Cette ligne-là aussi # if actor.level > last_level @status_window.level_up(i) end end end $game_party.gain_gold(gold) for item in treasures case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end end @result_window = Window_BattleResult.new(exp, gold, treasures) @phase5_wait_count = 100 end
end #============================================================================== # ■ Nouvelle fenêtre d'exp v1.01 par Krazplay Partie 2 #------------------------------------------------------------------------------ # Créer un nouveau scrîpt au-dessus de main et copier celui-là dedans. # Tout ce qui est sous la définition refresh est ce qui apparait tout le temps # Tout ce qui est sous la définition showlvlup est ce qui n'apparait qu'en # cas de level up #==============================================================================
class Window_Result < Window_Base def initialize(x,y) super(x, y, 315, 220) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.back_opacity = 255 end
def refresh(actor,levelenmoins) self.contents.clear self.contents.font.color = Color.new(255, 50, 50, 255) self.contents.font.size = 24 draw_actor_battler(actor,50,90,30) draw_actor_battler(actor,110,90,60) draw_actor_battler(actor,170,90,90) if levelenmoins == 0 draw_actor_battler(actor,230,90,250) end largeur_nom = contents.text_size(actor.name).width self.contents.draw_text(width/2 - largeur_nom/2 -16, 0, 99, 24, actor.name) self.contents.font.color = Color.new(100, 255, 100, 255) self.contents.font.size = 19 self.contents.draw_text(0,25, 99, 24, "Level") self.contents.font.color = normal_color self.contents.draw_text(10, 45, 99, 24, "HP") self.contents.draw_text(10, 63, 99, 24, "MP") self.contents.font.size = 18 self.contents.draw_text(0, 83, 99, 24, "Force") self.contents.draw_text(0, 103, 99, 24, "Dexterité") self.contents.draw_text(0, 123, 99, 24, "Agilité") self.contents.draw_text(0, 143, 99, 24, "Intelligence") self.contents.font.color = Color.new(125, 255, 125, 255) self.contents.draw_text(60, 170, 99, 24, "NEXT") @levelenmoins = levelenmoins @lvl = actor.level-levelenmoins self.contents.font.color = normal_color self.contents.draw_text(80, 25, 30, 24, @lvl.to_s,2) self.contents.draw_text(60, 45, 50, 24, $data_actors[actor.id].parameters[0, @lvl].to_s,2) self.contents.draw_text(60, 63, 50, 24, $data_actors[actor.id].parameters[1, @lvl].to_s,2) self.contents.draw_text(80, 83, 30, 24, $data_actors[actor.id].parameters[2, @lvl].to_s,2) self.contents.draw_text(80, 103, 30, 24, $data_actors[actor.id].parameters[3, @lvl].to_s,2) self.contents.draw_text(80, 123, 30, 24, $data_actors[actor.id].parameters[4, @lvl].to_s,2) self.contents.draw_text(80, 143, 30, 24, $data_actors[actor.id].parameters[5, @lvl].to_s,2) self.contents.draw_text(140, 170, 70, 24, actor.next_rest_exp_s.to_s,1) end
def showlvlup(actor) hpgagne = $data_actors[actor.id].parameters[0, actor.level] - $data_actors[actor.id].parameters[0, @lvl] mpgagne = $data_actors[actor.id].parameters[1, actor.level] - $data_actors[actor.id].parameters[1, @lvl] forcegagne = $data_actors[actor.id].parameters[2, actor.level] - $data_actors[actor.id].parameters[2, @lvl] dexgagne = $data_actors[actor.id].parameters[3, actor.level] - $data_actors[actor.id].parameters[3, @lvl] agigagne = $data_actors[actor.id].parameters[4, actor.level] - $data_actors[actor.id].parameters[4, @lvl] intgagne = $data_actors[actor.id].parameters[5, actor.level] - $data_actors[actor.id].parameters[5, @lvl] self.contents.font.color = Color.new(100, 255, 100, 255) self.contents.font.size = 19 self.contents.draw_text(50, 25, 99, 24, "UP !") self.contents.font.color = Color.new(20, 255, 20, 255) self.contents.font.size = 18 self.contents.draw_text(210, 25, 99, 24, actor.level.to_s) self.contents.draw_text(190, 45, 40, 24, $data_actors[actor.id].parameters[0, actor.level].to_s,2) self.contents.draw_text(190, 63, 40, 24, $data_actors[actor.id].parameters[1, actor.level].to_s,2) self.contents.draw_text(200, 83, 30, 24, $data_actors[actor.id].parameters[2, actor.level].to_s,2) self.contents.draw_text(200, 103, 30, 24, $data_actors[actor.id].parameters[3, actor.level].to_s,2) self.contents.draw_text(200, 123, 30, 24, $data_actors[actor.id].parameters[4, actor.level].to_s,2) self.contents.draw_text(200, 143, 30, 24, $data_actors[actor.id].parameters[5, actor.level].to_s,2) self.contents.font.color = Color.new(100, 255, 255, 255) self.contents.draw_text(140, 25, 20, 24, @levelenmoins.to_s,2) self.contents.draw_text(130, 45, 40, 24, hpgagne.to_s,2) self.contents.draw_text(130, 63, 40, 24, mpgagne.to_s,2) self.contents.draw_text(140, 83, 30, 24, forcegagne.to_s,2) self.contents.draw_text(140, 103, 30, 24, dexgagne.to_s,2) self.contents.draw_text(140, 123, 30, 24, agigagne.to_s,2) self.contents.draw_text(140, 143, 30, 24, intgagne.to_s,2) self.contents.font.color = Color.new(255, 100, 100, 255) h = [25,45,63,83,103,123,143] for i in 0...7 self.contents.draw_text(120, h[i], 20, 24, "+") end for i in 0...7 self.contents.draw_text(180, h[i], 20, 24, "=") end end
def draw_actor_battler(actor, x, y, transparence=255) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch / 2, bitmap, src_rect, transparence) end end Il faudrait le convertir pour vx Merci d'avance pour vos réponses |
|