@screeps/renderer 1.6.2-arena → 1.6.3-arena

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/renderer.js CHANGED
@@ -50548,7 +50548,6 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
50548
50548
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
50549
50549
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
50550
50550
 
50551
-
50552
50551
  var ActionHandle = /*#__PURE__*/function (_utils$EventEmitter) {
50553
50552
  function ActionHandle(container, action) {
50554
50553
  var _this;
@@ -52864,8 +52863,6 @@ const scaleGameToWorld = (value, {
52864
52863
 
52865
52864
 
52866
52865
 
52867
- var creepActions_Assets = Assets;
52868
-
52869
52866
 
52870
52867
  var TWEEN_DURATION = 0.6;
52871
52868
  var COLORS = {
@@ -52891,7 +52888,7 @@ function createCoverSprite(rootContainer, scope, world) {
52891
52888
  rootContainer.on('removed', function () {
52892
52889
  return container.destroy();
52893
52890
  });
52894
- var cover = new Sprite(creepActions_Assets.get('cover'));
52891
+ var cover = new Sprite(Assets.get('cover'));
52895
52892
  // coverSprite.blendMode = BLEND_MODES.ADD;
52896
52893
  // coverSprite.width = 150;
52897
52894
  // coverSprite.height = 150;
@@ -52901,7 +52898,7 @@ function createCoverSprite(rootContainer, scope, world) {
52901
52898
  // cover.filters = [new BlurFilter(1)];
52902
52899
  cover.parentLayer = world.layers.effects;
52903
52900
  container.addChild(cover);
52904
- var flare = new Sprite(creepActions_Assets.get('flare2'));
52901
+ var flare = new Sprite(Assets.get('flare2'));
52905
52902
  flare.blendMode = BLEND_MODES.ADD;
52906
52903
  flare.width = 300;
52907
52904
  flare.height = 300;
@@ -52910,7 +52907,7 @@ function createCoverSprite(rootContainer, scope, world) {
52910
52907
  flare.alpha = 0.05;
52911
52908
  flare.parentLayer = world.layers.effects;
52912
52909
  container.addChild(flare);
52913
- var coverLighting = new Sprite(creepActions_Assets.get('glow'));
52910
+ var coverLighting = new Sprite(Assets.get('glow'));
52914
52911
  coverLighting.anchor.x = 0.5;
52915
52912
  coverLighting.anchor.y = 0.5;
52916
52913
  coverLighting.x = 0;
@@ -52922,7 +52919,7 @@ function createCoverSprite(rootContainer, scope, world) {
52922
52919
  container.addChild(coverLighting);
52923
52920
  }
52924
52921
  function createChildCoverSprite(parent, scope, world) {
52925
- var sprite = new Sprite(creepActions_Assets.get('cover'));
52922
+ var sprite = new Sprite(Assets.get('cover'));
52926
52923
  sprite.anchor.x = 0.5;
52927
52924
  sprite.anchor.y = 0.5;
52928
52925
  sprite.alpha = 0;
@@ -53205,8 +53202,6 @@ function pushRangedShotActionWithBlur(actionsArray, stage, world, fromObject, to
53205
53202
  */
53206
53203
 
53207
53204
 
53208
-
53209
- var creepBuildBody_Assets = Assets;
53210
53205
  var maxParts = 50;
53211
53206
  var ANGLE_SHIFT = -Math.PI / 2;
53212
53207
  var PART_ANGLE = 2 * Math.PI / maxParts / 2;
@@ -53254,7 +53249,7 @@ function createBodyPartSprite(color, startAngle, endAngle, parent, bodySprites,
53254
53249
  return bodyPartBarSprite;
53255
53250
  }
53256
53251
  function createToughSprite(parent, bodySprites) {
53257
- var toughSprite = new Sprite(creepBuildBody_Assets.get('tough'));
53252
+ var toughSprite = new Sprite(Assets.get('tough'));
53258
53253
  toughSprite.width = 120;
53259
53254
  toughSprite.height = 120;
53260
53255
  toughSprite.anchor.x = 0.5;
@@ -53430,8 +53425,6 @@ function powerInfluence_toPrimitive(t, r) { if ("object" != powerInfluence_typeo
53430
53425
 
53431
53426
 
53432
53427
 
53433
- var powerInfluence_Assets = Assets;
53434
-
53435
53428
 
53436
53429
 
53437
53430
  var INFLUENCE_TEXTURE = (_INFLUENCE_TEXTURE = {}, powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(_INFLUENCE_TEXTURE, (constants_default()).PWR_DISRUPT_SOURCE, 'disrupt-source'), (constants_default()).PWR_DISRUPT_SPAWN, 'disrupt-spawn'), (constants_default()).PWR_DISRUPT_TERMINAL, 'disrupt-terminal'), (constants_default()).PWR_DISRUPT_TOWER, 'disrupt-tower'), (constants_default()).PWR_REGEN_MINERAL, 'regen-mineral'), (constants_default()).PWR_REGEN_SOURCE, 'regen-source'), (constants_default()).PWR_GENERATE_OPS, 'generate-ops'), (constants_default()).PWR_OPERATE_EXTENSION, 'operate-extension'), (constants_default()).PWR_OPERATE_LAB, 'operate-lab'), (constants_default()).PWR_OPERATE_OBSERVER, 'operate-observer'), powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(_INFLUENCE_TEXTURE, (constants_default()).PWR_OPERATE_SPAWN, 'operate-spawn'), (constants_default()).PWR_OPERATE_STORAGE, 'operate-storage'), (constants_default()).PWR_OPERATE_TERMINAL, 'operate-terminal'), (constants_default()).PWR_OPERATE_TOWER, 'operate-tower'), (constants_default()).PWR_SHIELD, 'shield'), (constants_default()).PWR_FORTIFY, 'fortify'), (constants_default()).PWR_OPERATE_CONTROLLER, 'operate-controller'), (constants_default()).PWR_OPERATE_POWER, 'operate-power'), (constants_default()).PWR_BERSERK, 'berserk'), (constants_default()).PWR_DEFEND, 'defend'), powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(_INFLUENCE_TEXTURE, (constants_default()).PWR_DISABLE, 'disable'), (constants_default()).PWR_ENCOURAGE, 'encourage'), (constants_default()).PWR_EXHAUST, 'exhaust'), (constants_default()).PWR_RENEW, 'renew'), (constants_default()).PWR_SIGHT, 'sight'), (constants_default()).PWR_SUMMON, 'summon'), (constants_default()).PWR_DEMOLISH, 'demolish'), (constants_default()).PWR_HARVEST_ENERGY, 'harvest-energy'), (constants_default()).PWR_HARVEST_MINERAL, 'harvest-mineral'), (constants_default()).PWR_KILL, 'kill'), powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(powerInfluence_defineProperty(_INFLUENCE_TEXTURE, (constants_default()).PWR_MASS_REPAIR, 'mass-repair'), (constants_default()).PWR_PUNCH, 'punch'), (constants_default()).PWR_REFLECT, 'reflect'), (constants_default()).PWR_REINFORCE, 'reinforce'), (constants_default()).PWR_REMOTE_TRANSFER, 'remote-transfer'), (constants_default()).PWR_SNIPE, 'snipe'));
