package Setup import initlater OeSetup import LinkedList import Table3D import public Trackable import public CustomClosureEvents import public Helper import public Array import public DebugFile import HashList // Everything you declare here will be done first // DONT import anything into here except packages from the StandardLib // This is a perfect place to declare anything that need to be global.. //--------------------// //------BonusMod------// //--------------------// public function colorToIndex(color c) returns int return c.red + (c.green * 256) + (c.blue * 65536) public function colorFromIndex(int i) returns color return color(i mod 256, (i mod 65536) div 256, (i mod 16777216) div 65536) public function colorAToIndex(colorA c) returns int return c.red + (c.green * 256) + (c.blue * 65536) + (c.alpha div 2 * 16777216) public function colorAFromIndex(int i) returns colorA return colorA(i mod 256, (i mod 65536) div 256, (i mod 16777216) div 65536, (i div 16777216) * 2) public tuple bonData(int raw, int size) public function cBonData(int raw, int size) returns bonData return bonData(raw, size) public timer timeTest = null public constant int maxBonSize = 14 public constant int attackRaw = '(A)0' - '0' public constant int attackSpeedRaw = '(B)0' - '0' public constant int armorRaw = '(C)0' - '0' public constant int lifeRaw = '(D)0' - '0' public constant int manaRaw = '(E)0' - '0' public constant int agiRaw = '(F)0' - '0' public constant int strRaw = '(G)0' - '0' public constant int intRaw = '(H)0' - '0' public constant int lifeRegRaw = '(I)0' - '0' public constant int manaRegRaw = '(J)0' - '0' public constant int permAttackItemRaw = 'BMI0' - '0' public constant int permAttackRaw = 'BMO0' - '0' public int array attackPerm public HashList preloadAbi = new HashList() public item array permAttackTome public HashList permAttackTomeId = new HashList() public int permAttackNegTomeId public item permAttackNegTome //--------------------// //----Other Stuff-----// //--------------------// public constant DebugFile infoFile = new DebugFile("Info") public constant DebugFile errorFile = new DebugFile("Error") public constant DebugFile debugFile = new DebugFile("Debug") public constant string charMap = ".................................!.#$%&'()*+,-./0123456789:;<=>.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................." public constant LinkedList allPlayers = new LinkedList() public constant string team1 = "Wargrin" public constant string team2 = "Everliving" public constant vec2 recycleGraveyard = vec2(0, 0) public constant vec2 menuStart = vec2(-2500, -1000) public constant hashtable trackBlacklist = InitHashtable() public tuple element(int x, int y) public constant int tileSize = 64 public constant int menuHeight = 22 public constant int menuWidth = 44 public constant real abilityLoadTime = 0.1 public constant real abilityLoadTimeLevelBonus = 0.03 public TrackableEx array tracks public function element.toVec() returns vec2 return vec2(this.x * tileSize * 1., this.y * tileSize * 1.) public function element.op_plus(element other) returns element return element(this.x + other.x, this.y + other.y) public function element.op_minus(element other) returns element return element(this.x - other.x, this.y - other.y) public function element.op_div(int i) returns element return element(this.x div i, this.y div i) public function elementFromIndex(int index) returns element return element(index mod 32768, index div 32768) public function elementToIndex(element e) returns int return e.x + e.y * 32768 public function vec2.toElement() returns element return element(roundReal(this.x), roundReal(this.y)) public function getTrackableAt(element pos) returns TrackableEx return tracks[(menuWidth + 1) * pos.x + pos.y] public function setTrackableAt(element pos, TrackableEx tr) tracks[(menuWidth + 1) * pos.x + pos.y] = tr public class ElementLoop element a element b int start construct(element a, element b) this.a = a this.b = b start = a.x function iterator() returns thistype return this function hasNext() returns boolean return (a.x <= b.x and a.y <= b.y) function next() returns element element ret = a if a.x >= b.x a.y++ a.x = start else a.x++ return ret function close() destroy this init trackBlacklist.saveBoolean(1, 1, true) public enum Update ATTACK // ATTACKSPEED // ARMOR // AGI // INT // STR // LIFE // MANA // LIFE_REG // MANA_REG // MOVESPEED // RESISTANCE // CRITCHANCE // CRITDAMAGE // EVADE // HITCHANCE // NORMAL_REDUCTION // MAGIC_REDUCTION // BONUS_DAMAGE // MAGIC_DEFLECTION // NORMAL_DEFLECTION // LIFESTEAL // HEAL SPELLPOWER // MASS // public enum BonType ATTACK // + ATTACK_PER // + ATTACKSPEED // + MOVESPEED // + MOVESPEED_PER // + ARMOR // + ARMOR_PER // + RESISTANCE // + RESISTANCE_PER // + AGI // + AGI_PER // + INT // + INT_PER // + STR // + STR_PER // + LIFE // + LIFE_PER // + LIFE_REG // + LIFE_REG_PER // + MANA // + MANA_PER // + MANA_REG // + MANA_REG_PER // + CRITCHANCE // + CRITDAMAGE // + EVADE // + HITCHANCE // + REDUCTION // + MAGIC_REDUCTION // + NORMAL_REDUCTION // + BONUS_DAMAGE // + DEFLECTION // + MAGIC_DEFLECTION // + NORMAL_DEFLECTION // + LIFESTEAL // + HEAL SPELLPOWER // + SPELLPOWER_PER // + MASS // + MASS_PER // + public enum TextType DAMAGE HEAL DOT MISS DODGE GOLD public enum ButtonType NORMAL ICON public enum OpenTo TOP_RIGHT TOP_LEFT BOT_RIGHT BOT_LEFT CENTER AUTO public enum Team Everliving Wargrin public function roundReal(real value) returns integer if value > 0 return R2I(value + 0.5) else return R2I(value - 0.5) endpackage