fantasy island


 
AccueilPortailFAQRechercherS'enregistrerMembresGroupesConnexion

Partagez | 
 

 script menu

Aller en bas 
AuteurMessage
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: script menu   Lun 2 Oct - 4:28

voila quelque menu asé bien ^-^ .



#Combo CMS by Xk8=============================================================#
#This is CMS is a combination between my second CMS and Zieg's Ring Menu Edit=#
#Credit to the ring coding will then go to Zieg===============================#
#I didn't do much in this CMS (item screens etc are uncustomized)=============#
#made this cms in under 60 minutes============================================#
#=============================================================================#
#other credits: Darkzero2840, Squall, Unknown Japanese Dude===================#
#Traduction par masterjojo :
#Ce script est une combinaison entre mon second CMS et le RingMenu de Zieg==#
#Remerciement à Zieg pour sa programation du RingMenu==================#
#CMS fait en moins de 60mn=========================================#
#==============================================================#
# Remerciement à Darkzero2840, Squall, Unknown Japanese Dude===========#
#===============================================================#
#www.neorpg.net
#
#www.neorpg.net/forum
#=============================================================================#
class Dummy_Window < Window_Base
def initialize
super(0, 0, 640, 64)
end
end

class Xtime < Window_Base

def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 14
self.contents.draw_text(4, -4, 120, 32, "Real Time")

@time_string = Time.now

text = @time_string.strftime("%A %H:%M:%S")
self.contents.font.size = 16
self.contents.font.color = normal_color
self.contents.draw_text(4, 10, 120, 32, text, 2)
end
def update
super
refresh
end
end

class Xlocation < Window_Base

def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.clear
self.contents.font.color = system_color
self.contents.font.color = normal_color
$maps = load_data("Data/MapInfos.rxdata")
@map_id = $game_map.map_id
@currmap = $maps[@map_id].name
self.contents.font.size = 16
self.contents.draw_text(4, 0, 64, 32, @currmap)
end
end

class Window_PlayTimePlus < Window_Base

def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 18
refresh
end

def refresh
self.contents.clear
self.contents.font.size = 14
self.contents.font.color = system_color
self.contents.draw_text(4, -4, 120, 32, "Temps de jeu")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.size = 18
self.contents.font.color = normal_color
self.contents.draw_text(4, 10, 120, 32, text, 2)
end

def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end


class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

class Window_BasePlus < Window_Base

alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end

plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)

if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end

gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_hp_original(actor, x, y, width)
end

alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)

if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end

plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)

if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end

gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_sp_original(actor, x, y, width)
end

alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)

if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end

plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0

color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)

if actor.next_exp != 0
exp = (width + plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width + plus_width) * rate_width / 100
end

gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_exp_original(actor, x, y)
end

def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width - width) / 2
when 2
x += rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end

self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end

self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end

self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end


Dernière édition par le Lun 2 Oct - 5:06, édité 2 fois
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: Re: script menu   Lun 2 Oct - 5:07

class Bitmap

def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end

elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end

elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end

bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)

if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end

sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else

sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end

sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end

class StatusSelectPlus < Window_BasePlus
attr_reader :index
attr_reader :help_window

def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end

def index=(index)
@index = index

if self.active and @help_window != nil
update_help
end
update_cursor_rect
end

def row_max
return (@item_max + @column_max - 1) / @column_max
end

def top_row

return self.oy / 32
end

def top_row=(row)

if row < 0
row = 0
end

if row > row_max - 1
row = row_max - 1
end

self.oy = row * 32
end

def page_row_max

return (self.height - 32) / 32
end
#www.neorpg.net
def page_item_max

return page_row_max * @column_max
end

def help_window=(help_window)
@help_window = help_window

if self.active and @help_window != nil
update_help
end
end

def update_cursor_rect

if @index < 0
self.cursor_rect.empty
return
end

row = @index / @column_max

if row < self.top_row
self.top_row = row
end

if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end

cursor_width = 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end

def update
super

if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end

if Input.repeat?(Input::UP)

if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end

