Le deal à ne pas rater :
Cartes Pokémon 151 : où trouver le coffret Collection Alakazam-ex ?
Voir le deal

Aller en bas
Ðawn
Ðawn
Membre

Nombre de messages : 163
Age : 31
Localisation : dans le Sud :p
Distinction : aucune
Date d'inscription : 25/12/2007

[résolu]Petite retouche d'un script Empty [résolu]Petite retouche d'un script

Mer 25 Fév 2009 - 22:38
Bonsoir !

Je me permets de poster un nouveau topic en parallèle à mon précédent. Il s'agit ici du bestiaire qu'on peut trouver ici
http://rpgmakervx.1fr1.net/menu-f36/bestiaire-t332.htm?highlight=bestiaire

Je l'ai modifié de façon à ne faire apparaître que certains éléments à l'écran, bref il marche super bien.

Cependant je me demandais comment ajouter une zone de texte dans laquelle il pourrait y avoir une description du monstre ?
Je précise avec ce screen:

[résolu]Petite retouche d'un script Veuve10

Je pense que ce serait possible en utilisant la base de données: quand on édite un monstre, il y a une partie "commentaires", peut-être est-il possible de la faire intervenir.

Bonne soirée, bon making.

Cordialement, Dawn drunken


Dernière édition par Ðawn le Sam 28 Fév 2009 - 21:24, édité 2 fois
Ðawn
Ðawn
Membre

Nombre de messages : 163
Age : 31
Localisation : dans le Sud :p
Distinction : aucune
Date d'inscription : 25/12/2007

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Sam 28 Fév 2009 - 19:21
Bonsoir Very Happy

Je me permets ce petit 🆙 pour que ma demande ne sombre pas dans le néant des autres topics ^^

Bonne soirée.
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 33
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Sam 28 Fév 2009 - 20:59
Et voila, j'espere que ca te va !
le script

berka
Ðawn
Ðawn
Membre

Nombre de messages : 163
Age : 31
Localisation : dans le Sud :p
Distinction : aucune
Date d'inscription : 25/12/2007

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Sam 28 Fév 2009 - 21:29
Désolé Berka...je vais jouer au type chiant mais bon...
Pourrais-tu insérer tes modifications sur mon script, que je poste à la suite ?
Je t'en remercie d'avance :P
Le script: (en deux posts, limite de caractères oblige)



#==============================================================================
# ■ Bestiaire pour RPG Maker VX
#------------------------------------------------------------------------------
# Version 1.0 (15/02/2008) par Krazplay
# Dernière version, commentaires :
# http://rpgmakerxp-factory.net/forum/index.php?topic=12494
# Modifier également par Emixam2 pour l'ajuster à la résolution RmVX de base
#------------------------------------------------------------------------------
# Ce script est configuré pour fonctionner en 544x416 !
#------------------------------------------------------------------------------
# Ce script utilise les variables 4001 à 4000+Nbre de monstres dans votre base
# de données. Cela peut facilement être modifié pour utiliser d'autres variables
# que celles du jeu.
# Pour appeller ce menu il suffit d'utiliser la ligne suivante :
# $scene = Scene_Liste_Monstres.new
# Cette scene renvoie au menu lorsqu'elle se termine, si vous voulez qu'elle
# ramène sur la carte plutôt qu'au menu, ajouter l'argument false :
# $scene = Scene_Liste_Monstres.new(false)
#
# N'oubliez pas de jeter un oeil à la configuration juste en-dessous !
#------------------------------------------------------------------------------
# Vous pouvez librement redistribuer ce script, y compris des versions modifiées.
# Mais vous devez laisser la provenance (auteur/site) du script original, elle
# est précisée au début des commentaires.
#==============================================================================
module KRAZ_SLM
# Si Vrai, les monstres qui n'ont pas encore été vaincus n'apparaissent pas du
# tout dans la liste (même pas comme monstre inconnu)
MONSTRES_INCONNUS_INVISIBLES = true
# Si Vrai, les noms des monstres sont visibles même s'ils n'ont jamais été
# tués, si Faux, ils apparaitront avec le nom précisé dans NOM_MONSTRE_INCONNU
NOMS_PAR_DEFAUT = false
# Si les monstres inconnus sont visibles mais que leurs noms n'apparaissent
# pas s'ils n'ont pas encore été tué, alors c'est celui-là qui sera utilisé.
NOM_MONSTRE_INCONNU = "Monstre inconnu"
# Si vrai, on peut accéder aux détails d'un monstre même si l'on en a pas encore
# tué un.
DETAILS_PAR_DEFAUT = true
# Si la scene est appelée par le menu, il peut être sympa de remettre le curseur
# sur la commande Bestiaire lorsqu'on y retourne.
POSITION_DS_MENU = 5
# Définit quelles variables vont être utilisées.
# N'oublier pas que cela commence à DEPART_VARIABLES+1, parce que le premier
# monstre a l'ID 1 et non 0.
DEPART_VARIABLES = 4000
# Les méthodes suivantes sont les seules références aux variables où sont
# stockés le nombre d'ennemi tué de chaque sorte, donc si vous désirez ne pas
# utiliser des variables du jeu, c'est uniquement ici que ça se passe.
def self.nombre_tués(id_monstre)
return $game_variables[DEPART_VARIABLES+id_monstre]
end

