Arena RPG Maker
Olá, visitante!
Seja bem-vindo ao fórum Arena RPG Maker, caso queira aprender sobre criação de jogos, está no fórum certo. Esperamos que possa aprender tanto quanto possa nos ensinar aqui.

Atenciosamente,
Equipe Arena RPG Maker.
Arena RPG Maker
Olá, visitante!
Seja bem-vindo ao fórum Arena RPG Maker, caso queira aprender sobre criação de jogos, está no fórum certo. Esperamos que possa aprender tanto quanto possa nos ensinar aqui.

Atenciosamente,
Equipe Arena RPG Maker.
Arena RPG Maker

Estamos de volta o/ ... Ou não.Eu amo a -Dark
Doações para o fórum abertas, clique aqui e saiba mais.
Últimos assuntos
» Ainda temos gente aqui?
Menu Personalizado EmptyQui 25 Nov 2021, 14:04 por Halt

» [Dúvida] Como tirar a porcentagem de esquiva
Menu Personalizado EmptySex 19 Nov 2021, 17:14 por Halt

» Pokémon Genesis Online! (PGO)
Menu Personalizado EmptyQua 05 Jul 2017, 18:08 por Lexar

» Tileset Converter to MV
Menu Personalizado EmptySex 12 maio 2017, 14:07 por Douggi

» Pack Resources, Sprites e etc
Menu Personalizado EmptyQua 23 Dez 2015, 12:30 por raydengv

» Download RPG Maker 2003 + RTP em português
Menu Personalizado EmptyTer 22 Dez 2015, 11:14 por ::KimMax::

» Fantasy Art Online
Menu Personalizado EmptyDom 18 Out 2015, 18:42 por daviih123

» Você vai ter medo do Nerve gear?
Menu Personalizado EmptySáb 25 Jul 2015, 17:02 por Kirito-kun

» O Barato é louco
Menu Personalizado EmptySáb 27 Jun 2015, 16:26 por Halt

» Download RPG Maker 2000 + RTP em português
Menu Personalizado EmptyQui 21 maio 2015, 20:28 por Wismael


Você não está conectado. Conecte-se ou registre-se

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Menu Personalizado Empty Menu Personalizado Qui 23 Ago 2012, 18:53

Halt

