class Scene_Battle
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If battle event is running
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
# If not after battle phase
if @phase != 5
# Refresh status window
@status_window.refresh
end
end
end
# Update system (timer) and screen
$game_system.update
$game_screen.update
# If timer has reached 0
# Update windows
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
# Update sprite set
@spriteset.update
# If transition is processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If message window is showing
if $game_temp.message_window_showing
return
end
# If effect is showing
if @spriteset.effect?
return
end
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Switch to title screen
$scene = Scene_Title.new
return
end
# If battle is aborted
if $game_temp.battle_abort
# Return to BGM used before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Battle ends
battle_end(1)
return
end
# If waiting
if @wait_count > 0
# Decrease wait count
@wait_count -= 1
return
end
# If battler forcing an action doesn't exist,
# and battle event is running
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# Branch according to phase
case @phase
when 1 # pre-battle phase
update_phase1
when 2 # party command phase
update_phase2
when 3 # actor command phase
update_phase3
when 4 # main phase
update_phase4
when 5 # after battle phase
update_phase5
end
end
end
class Window_Base < Window
def draw_actor_exp(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 24, 32, "E")
self.contents.font.color = normal_color
if actor.exp_list[actor.level+1] > 0
self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)
self.contents.draw_text(x + 108, y, 12, 32, "/", 1)
self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s)
else
self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)
end
end
end
class Game_Actor < Game_Battler
attr_reader :exp_list
def exp_s
return @exp.to_s
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
#==============================================================================
# ¡ Window_Base
#------------------------------------------------------------------------------
# @ƒQ[ƒ€'†,Ì,·,×,Ä,̃EƒBƒ"ƒhƒE,̃X[ƒp[ƒNƒ‰ƒX,Å,·B
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# œ HP ƒQ[ƒW,Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹,ÌHP•`‰æ,ð draw_actor_hp_original ,Æ-¼'O•ÏX
alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# •Ï"rate,É Œ»Ý,ÌHP/MHP,ð'ã"ü
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
# plus_x:XÀ•W,̈Ê'u•â³ rate_x:XÀ•W,̈Ê'u•â³(%) plus_y:YÀ•W,̈Ê'u•â³
# plus_width:•,Ì•â³ rate_width:•,Ì•â³(%) height:c•
# align1:•`‰æƒ^ƒCƒv1 0:¶‹l,ß 1:'†‰›'µ,¦ 2:‰E‹l,ß
# align2:•`‰æƒ^ƒCƒv2 0:ã‹l,ß 1:'†‰›'µ,¦ 2:‰º‹l,ß
# align3:ƒQ[ƒWƒ^ƒCƒv 0:¶‹l,ß 1:‰E‹l,ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf[ƒVƒ‡ƒ"Ý'è grade1:‹óƒQ[ƒW grade2:ŽÀƒQ[ƒW
# (0:‰¡,ɃOƒ‰ƒf[ƒVƒ‡ƒ" 1:c,ɃOƒ‰ƒf[ƒVƒ‡ƒ" 2:ŽÎ,ß,ɃOƒ‰ƒf[ƒVƒ‡ƒ"(Œƒd)j
grade1 = 1
grade2 = 0
# FÝ'èBcolor1:ŠO˜gCcolor2:'†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
# color5:ŽÀƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor6:ŽÀƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
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)
# •Ï"sp,É•`‰æ,·,éƒQ[ƒW,Ì•,ð'ã"ü
if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end
# ƒQ[ƒW,Ì•`‰æ
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)
# ƒIƒŠƒWƒiƒ‹,ÌHP•`‰æˆ--,ðŒÄ,Ño,µ
draw_actor_hp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# œ SP ƒQ[ƒW,Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹,ÌSP•`‰æ,ð draw_actor_sp_original ,Æ-¼'O•ÏX
alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# •Ï"rate,É Œ»Ý,ÌSP/MSP,ð'ã"ü
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end
# plus_x:XÀ•W,̈Ê'u•â³ rate_x:XÀ•W,̈Ê'u•â³(%) plus_y:YÀ•W,̈Ê'u•â³
# plus_width:•,Ì•â³ rate_width:•,Ì•â³(%) height:c•
# align1:•`‰æƒ^ƒCƒv1 0:¶‹l,ß 1:'†‰›'µ,¦ 2:‰E‹l,ß
# align2:•`‰æƒ^ƒCƒv2 0:ã‹l,ß 1:'†‰›'µ,¦ 2:‰º‹l,ß
# align3:ƒQ[ƒWƒ^ƒCƒv 0:¶‹l,ß 1:‰E‹l,ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf[ƒVƒ‡ƒ"Ý'è grade1:‹óƒQ[ƒW grade2:ŽÀƒQ[ƒW
# (0:‰¡,ɃOƒ‰ƒf[ƒVƒ‡ƒ" 1:c,ɃOƒ‰ƒf[ƒVƒ‡ƒ" 2:ŽÎ,ß,ɃOƒ‰ƒf[ƒVƒ‡ƒ"(Œƒd)j
grade1 = 1
grade2 = 0
# FÝ'èBcolor1:ŠO˜gCcolor2:'†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
# color5:ŽÀƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor6:ŽÀƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
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)
# •Ï"sp,É•`‰æ,·,éƒQ[ƒW,Ì•,ð'ã"ü
if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end
# ƒQ[ƒW,Ì•`‰æ
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)
# ƒIƒŠƒWƒiƒ‹,ÌSP•`‰æˆ--,ðŒÄ,Ño,µ
draw_actor_sp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# œ EXP ƒQ[ƒW,Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹,ÌEXP•`‰æ,ð draw_actor_sp_original ,Æ-¼'O•ÏX
alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)
# •Ï"rate,É Œ»Ý,Ìexp/nextexp,ð'ã"ü
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
# plus_x:XÀ•W,̈Ê'u•â³ rate_x:XÀ•W,̈Ê'u•â³(%) plus_y:YÀ•W,̈Ê'u•â³
# plus_width:•,Ì•â³ rate_width:•,Ì•â³(%) height:c•
# align1:•`‰æƒ^ƒCƒv1 0:¶‹l,ß 1:'†‰›'µ,¦ 2:‰E‹l,ß
# align2:•`‰æƒ^ƒCƒv2 0:ã‹l,ß 1:'†‰›'µ,¦ 2:‰º‹l,ß
# align3:ƒQ[ƒWƒ^ƒCƒv 0:¶‹l,ß 1:‰E‹l,ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf[ƒVƒ‡ƒ"Ý'è grade1:‹óƒQ[ƒW grade2:ŽÀƒQ[ƒW
# (0:‰¡,ɃOƒ‰ƒf[ƒVƒ‡ƒ" 1:c,ɃOƒ‰ƒf[ƒVƒ‡ƒ" 2:ŽÎ,ß,ɃOƒ‰ƒf[ƒVƒ‡ƒ"(Œƒd)j
grade1 = 1
grade2 = 0
# FÝ'èBcolor1:ŠO˜gCcolor2:'†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
# color5:ŽÀƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor6:ŽÀƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
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)
# •Ï"exp,É•`‰æ,·,éƒQ[ƒW,Ì•,ð'ã"ü
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
# ƒQ[ƒW,Ì•`‰æ
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)
# ƒIƒŠƒWƒiƒ‹,ÌEXP•`‰æˆ--,ðŒÄ,Ño,µ
draw_actor_exp_original(actor, x, y)
end
#--------------------------------------------------------------------------
# œ ƒQ[ƒW,Ì•`‰æ
#--------------------------------------------------------------------------
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
# ˜g•`‰æ
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
# ‹óƒQ[ƒW,Ì•`‰æ
self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end
# ŽÀƒQ[ƒW,Ì•`‰æ
self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end
#------------------------------------------------------------------------------
# @BitmapƒNƒ‰ƒX,ÉV,½,È‹@"\,ð'ljÁ,µ,Ü,·B
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# œ ‹éŒ`,ðƒOƒ‰ƒf[ƒVƒ‡ƒ"•\Ž¦
# color1 : ƒXƒ^[ƒgƒJƒ‰[
# color2 : ƒGƒ"ƒhƒJƒ‰[
# align : 0:‰¡,ɃOƒ‰ƒf[ƒVƒ‡ƒ"
# 1:c,ɃOƒ‰ƒf[ƒVƒ‡ƒ"
# 2:ŽÎ,ß,ɃOƒ‰ƒf[ƒVƒ‡ƒ"iŒƒd,É,Â,«'ˆÓj
#--------------------------------------------------------------------------
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
class Window_Base < Window
def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
def draw_actor_battler_graphic(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
#========================================
#¡ Game_Map
#--------------------------------------------------------------------------------
# Setting functions for the Map
#========================================
class Game_Map
def name
$map_infos[@map_id]
end
end
#========================================
#¡ Window_Title
#--------------------------------------------------------------------------------
# Setting functions for the Title
#========================================
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
#==============================================================================
# ¡ Window_MenuStatus
#------------------------------------------------------------------------------
# Sets up the Choosing.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 560, 454)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# Drawing Info on Screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 94
y = i * 110
actor = $game_party.actors[i]
# draw_actor_face(actor, 12, y + 90) #To get rid of the Face, put a "#" before the draw_ of this line
draw_actor_graphic(actor, 48, y + 65) #and delete the "#" infront of draw of this line
draw_actor_name(actor, x, y)
draw_actor_level(actor, x + 144, y)
draw_actor_state(actor, x + 280, y )
draw_actor_exp(actor, x+ 144, y + 38)
if actor.id == 1
draw_actor_hp(actor, x + -20, y + 32)
draw_actor_sp(actor, x + -20, y + 64)
end
end
end
#--------------------------------------------------------------------------
# Update of Cursor
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 110, self.width - 32, 96)
end
end
end
#=======================================#
# ¡Window_GameStats #
# written by AcedentProne #
#------------------------------------------------------------------------------#
class Window_GameStats < Window_Base
def initialize
super(0, 0, 160, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
refresh
end
def refresh
self.contents.clear
#Drawing gold into separate commas by Dubealex
case $game_party.gold
when 0..9999
gold = $game_party.gold
when 10000..99999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s
when 100000..999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s
when 1000000..9999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s
when 10000000..99999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s+","+array[5].to_s+array[6].to_s+array[7].to_s
when 100000000..999999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s+","+array[6].to_s+array[7].to_s+array[8].to_s
when 1000000000..9999999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s+","+array[7].to_s+array[8].to_s+array[9].to_s
when 10000000000..99999999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s+","+array[5].to_s+array[6].to_s+array[7].to_s+","+array[8].to_s+array[9].to_s+array[10].to_s
when 100000000000..999999999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s+","+array[6].to_s+array[7].to_s+array[8].to_s+","+array[9].to_s+array[10].to_s+array[11].to_s
when 1000000000000..9999999999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s+","+array[7].to_s+array[8].to_s+array[9].to_s+","+array[10].to_s+array[11].to_s+array[12].to_s
end
#Draw Gold
self.contents.font.color = system_color
gold_word = $data_system.words.gold.to_s
cx = contents.text_size(gold_word).width
cx2=contents.text_size(gold.to_s).width
self.contents.draw_text(4, 4, 120-cx-2, 32, gold_word)
self.contents.font.color = normal_color
self.contents.draw_text(124-cx2+1, 4, cx2, 32, gold.to_s, 2)
self.contents.font.color = system_color
# Draw "Time"
@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, -10, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, -10, 120, 32, "Time")
end
#--------------------------------------------------------------------------
# Update of The count
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ¡ Window_Mapname
#------------------------------------------------------------------------------
# @Draws the Map name
#==============================================================================
class Window_Mapname < Window_Base
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 44)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
refresh
end
#--------------------------------------------------------------------------
# Draws info on screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.draw_text(4, -10, 220, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(80, -10, 200, 32, $game_map.name)
end
end
#==============================================================================
# ¡ Scene_Menu
#------------------------------------------------------------------------------
# FF7 menu layout as requested by AcedentProne.
#==============================================================================
class Scene_Menu
#--------------------------- edit-------------------------------
attr_reader :status_window
#/--------------------------- edit-------------------------------
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 = "Status"
s5 = "Save"
s6 = "Quit"
#--------------------------- edit-------------------------------
# Command menu
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,])
@command_window.x = 640 - @command_window.width
@command_window.y = 480
@command_window.z = 110
@command_window.index = @menu_index
#If certain options are avaliable
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
#Showing location window
@map = Window_Mapname.new
@map.x = 640 - @map.width
@map.y = 0 - @map.height - 1
@map.z = 110
#Showing the game stats
@game_stats_window = Window_GameStats.new
@game_stats_window.x = 0 - @game_stats_window.width
@game_stats_window.y = 480 - @map.height - @game_stats_window.height
@game_stats_window.z =110
#Showing the Menu Status window
@status_window = Window_MenuStatus.new
@status_window.x = 640
@status_window.y = 8
@status_window.z = 100
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@game_stats_window.dispose
@status_window.dispose
@map.dispose
end
#--------------------------------------------------------------------------
#Defining the delay
#--------------------------------------------------------------------------
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
#--------------------------------------------------------------------------
# Updating
#--------------------------------------------------------------------------
def update
@command_window.update
@game_stats_window.update
@status_window.update
@map.update
#Moving Windows inplace
gamepos = 640 - @game_stats_window.width
mappos = 480 - @map.height - 1
if @command_window.y > 0
@command_window.y -= 60
end
if @game_stats_window.x < gamepos
@game_stats_window.x += 80
end
if @map.y < mappos
@map.y += 80
end
if @status_window.x > 0
@status_window.x -= 80
end
#Saying if options are active
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# Updating the Command Selection
#--------------------------------------------------------------------------
def update_command
# If B button is pushed
if Input.trigger?(Input::B)
# Plays assigned SE
$game_system.se_play($data_system.cancel_se)
#Looping for moving windows out
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
# Go to Map
$scene = Scene_Map.new
return
end
# If C button is pused
if Input.trigger?(Input::C)
# Checks actor size
if $game_party.actors.size == 0 and @command_window.index < 4
# plays SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = 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.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = 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)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_End.new
return
end
end
#--------------------------------------------------------------------------
# Updating Status Screen
#--------------------------------------------------------------------------
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 # ƒXƒLƒ‹
# ,±,̃AƒNƒ^[,Ìs"®§ŒÀ,ª 2 ˆÈã,Ìê‡
if $game_party.actors[@status_window.index].restriction >= 2
# ƒuƒU[ SE ,ð‰‰'t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ'è SE ,ð‰‰'t
$game_system.se_play($data_system.decision_se)
# ƒXƒLƒ‹‰æ-Ê,ÉØ,è'Ö,¦
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
end
if $game_exists
Thread.new {system('Game')}
exit
end
$game_exists = true
module Graphics
unless $graphics_fast_forward_defined
# Prevent F12 Crash
$graphics_fast_forward_defined = true
class << Graphics
alias graphics_fast_forward_update update
def update
# Call Original
graphics_fast_forward_update
# If DEBUG for XP and BTEST for all higher versions
if $DEBUG || $TEST
# If holding CTRL Key
if Input.press?(Input::CTRL)
# Fast Forward
Graphics.frame_rate = 120
# If holding SHIFT Key
elsif Input.press?(Input::SHIFT)
# Slow Mo
Graphics.frame_rate = 10
else
if $XPVXA == "XP"
# Normal Speed of 40 Frames Per Second for XP
Graphics.frame_rate = 40
else
# Normal Speed of 60 Frames Per Second for all higher versions
Graphics.frame_rate = 60
end
end
end
end
end
end
end
$XPVXA = "XP"
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Unlimited Levels by Blizzard
# Version: 1.0
# Type: Actor Attribute Modifier
# Date: 10.2.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This work is protected by the following license:
# #----------------------------------------------------------------------------
# #
# # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #
# # You are free:
# #
# # to Share - to copy, distribute and transmit the work
# # to Remix - to adapt the work
# #
# # Under the following conditions:
# #
# # Attribution. You must attribute the work in the manner specified by the
# # author or licensor (but not in any way that suggests that they endorse you
# # or your use of the work).
# #
# # Noncommercial. You may not use this work for commercial purposes.
# #
# # Share alike. If you alter, transform, or build upon this work, you may
# # distribute the resulting work only under the same or similar license to
# # this one.
# #
# # - For any reuse or distribution, you must make clear to others the license
# # terms of this work. The best way to do this is with a link to this web
# # page.
# #
# # - Any of the above conditions can be waived if you get permission from the
# # copyright holder.
# #
# # - Nothing in this license impairs or restricts the author's moral rights.
# #
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
# 99% compatible with SDK v1.x. 95% compatible with SDK v2.x. Can cause
# incompatibility issues with custom leveling systems. WILL corrupt your old
# savegames.
#
#
# Features:
#
# - allows actors to have levels higher than 99
# - automatic calculation of generated stats with minimum error rate
# - easy to use
#
#
# Explanation:
#
# This script will allow actors to have levels higher than 99. It
# automatically calculates the required EXP and the stats using RMXP's
# default method of calculation.
#
#
# Notes:
#
# - It is recommended that you also use a script that allows unlimited
# Max HP, Max SP, Str, Dex, Agi, Int and EXP in combination with this
# script.
# - In case a speed setting other than -10, 0 and 10 is being used, the
# attributes generated by this script can be higher by 1 in some cases for
# some levels due to a computational error in the interpolation function.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Level Database
#
# Use following template to give your actors a custom maximum level:
#
# when ID then LEVEL
#
# ID - ID of the actor in the database
# LEVEL - initial level / final level of that actor
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
def self.initial_level(id)
return case id
### START Initial Level Database
when 1 then 1
when 2 then 1
when 3 then 1
when 4 then 1
when 5 then 1
when 6 then 1
when 7 then 1
when 8 then 1
when 9 then 72
when 10 then 1
when 11 then 64
when 12 then 1
when 13 then 1
when 14 then 1
when 15 then 1
when 16 then 1
when 17 then 72
when 18 then 60
### END Initial Level Database
else
nil
end
end
def self.final_level(id)
return case id
### START Final Level Database
when 1 then 300
when 2 then 300
when 3 then 300
when 4 then 300
when 5 then 99
when 6 then 99
when 7 then 10
when 8 then 300
when 9 then 72
when 10 then 300
when 11 then 64
when 12 then 300
when 13 then 300
when 14 then 300
when 15 then 300
when 16 then 300
when 17 then 72
when 18 then 60
### END Final Level Database
else
nil
end
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Level Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Attribute Database
#
# Use following template to give your actors a custom attribute
# calculation.
#
# when ID then [START, END, SPEED]
#
# ID - ID of the actor in the database
# START - attribute value at starting level
# END - attribute value at final level
# SPEED - inflation speed setting (from -10 to 10)
#
# The SPEED setting is working the same as RMXP's speed setting for stat
# generation. -10 is the slowest curve while 10 is the fastest curve. 0 is
# the normal speed and will generate a linear curve.
# If you have an actor with the same initial and final level, the START
# value will be used.
#
# Any actor not defined here will use the default parameters that can be set
# up with RMXP's database. Keep in mind that actors that can have a level
# over 99 MUST HAVE their parameter behavior defined here or the game will
# crash!
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
def self.maxhp_parameters(id)
return case id
### START Max HP
when 1 then [10, 3000, 0.00]
when 2 then [10, 1500, 0]
when 3 then [10, 1500, 0]
when 4 then [10, 1500, 0]
when 5 then [10, 1500, 0]
when 6 then [10, 1500, 0]
when 7 then [10, 1500, 0]
when 8 then [10, 1500, 0]
when 9 then [10, 1500, 0]
when 10 then [10, 1500, 0]
when 11 then [10, 1500, 0]
when 12 then [10, 1500, 0]
when 13 then [10, 1500, 0]
when 14 then [10, 1500, 0]
when 15 then [10, 1500, 0]
when 16 then [10, 1500, 0]
when 17 then [10, 1500, 0]
when 18 then [10, 1500, 0]
### END Max HP
else
nil
end
end
def self.maxsp_parameters(id)
return case id
### START Max SP
when 1 then [0, 1500, 0]
when 2 then [0, 1500, 0]
when 3 then [0, 1500, 0]
when 4 then [0, 745, 0]
when 8 then [0, 1500, 0]
when 10 then [0, 1500, 0]
when 12 then [0, 745, 0]
when 13 then [0, 1500, 0]
when 14 then [0, 745, 0]
when 15 then [0, 1500, 0]
when 16 then [0, 745, 0]
### END Max SP
else
nil
end
end
def self.str_parameters(id)
return case id
### START Str
when 1 then [1, 300, 0]
when 2 then [0, 1500, 0]
when 3 then [0, 1500, 0]
when 4 then [0, 745, 0]
when 8 then [0, 1500, 0]
when 10 then [0, 1500, 0]
when 12 then [0, 745, 0]
when 13 then [0, 1500, 0]
when 14 then [0, 745, 0]
when 15 then [0, 1500, 0]
when 16 then [0, 745, 0]
### END Str
else
nil
end
end
def self.dex_parameters(id)
return case id
### START Dex
when 1 then [1, 300, 0]
when 2 then [0, 1500, 0]
when 3 then [0, 1500, 0]
when 4 then [0, 745, 0]
when 8 then [0, 1500, 0]
when 10 then [0, 1500, 0]
when 12 then [0, 745, 0]
when 13 then [0, 1500, 0]
when 14 then [0, 745, 0]
when 15 then [0, 1500, 0]
when 16 then [0, 745, 0]
### END Dex
else
nil
end
end
def self.agi_parameters(id)
return case id
### START Agi
when 1 then [1, 300, 0]
when 2 then [0, 1500, 0]
when 3 then [0, 1500, 0]
when 4 then [0, 745, 0]
when 8 then [0, 1500, 0]
when 10 then [0, 1500, 0]
when 12 then [0, 745, 0]
when 13 then [0, 1500, 0]
when 14 then [0, 745, 0]
when 15 then [0, 1500, 0]
when 16 then [0, 745, 0]
### END Agi
else
nil
end
end
def self.int_parameters(id)
return case id
### START Int
when 1 then [1, 300, 0]
when 2 then [0, 1500, 0]
when 3 then [0, 1500, 0]
when 4 then [0, 745, 0]
when 8 then [0, 1500, 0]
when 10 then [0, 1500, 0]
when 12 then [0, 745, 0]
when 13 then [0, 1500, 0]
when 14 then [0, 745, 0]
when 15 then [0, 1500, 0]
when 16 then [0, 745, 0]
### END Int
else
nil
end
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Attribute Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
$unlimited_levels = 1.0
end
#==============================================================================
# Wrapper_Base
#==============================================================================
class Wrapper_Base
def initialize(initial_level, final_level)
@initial_level, @final_level = initial_level, final_level
end
end
#==============================================================================
# Wrapper_ExpList
#==============================================================================
class Wrapper_ExpList < Wrapper_Base
def initialize(initial_level, final_level, inflation, basis)
super(initial_level, final_level)
@data = [0, 0]
pow = 2.4 + inflation / 100.0
(2..(@final_level + 1)).each {|i|
@data[i] = @data[i - 1] + (basis * ((i + 3) ** pow) / (5 ** pow)).to_i}
end
def [](i)
return ((i >= @initial_level && i <= @final_level) ? @data[i] : 0)
end
end
#==============================================================================
# Wrapper_Parameters
#==============================================================================
class Wrapper_Parameters < Wrapper_Base
def initialize(initial_level, final_level, id, parameters)
super(initial_level, final_level)
@id, @parameters = id, parameters
end
def calculate_parameter(min, max, speed, level)
p_range, l_range = max - min, (@final_level - @initial_level).to_f
linear = (min + p_range * ((level - @initial_level) / l_range)).ceil
return linear if speed == 0
if speed < 0
curve = (min + p_range * (((level - @initial_level) / l_range) ** 2)).ceil
else
curve = (max - p_range * (((@final_level - level) / l_range) ** 2)).ceil
end
return ((curve * speed.abs + linear * (10 - speed.abs)) / 10)
end
def [](type, level)
values = case type
when 0 then BlizzCFG.maxhp_parameters(@id)
when 1 then BlizzCFG.maxsp_parameters(@id)
when 2 then BlizzCFG.str_parameters(@id)
when 3 then BlizzCFG.dex_parameters(@id)
when 4 then BlizzCFG.agi_parameters(@id)
when 5 then BlizzCFG.int_parameters(@id)
else
nil
end
return @parameters[type, level] if values == nil
return values[0] if @initial_level == @final_level
return calculate_parameter(values[0], values[1], values[2], level)
end
end
#==============================================================================
# RPG::Actor
#==============================================================================
class RPG::Actor
alias initial_level_unlimited_levels_later initial_level
def initial_level
level = BlizzCFG.initial_level(@id)
return (level != nil ? level : initial_level_unlimited_levels_later)
end
alias final_level_unlimited_levels_later final_level
def final_level
level = BlizzCFG.final_level(@id)
return (level != nil ? level : final_level_unlimited_levels_later)
end
def parameters
return Wrapper_Parameters.new(initial_level, final_level, @id, @parameters)
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list = Wrapper_ExpList.new(actor.initial_level, actor.final_level,
actor.exp_inflation, actor.exp_basis)
end
end