def self.set_nombre_tués(id_monstre, nombre)
$game_variables[DEPART_VARIABLES+id_monstre] = nombre
end

def self.ajout_nombre_tués(id_monstre, nombre)
$game_variables[DEPART_VARIABLES+id_monstre] += nombre
end

# Ce qui suit permet de déplacer quasiment tout les textes présents dans le
# script afin que vous puissiez le customiser ou le faire fonctionner dans une
# autre résolution.
#======> Positionnement des éléments <======#
# Pour du 640x480
#-------------------------------------------#
# La fenêtre générale prend automatiquement tout l'écran
# Taille de la police
FG_TP = 24
# Description des 2 colonnes
FG_COL1 = "Nom de l'animal :"
FG_COL2 = "Vu(s) :"
# Position des descriptions [x, y, longueur, hauteur]
FG_PD1 = [10, 0, 200, 32]
FG_PD2 = [380, 0, 200, 32]
# Position du numéro du monstre selectionné [x, y, longueur, hauteur]
FG_NM = [240, 420, 300, 32]

# Fenêtre liste des monstres [x, y, longueur, hauteur]
# Attention cette fenêtre ne se voit pas, seul son contenu est visible.
FM = [0, 46, 640, 360+32]
# Nom du monstre [x, largeur max]
FM_NM = [20, 300]
# Nombre de monstres tués [x, largeur]
# Attention alignement du texte à droite et non à gauche.
FM_NMT = [480, 30]

# Fenêtre détails d'un monstre [x, y, largeur, hauteur]
FD = [0, 0, 544, 416]
# Vitesse ouverture/fermeture (255 le plus rapide)
FD_V = 24
# Position de l'image du monstre [x, y]
FD_B = [180, 200]
# Taille de la police du nom du monstre
FD_TT = 32
# Couleur du nom du monstre [Rouge, Vert, Bleu, Opacité]
FD_CT = [255, 155, 155, 255]
# Nom du monstre [x, y, longueur, hauteur]
# Attention ici le nom est centré sur x
FD_NM = [260, 0, 400, 32]
# Taille de la police du reste de la fenêtre
FD_TP = 24
# Utilise la couleur système pour la suite
FD_COLOR_SYSTEM = true
# Si vous ne désirez pas utiliser la couleur système
# [Rouge, Vert, Bleu, Opacité]
FD_CSA = [255, 155, 155, 255]
# Pour tout ce qui suit, le nom de la caractéristique et sa valeur sont écrit
# dans le même rectangle, mais la valeur est aligné à droite du rectangle.
# Position HP [x, y, longueur, hauteur]
FD_HP = [10, 30, 200, 32] # Points de vie
FD_ATK = [300, 30, 200, 32] # Attaque
FD_DEF = [300, 55, 200, 32] # Défense
FD_AGI = [10, 55, 200, 32] # Agilité
FD_EXP = [10, 310, 200, 32] # Experience
def refresh
self.contents.font.color = system_color
self.contents.draw_text(10, 15, 360, 200,"Pièces d'or")
end
#FD_GOLD = [10, 360, 200, 32] # Argent
# Mots désignants respectivement l'experience et les objets pouvant être laissé
# par l'ennemi.
FD_MEXP = "Expérience reçue"
FD_MDROP = "Objet "
# Position du mot FD_MDROP [x, y, longueur, hauteur]
FD_DROP = [10, 340, 200, 32]
# Position des objets droppé par l'ennemi [x, y, longueur, hauteur]
FD_DR1 = [85, 340, 212, 32]
FD_DR2 = [85, 360, 200, 32]