Halt
Administrador
Administrador
Coloque esse script acima do Main
Obs: é para jogos offline
Código:
class Game_Map
def name
$map_infos[@map_id]
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
#4###############################################################
class Window_Base
def draw_actor_name2(actor, x, y,align=0)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 64, 32, actor.name ,align)
end
def draw_actor_parameter(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 = $data_system.words.mdef
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.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 164, y, 36, 32, parameter_value.to_s, 2)
end
alias cbs_draw_actor_hp draw_actor_hp
def draw_actor_hp(actor, x, y, width = 146, height = 15)
bg = Color.new( 0, 0, 0, 160)
c1 = Color.new(255, 0, 0, 0)
c2 = Color.new(255, 255, 0, 160)
self.contents.fill_rect(x, y, width, height, bg)
width2 = width * actor.hp / actor.maxhp
gradient(x + 1, y + 1, width2 - 2, height - 2, c1, c2)
cbs_draw_actor_hp(actor, x, y, width)
end
alias cbs_draw_actor_sp draw_actor_sp
def draw_actor_sp(actor, x, y, width = 146, height = 15)
bg = Color.new( 0, 0, 0, 160)
c1 = Color.new( 0, 0, 255, 0)
c2 = Color.new( 0, 255, 255, 160)
self.contents.fill_rect(x, y, width, height, bg)
if actor.maxsp != 0
width2 = width * actor.sp / actor.maxsp
else
width2 = width * actor.sp / 1
end
gradient(x + 1, y + 1, width2 - 2, height - 2, c1, c2)
cbs_draw_actor_sp(actor, x, y, width)
end
def gradient(x, y, width, height, c1, c2)
for i in 1..width
x2 = x + i - 1
r = c1.red * (width - i) / width + c2.red * i / width
g = c1.green * (width - i) / width + c2.green * i / width
b = c1.blue * (width - i) / width + c2.blue * i / width
a = c1.alpha * (width - i) / width + c2.alpha * i / width
self.contents.fill_rect(x2, y, 1, height, Color.new(r, g, b, a))
end
end
end
#4###############################################################
class Window_Steps < 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.draw_text(4, 0, 120, 32, "Passos")
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $game_party.steps.to_s, 2)
end
end
#==============================================================================
class Window_PlayTime < 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
@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(4, 4, 120, 24, text, 1)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
class Window_Gold < 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
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
class Window_Equipamento < Window_Base
def initialize(actor)
super(0, 0, 240, 192)
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_item_name($data_weapons[@actor.weapon_id], 0, 0)
draw_item_name($data_armors[@actor.armor1_id], 0, 32)
draw_item_name($data_armors[@actor.armor2_id], 0, 64)
draw_item_name($data_armors[@actor.armor3_id], 0, 96)
draw_item_name($data_armors[@actor.armor4_id], 0, 128)
end
end
#==============================================================================
class Window_Status2 < Window_Base
def initialize(actor)
super(0, 0, 240, 192)
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_parameter(@actor, 0, 0, 0)
draw_actor_parameter(@actor, 0, 21, 1)
draw_actor_parameter(@actor, 0, 42, 2)
draw_actor_parameter(@actor, 0, 63, 3)
draw_actor_parameter(@actor, 0, 84, 4)
draw_actor_parameter(@actor, 0, 105, 5)
draw_actor_parameter(@actor, 0, 126, 6)
end
end
#==============================================================================
class Window_Hero_Status < Window_Base
def initialize(actor)
super(0, 0, 320, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
@frame = 0
@pose = 0
refresh
end
def refresh
self.contents.clear
draw_actor_sprite
draw_actor_name2(@actor, 8, 0, 1)
draw_actor_class(@actor, 96, 0)
draw_actor_level(@actor, 96, 24)
draw_actor_state(@actor, 96, 48)
self.contents.font.color = system_color
self.contents.draw_text(96, 72, 80, 32, "EXP:")
self.contents.font.color = normal_color
self.contents.draw_text(96, 72, 160, 32, @actor.exp_s + "/" + @actor.next_exp_s , 2)
draw_actor_hp(@actor, 96, 100, 172)
draw_actor_sp(@actor, 96, 124, 172)
end
def draw_actor_sprite
self.contents.fill_rect(0, 32, 80, 120, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.character(@actor.character_name, @actor.character_hue)
self.contents.stretch_blt(Rect.new(0, 32, 80, 120), bitmap,
Rect.new(bitmap.width / 4 * @frame, bitmap.height / 4 * @pose , bitmap.width / 4 , bitmap.height / 4))
end
def update
super
if Graphics.frame_count % 10 == 0
if @frame == 3
#@pose == 3 ? @pose = 0 : @pose += 1
end
@frame == 3 ? @frame = 0 : @frame += 1
draw_actor_sprite
end
end
end
#==============================================================================
class Window_Dummy < Window_Base
def initialize(actor)
super(0, 0, 160, 192)
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
bitmap = RPG::Cache.windowskin($game_system.windowskin_name)
src_rect = Rect.new(128,64,32,32)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(0, 42, bitmap, src_rect)
self.contents.blt(0, 84, bitmap, src_rect)
self.contents.blt(0, 126, bitmap, src_rect)
self.contents.draw_text(0,8,32,32,"H",0)
self.contents.draw_text(0,50,32,32,"J",0)
self.contents.draw_text(0,92,32,32,"K",0)
self.contents.draw_text(0,132,32,32,"L",0)
end
end
#==============================================================================
class Window_Mapname < Window_Base
def initialize
super(0, 0, 640, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 24
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(4, 16, 608, 32, $game_map.name.to_s, 1)
end
end
#==============================================================================
# Scene_Menu
#==============================================================================
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Salvar"
s5 = "Fim de Jogo"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
@command_window.index = @menu_index
@command_window.x = 640 - 160
@command_window.y = 192
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
if $game_system.save_disabled
@command_window.disable_item(4)
end
@playtime_window = Window_PlayTime.new
@playtime_window.x = 640 - @playtime_window.width
@steps_window = Window_Steps.new
@steps_window.x = 640 - @steps_window.width
@steps_window.y = 64
@gold_window = Window_Gold.new
@gold_window.x = 640 - @gold_window.width
@gold_window.y = 128
@mapname_window = Window_Mapname.new
@mapname_window.y = 480 - 96
#@mapname_window.visible = false
@status_window = Window_Hero_Status.new($game_party.actors[0])
@status_window.y = 0
@equip_window = Window_Equipamento.new($game_party.actors[0])
@equip_window.y = 192
@stats_window = Window_Status2.new($game_party.actors[0])
@stats_window.x = 240
@stats_window.y = 192
@dummy_window = Window_Dummy.new($game_party.actors[0])
@dummy_window.x = 320
@dummy_window.visible = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
@mapname_window.dispose
@equip_window.dispose
@stats_window.dispose
@dummy_window.dispose
end
def update
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
@mapname_window.update
@equip_window.update
@stats_window.update
@dummy_window.update
update_command
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 # Habilidades
#-------------------------------------------------------#
if $game_party.actors[0].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(0)
#-------------------------------------------------------#
when 2 # Equipamentos
#-------------------------------------------------------#
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(0)
#-------------------------------------------------------#
when 3 # Salvar
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 4 # Fim de Jogo
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
end

https://arenarpgmaker.forumeiros.com

Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos