Auteur: Siegfried
Ce script est magnifique.
Il permet d'avoir un graphique octogonal de défense élémentale et l'équipement
dans l'écran de Statut des persos.
Voilà ce que ça donne ( L'effet de cascade de l'équipement n'est pas inclus dans ce script ) :
Avant tout, il faut modifier le script Window_Status.
Remplacez-le par celui-ci.
Ce script est magnifique.
Il permet d'avoir un graphique octogonal de défense élémentale et l'équipement
dans l'écran de Statut des persos.
Voilà ce que ça donne ( L'effet de cascade de l'équipement n'est pas inclus dans ce script ) :
Avant tout, il faut modifier le script Window_Status.
Remplacez-le par celui-ci.
- Code:
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
# Auteur : Inconnu
# Equipement visible by Siegfried ( http://saleth-empire.fr-bb.com )
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 40, 112)
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
draw_actor_parameter(@actor, 96, 192, 0)
draw_actor_parameter(@actor, 96, 224, 1)
draw_actor_parameter(@actor, 96, 256, 2)
draw_actor_parameter(@actor, 96, 304, 3)
draw_actor_parameter(@actor, 96, 336, 4)
draw_actor_parameter(@actor, 96, 368, 5)
draw_actor_parameter(@actor, 96, 400, 6)
self.contents.font.color = system_color
self.contents.draw_text(320, 0, 140, 32, "Expérience : ")
self.contents.draw_text(320, 32, 160, 32, "Niveau suivant : ")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 140, 0, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 140, 32, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(320, 64, 196, 32, "Equipement : ")
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 94)
draw_item_name($data_armors[@actor.armor1_id], 325 + 16, 124)
draw_item_name($data_armors[@actor.armor2_id], 335 + 16, 154)
draw_item_name($data_armors[@actor.armor3_id], 345 + 16, 184)
draw_item_name($data_armors[@actor.armor4_id], 355 + 16, 214)
end
def dummy
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
end
end
- Code:
#==============================================================================
# Grapic_Def_Elem
#==============================================================================
class Window_Base
FONT_SIZE = 18
WORD_ELEMENT_GUARD = "Déf. Elémentale"
NUMBER_OF_ELEMENTS = 8
ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
end
#==============================================================================
# ¡ Window_Status
#==============================================================================
class Window_Status < Window_Base
alias xrxs_mp4_refresh refresh
def refresh
xrxs_mp4_refresh
draw_actor_element_radar_graph(@actor, 320, 240)
end
#--------------------------------------------------------------------------
def draw_actor_element_radar_graph(actor, 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, 104, 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 = actor.element_rate(eo)
estr = $data_system.elements[eo]
@color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
er = er.abs
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*radius/100 * Math.cos(th)).floor
@now_ey = cy - (er*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
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
Dim 5 Juil 2009 - 6:54 par TheCloud
» plate-forme v3
Mer 24 Déc 2008 - 3:08 par TheCloud
» Créations d'une rubrique Emulation
Mar 23 Déc 2008 - 5:37 par Allen Walker
» Un peu de jeux vidéo^^
Mar 23 Déc 2008 - 0:17 par Allen Walker
» "Lost Soul" Star Ocean Precipice of the dead
Dim 21 Déc 2008 - 23:28 par TheCloud
» Nouveau projet commun
Mer 17 Déc 2008 - 20:43 par TheCloud
» Problème: Comment mettre sa PS2 en ligne ?
Mar 16 Déc 2008 - 11:41 par TheCloud
» Le site officiel du MMORPG.
Ven 28 Nov 2008 - 20:46 par Elekami
» Idées ou truc fini du groupe du MMORPG.
Lun 10 Nov 2008 - 1:22 par Axel4
» Réactions du MMORPG.
Lun 10 Nov 2008 - 1:20 par Axel4