@@ -53502,7 +53495,7 @@ function powerInfluence_createCoverSpriteAction(sprite, tickDuration, pos) {
53502
53495
  if (!textureKey) {
53503
53496
  console.log('No texture key provided for power id', power.id);
53504
53497
  }
53505
- var texture = powerInfluence_Assets.get(textureKey);
53498
+ var texture = Assets.get(textureKey);
53506
53499
  if (!texture) {
53507
53500
  console.log('No texture provided for key ', textureKey);
53508
53501
  }
@@ -54124,8 +54117,6 @@ function sprite_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; v
54124
54117
 
54125
54118
 
54126
54119
 
54127
- var sprite_Assets = Assets;
54128
-
54129
54120
 
54130
54121
 
54131
54122
 
@@ -54164,7 +54155,7 @@ var sprite_Assets = Assets;
54164
54155
  var resource;
54165
54156
  var parsedTexture = actionHelper.parseExpression(texture, params);
54166
54157
  if (lodash_default().isString(parsedTexture)) {
54167
- resource = sprite_Assets.get(parsedTexture);
54158
+ resource = Assets.get(parsedTexture);
54168
54159
  } else {
54169
54160
  resource = texture;
54170
54161
  if (!resource) {
@@ -54472,8 +54463,6 @@ function terrain_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
54472
54463
 
54473
54464
 
54474
54465
 
54475
- var terrain_Assets = Assets;
54476
-
54477
54466
 
54478
54467
 
54479
54468
  var WALLS_BLUR = 0.006;
@@ -54625,7 +54614,8 @@ function addTilePositionAnimation(sprite, dx, dy) {
54625
54614
  'paint-order': 'stroke'
54626
54615
  }), {
54627
54616
  alpha: 0.4,
54628
- tint: tint
54617
+ tint: tint,
54618
+ zIndex: 1
54629
54619
  });
54630
54620
  if (swampTexture !== 'disabled') {
54631
54621
  swampObjects[1] = setupObject(buildSvg(swampPath, {
@@ -54644,19 +54634,21 @@ function addTilePositionAnimation(sprite, dx, dy) {
54644
54634
  }), {
54645
54635
  alpha: 0.25
54646
54636
  });
54647
- swampObjects[3] = setupObject(new TilingSprite(terrain_Assets.get('noise2'), VIEW_BOX, VIEW_BOX), {
54637
+ swampObjects[3] = setupObject(new TilingSprite(Assets.get('noise2'), VIEW_BOX, VIEW_BOX), {
54648
54638
  alpha: lighting === 'normal' ? 0.3 : 0.15,
54649
54639
  blendMode: BLEND_MODES.ADD,
54650
54640
  mask: swampObjects[1],
54651
54641
  tileScale: new Point(10, 10),
54652
- tint: 0x66FF00
54642
+ tint: 0x66FF00,
54643
+ zIndex: 1
54653
54644
  });
54654
- swampObjects[4] = setupObject(new TilingSprite(terrain_Assets.get('noise2'), VIEW_BOX, VIEW_BOX), {
54645
+ swampObjects[4] = setupObject(new TilingSprite(Assets.get('noise2'), VIEW_BOX, VIEW_BOX), {
54655
54646
  alpha: lighting === 'normal' ? 0.3 : 0.15,
54656
54647
  blendMode: BLEND_MODES.ADD,
54657
54648
  tileScale: new Point(14, 14),
54658
54649
  mask: swampObjects[2],
54659
- tint: 0x66FF00
54650
+ tint: 0x66FF00,
54651
+ zIndex: 1
54660
54652
  });
54661
54653
  if (swampTexture === 'animated') {
54662
54654
  addTilePositionAnimation(swampObjects[3], 1.5, 1.5);
@@ -54803,7 +54795,7 @@ function addTilePositionAnimation(sprite, dx, dy) {
54803
54795
  terrainObjects.wallMask.texture = mask.texture;
54804
54796
  actionHelper.onTextureLoaded(mask.texture, function () {
54805
54797
  if (lighting !== 'disabled') {
54806
- var bump = new TilingSprite(terrain_Assets.get('noise1'), VIEW_BOX, VIEW_BOX);
54798
+ var bump = new TilingSprite(Assets.get('noise1'), VIEW_BOX, VIEW_BOX);
54807
54799
  Object.assign(bump, {
54808
54800
  alpha: 0.2,
54809
54801
  blendMode: BLEND_MODES.ADD,
@@ -54935,7 +54927,7 @@ function addTilePositionAnimation(sprite, dx, dy) {
54935
54927
  tint: _tint
54936
54928
  });
54937
54929
  } else {
54938
- ground = new TilingSprite(terrain_Assets.get('ground'), VIEW_BOX, VIEW_BOX);
54930
+ ground = new TilingSprite(Assets.get('ground'), VIEW_BOX, VIEW_BOX);
54939
54931
  ground.x = -HALF_CELL_SIZE;
54940
54932
  ground.y = -HALF_CELL_SIZE;
54941
54933
  ground.tileScale.x = 3;
@@ -54947,7 +54939,7 @@ function addTilePositionAnimation(sprite, dx, dy) {
54947
54939
  } else {
54948
54940
  ground.alpha = 0.2;
54949
54941
  }
54950
- var ground2 = new TilingSprite(terrain_Assets.get('ground-mask'), VIEW_BOX, VIEW_BOX);
54942
+ var ground2 = new TilingSprite(Assets.get('ground-mask'), VIEW_BOX, VIEW_BOX);
54951
54943
  ground2.x = -HALF_CELL_SIZE;
54952
54944
  ground2.y = -HALF_CELL_SIZE;
54953
54945
  ground2.tileScale.x = 7;
@@ -55770,8 +55762,6 @@ function World_toPrimitive(t, r) { if ("object" != World_typeof(t) || !t) return
55770
55762
 
55771
55763
 
55772
55764
 
55773
- var World_Assets = Assets;
55774
-
55775
55765
 
55776
55766
 
55777
55767
 
@@ -55872,16 +55862,16 @@ var World = /*#__PURE__*/function () {
55872
55862
  _context.p = 1;
55873
55863
  // Add all assets to the Assets loader
55874
55864
  Object.keys(this.resourceMap).forEach(function (key) {
55875
- World_Assets.add({
55865
+ Assets.add({
55876
55866
  alias: key,
55877
55867
  src: _this.resourceMap[key]
55878
55868
  });
55879
55869
  });
55880
55870
 
55881
55871
  // Load all assets
55882
- logger.debug('Loading resources...');
55872
+ logger.debug('Loading resources...', this.resourceMap);
55883
55873
  _context.n = 2;
55884
- return World_Assets.load(Object.keys(this.resourceMap));
55874
+ return Assets.load(Object.keys(this.resourceMap));
55885
55875
  case 2:
55886
55876
  logger.debug('Resources loaded successfully');
55887
55877
  _context.n = 4;
@@ -56015,7 +56005,7 @@ var World = /*#__PURE__*/function () {
56015
56005
  }, {
56016
56006
  key: "release",
56017
56007
  value: function release() {
56018
- World_Assets.reset();
56008
+ Assets.reset();
56019
56009
  }
56020
56010
  }, {
56021
56011
  key: "getResource",
@@ -56032,7 +56022,7 @@ var World = /*#__PURE__*/function () {
56032
56022
  case 0:
56033
56023
  url = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : name;
56034
56024
  logger = this.options.logger; // Check if already cached
56035
- cached = World_Assets.get(name);
56025
+ cached = Assets.get(name);
56036
56026
  if (!cached) {
56037
56027
  _context2.n = 1;
56038
56028
  break;
@@ -56042,12 +56032,12 @@ var World = /*#__PURE__*/function () {
56042
56032
  case 1:
56043
56033
  _context2.p = 1;
56044
56034
  logger.debug("Loading resource ".concat(name));
56045
- World_Assets.add({
56035
+ Assets.add({
56046
56036
  alias: name,
56047
56037
  src: url
56048
56038
  });
56049
56039
  _context2.n = 2;
56050
- return World_Assets.load(name);
56040
+ return Assets.load(name);
56051
56041
  case 2:
56052
56042
  resource = _context2.v;
56053
56043
  return _context2.a(2, resource);
@@ -56260,8 +56250,6 @@ function GameRenderer_toPrimitive(t, r) { if ("object" != GameRenderer_typeof(t)
56260
56250
 
56261
56251
 
56262
56252
 
56263
-
56264
- var GameRenderer_Application = Application;
56265
56253
  var THRESHOLD = 500;
56266
56254
  var GameRenderer = /*#__PURE__*/function () {
56267
56255
  /**
@@ -56316,7 +56304,7 @@ var GameRenderer = /*#__PURE__*/function () {
56316
56304
  if (!this.released) {
56317
56305
  this.release();
56318
56306
  }
56319
- app = new GameRenderer_Application({
56307
+ app = new Application({
56320
56308
  width: width,
56321
56309
  height: height,
56322
56310
  antialias: true,