if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end

if Input.repeat?(Input::LEFT)

if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end

if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end

if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end

if self.active and @help_window != nil
update_help
end

update_cursor_rect
end
end

class MenuStatusPlus < StatusSelectPlus

def initialize
super(0, 0, 450, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end

def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 90
actor = $game_party.actors[i]
draw_actor_face(actor, x + 200, y + 79)
draw_actor_graphic(actor, x - 50, y + 80)
self.contents.font.size = 18
draw_actor_name(actor, x - 60, y + 4)
self.contents.font.color = system_color
self.contents.draw_text(x - 5, y + 2, 120, 32, '-')
self.contents.font.color = normal_color
draw_actor_class(actor, x + 75, y + 4)
draw_actor_level(actor, x + 5, y + 4)
draw_actor_state(actor, x + 135, y + 4)
draw_actor_exp(actor, x - 35, y + 54)
draw_actor_hp(actor, x - 35, y + 32)
draw_actor_sp(actor, x + 115, y + 32)
end
end
#www.neorpg.net
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(1, @index * 90 + 33, 26, 48)
end
end

def draw_actor_face(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = 90
src_rect = Rect.new(3, -1, fw, fh)
opacity = 180
self.contents.blt(x - fw / 23, y - fh, face, src_rect, opacity)
end
end

class Window_RingMenu < Window_Base

STARTUP_FRAMES = 20
MOVING_FRAMES = 5
RING_R = 64

ICON_ITEM = RPG::Cache.icon('034-Item03')
ICON_SKILL = RPG::Cache.icon('045-Skill02')
ICON_EQUIP = RPG::Cache.icon('013-Body01')
ICON_STATUS = RPG::Cache.icon("049-Skill06")
ICON_SAVE = RPG::Cache.icon('038-Item07')
ICON_LOAD = RPG::Cache.icon('038-Item07')
ICON_EXIT = RPG::Cache.icon('048-Skill05')
ICON_DISABLE= RPG::Cache.icon("")

MODE_START = 1
MODE_WAIT = 2
MODE_MOVER = 3
MODE_MOVEL = 4

attr_accessor :index

def initialize( center_x, center_y )
super(0, 0, 640, 416)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"

s1 = "Inventaire"
s2 = "Compétences"
s3 = "Equipement"
s4 = "Status"
s5 = "Savegarde"
s6 = "Chargement"
s7 = "Quitter"

@commands = [ s1, s2, s3, s4, s5, s6, s7 ]
@item_max = 7
@index = 0
@items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_LOAD, ICON_EXIT ]
@disabled = [ false, false, false, false, false, false, false ]
@cx = 64
@cy = 170

setup_move_start
refresh
end

def update
super
refresh
end

def refresh

self.contents.clear

case @mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end

rect = Rect.new(@cx - 272, @cy - 5, self.contents.width-32, 32) #+24
self.contents.draw_text(rect, @commands[@index],1)
end

def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end

def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
draw_item(x, y, i)
end
end

def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1 if mode != 0
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d ) ).to_i
y = @cy - ( RING_R * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end

def draw_item(x, y, i)
rect = Rect.new(0, 0, @items[i].width, @items[i].height)
if @index == i
self.contents.blt( x, y, @items[i], rect )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items[i], rect, 128 )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
end
end
end

def disable_item(index)
@disabled[index] = true
end

def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
end

def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1 if @index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0 if @index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end

def animation?
return @mode != MODE_WAIT
end
end

class Scene_Menu

def initialize(menu_index = 0)
@menu_index = menu_index
end

def main
@spriteset = Spriteset_Map.new
px = $game_player.screen_x - 15
py = $game_player.screen_y - 24

@dummy = Dummy_Window.new
@dummy.x = 0
@dummy.y = 415
@dummy.back_opacity = 200

@gold = Window_Gold.new
@gold.x = 0
@gold.y = 480
@gold.z = 9999
@gold.opacity = 0

@playtime = Window_PlayTimePlus.new
@playtime.x = 160
@playtime.y = 480
@playtime.z = 9999
@playtime.opacity = 0