##=====> Fin positionnement des éléments pour 640x480 <=====##
end

#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# Ajoute les monstres tués aux variables lorsqu'on gagne un combat ou fuit.
#==============================================================================
class Scene_Battle
include KRAZ_SLM

alias kraz_slm_process_victory process_victory
def process_victory
compte_les_morts
kraz_slm_process_victory
end

alias kraz_slm_process_escape process_escape
def process_escape
compte_les_morts
kraz_slm_process_escape
end

def compte_les_morts
for enemy in $game_troop.members
if enemy.dead?
KRAZ_SLM.ajout_nombre_tués(enemy.enemy_id, 1)
end
end
end
end

#==============================================================================
# ■ Scene_Liste_Monstres
#------------------------------------------------------------------------------
# La scène du bestiaire, tout simplement.
#==============================================================================
class Scene_Liste_Monstres
include KRAZ_SLM

def initialize(vient_du_menu = true)
# Pour savoir si l'on retourne au menu ou sur la carte à la fin de la scene.
@vient_du_menu = vient_du_menu
# Sert à vérifier si l'index de la fenêtre monstres a changé.
# -1 pour forcer la mise à jour dès le départ
@monstres_index = -1
end

def main
@general_window = Window_General.new
@monstres_window = Window_Monstres.new
@details_monstre_window = Window_Details_Monstre.new
@general_window.set_max_monstres(@monstres_window.data.size)
@details_monstre_window.openness = 0
@details_monstre_window.active = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@general_window.dispose
@monstres_window.dispose
end

def update
# Mise à jour des fenêtre
@general_window.update
@monstres_window.update
@details_monstre_window.update
# On vérifie si le curseur a bougé
if @monstres_window.index != @monstres_index
@monstres_index = @monstres_window.index
@general_window.affiche_numero(@monstres_index+1)
end
# Bouton de confirmation
if Input.trigger?(Input::C)
if @monstres_window.active and @monstres_window.data.size > 0
id_monstre = @monstres_window.data[@monstres_window.index][2]
if KRAZ_SLM.nombre_tués(id_monstre) > 0 or DETAILS_PAR_DEFAUT
@details_monstre_window.refresh(id_monstre)
@details_monstre_window.active = true
@details_monstre_window.open
@monstres_window.active = false
Sound.play_decision
else
Sound.play_buzzer
end
end
# Bouton d'annulation
elsif Input.trigger?(Input::B)
Sound.play_cancel
if @monstres_window.active
$scene = @vient_du_menu ? Scene_Menu.new(POSITION_DS_MENU) : Scene_Map.new
Graphics.freeze
elsif @details_monstre_window.active
@details_monstre_window.active = false
@details_monstre_window.close
@monstres_window.active = true
end
end
if @details_monstre_window.active
# Passage d'un monstre à l'autre lorsqu'on regarde leurs détails
if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::DOWN)
data = @monstres_window.data
new_index = index = @monstres_window.index
data.size.times do
new_index +=1
new_index = 0 if new_index >= data.size
break if DETAILS_PAR_DEFAUT or data[new_index][1] > 0
end
if new_index != index
@details_monstre_window.refresh(data[new_index][2])
Sound.play_cursor
@monstres_window.index = new_index
end
elsif Input.repeat?(Input::LEFT) or Input.repeat?(Input::UP)
data = @monstres_window.data
new_index = index = @monstres_window.index
data.size.times do
new_index -=1
new_index = data.size-1 if new_index < 0
break if DETAILS_PAR_DEFAUT or data[new_index][1] > 0
end
@details_monstre_window.refresh(data[new_index][2]) if new_index != index
@monstres_window.index = new_index
if new_index != index
@details_monstre_window.refresh(data[new_index][2])
Sound.play_cursor
@monstres_window.index = new_index
end
end
end
end # update_command
end # class Scene_Liste_Monstres
Ðawn
Ðawn
Membre

