package StatHandlerConfig import initlater StatHandler import BonusHandler ///** // * Make this function return a unique index if you want to use the unit extension functions. // * You can also comment it out and "import public" a package which provides this function. // */ public function getUnitIndex(unit u) returns int return u.getUserData() //public enum Stat // LIFE // absolute // MANA // absolute // LIFEREG // absolute, per second // MANAREG // absolute, per second // STR // absolute // AGI // absolute // INT // absolute // STR_WHITE // absolute // AGI_WHITE // absolute // INT_WHITE // absolute // DAMAGE // absolute // DAMAGE_PERC // % // ARMOR // absolute // ASPD // % // MS // absolute // EVA // % // CC // % critchance // CM // % critmultiplicator // CB // absolute critbonus // HEALREC // % heal received increase // ATTACKTHREAT // CASTSPEED // // TODO: magic resists, magic powers, damage resists /** List your stats here. */ public enum Stat LIFE // Life, absolute MANA // Mana, absolute LREG // Liferegen, absolute, per second MREG // Manaregen, absolute, per second STRE // Strength, absolute AGIL // Agility, absolute INTE // Intelligence, absolute DAMA // Damage, absolute DAMP // Damage, percent ARMO // Armor, absolute ASPD // Attackspeed, percent MOVE // Movespeed, absolute EVAS // Evasion chance, percent CCHA // Critchance, percent CMUL // Critmultiplicator, percent CBON // Critbonus, absolute HREC // Heal receibed, percent ATHR // Attackthreat, percent CSPE // Castspeed, percent STRW // Strength, absolute (stats) AGIW // Agility, absolute (stats) INTW // Intelligence, absolute (stats) // TODO: magic resists, magic powers, damage resists /** * Register all your stats here. Available functions: * - Linear stat: * registerStatLin(Stat stat) * - Exponential stat: * registerStatExp(Stat stat) * - Logistic stat: * registerStatLog(Stat stat) * - Linear stat with linear substat: * registerStatLinLin(Stat stat, Stat substat) * - Linear stat with exponential substat: * registerStatLinExp(Stat stat, Stat substat) */ public function statRegistry() registerStatLin(Stat.LIFE, (unit u, Stat s) -> setUnitBonus(u, Bonus.LIFE, u.getStat(Stat.LIFE)-u.getBaseStat(Stat.LIFE))) registerStatLin(Stat.MANA, (unit u, Stat s) -> setUnitBonus(u, Bonus.MANA, u.getStat(Stat.MANA)-u.getBaseStat(Stat.MANA))) registerStatLin(Stat.LREG, (unit u, Stat s) -> setUnitBonus(u, Bonus.LIFEREGEN, u.getStat(Stat.LREG)-u.getBaseStat(Stat.LREG))) registerStatLin(Stat.MREG, (unit u, Stat s) -> setUnitBonus(u, Bonus.MANAREGEN, u.getStat(Stat.MREG)-u.getBaseStat(Stat.MREG))) registerStatLin(Stat.STRE, (unit u, Stat s) -> setUnitBonus(u, Bonus.STRENGTH, u.getStat(Stat.STRE)-u.getStat(Stat.STRW))) registerStatLin(Stat.AGIL, (unit u, Stat s) -> setUnitBonus(u, Bonus.AGILITY, u.getStat(Stat.AGIL)-u.getStat(Stat.AGIW))) registerStatLin(Stat.INTE, (unit u, Stat s) -> setUnitBonus(u, Bonus.INTELLIGENCE, u.getStat(Stat.INTE)-u.getStat(Stat.INTW))) registerStatLinExp(Stat.DAMA, Stat.DAMP, (unit u, Stat s) -> setUnitBonus(u, Bonus.DAMAGE, u.getStat(Stat.DAMA)-u.getBaseStat(Stat.DAMA))) registerStatLin(Stat.ARMO, (unit u, Stat s) -> setUnitBonus(u, Bonus.ARMOR, u.getStat(Stat.ARMO)-u.getBaseStat(Stat.ARMO))) registerStatExp(Stat.ASPD, (unit u, Stat s) -> setUnitBonus(u, Bonus.ATTACKSPEED, u.getStat(Stat.ASPD))) // Ignore base attackspeed registerStatLin(Stat.MOVE, (unit u, Stat s) -> u.setMoveSpeed(1.*u.getStat(Stat.MOVE))) registerStatLin(Stat.STRW, (unit u, Stat s) -> SetHeroStr(u, u.getStat(Stat.STRW), true)) registerStatLin(Stat.AGIW, (unit u, Stat s) -> SetHeroAgi(u, u.getStat(Stat.AGIW), true)) registerStatLin(Stat.INTW, (unit u, Stat s) -> SetHeroInt(u, u.getStat(Stat.INTW), true)) registerStatLog(Stat.EVAS) registerStatLog(Stat.CCHA) registerStatExp(Stat.CMUL) registerStatLin(Stat.CBON) registerStatExp(Stat.HREC) registerStatExp(Stat.ATHR) registerStatExp(Stat.CSPE)