@playtimex = Xtime.new
@playtimex.x = 320
@playtimex.y = 480
@playtimex.z = 9999
@playtimex.opacity = 0

@location = Xlocation.new
@location.x = 480
@location.y = 480
@location.z = 9999
@location.opacity = 0

@command_window = Window_RingMenu.new(px,py)
@command_window.index = @menu_index
@command_window.back_opacity = 200

if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.z = 100
if $game_system.save_disabled
@command_window.disable_item(4)
end

@status_window = MenuStatusPlus.new
@status_window.x = 640
@status_window.y = 10
@status_window.z = 9999
@status_window.opacity = 0

@status_window.visible = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end

Graphics.freeze
@gold.dispose
@command_window.dispose
@status_window.dispose
@playtime.dispose
@playtimex.dispose
@location.dispose
@dummy.dispose
@spriteset.dispose
end

def update

@dummy.update
@location.update
if @location.y > 425
@location.y -= 25
end
@playtimex.update
if @playtimex.y > 425
@playtimex.y -= 25
end
@playtime.update
if @playtime.y > 425
@playtime.y -= 25
end
@command_window.update
@gold.update
if @gold.y > 425
@gold.y -= 25
end
@status_window.update
if @status_window.x > 210
@status_window.x -= 21
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: Re: script menu   Lun 2 Oct - 5:08

def update_command

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_system.save_disabled = true
$scene = Scene_Map.new
return
end

if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end

case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load2.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end

return if @command_window.animation?
if Input.press?(Input::UP) or Input.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
return
end

if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
return
end
end

def update_status

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end

if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end



2/ Créez un nouveau script au dessus de "main", nommez le "Menu_Combo" et collez le script ci-dessous :



class Scene_Load2 < Scene_File

def initialize
$game_temp = Game_Temp.new
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Quel fichier voulez-vous charger? www.neorpg.net")
end

def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end

$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Map.new
end

def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
end

def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)

if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end

$game_party.refresh
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: Re: script menu   Lun 2 Oct - 5:10

voici un autre menu .



faites un nouveau script "menu" au dessus de "main" et coller :



#============================================================
# Custom Menu System
# created by: Constance
# created on: Dec. 26, 2005
# version: 2.1
# credits: Acedent Prone, Diego, Dubealex
# special thanks credits goes to: SephirothSpawn, couldn't have done it without you
# RMXP - Underground - The Underground Gaming Zone
#============================================================
class Window_Base < Window

def draw_actor_level(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x + 4, y + 20, 24, 32, actor.level.to_s, 2)
end

def draw_actor_battler(actor, x, y)
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, bitmap, src_rect)
end

def draw_sprite(x, y, name, hue, pose, frame)
bitmap = RPG::Cache.character(name, hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
case pose
when 0;a = 0
when 1;a = ch
when 2;a = ch * 3
when 3;a = ch * 2
end

case frame
when 0;b = 0
when 1;b = cw
when 2;b = cw * 2
when 3;b = cw * 3
end
src_rect = Rect.new(b, a, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end

def draw_actor_hp(actor, x, y, width = 144)
self.contents.font.name = "Tahoma"
self.contents.font.size = 20
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x + 30, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 30 + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 30 + 60, y, 48, 32, actor.maxhp.to_s)
end
end
#============================================
def draw_actor_sp(actor, x, y, width = 144)
self.contents.font.name = "Tahoma"
self.contents.font.size = 20
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
self.contents.font.color = Color.new(74, 230, 51, 225)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x + 30, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 30 + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 30 + 60, y, 48, 32, actor.maxsp.to_s)
end
end

def draw_actor_level3(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end

def draw_actor_hp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end

def draw_actor_sp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end

def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 144, 32, actor.name)
end

