bulk modulus

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

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
This commit is contained in:
landgreen
2022-02-28 05:36:58 -08:00
parent 05dbd63a50
commit 50fbd618a6
6 changed files with 73 additions and 96 deletions

View File

@@ -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 = {

View File

@@ -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")

View File

@@ -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)
}

View File

@@ -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(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[gunTechPool[index]].name}</span>")`)
}
}
@@ -1634,8 +1635,8 @@ const tech = {
}
},
{
name: "complex spin-statistics",
description: `become <strong>immune</strong> to <strong class='color-harm'>harm</strong> for <strong>1.8</strong> seconds<br>once every <strong>7</strong> seconds`,
name: "spinstatistics theorem",
description: `become <strong>immune</strong> to <strong class='color-harm'>harm</strong> for <strong>1.9</strong> seconds<br>once every <strong>7</strong> 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: `<strong>clicking</strong> <strong class='color-m'>tech</strong> while paused <strong>ejects</strong> them<br><em><strong>4%</strong> chance to convert that tech into <strong class='color-f'>energy</strong></em>`,
name: "pure science",
description: `<strong>clicking</strong> <strong class='color-m'>tech</strong> while paused <strong>ejects</strong> them<br><strong>4%</strong> 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: `<strong>immune</strong> to <strong class='color-harm'>harm</strong> while <strong>grappling</strong>`,
// // link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Boson' class="link">boson</a>`,
// 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: `<strong>intangible</strong> to <strong class='color-block'>blocks</strong> and mobs while <strong>grappling</strong><br>passing through <strong>shields</strong> drains your <strong class='color-f'>energy</strong>`,
// link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Boson' class="link">boson</a>`,
// 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: "<strong>harpoon</strong> and <strong>grappling hook</strong> drain no <strong class='color-f'>energy</strong><br><strong>railgun</strong> generates <strong class='color-f'>energy</strong>", //as they <strong>retract</strong><br><strong>crouch</strong> firing <strong>harpoon</strong> generates <strong class='color-f'>energy</strong>",
name: "bulk modulus",
description: `become <strong>immune</strong> to <strong class='color-harm'>harm</strong> while <strong>grappling</strong><br>drains <strong class='color-f'>energy</strong> and prevents <strong>regen</strong>`,
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: "<strong>harpoons</strong> drain no <strong class='color-f'>energy</strong><br><strong>railgun</strong> generates <strong class='color-f'>energy</strong>", //as they <strong>retract</strong><br><strong>crouch</strong> firing <strong>harpoon</strong> generates <strong class='color-f'>energy</strong>",
isGunTech: true,
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.haveGunCheck("harpoon") && !tech.isImmuneGrapple
},
requires: "railgun, not BoseEinstein 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 <strong>${2+(this.count+1)*2}</strong> <strong class='color-ammo'>ammo</strong> into a new harpoon<br>fire <strong>+1</strong> <strong>harpoon</strong> with each shot`
},
remove() {
if (tech.extraHarpoons) {
this.description = `forge <strong>${2}</strong> <strong class='color-ammo'>ammo</strong> into a new harpoon<br>fire <strong>+1</strong> <strong>harpoon</strong> 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,
}