Nombre de messages : 163
Age : 31
Localisation : dans le Sud :p
Distinction : aucune
Date d'inscription : 25/12/2007

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Sam 28 Fév 2009 - 21:29
La suite du script:


#==============================================================================
# ■ Window_General
#------------------------------------------------------------------------------
# Fenêtre général
#==============================================================================
class Window_General < Window_Base
include KRAZ_SLM

def initialize
super(0, 0, Graphics.width, Graphics.height)
@max = 0
refresh
end

def refresh
self.contents.font.size = FG_TP
self.contents.font.color = system_color
self.contents.draw_text(FG_PD1[0], FG_PD1[1], FG_PD1[2], FG_PD1[3], FG_COL1)
self.contents.draw_text(FG_PD2[0], FG_PD2[1], FG_PD2[2], FG_PD2[3], FG_COL2)
end

def affiche_numero(ind=1)
# On efface une partie de la fenêtre (RGSS2!) avant d'écrire dessus
self.contents.clear_rect(FG_NM[0], FG_NM[1], FG_NM[2], FG_NM[3])
self.contents.draw_text(FG_NM[0], FG_NM[1], FG_NM[2], FG_NM[3], "Monstre #{ind} / #{@max}")
end

def set_max_monstres(max)
@max = max
end
end

#==============================================================================
# ■ Window_Monstres
#------------------------------------------------------------------------------
# Fenêtre avec le nom de tout les ennemis tués et combien de fois ils ont été
# tués. Seul le texte de la fenêtre reste visible (l'opacité et l'opacité du
# fond est mise à zéro).
#==============================================================================
class Window_Monstres < Window_Selectable
include KRAZ_SLM

attr_reader :data

def initialize
# Création de la fenêtre, on s'assure qu'elle au-dessus de la fenêtre 'General'
super(FM[0], FM[1], FM[2], FM[3])
# On ne veut voir que le texte, donc opacité et back_opacity à 0
self.back_opacity = 0
self.opacity = 0
# Index à zéro lorsqu'on commence, une seule colonne
self.index = 0
@column_max = 1
# @data est le tableau des données qui vont être affichées.
# Ces éléments sont des tableaux [nom du monstre, nombre tué, id du monstre]
@data = []
# Remplissage de @data
for monstre in $data_enemies
next if monstre == nil
id = monstre.id
tués = KRAZ_SLM.nombre_tués(id)
if tués == 0
next if MONSTRES_INCONNUS_INVISIBLES
nom = NOMS_PAR_DEFAUT ? monstre.name : NOM_MONSTRE_INCONNU
@data.push([nom, tués, id])
else
nom = monstre.name
@data.push([nom, tués, id])
end
end
# Le nombre d'objets dans notre liste c'est évidement le nombre de monstre
# qu'on va afficher
@item_max = @data.size
# Va mettre le bitmap à la bonne taille
create_contents
refresh
end

def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end

def draw_item(index)
tab_monstre = @data[index]
if tab_monstre != nil
self.contents.draw_text( FM_NM[0], (WLH * index), FM_NM[1], WLH, tab_monstre[0])
self.contents.draw_text(FM_NMT[0], (WLH * index),FM_NMT[1], WLH, tab_monstre[1].to_s, 2)
end
end

def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = WLH
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * WLH
return rect
end

def update
super
if @column_max == 1 and self.active
if Input.repeat?(Input::RIGHT)
cursor_pagedown
end
if Input.repeat?(Input::LEFT)
cursor_pageup
end
end
end

