@ -239,7 +239,7 @@ export default class BalatroGame extends Phaser.Scene {
text ( x , y , str , size , color = C . ink , opts = { } ) {
const t = this . add . text ( x , y , str , {
fontFamily : opts . font || ' m6x11, "Julius Sans One"', fontSize : ` ${ size } px ` , color ,
fontFamily : opts . font || ' "Julius Sans One"', fontSize : ` ${ size } px ` , color ,
align : opts . align || 'left' , wordWrap : opts . wrap ? { width : opts . wrap } : undefined ,
fontStyle : opts . bold ? 'bold' : 'normal' ,
} ) . setOrigin ( opts . ox ? ? 0 , opts . oy ? ? 0 ) ;
@ -266,7 +266,7 @@ export default class BalatroGame extends Phaser.Scene {
toast ( msg ) {
if ( this . _toastText ) this . _toastText . destroy ( ) ;
const t = this . add . text ( GAME _WIDTH / 2 , 640 , msg , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '30px' , color : '#ffd2c8' ,
fontFamily : ' "Julius Sans One"', fontSize : '30px' , color : '#ffd2c8' ,
backgroundColor : '#301418' , padding : { x : 18 , y : 10 } ,
} ) . setOrigin ( 0.5 ) . setDepth ( 90 ) ;
this . fxLayer . add ( t ) ;
@ -326,22 +326,22 @@ export default class BalatroGame extends Phaser.Scene {
if ( enh !== 'stone' ) {
const color = SUIT _COLOR [ card . suit ] ;
const rank = this . add . text ( - w / 2 + 10 , - h / 2 + 6 , RANK _NAMES [ card . rank ] , {
fontFamily : ' m6x11, Georgia, serif', fontSize : ` ${ Math . round ( h * 0.21 ) } px ` , color , fontStyle : 'bold' ,
fontFamily : ' Georgia, serif', fontSize : ` ${ Math . round ( h * 0.21 ) } px ` , color , fontStyle : 'bold' ,
} ) ;
const suitSm = this . add . text ( - w / 2 + 12 , - h / 2 + 8 + h * 0.21 , SUIT _GLYPH [ card . suit ] , {
fontFamily : ' m6x11, Georgia, serif', fontSize : ` ${ Math . round ( h * 0.16 ) } px ` , color ,
fontFamily : ' Georgia, serif', fontSize : ` ${ Math . round ( h * 0.16 ) } px ` , color ,
} ) ;
const suitBig = this . add . text ( w * 0.16 , h * 0.16 , SUIT _GLYPH [ card . suit ] , {
fontFamily : ' m6x11, Georgia, serif', fontSize : ` ${ Math . round ( h * 0.42 ) } px ` , color ,
fontFamily : ' Georgia, serif', fontSize : ` ${ Math . round ( h * 0.42 ) } px ` , color ,
} ) . setOrigin ( 0.5 ) . setAlpha ( 0.9 ) ;
cont . add ( [ rank , suitSm , suitBig ] ) ;
if ( enh === 'wild' ) {
const wl = this . add . text ( 0 , h * 0.38 , 'WILD' , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.1 ) } px ` , color : '#5a3a10' , fontStyle : 'bold' } ) . setOrigin ( 0.5 ) ;
const wl = this . add . text ( 0 , h * 0.38 , 'WILD' , { fontFamily : ' "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.1 ) } px ` , color : '#5a3a10' , fontStyle : 'bold' } ) . setOrigin ( 0.5 ) ;
cont . add ( wl ) ;
}
} else {
const st = this . add . text ( 0 , 0 , '◼' , { fontFamily : ' m6x11, Georgia, serif', fontSize : ` ${ Math . round ( h * 0.32 ) } px ` , color : '#4c4a45' } ) . setOrigin ( 0.5 ) ;
const lbl = this . add . text ( 0 , h * 0.3 , 'STONE' , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.1 ) } px ` , color : '#3d3b37' } ) . setOrigin ( 0.5 ) ;
const st = this . add . text ( 0 , 0 , '◼' , { fontFamily : ' Georgia, serif', fontSize : ` ${ Math . round ( h * 0.32 ) } px ` , color : '#4c4a45' } ) . setOrigin ( 0.5 ) ;
const lbl = this . add . text ( 0 , h * 0.3 , 'STONE' , { fontFamily : ' "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.1 ) } px ` , color : '#3d3b37' } ) . setOrigin ( 0.5 ) ;
cont . add ( [ st , lbl ] ) ;
}
if ( card . seal ) {
@ -351,19 +351,19 @@ export default class BalatroGame extends Phaser.Scene {
}
if ( card . edition ) {
const tag = this . add . text ( 0 , - h / 2 + 4 , EDITIONS [ card . edition ] . name . toUpperCase ( ) , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.07 ) } px ` , color : '#ffffff' ,
fontFamily : ' "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.07 ) } px ` , color : '#ffffff' ,
} ) . setOrigin ( 0.5 , 0 ) . setAlpha ( 0.85 ) ;
cont . add ( tag ) ;
}
if ( card . permaChips ) {
const pc = this . add . text ( - w / 2 + 8 , h / 2 - 26 , ` + ${ card . permaChips } ` , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.09 ) } px ` , color : C . chipsHex ,
fontFamily : ' "Julius Sans One"', fontSize : ` ${ Math . round ( h * 0.09 ) } px ` , color : C . chipsHex ,
} ) ;
cont . add ( pc ) ;
}
if ( debuffed ) {
const shade = this . add . rectangle ( 0 , 0 , w , h , 0x1a1420 , 0.62 ) ;
const xg = this . add . text ( 0 , 0 , '✕' , { fontFamily : ' m6x11, Georgia, serif', fontSize : ` ${ Math . round ( h * 0.3 ) } px ` , color : '#8a4550' } ) . setOrigin ( 0.5 ) ;
const xg = this . add . text ( 0 , 0 , '✕' , { fontFamily : ' Georgia, serif', fontSize : ` ${ Math . round ( h * 0.3 ) } px ` , color : '#8a4550' } ) . setOrigin ( 0.5 ) ;
cont . add ( [ shade , xg ] ) ;
}
cont . setSize ( w , h ) ;
@ -387,11 +387,11 @@ export default class BalatroGame extends Phaser.Scene {
g . lineStyle ( 2 , C . rarity [ def . rarity ] , 1 ) ; g . strokeRoundedRect ( - w / 2 , - h / 2 , w , h , 10 ) ;
cont . add ( g ) ;
const name = this . add . text ( 0 , - h / 2 + 15 , def . name , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : ` ${ Math . min ( 17 , Math . round ( 280 / def . name . length ) ) } px ` , color : '#141019' , fontStyle : 'bold' ,
fontFamily : ' "Julius Sans One"', fontSize : ` ${ Math . min ( 17 , Math . round ( 280 / def . name . length ) ) } px ` , color : '#141019' , fontStyle : 'bold' ,
} ) . setOrigin ( 0.5 ) ;
const desc = typeof def . desc === 'function' ? def . desc ( opts . inst || { state : def . initState ? def . initState ( ) : { } } ) : def . desc ;
const body = this . add . text ( 0 , 8 , desc , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '15px' , color : C . ink , align : 'center' ,
fontFamily : ' "Julius Sans One"', fontSize : '15px' , color : C . ink , align : 'center' ,
wordWrap : { width : w - 16 } ,
} ) . setOrigin ( 0.5 ) ;
cont . add ( [ name , body ] ) ;
@ -403,14 +403,14 @@ export default class BalatroGame extends Phaser.Scene {
eg . lineStyle ( 4 , edColor , 0.95 ) ; eg . strokeRoundedRect ( - w / 2 , - h / 2 , w , h , 10 ) ;
cont . add ( eg ) ;
const tag = this . add . text ( 0 , h / 2 - 16 , EDITIONS [ edition ] . name . toUpperCase ( ) , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '11px' , color : '#ffffff' ,
fontFamily : ' "Julius Sans One"', fontSize : '11px' , color : '#ffffff' ,
} ) . setOrigin ( 0.5 ) . setAlpha ( 0.9 ) ;
cont . add ( tag ) ;
if ( edition === 'negative' ) cont . setAlpha ( 0.8 ) ;
}
if ( opts . inst && opts . inst . debuffedByBoss ) {
cont . add ( this . add . rectangle ( 0 , 0 , w , h , 0x1a1420 , 0.6 ) ) ;
cont . add ( this . add . text ( 0 , 0 , 'DISABLED' , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '16px' , color : '#c86a6a' } ) . setOrigin ( 0.5 ) ) ;
cont . add ( this . add . text ( 0 , 0 , 'DISABLED' , { fontFamily : ' "Julius Sans One"', fontSize : '16px' , color : '#c86a6a' } ) . setOrigin ( 0.5 ) ) ;
}
cont . setSize ( w , h ) ;
return cont ;
@ -433,16 +433,16 @@ export default class BalatroGame extends Phaser.Scene {
g . lineStyle ( 1 , tint , 0.6 ) ; g . strokeRoundedRect ( - w / 2 + 6 , - h / 2 + 6 , w - 12 , h - 12 , 8 ) ;
cont . add ( g ) ;
const name = this . add . text ( 0 , - h / 2 + 20 , def . name , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : ` ${ Math . min ( 16 , Math . round ( 300 / def . name . length ) ) } px ` ,
fontFamily : ' "Julius Sans One"', fontSize : ` ${ Math . min ( 16 , Math . round ( 300 / def . name . length ) ) } px ` ,
color : ` # ${ tint . toString ( 16 ) . padStart ( 6 , '0' ) } ` , fontStyle : 'bold' , align : 'center' , wordWrap : { width : w - 14 } ,
} ) . setOrigin ( 0.5 , 0 ) ;
const descText = kind === 'planet' ? ` +1 level: ${ HAND _BY _ID [ def . hand ] . name } ` : def . desc ;
const body = this . add . text ( 0 , 16 , descText , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '14px' , color : C . ink , align : 'center' , wordWrap : { width : w - 18 } ,
fontFamily : ' "Julius Sans One"', fontSize : '14px' , color : C . ink , align : 'center' , wordWrap : { width : w - 18 } ,
} ) . setOrigin ( 0.5 ) ;
cont . add ( [ name , body ] ) ;
const glyph = { tarot : '☽' , planet : '✶' , spectral : '✧' } [ kind ] ;
cont . add ( this . add . text ( 0 , h / 2 - 22 , glyph , { fontFamily : ' m6x11, Georgia, serif', fontSize : '20px' , color : ` # ${ tint . toString ( 16 ) . padStart ( 6 , '0' ) } ` } ) . setOrigin ( 0.5 ) ) ;
cont . add ( this . add . text ( 0 , h / 2 - 22 , glyph , { fontFamily : ' Georgia, serif', fontSize : '20px' , color : ` # ${ tint . toString ( 16 ) . padStart ( 6 , '0' ) } ` } ) . setOrigin ( 0.5 ) ) ;
}
cont . setSize ( w , h ) ;
return cont ;
@ -460,14 +460,14 @@ export default class BalatroGame extends Phaser.Scene {
this . fxLayer . add ( cont ) ;
let y = PAD ;
const title = this . add . text ( PAD , y , info . title , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '22px' , color : info . titleColor || C . ink ,
fontFamily : ' "Julius Sans One"', fontSize : '22px' , color : info . titleColor || C . ink ,
fontStyle : 'bold' , wordWrap : { width : W - PAD * 2 } ,
} ) ;
cont . add ( title ) ;
y += title . height + 4 ;
if ( info . tag ) {
const tag = this . add . text ( PAD , y , info . tag , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '14px' , color : info . tagColor || C . muted ,
fontFamily : ' "Julius Sans One"', fontSize : '14px' , color : info . tagColor || C . muted ,
} ) ;
cont . add ( tag ) ;
y += tag . height + 8 ;
@ -476,7 +476,7 @@ export default class BalatroGame extends Phaser.Scene {
}
for ( const line of info . lines || [ ] ) {
const t = this . add . text ( PAD , y , line . text , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '16px' , color : line . color || C . muted ,
fontFamily : ' "Julius Sans One"', fontSize : '16px' , color : line . color || C . muted ,
wordWrap : { width : W - PAD * 2 } ,
} ) ;
cont . add ( t ) ;
@ -657,7 +657,7 @@ export default class BalatroGame extends Phaser.Scene {
// Shaken in update() with the scoring hum's intensity.
this . _shakeTargets = [ chipsBox , multBox , this . _chipsText , this . _multText ]
. map ( ( obj ) => ( { obj , bx : obj . x , by : obj . y } ) ) ;
this . text ( X + 16 + W / 2 - 16 , cy + 32 , '× ' , 30 , C . muted , { ox : 0.5 , oy : 0.5 } ) ;
this . text ( X + 16 + W / 2 - 8 , cy + 32 , '× ' , 30 , C . muted , { ox : 0.5 , oy : 0.5 } ) ;
this . _handNameText = this . text ( X + W / 2 , cy - 26 , '' , 20 , C . gold ? '#e7c14b' : C . ink , { ox : 0.5 } ) ;
// hands / discards / gold / ante
@ -701,7 +701,7 @@ export default class BalatroGame extends Phaser.Scene {
g . fillStyle ( C . panel , 0.97 ) ; g . fillRoundedRect ( GAME _WIDTH / 2 - 240 , 360 , 480 , 360 , 16 ) ;
g . lineStyle ( 2 , C . panelEdge , 1 ) ; g . strokeRoundedRect ( GAME _WIDTH / 2 - 240 , 360 , 480 , 360 , 16 ) ;
ov . add ( [ shade , g ] ) ;
const t = this . add . text ( GAME _WIDTH / 2 , 400 , 'Options' , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '32px' , color : C . ink } ) . setOrigin ( 0.5 ) ;
const t = this . add . text ( GAME _WIDTH / 2 , 400 , 'Options' , { fontFamily : ' "Julius Sans One"', fontSize : '32px' , color : C . ink } ) . setOrigin ( 0.5 ) ;
ov . add ( t ) ;
const mk = ( y , label , cb ) => {
const b = new Button ( this , GAME _WIDTH / 2 , y , label , cb , { width : 320 , height : 56 , fontSize : 22 } ) ;
@ -775,8 +775,8 @@ export default class BalatroGame extends Phaser.Scene {
g . lineStyle ( 2 , C . rarity [ def . rarity ] , 1 ) ; g . strokeRoundedRect ( px , py , pw , ph , 12 ) ;
cont . add ( g ) ;
const desc = typeof def . desc === 'function' ? def . desc ( inst ) : def . desc ;
cont . add ( this . add . text ( px + 20 , py + 14 , ` ${ def . name } ${ inst . edition ? ` ( ${ EDITIONS [ inst . edition ] . name } ) ` : '' } ` , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '24px' , color : C . ink } ) ) ;
cont . add ( this . add . text ( px + 20 , py + 52 , desc , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '17px' , color : C . muted , wordWrap : { width : pw - 40 } } ) ) ;
cont . add ( this . add . text ( px + 20 , py + 14 , ` ${ def . name } ${ inst . edition ? ` ( ${ EDITIONS [ inst . edition ] . name } ) ` : '' } ` , { fontFamily : ' "Julius Sans One"', fontSize : '24px' , color : C . ink } ) ) ;
cont . add ( this . add . text ( px + 20 , py + 52 , desc , { fontFamily : ' "Julius Sans One"', fontSize : '17px' , color : C . muted , wordWrap : { width : pw - 40 } } ) ) ;
const sell = new Button ( this , px + pw - 110 , py + ph - 40 , ` Sell $ ${ inst . sellValue } ` , ( ) => {
const r = sellJoker ( this . run , inst . uid ) ;
if ( r . ok ) { playSound ( this , SFX . COINS ) ; this . save ( ) ; this . renderView ( ) ; }
@ -823,11 +823,11 @@ export default class BalatroGame extends Phaser.Scene {
const tint = { tarot : C . tarot , planet : C . planet , spectral : C . spectral } [ inst . kind ] ;
g . lineStyle ( 2 , tint , 1 ) ; g . strokeRoundedRect ( px , py , pw , ph , 12 ) ;
cont . add ( g ) ;
cont . add ( this . add . text ( px + 20 , py + 14 , def . name , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '24px' , color : C . ink } ) ) ;
cont . add ( this . add . text ( px + 20 , py + 14 , def . name , { fontFamily : ' "Julius Sans One"', fontSize : '24px' , color : C . ink } ) ) ;
const descText = inst . kind === 'planet' ? ` +1 level: ${ HAND _BY _ID [ def . hand ] . name } ` : def . desc ;
cont . add ( this . add . text ( px + 20 , py + 52 , descText , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '17px' , color : C . muted , wordWrap : { width : pw - 40 } } ) ) ;
cont . add ( this . add . text ( px + 20 , py + 52 , descText , { fontFamily : ' "Julius Sans One"', fontSize : '17px' , color : C . muted , wordWrap : { width : pw - 40 } } ) ) ;
const needs = def . targets || 0 ;
if ( needs ) cont . add ( this . add . text ( px + 20 , py + ph - 96 , ` Select up to ${ needs } card ${ needs > 1 ? 's' : '' } in hand first ` , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '15px' , color : '#a8d8ff' } ) ) ;
if ( needs ) cont . add ( this . add . text ( px + 20 , py + ph - 96 , ` Select up to ${ needs } card ${ needs > 1 ? 's' : '' } in hand first ` , { fontFamily : ' "Julius Sans One"', fontSize : '15px' , color : '#a8d8ff' } ) ) ;
const use = new Button ( this , px + pw - 110 , py + ph - 40 , 'Use' , ( ) => {
const r = useConsumable ( this . run , inst . uid , this . selected . slice ( 0 , Math . max ( needs , 2 ) ) ) ;
if ( ! r . ok ) { this . toast ( r . error ) ; return ; }
@ -897,7 +897,7 @@ export default class BalatroGame extends Phaser.Scene {
cont . add ( glow ) ;
}
if ( run . bossState && run . bossState . forcedUid === card . uid ) {
const lock = this . add . text ( 0 , - h / 2 - 20 , '⛓ forced' , { fontFamily : ' m6x11, "Julius Sans One"', fontSize : '15px' , color : '#ff8a6a' } ) . setOrigin ( 0.5 ) ;
const lock = this . add . text ( 0 , - h / 2 - 20 , '⛓ forced' , { fontFamily : ' "Julius Sans One"', fontSize : '15px' , color : '#ff8a6a' } ) . setOrigin ( 0.5 ) ;
cont . add ( lock ) ;
}
if ( ! frozen ) {
@ -1140,7 +1140,7 @@ export default class BalatroGame extends Phaser.Scene {
const x = sprite ? this . fxX ( sprite ) : 980 ;
const y = sprite ? this . fxY ( sprite ) - 90 : 400 ;
const t = this . add . text ( x , y , textStr , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '34px' , color , fontStyle : 'bold' ,
fontFamily : ' "Julius Sans One"', fontSize : '34px' , color , fontStyle : 'bold' ,
stroke : '#141019' , strokeThickness : 5 ,
} ) . setOrigin ( 0.5 ) . setDepth ( 85 ) ;
this . fxLayer . add ( t ) ;
@ -1189,7 +1189,7 @@ export default class BalatroGame extends Phaser.Scene {
const score = res . trace . score ;
// Slam: big score text at the played row.
const slam = this . add . text ( centerX , py - 170 , fmtChips ( score ) , {
fontFamily : ' m6x11, "Julius Sans One"', fontSize : '72px' , color : '#ffffff' , fontStyle : 'bold' ,
fontFamily : ' "Julius Sans One"', fontSize : '72px' , color : '#ffffff' , fontStyle : 'bold' ,
stroke : '#c8342c' , strokeThickness : 8 ,
} ) . setOrigin ( 0.5 ) . setScale ( 1.6 ) . setAlpha ( 0 ) . setDepth ( 86 ) ;
this . fxLayer . add ( slam ) ;