diff --git a/packages/combat/src/traits/harmful.js b/packages/combat/src/traits/harmful.js index 06714d4..2b818a5 100644 --- a/packages/combat/src/traits/harmful.js +++ b/packages/combat/src/traits/harmful.js @@ -147,7 +147,7 @@ export default (flecks) => class Harmful extends decorate(Trait) { } tick() { - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { if (this.entity.is('Collider')) { const {isCollidingWith} = this.entity; for (let i = 0; i < isCollidingWith.length; i++) { diff --git a/packages/combat/src/traits/vulnerable.js b/packages/combat/src/traits/vulnerable.js index 2940b97..0d21bd6 100644 --- a/packages/combat/src/traits/vulnerable.js +++ b/packages/combat/src/traits/vulnerable.js @@ -285,7 +285,7 @@ export default (flecks) => class Vulnerable extends Trait { }, tookHarm: (harm) => { - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { this.#harms.push(harm); this.interactions(this.entity, harm); this.markAsDirty(); @@ -362,7 +362,7 @@ export default (flecks) => class Vulnerable extends Trait { this.#interactionTickers[i].tick(elapsed); } } - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { const it = this.#locks.keys(); for (let current = it.next(); current.done !== true; current = it.next()) { const {value: key} = current; diff --git a/packages/core/src/electron.js b/packages/core/src/electron.js index 43853e3..addd0bb 100644 --- a/packages/core/src/electron.js +++ b/packages/core/src/electron.js @@ -1,6 +1,6 @@ // import {fork} from 'child_process'; // import {app, BrowserWindow} from 'electron'; -// import {get} from 'http'; +// import {get} from 'web'; // let serverInstance = false; // async function startServer() { diff --git a/packages/core/src/traits/lootable.js b/packages/core/src/traits/lootable.js index cd3ebd6..797c7e2 100644 --- a/packages/core/src/traits/lootable.js +++ b/packages/core/src/traits/lootable.js @@ -80,7 +80,7 @@ export default () => class Lootable extends decorate(Trait) { hooks() { const hooks = {}; - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { let isDying = false; hooks.destroy = () => () => { if (isDying) { diff --git a/packages/farm/src/resources/decorators/room.js b/packages/farm/src/resources/decorators/room.js index 35a2371..5b3df6f 100644 --- a/packages/farm/src/resources/decorators/room.js +++ b/packages/farm/src/resources/decorators/room.js @@ -34,7 +34,7 @@ export default (Room) => class FarmableRoom extends Room { adjustWaterAt(target, increase) { const tiles = this.tiles[1]; if ( - 'http' === process.env.FLECKS_CORE_BUILD_TARGET + 'web' === process.env.FLECKS_CORE_BUILD_TARGET || TILLED !== tiles.tileAt(target) ) { return; @@ -98,7 +98,7 @@ export default (Room) => class FarmableRoom extends Room { const {tileSize} = tiles; const target = Vector.floor(Vector.div(center, tileSize)); return ( - 'http' !== process.env.FLECKS_CORE_BUILD_TARGET + 'web' !== process.env.FLECKS_CORE_BUILD_TARGET && TILLED === tiles.tileAt(target) && !this.isPlantAt(center) ); @@ -113,7 +113,7 @@ export default (Room) => class FarmableRoom extends Room { } prepareSoilAt(target) { - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { const tiles = this.tiles[1]; tiles.setTileAt(target, TILLED); this.adjustWaterAt(target, 0); @@ -130,7 +130,7 @@ export default (Room) => class FarmableRoom extends Room { } tickWater(elapsed) { - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { return; } const water = Object.entries(this.water); diff --git a/packages/farm/src/traits/plant.js b/packages/farm/src/traits/plant.js index f95e87e..1dc0ecf 100644 --- a/packages/farm/src/traits/plant.js +++ b/packages/farm/src/traits/plant.js @@ -108,7 +108,7 @@ export default (flecks) => class Plant extends decorate(Trait) { } tick(elapsed) { - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { return; } const {room} = this.entity; diff --git a/packages/farm/src/traits/tool.js b/packages/farm/src/traits/tool.js index 457c91a..f31b952 100644 --- a/packages/farm/src/traits/tool.js +++ b/packages/farm/src/traits/tool.js @@ -17,7 +17,7 @@ export default (flecks) => class Tool extends Trait { constructor() { super(); - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { this.#throbber = {color: 0}; this.#throbber.lfo = new LfoResult( this.#throbber, @@ -66,7 +66,7 @@ export default (flecks) => class Tool extends Trait { } calculateTargetTotal() { - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { const {wielder} = this.entity; if (!wielder || !wielder.room) { return; @@ -118,7 +118,7 @@ export default (flecks) => class Tool extends Trait { destroy() { const {wielder} = this.entity; this.onWielderChanged(wielder); - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { this.#primitives.destroy(); this.#throbber = {}; } @@ -179,7 +179,7 @@ export default (flecks) => class Tool extends Trait { onWielderActiveSlotIndexChanged() { this.calculateTargets(); - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { this.#primitives.visible = false; const {wielder} = this.entity; if (!wielder || !wielder.container || !wielder.is('Receptacle')) { @@ -191,13 +191,13 @@ export default (flecks) => class Tool extends Trait { onWielderChanged(oldWielder, newWielder) { if (oldWielder && oldWielder.is('Visible')) { - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { oldWielder.removeRasterSibling(this.#primitives); } oldWielder.off('activeSlotIndexChanged', this.onWielderActiveSlotIndexChanged); } if (newWielder && newWielder.is('Visible')) { - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { newWielder.addRasterSibling(this.#primitives); } newWielder.on('activeSlotIndexChanged', this.onWielderActiveSlotIndexChanged, this); @@ -264,7 +264,7 @@ export default (flecks) => class Tool extends Trait { } repositionPrimitives() { - if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) { const {wielder} = this.entity; if (!wielder || !wielder.room) { return; diff --git a/packages/inventory/src/traits/receptacle.js b/packages/inventory/src/traits/receptacle.js index d8324be..e46bf5d 100644 --- a/packages/inventory/src/traits/receptacle.js +++ b/packages/inventory/src/traits/receptacle.js @@ -84,7 +84,7 @@ export default (flecks) => class Receptacle extends decorate(Trait) { this.addListenersForItem(item); this.slotItems[slotNumber] = item; this.entity.emit('itemAdded', item, slotNumber); - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { this.packetUpdates.push([ 'TraitUpdateReceptacleItemFull', { @@ -100,7 +100,7 @@ export default (flecks) => class Receptacle extends decorate(Trait) { addListenersForItem(item) { const listener = (oldQty, newQty) => { - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { const slotIndex = this.itemSlotIndex(item); // Valid quantity; update client. if (newQty > 0) { @@ -175,7 +175,7 @@ export default (flecks) => class Receptacle extends decorate(Trait) { listeners() { const listeners = {}; - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { listeners.collisionStart = (other) => { if (other.is('Item')) { other.list?.removeEntity(other); @@ -227,7 +227,7 @@ export default (flecks) => class Receptacle extends decorate(Trait) { this.removeListenersForItem(item); delete this.slotItems[slotIndex]; this.entity.emit('itemRemoved', item, slotIndex); - if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { + if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) { this.packetUpdates.push([ 'TraitUpdateReceptacleItemSwap', {