end #class Window_Monstres

#==============================================================================
# ■ Window_details_monstre
#------------------------------------------------------------------------------
# Permet de créer une fenêtre avec les détails d'un ennemi
#==============================================================================
class Window_Details_Monstre < Window_Base
include KRAZ_SLM

def initialize
super(FD[0], FD[1], FD[2], FD[3])
self.contents = Bitmap.new(width-32, height-32)
self.back_opacity = 255
end

def update
if @opening
self.openness += FD_V
@opening = false if self.openness == 255
elsif @closing
self.openness -= FD_V
@closing = false if self.openness == 0
end
end

def refresh(monstre_id)
self.contents.clear
draw_actor_battler($data_enemies[monstre_id], FD_B[0], FD_B[1])
self.contents.font.size = FD_TT
self.contents.font.color = Color.new(FD_CT[0], FD_CT[1], FD_CT[2], FD_CT[3])
monster_name_width = contents.text_size($data_enemies[monstre_id].name).width
self.contents.draw_text(FD_NM[0]-(monster_name_width/2), FD_NM[1], FD_NM[2], FD_NM[3], $data_enemies[monstre_id].name)
self.contents.font.size = FD_TP
if FD_COLOR_SYSTEM
self.contents.font.color = system_color
else
self.contents.font.color = Color.new(FD_CSA[0], FD_CSA[1], FD_CSA[2], FD_CSA[3])
end
self.contents.draw_text(FD_HP[0], FD_HP[1], FD_HP[2], FD_HP[3], "#{Vocab.hp} :")
self.contents.draw_text(FD_ATK[0], FD_ATK[1], FD_ATK[2], FD_ATK[3], "#{Vocab.atk} :")
self.contents.draw_text(FD_DEF[0], FD_DEF[1], FD_DEF[2], FD_DEF[3], "#{Vocab.def} :")
self.contents.draw_text(FD_AGI[0], FD_AGI[1], FD_AGI[2], FD_AGI[3], "#{Vocab.agi} :")
self.contents.draw_text(FD_EXP[0], FD_EXP[1], FD_EXP[2], FD_EXP[3], FD_MEXP+" :")
#self.contents.draw_text(FD_GOLD[0], FD_GOLD[1], FD_GOLD[2], FD_GOLD[3], "Pièces d'or :")
self.contents.draw_text(FD_DROP[0], FD_DROP[1], FD_DROP[2], FD_DROP[3], FD_MDROP+" :")
self.contents.font.color = normal_color
self.contents.draw_text(FD_HP[0], FD_HP[1], FD_HP[2], FD_HP[3], $data_enemies[monstre_id].maxhp.to_s, 2)
self.contents.draw_text(FD_ATK[0], FD_ATK[1], FD_ATK[2], FD_ATK[3], $data_enemies[monstre_id].atk.to_s, 2)
self.contents.draw_text(FD_DEF[0], FD_DEF[1], FD_DEF[2], FD_DEF[3], $data_enemies[monstre_id].def.to_s, 2)
self.contents.draw_text(FD_AGI[0], FD_AGI[1], FD_AGI[2], FD_AGI[3], $data_enemies[monstre_id].agi.to_s, 2)

self.contents.draw_text(FD_EXP[0], FD_EXP[1], FD_EXP[2], FD_EXP[3], $data_enemies[monstre_id].exp.to_s, 2)
#self.contents.draw_text(FD_GOLD[0], FD_GOLD[1], FD_GOLD[2], FD_GOLD[3], $data_enemies[monstre_id].gold.to_s, 2)
# Affichage objets que peuvent donner les ennemis
if $data_enemies[monstre_id].drop_item1.kind != 0
item = $data_enemies[monstre_id].drop_item1
case item.kind
when 1
icon_index = $data_items[item.item_id].icon_index
name = $data_items[item.item_id].name
when 2
icon_index = $data_weapons[item.weapon_id].icon_index
name = $data_weapons[item.item_id].name
when 3
icon_index = $data_armors[item.armor_id].icon_index
name = $data_armors[item.item_id].name
end
opacity = self.contents.font.color == normal_color ? 255 : 128
denom = $data_enemies[monstre_id].drop_item1.denominator.to_s

