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

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1358,13 +1358,12 @@ const b = {
thrustMag: 0.1, thrustMag: 0.1,
dmg: 6, //damage done in addition to the damage from momentum dmg: 6, //damage done in addition to the damage from momentum
classType: "bullet", classType: "bullet",
endCycle: simulation.cycle + 45, endCycle: simulation.cycle + 70,
collisionFilter: { collisionFilter: {
category: cat.bullet, category: cat.bullet,
mask: tech.isShieldPierce ? cat.body | cat.mob | cat.mobBullet : cat.body | cat.mob | cat.mobBullet | cat.mobShield, mask: tech.isShieldPierce ? cat.body | cat.mob | cat.mobBullet : cat.body | cat.mob | cat.mobBullet | cat.mobShield,
}, },
minDmgSpeed: 4, minDmgSpeed: 4,
ropeExtension: 0,
lookFrequency: Math.floor(7 + Math.random() * 3), 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 density: tech.harpoonDensity, //0.001 is normal for blocks, 0.006 is normal for harpoon, 0.006*6 when buffed
drain: 0.004, drain: 0.004,
@@ -1517,7 +1516,7 @@ const b = {
x: m.pos.x + 30 * Math.cos(m.angle), x: m.pos.x + 30 * Math.cos(m.angle),
y: m.pos.y + 30 * Math.sin(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) { if (input.fire) {
//control position while hooked //control position while hooked
// if (input.down) { //down // if (input.down) { //down
@@ -1566,21 +1565,18 @@ const b = {
} }
} }
} }
// if (tech.isIntangibleGrapple) { if (tech.isImmuneGrapple && m.immuneCycle < m.cycle + 10) {
// player.collisionFilter.mask = cat.map m.immuneCycle = m.cycle + 10;
// let inPlayer = Matter.Query.region(mob, player.bounds) if (m.energy > 0.001) {
// if (inPlayer.length > 0) { m.energy -= 0.001
// for (let i = 0; i < inPlayer.length; i++) { } else {
// if (m.energy > 0 && inPlayer[i].shield) m.energy -= 0.014; Matter.Sleeping.set(this, false)
// } this.collisionFilter.category = 0
// } this.collisionFilter.mask = 0
// //check for disabling intangible in next cycle this.do = this.returnToPlayer
// requestAnimationFrame(() => { this.endCycle = simulation.cycle + 60
// if (!tech.isIntangibleGrapple || !input.fire || this.) { }
// player.collisionFilter.mask = cat.body | cat.map | cat.mob | cat.mobBullet | cat.mobShield //normal collisions }
// }
// });
// }
} else { } else {
Matter.Sleeping.set(this, false) Matter.Sleeping.set(this, false)
this.collisionFilter.category = 0 this.collisionFilter.category = 0
@@ -6092,11 +6088,11 @@ const b = {
} }
this.ammo++ //make up for the ammo used up in fire() this.ammo++ //make up for the ammo used up in fire()
simulation.updateGunHUD(); simulation.updateGunHUD();
m.fireCDcycle = m.cycle + 90 // cool down m.fireCDcycle = m.cycle + Math.floor(75 * b.fireCDscale) // cool down
} else { } else {
b.grapple(where, m.angle, harpoonSize) 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() { harpoonFire() {
const where = { const where = {

View File

@@ -18,7 +18,7 @@ const level = {
// m.setField("time dilation") // m.setField("time dilation")
// b.giveGuns("harpoon") // b.giveGuns("harpoon")
// for (let i = 0; i < 9; i++) tech.giveTech("smelting") // for (let i = 0; i < 9; i++) tech.giveTech("smelting")
// tech.giveTech("boson quasiparticles") // tech.giveTech("exchange interaction")
// tech.giveTech("grappling hook") // tech.giveTech("grappling hook")
// for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech"); // for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech");
// for (let i = 0; i < 3; i++) tech.giveTech("undefined") // for (let i = 0; i < 3; i++) tech.giveTech("undefined")

View File

@@ -1045,9 +1045,9 @@ const powerUps = {
}, },
pauseEjectTech(index) { pauseEjectTech(index) {
if (tech.isPauseEjectTech || simulation.testing) { if (tech.isPauseEjectTech || simulation.testing) {
if (Math.random() < 0.04) { if (Math.random() < 0.04 || tech.tech[index].isFromAppliedScience) {
tech.removeTech(index) 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 { } else {
powerUps.ejectTech(index) powerUps.ejectTech(index)
} }

View File

@@ -369,6 +369,7 @@ const tech = {
if (gunTechPool.length) { if (gunTechPool.length) {
const index = Math.floor(Math.random() * gunTechPool.length) const index = Math.floor(Math.random() * gunTechPool.length)
tech.giveTech(gunTechPool[index]) // choose from the gun pool 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>")`) 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", name: "spinstatistics theorem",
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`, 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, maxCount: 3,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -1645,7 +1646,7 @@ const tech = {
}, },
requires: "", requires: "",
effect() { effect() {
tech.cyclicImmunity += 108; tech.cyclicImmunity += 114;
}, },
remove() { remove() {
tech.cyclicImmunity = 0; tech.cyclicImmunity = 0;
@@ -3066,8 +3067,8 @@ const tech = {
} }
}, },
{ {
name: "particle collider", name: "pure science",
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>`, 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, maxCount: 1,
count: 0, count: 0,
frequency: 1, 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", name: "bulk modulus",
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>", 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, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 2, frequency: 2,
frequencyDefault: 2, frequencyDefault: 2,
allowed() { 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() { effect() {
tech.isRailEnergyGain = true; tech.isRailEnergyGain = true;
}, },
@@ -5652,7 +5632,7 @@ const tech = {
allowed() { allowed() {
return (!tech.isLargeHarpoon && tech.haveGunCheck("harpoon")) || (tech.isNeedles || tech.isNeedleShot) 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() { effect() {
tech.isShieldPierce = true tech.isShieldPierce = true
}, },
@@ -5671,7 +5651,7 @@ const tech = {
allowed() { allowed() {
return tech.haveGunCheck("harpoon") && !tech.isShieldPierce return tech.haveGunCheck("harpoon") && !tech.isShieldPierce
}, },
requires: "harpoon", requires: "harpoon not ceramics",
effect() { effect() {
tech.isLargeHarpoon = true; tech.isLargeHarpoon = true;
}, },
@@ -5690,22 +5670,24 @@ const tech = {
frequency: 2, frequency: 2,
frequencyDefault: 2, frequencyDefault: 2,
allowed() { allowed() {
return tech.haveGunCheck("harpoon") && b.returnGunAmmo('harpoon') > 1 return tech.haveGunCheck("harpoon") && b.returnGunAmmo('harpoon') > 1 + this.count * 2
}, },
requires: "harpoon", requires: "harpoon",
effect() { effect() {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "harpoon") { 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 if (b.guns[i].ammo < 0) b.guns[i].ammo = 0
simulation.updateGunHUD(); simulation.updateGunHUD();
tech.extraHarpoons++; tech.extraHarpoons++;
break 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() { remove() {
if (tech.extraHarpoons) { 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 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "harpoon") { if (b.guns[i].name === "harpoon") {
b.guns[i].ammo += 2 b.guns[i].ammo += 2
@@ -7531,8 +7513,16 @@ const tech = {
requires: "", requires: "",
effect() { effect() {
for (let i = 0, len = mob.length; i < len; i++) { for (let i = 0, len = mob.length; i < len; i++) {
powerUps.directSpawn(mob[i].position.x, mob[i].position.y, "ammo"); if (mob[i].isDropPowerUp) {
mob[i].death(); 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() {} remove() {}
@@ -9488,5 +9478,5 @@ const tech = {
isGroundState: null, isGroundState: null,
isRailGun: null, isRailGun: null,
isGrapple: null, isGrapple: null,
// isIntangibleGrapple: null isImmuneGrapple: null,
} }

View File

@@ -1,33 +1,24 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
grappling hook - small quality of life improvements grapple goes 40% farther before it retracts automatically
about 30% larger, and a new shape (does more damage as a result) grapple now works well with fire delay reduction
continues past mobs after hitting them instead of retracting or it's annoying, you decide!
pulls faster even at close range smelting cost more ammo as you increase stacks
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
JUNK tech: Mech v4.48 - open a portal to a primordial version of reality (an old scratch game I wrote) grappling hook tech: bulk modulus - immune to harm while grappling, but drain a bit of energy
JUNK tech: harvest - convert all the mobs on this level into ammo
pause menu stats are a bit different
particle collider renamed pure science - and it gives 1 research instead of energy when it fails: 4% chance
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
grappling hook 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 draw the hook part directly
two backwards angled spikes near the front two backwards angled spikes near the front
give player more control over motion while hanging and retracting give player more control over motion while hanging and retracting
reduce friction effects so player swing around? reduce friction effects so player swing around?
up down left right push player around? up down left right push player around?
scale velocity dampening with distance to grapple? 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 that does less damage the more tech you have?
tech.totalCount tech.totalCount