blast mines
tech: blast mines - mines stun when they activate laser mines only fire if crouching (so you can fire normal mines when energy is low) mines now includes the radius of the mob when calculating mobs in range so it will detonate from the final boss from farther away mines have a small random chance to detonate from targets up to 40% father away time dilation field drains less energy for the first few seconds, but linearly ramps up energy drain as you stay frozen in time unfreezing time returns you the normal drain rate in half the time to ramp up this should be a buff for all situations, except someone who has a huge external source of energy 360 wave beam has reduced mob slow effect
This commit is contained in:
201
js/bullet.js
201
js/bullet.js
@@ -717,7 +717,7 @@ const b = {
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
|
||||
Matter.Body.setDensity(bullet[me], 0.0005);
|
||||
bullet[me].explodeRad = 275;
|
||||
bullet[me].explodeRad = 300;
|
||||
bullet[me].onEnd = function() {
|
||||
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
|
||||
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
|
||||
@@ -742,7 +742,7 @@ const b = {
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
|
||||
Matter.Body.setDensity(bullet[me], 0.0005);
|
||||
bullet[me].explodeRad = 300;
|
||||
bullet[me].explodeRad = 305;
|
||||
bullet[me].onEnd = function() {
|
||||
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
|
||||
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
|
||||
@@ -777,7 +777,7 @@ const b = {
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
|
||||
Matter.Body.setDensity(bullet[me], 0.0005);
|
||||
bullet[me].explodeRad = 333 + Math.floor(Math.random() * 50) + tech.isBlockExplode * 100
|
||||
bullet[me].explodeRad = 350 + Math.floor(Math.random() * 50) + tech.isBlockExplode * 110
|
||||
bullet[me].onEnd = function() {
|
||||
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
|
||||
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
|
||||
@@ -853,7 +853,7 @@ const b = {
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.circle(where.x, where.y, 20, b.fireAttributes(angle, false));
|
||||
Matter.Body.setDensity(bullet[me], 0.0003);
|
||||
bullet[me].explodeRad = 333 + Math.floor(Math.random() * 50) + tech.isBlockExplode * 100
|
||||
bullet[me].explodeRad = 350 + Math.floor(Math.random() * 50) + tech.isBlockExplode * 100
|
||||
bullet[me].onEnd = function() {
|
||||
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
|
||||
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 6)
|
||||
@@ -1044,7 +1044,7 @@ const b = {
|
||||
//aoe damage to mobs
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.damageRadius + mob[i].radius) {
|
||||
let dmg = b.dmgScale * 0.09
|
||||
let dmg = b.dmgScale * 0.1
|
||||
if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
||||
if (mob[i].shield) dmg *= 3 //to make up for the /5 that shields normally take
|
||||
mob[i].damage(dmg);
|
||||
@@ -1587,6 +1587,20 @@ const b = {
|
||||
ctx.globalAlpha = 1;
|
||||
}
|
||||
},
|
||||
AoEStunEffect(where, range, cycles = 100 + 80 * Math.random()) {
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
if (mob[i].alive && !mob[i].isShielded && !mob[i].shield && !mob[i].isBadTarget) {
|
||||
if (Vector.magnitude(Vector.sub(where, mob[i].position)) - mob[i].radius < range) mobs.statusStun(mob[i], cycles)
|
||||
}
|
||||
}
|
||||
simulation.drawList.push({
|
||||
x: where.x,
|
||||
y: where.y,
|
||||
radius: range,
|
||||
color: "rgba(0,0,0,0.1)",
|
||||
time: 15
|
||||
});
|
||||
},
|
||||
laserMine(position, velocity = { x: 0, y: -8 }) {
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.polygon(position.x, position.y, 3, 25, {
|
||||
@@ -1624,15 +1638,17 @@ const b = {
|
||||
if (!(simulation.cycle % this.lookFrequency) && m.energy > this.drain) { //find mob targets
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
if (
|
||||
Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position)) < 2000000 &&
|
||||
Vector.magnitude(Vector.sub(this.position, mob[i].position)) < 1300 &&
|
||||
!mob[i].isBadTarget &&
|
||||
Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
|
||||
Matter.Query.ray(body, this.position, mob[i].position).length === 0
|
||||
) {
|
||||
b.AoEStunEffect(this.position, 1300);
|
||||
this.do = this.laserSpin
|
||||
this.endCycle = simulation.cycle + 360
|
||||
// if (this.angularSpeed < 0.01) this.torque += this.inertia * this.torqueMagnitude * 5 //spin
|
||||
this.isArmed = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1708,11 +1724,7 @@ const b = {
|
||||
});
|
||||
Matter.Body.setAngularVelocity(this, 0)
|
||||
}
|
||||
if (tech.isMineSentry) {
|
||||
this.sentry();
|
||||
} else {
|
||||
this.arm();
|
||||
}
|
||||
this.arm();
|
||||
|
||||
//sometimes the mine can't attach to map and it just needs to be reset
|
||||
const that = this
|
||||
@@ -1736,41 +1748,47 @@ const b = {
|
||||
this.stillCount++
|
||||
}
|
||||
}
|
||||
if (this.stillCount > 25) {
|
||||
if (tech.isMineSentry) {
|
||||
this.sentry();
|
||||
} else {
|
||||
this.arm();
|
||||
}
|
||||
}
|
||||
},
|
||||
sentry() {
|
||||
this.collisionFilter.mask = cat.map | cat.body | cat.mob | cat.mobBullet | cat.mobShield | cat.bullet //can now collide with other bullets
|
||||
this.lookFrequency = simulation.cycle + 60
|
||||
this.endCycle = simulation.cycle + 1620
|
||||
this.do = function() { //overwrite the do method for this bullet
|
||||
this.force.y += this.mass * 0.002; //extra gravity
|
||||
if (simulation.cycle > this.lookFrequency) {
|
||||
this.lookFrequency = 8 + Math.floor(3 * Math.random())
|
||||
this.do = function() { //overwrite the do method for this bullet
|
||||
this.force.y += this.mass * 0.002; //extra gravity
|
||||
if (!(simulation.cycle % this.lookFrequency) && !m.isBodiesAsleep) { //find mob targets
|
||||
this.endCycle -= 8
|
||||
b.targetedNail(this.position, 1, 45 + 5 * Math.random(), 1100, false, 2) //targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true, damage = 1.4) {
|
||||
if (!(simulation.cycle % (this.lookFrequency * 6))) {
|
||||
simulation.drawList.push({
|
||||
x: this.position.x,
|
||||
y: this.position.y,
|
||||
radius: 8,
|
||||
color: "#fe0",
|
||||
time: 4
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.stillCount > 25) this.arm();
|
||||
},
|
||||
// sentry() {
|
||||
// this.collisionFilter.mask = cat.map | cat.body | cat.mob | cat.mobBullet | cat.mobShield | cat.bullet //can now collide with other bullets
|
||||
// this.lookFrequency = simulation.cycle + 60
|
||||
// this.do = function() { //overwrite the do method for this bullet
|
||||
// this.force.y += this.mass * 0.002; //extra gravity
|
||||
// if (simulation.cycle > this.lookFrequency) {
|
||||
// const random = 300 * Math.random
|
||||
// for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
// if (
|
||||
// !mob[i].isBadTarget &&
|
||||
// Vector.magnitude(Vector.sub(this.position, mob[i].position)) < 700 + mob[i].radius + random &&
|
||||
// Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
|
||||
// Matter.Query.ray(body, this.position, mob[i].position).length === 0
|
||||
// ) {
|
||||
|
||||
// this.lookFrequency = 8 + Math.floor(3 * Math.random())
|
||||
// this.endCycle = simulation.cycle + 900
|
||||
// this.do = function() { //overwrite the do method for this bullet
|
||||
// this.force.y += this.mass * 0.002; //extra gravity
|
||||
// if (!(simulation.cycle % this.lookFrequency) && !m.isBodiesAsleep) { //find mob targets
|
||||
// // this.endCycle -= 8
|
||||
// b.targetedNail(this.position, 1, 45 + 5 * Math.random(), 1100, false, 2) //targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true, damage = 1.4) {
|
||||
// if (!(simulation.cycle % (this.lookFrequency * 6))) {
|
||||
// simulation.drawList.push({
|
||||
// x: this.position.x,
|
||||
// y: this.position.y,
|
||||
// radius: 8,
|
||||
// color: "#fe0",
|
||||
// time: 4
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
arm() {
|
||||
this.collisionFilter.mask = cat.map | cat.body | cat.mob | cat.mobBullet | cat.mobShield | cat.bullet //can now collide with other bullets
|
||||
this.lookFrequency = simulation.cycle + 60
|
||||
@@ -1789,13 +1807,41 @@ const b = {
|
||||
this.do = function() { //overwrite the do method for this bullet
|
||||
this.force.y += this.mass * 0.002; //extra gravity
|
||||
if (!(simulation.cycle % this.lookFrequency)) { //find mob targets
|
||||
const random = 300 * Math.random()
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
if (Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position)) < 500000 &&
|
||||
if (
|
||||
!mob[i].isBadTarget &&
|
||||
Vector.magnitude(Vector.sub(this.position, mob[i].position)) < 700 + mob[i].radius + random &&
|
||||
Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
|
||||
Matter.Query.ray(body, this.position, mob[i].position).length === 0) {
|
||||
this.endCycle = 0 //end life if mob is near and visible
|
||||
if (Math.random() < 0.8) isAmmoBack = false; //20% chance to get ammo back after detonation
|
||||
Matter.Query.ray(body, this.position, mob[i].position).length === 0
|
||||
) {
|
||||
b.AoEStunEffect(this.position, 700 + mob[i].radius + random);
|
||||
if (tech.isMineSentry) {
|
||||
this.lookFrequency = 8 + Math.floor(3 * Math.random())
|
||||
this.endCycle = simulation.cycle + 900
|
||||
this.do = function() { //overwrite the do method for this bullet
|
||||
this.force.y += this.mass * 0.002; //extra gravity
|
||||
if (!(simulation.cycle % this.lookFrequency) && !m.isBodiesAsleep) { //find mob targets
|
||||
b.targetedNail(this.position, 1, 45 + 5 * Math.random(), 1100, false, 2) //targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true, damage = 1.4) {
|
||||
if (!(simulation.cycle % (this.lookFrequency * 6))) {
|
||||
simulation.drawList.push({
|
||||
x: this.position.x,
|
||||
y: this.position.y,
|
||||
radius: 8,
|
||||
color: "#fe0",
|
||||
time: 4
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
} else {
|
||||
this.endCycle = 0 //end life if mob is near and visible
|
||||
if (Math.random() < 0.8) isAmmoBack = false; //20% chance to get ammo back after detonation
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1805,8 +1851,7 @@ const b = {
|
||||
},
|
||||
onEnd() {
|
||||
if (this.isArmed) {
|
||||
b.targetedNail(this.position, 22, 40 + 10 * Math.random(), 1200, true, 1.9) //targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true, damage = 1.4) {
|
||||
|
||||
b.targetedNail(this.position, tech.isMineSentry ? 7 : 22, 40 + 10 * Math.random(), 1200, true, 1.9) //targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true, damage = 1.4) {
|
||||
}
|
||||
if (tech.isMineAmmoBack && (!this.isArmed || Math.random() < 0.2)) { //get ammo back from tech.isMineAmmoBack
|
||||
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
|
||||
@@ -2382,7 +2427,7 @@ const b = {
|
||||
this.radioRadius = this.radioRadius * 0.993 + 0.007 * this.maxRadioRadius //smooth radius towards max
|
||||
//aoe damage to player
|
||||
if (Vector.magnitude(Vector.sub(player.position, this.position)) < this.radioRadius) {
|
||||
const DRAIN = tech.isRadioactiveResistance ? 0.0023 * 0.25 : 0.0023
|
||||
const DRAIN = tech.isRadioactiveResistance ? 0.002 * 0.25 : 0.002
|
||||
if (m.energy > DRAIN) {
|
||||
if (m.immuneCycle < m.cycle) m.energy -= DRAIN
|
||||
} else {
|
||||
@@ -2724,7 +2769,12 @@ const b = {
|
||||
const targets = [] //target nearby mobs
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
const dist = Vector.magnitude(Vector.sub(position, mob[i].position));
|
||||
if (dist < range && Matter.Query.ray(map, position, mob[i].position).length === 0 && Matter.Query.ray(body, position, mob[i].position).length === 0) {
|
||||
if (
|
||||
dist < range + mob[i].radius &&
|
||||
(!mob[i].isBadTarget) && //|| mob[i].isMobBullet
|
||||
Matter.Query.ray(map, position, mob[i].position).length === 0 &&
|
||||
Matter.Query.ray(body, position, mob[i].position).length === 0
|
||||
) {
|
||||
targets.push(Vector.add(mob[i].position, Vector.mult(mob[i].velocity, dist / 60))) //predict where the mob will be in a few cycles
|
||||
}
|
||||
}
|
||||
@@ -3830,11 +3880,11 @@ const b = {
|
||||
let knock, spread
|
||||
if (m.crouch) {
|
||||
spread = 0.65
|
||||
m.fireCDcycle = m.cycle + Math.floor(55 * b.fireCDscale) // cool down
|
||||
if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(58 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(58 * b.fireCDscale); //player is immune to damage for 30 cycles
|
||||
m.fireCDcycle = m.cycle + Math.floor(60 * b.fireCDscale) // cool down
|
||||
if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(60 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(60 * b.fireCDscale); //player is immune to damage for 30 cycles
|
||||
knock = 0.01
|
||||
} else {
|
||||
m.fireCDcycle = m.cycle + Math.floor(45 * b.fireCDscale) // cool down
|
||||
m.fireCDcycle = m.cycle + Math.floor(47 * b.fireCDscale) // cool down
|
||||
if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(47 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(47 * b.fireCDscale); //player is immune to damage for 30 cycles
|
||||
spread = 1.3
|
||||
knock = 0.1
|
||||
@@ -4198,8 +4248,8 @@ const b = {
|
||||
}
|
||||
if (!mob[j].isShielded) {
|
||||
Matter.Body.setVelocity(mob[j], { //friction
|
||||
x: mob[j].velocity.x * 0.93,
|
||||
y: mob[j].velocity.y * 0.93
|
||||
x: mob[j].velocity.x * 0.95,
|
||||
y: mob[j].velocity.y * 0.95
|
||||
});
|
||||
//draw vibes
|
||||
let vertices = mob[j].vertices;
|
||||
@@ -4585,20 +4635,37 @@ const b = {
|
||||
name: "mine",
|
||||
description: "toss a <strong>proximity</strong> mine that <strong>sticks</strong> to walls<br>fires <strong>nails</strong> at mobs within range",
|
||||
ammo: 0,
|
||||
ammoPack: 1.5,
|
||||
ammoPack: 1.4,
|
||||
have: false,
|
||||
do() {},
|
||||
fire() {
|
||||
if (tech.isLaserMine) { //laser mine
|
||||
const speed = m.crouch ? 50 : 20
|
||||
const velocity = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }
|
||||
b.laserMine(m.pos, velocity)
|
||||
} else { //normal mines
|
||||
|
||||
if (m.crouch) {
|
||||
if (tech.isLaserMine) {
|
||||
const speed = 40
|
||||
const velocity = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }
|
||||
b.laserMine(m.pos, velocity)
|
||||
} else {
|
||||
const pos = {
|
||||
x: m.pos.x + 30 * Math.cos(m.angle),
|
||||
y: m.pos.y + 30 * Math.sin(m.angle)
|
||||
}
|
||||
let speed = 36
|
||||
if (Matter.Query.point(map, pos).length > 0) { //don't fire if mine will spawn inside map
|
||||
speed = -2
|
||||
}
|
||||
b.mine(pos, {
|
||||
x: speed * Math.cos(m.angle),
|
||||
y: speed * Math.sin(m.angle)
|
||||
}, 0, tech.isMineAmmoBack)
|
||||
}
|
||||
m.fireCDcycle = m.cycle + Math.floor(50 * b.fireCDscale); // cool down
|
||||
} else {
|
||||
const pos = {
|
||||
x: m.pos.x + 30 * Math.cos(m.angle),
|
||||
y: m.pos.y + 30 * Math.sin(m.angle)
|
||||
}
|
||||
let speed = m.crouch ? 36 : 22
|
||||
let speed = 23
|
||||
if (Matter.Query.point(map, pos).length > 0) { //don't fire if mine will spawn inside map
|
||||
speed = -2
|
||||
}
|
||||
@@ -4606,8 +4673,8 @@ const b = {
|
||||
x: speed * Math.cos(m.angle),
|
||||
y: speed * Math.sin(m.angle)
|
||||
}, 0, tech.isMineAmmoBack)
|
||||
m.fireCDcycle = m.cycle + Math.floor(25 * b.fireCDscale); // cool down
|
||||
}
|
||||
m.fireCDcycle = m.cycle + Math.floor((m.crouch ? 50 : 25) * b.fireCDscale); // cool down
|
||||
}
|
||||
}, {
|
||||
name: "spores",
|
||||
@@ -4838,7 +4905,7 @@ const b = {
|
||||
name: "rail gun",
|
||||
description: "use <strong class='color-f'>energy</strong> to launch a high-speed <strong>dense</strong> rod<br><strong>hold</strong> left mouse to charge, <strong>release</strong> to fire",
|
||||
ammo: 0,
|
||||
ammoPack: 4.1,
|
||||
ammoPack: 3.5,
|
||||
have: false,
|
||||
do() {},
|
||||
fire() {
|
||||
|
||||
14
js/level.js
14
js/level.js
@@ -15,9 +15,9 @@ const level = {
|
||||
// level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why
|
||||
// simulation.isHorizontalFlipped = true
|
||||
// tech.isFieldFree = true
|
||||
// m.setField("perfect diamagnetism")
|
||||
// b.giveGuns("drones")
|
||||
// tech.giveTech("Meissner effect")
|
||||
// m.setField("time dilation")
|
||||
// b.giveGuns("mine")
|
||||
// tech.giveTech("laser-mines")
|
||||
// b.giveGuns("nail gun")
|
||||
// tech.giveTech("Lenz's law")
|
||||
// for (let i = 0; i < 9; i++) tech.giveTech("MIRV")
|
||||
@@ -113,24 +113,24 @@ const level = {
|
||||
difficultyIncrease(num = 1) {
|
||||
for (let i = 0; i < num; i++) {
|
||||
simulation.difficulty++
|
||||
b.dmgScale *= 0.915; //damage done by player decreases each level
|
||||
b.dmgScale *= 0.914; //damage done by player decreases each level
|
||||
if (simulation.accelScale < 5) simulation.accelScale *= 1.02 //mob acceleration increases each level
|
||||
if (simulation.lookFreqScale > 0.2) simulation.lookFreqScale *= 0.98 //mob cycles between looks decreases each level
|
||||
if (simulation.CDScale > 0.2) simulation.CDScale *= 0.97 //mob CD time decreases each level
|
||||
}
|
||||
simulation.dmgScale = 0.39 * simulation.difficulty //damage done by mobs increases each level
|
||||
simulation.dmgScale = 0.4 * simulation.difficulty //damage done by mobs increases each level
|
||||
simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale;
|
||||
},
|
||||
difficultyDecrease(num = 1) { //used in easy mode for simulation.reset()
|
||||
for (let i = 0; i < num; i++) {
|
||||
simulation.difficulty--
|
||||
b.dmgScale /= 0.915; //damage done by player decreases each level
|
||||
b.dmgScale /= 0.914; //damage done by player decreases each level
|
||||
if (simulation.accelScale > 0.2) simulation.accelScale /= 1.02 //mob acceleration increases each level
|
||||
if (simulation.lookFreqScale < 5) simulation.lookFreqScale /= 0.98 //mob cycles between looks decreases each level
|
||||
if (simulation.CDScale < 5) simulation.CDScale /= 0.97 //mob CD time decreases each level
|
||||
}
|
||||
if (simulation.difficulty < 1) simulation.difficulty = 0;
|
||||
simulation.dmgScale = 0.39 * simulation.difficulty //damage done by mobs increases each level
|
||||
simulation.dmgScale = 0.4 * simulation.difficulty //damage done by mobs increases each level
|
||||
if (simulation.dmgScale < 0.1) simulation.dmgScale = 0.1;
|
||||
simulation.healScale = 1 / (1 + simulation.difficulty * 0.055)
|
||||
},
|
||||
|
||||
43
js/player.js
43
js/player.js
@@ -490,7 +490,7 @@ const m = {
|
||||
harmReduction() {
|
||||
let dmg = 1
|
||||
dmg *= m.fieldHarmReduction
|
||||
if (tech.isZeno) dmg *= 0.16
|
||||
if (tech.isZeno) dmg *= 0.17
|
||||
if (tech.isFieldHarmReduction) dmg *= 0.5
|
||||
if (tech.isHarmMACHO) dmg *= 0.33
|
||||
if (tech.isImmortal) dmg *= 0.66
|
||||
@@ -1949,7 +1949,7 @@ const m = {
|
||||
m.energy -= 0.04;
|
||||
b.iceIX(1)
|
||||
} else if (tech.isDroneRadioactive) {
|
||||
m.energy -= 0.85;
|
||||
m.energy -= 0.8;
|
||||
b.droneRadioactive({ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5) }, 25)
|
||||
} else {
|
||||
m.energy -= 0.45 * tech.droneEnergyReduction;
|
||||
@@ -2038,6 +2038,7 @@ const m = {
|
||||
// m.fieldMeterColor = "#000"
|
||||
m.fieldFire = true;
|
||||
m.isBodiesAsleep = false;
|
||||
m.drain = 0.0005
|
||||
m.hold = function() {
|
||||
if (m.isHolding) {
|
||||
m.wakeCheck();
|
||||
@@ -2048,10 +2049,10 @@ const m = {
|
||||
m.grabPowerUp();
|
||||
m.lookForPickUp(180);
|
||||
|
||||
const DRAIN = 0.0013
|
||||
if (m.energy > DRAIN) {
|
||||
m.energy -= DRAIN;
|
||||
if (m.energy < DRAIN) {
|
||||
m.drain += 0.0000025
|
||||
if (m.energy > m.drain) {
|
||||
m.energy -= m.drain;
|
||||
if (m.energy < m.drain) {
|
||||
m.fieldCDcycle = m.cycle + 120;
|
||||
m.energy = 0;
|
||||
m.wakeCheck();
|
||||
@@ -2076,19 +2077,6 @@ const m = {
|
||||
sleep(mob);
|
||||
sleep(body);
|
||||
sleep(bullet);
|
||||
// for (let i = 0, len = cons.length; i < len; i++) {
|
||||
// Matter.Body.setVelocity(cons[i].bodyB, {
|
||||
// x: 0,
|
||||
// y: 0
|
||||
// });
|
||||
// }
|
||||
//doesn't really work, just slows down constraints
|
||||
// for (let i = 0, len = cons.length; i < len; i++) {
|
||||
// if (cons[i].stiffness !== 0) {
|
||||
// cons[i].storeStiffness = cons[i].stiffness;
|
||||
// cons[i].stiffness = 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
simulation.cycle--; //pause all functions that depend on game cycle increasing
|
||||
if (tech.isTimeSkip) {
|
||||
@@ -2097,32 +2085,17 @@ const m = {
|
||||
m.cycle++;
|
||||
simulation.gravity();
|
||||
if (tech.isFireMoveLock && input.fire) {
|
||||
// Matter.Body.setVelocity(player, {
|
||||
// x: 0,
|
||||
// y: -55 * player.mass * simulation.g //undo gravity before it is added
|
||||
// });
|
||||
player.force.x = 0
|
||||
player.force.y = 0
|
||||
}
|
||||
Engine.update(engine, simulation.delta);
|
||||
m.move();
|
||||
simulation.checks();
|
||||
// mobs.loop();
|
||||
// m.draw();
|
||||
m.walk_cycle += m.flipLegs * m.Vx;
|
||||
// m.hold();
|
||||
// m.energy += DRAIN; // 1 to undo the energy drain from time speed up, 0.5 to cut energy drain in half
|
||||
|
||||
b.fire();
|
||||
// b.bulletRemove();
|
||||
b.bulletDo();
|
||||
simulation.isTimeSkipping = false;
|
||||
}
|
||||
// simulation.cycle--; //pause all functions that depend on game cycle increasing
|
||||
// if (tech.isTimeSkip && !simulation.isTimeSkipping) { //speed up the rate of time
|
||||
// simulation.timeSkip(1)
|
||||
// m.energy += 1.5 * DRAIN; //x1 to undo the energy drain from time speed up, x1.5 to cut energy drain in half
|
||||
// }
|
||||
} else { //holding, but field button is released
|
||||
m.wakeCheck();
|
||||
}
|
||||
@@ -2130,9 +2103,11 @@ const m = {
|
||||
m.wakeCheck();
|
||||
m.pickUp();
|
||||
} else {
|
||||
if (m.drain > 0.0005) m.drain -= 0.000005 //return drain to base level
|
||||
m.wakeCheck();
|
||||
m.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
}
|
||||
// console.log(m.drain.toFixed(6))
|
||||
m.drawFieldMeter()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ const powerUps = {
|
||||
// if (powerUps.research.count) text += `<div class="choose-grid-module" onclick="powerUps.research.use('tech')"><div class="grid-title"><div class="circle-grid research"></div> research <span class="research-select">${powerUps.research.count}</span></div></div>`
|
||||
|
||||
if (tech.isExtraGunField) {
|
||||
if (Math.random() > 0.5) {
|
||||
if (Math.random() > 0.5 && b.inventory.length < b.guns.length) {
|
||||
//bonus gun in tech menu
|
||||
let choiceGun = powerUps.gun.pick(b.guns)
|
||||
powerUps.gun.choiceLog.push(choiceGun)
|
||||
@@ -693,8 +693,8 @@ const powerUps = {
|
||||
powerUps.research.currentRerollCount = 0
|
||||
if (tech.isTechDamage && who.name === "tech") m.damage(0.11)
|
||||
if (tech.isMassEnergy) m.energy += 2;
|
||||
if (tech.isMineDrop) {
|
||||
if (tech.isLaserMine) {
|
||||
if (tech.isMineDrop && b.length < 150) {
|
||||
if (tech.isLaserMine && m.crouch) {
|
||||
b.laserMine(who.position)
|
||||
} else {
|
||||
b.mine(who.position, { x: 0, y: 0 }, 0, tech.isMineAmmoBack)
|
||||
|
||||
60
js/tech.js
60
js/tech.js
@@ -2,9 +2,9 @@
|
||||
totalCount: null,
|
||||
setupAllTech() {
|
||||
for (let i = 0, len = tech.tech.length; i < len; i++) {
|
||||
tech.tech[i].remove();
|
||||
tech.tech[i].isLost = false
|
||||
tech.tech[i].count = 0
|
||||
tech.tech[i].isLost = false
|
||||
tech.tech[i].remove();
|
||||
if (tech.tech[i].isJunk) {
|
||||
tech.tech[i].frequency = 0
|
||||
} else if (tech.tech[i].frequencyDefault) {
|
||||
@@ -670,7 +670,7 @@
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return tech.isStunField || tech.oneSuperBall || tech.isCloakStun || tech.orbitBotCount > 1 || tech.isExplosionStun
|
||||
return tech.isStunField || tech.oneSuperBall || tech.isCloakStun || tech.orbitBotCount > 1 || tech.isExplosionStun || tech.isMineStun
|
||||
},
|
||||
requires: "a stun effect",
|
||||
effect() {
|
||||
@@ -1937,7 +1937,7 @@
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return tech.isStunField || tech.isExplosionStun || tech.oneSuperBall || tech.isHarmFreeze || tech.isIceField || tech.relayIce || tech.isIceCrystals || tech.isSporeFreeze || tech.isAoESlow || tech.isFreezeMobs || tech.isCloakStun || tech.orbitBotCount > 1 || tech.isWormholeDamage || tech.blockingIce > 1 || tech.iceIXOnDeath || tech.isIceShot
|
||||
return tech.isStunField || tech.isExplosionStun || tech.isMineStun || tech.oneSuperBall || tech.isHarmFreeze || tech.isIceField || tech.relayIce || tech.isIceCrystals || tech.isSporeFreeze || tech.isAoESlow || tech.isFreezeMobs || tech.isCloakStun || tech.orbitBotCount > 1 || tech.isWormholeDamage || tech.blockingIce > 1 || tech.iceIXOnDeath || tech.isIceShot
|
||||
},
|
||||
requires: "a freezing or stunning effect",
|
||||
effect() {
|
||||
@@ -2478,7 +2478,7 @@
|
||||
},
|
||||
{
|
||||
name: "Zeno's paradox",
|
||||
description: "reduce <strong class='color-harm'>harm</strong> by <strong>84%</strong>, but every <strong>5</strong> seconds<br>remove <strong>1/10</strong> of your current <strong class='color-h'>health</strong>",
|
||||
description: "reduce <strong class='color-harm'>harm</strong> by <strong>83%</strong>, but every <strong>5</strong> seconds<br>remove <strong>1/10</strong> of your current <strong class='color-h'>health</strong>",
|
||||
// description: "every <strong>5</strong> seconds remove <strong>1/10</strong> of your <strong class='color-h'>health</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>90%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
@@ -4417,16 +4417,16 @@
|
||||
},
|
||||
{
|
||||
name: "laser-mines",
|
||||
description: "<strong>mines</strong> hover in place until <strong>mobs</strong> get in range<br><strong>mines</strong> use <strong class='color-f'>energy</strong> to emit <strong>3</strong> unaimed <strong class='color-laser'>lasers</strong>",
|
||||
description: "<strong>mines</strong> laid while you are <strong>crouched</strong><br>use <strong class='color-f'>energy</strong> to emit <strong>3</strong> unaimed <strong class='color-laser'>lasers</strong>",
|
||||
isGunTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return (tech.haveGunCheck("mine") || tech.isMineDrop) && !tech.isMineSentry
|
||||
return tech.haveGunCheck("mine")
|
||||
},
|
||||
requires: "mines, not sentry",
|
||||
requires: "mines",
|
||||
effect() {
|
||||
tech.isLaserMine = true;
|
||||
},
|
||||
@@ -4443,9 +4443,9 @@
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return tech.haveGunCheck("mine") && !tech.isMineSentry
|
||||
return tech.haveGunCheck("mine") && !tech.isMineDrop
|
||||
},
|
||||
requires: "mine, not sentry",
|
||||
requires: "mine, not bobby trap",
|
||||
effect() {
|
||||
tech.isMineAmmoBack = true;
|
||||
},
|
||||
@@ -4455,16 +4455,16 @@
|
||||
},
|
||||
{
|
||||
name: "sentry",
|
||||
description: "<strong>mines</strong> <strong>target</strong> mobs with nails over time<br>mines last about <strong>14</strong> seconds",
|
||||
description: "instead of detonating, <strong>mines</strong> <strong>target</strong> mobs<br>with a stream of nails for about <strong>14</strong> seconds",
|
||||
isGunTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return (tech.haveGunCheck("mine") || tech.isMineDrop) && !tech.isMineAmmoBack && !tech.isLaserMine
|
||||
return tech.haveGunCheck("mine")
|
||||
},
|
||||
requires: "mines, not mine reclamation, laser-mines",
|
||||
requires: "mines",
|
||||
effect() {
|
||||
tech.isMineSentry = true;
|
||||
},
|
||||
@@ -4473,24 +4473,43 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "booby trap",
|
||||
description: "drop a <strong>mine</strong> after picking up a <strong>power up</strong><br><strong>+23</strong> <strong class='color-j'>JUNK</strong> to the potential <strong class='color-m'>tech</strong> pool",
|
||||
name: "blast mines",
|
||||
description: "when a <strong>mine</strong> <strong>activates</strong><br>it <strong>stuns</strong> nearby mobs for up to <strong>3</strong> seconds",
|
||||
isGunTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return tech.isMineSentry === true || tech.isLaserMine === true || tech.isMineAmmoBack === true
|
||||
return tech.haveGunCheck("mine")
|
||||
},
|
||||
requires: "some mine tech",
|
||||
requires: "mines",
|
||||
effect() {
|
||||
tech.isMineStun = true;
|
||||
},
|
||||
remove() {
|
||||
tech.isMineStun = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "booby trap",
|
||||
description: "drop a <strong>mine</strong> after picking up a <strong>power up</strong><br><strong>+30</strong> <strong class='color-j'>JUNK</strong> to the potential <strong class='color-m'>tech</strong> pool",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return tech.haveGunCheck("mine") && !tech.isMineAmmoBack
|
||||
},
|
||||
requires: "mines, not mine reclamation",
|
||||
effect() {
|
||||
tech.isMineDrop = true;
|
||||
if (tech.isMineDrop) b.mine(m.pos, { x: 0, y: 0 }, 0, tech.isMineAmmoBack)
|
||||
tech.addJunkTechToPool(23)
|
||||
tech.addJunkTechToPool(30)
|
||||
},
|
||||
remove() {
|
||||
tech.isMineDrop = false;
|
||||
if (this.count > 0) tech.removeJunkTechFromPool(13)
|
||||
if (this.count > 0) tech.removeJunkTechFromPool(30)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -7878,5 +7897,6 @@
|
||||
isFieldFree: null,
|
||||
wormSurviveDmg: null,
|
||||
isExtraGunField: null,
|
||||
isBigField: null
|
||||
isBigField: null,
|
||||
isMineStun: null
|
||||
}
|
||||
Reference in New Issue
Block a user