draw_icon(icon_index, FD_DR1[0], FD_DR1[1]+4)
self.contents.draw_text(FD_DR1[0]+30, FD_DR1[1], FD_DR1[2], FD_DR1[3], name + " (1/#{denom})", 0)
end
if $data_enemies[monstre_id].drop_item2.kind != 0
item = $data_enemies[monstre_id].drop_item2
case item.kind
when 1
icon_index = $data_items[item.item_id].icon_index
name = $data_items[item.item_id].name
when 2
icon_index = $data_weapons[item.weapon_id].icon_index
name = $data_weapons[item.item_id].name
when 3
icon_index = $data_armors[item.armor_id].icon_index
name = $data_armors[item.item_id].name
end
opacity = self.contents.font.color == normal_color ? 255 : 128
denom = $data_enemies[monstre_id].drop_item2.denominator
draw_icon(icon_index, FD_DR2[0], FD_DR2[1]+4)
self.contents.draw_text(FD_DR2[0]+30, FD_DR2[1], FD_DR2[2], FD_DR2[3], name + " (1/#{denom})", 0)
end

end
end

#--------------------------------------------------------------------------
# ● draw_actor_battler
# Dessine le battler de l'acteur aux coordonnées x,y
# L'acteur peut aussi bien être un monstre qu'un personnage
#--------------------------------------------------------------------------
class Window_Base
def draw_actor_battler(actor, x, y)
bitmap = 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)
end
end

#==============================================================================
# ¡ Window_Status
#==============================================================================
class Window_Base
#--------------------------------------------------------------------------
def draw_enemy_element_radar_graph(enemy, x, y, radius = 56)
cx = x + radius + FONT_SIZE + 48
cy = y + radius + FONT_SIZE + 32
self.contents.font.color = system_color
#self.contents.draw_text(x, y, 134, 32, WORD_ELEMENT_GUARD)
for loop_i in 0..NUMBER_OF_ELEMENTS
if loop_i == 0

else
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
end
if loop_i == NUMBER_OF_ELEMENTS
eo = ELEMENT_ORDER[0]
else
eo = ELEMENT_ORDER[loop_i]
end
er = element_pourcent(enemy, eo)
estr = $data_system.elements[eo]
@color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
@now_x = cx + (radius * Math.cos(th)).floor
@now_y = cy - (radius * Math.sin(th)).floor
@now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
@now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
@now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_ex = cx + (er.abs*radius/100 * Math.cos(th)).floor
@now_ey = cy - (er.abs*radius/100 * Math.sin(th)).floor
if loop_i == 0
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
else

end
next if loop_i == 0
self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
self.contents.font.size = FONT_SIZE
self.contents.font.color = system_color
self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
self.contents.font.color = Color.new(255,255,255,128)
self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, er.to_s + "%", 2)
end
end

#--------------------------------------------------------------------------
# ● 属性補正値の取得
# element_id : 属性 ID
#--------------------------------------------------------------------------
def element_pourcent(enemy, element_id)
table = [0,200,150,100,50,0,-100]
return table[enemy.element_ranks[element_id]]
end
end
#==============================================================================
# ¸ ¦O�����C�u���¦
#==============================================================================
class Bitmap
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 33
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Sam 28 Fév 2009 - 21:57
c'est sur que si tu ne me donnes pas le script a modifier...

le script
Ðawn
Ðawn
Membre

Nombre de messages : 163
Age : 31
Localisation : dans le Sud :p
Distinction : aucune
Date d'inscription : 25/12/2007

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Sam 28 Fév 2009 - 22:07
c'est sur que si tu ne me donnes pas le script a modifier...

Je suis vraiment désolé Berka !
Je teste ça, et j'édite.

EDIT: Parfait, comme d'habitude :P

Vraiment, un grand merci à toi, Berka. Et encore désolé pour l'oubli.
Contenu sponsorisé

[résolu]Petite retouche d'un script Empty Re: [résolu]Petite retouche d'un script

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum