Sujet: Compétence sur les armes Dim 11 Mar 2012 - 17:53
Bonjour ou bonsoir selon l'heure,
Je cherche un script qui permettrait de donner une compétence supplémentaire au porteur d'une arme, qui enlève la compétence lorsque l'on enlève l'arme. Un exemple car je suis pas sur d'être clair : Si un de mes persos porte une épée particulière, il apprend la compétence taillade, si il enlève l'épée, il n'a plus la compétence taillade.
Je voudrais aussi qu'il ne soit pas obligatoire que toutes les armes du jeu donnent une compétence, et surtout, que le script soit simple d'utilisation et d’installation, car c'est vraiment LE truc dans le making que je comprend pas du tout en général (du coup je fais souvent en event, mais la je crois que c'est pas faisable :/ )
#=============================================================== # ● [VX] ◦ Rapport de combat V3 #-------------------------------------------------------------- # ◦ Par Blockade # ◦ http://rpg-maker-vx.bbactif.com/forum.htm # ◦ Crée le 06/04/2009 # ◦ Version 3.7 # ◦ Remerciment à Woratana, Moghunter #-------------------------------------------------------------- #=============================================================== #=============================================================== # Notes de version : #--------------------------------------------------------------- # ~ Version 1.0 : # - Création du script # ~ Version 2.0 : # - Interface revue # - Regroupement et classement des objets gagnés # - Ajouts d'options de personalisations # ~ Version 3.0 : # - Le script distibue l'argent gagné correctement. # - Module de configuration entiérement revu # - Compatibilité améliorée # - Pop-up lors d'un level up qui affiche les caractéristiques # - Affiche les sorts gagnés # ~ Version 3.5 # - Meilleur affichage des caractéristiques quand le héros gagne un niveau # - Affichage du temps de combat # ~ Version 3.6 # - Mise à la norme de mes scripts # - Compatible avec 3 systèmes de combat : Combat VX, SBS, SBS avec ATB # - Détecte automatiquement le SBS # ~ Version 3.7 # - Correction d'un bug avec le SBS avec ATB, le rapport d'affichais deux fois #=============================================================== #=============================================================== # Utilisation : # Plug & Play, inserez le au dessus de Main ! # Jettez un coup d'oeil au module de configuration ! #=============================================================== module Blockade module Config_Report #=============================================================== # Blockade::Config_Report Début du Module de configuration #=============================================================== #------------------------------------------- # >> Configuration du texte #-------------------------------------------- # > Texte contenu dans l'help_window Text_help_window = "Rapport de Combat"
# > Dans la fenêtre de drop Drop_nil = "Aucun objet trouvé." # Si pas d'objet à la fin du combat Drop_objets = "Objets trouvés :" # Si des objets sont trouvées Drop_armures = "Armures trouvées :" # Si des armures sont trouvées Drop_armes = "Armes trouvées :" # Si des armes sont trouvées
# > Dans la fenêtre de changement de niveau Texte_hp = "HP " # Texte pour les Hp Texte_mp = "MP " # Texte pour les Mp Texte_atk = "Attaque " # Texte pour l'attaque Texte_def = "Défense " # Texte pour la défense Texte_int = "Intelligence " # Texte pour l'intelligence Texte_agi = "Agilité " # Texte pour l'agilité
# > Couleur des noms de caracteristiques Couleur_nom_carac = 4
# > Dans la fenêtre des nouveaux sorts Couleur_new_skill = 4 # Couleur de Texte_new_skill Texte_new_skill = "Nouveaux sorts : " # Texte pour introduire les nouveaux sorts #-------------------------------------------
#------------------------------------------- # >> Configuration des icones #-------------------------------------------- # > Dans la fenêtre de changement de niveau Icone_hp = 99 # Id de l'icone pour les PV Icone_mp = 100 # Id de l'icone pour les PM Icone_atk = 2 # Id de l'icone pour l'attaque Icone_def = 52 # Id de l'icone pour la défense Icone_int = 21 # Id de l'icone pour l'intelligence Icone_agi = 48 # Id de l'icone pour l'agilité
# > Dans la fenêtre des sorts Icone_new_skill = 130 #-------------------------------------------
#------------------------------------------- # >> Configuration des sons #-------------------------------------------- # > Quand un héros gagne un niveau Lvl_up_sound = "Recovery" # Nom du SE Lvl_up_volume = 80 # Volume entre 50-150 Lvl_up_tempo = 100 # Tempo entre 50-150 #=============================================================== # Blockade::Config_Report Fin du Module de configuration #=============================================================== end end
$imported = {} if $imported == nil $imported["Rapport_CombatV3"] = true
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # Scene qui gère les combats #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Prend le temps au début du combat #-------------------------------------------------------------------------- alias start_battle_block start def start start_battle_block @temps = Time.now end
#-------------------------------------------------------------------------- # * Enpêche le rapport de s'afficher 2 fois (ATB fix) #-------------------------------------------------------------------------- alias judge_win_loss_block judge_win_loss unless $@ def judge_win_loss if defined?(::N02) return unless @fin_combat.nil? end judge_win_loss_block end #-------------------------------------------------------------------------- # * Processus de victoire #-------------------------------------------------------------------------- def process_victory if defined?(::N01) @status_window.visible = true @message_window.visible = false # ボスコラプスはウエイトを長く挟む for enemy in $game_troop.members break boss_wait = true if enemy.collapse_type == 3 end wait(440) if boss_wait wait(N01::WIN_WAIT) unless boss_wait # 動けないアクターを除いて勝利アクション for actor in $game_party.members unless actor.restriction >= 4 @spriteset.set_action(true, actor.index,actor.win) end end end @info_viewport.visible = false @message_window.visible = false RPG::BGM.stop $game_system.battle_end_me.play unless $BTEST $game_temp.map_bgm.play $game_temp.map_bgs.play end new_temps = Time.now temps = new_temps- @temps if temps >= 60 @temps_combat = (temps / 60).truncate @suffixe = @temps_combat > 1 ? "minutes" : "minute" else @temps_combat = temps.truncate @suffixe = "secondes" end @exp =$game_troop.exp_total @gold = $game_troop.gold_total @drop = $game_troop.make_drop_items $game_party.gain_gold(@gold) ini_variable Graphics.fadeout(30) afficher_rapport Graphics.fadein(20) end
#-------------------------------------------------------------------------- # * Initialise les variables #-------------------------------------------------------------------------- def ini_variable @fin_combat = true @actors_lvl_up = [] @num_passage= 0 end
#-------------------------------------------------------------------------- # * Afficher le rapport de combat #-------------------------------------------------------------------------- def afficher_rapport @help_window = Window_Help_Combat.new @heros_window = [] y=55 ; i=0 for actor in $game_party.members @heros_window[i] = Heros_Window.new(actor,y,@exp) @actors_lvl_up.push([actor,@heros_window[i].get_old_carac,@heros_window[i].get_new_carac,@heros_window[i].get_new_skills]) if @heros_window[i].level_up y +=74; i += 1 end @gold_exp_window = Gold_Exp_Window.new(@gold,@exp) @butin_window = Drop_Window.new(@drop) @help_window.set_text(Blockade::Config_Report::Text_help_window,Blockade::Config_Report::Alignement_texte,Blockade::Config_Report::Texte_temps_combat + "#{@temps_combat} #{@suffixe} ",Blockade::Config_Report::Alignement_texte_temps_combat) if @actors_lvl_up != [] RPG::SE.new(Blockade::Config_Report::Lvl_up_sound, Blockade::Config_Report::Lvl_up_volume, Blockade::Config_Report::Lvl_up_tempo).play @actor_window = Carac_Window.new(@actors_lvl_up[@num_passage]) new_skill = @actors_lvl_up[@num_passage] @actor_window2 = Skills_Window.new(@actors_lvl_up[@num_passage]) if @actors_lvl_up[@num_passage][3].size > 0 end end
#-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- alias update_block update unless $@ def update if @fin_combat != true update_block else # Si c'est la fin du combat @help_window.update @message_window.update for i in 0...@heros_window.size @heros_window[i].update end if @actors_lvl_up != [] @actor_window.update @actor_window2.update if @actors_lvl_up[@num_passage][3].size > 0 # if @heros_window[@num_passage].get_new_skills.size > 0 if Input.trigger?(Input::C) @num_passage += 1 @actor_window.dispose @actor_window2.visible = false if @actor_window2 != nil if @num_passage + 1 > @actors_lvl_up.size Input.update @actors_lvl_up = [] end # fin @num_passage if @actors_lvl_up != [] RPG::SE.new(Blockade::Config_Report::Lvl_up_sound, Blockade::Config_Report::Lvl_up_volume, Blockade::Config_Report::Lvl_up_tempo).play @actor_window = Carac_Window.new(@actors_lvl_up[@num_passage]) @actor_window2 = Skills_Window.new(@actors_lvl_up[@num_passage]) if @actors_lvl_up[@num_passage][3].size >0 # if @heros_window[@num_passage].get_new_skills.size > 0 end # fin @actors_lvl_up end # fin input else # si pas de lvl up end # Si on appuye sur Entrée if Input.trigger?(Input::C) and @actors_lvl_up == [] @help_window.dispose for i in 0...@heros_window.size @heros_window[i].dispose end @gold_exp_window.dispose @butin_window.dispose if $BTEST $scene = nil else Graphics.fadeout(30) battle_end(0) suppr_variables end end end end
#-------------------------------------------------------------------------- # * Reinitialise les variables #-------------------------------------------------------------------------- def suppr_variables @fin_combat = false @actors_lvl_up = [] end end
#============================================================================== # ** Window_Help_Combat #------------------------------------------------------------------------------ # This window shows skill and item explanations along with actor status. #============================================================================== class Window_Help_Combat < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 544, WLH + 32) end #-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text1, align1,text2,align2) if text1 != @text1 or align1 != @align1 or text2 != @text2 or align2 != @align2 self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, WLH, text1, align1) self.contents.draw_text(4, 0, self.width - 40, WLH, text2, align2) @text1 = text1 ; @align = align2 @text2 = text2 ; @align2 = align2 end end end
#============================================================================== # ** Skills_Window #------------------------------------------------------------------------------ # Affiche les sorts #============================================================================== class Skills_Window < Window_Base def initialize(actor_info) @new_skills = actor_info[3] super(300,58,244,230) afficher_sorts end
#-------------------------------------------------------------------------- # * Affiche les nouveaux sorts #-------------------------------------------------------------------------- def afficher_sorts self.contents.font.color = text_color(Blockade::Config_Report::Couleur_new_skill) self.contents.draw_text(25,0, 200, WLH, Blockade::Config_Report::Texte_new_skill) draw_icon(Blockade::Config_Report::Icone_new_skill,0,0) y = 25 for skills in @new_skills draw_item_name(skills,0,y) y += 25 end end end
#============================================================================== # ** Carac_Window #------------------------------------------------------------------------------ # Affiche les caractérisqtiques #============================================================================== class Carac_Window < Window_Base def initialize(actor) @actor = actor[0] @old_carac = actor[1] @new_carac = actor[2] @new_skills = actor[3] x = 100 x = 0 if @new_skills.size > 0 super(x,58,300,230) afficher_info_actor afficher_icone afficher_carac end
#-------------------------------------------------------------------------- # * Affiche le nom et le niveau du héros #-------------------------------------------------------------------------- def afficher_info_actor draw_character(@actor.character_name, @actor.character_index, 20, 40) self.contents.draw_text(40,0, 200, WLH, @actor.name) self.contents.draw_text(40,20,200,WLH,Blockade::Config_Report::Lvl + @old_carac[0].to_s + " > " + Blockade::Config_Report::Lvl + @new_carac[0].to_s) end
#-------------------------------------------------------------------------- # * Affiche les icones #-------------------------------------------------------------------------- def afficher_icone draw_icon(Blockade::Config_Report::Icone_hp,0,50) draw_icon(Blockade::Config_Report::Icone_mp ,0,75) draw_icon(Blockade::Config_Report::Icone_atk ,0,100) draw_icon(Blockade::Config_Report::Icone_def,0,125) draw_icon(Blockade::Config_Report::Icone_int,0,150) draw_icon(Blockade::Config_Report::Icone_agi,0,175) end
#-------------------------------------------------------------------------- # * Affiche les caractéristiques #-------------------------------------------------------------------------- def afficher_carac self.contents.font.color = text_color(Blockade::Config_Report::Couleur_nom_carac) self.contents.draw_text(25,50, 150, WLH, Blockade::Config_Report::Texte_hp) self.contents.draw_text(25,75, 150, WLH, Blockade::Config_Report::Texte_mp) self.contents.draw_text(25,100, 150, WLH, Blockade::Config_Report::Texte_atk) self.contents.draw_text(25,125, 150, WLH, Blockade::Config_Report::Texte_def) self.contents.draw_text(25,150, 150, WLH, Blockade::Config_Report::Texte_int) self.contents.draw_text(25,175, 150, WLH, Blockade::Config_Report::Texte_agi) self.contents.font.color = normal_color y = 50 for i in 1...@new_carac.size self.contents.draw_text(150,y, 105, WLH, @old_carac[i],0) self.contents.draw_text(150,y, 110, WLH, "> ",1) self.contents.font.color = power_up_color if @old_carac[i] < @new_carac[i] self.contents.font.color.alpha = 128 if @old_carac[i] == @new_carac[i] self.contents.draw_text(150,y, 105, WLH, @new_carac[i],2) self.contents.font.color.alpha = 255 self.contents.font.color = normal_color y +=25 end end end
#============================================================================== # ** Gold_Exp_Window #------------------------------------------------------------------------------ # Affiche l'argent et l'exp obtenus #============================================================================== class Gold_Exp_Window < Window_Base def initialize(gold,exp) super(0,350,200,65) self.contents.draw_text(0,-6,200,WLH,Blockade::Config_Report::Exp + exp.to_s) self.contents.draw_text(0,14,200,WLH,Blockade::Config_Report::Gold + gold.to_s) end end
#============================================================================== # ** Heros_Window #------------------------------------------------------------------------------ # Affiche les informations d'exp sur les héros #============================================================================== class Heros_Window < Window_Base def initialize(actor,y,exp) super(0,y,200,75) @actor = actor @exp = exp afficher_info end
#-------------------------------------------------------------------------- # * Renvoie les anciennes caractérisques #-------------------------------------------------------------------------- def get_old_carac return @old_carac end
#-------------------------------------------------------------------------- # * Renvoie les nouvelles caractérisques #-------------------------------------------------------------------------- def get_new_carac return @new_carac end
#-------------------------------------------------------------------------- # * Renvoie les nouveaux sorts #-------------------------------------------------------------------------- def get_new_skills if @new_skills.size > 0 return @new_skills else return [] end end #-------------------------------------------------------------------------- # * Determine si le heros a pris un ou plusieurs niveaux #-------------------------------------------------------------------------- def level_up return @level_up end #-------------------------------------------------------------------------- # * Couleur 1 de la barre #-------------------------------------------------------------------------- def exp_gauge_color1 return text_color(30) end
#-------------------------------------------------------------------------- # * Couleur 1 de la barre #-------------------------------------------------------------------------- def exp_gauge_color2 return text_color(31) end
#-------------------------------------------------------------------------- # * Dessine la barre d'exp #------------------------------------------------------------------------- def draw_actor_exp_meter(actor, x, y, width = 100) if actor.next_exp != 0 exp = actor.now_exp else exp = 1 end gw = width * exp / [actor.next_exp, 1].max gc1 = exp_gauge_color1 gc2 = exp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, "Exp") self.contents.font.color = normal_color xr = x + width self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2) end end
#============================================================================== # ** Drop_Window #------------------------------------------------------------------------------ # Affiche les objets obtenus #============================================================================== class Drop_Window < Window_Base def initialize(drop) super(200,55,344,360) @drop = drop if @drop != [] trier_drop regrouper afficher_drop donner_drop else afficher_mess end end
#-------------------------------------------------------------------------- # * Trie le drop en fonction du type d'objet #------------------------------------------------------------------------- def trier_drop @armes = [] @armures = [] @items = [] for item in @drop if item.is_a?(RPG::Item) @items.push(item) end if item.is_a?(RPG::Armor) @armures.push(item) end if item.is_a?(RPG::Weapon) @armes.push(item) end end end
#-------------------------------------------------------------------------- # * Regroupe les objets par nombre #------------------------------------------------------------------------- def regrouper #------------------------------------------------------- # Pour les objets #------------------------------------------------------ if @items != [] @items_unique = @items.uniq @regroupement_item = {} for item in @items_unique @regroupement_item[item] = 0 end for item in @items if @regroupement_item.include?(item) @regroupement_item[item] += 1 end end end
#------------------------------------------------------- # Pour les armures #------------------------------------------------------ if @armures != [] @armure_unique = @armures.uniq @regroupement_armures = {} for armure in @armure_unique @regroupement_armures[armure] = 0 end for armure in @armures if @regroupement_armures.include?(armure) @regroupement_armures[armure] += 1 end end end
#------------------------------------------------------- # Pour les armes #------------------------------------------------------ if @armes != [] @armes_unique = @armes.uniq @regroupement_armes = {} for arme in @armes_unique @regroupement_armes[arme] = 0 end for arme in @armes if @regroupement_armes.include?(arme) @regroupement_armes[arme] += 1 end end end end
#-------------------------------------------------------------------------- # * Affiche les objets #------------------------------------------------------------------------- def afficher_drop y=0 # Initialisation de la coordonée y #------------------------------------------------------- # Pour les objets #------------------------------------------------------ if @items != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_objets) y += 25 for item in @regroupement_item draw_icon(item[0].icon_index, 0, y) if item[1] > 1 quantite = " x" + item[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, item[0].name + quantite) y+=25 end end
y += 5 if @items.nil? == false # Si les objets on été affiché augmenter y de 5
#------------------------------------------------------- # Pour les armures #------------------------------------------------------ if @armures != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_armures) y += 25 for armure in @regroupement_armures draw_icon(armure[0].icon_index, 0, y) if armure[1] > 1 quantite = " x" + armure[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, armure[0].name + quantite) y +=25 end end
y += 5 if @armures.nil? == false # Si les armures on été affichées augmenter y de 5
#------------------------------------------------------- # Pour les armes #------------------------------------------------------ if @armes != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_armes) y += 25 for arme in @regroupement_armes draw_icon(arme[0].icon_index, 0, y) if arme[1] > 1 quantite = " x" + arme[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, arme[0].name + quantite) y +=25 end end end
#------------------------------------------------------- # Afficher un message si pas de drop #------------------------------------------------------ def afficher_mess self.contents.draw_text(0,0,360,WLH,Blockade::Config_Report::Drop_nil) end
#------------------------------------------------------- # Donne le drop à l'équipe #------------------------------------------------------ def donner_drop for item in @drop $game_party.gain_item(item, 1) end end end
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # Gére les données système sur les héros. #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Calcul de l'exp accumulée #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end
#-------------------------------------------------------------------------- # * Calcul de l'exp a avoir pour gagner un niveau #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end
(Suite au prochain message)
LittleGamer
Poulet carnivore Lv.2
Inscrit le : 03/12/2011 Messages : 28
Sujet: Re: Compétence sur les armes Dim 11 Mar 2012 - 17:54
(suite du premier message qui était trop long)
-Neo Save System
Spoiler:
Code:
#========================================================================== # â— [VX] â—¦ Neo Save System V â—¦ â–¡ #--------------------------------------------------------------------------- # â—¦ Author: Woratana [woratana@hotmail.com] # â—¦ Thaiware RPG Maker Community # â—¦ Last Updated: # â—¦ Version: 3.0 -> 5.0 # â—¦ Continued support by Helladen # â—¦ (Screen Shot credit Wortana, Andreas21, and Cybersam) #--------------------------------------------------------------------------- # â—¦ Log V: # - Screenshot support for those who want tone/weather/sprites and # unlike NSS 1.0 the screen is now centered. # - Added an option to stay in save screen after you save the game #--------------------------------------------------------------------------- # â—¦ Log IV: # - New addition for hiding map names. You can control the switch to # allow MAP_NO_NAME_LIST to work or not. # - Revised some of the settings and script organization. # - Added an option to disable the vocab::Gold text right of the number. # - Added an option to use default opacity or not. # - Swap tile compatibility support. #--------------------------------------------------------------------------- # â—¦ Log III: # - Change back to draw tile map as screenshot. Don't need any image. # - For drawing tile map, the characters won't show on the tile map. #--------------------------------------------------------------------------- # â—¦ Log II: # - Screenshot DLL is not work with Vista Aero, so I remove it # and use image for each map instead of screenshot. # - Actor's level in last version (V.1) is incorrect. #--------------------------------------------------------------------------- # â—¦ Features: # - Unlimited save slots, you can choose max save slot # - Many configuration options # - Swap tile support # - You can use image for scene's background # - Choose your save file's name, and folder to store save files # - Choose to show only information you want # - Editable text for information's title # - Draw tile map for map that player is currently on. # - Remove text you don't want from map's name (e.g. tags for special script) # - Choose map that you don't want to show the name on # - Include save confirmation window before overwrite old save #===========================================================================
module Wora_NSS Wora_NSS #========================================================================== # * START NEO SAVE SYSTEM - SETUP #-------------------------------------------------------------------------- OPACITY_DEFAULT = true # This will use the default opacity for windows # Please note that this will affect both opacitys below NSS_WINDOW_OPACITY = 255 # All windows' opacity (Lowest 0 - 255 Highest) # You can change this to 0 in case you want to use image for background NSS_IMAGE_BG = '' # Background image file name, it must be in folder Picture # use '' for no background NSS_IMAGE_BG_OPACITY = 255 # Opacity for background image
# If you use the screen shot method this does not matter SWAP_TILE = false # Make this false if you don't use the swap_tile script SWAP_TILE_SWITCH = 84 # The switch needs to be the same as your swap tile # switch, but if SWAP_TILE is false it does not matter
# If this is true it will screen shot the map, if false it will draw it SCREENSHOT_IMAGE = true # Drawing the map is good because it doesn't require # a .DLL or images for the screen shot, but it has sprites, tone, and # weather. You need to turn on swap tile if you have this as false.
IMAGE_FILETYPE = '.png' # Image type for screenshot # '.bmp', or '.jpg', or '.png'
# If this is true then the scene will not change when you save the game SCENE_CHANGE = true # Changes Scene to map if true
MAX_SAVE_SLOT = 20 # Max save slots SLOT_NAME = 'SLOT {id}' # Name of the slot (show in save slots list), use {id} for slot ID SAVE_FILE_NAME = 'Save {id}.rvdata' # Save file name, you can also change its file type from .rvdata to other
# Use {id} for save slot ID SAVE_PATH = '' # Path to store save file, e.g. 'Save/' or '' (for game folder) SAVED_SLOT_ICON = 133 # Icon Index for saved slot
EMPTY_SLOT_ICON = 141 # Icon Index for empty slot EMPTY_SLOT_TEXT = 'Vide' # Text to show for empty slot's data
DRAW_GOLD = true # Draw Gold DRAW_PLAYTIME = true # Draw Playtime DRAW_LOCATION = true # Draw location DRAW_FACE = true # Draw Actor's face DRAW_LEVEL = true # Draw Actor's level DRAW_NAME = true # Draw Actor's name DRAW_TEXT_GOLD = false # Draw the vocab::Gold text to the right of the number
MAP_NAME_TEXT_SUB = %w{} # Text that you want to remove from map name, # e.g. %w{[LN] [DA]} will remove text '[LN]' and '[DA]' from map name MAP_NO_NAME_LIST = [2] # ID of Map that will not show map name, e.g. [1,2,3] MAP_NO_NAME = '???' # What you will use to call the map in the no name list
# This is a switch that can activate or deactivate maps from being displayed as # MAP_NO_NAME. If it is off then maps will return back to normal. MAP_NO_NAME_SWITCH = 95 # This switch has to be on for MAP_NO_NAME_LIST to work
MAP_BORDER = Color.new(0,0,0,200) # Map image border color (R,G,B,Opacity) FACE_BORDER = Color.new(0,0,0,200) # Face border color
# Save confirmation window SFC_Text_Confirm = 'Confirmer' # Text to confirm to save file SFC_Text_Cancel = 'Annuler' # Text to cancel to save SFC_Window_Width = 200 # Width of Confirmation Window SFC_Window_X_Offset = 0 # Move Confirmation Window horizontally SFC_Window_Y_Offset = 0 # Move Confirmation Window vertically
#------------------------------------------------------------------------- # END NEO SAVE SYSTEM - SETUP (Edit below at your own risk) #=========================================================================
#------------------------------------------------------------- # Screenshot V2 by Andreas21 and Cybersam #------------------------------------------------------------- @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), '' @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l' @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l' module_function def self.shot(file_name) case IMAGE_FILETYPE when '.bmp'; typid = 0 when '.jpg'; typid = 1 when '.png'; typid = 2 end # Get Screenshot filename = file_name + IMAGE_FILETYPE @screen.call(0, 0, Graphics.width, Graphics.height, filename, self.handel, typid) end def self.handel game_name = "\0" * 256 @readini.call('Game','Title','',game_name,255,".\\Game.ini") game_name.delete!("\0") return @findwindow.call('RGSS Player',game_name) end
end
class Scene_File < Scene_Base include Wora_NSS attr_reader :window_slotdetail #------------------------------------------------------------------------- # * Start processing #------------------------------------------------------------------------- def start super create_menu_background if NSS_IMAGE_BG != '' @bg = Sprite.new @bg.bitmap = Cache.picture(NSS_IMAGE_BG) @bg.opacity = NSS_IMAGE_BG_OPACITY end @help_window = Window_Help.new command = [] (1..MAX_SAVE_SLOT).each do |i| command << SLOT_NAME.clone.gsub!(/\{ID\}/i) { i.to_s } end @window_slotdetail = Window_NSS_SlotDetail.new @window_slotlist = Window_SlotList.new(160, command) @window_slotlist.y = @help_window.height @window_slotlist.height = Graphics.height - @help_window.height if OPACITY_DEFAULT == false @help_window.opacity = NSS_WINDOW_OPACITY @window_slotdetail.opacity = @window_slotlist.opacity = NSS_WINDOW_OPACITY end
# Create Folder for Save file if SAVE_PATH != '' Dir.mkdir(SAVE_PATH) if !FileTest.directory?(SAVE_PATH) end if @saving @index = $game_temp.last_file_index @help_window.set_text(Vocab::SaveMessage) else @index = self.latest_file_index @help_window.set_text(Vocab::LoadMessage) (1..MAX_SAVE_SLOT).each do |i| @window_slotlist.draw_item(i-1, false) if !@window_slotdetail.file_exist?(i) end end @window_slotlist.index = @index # Draw Information @last_slot_index = @window_slotlist.index @window_slotdetail.draw_data(@last_slot_index + 1) end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super dispose_menu_background unless @bg.nil? @bg.bitmap.dispose @bg.dispose end @window_slotlist.dispose @window_slotdetail.dispose @help_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super if !@confirm_window.nil? @confirm_window.update if Input.trigger?(Input::C) if @confirm_window.index == 0 determine_savefile @confirm_window.dispose @confirm_window = nil else Sound.play_cancel @confirm_window.dispose @confirm_window = nil end elsif Input.trigger?(Input::B) Sound.play_cancel @confirm_window.dispose @confirm_window = nil end else update_menu_background @window_slotlist.update if @window_slotlist.index != @last_slot_index @last_slot_index = @window_slotlist.index @window_slotdetail.draw_data(@last_slot_index + 1) end @help_window.update update_savefile_selection end end #-------------------------------------------------------------------------- # * Update Save File Selection #-------------------------------------------------------------------------- def update_savefile_selection if Input.trigger?(Input::C) if @saving and @window_slotdetail.file_exist?(@last_slot_index + 1) Sound.play_decision text1 = SFC_Text_Confirm text2 = SFC_Text_Cancel @confirm_window = Window_Command.new(SFC_Window_Width,[text1,text2]) @confirm_window.x = ((544 - @confirm_window.width) / 2) + SFC_Window_X_Offset @confirm_window.y = ((416 - @confirm_window.height) / 2) + SFC_Window_Y_Offset else determine_savefile end elsif Input.trigger?(Input::B) Sound.play_cancel return_scene end end
#-------------------------------------------------------------------------- # * Execute Save #-------------------------------------------------------------------------- def do_save if SCREENSHOT_IMAGE File.rename(SAVE_PATH + 'temp' + IMAGE_FILETYPE, make_filename(@last_slot_index).gsub(/\..*$/){ '_ss' } + IMAGE_FILETYPE) end file = File.open(make_filename(@last_slot_index), "wb") write_save_data(file) file.close if SCENE_CHANGE $scene = Scene_Map.new else $scene = Scene_File.new(true, false, false) end end #-------------------------------------------------------------------------- # * Execute Load #-------------------------------------------------------------------------- def do_load file = File.open(make_filename(@last_slot_index), "rb") read_save_data(file) file.close $scene = Scene_Map.new RPG::BGM.fade(1500) Graphics.fadeout(60) Graphics.wait(40) @last_bgm.play @last_bgs.play end #-------------------------------------------------------------------------- # * Confirm Save File #-------------------------------------------------------------------------- def determine_savefile if @saving Sound.play_save do_save else if @window_slotdetail.file_exist?(@last_slot_index + 1) Sound.play_load do_load else Sound.play_buzzer return end end $game_temp.last_file_index = @last_slot_index end #-------------------------------------------------------------------------- # * Create Filename # file_index : save file index (0-3) #-------------------------------------------------------------------------- def make_filename(file_index) return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index + 1).to_s } end #-------------------------------------------------------------------------- # * Select File With Newest Timestamp #-------------------------------------------------------------------------- def latest_file_index latest_index = 0 latest_time = Time.at(0) (1..MAX_SAVE_SLOT).each do |i| file_name = make_filename(i - 1) next if !@window_slotdetail.file_exist?(i) file_time = File.mtime(file_name) if file_time > latest_time latest_time = file_time latest_index = i - 1 end end return latest_index end
def make_filename(file_index) return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index).to_s } end
def file_exist?(slot_id) return @exist_list[slot_id] if !@exist_list[slot_id].nil? @exist_list[slot_id] = FileTest.exist?(make_filename(slot_id)) return @exist_list[slot_id] end
def get_bitmap(path) if !@bitmap_list.include?(path) @bitmap_list[path] = Bitmap.new(path) end return @bitmap_list[path] end
def get_mapname(map_id) if @map_data.nil? @map_data = load_data("Data/MapInfos.rvdata") end if @map_name[map_id].nil? if MAP_NO_NAME_LIST.include?(map_id) and $game_switches[MAP_NO_NAME_SWITCH] @map_name[map_id] = MAP_NO_NAME else @map_name[map_id] = @map_data[map_id].name end MAP_NAME_TEXT_SUB.each_index do |i| @map_name[map_id].sub!(MAP_NAME_TEXT_SUB[i], '') @mapname = @map_name[map_id] end end return @map_name[map_id] end
if $tileA1 != nil @tilemap.bitmaps[0] = tile1 else @tilemap.bitmaps[0] = Cache.system("TileA1") end
if $tileA2 != nil @tilemap.bitmaps[1] = tile2 else @tilemap.bitmaps[1] = Cache.system("TileA2") end
if $tileA3 != nil @tilemap.bitmaps[2] = tile3 else @tilemap.bitmaps[2] = Cache.system("TileA3") end
if $tileA4 != nil @tilemap.bitmaps[3] = tile4 else @tilemap.bitmaps[3] = Cache.system("TileA4") end
if $tileA5 != nil @tilemap.bitmaps[4] = tile5 else @tilemap.bitmaps[4] = Cache.system("TileA5") end
if $tileB != nil @tilemap.bitmaps[5] = tile6 else @tilemap.bitmaps[5] = Cache.system("TileB") end
if $tileC != nil @tilemap.bitmaps[6] = tile7 else @tilemap.bitmaps[6] = Cache.system("TileC") end
if $tileD != nil @tilemap.bitmaps[7] = tile8 else @tilemap.bitmaps[7] = Cache.system("TileD") end
if $tileE != nil @tilemap.bitmaps[8] = tile9 else @tilemap.bitmaps[8] = Cache.system("TileE") end
@tilemap.map_data = map_data @tilemap.ox = ox / 8 + 99 @tilemap.oy = oy / 8 + 90 end
def dispose_tilemap unless @tilemap.nil? @tilemap.dispose @tilemap = nil end end end end
class Scene_Title < Scene_Base def check_continue file_name = Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { '*' } @continue_enabled = (Dir.glob(file_name).size > 0) end end
class Scene_Map < Scene_Base alias wora_nss_scemap_ter terminate def terminate Wora_NSS.shot(Wora_NSS::SAVE_PATH + 'temp') wora_nss_scemap_ter end end #====================================================================== # END - NEO SAVE SYSTEM by Woratana #======================================================================
# Patch de modification du NeoSaveMachin de Wortanouille # Par Sasuke (http://funkywork.blogspot.com) class Scene_File < Scene_Base #-------------------------------------------------------------------------- # * Execute Save #-------------------------------------------------------------------------- def do_save if SCREENSHOT_IMAGE File.rename(SAVE_PATH + 'temp' + IMAGE_FILETYPE, make_filename(@last_slot_index).gsub(/\..*$/){ '_ss' } + IMAGE_FILETYPE) end file = File.open(make_filename(@last_slot_index), "wb") write_save_data(file) file.close $scene = Scene_Map.new end end
Voila, J’espère que quelqu'un pourra répondre a ma requête Merci d'avance