Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #------------------------------------------------------------------------------
- # Script creado por FiaPlay para Pokémon Essentials BES (Créditos si se usa)
- #------------------------------------------------------------------------------
- =begin Instrucciones de instalación
- Si actualizas desde una versión anterior es recomendable que repitas los pasos y compares con el código de una base limpia.
- 1) En PokeBattle_Scene Busca:
- @sprites["battlebox1"]=PokemonDataBox.new(battle.battlers[1],battle.doublebattle,@viewport)
- y reemplázalo por:
- if battle.rules["bossBar"]
- @boss=getConst(BossBoxSetings,battle.rules["bossBar"])
- case @boss["style"]
- when ["EBS"]
- @sprites["battlebox1"]=EBSBossBox.new(battle.battlers[1],@viewport)
- else
- c=@boss["basecolor"] || Color.new(0,128,0)
- @sprites["battlebox1"]=BossDataBox.new(battle.battlers[1],c,@viewport)
- end
- else
- @sprites["battlebox1"]=PokemonDataBox.new(battle.battlers[1],battle.doublebattle,@viewport)
- end
- 2) En PokeBattle_Scene Busca:
- @sprites["pokemon1"].tone.gray+=8 if @sprites["pokemon1"].tone.gray<0
- y debajo pon:
- @sprites["pokemon1"].tone=Tone.new(0,0,0,0) if @boss
- 3) Crea un nuevo script encima de Main e inserta el scrip ahí.
- 4) Descomprime este Zip en Graphics/Picturs/Battle:
- https://mega.nz/file/qM5SWD4C#6Lf-k5fK1JIqQ_c5txqi3uVp8-4GxloBV-WtefTkAhM
- Instrucciones de uso:
- 1) Crea los datos para cada barra en el módulo BossBoxSetings
- 2) Antes del combate usa: setBattleRule("bossBar",:(Nombre de la contante)) #Los 2 puntos son necesarios
- 3)Para un ejemplo Práctico usa:
- setBattleRule("bossBar",:Rayquaza)
- setBattleRule("bossBar",:Mewtwo)
- setBattleRule("bossBar",:Regidrago)
- setBattleRule("bossBar",:Reshiram)
- setBattleRule("bossBar",:BASIC)
- =end
- module BossBoxSetings
- Rayquaza = {
- "name" => "Dios de los Cielos", #Nombre que se muestra sobre la barra
- "basecolor" => Color.new(0,161,255), #Color principal de las letras y la barra de vida
- "shadowcolor" => Color.new(0,126,199), #Color secundario de las letras
- "alignment" => "left", #Alineación de la barra (por defecto está en el centro, Solo Standart)
- }
- Mewtwo = {
- "name" => "Genoma Alterado",
- "basecolor" => Color.new(196,0,193),
- "shadowcolor" => Color.new(125,7,125)
- }
- Regidrago = {
- "basecolor" => Color.new(204,0,193),
- "shadowcolor" => Color.new(125,7,7),
- "barsizeX" => 140, #Ancho de la barra (Por defecto es la misma que el texto, Solo Standart)
- "barsizeY" => 10 , #Alto de la barra (Por defecto es 8, Solo Standart)
- }
- Reshiram = {
- "style" => "EBS", #Barra estilo EBS
- "name" => "Deidad Ígnea",
- "basecolor" => Color.new(233,233,233),
- "shadowcolor" => Color.new(120,120,120), #Color secundario de la barra de vida
- "showlevel" => true #Decide si mostrar o no el nivel(Solo EBS)
- }
- BASIC = {} #No tocar este
- end
- #===============================================================================
- # Código común entre las barras de vida
- # Recomendable no tocar nada a partir de Aquí
- #===============================================================================
- module CustomDataBox
- def exp
- return 0
- end
- def hp
- return @animatingHP ? @currenthp : @battler.hp
- end
- def animateHP(oldhp,newhp)
- @starthp=oldhp
- @currenthp=oldhp
- @endhp=newhp
- @animatingHP=true
- end
- def animateEXP(oldexp,newexp)
- @currentexp=oldexp
- @endexp=newexp
- @animatingEXP=true
- end
- def update
- super
- @frame+=1
- if @animatingHP
- if @currenthp<@endhp
- @currenthp+=[1,(@battler.totalhp/PokeBattle_SceneConstants::HPGAUGESIZE).floor].max
- @currenthp=@endhp if @currenthp>@endhp
- elsif @currenthp>@endhp
- @currenthp-=[1,(@battler.totalhp/PokeBattle_SceneConstants::HPGAUGESIZE).floor].max
- @currenthp=@endhp if @currenthp<@endhp
- end
- @animatingHP=false if @currenthp==@endhp
- refresh
- end
- # Data box bobbing while Pokémon is selected
- if ((@frame/10).floor&1)==1 && @selected==1 # Choosing commands for this Pokémon
- self.y=@spriteY+2
- elsif ((@frame/10).floor&1)==1 && @selected==2 # When targeted or damaged
- self.y=@spriteY+2
- end
- end
- end
- #===============================================================================
- # Barra de vida de Jefes (Estilo FiaPlay)
- #===============================================================================
- class BossDataBox < SpriteWrapper
- include CustomDataBox
- attr_reader :battler
- attr_accessor :selected
- attr_accessor :appearing
- attr_reader :animatingHP
- attr_reader :animatingEXP
- def initialize(battler,color,viewport=nil)
- super(viewport)
- @explevel=0
- @battler=battler
- @selected=0
- @frame=0
- @showexp=false
- @animatingHP=false
- @starthp=0
- @currenthp=0
- @endhp=0
- @expflash=0
- @color=color
- @spriteY=2
- @statuses=AnimatedBitmap.new(_INTL("Graphics/#{BATTLE_ROUTE}/battleBossStatuses"))
- @contents=BitmapWrapper.new(512,62)
- @boss=battler.battle.scene.boss
- self.bitmap=@contents
- self.visible=false
- self.z=50
- refresh
- end
- def dispose
- @statuses.dispose
- @contents.dispose
- super
- end
- def appear
- refresh
- self.visible=true
- self.opacity=255
- self.y=@spriteY
- self.x=0
- end
- def refresh
- self.bitmap.clear
- return if !@battler.pokemon
- base = @boss["basecolor"] || PokeBattle_SceneConstants::BOXTEXTBASECOLOR
- shadow = @boss["shadowcolor"] || PokeBattle_SceneConstants::BOXTEXTSHADOWCOLOR
- pokename = @boss["name"] || @battler.name
- pbSetSystemFont(self.bitmap)
- @sizeX = @boss["barsizeX"] || self.bitmap.text_size(pokename).width
- textX = @boss["barsizeX"] ? (@sizeX-self.bitmap.text_size(pokename).width)/2 : 0
- alignment = @boss["alignment"]
- case alignment
- when "left"
- baseX=10
- when "center" , nil
- baseX=(512-@sizeX)/2
- when "right"
- baseX=502-@sizeX
- end
- textpos=[
- [pokename,baseX+textX,4,false,base,shadow,PokeBattle_SceneConstants::DTBOX_OUTLINE]
- ]
- pbDrawTextPositions(self.bitmap,textpos)
- if @battler.status>0
- statusX = alignment=="right" ? -26 : @sizeX+4
- self.bitmap.blt(baseX+statusX,16,@statuses.bitmap,
- Rect.new(0,(@battler.status-1)*22,22,22))
- end
- hpGaugeSize=@sizeX
- hpgauge=@battler.totalhp==0 ? 0 : (self.hp*hpGaugeSize/@battler.totalhp)
- hpgauge=2 if hpgauge==0 && self.hp>0
- # fill with black (shows what the HP used to be)
- hpGaugeY=PokeBattle_SceneConstants::HPGAUGE_Y
- # fill with HP color
- barY = @boss["barsizeY"] || 8
- self.bitmap.fill_rect(baseX,hpGaugeY-4,hpgauge,barY,@color)
- end
- end
- #===============================================================================
- # Barra de vida de Jefes (Estilo EBS)
- #===============================================================================
- class EBSBossBox < SpriteWrapper
- include CustomDataBox
- attr_reader :battler
- attr_accessor :selected
- attr_accessor :appearing
- attr_reader :animatingHP
- attr_reader :animatingEXP
- def initialize(battler,viewport=nil)
- super(viewport)
- @battler=battler
- @selected=0
- @frame=0
- @starthp=0
- @currenthp=0
- @endhp=0
- @databox=AnimatedBitmap.new("Graphics/#{BATTLE_ROUTE}/battleBossBoxEBS")
- @spriteX=14
- @spriteY=PokeBattle_SceneConstants::FOEBOXD1_Y
- @statuses=AnimatedBitmap.new(_INTL("Graphics/#{BATTLE_ROUTE}/battleStatusesEBS"))
- @contents=BitmapWrapper.new(@databox.width,@databox.height)
- self.bitmap=@contents
- self.visible=true
- self.z=50
- self.x=@spriteX
- self.y=@spriteY
- @boss=battler.battle.scene.boss
- refresh
- end
- def refresh
- baseX=16
- self.bitmap.clear
- return if !@battler.pokemon
- self.bitmap.blt(0,0,@databox.bitmap,Rect.new(0,0,@databox.width,@databox.height))
- base = @boss["basecolor"] || PokeBattle_SceneConstants::BOXTEXTBASECOLOR
- shadow=PokeBattle_SceneConstants::BOXTEXTSHADOWCOLOR
- pokename = @boss["name"] || @battler.name
- pbSetSmallFont(self.bitmap)
- textpos=[
- [pokename,baseX+40,8,false,base,shadow,true]
- ]
- genderX=self.bitmap.text_size(pokename).width
- case @battler.displayGender
- when 0 # Male
- textpos.push([_INTL("♂"),genderX,6,false,Color.new(48,96,216),shadow,true])
- when 1 # Female
- textpos.push([_INTL("♀"),genderX,6,false,Color.new(248,88,40),shadow,true])
- end
- pbDrawTextPositions(self.bitmap,textpos)
- textpos=[
- [_INTL("Nv{1}",@battler.level),@databox.width-80,8,true,base,shadow,true]
- ]
- pbDrawTextPositions(self.bitmap,textpos) if @boss["showlevel"]
- imagepos=[]
- if @battler.isMega?
- imagepos.push(["Graphics/#{BATTLE_ROUTE}/battleMegaEvoBox.png",baseX - 16, 7, 0, 0, -1, -1])
- elsif @battler.isUltra?
- imagepos.push(["Graphics/#{BATTLE_ROUTE}/battleUltraBurstBox.png",baseX- 16, 7, 0, 0, -1, -1])
- elsif @battler.isPrimal?
- imagepos.push(["Graphics/#{BATTLE_ROUTE}/battlePrimal#{PBSpecies.getName(@battler.species)}Box.png",baseX- 16, 7, 0, 0, -1, -1])
- elsif @battler.isTera?
- imagepos.push(["Graphics/Pictures/teraTypes.png",baseX - 16, 7,0,@battler.type1*32,32,32])
- end
- pbDrawImagePositions(self.bitmap,imagepos)
- if @battler.status>0
- self.bitmap.blt(160,48,@statuses.bitmap,
- Rect.new(0,(@battler.status-1)*16,44,16))
- end
- hpGaugeSize=252
- hpgauge=@battler.totalhp==0 ? 0 : (self.hp*hpGaugeSize/@battler.totalhp)
- hpgauge=2 if hpgauge==0 && self.hp>0
- hpzone=0
- hpzone=1 if self.hp<=(@battler.totalhp/2).floor
- hpzone=2 if self.hp<=(@battler.totalhp/4).floor
- hpcolors=[
- PokeBattle_SceneConstants::HPCOLORGREENDARK,
- PokeBattle_SceneConstants::HPCOLORGREEN,
- PokeBattle_SceneConstants::HPCOLORYELLOWDARK,
- PokeBattle_SceneConstants::HPCOLORYELLOW,
- PokeBattle_SceneConstants::HPCOLORREDDARK,
- PokeBattle_SceneConstants::HPCOLORRED
- ]
- # fill with black (shows what the HP used to be)
- hpGaugeX=PokeBattle_SceneConstants::HPGAUGE_X
- hpGaugeY=PokeBattle_SceneConstants::HPGAUGE_Y
- # fill with HP color
- oc = @boss["shadowcolor"] || hpcolors[hpzone*2]
- c = @boss["basecolor"] && @boss["shadowcolor"] ? base : [hpzone*2+1]
- self.bitmap.fill_rect(48,40,hpgauge,2,oc)
- self.bitmap.fill_rect(48,42,hpgauge,4,c)
- end
- def dispose
- @statuses.dispose
- @contents.dispose
- @databox.dispose
- super
- end
- def appear
- refresh
- self.visible=true
- self.opacity=255
- end
- end
- class PokeBattle_Scene
- attr_accessor :boss
- def setBossBar(setings=:BASIC)
- @sprites["battlebox1"].dispose
- if setings
- @boss=getConst(BossBoxSetings,setings)
- case @boss["style"]
- when ["EBS"]
- @sprites["battlebox1"]=EBSBossBox.new(battle.battlers[1],@viewport)
- else
- @sprites["battlebox1"]=BossDataBox.new(@battle.battlers[1],@boss["basecolor"],@viewport)
- end
- else
- @sprites["battlebox1"]=PokemonDataBox.new(battle.battlers[1],@battle.doublebattle,@viewport)
- end
- b = @sprites["battlebox1"]
- b.appear
- end
- end
Add Comment
Please, Sign In to add comment