package Ġcom . ly ee ed ar . Game Ċ Ċ import Ġcom . badlogic . gdx . graphics . Color Ċ import Ġcom . badlogic . gdx . math . Interpolation Ċ import Ġcom . badlogic . gdx . math . Vector 2 Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . Actor Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . actions . Actions Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . actions . Actions . alpha Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . ui . Label Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . ui . Stack Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . ui . Table Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . utils . Texture Region Drawable Ċ import Ġcom . badlogic . gdx . utils . Align Ċ import Ġcom . badlogic . gdx . utils . Array Ċ import Ġcom . ly ee ed ar . Asc ension Ċ import Ġcom . ly ee ed ar . Components . name Ċ import Ġcom . ly ee ed ar . Global Ċ import Ġcom . ly ee ed ar . Main Game Ċ import Ġcom . ly ee ed ar . UI .* Ċ import Ġcom . ly ee ed ar . Util .* Ċ import Ġk tx . actors . alpha Ċ import Ġk tx . actors . then Ċ import Ġs quid p ony . Fake Language Gen Ċ import Ġs quid p ony . s quid math . Light R NG Ċ import Ġs quid p ony . s quid math . R NG Ċ import Ġjava . lang . System . currentTimeMillis Ċ Ċ abstract Ġclass ĠAbstract B ount y Ċ { Ċ ĉ val Ġtile Size Ġ= Ġ 6 4 f ĊĊ ĉ val Ġhours To Millis Ġ= Ġ 6 0 Ġ* Ġ 6 0 Ġ* Ġ 1 0 0 0 L ĊĊ ĉ var ĠstartTime Millis : ĠLong Ġ= Ġ 0 L Ċ ĉ var Ġduration Millis : ĠLong Ġ= Ġ 0 L Ċ ĉ late init Ġvar Ġtitle : ĠString Ċ ĉ var Ġasc ension : ĠAsc ension Ġ= ĠAsc ension . M UND ANE ĊĊ ĉ fun Ġis Complete () Ġ= Ġremaining () Ġ<= Ġ 0 Ċ ĉ fun ĠendTime () Ġ= ĠstartTime Millis Ġ+ Ġduration Millis Ċ ĉ fun Ġremaining () Ġ= ĠendTime () Ġ- ĠcurrentTime Millis () ĊĊ ĉ abstract Ġfun Ġget Tile (): ĠTable Ċ ĉ abstract Ġfun Ġget ClassName (): ĠString ĊĊ ĉ fun Ġcreate Card Table (): ĠTable Ċ ĉ { Ċĉ ĉ val Ġtable Ġ= ĠTable () ĊĊĉ ĉ val Ġasc ension Label Ġ= ĠLabel ( asc ension . name . ne aten (), ĠStatic s . skin , Ġ" title ") Ċĉ ĉ asc ension Label . color Ġ= Ġasc ension . colour . color () ĊĊĉ ĉ table . add ( asc ension Label ). pad ( 5 f ) Ċĉ ĉ table . row () ĊĊĉ ĉ table . add ( get Tile ()). pad ( 1 0 f ) Ċĉ ĉ table . row () ĊĊĉ ĉ val Ġtitle Label Ġ= ĠLabel ( title , ĠStatic s . skin , Ġ" card title "). wrap () Ċĉ ĉ title Label . align ( Align . center ) Ċĉ ĉ table . add ( title Label ). grow X (). pad ( 1 0 f ) Ċĉ ĉ table . row () ĊĊĉ ĉ val Ġduration Label Ġ= ĠLabel ( duration Millis . millis To Pretty Time ( show Seconds Ġ= Ġfalse ), ĠStatic s . skin , Ġ" card ") Ċĉ ĉ table . add ( duration Label ). pad ( 1 0 f ) Ċĉ ĉ table . row () ĊĊĉ ĉ return Ġtable Ċ ĉ } ĊĊ ĉ abstract Ġfun Ġcollect ( source : ĠActor , Ġgame Data Bar : ĠGame Data Bar , Ġnavigation Bar : ĠNavigation Bar ) ĊĊ ĉ fun Ġgenerate ( ran : ĠLight R NG ) Ċ ĉ { Ċĉ ĉ asc ension Ġ= ĠAsc ension . get Weighted Asc ension ( ran ) ĊĊĉ ĉ do Generate ( ran ) ĊĊĉ ĉ duration Millis Ġ= Ġ(( 1 f Ġ+ Ġasc ension . multiplier ) Ġ* Ġhours To Millis ). to Long () Ċ ĉ } Ċ ĉ abstract Ġfun Ġdo Generate ( ran : ĠLight R NG ) ĊĊ ĉ fun Ġsave ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ xml Data . set (" Type ", Ġget ClassName ()) Ċĉ ĉ xml Data . set (" StartTime ", ĠstartTime Millis ) Ċĉ ĉ xml Data . set (" Duration ", Ġduration Millis ) Ċĉ ĉ xml Data . set (" Title ", Ġtitle ) Ċĉ ĉ xml Data . set (" Asc ension ", Ġasc ension . ordinal ) ĊĊĉ ĉ do Save ( xml Data ) Ċ ĉ } Ċ ĉ abstract Ġfun Ġdo Save ( xml Data : ĠXml Data ) ĊĊ ĉ fun Ġload ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ val Ġtypename Ġ= Ġxml Data . get (" Type ") Ċĉ ĉ if Ġ( typename Ġ!= Ġget ClassName ()) Ġthrow ĠException (" B ount y Ġtype Ġ${ get ClassName ()} Ġdoes Ġnot Ġmatch Ġxml Ġname Ġ$ typename !") ĊĊĉ ĉ startTime Millis Ġ= Ġxml Data . getLong (" StartTime ") Ċĉ ĉ duration Millis Ġ= Ġxml Data . getLong (" Duration ") Ċĉ ĉ title Ġ= Ġxml Data . get (" Title ") Ċĉ ĉ asc ension Ġ= ĠAsc ension . Values [ xml Data . getInt (" Asc ension ")] ĊĊĉ ĉ do Load ( xml Data ) Ċ ĉ } Ċ ĉ abstract Ġfun Ġdo Load ( xml Data : ĠXml Data ) ĊĊ ĉ comp anion Ġobject Ċ ĉ { Ċĉ ĉ fun Ġload ( xml Data : ĠXml Data ): ĠAbstract B ount y Ċĉ ĉ { Ċĉĉ ĉ val Ġname Ġ= Ġxml Data . get (" Type ") Ċĉĉ ĉ val Ġb ount y Ġ= Ġcreate ( name ) ĊĊĉĉ ĉ bo unt y . load ( xml Data ) ĊĊĉĉ ĉ return Ġb ount y Ċĉ ĉ } ĊĊĉ ĉ fun Ġgenerate ( ran : ĠLight R NG Ġ= ĠRandom . random ): ĠAbstract B ount y Ċĉ ĉ { Ċĉĉ ĉ val Ġtypes Ġ= ĠarrayOf ( Ċĉĉĉ ĉ " G OLD ", Ċĉĉĉ ĉ " EXP ", Ċĉĉĉ ĉ " EQ U IP MENT ", Ċĉĉĉ ĉ " HER O " Ċĉĉ ĉ ) ĊĊĉĉ ĉ val Ġb ount y Ġ= Ġcreate ( types . random ( ran )) Ċĉĉ ĉ bo unt y . generate ( ran ) ĊĊĉĉ ĉ return Ġb ount y Ċĉ ĉ } ĊĊĉ ĉ fun Ġcreate ( name : ĠString ): ĠAbstract B ount y Ċĉ ĉ { Ċĉĉ ĉ return Ġwhen Ġ( name . toUpperCase ()) Ċĉĉ ĉ { Ċĉĉĉ ĉ " G OLD " Ġ-> ĠGold B ount y () Ċĉĉĉ ĉ " EXP " Ġ-> ĠExp B ount y () Ċĉĉĉ ĉ " EQ U IP MENT " Ġ-> ĠE quipment B ount y () Ċĉĉĉ ĉ " HER O " Ġ-> ĠHero B ount y () Ċĉĉĉ ĉ else Ġ-> Ġthrow ĠException (" Unknown Ġb ount y Ġtype Ġ$ name !") Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } Ċ } Ċ Ċ class ĠGold B ount y Ġ: ĠAbstract B ount y () Ċ { Ċ ĉ var Ġamount : ĠInt Ġ= Ġ 0 ĊĊ ĉ override Ġfun Ġget Tile (): ĠTable Ċ ĉ { Ċĉ ĉ val Ġgold Tile Ġ= ĠStack () Ċĉ ĉ gold Tile . add ( Sprite Widget ( Asset Manager . load Sprite (" GUI / text ured _ back "), Ġtile Size , Ġtile Size )) Ċĉ ĉ gold Tile . add ( Sprite Widget ( Asset Manager . load Sprite (" O ry x / Custom / items / coin _ gold _ p ile "), Ġtile Size , Ġtile Size )) ĊĊĉ ĉ val Ġgold Amount Table Ġ= ĠTable () Ċĉ ĉ gold Amount Table . background Ġ= ĠTexture Region Drawable ( Asset Manager . load Texture Region (" white ")). tint ( Color ( 0 f , Ġ 0 f , Ġ 0 f , Ġ 0 . 6 f )) Ċĉ ĉ gold Amount Table . add ( Label ( amount . pretty Print (), ĠStatic s . skin , Ġ" small ")). pad Bottom ( 5 f ) ĊĊĉ ĉ gold Tile . add Table ( gold Amount Table ). expand Y (). grow X (). bottom () Ċĉ ĉ gold Tile . add ( Sprite Widget ( Asset Manager . load Sprite (" GUI / Por trait Frame Border "), Ġtile Size , Ġtile Size )) ĊĊĉ ĉ val Ġtable Ġ= ĠTable () Ċĉ ĉ table . add ( gold Tile ). grow () ĊĊĉ ĉ return Ġtable Ċ ĉ } ĊĊ ĉ override Ġfun Ġcollect ( source : ĠActor , Ġgame Data Bar : ĠGame Data Bar , Ġnavigation Bar : ĠNavigation Bar ) Ċ ĉ { Ċĉ ĉ Future . call ({ ĠGlobal . data . gold Ġ+= Ġamount Ġ}, Ġ 1 f ) ĊĊĉ ĉ var Ġdelay Ġ= Ġ 0 f Ċĉ ĉ for Ġ( i Ġin Ġ 0 Ġuntil Ġ 1 5 ) Ċĉ ĉ { Ċĉĉ ĉ val Ġsrc Ġ= Ġsource . local To Stage Coordinates ( Vector 2 ( source . width Ġ/ Ġ 2 f , Ġsource . height Ġ/ Ġ 2 f )) ĊĊĉĉ ĉ val Ġdst Table Ġ= Ġgame Data Bar . gold Table Ċĉĉ ĉ val Ġdst Ġ= Ġdst Table . local To Stage Coordinates ( Vector 2 ()) ĊĊĉĉ ĉ val Ġwidget Ġ= ĠSprite Widget ( Asset Manager . load Sprite (" O ry x / uf _ split / uf _ items / coin _ gold "), Ġ 1 6 f , Ġ 1 6 f ) Ċĉĉ ĉ widget . setSize ( 1 6 f , Ġ 1 6 f ) Ċĉĉ ĉ widget . setPosition ( src . x , Ġsrc . y ) Ċĉĉ ĉ widget . to Front () Ċĉĉ ĉ widget . alpha Ġ= Ġ 0 f ĊĊĉĉ ĉ val Ġspark le Particle Ġ= ĠParticle Effect Actor ( Asset Manager . load Particle Effect (" Get Equipment ", Ġtime Multiplier Ġ= Ġ 1 . 2 f ). get Particle Effect (), Ġtrue ) Ċĉĉ ĉ spark le Particle . color Ġ= ĠColor . G OLD Ċĉĉ ĉ spark le Particle . setSize ( dst Table . height , Ġdst Table . height ) Ċĉĉ ĉ spark le Particle . setPosition ( dst . x , Ġdst . y ) ĊĊĉĉ ĉ val Ġsequence Ġ= Ċĉĉĉ ĉ alpha ( 0 f ) Ġthen Ċĉĉĉ ĉ Actions . delay ( delay ) Ġthen Ċĉĉĉĉ ĉ alpha ( 1 f ) Ġthen Ċĉĉĉ ĉ Actions . parallel ( Ċĉĉĉĉ ĉ m ote ( src , Ġdst , Ġ 1 f , ĠInterpol ation . exp 5 , Ġfalse ), Ċĉĉĉĉ ĉ Actions . scale To ( 0 . 7 f , Ġ 0 . 7 f , Ġ 1 f ), Ċĉĉĉĉ ĉ Actions . delay ( 0 . 8 f ) Ġthen Ġlambda Ġ{ ĠStatic s . stage . add Actor ( spark le Particle ) Ġ} Ġthen ĠActions . fadeOut ( 0 . 1 f )) Ġthen Ċĉĉĉĉ ĉ Actions . remove Actor () Ċĉĉ ĉ widget . addAction ( sequence ) ĊĊĉĉ ĉ Statics . stage . add Actor ( widget ) ĊĊĉĉ ĉ delay Ġ+= Ġ 0 . 0 1 f Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġget ClassName (): ĠString Ġ= Ġ" G OLD " ĊĊ ĉ override Ġfun Ġdo Generate ( ran : ĠLight R NG ) Ċ ĉ { Ċĉ ĉ // Ġstart Ġwith Ġ 5 0 0 Ġgold Ċĉ ĉ var Ġgold Ġ= Ġ 5 0 0 ĊĊĉ ĉ gold Ġ+= Ġ( gold Ġ* Ġasc ension . multiplier Ġ* Ġ 1 . 5 f ). toInt () ĊĊĉ ĉ amount Ġ= Ġgold ĊĊĉ ĉ // Ġgenerate Ġtitle ĊĊĉ ĉ // Ġpick Ġaction Ċĉ ĉ val Ġactions Ġ= ĠarrayOf ( Ċĉĉ ĉ " R aid ", Ċĉĉ ĉ " P illage ", Ċĉĉ ĉ " Lo ot ", Ċĉĉ ĉ " Explore ", Ċĉĉ ĉ " Map ", Ċĉĉ ĉ " Invest igate ", Ċĉĉ ĉ " Collect Ġin ", Ċĉĉ ĉ " Search ", Ċĉĉ ĉ " Gather Ġat ", Ċĉĉ ĉ " Del ve Ġinto ", Ċĉĉ ĉ " Exam ine ", Ċĉĉ ĉ " H unt Ġin ", Ċĉĉ ĉ " Pro spect ", Ċĉĉ ĉ " S cout ", Ċĉĉ ĉ " Quest Ġat ", Ċĉĉ ĉ " Quest Ġin ", Ċĉĉ ĉ " Adventure Ġat ", Ċĉĉ ĉ " Adventure Ġin ", Ċĉĉ ĉ " Jo urney Ġto ", Ċĉĉ ĉ " Vo y age Ġto ", Ċĉĉ ĉ " Ass ault ", Ċĉĉ ĉ " De se crate ", Ċĉĉ ĉ " R ans ack ", Ċĉĉ ĉ " Des po il ", Ċĉĉ ĉ " S ack " Ċĉ ĉ ) Ċĉ ĉ val Ġaction Ġ= Ġactions . random ( ran ) ĊĊĉ ĉ // Ġpick Ġlocation Ċĉ ĉ val Ġlocation Name Ġ= ĠFake Language Gen . F ANT ASY _ NAME . word ( R NG ( ran ), Ġtrue ) ĊĊĉ ĉ val Ġlocation Types Ġ= ĠarrayOf ( Ċĉĉ ĉ " Ru ins ", Ċĉĉ ĉ " Rem ains ", Ċĉĉ ĉ " W re ck age ", Ċĉĉ ĉ " W re ck ", Ċĉĉ ĉ " Crypt s ", Ċĉĉ ĉ " Tom bs ", Ċĉĉ ĉ " Cat ac om bs ", Ċĉĉ ĉ " D ungeon ", Ċĉĉ ĉ " Ma us ole um ", Ċĉĉ ĉ " Sep ul cher ", Ċĉĉ ĉ " Vault ", Ċĉĉ ĉ " Sh r ine ", Ċĉĉ ĉ " Pal ace ", Ċĉĉ ĉ " M ansion ", Ċĉĉ ĉ " Castle ", Ċĉĉ ĉ " Man or ", Ċĉĉ ĉ " Ch ate au ", Ċĉĉ ĉ " Temp le ", Ċĉĉ ĉ " Ch ap el ", Ċĉĉ ĉ " Ch urch ", Ċĉĉ ĉ " Pag oda ", Ċĉĉ ĉ " San ct uary ", Ċĉĉ ĉ " Gr ave ", Ċĉĉ ĉ " Forest ", Ċĉĉ ĉ " C aves ", Ċĉĉ ĉ " C ave ", Ċĉĉ ĉ " Ca ver ns ", Ċĉĉ ĉ " W ood ", Ċĉĉ ĉ " Th icket ", Ċĉĉ ĉ " W ood land ", Ċĉĉ ĉ " Jun gle ", Ċĉĉ ĉ " Cop se ", Ċĉĉ ĉ " We ald ", Ċĉĉ ĉ " Gro ve " Ċĉ ĉ ) Ċĉ ĉ val Ġlocation Type Ġ= Ġlocation Types . random ( ran ) ĊĊĉ ĉ val Ġarrange ment Types Ġ= ĠarrayOf ( Ċĉĉ ĉ "$ location Type Ġof Ġ$ location Name ", Ċĉĉ ĉ "$ location Name Ġ$ location Type " Ċĉ ĉ ) Ċĉ ĉ val Ġarrange ment Ġ= Ġarrange ment Types . random ( ran ) ĊĊĉ ĉ title Ġ= Ġ"$ action Ġthe Ġ$ arrange ment " Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Save ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ xml Data . set (" Amount ", Ġamount ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Load ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ amount Ġ= Ġxml Data . getInt (" Amount ") Ċ ĉ } Ċ } Ċ Ċ class ĠExp B ount y Ġ: ĠAbstract B ount y () Ċ { Ċ ĉ var Ġamount : ĠInt Ġ= Ġ 0 ĊĊ ĉ override Ġfun Ġget Tile (): ĠTable Ċ ĉ { Ċĉ ĉ val Ġtile Ġ= ĠStack () Ċĉ ĉ tile . add ( Sprite Widget ( Asset Manager . load Sprite (" GUI / text ured _ back "), Ġtile Size , Ġtile Size )) Ċĉ ĉ tile . add ( Sprite Widget ( Asset Manager . load Sprite (" O ry x / uf _ split / uf _ items / book _ blue "), Ġtile Size , Ġtile Size )) ĊĊĉ ĉ val Ġamount Table Ġ= ĠTable () Ċĉ ĉ amount Table . background Ġ= ĠTexture Region Drawable ( Asset Manager . load Texture Region (" white ")). tint ( Color ( 0 f , Ġ 0 f , Ġ 0 f , Ġ 0 . 6 f )) Ċĉ ĉ amount Table . add ( Label ( amount . pretty Print (), ĠStatic s . skin , Ġ" small ")). pad Bottom ( 5 f ) ĊĊĉ ĉ tile . add Table ( amount Table ). expand Y (). grow X (). bottom () Ċĉ ĉ tile . add ( Sprite Widget ( Asset Manager . load Sprite (" GUI / Por trait Frame Border "), Ġtile Size , Ġtile Size )) ĊĊĉ ĉ val Ġtable Ġ= ĠTable () Ċĉ ĉ table . add ( tile ). grow () ĊĊĉ ĉ return Ġtable Ċ ĉ } ĊĊ ĉ override Ġfun Ġcollect ( source : ĠActor , Ġgame Data Bar : ĠGame Data Bar , Ġnavigation Bar : ĠNavigation Bar ) Ċ ĉ { Ċĉ ĉ Future . call ({ ĠGlobal . data . experience Ġ+= Ġamount Ġ}, Ġ 1 f ) ĊĊĉ ĉ var Ġdelay Ġ= Ġ 0 f Ċĉ ĉ for Ġ( i Ġin Ġ 0 Ġuntil Ġ 1 5 ) Ċĉ ĉ { Ċĉĉ ĉ val Ġsrc Ġ= Ġsource . local To Stage Coordinates ( Vector 2 ( source . width Ġ/ Ġ 2 f , Ġsource . height Ġ/ Ġ 2 f )) ĊĊĉĉ ĉ val Ġdst Table Ġ= Ġgame Data Bar . exp Table Ċĉĉ ĉ val Ġdst Ġ= Ġdst Table . local To Stage Coordinates ( Vector 2 ()) ĊĊĉĉ ĉ val Ġwidget Ġ= ĠSprite Widget ( Asset Manager . load Sprite (" O ry x / uf _ split / uf _ items / crystal _ sky "), Ġ 1 6 f , Ġ 1 6 f ) Ċĉĉ ĉ widget . setSize ( 1 6 f , Ġ 1 6 f ) Ċĉĉ ĉ widget . setPosition ( src . x , Ġsrc . y ) Ċĉĉ ĉ widget . to Front () Ċĉĉ ĉ widget . alpha Ġ= Ġ 0 f ĊĊĉĉ ĉ val Ġspark le Particle Ġ= ĠParticle Effect Actor ( Asset Manager . load Particle Effect (" Get Equipment ", Ġtime Multiplier Ġ= Ġ 1 . 2 f ). get Particle Effect (), Ġtrue ) Ċĉĉ ĉ spark le Particle . color Ġ= ĠColor . CY AN Ċĉĉ ĉ spark le Particle . setSize ( dst Table . height , Ġdst Table . height ) Ċĉĉ ĉ spark le Particle . setPosition ( dst . x , Ġdst . y ) ĊĊĉĉ ĉ val Ġsequence Ġ= Ċĉĉĉ ĉ alpha ( 0 f ) Ġthen Ċĉĉĉĉ ĉ Actions . delay ( delay ) Ġthen Ċĉĉĉĉ ĉ alpha ( 1 f ) Ġthen Ċĉĉĉĉ ĉ Actions . parallel ( Ċĉĉĉĉĉ ĉ m ote ( src , Ġdst , Ġ 1 f , ĠInterpol ation . exp 5 , Ġfalse ), Ċĉĉĉĉĉ ĉ Actions . scale To ( 0 . 7 f , Ġ 0 . 7 f , Ġ 1 f ), Ċĉĉĉĉĉ ĉ Actions . delay ( 0 . 8 f ) Ġthen Ġlambda Ġ{ ĠStatic s . stage . add Actor ( spark le Particle ) Ġ} Ġthen ĠActions . fadeOut ( 0 . 1 f )) Ġthen Ċĉĉĉĉ ĉ Actions . remove Actor () Ċĉĉ ĉ widget . addAction ( sequence ) ĊĊĉĉ ĉ Statics . stage . add Actor ( widget ) ĊĊĉĉ ĉ delay Ġ+= Ġ 0 . 0 1 f Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġget ClassName (): ĠString Ġ= Ġ" EXP " ĊĊ ĉ override Ġfun Ġdo Generate ( ran : ĠLight R NG ) Ċ ĉ { Ċĉ ĉ val Ġlevel Ġ= ĠGlobal . data . getCurrent Level () Ċĉ ĉ val Ġexp Required Ġ= ĠGlobal . get Experience For Level ( level ) ĊĊĉ ĉ val Ġreward Ġ= Ġexp Required Ġ+ Ġ( exp Required Ġ* Ġasc ension . multiplier Ġ* Ġ 1 . 5 f ). toInt () Ċĉ ĉ amount Ġ= Ġreward ĊĊĉ ĉ // Ġgenerate Ġtitle ĊĊĉ ĉ // Ġpick Ġaction Ċĉ ĉ val Ġactions Ġ= ĠarrayOf ( Ċĉĉ ĉ " Study Ġwith ", Ċĉĉ ĉ " Deb ate Ġwith ", Ċĉĉ ĉ " Exercise Ġwith ", Ċĉĉ ĉ " Inspect ", Ċĉĉ ĉ " Survey ", Ċĉĉ ĉ " In quire Ġabout ", Ċĉĉ ĉ " Train Ġwith ", Ċĉĉ ĉ " S par Ġwith ", Ċĉĉ ĉ " Listen Ġto ", Ċĉĉ ĉ " Ob serve ", Ċĉĉ ĉ " Fight Ġagainst ", Ċĉĉ ĉ " Att end Ġa Ġlect ure Ġby ", Ċĉĉ ĉ " Take Ġa Ġclass Ġby ", Ċĉĉ ĉ " Get Ġinstruct ed Ġby ", Ċĉĉ ĉ " Get Ġta ught Ġby ", Ċĉĉ ĉ " Challenge ", Ċĉĉ ĉ " Cl ash Ġwith ", Ċĉĉ ĉ " Protect ", Ċĉĉ ĉ " Me et ", Ċĉĉ ĉ " Ass ault ", Ċĉĉ ĉ " B rawl Ġwith ", Ċĉĉ ĉ " D uel ", Ċĉĉ ĉ " Gr apple Ġwith ", Ċĉĉ ĉ " J ou st Ġwith ", Ċĉĉ ĉ " Sc uffle Ġwith ", Ċĉĉ ĉ " Sc rap Ġwith ", Ċĉĉ ĉ " W rest le Ġwith ", Ċĉĉ ĉ " Exchange Ġblow s Ġwith " Ċĉĉĉĉĉĉĉ Ġ) Ċĉ ĉ val Ġaction Ġ= Ġactions . random ( ran ) ĊĊĉ ĉ // Ġpick Ġperson Ċĉ ĉ val Ġperson Name Ġ= ĠFake Language Gen . F ANT ASY _ NAME . word ( R NG ( ran ), Ġtrue ) ĊĊĉ ĉ val Ġperson Titles Ġ= ĠarrayOf ( Ċĉĉ ĉ " Capt ain ", Ċĉĉ ĉ " Boss ", Ċĉĉ ĉ " Command er ", Ċĉĉ ĉ " Off icer ", Ċĉĉ ĉ " Ch ie ft an ", Ċĉĉ ĉ " M ist ress ", Ċĉĉ ĉ " General ", Ċĉĉ ĉ " Master ", Ċĉĉ ĉ " M age ", Ċĉĉ ĉ " Wizard ", Ċĉĉ ĉ " Sch olar ", Ċĉĉ ĉ " K night ", Ċĉĉ ĉ " Fight er ", Ċĉĉ ĉ " War ri or ", Ċĉĉ ĉ " L ie ut enant ", Ċĉĉ ĉ " Ast ro log er ", Ċĉĉ ĉ " Con j urer ", Ċĉĉ ĉ " Div iner ", Ċĉĉ ĉ " En chan ter ", Ċĉĉ ĉ " Mag us ", Ċĉĉ ĉ " N ec rom ancer ", Ċĉĉ ĉ " Occ ult ist ", Ċĉĉ ĉ " Sh aman ", Ċĉĉ ĉ " S or cer er ", Ċĉĉ ĉ " War lock ", Ċĉĉ ĉ " W itch ", Ċĉĉ ĉ " C aval ier ", Ċĉĉ ĉ " Champ ion ", Ċĉĉ ĉ " Che val ier ", Ċĉĉ ĉ " Pal adin ", Ċĉĉ ĉ " War pri est ", Ċĉĉ ĉ " C ler ic ", Ċĉĉ ĉ " Temp lar ", Ċĉĉ ĉ " Hero ", Ċĉĉ ĉ " L ord " Ċĉĉĉĉĉĉĉĉ ĠĠ Ġ) Ċĉ ĉ val Ġperson Title Ġ= Ġperson Titles . random ( ran ) ĊĊĉ ĉ title Ġ= Ġ"$ action Ġ$ person Title Ġ$ person Name " Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Save ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ xml Data . set (" Amount ", Ġamount ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Load ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ amount Ġ= Ġxml Data . getInt (" Amount ") Ċ ĉ } Ċ } Ċ Ċ class ĠE quipment B ount y Ġ: ĠAbstract B ount y () Ċ { Ċ ĉ late init Ġvar Ġequipment : ĠE quipment ĊĊ ĉ override Ġfun Ġget Tile (): ĠTable Ċ ĉ { Ċĉ ĉ return Ġequipment . create Tile ( tile Size ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġcollect ( source : ĠActor , Ġgame Data Bar : ĠGame Data Bar , Ġnavigation Bar : ĠNavigation Bar ) Ċ ĉ { Ċĉ ĉ Global . data . equipment . add ( equipment ) ĊĊĉ ĉ val Ġsrc Ġ= Ġsource . local To Stage Coordinates ( Vector 2 ( source . width Ġ/ Ġ 2 f , Ġsource . height Ġ/ Ġ 2 f )) ĊĊĉ ĉ val Ġdst Table Ġ= Ġnavigation Bar . screen Map [ Main Game . Screen Enum . HER OES ] Ċĉ ĉ val Ġdst Ġ= Ġdst Table . local To Stage Coordinates ( Vector 2 ()) ĊĊĉ ĉ val Ġwidget Ġ= ĠMask ed Texture ( equipment . full Icon ) Ċĉ ĉ widget . setSize ( 4 8 f , Ġ 4 8 f ) Ċĉ ĉ widget . setPosition ( src . x , Ġsrc . y ) Ċĉ ĉ widget . to Front () ĊĊĉ ĉ val Ġspark le Particle Ġ= ĠParticle Effect Actor ( Asset Manager . load Particle Effect (" Get Equipment ", Ġtime Multiplier Ġ= Ġ 1 . 2 f ). get Particle Effect (), Ġtrue ) Ċĉ ĉ spark le Particle . color Ġ= ĠColor . WHITE . cpy (). lerp ( equipment . asc ension . colour . color (), Ġ 0 . 3 f ) Ċĉ ĉ spark le Particle . setSize ( dst Table . height , Ġdst Table . height ) Ċĉ ĉ spark le Particle . setPosition ( dst Table . x Ġ+ Ġdst Table . width * 0 . 5 f Ġ- Ġdst Table . height Ġ* Ġ 0 . 5 f , Ġdst Table . y ) ĊĊĉ ĉ val Ġsequence Ġ= Ċĉĉĉ ĉ Actions . parallel ( Ċĉĉĉĉ ĉ m ote ( src , Ġdst , Ġ 1 f , ĠInterpol ation . exp 5 , Ġfalse ), Ċĉĉĉĉ ĉ Actions . scale To ( 0 . 7 f , Ġ 0 . 7 f , Ġ 1 f ), Ċĉĉĉĉ ĉ Actions . delay ( 0 . 9 f ) Ġthen Ġlambda Ġ{ ĠStatic s . stage . add Actor ( spark le Particle ) Ġ} Ġthen ĠActions . fadeOut ( 0 . 1 f )) Ġthen Ċĉĉĉ ĉ Actions . remove Actor () Ċĉ ĉ widget . addAction ( sequence ) ĊĊĉ ĉ Statics . stage . add Actor ( widget ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġget ClassName (): ĠString Ġ= Ġ" EQ U IP MENT " ĊĊ ĉ override Ġfun Ġdo Generate ( ran : ĠLight R NG ) Ċ ĉ { Ċĉ ĉ val Ġlevel Ġ= ĠGlobal . data . getCurrent Level () Ċĉ ĉ equipment Ġ= ĠE quipment Creator . create Random ( level , Ġran , Ġasc ension Ġ= Ġasc ension ) ĊĊĉ ĉ // Ġgenerate Ġtitle ĊĊĉ ĉ // Ġpick Ġaction Ċĉ ĉ val Ġactions Ġ= ĠarrayOf ( Ċĉĉ ĉ " Ste al ", Ċĉĉ ĉ " N ab ", Ċĉĉ ĉ " Appro priate ", Ċĉĉ ĉ " Pin ch ", Ċĉĉ ĉ " Pur lo in ", Ċĉĉ ĉ " Conf is cate ", Ċĉĉ ĉ " Rob ", Ċĉĉ ĉ " P il fer ", Ċĉĉ ĉ " Acquire ", Ċĉĉ ĉ " Ob tain ", Ċĉĉ ĉ " Discover ", Ċĉĉ ĉ " Make ", Ċĉĉ ĉ " Build ", Ċĉĉ ĉ " Craft ", Ċĉĉ ĉ " Forge ", Ċĉĉ ĉ " Create ", Ċĉĉ ĉ " Design ", Ċĉĉ ĉ " Con ceive ", Ċĉĉ ĉ " Construct ", Ċĉĉ ĉ " Invent ", Ċĉĉ ĉ " Produce ", Ċĉĉ ĉ " Shape ", Ċĉĉ ĉ " Fabric ate ", Ċĉĉ ĉ " As semble ", Ċĉĉ ĉ " Man ufacture ", Ċĉĉ ĉ " Engine er " Ċĉĉĉĉĉĉĉ Ġ) Ċĉ ĉ val Ġaction Ġ= Ġactions . random ( ran ) ĊĊĉ ĉ val Ġa Ġ= Ġif Ġ( equipment . fullName [ 0 ]. is V owel ()) Ġ" an " Ġelse Ġ" a " ĊĊĉ ĉ title Ġ= Ġ"$ action Ġ$ a Ġ${ equipment . fullName }" Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Save ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ val Ġequip El Ġ= Ġxml Data . addChild (" Equipment ") Ċĉ ĉ equipment . save ( equip El ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Load ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ equipment Ġ= ĠE quipment . load ( xml Data . getChild ByName (" Equipment ") !! ) Ċ ĉ } Ċ } Ċ Ċ class ĠHero B ount y Ġ: ĠAbstract B ount y () Ċ { Ċ ĉ late init Ġvar Ġhero : ĠString ĊĊ ĉ override Ġfun Ġget Tile (): ĠTable Ċ ĉ { Ċĉ ĉ val Ġentity Data Ġ= ĠGlobal . data . hero Pool . first Ġ{ Ġit . faction Entity . entity Path Ġ== Ġhero Ġ} ĊĊĉ ĉ return Ġentity Data . faction Entity . create Tile ( tile Size , ĠAsc ension . M UND ANE ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġcollect ( source : ĠActor , Ġgame Data Bar : ĠGame Data Bar , Ġnavigation Bar : ĠNavigation Bar ) Ċ ĉ { Ċĉ ĉ val Ġentity Data Ġ= ĠGlobal . data . hero Pool . first Ġ{ Ġit . faction Entity . entity Path Ġ== Ġhero Ġ} Ċĉ ĉ entity Data . asc ension Shards Ġ+= Ġ 1 ĊĊĉ ĉ val Ġsrc Ġ= Ġsource . local To Stage Coordinates ( Vector 2 ( source . width Ġ/ Ġ 2 f , Ġsource . height Ġ/ Ġ 2 f )) ĊĊĉ ĉ val Ġdst Table Ġ= Ġnavigation Bar . screen Map [ Main Game . Screen Enum . HER OES ] Ċĉ ĉ val Ġdst Ġ= Ġdst Table . local To Stage Coordinates ( Vector 2 ()) ĊĊĉ ĉ val Ġwidget Ġ= ĠSprite Widget ( Asset Manager . load Sprite (" Particle / shard "), Ġ 1 6 f , Ġ 1 6 f ) Ċĉ ĉ widget . color Ġ= ĠColour . WHITE . copy (). lerp ( entity Data . faction Entity . r arity . colour , Ġ 0 . 7 f ). color () Ċĉ ĉ widget . setSize ( 1 6 f , Ġ 1 6 f ) Ċĉ ĉ widget . setPosition ( src . x , Ġsrc . y ) Ċĉ ĉ widget . to Front () ĊĊĉ ĉ val Ġchosen Dst Ġ= Ġdst . cpy () Ċĉ ĉ chosen Dst . x Ġ+= Ġdst Table . width Ġ* Ġ 0 . 5 f Ġ* ĠRandom . random () Ċĉ ĉ chosen Dst . y Ġ+= Ġdst Table . height Ġ* Ġ 0 . 5 f Ġ* ĠRandom . random () ĊĊĉ ĉ val Ġparticle Ġ= ĠAsset Manager . load Particle Effect (" Get Shard ", Ġtime Multiplier Ġ= Ġ 1 . 2 f ) Ċĉ ĉ particle . colour Ġ= ĠColour . WHITE . copy (). lerp ( entity Data . faction Entity . r arity . colour , Ġ 0 . 7 f ) ĊĊĉ ĉ val Ġshard Particle Ġ= ĠParticle Effect Actor ( particle . get Particle Effect (), Ġtrue ) Ċĉ ĉ shard Particle . setSize ( dst Table . height , Ġdst Table . height ) Ċĉ ĉ shard Particle . setPosition ( chosen Dst . x Ġ- Ġ 1 6 f , Ġchosen Dst . y Ġ- Ġ 1 6 f ) ĊĊĉ ĉ val Ġsequence Ġ= Ċĉĉ ĉ Actions . parallel ( Ċĉĉĉ ĉ m ote ( src , Ġchosen Dst , Ġ 1 f Ġ+ Ġ 0 . 0 2 f , ĠInterpol ation . exp 5 , Ġtrue ), Ċĉĉĉ ĉ Actions . scale To ( 0 . 7 f , Ġ 0 . 7 f , Ġ 1 f ), Ċĉĉĉ ĉ Actions . delay ( 0 . 8 f Ġ+ Ġ 0 . 0 2 f ) Ġthen Ġlambda Ġ{ ĠStatic s . stage . add Actor ( shard Particle ) Ġ} Ġthen ĠActions . fadeOut ( 0 . 1 f )) Ġthen Ċĉĉĉ ĉ Actions . remove Actor () Ċĉ ĉ widget . addAction ( sequence ) ĊĊĉ ĉ Statics . stage . add Actor ( widget ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġget ClassName (): ĠString Ġ= Ġ" HER O " ĊĊ ĉ override Ġfun Ġdo Generate ( ran : ĠLight R NG ) Ċ ĉ { Ċĉ ĉ val Ġpossible D rops Ġ= ĠArray < Faction Entity >() Ċĉ ĉ for Ġ( faction Ġin ĠGlobal . data . unlocked F actions ) Ċĉ ĉ { Ċĉĉ ĉ for Ġ( hero Ġin Ġf action . hero es ) Ċĉĉ ĉ { Ċĉĉĉ ĉ if Ġ( Global . data . hero Pool . any { Ġit . faction Entity Ġ== Ġhero }) Ċĉĉĉ ĉ { Ċĉĉĉĉ ĉ for Ġ( i Ġin Ġ 0 Ġuntil Ġhero . r arity . drop Rate ) Ċĉĉĉĉ ĉ { Ċĉĉĉĉĉ ĉ possible D rops . add ( hero ) Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉ ĉ } ĊĊĉ ĉ val Ġhero Data Ġ= Ġpossible D rops . random ( ran ) Ċĉ ĉ hero Ġ= Ġhero Data . entity Path Ċĉ ĉ asc ension Ġ= Ġhero Data . r arity . asc ension ĊĊĉ ĉ val Ġentity Data Ġ= ĠGlobal . data . hero Pool . first Ġ{ Ġit . faction Entity Ġ== Ġhero Data Ġ} Ċĉ ĉ val Ġentity Ġ= Ġentity Data . getEntity (" 1 ") Ċĉ ĉ val Ġname Ġ= Ġentity . name (). name ĊĊĉ ĉ // Ġgenerate Ġtitle ĊĊĉ ĉ // Ġpick Ġaction Ċĉ ĉ val Ġactions Ġ= ĠarrayOf ( Ċĉĉ ĉ " Re cruit ", Ċĉĉ ĉ " Train ", Ċĉĉ ĉ " En hance ", Ċĉĉ ĉ " St reng then ", Ċĉĉ ĉ " Emp ower ", Ċĉĉ ĉ " Impro ve ", Ċĉĉ ĉ " Boost ", Ċĉĉ ĉ " Advance ", Ċĉĉ ĉ " Upgrade ", Ċĉĉ ĉ " Aug ment ", Ċĉĉ ĉ " C ult ivate ", Ċĉĉ ĉ " Develop ", Ċĉĉ ĉ " Ref ine ", Ċĉĉ ĉ " Increase ", Ċĉĉ ĉ " Progress ", Ċĉĉ ĉ " Prom ote ", Ċĉĉ ĉ " E lev ate ", Ċĉĉ ĉ " Re in force ", Ċĉĉ ĉ " Height en ", Ċĉĉ ĉ " M agn ify " Ċĉĉĉĉĉĉĉ Ġ) Ċĉ ĉ val Ġaction Ġ= Ġactions . random ( ran ) ĊĊĉ ĉ title Ġ= Ġ"$ action Ġ$ name " Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Save ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ xml Data . set (" Hero ", Ġhero ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġdo Load ( xml Data : ĠXml Data ) Ċ ĉ { Ċĉ ĉ hero Ġ= Ġxml Data . get (" Hero ") Ċ ĉ } Ċ }