momonari_junta
Member
script:
Is there a way to make a switch or call script to turn off this script?
When I use the switch in the script it just turns off the Image of the Dash Bar, but you can still dash and run, you just don't see the bar.
How can I totally turn it off (not just the dash bar image)?
if true # True = Enable / False = Disable (Script)
#_______________________________________________________________________________
# MOG_Advanced Move System V2.0
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
#Adiciona o sistema avançado de movimento.
#Será necessário ter a picture "Dash_Bar" dentro da pasta
#pictures.
#######################OPCIONAL################################
#Apresenta uma animação diferente para cada fase de movimento.
#Para ter a animação do Char correndo será necessário
#ter o arquivo imagem "Nome_do_char_DASH.png"
#Para ter a animação do Char na diagonal será necessário
#ter o arquivo imagem "Nome_do_char_quarter.png"
#Para ter a animação do Char na diagonal e correndo será
#necessário ter o arquivo imagem "Nome_do_char_dash_quarter.png"
#Exemplo
#Nome do CHAR = 001-Fighter01.png
#001-Fighter01_dash.png
#001-Fighter01_quarter.png
#001-Fighter01_dash_quarter.png
#################################################################
# CUSTOMIZAÇÃO
################################################################################
module MOG
#Valor do medidor de DASH.
$max_dash = 200
#Valor gasto do medidor de DASH.
DASH_DOWN = 3
#Valor do aumento do medidor de DASH.
DASH_UP = 1
#Velocidade para correr.
DASH_SPEED = 5
#Velocidade para caminhar.
NORMAL_SPEED = 4
#Tecla para o DASH.
BUTTON = Input::C
#SKIN da Janela.
DASH_SKIN = ""
#Trasparência da janela do DASH.
DASH_OPACITY = 0
#Posição da janela na horizontal.
POS_X = 0
#Posição da janela na vertical.
POS_Y = 0
#Som do medidor quando chegar a 100%
SE_PLAY = "032-Switch01"
#Porcentagem para apresentação do Dash em nÃÂvel baixo.
LOW = 20
#Nome do texto da janela do DASH.
DASH_NAME ="DASH"
#Swithe que desativa a janela do DASH
SWIT = 1
#Velocidade em que a janela de Move será
#atualizada.
ADVMOVREF = 4
#
################################################################################
# SPECIAL STATUS
################################################################################
# HASTE - Aumenta a Barra de Dash mais rápido.
# SLOW - Deixa o personagem lento.
# CONFUSE - Inverte os comandos de direções.
# DELAY - Drena o medidor de Dash.
# POISON - Causa dano consecutivo no personagem.
# CRAZY - O personagem se movimenta sozinho aleatoriamente.
# REGEN - Recupera o HP do personagem.
# FAST - Aumenta a velocidade do personagem.
################################################################################
# NOTA - Algumas condições anulam a outra(EX - Poison e Regen).
################################################################################
#Definição das ID de status que representarão as
#condições especiais de mapa.
HASTE = 18
SLOW = 19
CONFUSE = 20
DELAY = 21
POISON = 22
CRAZY = 23
REGEN = 24
FAST = 25
################################################################################
#Definição da duração de cada condição no mapa.
HASTE_TIME = 15
SLOW_TIME = 15
CONFUSE_TIME = 15
DELAY_TIME = 15
POISON_TIME = 15
CRAZY_TIME = 15
REGEN_TIME = 15
FAST_TIME = 15
################################################################################
#A condição HASTE multiplicará a velocidade por.
HASTE_UP = 3
#Velocidade reduzida ao estar na condição SLOW.
SLOW_SPEED = 2
#% de dano ao estar na condição POISON.
POISON_DAMAGE = 10
#% de HP recuperado ao estar na condição REGEN.
REGEN_RESTORE = 3
#A condição FAST aumentará velocidade por.
FAST_SPEED = 1
#
################################################################################
# SISTEMA DE LEVEL
################################################################################
#Ativar sistema de velocidade por Level ou parâmetro.
LEVEL = true
#-------------------------------------------
#Velocidade maxima para o DASH.
#(Útil para evitar exageros na velocidade.)
MAX_SPEED = 5
#-------------------------------------------
#Sistema de calculo será baseado no atributo.
# 0 = Level
# 1 = HP
# 2 = MP
# 3 = STR
# 4 = DEX
# 5 = AGL
# 6 = INT
# 7 = Passos
# 8 = Variável
# 9.. = Normal
LEVEL_SISTEMA = 0
#Definição da variável.
VARI = 5
#Calculo será baseado em :
#0 = Personagem ID 1.
#1 = Média do grupo.
ACTOR = 0
#--------------------------------------------#
#Calculo de ganho ao aumentar os parâmetros. #
#--------------------------------------------#
#LEVEL_CALCULO = Diminua este valor para que o
#personagem fique mais rápido.
#LEVEL_CALCULO2 = Aumente este valor para que o
#medidor de DASH fique maior(em pontos) o que resulta
#em um gasto menor do medidor de Dash.
#LEVEL CALCULO3 = Diminua este valor para aumentar
#a velocidade do medidor.
#-------------------------------------------------------------------------------
#Velocidade de movimento.
#(Parâmetro é dividido pelo valor abaixo)
LEVEL_CALCULO = 99
#Valor maximo do medidor de DASH.
#(Parâmetro é mutiplicado pelo valor abaixo)
LEVEL_CALCULO2 = 1
#Velocidade do aumento do medidor.
#(Parâmetro é dividido pelo valor abaixo)
LEVEL_CALCULO3 = 10
end
$dash = 0
$valor0 = 0
$slow = 0
$xrxs = {} if $xrxs == nil
$mogscript = {} if $mogscript == nil
$mogscript["adv_move"] = true
#-------------------------------------------------------------------------------
# Window Base
#-------------------------------------------------------------------------------
class Window_Base < Window
def dash(x,y)
val0 = $dash
val1 = $max_dash + $valor0
valor = 100 * val0 / val1
dash_back = RPG::Cache.picture("Dash_Bar")
cw = dash_back.width
ch = 17
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, dash_back, src_rect)
dash = RPG::Cache.picture("Dash_Bar")
cw = dash.width * $dash / val1
ch = 17
if valor <= MOG::LOW
src_rect = Rect.new(0, 17, cw, ch)
else
src_rect = Rect.new(0, 34, cw, ch)
end
self.contents.blt(x , y - ch, dash, src_rect)
self.contents.font.size = 13
self.contents.font.name = "Georgia"
self.contents.font.bold = true
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 1 , y - 36, 120, 32,MOG::DASH_NAME)
self.contents.font.color = Color.new(50,250,50,255)
self.contents.draw_text(x , y - 35, 120, 32,MOG::DASH_NAME)
self.contents.font.color = Color.new(0,0,0,255)
if valor >= 100
valor = 100
elsif valor < 0
valor = 0
end
self.contents.draw_text(x - 6, y - 29, 120, 32,valor.to_s + "%",2 )
if valor <= 0
r = rand(0) + 250
g = rand(200) + 50
b = rand(200) + 50
self.contents.font.color = Color.new(r,g,b,255)
elsif valor <= MOG::LOW
self.contents.font.color = Color.new(255,0,0,255)
elsif valor >= 100
r = rand(200) + 50
g = rand(200) + 50
b = rand(0) + 250
self.contents.font.color = Color.new(r,g,b,255)
else
self.contents.font.color = Color.new(50,250,250,255)
end
self.contents.draw_text(x - 5, y - 30, 120, 32,valor.to_s + "%",2 )
end
end
#-------------------------------------------------------------------------------
# Window Dash
#-------------------------------------------------------------------------------
class Window_Dash < Window_Base
def initialize
super(0, 0, 155, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = MOG::DASH_OPACITY
self.windowskin = RPG::Cache.windowskin(MOG::DASH_SKIN)
refresh
end
def refresh
self.contents.clear
dash(5,30)
end
end
#-------------------------------------------------------------------------------
#Scene Map
#-------------------------------------------------------------------------------
class Scene_Map
alias mog_dash_main main
def main
@dash_win = Window_Dash.new
@dash_win.x = MOG::POS_X
@dash_win.y = MOG::POS_Y
@re = 0
mog_dash_main
@dash_win.dispose
end
alias mog_dash_update update
def update
if $game_switches[MOG::SWIT] == true
@dash_win.visible = false
else
@dash_win.visible = true
end
@re += 1
if @re >= MOG::ADVMOVREF
@re = 0
end
if @re == 0
@dash_win.refresh
end
mog_dash_update
end
end
#-------------------------------------------------------------------------------
#Game Player
#-------------------------------------------------------------------------------
class Game_Player < Game_Character
@@poin = 0
def update
last_moving = moving?
for i in 0...$game_party.actors.size
actor = $game_party.actors
end
if actor.state?(MOG::CONFUSE)
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir8
when 1
move_right
move_up
when 2
move_up
when 3
move_up
move_left
when 4
move_right
when 6
move_left
when 7
move_down
move_right
when 8
move_down
when 9
move_left
move_down
end
end
elsif actor.state?(MOG::CRAZY)
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case rand(8)
when 1
move_right
move_up
when 2
move_up
when 3
move_up
move_left
when 4
move_right
when 5
move_left
when 6
move_down
move_right
when 7
move_down
when 8
move_left
move_down
end
end
else
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir8
when 1
move_left
move_down
when 2
move_down
when 3
move_down
move_right
when 4
move_left
when 6
move_right
when 7
move_up
move_left
when 8
move_up
when 9
move_right
move_up
end
end
end
last_real_x = @real_x
last_real_y = @real_y
super
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
$game_map.scroll_down(@real_y - last_real_y)
end
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
$game_map.scroll_left(last_real_x - @real_x)
end
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
$game_map.scroll_right(@real_x - last_real_x)
end
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
$game_map.scroll_up(last_real_y - @real_y)
end
unless moving?
if last_moving
result = check_event_trigger_here([1,2])
if result == false
unless $DEBUG and Input.press?(Input::CTRL)
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
if Input.trigger?(Input::C)
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
alias mog_dash_update update
def update
se_01 = $dash
se_02 = $max_dash + $valor0
se_03 = 100 * se_01 / se_02
if se_03 >= 100
se_03 = 100
@@poin += 1
end
if @@poin == 1
Audio.se_play("Audio/SE/" + MOG::SE_PLAY, 100, 100) rescue nil
end
if MOG::ACTOR == 0
actor = $game_party.actors[0]
else
for i in 0...$game_party.actors.size
actor = $game_party.actors
end
end
def img_dia_exist?(actor)
begin
RPG::Cache.character(actor.character_name.to_s + "_quarter", actor.character_hue)
rescue
return false
end
return true
end
def img_dia_dash_exist?(actor)
begin
RPG::Cache.character(actor.character_name.to_s + "_dash_quarter", actor.character_hue)
rescue
return false
end
return true
end
def img_exist?(actor)
begin
RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue)
rescue
return false
end
return true
end
if Input.press?(MOG::BUTTON) and se_03 > 0
case Input.dir8
when 1
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
when 2
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 3
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
when 4
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 6
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 7
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
when 8
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 9
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
end
else
case Input.dir8
when 1
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
when 2
@character_name = actor.character_name
when 3
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
when 4
@character_name = actor.character_name
when 6
@character_name = actor.character_name
when 7
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
when 8
@character_name = actor.character_name
when 9
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
end
end
if MOG::LEVEL_SISTEMA == 0
tipo = actor.level
elsif MOG::LEVEL_SISTEMA == 1
tipo = actor.maxhp
elsif MOG::LEVEL_SISTEMA == 2
tipo = actor.maxsp
elsif MOG::LEVEL_SISTEMA == 3
tipo = actor.str
elsif MOG::LEVEL_SISTEMA == 4
tipo = actor.dex
elsif MOG::LEVEL_SISTEMA == 5
tipo = actor.agi
elsif MOG::LEVEL_SISTEMA == 6
tipo = actor.int
elsif MOG::LEVEL_SISTEMA == 7
tipo = $game_party.steps
elsif MOG::LEVEL_SISTEMA == 8
tipo = $game_variables[MOG::VARI]
else
tipo = 0
end
if MOG::LEVEL == true
calculo = tipo * MOG::LEVEL_CALCULO2
$valor0 = calculo
else
$valor0 = 0
end
if $dash >= $max_dash + $valor0
$dash = $max_dash + $valor0
elsif $dash <= 0
$dash = 0
end
if MOG::LEVEL == true
valor1 = tipo / MOG::LEVEL_CALCULO
else
valor1 = 0
end
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing
if Input.press?(MOG::BUTTON)
@@poin = 0
if $dash >= 10
valor5 = MOG::DASH_SPEED + $valor0
if valor5 > MOG::MAX_SPEED
if actor.state?(MOG::SLOW)
@move_speed = MOG::MAX_SPEED - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::MAX_SPEED - $slow
end
else
if actor.state?(MOG::SLOW)
@move_speed = MOG::DASH_SPEED + valor1 - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::DASH_SPEED - $slow
end
end
$dash -= MOG::DASH_DOWN
else
$dash -= MOG::DASH_DOWN
for i in 0...$game_party.actors.size
actor = $game_party.actors
for i in 1...$data_states.size
state = $data_states
if actor.state?(MOG::SLOW)
@move_speed = MOG::NORMAL_SPEED - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::NORMAL_SPEED - $slow
end
end
end
end
else
if MOG::LEVEL == true
valor3 = tipo / MOG::LEVEL_CALCULO3
else
valor3 = 0
end
if actor.state?(MOG::DELAY)
$dash -= MOG::DASH_UP + valor3
@move_speed = MOG::NORMAL_SPEED - $slow
else
speed1 = MOG::DASH_UP + valor3
speed2 = (MOG::DASH_UP + valor3) * MOG::HASTE_UP
if actor.state?(MOG::HASTE)
$dash += speed2
else
$dash += speed1
end
@move_speed = MOG::NORMAL_SPEED - $slow
if actor.state?(MOG::SLOW)
@move_speed = MOG::NORMAL_SPEED - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::NORMAL_SPEED - $slow
end
end
end
end
mog_dash_update
end
end
##################
# Game_Character #
##################
class Game_Character
def move_random
case rand(8)
when 0
move_down(false)
when 1
move_left(false)
when 2
move_right(false)
when 3
move_up(false)
when 4
move_lower_left
when 5
move_lower_right
when 6
move_upper_left
when 7
move_upper_right
end
end
def move_toward_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx
if sx < 0 and sy > 0
move_upper_right
elsif sx > 0 and sy > 0
move_upper_left
elsif sx > 0 and sy < 0
move_lower_left
elsif sx < 0 and sy < 0
move_lower_right
elsif sx < 0
move_right
elsif sx > 0
move_left
elsif sy > 0
move_up
elsif sy < 0
move_down
end
end
end
def move_away_from_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx
if sx < 0 and sy > 0
move_lower_left
elsif sx > 0 and sy > 0
move_lower_right
elsif sx > 0 and sy < 0
move_upper_right
elsif sx < 0 and sy < 0
move_upper_left
elsif sx < 0
move_left
elsif sx > 0
move_right
elsif sy > 0
move_down
elsif sy < 0
move_up
end
end
end
end
end
############
#Game_Actor#
############
class Game_System
include MOG
attr_accessor :states_haste
attr_accessor :states_slow
attr_accessor :states_confuse
attr_accessor :states_delay
attr_accessor :states_poison
attr_accessor :states_crazy
attr_accessor :states_regen
attr_accessor :states_fast
alias mog_advmove_initialize initialize
def initialize
mog_advmove_initialize
@states_haste = 40 * HASTE_TIME
@states_slow = 40 * SLOW_TIME
@states_confuse = 40 * CONFUSE_TIME
@states_delay = 40 * DELAY_TIME
@states_poison = 40 * POISON_TIME
@states_crazy = 40 * CRAZY_TIME
@states_regen = 40 * REGEN_TIME
@states_fast = 40 * FAST_TIME
end
end
#############
# Scene_Map #
#############
class Scene_Map
include MOG
alias mog_advmovmain main
def main
@status_ref = 0
mog_advmovmain
end
alias mog_advmove_update update
def update
mog_advmove_update
if $xrxs["xas"] == true
for i in 0...$game_party.actors.size
actor = $game_party.actors
end
if XAS_BA::AUTOGAMEOVER == true and $game_party.all_dead?
$scene = Scene_Gameover.new rescue nil
end
end
@status_ref += 1
if @status_ref >= 30
@status_ref = 0
end
for i in 0...$game_party.actors.size
actor = $game_party.actors
for i in 1...$data_states.size
state = $data_states
if actor.state?(i) == true
if actor.state?(MOG::HASTE)
$game_system.states_haste -= 1
end
if actor.state?(MOG::SLOW)
$game_system.states_slow -= 1
end
if actor.state?(MOG::CONFUSE)
$game_system.states_confuse -= 1
end
if actor.state?(MOG::DELAY)
$game_system.states_delay -= 1
end
if actor.state?(MOG::POISON)
$game_system.states_poison -= 1
end
if actor.state?(MOG::CRAZY)
$game_system.states_crazy -= 1
end
if actor.state?(MOG::REGEN)
$game_system.states_regen -= 1
end
if actor.state?(MOG::FAST)
$game_system.states_fast -= 1
end
if actor.state?(MOG::REGEN) == true and @status_ref == 0
damage = -(actor.maxhp * MOG::REGEN_RESTORE / 100)
actor.hp -= damage
if $xrxs["xas"] == true
$game_player.battler.damage = damage
$game_player.battler.damage_pop = true
end
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
elsif actor.state?(MOG::POISON) == true and @status_ref == 0
damage = actor.maxhp * MOG::POISON_DAMAGE / 100
if actor.hp > damage
actor.hp -= damage
if $xrxs["xas"] == true
$game_player.battler.damage = damage
$game_player.battler.damage_pop = true
end
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
end
end
if $game_system.states_haste <= 0
actor.remove_state(HASTE)
$game_system.states_haste = 40 * HASTE_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_slow <= 0
actor.remove_state(SLOW)
$game_system.states_slow = 40 * SLOW_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_confuse <= 0
actor.remove_state(CONFUSE)
$game_system.states_confuse = 40 * CONFUSE_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_delay <= 0
actor.remove_state(DELAY)
$game_system.states_delay = 40 * DELAY_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_poison <= 0
actor.remove_state(POISON)
$game_system.states_poison = 40 * POISON_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_crazy <= 0
actor.remove_state(CRAZY)
$game_system.states_crazy = 40 * CRAZY_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_regen <= 0
actor.remove_state(REGEN)
$game_system.states_regen = 40 * REGEN_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_fast <= 0
actor.remove_state(FAST)
$game_system.states_fast = 40 * FAST_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
end
end
end
end
##############
# Game_Party #
##############
class Game_Party
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
actor.hp -= [actor.maxhp / 100, 1].max
valor = [actor.maxhp / 100, 1].max
if $xrxs["xas"] == true
$game_player.battler.damage = valor
$game_player.battler.damage_pop = true
end
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
$game_temp.gameover = $game_party.all_dead?
end
end
end
end
#_______________________________________________________________________________
# MOG_Advanced Move System V2.0
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
#Adiciona o sistema avançado de movimento.
#Será necessário ter a picture "Dash_Bar" dentro da pasta
#pictures.
#######################OPCIONAL################################
#Apresenta uma animação diferente para cada fase de movimento.
#Para ter a animação do Char correndo será necessário
#ter o arquivo imagem "Nome_do_char_DASH.png"
#Para ter a animação do Char na diagonal será necessário
#ter o arquivo imagem "Nome_do_char_quarter.png"
#Para ter a animação do Char na diagonal e correndo será
#necessário ter o arquivo imagem "Nome_do_char_dash_quarter.png"
#Exemplo
#Nome do CHAR = 001-Fighter01.png
#001-Fighter01_dash.png
#001-Fighter01_quarter.png
#001-Fighter01_dash_quarter.png
#################################################################
# CUSTOMIZAÇÃO
################################################################################
module MOG
#Valor do medidor de DASH.
$max_dash = 200
#Valor gasto do medidor de DASH.
DASH_DOWN = 3
#Valor do aumento do medidor de DASH.
DASH_UP = 1
#Velocidade para correr.
DASH_SPEED = 5
#Velocidade para caminhar.
NORMAL_SPEED = 4
#Tecla para o DASH.
BUTTON = Input::C
#SKIN da Janela.
DASH_SKIN = ""
#Trasparência da janela do DASH.
DASH_OPACITY = 0
#Posição da janela na horizontal.
POS_X = 0
#Posição da janela na vertical.
POS_Y = 0
#Som do medidor quando chegar a 100%
SE_PLAY = "032-Switch01"
#Porcentagem para apresentação do Dash em nÃÂvel baixo.
LOW = 20
#Nome do texto da janela do DASH.
DASH_NAME ="DASH"
#Swithe que desativa a janela do DASH
SWIT = 1
#Velocidade em que a janela de Move será
#atualizada.
ADVMOVREF = 4
#
################################################################################
# SPECIAL STATUS
################################################################################
# HASTE - Aumenta a Barra de Dash mais rápido.
# SLOW - Deixa o personagem lento.
# CONFUSE - Inverte os comandos de direções.
# DELAY - Drena o medidor de Dash.
# POISON - Causa dano consecutivo no personagem.
# CRAZY - O personagem se movimenta sozinho aleatoriamente.
# REGEN - Recupera o HP do personagem.
# FAST - Aumenta a velocidade do personagem.
################################################################################
# NOTA - Algumas condições anulam a outra(EX - Poison e Regen).
################################################################################
#Definição das ID de status que representarão as
#condições especiais de mapa.
HASTE = 18
SLOW = 19
CONFUSE = 20
DELAY = 21
POISON = 22
CRAZY = 23
REGEN = 24
FAST = 25
################################################################################
#Definição da duração de cada condição no mapa.
HASTE_TIME = 15
SLOW_TIME = 15
CONFUSE_TIME = 15
DELAY_TIME = 15
POISON_TIME = 15
CRAZY_TIME = 15
REGEN_TIME = 15
FAST_TIME = 15
################################################################################
#A condição HASTE multiplicará a velocidade por.
HASTE_UP = 3
#Velocidade reduzida ao estar na condição SLOW.
SLOW_SPEED = 2
#% de dano ao estar na condição POISON.
POISON_DAMAGE = 10
#% de HP recuperado ao estar na condição REGEN.
REGEN_RESTORE = 3
#A condição FAST aumentará velocidade por.
FAST_SPEED = 1
#
################################################################################
# SISTEMA DE LEVEL
################################################################################
#Ativar sistema de velocidade por Level ou parâmetro.
LEVEL = true
#-------------------------------------------
#Velocidade maxima para o DASH.
#(Útil para evitar exageros na velocidade.)
MAX_SPEED = 5
#-------------------------------------------
#Sistema de calculo será baseado no atributo.
# 0 = Level
# 1 = HP
# 2 = MP
# 3 = STR
# 4 = DEX
# 5 = AGL
# 6 = INT
# 7 = Passos
# 8 = Variável
# 9.. = Normal
LEVEL_SISTEMA = 0
#Definição da variável.
VARI = 5
#Calculo será baseado em :
#0 = Personagem ID 1.
#1 = Média do grupo.
ACTOR = 0
#--------------------------------------------#
#Calculo de ganho ao aumentar os parâmetros. #
#--------------------------------------------#
#LEVEL_CALCULO = Diminua este valor para que o
#personagem fique mais rápido.
#LEVEL_CALCULO2 = Aumente este valor para que o
#medidor de DASH fique maior(em pontos) o que resulta
#em um gasto menor do medidor de Dash.
#LEVEL CALCULO3 = Diminua este valor para aumentar
#a velocidade do medidor.
#-------------------------------------------------------------------------------
#Velocidade de movimento.
#(Parâmetro é dividido pelo valor abaixo)
LEVEL_CALCULO = 99
#Valor maximo do medidor de DASH.
#(Parâmetro é mutiplicado pelo valor abaixo)
LEVEL_CALCULO2 = 1
#Velocidade do aumento do medidor.
#(Parâmetro é dividido pelo valor abaixo)
LEVEL_CALCULO3 = 10
end
$dash = 0
$valor0 = 0
$slow = 0
$xrxs = {} if $xrxs == nil
$mogscript = {} if $mogscript == nil
$mogscript["adv_move"] = true
#-------------------------------------------------------------------------------
# Window Base
#-------------------------------------------------------------------------------
class Window_Base < Window
def dash(x,y)
val0 = $dash
val1 = $max_dash + $valor0
valor = 100 * val0 / val1
dash_back = RPG::Cache.picture("Dash_Bar")
cw = dash_back.width
ch = 17
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, dash_back, src_rect)
dash = RPG::Cache.picture("Dash_Bar")
cw = dash.width * $dash / val1
ch = 17
if valor <= MOG::LOW
src_rect = Rect.new(0, 17, cw, ch)
else
src_rect = Rect.new(0, 34, cw, ch)
end
self.contents.blt(x , y - ch, dash, src_rect)
self.contents.font.size = 13
self.contents.font.name = "Georgia"
self.contents.font.bold = true
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 1 , y - 36, 120, 32,MOG::DASH_NAME)
self.contents.font.color = Color.new(50,250,50,255)
self.contents.draw_text(x , y - 35, 120, 32,MOG::DASH_NAME)
self.contents.font.color = Color.new(0,0,0,255)
if valor >= 100
valor = 100
elsif valor < 0
valor = 0
end
self.contents.draw_text(x - 6, y - 29, 120, 32,valor.to_s + "%",2 )
if valor <= 0
r = rand(0) + 250
g = rand(200) + 50
b = rand(200) + 50
self.contents.font.color = Color.new(r,g,b,255)
elsif valor <= MOG::LOW
self.contents.font.color = Color.new(255,0,0,255)
elsif valor >= 100
r = rand(200) + 50
g = rand(200) + 50
b = rand(0) + 250
self.contents.font.color = Color.new(r,g,b,255)
else
self.contents.font.color = Color.new(50,250,250,255)
end
self.contents.draw_text(x - 5, y - 30, 120, 32,valor.to_s + "%",2 )
end
end
#-------------------------------------------------------------------------------
# Window Dash
#-------------------------------------------------------------------------------
class Window_Dash < Window_Base
def initialize
super(0, 0, 155, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = MOG::DASH_OPACITY
self.windowskin = RPG::Cache.windowskin(MOG::DASH_SKIN)
refresh
end
def refresh
self.contents.clear
dash(5,30)
end
end
#-------------------------------------------------------------------------------
#Scene Map
#-------------------------------------------------------------------------------
class Scene_Map
alias mog_dash_main main
def main
@dash_win = Window_Dash.new
@dash_win.x = MOG::POS_X
@dash_win.y = MOG::POS_Y
@re = 0
mog_dash_main
@dash_win.dispose
end
alias mog_dash_update update
def update
if $game_switches[MOG::SWIT] == true
@dash_win.visible = false
else
@dash_win.visible = true
end
@re += 1
if @re >= MOG::ADVMOVREF
@re = 0
end
if @re == 0
@dash_win.refresh
end
mog_dash_update
end
end
#-------------------------------------------------------------------------------
#Game Player
#-------------------------------------------------------------------------------
class Game_Player < Game_Character
@@poin = 0
def update
last_moving = moving?
for i in 0...$game_party.actors.size
actor = $game_party.actors
end
if actor.state?(MOG::CONFUSE)
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir8
when 1
move_right
move_up
when 2
move_up
when 3
move_up
move_left
when 4
move_right
when 6
move_left
when 7
move_down
move_right
when 8
move_down
when 9
move_left
move_down
end
end
elsif actor.state?(MOG::CRAZY)
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case rand(8)
when 1
move_right
move_up
when 2
move_up
when 3
move_up
move_left
when 4
move_right
when 5
move_left
when 6
move_down
move_right
when 7
move_down
when 8
move_left
move_down
end
end
else
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir8
when 1
move_left
move_down
when 2
move_down
when 3
move_down
move_right
when 4
move_left
when 6
move_right
when 7
move_up
move_left
when 8
move_up
when 9
move_right
move_up
end
end
end
last_real_x = @real_x
last_real_y = @real_y
super
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
$game_map.scroll_down(@real_y - last_real_y)
end
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
$game_map.scroll_left(last_real_x - @real_x)
end
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
$game_map.scroll_right(@real_x - last_real_x)
end
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
$game_map.scroll_up(last_real_y - @real_y)
end
unless moving?
if last_moving
result = check_event_trigger_here([1,2])
if result == false
unless $DEBUG and Input.press?(Input::CTRL)
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
if Input.trigger?(Input::C)
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
alias mog_dash_update update
def update
se_01 = $dash
se_02 = $max_dash + $valor0
se_03 = 100 * se_01 / se_02
if se_03 >= 100
se_03 = 100
@@poin += 1
end
if @@poin == 1
Audio.se_play("Audio/SE/" + MOG::SE_PLAY, 100, 100) rescue nil
end
if MOG::ACTOR == 0
actor = $game_party.actors[0]
else
for i in 0...$game_party.actors.size
actor = $game_party.actors
end
end
def img_dia_exist?(actor)
begin
RPG::Cache.character(actor.character_name.to_s + "_quarter", actor.character_hue)
rescue
return false
end
return true
end
def img_dia_dash_exist?(actor)
begin
RPG::Cache.character(actor.character_name.to_s + "_dash_quarter", actor.character_hue)
rescue
return false
end
return true
end
def img_exist?(actor)
begin
RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue)
rescue
return false
end
return true
end
if Input.press?(MOG::BUTTON) and se_03 > 0
case Input.dir8
when 1
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
when 2
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 3
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
when 4
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 6
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 7
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
when 8
if img_exist?(actor)
@character_name = actor.character_name + "_dash"
end
when 9
if img_dia_dash_exist?(actor)
@character_name = actor.character_name + "_dash_quarter"
end
end
else
case Input.dir8
when 1
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
when 2
@character_name = actor.character_name
when 3
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
when 4
@character_name = actor.character_name
when 6
@character_name = actor.character_name
when 7
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
when 8
@character_name = actor.character_name
when 9
if img_dia_exist?(actor)
@character_name = actor.character_name + "_quarter"
end
end
end
if MOG::LEVEL_SISTEMA == 0
tipo = actor.level
elsif MOG::LEVEL_SISTEMA == 1
tipo = actor.maxhp
elsif MOG::LEVEL_SISTEMA == 2
tipo = actor.maxsp
elsif MOG::LEVEL_SISTEMA == 3
tipo = actor.str
elsif MOG::LEVEL_SISTEMA == 4
tipo = actor.dex
elsif MOG::LEVEL_SISTEMA == 5
tipo = actor.agi
elsif MOG::LEVEL_SISTEMA == 6
tipo = actor.int
elsif MOG::LEVEL_SISTEMA == 7
tipo = $game_party.steps
elsif MOG::LEVEL_SISTEMA == 8
tipo = $game_variables[MOG::VARI]
else
tipo = 0
end
if MOG::LEVEL == true
calculo = tipo * MOG::LEVEL_CALCULO2
$valor0 = calculo
else
$valor0 = 0
end
if $dash >= $max_dash + $valor0
$dash = $max_dash + $valor0
elsif $dash <= 0
$dash = 0
end
if MOG::LEVEL == true
valor1 = tipo / MOG::LEVEL_CALCULO
else
valor1 = 0
end
unless $game_system.map_interpreter.running? or
$game_temp.message_window_showing
if Input.press?(MOG::BUTTON)
@@poin = 0
if $dash >= 10
valor5 = MOG::DASH_SPEED + $valor0
if valor5 > MOG::MAX_SPEED
if actor.state?(MOG::SLOW)
@move_speed = MOG::MAX_SPEED - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::MAX_SPEED - $slow
end
else
if actor.state?(MOG::SLOW)
@move_speed = MOG::DASH_SPEED + valor1 - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::DASH_SPEED - $slow
end
end
$dash -= MOG::DASH_DOWN
else
$dash -= MOG::DASH_DOWN
for i in 0...$game_party.actors.size
actor = $game_party.actors
for i in 1...$data_states.size
state = $data_states
if actor.state?(MOG::SLOW)
@move_speed = MOG::NORMAL_SPEED - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::NORMAL_SPEED - $slow
end
end
end
end
else
if MOG::LEVEL == true
valor3 = tipo / MOG::LEVEL_CALCULO3
else
valor3 = 0
end
if actor.state?(MOG::DELAY)
$dash -= MOG::DASH_UP + valor3
@move_speed = MOG::NORMAL_SPEED - $slow
else
speed1 = MOG::DASH_UP + valor3
speed2 = (MOG::DASH_UP + valor3) * MOG::HASTE_UP
if actor.state?(MOG::HASTE)
$dash += speed2
else
$dash += speed1
end
@move_speed = MOG::NORMAL_SPEED - $slow
if actor.state?(MOG::SLOW)
@move_speed = MOG::NORMAL_SPEED - MOG::SLOW_SPEED - $slow
elsif actor.state?(MOG::FAST)
@move_speed = MOG::NORMAL_SPEED + MOG::FAST_SPEED - $slow
else
@move_speed = MOG::NORMAL_SPEED - $slow
end
end
end
end
mog_dash_update
end
end
##################
# Game_Character #
##################
class Game_Character
def move_random
case rand(8)
when 0
move_down(false)
when 1
move_left(false)
when 2
move_right(false)
when 3
move_up(false)
when 4
move_lower_left
when 5
move_lower_right
when 6
move_upper_left
when 7
move_upper_right
end
end
def move_toward_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx
if sx < 0 and sy > 0
move_upper_right
elsif sx > 0 and sy > 0
move_upper_left
elsif sx > 0 and sy < 0
move_lower_left
elsif sx < 0 and sy < 0
move_lower_right
elsif sx < 0
move_right
elsif sx > 0
move_left
elsif sy > 0
move_up
elsif sy < 0
move_down
end
end
end
def move_away_from_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx
if sx < 0 and sy > 0
move_lower_left
elsif sx > 0 and sy > 0
move_lower_right
elsif sx > 0 and sy < 0
move_upper_right
elsif sx < 0 and sy < 0
move_upper_left
elsif sx < 0
move_left
elsif sx > 0
move_right
elsif sy > 0
move_down
elsif sy < 0
move_up
end
end
end
end
end
############
#Game_Actor#
############
class Game_System
include MOG
attr_accessor :states_haste
attr_accessor :states_slow
attr_accessor :states_confuse
attr_accessor :states_delay
attr_accessor :states_poison
attr_accessor :states_crazy
attr_accessor :states_regen
attr_accessor :states_fast
alias mog_advmove_initialize initialize
def initialize
mog_advmove_initialize
@states_haste = 40 * HASTE_TIME
@states_slow = 40 * SLOW_TIME
@states_confuse = 40 * CONFUSE_TIME
@states_delay = 40 * DELAY_TIME
@states_poison = 40 * POISON_TIME
@states_crazy = 40 * CRAZY_TIME
@states_regen = 40 * REGEN_TIME
@states_fast = 40 * FAST_TIME
end
end
#############
# Scene_Map #
#############
class Scene_Map
include MOG
alias mog_advmovmain main
def main
@status_ref = 0
mog_advmovmain
end
alias mog_advmove_update update
def update
mog_advmove_update
if $xrxs["xas"] == true
for i in 0...$game_party.actors.size
actor = $game_party.actors
end
if XAS_BA::AUTOGAMEOVER == true and $game_party.all_dead?
$scene = Scene_Gameover.new rescue nil
end
end
@status_ref += 1
if @status_ref >= 30
@status_ref = 0
end
for i in 0...$game_party.actors.size
actor = $game_party.actors
for i in 1...$data_states.size
state = $data_states
if actor.state?(i) == true
if actor.state?(MOG::HASTE)
$game_system.states_haste -= 1
end
if actor.state?(MOG::SLOW)
$game_system.states_slow -= 1
end
if actor.state?(MOG::CONFUSE)
$game_system.states_confuse -= 1
end
if actor.state?(MOG::DELAY)
$game_system.states_delay -= 1
end
if actor.state?(MOG::POISON)
$game_system.states_poison -= 1
end
if actor.state?(MOG::CRAZY)
$game_system.states_crazy -= 1
end
if actor.state?(MOG::REGEN)
$game_system.states_regen -= 1
end
if actor.state?(MOG::FAST)
$game_system.states_fast -= 1
end
if actor.state?(MOG::REGEN) == true and @status_ref == 0
damage = -(actor.maxhp * MOG::REGEN_RESTORE / 100)
actor.hp -= damage
if $xrxs["xas"] == true
$game_player.battler.damage = damage
$game_player.battler.damage_pop = true
end
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
elsif actor.state?(MOG::POISON) == true and @status_ref == 0
damage = actor.maxhp * MOG::POISON_DAMAGE / 100
if actor.hp > damage
actor.hp -= damage
if $xrxs["xas"] == true
$game_player.battler.damage = damage
$game_player.battler.damage_pop = true
end
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
end
end
if $game_system.states_haste <= 0
actor.remove_state(HASTE)
$game_system.states_haste = 40 * HASTE_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_slow <= 0
actor.remove_state(SLOW)
$game_system.states_slow = 40 * SLOW_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_confuse <= 0
actor.remove_state(CONFUSE)
$game_system.states_confuse = 40 * CONFUSE_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_delay <= 0
actor.remove_state(DELAY)
$game_system.states_delay = 40 * DELAY_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_poison <= 0
actor.remove_state(POISON)
$game_system.states_poison = 40 * POISON_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_crazy <= 0
actor.remove_state(CRAZY)
$game_system.states_crazy = 40 * CRAZY_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_regen <= 0
actor.remove_state(REGEN)
$game_system.states_regen = 40 * REGEN_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
if $game_system.states_fast <= 0
actor.remove_state(FAST)
$game_system.states_fast = 40 * FAST_TIME
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
end
end
end
end
end
##############
# Game_Party #
##############
class Game_Party
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
actor.hp -= [actor.maxhp / 100, 1].max
valor = [actor.maxhp / 100, 1].max
if $xrxs["xas"] == true
$game_player.battler.damage = valor
$game_player.battler.damage_pop = true
end
if $mogscript["mpstelen"] == true
$game_player.wref = true
end
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
$game_temp.gameover = $game_party.all_dead?
end
end
end
end
Is there a way to make a switch or call script to turn off this script?
When I use the switch in the script it just turns off the Image of the Dash Bar, but you can still dash and run, you just don't see the bar.
How can I totally turn it off (not just the dash bar image)?