[RMXP] Modulo Drimer-Core
Sept 16, 2014 19:04:13 GMT -4
Post por Drimer en Sept 16, 2014 19:04:13 GMT -4
Módulo utilizado para todos mis scripts, está en constante actualización.
Si tienen error respecto a la mega-evolución basta con buscar #=begin & #=end y quitarles el # del inicio.
Script:
Si tienen error respecto a la mega-evolución basta con buscar #=begin & #=end y quitarles el # del inicio.
Script:
($imported ||= {})["DRIMER-CORE"] = true
$core_data = {}
#============================================================================#
# ** Consola de Depuración
#============================================================================#
if $DEBUG || $TEST
Win32API.new('kernel32', 'AllocConsole', 'V', 'L').call
$stdout.reopen('CONOUT$')
ini = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')
title = "\0" * 256
ini.call('Game', 'Title', '', title, 256, '.\\Game.ini')
title.delete!("\0")
hwnd = Win32API.new('user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', title)
Win32API.new('user32', 'SetForegroundWindow', 'L', 'L').call(hwnd)
Win32API.new('kernel32','SetConsoleTitleA','P','S').call("#{title} : Debug Console")
puts ('=' * 75, Time.now, '=' * 75, "\n")
puts "Consola creada correctamente.\n"
end
#============================================================================#
# ** Guardado de datos # No tocar
#============================================================================#
def coreDump
file = File.open("CoreCheck.dat", "wb")
for i in $core_data
Marshal.dump(i, file)
end
file.close
end
puts "Modulo DRIMER-CORE cargado con exito.\n"
#==============================================================================#
# ** Mega-Aviso
#==============================================================================#
msg = "Recuerda que para ""instalar"" las megaevoluciones\n" +
"de este modulo en el sistema debes colocar >load_megas<\n" +
"al final del script de formas alternas."
$core_data["mega"] = true
puts msg if $DEBUG && !File::exists?("CoreCheck.dat")
coreDump
#==============================================================================#
# ** Error Handler
#==============================================================================#
unless $imported["VARS-CORE"]
msg = "El sistema requiere de las variables para ejecutarse.\n" +
"Puede jugar, pero llegado el punto en que sean requeridas\n" +
"el sistema colapsará."
puts msg
$core_data["vars-core"] = false
coreDump
end
unless $imported["WIN32API"]
msg = "El sistema requiere la class >>Win32API<< para\n" +
"que el sistema de Mouse funcione correctamente."
puts msg
$core_data["win32api"] = true
coreDump
end
unless $imported["ADV-KEYS"]
msg = "El sistema requiere el sistema de control\n" +
"avanzado para funcionar correctamente."
puts msg
$core_data["adv-keys"] = false
coreDump
end
unless $imported["GEN-VOCAB"]
msg = "El sistema requiere del módulo de vocabulario\n" +
"para funcionar correctamente."
puts msg
$core_data["gen-vocab"] = false
coreDump
end
#==============================================================================#
# ** System
#==============================================================================#
module Core
SAVE_MAX = 16 [HASH]No Editar
SAVE_FILE_VIS = 4 [HASH]No Editar
module Colores
Blanco = Color.new(255,255,255)
Rojo = Color.new(255,150,150)
Verde = Color.new(150,255,150)
Azul = Color.new(150,150,255)
Amarillo = Color.new(225,225,20)
Alfa = Color.new(0,0,0,128)
end
module Messages
WINDOW_VAR = [31,32,33,34,35,36,37,38,39,40,41,42,43,44]
WINDOW_ANIMATE = [15, 15]
NAME = [["Verdana", "Anklada"], 14, Color.new(255,225,235,225), true, true]
SE = [2, "Decision1", 60, 150]
ANIM_FACE = [true, :fade, 12, 8]
ANIM_NAME = [true, :fade, 12, 8]
module Net
module NetworkMessages
$NetMsg = {}
$NetMsg["start"] = "Conectando a la CWF de #{GAMENAME}"
$NetMsg["offline"] = "El sistema no es accesible en este momento."
$NetMsg["update"] = "1 actualización disponible"
$NetMsg["full"] = "El servidor está lleno."
$NetMsg["success"] = "¡Bienvenido a la CWF de #{GAMENAME}"
$NetMsg["out"] = "Has sido desconectado: "
$NetMsg["fcgen"] = "Generando codigo de amigo"
$NetMsg["fcsearch"] = "Buscando un Codigo de Amigo disponible"
end
module BattleMessages
$BattleMsg = {}
$BattleMsg["nexist"] ="El Codigo de Amigo no está registrado."
$BattleMsg["serv-issue"] = "Hay un error en el servidor en este momento."
$BattleMsg["ban"] = "Tu cuenta ha sido baneada"
$BattleMsg["ip-ban"] = "Tu IP ha sido baneada"
$BattleMsg["success"] = "¡Bienvenido a la CWF de #{GAMENAME}!"
$BattleMsg["online-issue"] = "Tienes una conexión activa"
end
end
end
#============================================================================#
# ** Reloj Básico
#============================================================================#
module HourBased
def getHora
@hora = Time.now
case @hora.hour
when 1..12
case @hora.min
when 0..9
@hora1 = @hora.hour.to_s + ":" + "0"+@hora.min.to_s + " a.m"
else
@hora1 = @hora.hour.to_s + ":" + @hora.min.to_s + " a.m"
end
when 13..24
case @hora.min
when 0..9
@hora1 = (@hora.hour-12).to_s + ":" + "0"+@hora.min.to_s + " p.m"
else
@hora1 = (@hora.hour-12).to_s + ":" + @hora.min.to_s + " p.m"
end
end
$hora = @hora1
return $hora
end
def getHora_2
@hora = Time.now
case @hora.hour
when 1..12
@hora1 = @hora.hour.to_s + ":" + @hora.min.to_s + " a.m"
when 13..24
@hora1 = (@hora.hour-12).to_s + ":" + @hora.min.to_s + " p.m"
end
$hora1 = @hora1
return $hora1
end
def checkHora
if $hora!=$hora1
return true
end
end
def reloj
getHora
if checkHora
[HASH]Instrucción
end
getHora_2
end
end
end
#==========================================================================#
# ** Mouse Support
#==========================================================================#
module Mouse
gsm = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
@GetCursorPos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
@SetCapture = Win32API.new('user32', 'SetCapture', 'p', 'i')
@ReleaseCapture = Win32API.new('user32', 'ReleaseCapture', '', 'i')
module_function
def getMouseGlobalPos
pos = [0, 0].pack('ll')
if @GetCursorPos.call(pos) != 0
return pos.unpack('ll')
else
return nil
end
end
def screen_to_client(x, y)
return nil unless x and y
screenToClient = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
pos = [x, y].pack('ll')
if screenToClient.call(Win32API.pbFindRgssWindow, pos) != 0
return pos.unpack('ll')
else
return nil
end
end
def setCapture
@SetCapture.call(Win32API.pbFindRgssWindow)
end
def releaseCapture
@ReleaseCapture.call
end
# Returns the position of the mouse relative to the game window.
def getMousePos(catch_anywhere = false)
resizeFactor=($ResizeFactor) ? $ResizeFactor : 1
x, y = screen_to_client(*getMouseGlobalPos)
width, height = Win32API.client_size
if catch_anywhere or (x >= 0 and y >= 0 and x < width and y < height)
return (x/resizeFactor).to_i, (y/resizeFactor).to_i
else
return nil
end
end
def del
if @oldcursor == nil
return
else
@SetClassLong.call(Win32API.pbFindRgssWindow,-12, @oldcursor)
@oldcursor = nil
end
end
end
class Game_Mouse
def initialize
@mouse=Mouse
@position=@mouse.getMousePos
if @position==nil
@x=0
@y=0
else
@x=@position[0]
@y=@position[1]
end
end
def x
return @x
end
def y
return @y
end
def update
@position=@mouse.getMousePos
if @position==nil
@x=0
@y=0
else
@x=@position[0]
@y=@position[1]
end
end
def visible
end
def invisible
end
end
#==========================================================================#
# ** Devuelve verdadero al presionar una tecla o botón del Mouse
#==========================================================================#
def pbPressAnyKey
if (Input.trigger?(Input::C) || Input.trigger?(Input::B) ||
Input.trigger?(Input::Z) || Input.trigger?(Input::SHIFT) ||
Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT))
return true
end
end
def pbPressAnyMouse
if (Input.pressed(Input::Mouse_Left) || Input.pressed(Input::Mouse_Right))
return true
end
end
#==========================================================================#
# ** Soporte para mouse
#==========================================================================#
def pbMouseOver?(image,width=-1,height=-1)
width=image.bitmap.width if width==-1
height=image.bitmap.height if height==-1
if $mouse.x >= image.x && $mouse.x <= (image.x + width) and
$mouse.y >= image.y && $mouse.y <= (image.y + height)
return true
else
return false
end
end
#-------------------------------
def pbMouseOverBattle?(image,width=-1,height=-1)
width=image.bitmap.width if width==-1
height=image.bitmap.height if height==-1
if $mouse.x >= image.x && $mouse.x <= (image.x + width) and
$mouse.y >= 410+image.y && $mouse.y <= (410+image.y + height)
return true
else
return false
end
end
def pbBattleClick?(image,width=-1,height=-1)
width=image.bitmap.width if width==-1
height=image.bitmap.height if height==-1
if $mouse.x >= image.x && $mouse.x <= (image.x + width) and
$mouse.y >= 410+image.y && $mouse.y <= (410+image.y + height) &&
Input.pressed(Input::Mouse_Left)
return true
else
return false
end
end
#-------------------------------
def pbMouseInArea?(x,y,width,height)
if $mouse.x >= x && $mouse.x <= (x + width) and $mouse.y >= y &&
$mouse.y <= (y + height)
return true
else
return false
end
end
def pbMouseInAreaLeft?(x,y,width,height)
if $mouse.x >= x && $mouse.x <= (x + width) and $mouse.y >= y &&
$mouse.y <= (y + height) && Input.pressed(Input::Mouse_Left)
return true
else
return false
end
end
def pbMouseInAreaRight?(x,y,width,height)
if $mouse.x >= x && $mouse.x <= (x + width) and $mouse.y >= y &&
$mouse.y <= (y + height) && Input.pressed(Input::Mouse_Right)
return true
else
return false
end
end
def pbMouseOverImage?(image,width=-1,height=-1)
width=image.bitmap.width if width==-1
height=image.bitmap.height if height==-1
if $mouse.x >= image.x && $mouse.x <= (image.x + width) &&
$mouse.y >= image.y && $mouse.y <= (image.y + height)
return true
else
return false
end
end
def pbMouseLeftClick?(image,width=-1,height=-1)
width=image.bitmap.width if width==-1
height=image.bitmap.height if height==-1
if $mouse.x >= image.x && $mouse.x <= (image.x + width) and
$mouse.y >= image.y && $mouse.y <= (image.y + height) &&
Input.pressed(Input::Mouse_Left)
return true
else
return false
end
end
def pbMouseRightClick?(image,width=-1,height=-1)
width=image.bitmap.width if width==-1
height=image.bitmap.height if height==-1
if $mouse.x >= image.x && $mouse.x <= (image.x + width) and
$mouse.y >= image.y && $mouse.y <= (image.y + height) &&
Input.pressed(Input::Mouse_Right)
return true
else
return false
end
end
#==============================================================================#
# ** Genera un Icono de la carpeta Characters.
#==============================================================================#
def pbMostrarIcon(image, xvalue, yvalue, zvalue)
z_base = 100
@res = {}
@res["#{image}"] = IconSprite.new(64,64,@viewport)
@res["#{image}"].setBitmap("Graphics/Characters/" + "#{image}")
@res["#{image}"].x = xvalue
@res["#{image}"].y = yvalue
@res["#{image}"].z = z_base + zvalue
charwidth=@res["#{image}"].bitmap.width
charheight=@res["#{image}"].bitmap.height
@res["#{image}"].src_rect = Rect.new(0,0,charwidth/4,charheight/4)
end
#==============================================================================#
# ** Soporte para imagenes improvisadas
#==============================================================================#
def pbMostrarImagen(image, frames, zvalue, xvalue, yvalue)
@sprites = {}
@sprites["#{image}"] = Sprite.new
@sprites["#{image}"].bitmap = RPG::Cache.picture(image)
@sprites["#{image}"].z = zvalue
@sprites["#{image}"].x = xvalue
@sprites["#{image}"].y = yvalue
if frames > 0
@sprites["#{image}"].opacity = frames
else
@sprites["#{image}"].opacity = 255
end
loop do
Graphics.update
@sprites["#{image}"].opacity += frames if frames > 0 || frames != nil
break if @sprites["#{image}"].opacity == 255 ||
@sprites["#{image}"].opacity > 255
end
end
#==============================================================================#
# ** Soporte para imagenes improvisadas con ID
#==============================================================================#
def pbMostrarBoton(id, image, frames, zvalue, xvalue, yvalue)
@sprites = {}
@sprites["#{id}"] = Sprite.new
@sprites["#{id}"].bitmap = RPG::Cache.picture(image)
@sprites["#{id}"].z = zvalue
@sprites["#{id}"].x = xvalue
@sprites["#{id}"].y = yvalue
if frames > 0
@sprites["#{id}"].opacity = frames
else
@sprites["#{id}"].opacity = 255
end
loop do
Graphics.update
@sprites["#{id}"].opacity += frames if frames > 0 || frames != nil
break if @sprites["#{id}"].opacity == 255 ||
@sprites["#{id}"].opacity > 255
end
end
#==============================================================================#
# ** Oculta un Boton
#==============================================================================#
def pbOcultarBoton(id, frames)
if frames > 0 || frames != nil
loop do
Graphics.update
@sprites["#{id}"].opacity -= frames
break if @sprites["#{id}"].opacity == 0 ||
@sprites["#{id}"].opacity < 0
end
end
@sprites["#{id}"].dispose
end
#==============================================================================#
# ** Oculta una imagen
#==============================================================================#
def pbOcultarImagen(image, frames)
if frames > 0 || frames != nil
loop do
Graphics.update
@sprites["#{image}"].opacity -= frames
break if @sprites["#{image}"].opacity == 0 ||
@sprites["#{image}"].opacity < 0
end
end
@sprites["#{image}"].dispose
end
#==============================================================================#
# ** Cambio de estado
#==============================================================================#
def pbCambioEstado(estado)
for i in 0..$Trainer.party.length-1
$Trainer.party[i].status = estado
end
end
#=begin
#==============================================================================#
# ** Bayas
#==============================================================================#
# Berry, hours per stage, min yield, max yield, plural
BERRYVALUES = [
[:CHERIBERRY,3,2,5,_INTL("Baya Zreza")],
[:CHESTOBERRY,3,2,5,_INTL("Baya Atania")],
[:PECHABERRY,3,2,5,_INTL("Baya Meloc")],
[:RAWSTBERRY,3,2,5,_INTL("Baya Safre")],
[:ASPEARBERRY,3,2,5,_INTL("Baya Perasi")],
[:LEPPABERRY,4,2,5,_INTL("Baya Zanama")],
[:ORANBERRY,4,2,5,_INTL("Baya Aranja")],
[:PERSIMBERRY,4,2,5,_INTL("Baya Caquic")],
[:LUMBERRY,12,2,5,_INTL("Baya Ziuela")],
[:SITRUSBERRY,8,2,5,_INTL("Baya Zidra")],
[:FIGYBERRY,5,1,5,_INTL("Baya Higog")],
[:WIKIBERRY,5,1,5,_INTL("Baya Wiki")],
[:MAGOBERRY,5,1,5,_INTL("Baya Ango")],
[:AGUAVBERRY,5,1,5,_INTL("Baya Guaya")],
[:IAPAPABERRY,5,1,5,_INTL("Baya Pabaya")],
[:RAZZBERRY,2,2,10,_INTL("Baya Frambu")],
[:BLUKBERRY,2,2,10,_INTL("Baya Oram")],
[:NANABBERRY,2,2,10,_INTL("Baya Latano")],
[:WEPEARBERRY,2,2,10,_INTL("Baya Peragu")],
[:PINAPBERRY,2,2,10,_INTL("Baya Pinia")],
[:POMEGBERRY,8,1,5,_INTL("Baya Grana")],
[:KELPSYBERRY,8,1,5,_INTL("Baya Algama")],
[:QUALOTBERRY,8,1,5,_INTL("Baya Ispero")],
[:HONDEWBERRY,8,1,5,_INTL("Baya Meluce")],
[:GREPABERRY,8,1,5,_INTL("Baya Uvav")],
[:TAMATOBERRY,8,1,5,_INTL("Baya Tamate")],
[:CORNNBERRY,8,2,10,_INTL("Baya Mais")],
[:MAGOSTBERRY,6,2,10,_INTL("Baya Aostan")],
[:RABUTABERRY,6,2,10,_INTL("Baya Rautan")],
[:NOMELBERRY,6,2,10,_INTL("Baya Monli")],
[:SPELONBERRY,15,2,15,_INTL("Baya Wikano")],
[:PAMTREBERRY,15,3,15,_INTL("Baya Plama")],
[:WATMELBERRY,15,2,15,_INTL("Baya Sambia")],
[:DURINBERRY,15,3,15,_INTL("Baya Rudion")],
[:BELUEBERRY,15,2,15,_INTL("Baya Andano")],
[:OCCABERRY,18,1,5,_INTL("Baya Lichi")],
[:PASSHOBERRY,18,1,5,_INTL("Baya Pasio")],
[:WACANBERRY,18,1,5,_INTL("Baya Gualot")],
[:RINDOBERRY,18,1,5,_INTL("Baya Tamar")],
[:YACHEBERRY,18,1,5,_INTL("Baya Rimoya")],
[:CHOPLEBERRY,18,1,5,_INTL("Baya Pomaro")],
[:KEBIABERRY,18,1,5,_INTL("Baya Kebia")],
[:SHUCABERRY,18,1,5,_INTL("Baya Acardo")],
[:COBABERRY,18,1,5,_INTL("Baya Kouba")],
[:PAYAPABERRY,18,1,5,_INTL("Baya Payapa")],
[:TANGABERRY,18,1,5,_INTL("Baya Yecana")],
[:CHARTIBERRY,18,1,5,_INTL("Baya Alcho")],
[:KASIBBERRY,18,1,5,_INTL("Baya Drasi")],
[:HABANBERRY,18,1,5,_INTL("Baya Anjiro")],
[:COLBURBERRY,18,1,5,_INTL("Baya Dillo")],
[:BABIRIBERRY,18,1,5,_INTL("Baya Baribá")],
[:CHILANBERRY,18,1,5,_INTL("Baya Chilan")],
[:LIECHIBERRY,24,1,5,_INTL("Baya Lichi")],
[:GANLONBERRY,24,1,5,_INTL("Baya Gonlan")],
[:SALACBERRY,24,1,5,_INTL("Baya Aslac")],
[:PETAYABERRY,24,1,5,_INTL("Baya Yapati")],
[:APICOTBERRY,24,1,5,_INTL("Baya Aricoc")],
[:LANSATBERRY,24,1,5,_INTL("Baya Zonlan")],
[:STARFBERRY,24,1,5,_INTL("Baya Arabol")],
[:ENIGMABERRY,24,1,5,_INTL("Baya Enigma")],
[:MICLEBERRY,24,1,5,_INTL("Baya Lagro")],
[:CUSTAPBERRY,24,1,5,_INTL("Baya Chiri")],
[:JACOBABERRY,24,1,5,_INTL("Baya Jacoba")],
[:ROWAPBERRY,24,1,5,_INTL("Baya Magua")]
]
#==============================================================================#
# ** Natures
#==============================================================================#
module PBNatures
HARDY = 0
LONELY = 1
BRAVE = 2
ADAMANT = 3
NAUGHTY = 4
BOLD = 5
DOCILE = 6
RELAXED = 7
IMPISH = 8
LAX = 9
TIMID = 10
HASTY = 11
SERIOUS = 12
JOLLY = 13
NAIVE = 14
MODEST = 15
MILD = 16
QUIET = 17
BASHFUL = 18
RASH = 19
CALM = 20
GENTLE = 21
SASSY = 22
CAREFUL = 23
QUIRKY = 24
def PBNatures.maxValue; 24; end
def PBNatures.getCount; 25; end
def PBNatures.getName(id)
names=[
_INTL("Fuerte"),
_INTL("Huraña"),
_INTL("Audaz"),
_INTL("Firme"),
_INTL("Pícara"),
_INTL("Osada"),
_INTL("Dócil"),
_INTL("Plácida"),
_INTL("Agitada"),
_INTL("Floja"),
_INTL("Miedosa"),
_INTL("Activa"),
_INTL("Seria"),
_INTL("Alegre"),
_INTL("Ingenua"),
_INTL("Modesta"),
_INTL("Afable"),
_INTL("Mansa"),
_INTL("Tímida"),
_INTL("Alocada"),
_INTL("Serena"),
_INTL("Amable"),
_INTL("Grosera"),
_INTL("Cauta"),
_INTL("Rara")
]
return names[id]
end
end
#==============================================================================#
# ** Mega-Evolution
#==============================================================================#
def load_megas
#-----------------------------------------------------------------------------
# ** Venusaur
#-----------------------------------------------------------------------------
MultipleForms.register(:VENUSAUR,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:VENUSAURITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Venusaur") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [80,102,123,100,100,120] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:THICKFAT) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1555 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Charizard
#-----------------------------------------------------------------------------
MultipleForms.register(:CHARIZARD,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:CHARIZARDITAX)
next 2 if isConst?(pokemon.item,PBItems,:CHARITARDITAY)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Charizard X") if pokemon.form==1
next _INTL("Mega Charizard Y") if pokemon.form==2
next
},
"getBaseStats"=>proc{|pokemon|
next [78,124,118,100,129,85] if pokemon.form==1
next [78,104,78,100,159,115] if pokemon.form==2
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:DRAGON) if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:TOUGHCLAWS) if pokemon.form==1
next getID(PBAbilities,:DROUGHT) if pokemon.form==2
next
},
"weight"=>proc{|pokemon|
next 1105 if pokemon.form==1
next 1005 if pokemon.form==2
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Blastoise
#-----------------------------------------------------------------------------
MultipleForms.register(:BLASTOISE,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:BLASTOISITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Blastoise") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [79,103,120,78,135,115] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:MEGADISPARADOR) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Mewtwo
#-----------------------------------------------------------------------------
MultipleForms.register(:MEWTWO,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:MEWTONITAX)
next 2 if isConst?(pokemon.item,PBItems,:MEWTONITAY)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Mewtwo X") if pokemon.form==1
next _INTL("Mega Mewto Y") if pokemon.form==2
next
},
"getBaseStats"=>proc{|pokemon|
next [106,190,100,154,100,130] if pokemon.form==1
next [106,150,70,190,120,140] if pokemon.form==2
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:FIGHT) if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:STEADFAST) if pokemon.form==1
next getID(PBAbilities,:INSOMNIA) if pokemon.form==2
next
},
"weight"=>proc{|pokemon|
next 1105 if pokemon.form==1
next 1005 if pokemon.form==2
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Gengar
#-----------------------------------------------------------------------------
MultipleForms.register(:GENGAR,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:GENGARITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Gengar") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [60,65,80,170,95,130] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SHADOWTAG) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Pinsir
#-----------------------------------------------------------------------------
MultipleForms.register(:PINSIR,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:PINSIRITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Pinsir") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [65,155,120,65,90,105] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:AERILATE) if pokemon.form==1
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:FLYING) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Gyarados
#-----------------------------------------------------------------------------
MultipleForms.register(:GYARADOS,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:GYARADOSITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Gyarados") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [95,155,109,70,130,81] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:MOLDBREAKER) if pokemon.form==1
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:DARK) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Aerodactyl
#-----------------------------------------------------------------------------
MultipleForms.register(:AERODACTYL,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:AERODACTYLITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Aerodactyl") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [80,135,85,70,95,150] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:TOUGHCLAWS) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Ampharos
#-----------------------------------------------------------------------------
MultipleForms.register(:AMPHAROS,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:AMPHAROSITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Ampharos") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [90,95,105,165,110,45] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:MOLDBREAKER) if pokemon.form==1
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:DRAGON) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Scizor
#-----------------------------------------------------------------------------
MultipleForms.register(:SCIZOR,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:SCIZORITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Scizor") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [70,150,140,65,100,75] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:TECHNICIAN) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Heracross
#-----------------------------------------------------------------------------
MultipleForms.register(:HERACROSS,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:HERACROSSITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Heracross") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [80,185,115,40,105,75] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SKILLLINK) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Houndoom
#-----------------------------------------------------------------------------
MultipleForms.register(:HOUNDOOM,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:HOUNDOOMITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Houndoom") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [75,90,90,140,90,115] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SOLARPOWER) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Tyranitar
#-----------------------------------------------------------------------------
MultipleForms.register(:TYRANITAR,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:TYRANITARITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Tyranitar") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [100,164,150,95,120,71] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SANDSTREAM) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Blaziken
#-----------------------------------------------------------------------------
MultipleForms.register(:BLAZIKEN,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:BLAZIKENITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Blaziken") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [80,160,80,130,80,100] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SPEEDBOOST) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Gardevoir
#-----------------------------------------------------------------------------
MultipleForms.register(:GARDEVOIR,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:GARDEVOIRITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Gardevoir") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [68,85,65,165,135,100] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:PIXILATE) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Mawile
#-----------------------------------------------------------------------------
MultipleForms.register(:MAWILE,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:MAWILITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Mawile") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [50,105,125,55,95,50] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:HUGEPOWER) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Medicham
#-----------------------------------------------------------------------------
MultipleForms.register(:MEDICHAM,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:MEDICHAMITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Medicham") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [60,100,85,80,85,100] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:PUREPOWER) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Banette
#-----------------------------------------------------------------------------
MultipleForms.register(:BANETTE,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:BANETTITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Bannete") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [64,165,70,93,83,75] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:PRANKSTER) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Absol
#-----------------------------------------------------------------------------
MultipleForms.register(:ABSOL,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:ABSOLITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Absol") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [65,150,60,115,60,115] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:MAGICBOUNCE) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Garchomp
#-----------------------------------------------------------------------------
MultipleForms.register(:GARCHOMP,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:GARCHOMPITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Mega Garchomp") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [108,170,115,120,95,92] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SANDFORCE) if pokemon.form==1
next
},
"weight"=>proc{|pokemon|
next 1011 if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
end
#==============================================================================#
# ** Mega-Evolution
#==============================================================================#
def ancient_devolution
#-----------------------------------------------------------------------------
# ** Groudon
#-----------------------------------------------------------------------------
MultipleForms.register(:GROUDON,{
"getOmegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:GROUDONITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Groudon Primigenio") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [108,170,115,120,95,92] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SANDFORCE) if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
#-----------------------------------------------------------------------------
# ** Kyogre
#-----------------------------------------------------------------------------
MultipleForms.register(:KYOGRE,{
"getAlphaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:KYOGRECITA)
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
"getMegaName"=>proc{|pokemon|
next _INTL("Kyogre Primigenio") if pokemon.form==1
next
},
"getBaseStats"=>proc{|pokemon|
next [108,170,115,120,95,92] if pokemon.form==1
next
},
"ability"=>proc{|pokemon|
next getID(PBAbilities,:SANDFORCE) if pokemon.form==1
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
end
#=end