diff --git a/.DS_Store b/.DS_Store
index 47c1a1f..5ca13c1 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index de6be64..6c833c4 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -1358,13 +1358,12 @@ const b = {
thrustMag: 0.1,
dmg: 6, //damage done in addition to the damage from momentum
classType: "bullet",
- endCycle: simulation.cycle + 45,
+ endCycle: simulation.cycle + 70,
collisionFilter: {
category: cat.bullet,
mask: tech.isShieldPierce ? cat.body | cat.mob | cat.mobBullet : cat.body | cat.mob | cat.mobBullet | cat.mobShield,
},
minDmgSpeed: 4,
- ropeExtension: 0,
lookFrequency: Math.floor(7 + Math.random() * 3),
density: tech.harpoonDensity, //0.001 is normal for blocks, 0.006 is normal for harpoon, 0.006*6 when buffed
drain: 0.004,
@@ -1517,7 +1516,7 @@ const b = {
x: m.pos.x + 30 * Math.cos(m.angle),
y: m.pos.y + 30 * Math.sin(m.angle)
})
- let dist = Vector.magnitude(sub) - this.ropeExtension
+ let dist = Vector.magnitude(sub)
if (input.fire) {
//control position while hooked
// if (input.down) { //down
@@ -1566,21 +1565,18 @@ const b = {
}
}
}
- // if (tech.isIntangibleGrapple) {
- // player.collisionFilter.mask = cat.map
- // let inPlayer = Matter.Query.region(mob, player.bounds)
- // if (inPlayer.length > 0) {
- // for (let i = 0; i < inPlayer.length; i++) {
- // if (m.energy > 0 && inPlayer[i].shield) m.energy -= 0.014;
- // }
- // }
- // //check for disabling intangible in next cycle
- // requestAnimationFrame(() => {
- // if (!tech.isIntangibleGrapple || !input.fire || this.) {
- // player.collisionFilter.mask = cat.body | cat.map | cat.mob | cat.mobBullet | cat.mobShield //normal collisions
- // }
- // });
- // }
+ if (tech.isImmuneGrapple && m.immuneCycle < m.cycle + 10) {
+ m.immuneCycle = m.cycle + 10;
+ if (m.energy > 0.001) {
+ m.energy -= 0.001
+ } else {
+ Matter.Sleeping.set(this, false)
+ this.collisionFilter.category = 0
+ this.collisionFilter.mask = 0
+ this.do = this.returnToPlayer
+ this.endCycle = simulation.cycle + 60
+ }
+ }
} else {
Matter.Sleeping.set(this, false)
this.collisionFilter.category = 0
@@ -6092,11 +6088,11 @@ const b = {
}
this.ammo++ //make up for the ammo used up in fire()
simulation.updateGunHUD();
- m.fireCDcycle = m.cycle + 90 // cool down
+ m.fireCDcycle = m.cycle + Math.floor(75 * b.fireCDscale) // cool down
} else {
b.grapple(where, m.angle, harpoonSize)
}
- m.fireCDcycle = m.cycle + 45 // cool down
+ m.fireCDcycle = m.cycle + Math.floor(75 * b.fireCDscale) // cool down
},
harpoonFire() {
const where = {
diff --git a/js/level.js b/js/level.js
index 06b8a6f..eacfe7b 100644
--- a/js/level.js
+++ b/js/level.js
@@ -18,7 +18,7 @@ const level = {
// m.setField("time dilation")
// b.giveGuns("harpoon")
// for (let i = 0; i < 9; i++) tech.giveTech("smelting")
- // tech.giveTech("boson quasiparticles")
+ // tech.giveTech("exchange interaction")
// tech.giveTech("grappling hook")
// for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech");
// for (let i = 0; i < 3; i++) tech.giveTech("undefined")
diff --git a/js/powerup.js b/js/powerup.js
index f48b69a..31783e6 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -1045,9 +1045,9 @@ const powerUps = {
},
pauseEjectTech(index) {
if (tech.isPauseEjectTech || simulation.testing) {
- if (Math.random() < 0.04) {
+ if (Math.random() < 0.04 || tech.tech[index].isFromAppliedScience) {
tech.removeTech(index)
- m.energy += 20.48;
+ powerUps.spawn(m.pos.x + 40 * (Math.random() - 0.5), m.pos.y + 40 * (Math.random() - 0.5), "research", false);
} else {
powerUps.ejectTech(index)
}
diff --git a/js/tech.js b/js/tech.js
index 292a53a..e804f8a 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -369,6 +369,7 @@ const tech = {
if (gunTechPool.length) {
const index = Math.floor(Math.random() * gunTechPool.length)
tech.giveTech(gunTechPool[index]) // choose from the gun pool
+ tech.tech[gunTechPool[index]].isFromAppliedScience = true //makes it not remove properly under pure science
simulation.makeTextLog(`tech.giveTech("${tech.tech[gunTechPool[index]].name}")`)
}
}
@@ -1634,8 +1635,8 @@ const tech = {
}
},
{
- name: "complex spin-statistics",
- description: `become immune to harm for 1.8 seconds
once every 7 seconds`,
+ name: "spin–statistics theorem",
+ description: `become immune to harm for 1.9 seconds
once every 7 seconds`,
maxCount: 3,
count: 0,
frequency: 1,
@@ -1645,7 +1646,7 @@ const tech = {
},
requires: "",
effect() {
- tech.cyclicImmunity += 108;
+ tech.cyclicImmunity += 114;
},
remove() {
tech.cyclicImmunity = 0;
@@ -3066,8 +3067,8 @@ const tech = {
}
},
{
- name: "particle collider",
- description: `clicking tech while paused ejects them
4% chance to convert that tech into energy`,
+ name: "pure science",
+ description: `clicking tech while paused ejects them
4% chance to convert that tech into ${powerUps.orb.research(1)}`,
maxCount: 1,
count: 0,
frequency: 1,
@@ -5582,58 +5583,37 @@ const tech = {
}
}
},
- // {
- // name: "exchange interaction",
- // description: `immune to harm while grappling`,
- // // link: `boson`,
- // isGunTech: true,
- // maxCount: 1,
- // count: 0,
- // frequency: 2,
- // frequencyDefault: 2,
- // allowed() {
- // return tech.isGrapple && !tech.isRailEnergyGain
- // },
- // requires: "grappling hook, not alternator",
- // effect() {
- // tech.isIntangibleGrapple = true;
- // },
- // remove() {
- // tech.isIntangibleGrapple = false
- // }
- // },
- // {
- // name: "boson quasiparticles",
- // description: `intangible to blocks and mobs while grappling
passing through shields drains your energy`,
- // link: `boson`,
- // isGunTech: true,
- // maxCount: 1,
- // count: 0,
- // frequency: 2,
- // frequencyDefault: 2,
- // allowed() {
- // return tech.isGrapple && !tech.isRailEnergyGain
- // },
- // requires: "grappling hook, not alternator",
- // effect() {
- // tech.isIntangibleGrapple = true;
- // },
- // remove() {
- // tech.isIntangibleGrapple = false
- // }
- // },
{
- name: "alternator",
- description: "harpoon and grappling hook drain no energy
railgun generates energy", //as they retract
crouch firing harpoon generates energy",
+ name: "bulk modulus",
+ description: `become immune to harm while grappling
drains energy and prevents regen`,
isGunTech: true,
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
- return tech.haveGunCheck("harpoon")
+ return tech.isGrapple && !tech.isRailEnergyGain
},
- requires: "railgun",
+ requires: "grappling hook, not alternator",
+ effect() {
+ tech.isImmuneGrapple = true;
+ },
+ remove() {
+ tech.isImmuneGrapple = false
+ }
+ },
+ {
+ name: "alternator",
+ description: "harpoons drain no energy
railgun generates energy", //as they retract
crouch firing harpoon generates energy",
+ isGunTech: true,
+ maxCount: 1,
+ count: 0,
+ frequency: 2,
+ frequencyDefault: 2,
+ allowed() {
+ return tech.haveGunCheck("harpoon") && !tech.isImmuneGrapple
+ },
+ requires: "railgun, not Bose–Einstein statistics",
effect() {
tech.isRailEnergyGain = true;
},
@@ -5652,7 +5632,7 @@ const tech = {
allowed() {
return (!tech.isLargeHarpoon && tech.haveGunCheck("harpoon")) || (tech.isNeedles || tech.isNeedleShot)
},
- requires: "nail gun, needle gun, needle-shot, harpoon",
+ requires: "nail gun, needle gun, needle-shot, harpoon, not Bessemer process",
effect() {
tech.isShieldPierce = true
},
@@ -5671,7 +5651,7 @@ const tech = {
allowed() {
return tech.haveGunCheck("harpoon") && !tech.isShieldPierce
},
- requires: "harpoon",
+ requires: "harpoon not ceramics",
effect() {
tech.isLargeHarpoon = true;
},
@@ -5690,22 +5670,24 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
- return tech.haveGunCheck("harpoon") && b.returnGunAmmo('harpoon') > 1
+ return tech.haveGunCheck("harpoon") && b.returnGunAmmo('harpoon') > 1 + this.count * 2
},
requires: "harpoon",
effect() {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "harpoon") {
- b.guns[i].ammo -= 2
+ b.guns[i].ammo -= 2 + this.count
if (b.guns[i].ammo < 0) b.guns[i].ammo = 0
simulation.updateGunHUD();
tech.extraHarpoons++;
break
}
}
+ this.description = `forge ${2+(this.count+1)*2} ammo into a new harpoon
fire +1 harpoon with each shot`
},
remove() {
if (tech.extraHarpoons) {
+ this.description = `forge ${2} ammo into a new harpoon
fire +1 harpoon with each shot`
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "harpoon") {
b.guns[i].ammo += 2
@@ -7531,8 +7513,16 @@ const tech = {
requires: "",
effect() {
for (let i = 0, len = mob.length; i < len; i++) {
- powerUps.directSpawn(mob[i].position.x, mob[i].position.y, "ammo");
- mob[i].death();
+ if (mob[i].isDropPowerUp) {
+ powerUps.directSpawn(mob[i].position.x, mob[i].position.y, "ammo");
+ mob[i].death();
+ }
+ }
+ for (let i = powerUp.length - 1; i > -1; i--) {
+ if (powerUp[i].name !== "ammo") {
+ Matter.Composite.remove(engine.world, powerUp[i]);
+ powerUp.splice(i, 1);
+ }
}
},
remove() {}
@@ -9488,5 +9478,5 @@ const tech = {
isGroundState: null,
isRailGun: null,
isGrapple: null,
- // isIntangibleGrapple: null
+ isImmuneGrapple: null,
}
\ No newline at end of file
diff --git a/todo.txt b/todo.txt
index c19ead6..482b72f 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,33 +1,24 @@
******************************************************** NEXT PATCH **************************************************
-grappling hook - small quality of life improvements
- about 30% larger, and a new shape (does more damage as a result)
- continues past mobs after hitting them instead of retracting
- pulls faster even at close range
- sticks into walls more reliably
- returns to you when you let go of fire, even when stuck
- loses ammo less often
- drains energy as it pulls
+grapple goes 40% farther before it retracts automatically
+grapple now works well with fire delay reduction
+ or it's annoying, you decide!
+smelting cost more ammo as you increase stacks
-JUNK tech: Mech v4.48 - open a portal to a primordial version of reality (an old scratch game I wrote)
-JUNK tech: harvest - convert all the mobs on this level into ammo
-pause menu stats are a bit different
+grappling hook tech: bulk modulus - immune to harm while grappling, but drain a bit of energy
+particle collider renamed pure science - and it gives 1 research instead of energy when it fails: 4% chance
+
******************************************************** TODO ********************************************************
grappling hook
- fire delay reduction doesn't have much effect
- tech: give harm immunity while being pulled?
- make not stack with alternator? so no energy regen
- tech: give no collisions, like boson composite while attached to harpoon
- make not stack with alternator? so no energy regen
- this was annoying to code, but probably doable
draw the hook part directly
two backwards angled spikes near the front
give player more control over motion while hanging and retracting
reduce friction effects so player swing around?
up down left right push player around?
scale velocity dampening with distance to grapple?
+ make a variable to track rope length?
tech that does less damage the more tech you have?
tech.totalCount