You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
1.2 KiB

  1. //Imports
  2. const eventEmitter = require('../misc/events');
  3. //Module
  4. module.exports = {
  5. //At which interval does each zone tick in ms
  6. tickTime: 350,
  7. //The maximum level a player can reach
  8. maxLevel: 21,
  9. //Rune damage is multiplied by nth entry from this array where n = level - 1
  10. dmgMults: [0.25, 0.4, 0.575, 0.8, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6],
  11. //Mob HP is multiplied by nth entry from this array where n = level - 1
  12. hpMults: [0.1, 0.2, 0.4, 0.7, 0.78, 0.91, 1.16, 1.19, 1.65, 2.36, 3.07, 3.55, 4.1, 4.85, 5.6, 5.9, 6.5, 7.1, 7.9, 12, 15],
  13. //How far a player can see objects horizontally
  14. viewDistanceX: 32,
  15. //How far a player can see objects vertically
  16. viewDistanceY: 17,
  17. //How many milliseconds to wait to kill a thread after it's been empty
  18. destroyThreadWhenEmptyForMs: 10000,
  19. init: function (threadArgs) {
  20. const emBeforeGetConsts = {
  21. threadArgs,
  22. constValues: {}
  23. };
  24. Object.entries(this).forEach(([k, v]) => {
  25. if (typeof(v) === 'function')
  26. return;
  27. emBeforeGetConsts.constValues[k] = v;
  28. });
  29. eventEmitter.emit('beforeGetConsts', emBeforeGetConsts);
  30. Object.entries(emBeforeGetConsts.constValues).forEach(([k, v]) => {
  31. this[k] = v;
  32. });
  33. }
  34. };