def draw_actor_parameter2(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = "Magic Defense"
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
end
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end

def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
if type == "horizontal"
width = length
height = thick
self.contents.fill_rect(x-1, y - 1, width + 1, height + 3, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y, width + 1, height + 1, Color.new(0, 0, 0, 255))
w = width * e1.to_f / e2.to_f
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
end
end

class Window_Selectable2 < Window_Base

attr_reader :index
attr_reader :help_window

def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end

def index=(index)
@index = index
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end

def row_max
return (@item_max + @column_max - 1) / @column_max
end

def top_row
return self.oy / 32
end

def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end

def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end

def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end

if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, 65, 32)
end

def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::UP)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end

if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end

if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end

class Window_Command2 < Window_Selectable2

attr_accessor :commands

def initialize(commands)
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@width = width
@item_max = 6
@column_max = 3
@commands = commands
self.index = 0
end
end

class Dummy_Window_Command < Window_Base

def initialize
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
end

def refresh
self.contents.clear
self.contents.draw_text(-35, 0, 124, 32, $data_system.words.item, 1)
self.contents.draw_text(50, 0, 124, 32, $data_system.words.skill, 1)
self.contents.draw_text(145, 0, 124, 32, $data_system.words.equip, 1)
self.contents.draw_text(-35, 35, 124, 32, "Load", 1)
self.contents.draw_text(50, 35, 124, 32, "Save", 1)
self.contents.draw_text(140, 35, 124, 32, "Exit", 1)
end
end


class Dummy_Window_Command2 < Window_Base

def initialize
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
end

