// Ċ // ĠSource Ġcode Ġre created Ġfrom Ġa Ġ. class Ġfile Ġby ĠIntelliJ ĠIDEA Ċ // Ġ( powered Ġby ĠF ern Flow er Ġde compiler ) Ċ // Ċ package Ġw tf . osh isa ure . null pom od sh it . modes Ċ Ċ import Ġmu . nu . null po . game . component . B GM Status Ċ import Ġmu . nu . null po . game . event . Event Receiver . COLOR Ċ import Ġmu . nu . null po . game . play . Game Engine Ċ import Ġmu . nu . null po . game . subsystem . mode . Abstract Mode Ċ import Ġmu . nu . null po . game . subsystem . mode . menu . Delegate MenuItem Ċ import Ġmu . nu . null po . game . subsystem . mode . menu . Menu List Ċ import Ġmu . nu . null po . game . subsystem . mode . menu . Strings MenuItem Ċ import Ġmu . nu . null po . gui . common . Base Font Ċ import Ġmu . nu . null po . util . Custom Properties Ċ import Ġmu . nu . null po . util . General Util . to Time Str Ċ import Ġkotlin . math . pow Ċ Ċ class ĠScore Attack Run : Abstract Mode () Ġ{ Ċ ĉ private Ġvar Ġlast type Ġ= Ġ 0 Ċ ĉ private Ġvar Ġlast piece Ġ= Ġ 0 Ċ ĉ private Ġvar Ġscore : Long Ġ= Ġ 0 Ċ ĉ /** ĠScore ĠRate ĠPer centage */ Ċ ĉ private Ġvar Ġscore Rate : Int Ġ= Ġ 0 Ċ ĉ private Ġvar Ġcurrent time Ġ= Ġ 0 Ċ ĉ private Ġvar Ġren Ġ= Ġ 0 Ċ ĉ private Ġvar Ġall clear s Ġ= Ġ 0 Ċ ĉ private Ġvar Ġlast b 2 b Ġ= Ġfalse Ċ ĉ private Ġvar Ġin combo Ġ= Ġfalse Ċ ĉ private Ġvar Ġqu ads Ġ= Ġ 0 Ċ ĉ private Ġvar Ġbg ml v Ġ= Ġ 0 Ċ ĉ private Ġvar Ġranking Score : Array < Long Array > Ġ= ĠArray ( RAN K ING _ TYPES ) Ġ{ Long Array ( RAN K ING _ MAX )} Ċ ĉ private Ġvar Ġranking Level : Array < IntArray > Ġ= ĠArray ( RAN K ING _ TYPES ) Ġ{ IntArray ( RAN K ING _ MAX )} Ċ ĉ private Ġvar Ġranking Qu ads : Array < IntArray > Ġ= ĠArray ( RAN K ING _ TYPES ) Ġ{ IntArray ( RAN K ING _ MAX )} Ċ ĉ private Ġvar Ġranking Rank Ġ= Ġ 0 Ċ ĉ private Ġvar Ġversion Ġ= Ġ 0 Ċ ĉ private Ġvar Ġlast score L : Long Ġ= Ġ 0 Ċ ĉ private Ġvar Ġing ame Ġ= Ġfalse Ċ ĉ private Ġvar Ġmax chain Ġ= Ġ 0 Ċ ĉ private Ġvar Ġmax mult : Int Ġ= Ġ 0 Ċ ĉ private Ġvar Ġsc get time Ġ= Ġ 0 ĊĊ ĉ private Ġval Ġitem Mode Ġ= ĠStrings MenuItem ( Ċĉ ĉ " game type ", Ġ" GAME ĠMODE ", ĠCOLOR . BLUE , Ġ 0 , Ċĉ ĉ Game type . values (). map Ġ{ it . label }. to Typed Array () Ċ ĉ ) Ċ ĉ private Ġvar Ġgame type : Int Ġby ĠDelegate MenuItem ( item Mode ) Ċ ĉ override Ġval Ġname : String Ġget () Ġ= Ġ" AR CADE ĠS CORE ĠATT ACK " Ċ ĉ override Ġval Ġmenu Ġ= ĠMenu List (" ar cade score attack ", Ġitem Mode ) ĊĊ ĉ override Ġfun Ġload Ranking ( prop : Custom Properties , Ġrule Name : String ) Ġ{ Ċĉ ĉ for ( i Ġin Ġ 0 Ġuntil ĠR ANK ING _ MAX ) Ġfor ( j Ġin Ġ 0 Ġuntil ĠR ANK ING _ TYPES ) Ġ{ Ċĉĉ ĉ ranking Score [ j ][ i ] Ġ= Ġprop . getProperty ("$ j . score .$ i ", Ġ 0 L ) Ċĉĉ ĉ ranking Level [ j ][ i ] Ġ= Ġprop . getProperty ("$ j . level .$ i ", Ġ 0 ) Ċĉĉ ĉ ranking Qu ads [ j ][ i ] Ġ= Ġprop . getProperty ("$ j . qu ads $ i ", Ġ 0 ) Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġsave Ranking () Ġ{ Ċĉ ĉ return Ġsuper . save Ranking ( Ċĉĉ ĉ ( 0 Ġuntil ĠR ANK ING _ TYPES ). flatMap Ġ{ t Ġ-> Ċĉĉĉ ĉ ( 0 Ġuntil ĠR ANK ING _ MAX ). flatMap Ġ{ i Ġ-> Ċĉĉĉĉ ĉ listOf ( Ċĉĉĉĉĉ ĉ "$ t . score .$ i " Ġto Ġranking Score [ t ][ i ], Ċĉĉĉĉĉ ĉ "$ t . level .$ i " Ġto Ġranking Level [ t ][ i ], Ċĉĉĉĉĉ ĉ "$ t . qu ads .$ i " Ġto Ġranking Qu ads [ t ][ i ], Ċĉĉĉĉ ĉ ) Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉ ĉ ) Ċ ĉ } ĊĊ ĉ private Ġfun Ġformat Score ( sc : Long ): String Ġ{ Ċĉ ĉ return Ġif ( sc >= score Cutoff Value ) Ġ{ Ċĉĉ ĉ format Score Sc ientific ( sc ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ val Ġbig str Ġ= Ġ"$ sc " Ċĉĉ ĉ val Ġlen Ġ= Ġbig str . length Ċĉĉ ĉ val Ġbuilder Ġ= ĠStringBuilder () Ċĉĉ ĉ for ( i Ġin Ġ 1 .. len ) Ġ{ Ċĉĉĉ ĉ builder . append ( big str [ len - i ]) Ċĉĉĉ ĉ if ( i % 3 == 0 && i != len ) Ġ{ Ċĉĉĉĉ ĉ builder . append (",") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ builder . reverse (). toString () Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ private Ġfun Ġformat Score Sc ientific ( sc : Long ): String Ġ{ Ċĉ ĉ var Ġbig str : String Ċĉ ĉ big str Ġ= Ġ"$ sc " Ċĉ ĉ while ( big str . length % 3 != 0 ) Ġ{ Ċĉĉ ĉ big str Ġ= Ġ" Ġ$ big str " Ċĉ ĉ } Ċĉ ĉ val Ġexponent Ġ= Ġbig str . length - 3 Ċĉ ĉ val Ġexp str Ġ= Ġ" E + "+ format Score ( exponent . to Long ()) Ċĉ ĉ var Ġrender Ġ= Ġ"" Ċĉ ĉ for ( i Ġin Ġ 0 .. 1 2 ) Ġ{ Ċĉĉ ĉ render Ġ+= Ġbig str [ i ] Ċĉĉ ĉ if ( i % 3 == 2 ) Ġ{ Ċĉĉĉ ĉ render Ġ+= Ġif ( i == 2 ) Ġ"." Ġelse Ġ" Ġ" Ċĉĉ ĉ } Ċĉ ĉ } Ċĉ ĉ return Ġrender . take ( sci Not ation Length - exp str . length )+ exp str Ċ ĉ } ĊĊ ĉ override Ġfun Ġplayer Init ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ ĊĊĉ ĉ score Ġ= Ġ 0 Ċĉ ĉ score Rate Ġ= Ġ 1 Ċĉ ĉ max mult Ġ= Ġ 1 Ċĉ ĉ current time Ġ= Ġ 7 2 0 0 Ċĉ ĉ last score L Ġ= Ġ 0 Ċĉ ĉ qu ads Ġ= Ġ 0 Ċĉ ĉ sc get time Ġ= Ġ 0 Ċĉ ĉ last b 2 b Ġ= Ġfalse Ċĉ ĉ in combo Ġ= Ġfalse Ċĉ ĉ ing ame Ġ= Ġfalse Ċĉ ĉ ren Ġ= Ġ 0 Ċĉ ĉ all clear s Ġ= Ġ 0 Ċĉ ĉ max chain Ġ= Ġ 0 Ċĉ ĉ bg ml v Ġ= Ġ 0 Ċĉ ĉ ranking Rank Ġ= Ġ- 1 Ċĉ ĉ ranking Score Ġ= ĠArray ( RAN K ING _ TYPES ) Ġ{ Long Array ( RAN K ING _ MAX )} Ċĉ ĉ ranking Level Ġ= ĠArray ( RAN K ING _ TYPES ) Ġ{ IntArray ( RAN K ING _ MAX )} Ċĉ ĉ ranking Qu ads Ġ= ĠArray ( RAN K ING _ TYPES ) Ġ{ IntArray ( RAN K ING _ MAX )} Ċĉ ĉ if (! owner . replay Mode ) Ġ{ Ċĉĉ ĉ version Ġ= Ġ 1 Ċĉ ĉ } Ċĉ ĉ engine . owner . background Status . bg Ġ= Ġ 0 Ċĉ ĉ engine . frame color Ġ= Ġ 7 Ċ ĉ } ĊĊ ĉ fun Ġset Speed ( engine : Game Engine ) Ġ{ Ċĉ ĉ when ( game type ) Ġ{ Ċĉĉĉ 2 , Ġ 3 , Ġ 5 Ġ-> Ġ{ Ċĉĉĉ ĉ engine . speed . gravity Ġ= Ġ- 1 Ċĉĉĉ ĉ engine . speed . denom inator Ġ= Ġ 1 Ċĉĉ ĉ } Ċĉĉĉ 4 Ġ-> Ġ{ Ċĉĉĉ ĉ var Ġlv Ġ= Ġengine . statistics . level Ċĉĉĉ ĉ if ( lv < 0 ) Ġ{ Ċĉĉĉĉ ĉ lv Ġ= Ġ 0 Ċĉĉĉ ĉ } Ċĉĉĉ ĉ if ( lv >= table Gravity . size ) Ġ{ Ċĉĉĉĉ ĉ lv Ġ= Ġtable Gravity . size - 1 Ċĉĉĉ ĉ } Ċĉĉĉ ĉ engine . speed . gravity Ġ= Ġtable Gravity [ lv ] Ċĉĉĉ ĉ engine . speed . denom inator Ġ= Ġtable Denom inator [ lv ] Ċĉĉ ĉ } Ċĉĉ ĉ else Ġ-> Ġ{ Ċĉĉĉ ĉ var Ġlv Ġ= Ġengine . statistics . level Ċĉĉĉ ĉ if ( lv < 0 ) Ġ{ Ċĉĉĉĉ ĉ lv Ġ= Ġ 0 Ċĉĉĉ ĉ } Ċĉĉĉ ĉ if ( lv >= table Gravity . size ) Ġ{ Ċĉĉĉĉ ĉ lv Ġ= Ġtable Gravity . size - 1 Ċĉĉĉ ĉ } Ċĉĉĉ ĉ engine . speed . gravity Ġ= Ġtable Gravity [ lv ] Ċĉĉĉ ĉ engine . speed . denom inator Ġ= Ġtable Denom inator [ lv ] Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Setting ( engine : Game Engine , Ġplayer ID : Int ): Boolean Ġ{ Ċĉ ĉ if (! engine . owner . replay Mode ) Ġ{ Ċ // ĉĉ ĉ val Ġchange Ġ= Ġupdate Menu ( engine ) Ċĉĉ ĉ if ( engine . ctrl . is Push ( 4 ) && engine . stat c [ 3 ] >= 5 ) Ġ{ Ċĉĉĉ ĉ engine . play SE (" dec ide ") Ċĉĉĉ ĉ return Ġfalse Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . ctrl . is Push ( 5 )) Ġengine . quit flag Ġ= Ġtrue Ċĉĉ ĉ engine . stat c [ 3 ] ++ Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ engine . stat c [ 3 ] ++ Ċĉĉ ĉ engine . stat c [ 2 ] Ġ= Ġ- 1 Ċĉĉ ĉ if ( engine . stat c [ 3 ] >= 6 0 ) Ġreturn Ġfalse Ċĉ ĉ } Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ override Ġfun Ġstart Game ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ engine . tw ist Enable Ġ= Ġgame type == 1 || game type == 3 Ċĉ ĉ engine . use All Spin Bonus Ġ= Ġtrue Ċĉ ĉ engine . big Ġ= Ġgame type == 4 || game type == 5 Ċĉ ĉ engine . tw ist Allow Kick Ġ= Ġtrue Ċĉ ĉ engine . tw ist Enable EZ Ġ= Ġfalse Ċĉ ĉ engine . statistics . level Ġ= Ġ 0 Ċĉ ĉ engine . statistics . level Disp Add Ġ= Ġ 1 Ċĉ ĉ score Ġ= Ġ 0 Ċĉ ĉ current time Ġ= Ġstart time Ċĉ ĉ last score L Ġ= Ġ 0 Ċĉ ĉ sc get time Ġ= Ġ 0 Ċĉ ĉ qu ads Ġ= Ġ 0 Ċĉ ĉ ren Ġ= Ġ 0 Ċĉ ĉ max chain Ġ= Ġ 0 Ċĉ ĉ last b 2 b Ġ= Ġfalse Ċĉ ĉ in combo Ġ= Ġfalse Ċĉ ĉ score Rate Ġ= Ġ 1 Ċĉ ĉ max mult Ġ= Ġ 1 Ċĉ ĉ ing ame Ġ= Ġtrue Ċĉ ĉ set Speed ( engine ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġrender Last ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ if (! owner . menu Only ) Ġ{ Ċĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 0 , Ġ" AR CADE ĠS CORE ĠATT ACK ", Ġ 8 f ) Ċĉĉ ĉ if ( game type != 0 ) Ġreceiver . draw Score Font ( engine , Ġplayer ID , Ġ 2 , Ġ 1 , Ġ" (${ GAME TYPE _ LABEL S [ game type ]} ĠMODE )", Ġ 9 f ) ĊĊĉĉ ĉ var Ġcolour : Int Ċĉĉ ĉ val Ġevent : Int Ġ= Ġif ( receiver . next Display Type == 2 ) Ġ 6 Ġelse Ġ 4 Ċĉĉ ĉ if ( engine . stat == Game Engine . Status . SETTING || engine . stat == Game Engine . Status . RESULT && ! owner . replay Mode ) Ġ{ Ċĉĉĉ ĉ if (! owner . replay Mode && engine . ai == null ) Ġ{ Ċĉĉĉĉ ĉ val Ġscale Ġ= Ġif ( receiver . next Display Type == 2 ) Ġ 0 . 5 f Ġelse Ġ 1 . 0 f Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 , Ġevent - 1 , Ġ" LV ĠQ S ĠS CORE ", ĠCOLOR . PUR PLE , Ġscale ) Ċĉĉĉĉ ĉ colour Ġ= Ġ 0 Ċĉĉĉĉ ĉ while ( colour < 1 0 ) Ġ{ Ċĉĉĉĉĉ ĉ receiver . draw Score Grade ( engine , Ġplayer ID , Ġ- 2 , Ġevent + colour , ĠString . format ("% 2 d ", Ġcolour + 1 ), ĠCOLOR . YELLOW , Ġscale ) Ċĉĉĉĉĉ ĉ receiver . draw Score Font ( Ċĉĉĉĉĉĉ ĉ engine , Ġplayer ID , Ġ 1 , Ġevent + colour , Ġ"${ ranking Level [ game type ][ colour ]+ 1 }", Ċĉĉĉĉĉĉ ĉ colour == ranking Rank , Ġscale Ċĉĉĉĉĉ ĉ ) Ċĉĉĉĉĉ ĉ receiver . draw Score Font ( Ċĉĉĉĉĉĉ ĉ engine , Ġplayer ID , Ġ 4 , Ġevent + colour , Ġ"${ ranking Qu ads [ game type ][ colour ] }", Ċĉĉĉĉĉĉ ĉ colour == ranking Rank , Ġscale Ċĉĉĉĉĉ ĉ ) Ċĉĉĉĉĉ ĉ receiver . draw Score Font ( Ċĉĉĉĉĉĉ ĉ engine , Ġplayer ID , Ġ 7 , Ġevent + colour , Ċĉĉĉĉĉĉ ĉ format Score ( ranking Score [ game type ][ colour ]), Ġcolour == ranking Rank , Ġscale Ċĉĉĉĉĉ ĉ ) Ċĉĉĉĉĉ ĉ ++ colour Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 3 , Ġ" SCORE ", Ġ 8 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 4 , Ġformat Score ( score ), Ġ 5 f ) Ċĉĉĉ ĉ if ( last score L != 0 L ) Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 5 , Ġ"+ "+ format Score ( last score L )) ĊĊĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 7 , Ġ" LINES ", Ġ 8 f ) Ċĉĉĉ ĉ if ( engine . statistics . level >= 1 9 ) Ġ{ Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 8 , Ġengine . statistics . lines . toString ()) Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ receiver . draw Score Font ( Ċĉĉĉĉĉ ĉ engine , Ċĉĉĉĉĉ ĉ player ID , Ċĉĉĉĉĉĉ 0 , Ċĉĉĉĉĉĉ 8 , Ċĉĉĉĉĉ ĉ engine . statistics . lines . toString () +"/ "+ table Level Change [ engine . statistics . level + 1 ] Ċĉĉĉĉ ĉ ) Ċĉĉĉ ĉ } Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 0 , Ġ" LEVEL ", Ġ 8 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 1 , Ġ( engine . statistics . level + 1 ). toString ()) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 0 , Ġ 1 0 , Ġ" QU ADS ", Ġ 8 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 0 , Ġ 1 1 , Ġ"$ qu ads ", Ġ 6 f ) Ċĉĉĉ ĉ if ( game type != 4 && game type != 5 ) Ġ{ Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 3 , Ġ" CHAIN ", Ġ 8 f ) Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 4 , Ġ"$ ren ", ĠCOLOR . RED ) Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 3 , Ġ" ALL ĠC LE ARS ", Ġ 8 f ) Ċĉĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 4 , Ġ"$ all clear s ", ĠCOLOR . RED ) Ċĉĉĉ ĉ } Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 0 , Ġ 1 3 , Ġ" MULTI PLIER ", Ġ 8 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 0 , Ġ 1 4 , Ġ"${ Base Font . CROSS }$ score Rate %", Ġ 5 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 7 , Ġ" TIME ĠLEFT ", Ġ 2 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 8 , Ġcurrent time . to Time Str ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 0 , Ġ 1 7 , Ġ" TOTAL ĠTIME ", Ġ 9 f ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 1 0 , Ġ 1 8 , Ġengine . statistics . time . to Time Str ) Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Last ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ super . on Last ( engine , Ġplayer ID ) Ċĉ ĉ if ( ing ame && engine . statistics . time > 0 ) Ġ{ Ċĉĉ ĉ sc get time Ġ+= Ġscore Rate Ċĉĉ ĉ while ( sc get time >= 1 0 0 ) Ġ{ Ċĉĉĉ ĉ score ++ Ċĉĉĉ ĉ sc get time Ġ-= Ġ 1 0 0 Ċĉĉ ĉ } Ċĉĉ ĉ -- current time Ċĉĉ ĉ if ( current time <= 0 ) Ġ{ Ċĉĉĉ ĉ ing ame Ġ= Ġfalse Ċĉĉĉ ĉ engine . play SE (" level stop ") Ċĉĉĉ ĉ engine . game Ended () Ċĉĉĉ ĉ engine . reset Stat c () Ċĉĉĉ ĉ engine . stat Ġ= ĠGame Engine . Status . EX CELL ENT Ċĉĉ ĉ } Ġelse Ġif ( current time <= 6 0 0 && current time % 6 0 == 0 ) Ġ{ Ċĉĉĉ ĉ engine . play SE (" countdown ") Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Game Over ( engine : Game Engine , Ġplayer ID : Int ): Boolean Ġ{ Ċĉ ĉ ing ame Ġ= Ġfalse Ċĉ ĉ return Ġfalse Ċ ĉ } ĊĊ ĉ override Ġfun Ġcalc Score ( engine : Game Engine , Ġplayer ID : Int , Ġlines : Int ): Int Ġ{ Ċĉ ĉ last type Ġ= Ġmin Of ( lines , Ġ 4 ) Ċĉ ĉ last piece Ġ= Ġengine . now Piece Object !!. id Ċĉ ĉ var Ġpts Ġ= Ġcalc Score Base ( engine , Ġlines ) Ċĉ ĉ var Ġmax lines : Int Ċĉ ĉ if ( lines != 0 ) Ġ{ Ċĉĉ ĉ in combo Ġ= Ġtrue Ċĉĉ ĉ max lines Ġ= Ġ 2 Ċĉĉ ĉ while ( max lines <= lines ) Ġ{ Ċĉĉĉ ĉ pts Ġ*= Ġmax lines Ċĉĉĉ ĉ ++ max lines Ċĉĉ ĉ } Ċ // ĉĉ ĉ engine . play SE (" b 2 b _"+ if ( ren == 0 ) Ġ" start " Ġelse Ġ" continue ") Ċĉĉ ĉ ++ ren Ċĉĉ ĉ last b 2 b Ġ= Ġlines >= 4 || engine . tw ist Ċĉĉ ĉ qu ads Ġ+= Ġif ( lines >= 4 ) Ġ 1 Ġelse Ġ 0 Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ pts Ġ= Ġ 0 Ċĉĉ ĉ in combo Ġ= Ġfalse Ċĉ ĉ } Ċĉ ĉ if ( engine . tw ist ) Ġlast type Ġ+= Ġ 5 Ċĉ ĉ if ( lines >= 1 && engine . field . isEmpty ) Ġ{ Ċĉĉ ĉ engine . play SE (" br avo ") Ċĉĉ ĉ ++ all clear s Ċĉĉ ĉ last type Ġ+= Ġ 1 0 Ċĉ ĉ } Ċĉ ĉ pts Ġ= Ġpts * score Rate / 1 0 0 Ċĉ ĉ if (! last b 2 b && ! in combo ) Ġ{ Ċĉĉ ĉ if ( ren != 0 && game type != 4 && game type != 5 ) Ġ{ Ċĉĉĉ ĉ engine . play SE (" b 2 b _ end ") Ċĉĉ ĉ } Ċĉĉ ĉ ren Ġ= Ġ 0 Ċĉ ĉ } Ċĉ ĉ engine . statistics . score Line Ġ+= Ġpts Ċĉ ĉ score Ġ+= Ġpts ĊĊĉ ĉ if ( table B GM Change [ bg ml v ] ! =- 1 ) Ġ{ Ċĉĉ ĉ if ( engine . statistics . lines >= table B GM Change [ bg ml v ]- 5 ) Ġ{ Ċĉĉĉ ĉ owner . bg m Status . fade sw Ġ= Ġtrue Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . statistics . lines >= table B GM Change [ bg ml v ]) Ġ{ Ċĉĉĉ ĉ ++ bg ml v Ċĉĉĉ ĉ owner . bg m Status . bg m Ġ= ĠBG M Status . B GM . Generic ( bg ml v ) Ċĉĉĉ ĉ owner . bg m Status . fade sw Ġ= Ġfalse Ċĉĉ ĉ } Ċĉ ĉ } Ċĉ ĉ if ( engine . statistics . lines >= table Level Change [ engine . statistics . level + 1 ] && engine . statistics . level < 1 9 ) Ġ{ Ċĉĉ ĉ ++ engine . statistics . level Ċĉĉ ĉ current time Ġ+= Ġtime bonus Ċĉĉ ĉ owner . background Status . fade sw Ġ= Ġtrue Ċĉĉ ĉ owner . background Status . fade count Ġ= Ġ 0 Ċĉĉ ĉ owner . background Status . fade bg Ġ= Ġengine . statistics . level Ċĉĉ ĉ set Speed ( engine ) Ċĉĉ ĉ engine . play SE (" level up ") Ċĉ ĉ } Ċĉ ĉ if ( engine . statistics . level < 1 9 ) Ġ{ Ċĉĉ ĉ max lines Ġ= Ġtable Level Change [ engine . statistics . level + 1 ] Ċĉĉ ĉ val Ġmin lines Ġ= Ġtable Level Change [ engine . statistics . level ] Ċĉĉ ĉ val Ġlin er ange Ġ= Ġmax lines - min lines Ċĉĉ ĉ val Ġcurl ines Ġ= Ġengine . statistics . lines - min lines Ċĉĉ ĉ val Ġrest lines Ġ= Ġlin er ange - curl ines Ċĉĉ ĉ engine . meter Value Ġ= Ġcurl ines * receiver . get Meter Max ( engine )/( liner ange - 1 ) Ċĉĉ ĉ engine . meter Color Ġ= Ġ 3 Ċĉĉ ĉ if ( rest lines <= 1 0 ) Ġengine . meter Color Ġ= Ġ 2 Ċĉĉ ĉ if ( rest lines <= 4 ) Ġengine . meter Color Ġ= Ġ 1 Ċĉĉ ĉ if ( rest lines <= 2 ) Ġengine . meter Color Ġ= Ġ 0 Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ engine . meter Value Ġ= Ġcurrent time * receiver . get Meter Max ( engine )/ ' ê ¿ Ī '. code Ċĉĉ ĉ engine . meter Color Ġ= Ġif ( current time <= 1 0 ) Ġ 0 Ċĉĉ ĉ else Ġif ( current time <= 3 0 ) Ġ 1 Ċĉĉ ĉ else Ġif ( current time <= 6 0 ) Ġ 2 Ċĉĉ ĉ else Ġ 3 Ċĉ ĉ } Ċĉ ĉ score Rate Ġ= Ġ( 1 0 + engine . statistics . level )*( 2 0 + if ( game type != 4 && game type != 5 ) Ġren Ġelse Ġall clear s )*( 1 0 + qu ads )/ 2 0 Ċĉ ĉ if ( ren > max chain ) Ġmax chain Ġ= Ġren Ċĉ ĉ if ( score Rate > max mult ) Ġmax mult Ġ= Ġscore Rate Ċĉ ĉ return Ġpts Ċ ĉ } ĊĊ ĉ override Ġfun Ġrender Result ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 0 , Ġ" FINAL ĠS CORE ", ĠCOLOR . PUR PLE ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 , Ġformat Score ( score ), ĠCOLOR . YELLOW ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 2 , Ġ" QU ADS ", ĠCOLOR . PUR PLE ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 3 , Ġ"$ qu ads ", ĠCOLOR . CY AN ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 4 , Ġ" MAX ĠCH AIN ", ĠCOLOR . PUR PLE ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 5 , Ġ"$ max chain ", ĠCOLOR . RED ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 6 , Ġ" MAX ĠMULTI .", ĠCOLOR . PUR PLE ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 7 , Ġ"${ Base Font . CROSS }$ max mult ", ĠCOLOR . YELLOW ) Ċĉ ĉ draw Result Stats ( engine , Ġplayer ID , Ġreceiver , Ġ 8 , ĠCOLOR . PUR PLE , ĠStat istic . LINES , ĠStat istic . LEVEL , ĠStat istic . L PM , ĠStat istic . P PS ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġsave Replay ( engine : Game Engine , Ġplayer ID : Int , Ġprop : Custom Properties ): Boolean Ġ{ Ċĉ ĉ if (! owner . replay Mode && engine . ai == null ) Ġ{ Ċĉĉ ĉ update Ranking ( score , Ġengine . statistics . level , Ġqu ads , Ġgame type ) Ċĉĉ ĉ return Ġ( ranking Rank ! =- 1 ) Ċĉ ĉ } Ċĉ ĉ return Ġfalse Ċ ĉ } ĊĊ ĉ private Ġfun Ġupdate Ranking ( sc : Long , Ġlv : Int , Ġt et : Int , Ġtype : Int ) Ġ{ Ċĉ ĉ ranking Rank Ġ= Ġcheck Ranking ( sc , Ġlv , Ġt et , Ġtype ) Ċĉ ĉ if ( ranking Rank ! =- 1 ) Ġ{ Ċĉĉ ĉ for ( i Ġin Ġ 9 Ġdown To Ġranking Rank + 1 ) Ġ{ Ċĉĉĉ ĉ ranking Score [ type ][ i ] Ġ= Ġranking Score [ type ][ i - 1 ] Ċĉĉĉ ĉ ranking Level [ type ][ i ] Ġ= Ġranking Level [ type ][ i - 1 ] Ċĉĉĉ ĉ ranking Qu ads [ type ][ i ] Ġ= Ġranking Qu ads [ type ][ i - 1 ] Ċĉĉ ĉ } Ċĉĉ ĉ ranking Score [ type ][ ranking Rank ] Ġ= Ġsc Ċĉĉ ĉ ranking Level [ type ][ ranking Rank ] Ġ= Ġlv Ċĉĉ ĉ ranking Qu ads [ type ][ ranking Rank ] Ġ= Ġt et Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ private Ġfun Ġcheck Ranking ( sc : Long , Ġlv : Int , Ġt et : Int , Ġtype : Int ): Int Ġ{ Ċĉ ĉ for ( i Ġin Ġ 0 .. 9 ) Ġif ( sc > ranking Score [ type ][ i ]) Ġreturn Ġi Ċĉ ĉ else Ġif ( sc == ranking Score [ type ][ i ] && t et > ranking Qu ads [ type ][ i ]) Ġreturn Ġi Ċĉ ĉ else Ġif ( sc == ranking Score [ type ][ i ] && t et == ranking Qu ads [ type ][ i ] && lv > ranking Level [ type ][ i ]) Ġreturn Ġi Ċĉ ĉ return Ġ- 1 Ċ ĉ } ĊĊ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ private Ġconst Ġval ĠCURRENT _ VERSION Ġ= Ġ 1 Ċĉ ĉ private Ġval Ġtable Gravity Ġ= Ġint ArrayOf ( 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 2 , Ġ 3 , Ġ 4 , Ġ 5 , Ġ 3 , Ġ 4 , Ġ 5 , Ġ 7 , Ġ 1 0 , Ġ- 1 ) Ċĉ ĉ private Ġval Ġtable Denom inator Ġ= Ġint ArrayOf ( 6 0 , Ġ 3 0 , Ġ 2 0 , Ġ 1 5 , Ġ 1 2 , Ġ 1 0 , Ġ 6 , Ġ 4 , Ġ 3 , Ġ 2 , Ġ 2 , Ġ 2 , Ġ 2 , Ġ 2 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 , Ġ 1 ) Ċĉ ĉ private Ġval Ġtable B GM Change Ġ= Ġint ArrayOf ( 2 5 , Ġ 7 5 , Ġ 1 6 0 , Ġ 2 5 0 , Ġ- 1 ) Ċĉ ĉ private Ġval Ġtable Level Change Ġ= Ċĉĉ ĉ int ArrayOf ( 0 , Ġ 5 , Ġ 1 0 , Ġ 1 5 , Ġ 2 0 , Ġ 2 5 , Ġ 3 5 , Ġ 4 5 , Ġ 5 5 , Ġ 6 5 , Ġ 7 5 , Ġ 9 0 , Ġ 1 1 5 , Ġ 1 3 0 , Ġ 1 4 5 , Ġ 1 6 0 , Ġ 1 8 0 , Ġ 2 0 0 , Ġ 2 2 0 , Ġ 2 5 0 , Ġ- 1 ) Ċĉ ĉ private Ġconst Ġval ĠR ANK ING _ MAX Ġ= Ġ 1 3 ĊĊĉ ĉ private Ġenum Ġclass ĠGame type ( label : String ? Ġ= Ġnull ) Ġ{ Ċĉĉ ĉ Regular , ĠSpin , ĠMax Speed , ĠSpin Max (" Spin ĠMax Speed "), ĠMe ga , ĠMe ga Max (" Me ga ĠMax Speed "); ĊĊĉĉ ĉ val Ġlabel : String Ġ= Ġlabel Ġ?: Ġname Ċĉ ĉ } ĊĊĉ ĉ private Ġval ĠGAME TYPE _ LABEL S : Array < String > Ġ= ĠGame type . values (). map Ġ{ it . label }. to Typed Array () Ċĉ ĉ private Ġval ĠR ANK ING _ TYPES Ġ= ĠGAME TYPE _ LABEL S . size Ċĉ ĉ private Ġconst Ġval ĠGAME TYPE _ REG ULAR Ġ= Ġ 0 Ċĉ ĉ private Ġconst Ġval ĠGAME TYPE _ SP IN Ġ= Ġ 1 Ċĉ ĉ private Ġconst Ġval ĠGAME TYPE _ MAX SPEED Ġ= Ġ 2 Ċĉ ĉ private Ġconst Ġval ĠGAME TYPE _ MAX SPEED _ SP IN Ġ= Ġ 3 Ċĉ ĉ private Ġconst Ġval ĠGAME TYPE _ ME GA Ġ= Ġ 4 Ċĉ ĉ private Ġconst Ġval ĠGAME TYPE _ MAX SPEED _ ME GA Ġ= Ġ 5 Ċĉ ĉ private Ġconst Ġval Ġstart time Ġ= Ġ 9 0 0 0 Ċĉ ĉ private Ġconst Ġval Ġtime bonus Ġ= Ġ 1 8 0 0 Ċĉ ĉ private Ġconst Ġval Ġmax Number Length Ġ= Ġ 1 3 Ċĉ ĉ private Ġval Ġscore Cutoff Value : Long Ġ= Ġ( 1 0 . 0 ). pow ( max Number Length ). to Long () Ċĉ ĉ private Ġconst Ġval Ġsci Not ation Length Ġ= Ġ 1 7 Ċ ĉ } Ċ } Ċ