def refresh
self.contents.clear
bitmap = RPG::Cache.icon("034-Item03")
self.contents.blt(35, 4, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("050-Skill07")
self.contents.blt(115, 4, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("013-Body01")
self.contents.blt(205, 4, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("033-Item02")
self.contents.blt(35, 39, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("037-Item06")
self.contents.blt(115, 39, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("039-Item08")
self.contents.blt(205, 39, bitmap, Rect.new(0, 0, 24, 24))
end
end

class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: Re: script menu   Lun 2 Oct - 5:11

class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end

end

class Game_Map

def name
$map_infos[@map_id]
end

end

class Window_PlayTime < Window_Base

def initialize
super(0, 0, 150, 101)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(4, 0, 120, 32, "Playtime:")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(-15, 32, 120, 32, text, 2)
end

def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end

class Window_Location < Window_Base
def initialize
super(0, 0, 220,101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
end

def refresh
bitmap = RPG::Cache.icon("032-Item01")
self.contents.blt(165, y + 40, bitmap, Rect.new(0, 0, 24, 24))
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.font.size = 20
self.contents.draw_text(44, 40, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(164-cx, 40, cx, 32, $data_system.words.gold, 2)
lx = contents.text_size("Location:").width
self.contents.draw_text(4, -55, lx, 144, "Location:", 1)
self.contents.font.color = normal_color
self.contents.font.size = 20
self.contents.draw_text(10 + lx, 1, lx + 40, 32, $game_map.name.to_s, 1)
end

end

class Window_GraphicCharacter1 < Window_Base
def initialize
super(0, 0, 200,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
@pose, @frame = 0, 0
refresh
end

def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_sprite(25, 55, actor.character_name, actor.character_hue , @pose, @frame)
end

def frame_update
@frame == 3 ? @frame = 0 : @frame += 1
refresh
end

def update_pose(direction)
if direction == 0
@pose == 0 ? @pose = 3 : @pose -= 1
else
@pose == 3 ? @pose = 0 : @pose += 1
end
refresh
end
end

class Window_GraphicCharacter2 < Window_Base
def initialize
super(0, 0, 200,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
@pose, @frame = 0, 0
refresh
end

def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.draw_text(25, 55, 50, 28, "Empty")
else
actor = $game_party.actors[1]
draw_sprite(25, 55, actor.character_name, actor.character_hue , @pose, @frame)
end
end

def frame_update
@frame == 3 ? @frame = 0 : @frame += 1
refresh
end

def update_pose(direction)
if direction == 0
@pose == 0 ? @pose = 3 : @pose -= 1
else
@pose == 3 ? @pose = 0 : @pose += 1
end
refresh
end
end

class Window_Character1 < Window_Base

def initialize
super(0, 0, 200,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
@pose, @frame = 0, 0
refresh
end

def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_actor_hp(actor, x + 4, y + 55, 144)
draw_actor_barz(actor, x + 4, y + 81, "horizontal", 160, 4, actor.hp, actor.maxhp, Color.new(102, --200, 160, 0), Color.new(0, 0, 0, 0))
draw_actor_sp(actor, x + 4, y + 110, 144)
draw_actor_barz(actor, x + 4, y + 136, "horizontal", 160, 4, actor.sp, actor.maxsp, Color.new(0, 0, 0, 0), Color.new(-102, 160, -200, 0))
self.contents.font.size = 20
self.contents.draw_text(x + 50, y - 55, 144, 144, "Class:")
draw_actor_class(actor, x + 100, y + 1)
self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________")
self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:")
draw_actor_level(actor, x + 95, y + 6)
end

end

class Window_Character2 < Window_Base

def initialize
super(0, 0, 200,200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
end

def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.draw_text(25, 55, 50, 28, "Empty")
else
actor = $game_party.actors[1]
draw_actor_hp(actor, x + 4, y + 55, 144)
draw_actor_barz(actor, x + 4, y + 81, "horizontal", 160, 4, actor.hp, actor.maxhp, Color.new(102, --200, 160, 0), Color.new(0, 0, 0, 0))
draw_actor_sp(actor, x + 4, y + 110, 144)
draw_actor_barz(actor, x + 4, y + 136, "horizontal", 160, 4, actor.sp, actor.maxsp, Color.new(0, 0, 0, 0), Color.new(-102, 160, -200, 0))
self.contents.font.size = 20
self.contents.draw_text(x + 50, y - 55, 144, 144, "Class:")
draw_actor_class(actor, x + 100, y + 1)
self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________")
self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:")
draw_actor_level(actor, x + 95, y + 6)
end
end

end

class Window_Character_Selection2 < Window_Base

def initialize
super(0, 0, 640, 51)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z = 2000
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
cx = contents.text_size("Which Character would you like to select?").width
self.contents.draw_text(145, -6, cx, 32, "Which Character would you like to select?", 2)
end
end

#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
#==============================================================================

class Window_Selectable3 < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :index # cursor position
attr_reader :help_window # help window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
# Update Help Text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max
# Compute rows from number of items and columns
return (@item_max + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 32
return self.oy / 32
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 32 for y-coordinate of window contents
# transfer origin
self.oy = row * 32
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 32
end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max
# Multiply row count (page_row_max) times column count (@column_max)
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
# Update cursor rectangle
if $game_party.actors.size < 2
self.cursor_rect.set(250 + @index * 140, y, 100, 20)
else
self.cursor_rect.set(160 + @index * 140, y, 150, 20)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If cursor is movable
if self.active and @item_max > 0 and @index >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
# If column count is 1 and directional button was pressed down with no
# repeat, or if cursor position is more to the front than
# (item count - column count)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If column count is 1 and directional button was pressed up with no
# repeat, or if cursor position is more to the back than column count
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# If column count is 2 or more, and cursor position is closer to front
# than (item count -1)
if @column_max >= 2 and @index < @item_max - 1
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# If column count is 2 or more, and cursor position is more back than 0
if @column_max >= 2 and @index > 0
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
# If R button was pressed
if Input.repeat?(Input::R)
# If bottom row being displayed is more to front than bottom data row
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
# Move cursor 1 page back
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
# If L button was pressed
if Input.repeat?(Input::L)
# If top row being displayed is more to back than 0
if self.top_row > 0
# Move cursor 1 page forward
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: Re: script menu   Lun 2 Oct - 5:12

class Window_StatusCharacter1 < Window_Base

def initialize
super(0, 0, 440,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(215, -63, 144, 144, "Current State:")
self.contents.draw_text(190, 114, 120, 32, "Experience:")
self.contents.draw_text(0, -7, 120, 32, "Name:")
actor = @actor
@actor = $game_party.actors[0]
draw_actor_name(@actor, x + 55, y - 7)
draw_actor_state(@actor, 325, -8, 144)
draw_actor_parameter2(@actor, 0, 15 + 10, 0)
draw_actor_parameter2(@actor, 0, 15 + 40, 1)
draw_actor_parameter2(@actor, 0, 15 + 70, 2)
draw_actor_parameter2(@actor, 0, 15 + 100, 3)
draw_actor_parameter2(@actor, 190, 15 + 10, 4)
draw_actor_parameter2(@actor, 190, 15 + 40, 5)
draw_actor_parameter2(@actor, 190, 15 + 70, 6)
draw_actor_barz(@actor, 0, 15 + 37, "horizontal", 168, 1, @actor.atk, 999, Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255))
draw_actor_barz(@actor, 0, 15 + 67, "horizontal", 168, 1, @actor.pdef, 999, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
draw_actor_barz(@actor, 0, 15 + 97, "horizontal", 168, 1, @actor.mdef, 999, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
draw_actor_barz(@actor, 0, 15 + 127, "horizontal", 168, 1, @actor.str, 999, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
draw_actor_barz(@actor, 190, 15 + 37, "horizontal", 168, 1, @actor.dex, 999, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
draw_actor_barz(@actor, 190, 15 + 67, "horizontal", 168, 1, @actor.agi, 999, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
draw_actor_barz(@actor, 190, 15 + 97, "horizontal", 168, 1, @actor.int, 999, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
draw_actor_barz(@actor, 190, 15 + 127, "horizontal", 168, 1, @actor.now_exp.to_f, @actor.next_exp, Color.new(-255, 200, -86, 255), Color.new(-168, -157, 184, 255))
end

end

class Window_StatusCharacter2 < Window_Base

def initialize
super(0, 0, 440,200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
end

def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.draw_text(25, 55, 50, 28, "Empty")
else
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(215, -63, 144, 144, "Current State:")
self.contents.draw_text(190, 114, 120, 32, "Experience:")
self.contents.draw_text(0, -7, 120, 32, "Name:")
actor = @actor
@actor = $game_party.actors[1]
draw_actor_name(@actor, x + 55, y - 7)
draw_actor_state(@actor, 325, -8, 144)
draw_actor_parameter2(@actor, 0, 15 + 10, 0)
draw_actor_parameter2(@actor, 0, 15 + 40, 1)
draw_actor_parameter2(@actor, 0, 15 + 70, 2)
draw_actor_parameter2(@actor, 0, 15 + 100, 3)
draw_actor_parameter2(@actor, 190, 15 + 10, 4)
draw_actor_parameter2(@actor, 190, 15 + 40, 5)
draw_actor_parameter2(@actor, 190, 15 + 70, 6)
draw_actor_barz(@actor, 0, 15 + 37, "horizontal", 168, 1, @actor.atk, 999, Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255))
draw_actor_barz(@actor, 0, 15 + 67, "horizontal", 168, 1, @actor.pdef, 999, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
draw_actor_barz(@actor, 0, 15 + 97, "horizontal", 168, 1, @actor.mdef, 999, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
draw_actor_barz(@actor, 0, 15 + 127, "horizontal", 168, 1, @actor.str, 999, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
draw_actor_barz(@actor, 190, 15 + 37, "horizontal", 168, 1, @actor.dex, 999, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
draw_actor_barz(@actor, 190, 15 + 67, "horizontal", 168, 1, @actor.agi, 999, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
draw_actor_barz(@actor, 190, 15 + 97, "horizontal", 168, 1, @actor.int, 999, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
draw_actor_barz(@actor, 190, 15 + 127, "horizontal", 168, 1, @actor.now_exp.to_f, @actor.next_exp, Color.new(-255, 200, -86, 255), Color.new(-168, -157, 184, 255))
end
end

end

class Scene_Load2 < Scene_File

def initialize
$game_temp = Game_Temp.new
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Which file would you like to load?")
end

def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Map.new
end

def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(3)
end

def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)

if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
end
end

class Window_EquipLeft2 < Window_Base

def initialize(actor)
super(0, 64, 272, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end

def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level3(@actor, 4, 32)
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 64, 40, 32, "->", 1)
self.contents.font.color = normal_color
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 96, 40, 32, "->", 1)
self.contents.font.color = normal_color
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 128, 40, 32, "->", 1)
self.contents.font.color = normal_color
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
end

def set_new_parameters(new_atk, new_pdef, new_mdef)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
refresh
end
end
end

class Window_EquipRight2 < Window_Selectable

def initialize(actor)
super(272, 64, 368, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
self.index = 0
end

def item
return @data[self.index]
end

def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end

def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end

class Window_Character_Selection1 < Window_Selectable3

attr_accessor :commands

def initialize(commands)
super(0, 50, 640, 50)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@width = width
if $game_party.actors.size < 2
@item_max = 1
@column_max = 1
else
@item_max = 2
@column_max =2
end
@commands = 2
self.visible = false
self.active = false
self.index = -1
self.z = 2000
refresh
end


def refresh
self.contents.clear
self.contents.font.color = system_color
if $game_party.actors.size < 2
self.contents.draw_text(180, -6, 144, 32, $game_party.actors[0].name, 2)
else
self.contents.draw_text(120, -6, 144, 32, $game_party.actors[0].name, 2)
self.contents.draw_text(240, -6, 144, 32, $game_party.actors[1].name, 2)
end
end
end

class Scene_Equip2

def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end

def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@left_window = Window_EquipLeft2.new(@actor)
@right_window = Window_EquipRight2.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@right_window.index = @equip_index
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end

def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end

if @right_window.active
@left_window.set_new_parameters(nil, nil, nil)
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end

def update
@left_window.update
@right_window.update
@item_window.update
refresh
if @right_window.active
update_right
return
end

if @item_window.active
update_item
return
end
end

def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
return
end

if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end

$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end

if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip2.new(@actor_index, @right_window.index)
return
end

if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip2.new(@actor_index, @right_window.index)
return
end
end

def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
return
end
end
end

class Window_Graphic1 < Window_Base

def initialize
super(0, 0, 280, 200)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_actor_battler(actor, x + 130, y + 200)
end
end

class Window_Graphic2 < Window_Base
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
darksonic872
the master
avatar

Nombre de messages : 53
Date d'inscription : 07/09/2006

MessageSujet: Re: script menu   Lun 2 Oct - 5:12

def initialize
super(0, 0, 280, 220)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.clear
else
actor = $game_party.actors[1]
draw_actor_battler(actor, x + 130, y + 200)
end
end
end

class Window_SkillStatus < Window_Base

def initialize(actor)
super(0, 64, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end

def refresh
self.contents.clear
draw_actor_name(@actor, 0, 0)
draw_actor_state(@actor, 150, 0)
draw_actor_hp2(@actor, 270, 0)
draw_actor_sp2(@actor, 440, 0)
end
end

class Scene_Skill2

def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end

def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@status_window = Window_SkillStatus.new(@actor)
@skill_window = Window_Skill.new(@actor)
@skill_window.help_window = @help_window
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
end

def update
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
if @skill_window.active
update_skill
return
end

if @target_window.active
update_target
return
end
end

def update_skill
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
return
end

if Input.trigger?(Input::C)
@skill = @skill_window.skill
if @skill == nil or not @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)

if @skill.scope >= 3
@skill_window.active = false
@target_window.x = (@skill_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
else
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
$scene = Scene_Map.new
return
end
end
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Skill.new(@actor_index)
return
end

if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Skill.new(@actor_index)
return
end
end

def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
return
end

if Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end

if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end

if @target_window.index <= -2
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end

if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end

if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end


class Scene_Menu

def initialize(menu_index = 0)
@menu_index = menu_index
end

def main
@update_frame = 0

@window_location = Window_Location.new
@window_location.x =420

@window_character_selection1 = Window_Character_Selection1.new(@commands)
@window_character_selection1.y = 50

@window_character_selection2 = Window_Character_Selection2 .new


@window_character1_graphic = Window_GraphicCharacter1.new
@window_character1_graphic.y =100
@window_character1_graphic.frame_update
@window_character1_graphic.opacity = 0
@window_character1_graphic.back_opacity = 0

@window_character2_graphic = Window_GraphicCharacter2.new
@window_character2_graphic.y =280
@window_character2_graphic.frame_update
@window_character2_graphic.opacity = 0
@window_character2_graphic.back_opacity = 0

@window_character1 = Window_Character1.new
@window_character1.y =100

@window_character2 = Window_Character2.new
@window_character2.y =280

@window_status_character1 = Window_StatusCharacter1.new
@window_status_character1.x =200
@window_status_character1.y =100

@window_status_character2 = Window_StatusCharacter2.new
@window_status_character2.x =200
@window_status_character2.y =280

@playtime_window = Window_PlayTime.new
@playtime_window.x = 270

@graphic1 = Window_Graphic1.new
@graphic1.x = 240
@graphic1.y = 92
@graphic1.z = 501
@graphic1.opacity = 0
@graphic1.back_opacity = 0
@graphic1.contents_opacity = 100

@graphic2 = Window_Graphic2.new
@graphic2.x = 240
@graphic2.y = 272
@graphic2.z = 501
@graphic2.opacity = 0
@graphic2.back_opacity = 0
@graphic2.contents_opacity = 100

@command_window = Window_Command2.new(["Item", "Skill", "Equip", "Load", "Save", "Quit"])
@command_window.index = @menu_index

@dummy_window = Dummy_Window_Command.new
@dummy_window.z = 500
@dummy_window.opacity = 0
@dummy_window.back_opacity = 0

@dummy_window_icons = Dummy_Window_Command2.new
@dummy_window_icons.opacity = 0
@dummy_window_icons.back_opacity = 0
@dummy_window_icons.contents_opacity = 100

Graphics.transition
loop do
Graphics.update
Input.update
@update_frame += 1
if @update_frame == 5
@update_frame = 0
@window_character2_graphic.frame_update
@window_character1_graphic.frame_update
end

update
if $scene != self
break
end
end

Graphics.freeze
@window_location.dispose
@window_character1.dispose
@window_status_character1.dispose
@window_character2.dispose
@window_status_character2.dispose
@playtime_window.dispose
@command_window.dispose
@graphic1.dispose
@graphic2.dispose
@dummy_window.dispose
@dummy_window_icons.dispose
@window_character1_graphic.dispose
@window_character2_graphic.dispose
@window_character_selection1.dispose
@window_character_selection2.dispose
end

def update
@playtime_window.update
@command_window.update
@window_character_selection1.update

if @command_window.active
update_command
return
end

if @window_character_selection1.active
update_character
return
end
end

def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end

if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@window_character_selection1.visible = true
@window_character_selection2.visible = true
@window_character_selection1.active = true
@window_character_selection1.index = 0
@command_window.active = false
when 2
$game_system.se_play($data_system.decision_se)
@window_character_selection1.visible = true
@window_character_selection1.active = true
@window_character_selection2.visible = true
@window_character_selection1.index = 0
@command_window.active = false
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load2.new
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end

def update_character
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@window_character_selection1.visible = false
@window_character_selection1.active = false
@window_character_selection2.visible = false
@window_character_selection1.index = -1
return
end

if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 1
$game_system.se_play($data_system.decision_se)
case @window_character_selection1.index
when 0
$scene = Scene_Skill2.new(@window_character_selection1.index)
when 1
$scene = Scene_Skill2.new(@window_character_selection1.index)
end
when 2
$game_system.se_play($data_system.decision_se)
case @window_character_selection1.index
when 0
$scene = Scene_Equip2.new(@window_character_selection1.index)
when 1
$scene = Scene_Equip2.new(@window_character_selection1.index)
end
end
return
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://fantasy-island.bb-fr.com
Contenu sponsorisé




MessageSujet: Re: script menu   

Revenir en haut Aller en bas
 
script menu
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
fantasy island :: RPG maker :: Scripts-
Sauter vers: