mod - emp

This commit is contained in:
landgreen
2020-03-31 19:01:01 -07:00
parent fc34952a86
commit 19c1224796
5 changed files with 69 additions and 35 deletions

View File

@@ -70,6 +70,7 @@ const b = {
isModHarmDamage: null, isModHarmDamage: null,
isModAlphaRadiation: null, isModAlphaRadiation: null,
modEnergyRegen: null, modEnergyRegen: null,
isModVacuumShield: null,
modOnHealthChange() { //used with acid mod modOnHealthChange() { //used with acid mod
if (b.isModAcidDmg && mech.health > 0.8) { if (b.isModAcidDmg && mech.health > 0.8) {
b.modAcidDmg = 0.7 b.modAcidDmg = 0.7
@@ -1026,7 +1027,7 @@ const b = {
}, },
{ {
name: "optimized shell packing", name: "optimized shell packing",
description: "<strong>flak</strong> ammo drops contain <strong>2x</strong> more shells", description: "<strong>flak</strong> ammo drops contain <strong>3x</strong> more shells",
maxCount: 3, maxCount: 3,
count: 0, count: 0,
allowed() { allowed() {
@@ -1035,7 +1036,7 @@ const b = {
requires: "flak", requires: "flak",
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 === "flak") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * (2 + this.count); if (b.guns[i].name === "flak") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * (3 + this.count);
} }
}, },
remove() { remove() {
@@ -1044,6 +1045,22 @@ const b = {
} }
} }
}, },
{
name: "electromagnetic pulse",
description: "<strong>vacuum bomb's </strong> <strong class='color-e'>explosion</strong> destroys <strong>shields</strong><br>and does <strong>20%</strong> more <strong class='color-d'>damage</strong>",
maxCount: 1,
count: 0,
allowed() {
return b.haveGunCheck("vacuum bomb")
},
requires: "vacuum bomb",
effect() {
b.isModVacuumShield = true;
},
remove() {
b.isModVacuumShield = false;
}
},
{ {
name: "mine reclamation", name: "mine reclamation",
description: "retrieve <strong>ammo</strong> from all undetonated <strong>mines</strong><br>and <strong>20%</strong> of <strong>mines</strong> after detonation", description: "retrieve <strong>ammo</strong> from all undetonated <strong>mines</strong><br>and <strong>20%</strong> of <strong>mines</strong> after detonation",
@@ -1994,7 +2011,7 @@ const b = {
friction: 0.05, friction: 0.05,
frictionAir: 0.0005, frictionAir: 0.0005,
restitution: 1, restitution: 1,
dmg: 0.13, //damage done in addition to the damage from momentum dmg: 0.15, //damage done in addition to the damage from momentum
lookFrequency: 83 + Math.floor(41 * Math.random()), lookFrequency: 83 + Math.floor(41 * Math.random()),
endCycle: game.cycle + Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger), endCycle: game.cycle + Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger),
classType: "bullet", classType: "bullet",
@@ -2378,8 +2395,10 @@ const b = {
// bullet[me].dmg = 0.1 // bullet[me].dmg = 0.1
bullet[me].frictionAir = 0.034; bullet[me].frictionAir = 0.034;
bullet[me].do = function () { bullet[me].do = function () {
const scale = 1 - 0.035 / b.isModBulletsLastLonger if (!mech.isBodiesAsleep) {
Matter.Body.scale(this, scale, scale); const scale = 1 - 0.035 / b.isModBulletsLastLonger
Matter.Body.scale(this, scale, scale);
}
}; };
} }
} }
@@ -2499,7 +2518,7 @@ const b = {
name: "wave beam", //4 name: "wave beam", //4
description: "emit a <strong>sine wave</strong> of oscillating particles<br>particles <strong>slowly</strong> propagate through <strong>solids</strong>", description: "emit a <strong>sine wave</strong> of oscillating particles<br>particles <strong>slowly</strong> propagate through <strong>solids</strong>",
ammo: 0, ammo: 0,
ammoPack: 100, ammoPack: 110,
have: false, have: false,
isStarterGun: true, isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
@@ -2540,7 +2559,7 @@ const b = {
for (let i = 0; i < q.length; i++) { for (let i = 0; i < q.length; i++) {
slowCheck = 0.3; slowCheck = 0.3;
Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
let dmg = b.dmgScale * 0.6 / Math.sqrt(q[i].mass) let dmg = b.dmgScale * 0.45 / Math.sqrt(q[i].mass)
q[i].damage(dmg); q[i].damage(dmg);
q[i].foundPlayer(); q[i].foundPlayer();
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue
@@ -2709,7 +2728,7 @@ const b = {
name: "vacuum bomb", //8 name: "vacuum bomb", //8
description: "fire a bomb that <strong>sucks</strong> before <strong class='color-e'>exploding</strong><br><strong>click</strong> left mouse again to <strong>detonate</strong>", description: "fire a bomb that <strong>sucks</strong> before <strong class='color-e'>exploding</strong><br><strong>click</strong> left mouse again to <strong>detonate</strong>",
ammo: 0, ammo: 0,
ammoPack: 2, ammoPack: 3,
have: false, have: false,
isStarterGun: false, isStarterGun: false,
isEasyToAim: false, isEasyToAim: false,
@@ -2726,6 +2745,19 @@ const b = {
bullet[me].explodeRad = 440 + Math.floor(Math.random() * 30); bullet[me].explodeRad = 440 + Math.floor(Math.random() * 30);
bullet[me].onEnd = function () { bullet[me].onEnd = function () {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
//also damage all mobs
if (b.isModVacuumShield) {
for (let i = 0, len = mob.length; i < len; ++i) {
if (mob[i].shield) {
const dist = Vector.magnitude(Vector.sub(this.position, mob[i].position)) - mob[i].radius;
if (dist < this.explodeRad) mob[i].damage(Infinity);
} else if (mob[i].alive && !mob[i].isShielded) {
const dist = Vector.magnitude(Vector.sub(this.position, mob[i].position)) - mob[i].radius;
if (dist < this.explodeRad) mob[i].damage(0.8 * b.dmgScale);
}
}
}
} }
bullet[me].onDmg = function () { bullet[me].onDmg = function () {
// this.endCycle = 0; //bullet ends cycle after doing damage //this triggers explosion // this.endCycle = 0; //bullet ends cycle after doing damage //this triggers explosion
@@ -2736,14 +2768,13 @@ const b = {
bullet[me].do = function () { bullet[me].do = function () {
//extra gravity for harder arcs //extra gravity for harder arcs
this.force.y += this.mass * 0.0022; this.force.y += this.mass * 0.0022;
mech.fireCDcycle = mech.cycle + 10 //can't fire until after the explosion
//set armed and sucking status //set armed and sucking status
if (!this.isArmed && !game.mouseDown) { if (!this.isArmed && !game.mouseDown) {
this.isArmed = true this.isArmed = true
} else if (this.isArmed && game.mouseDown && !this.isSucking) { } else if (this.isArmed && game.mouseDown && !this.isSucking) {
this.isSucking = true; this.isSucking = true;
this.endCycle = game.cycle + 35; this.endCycle = game.cycle + 50;
} }
if (this.isSucking) { if (this.isSucking) {
@@ -2751,7 +2782,7 @@ const b = {
const that = this const that = this
let mag = 0.1 let mag = 0.1
function suck(who, radius = that.explodeRad * 3) { function suck(who, radius = that.explodeRad * 3.5) {
for (i = 0, len = who.length; i < len; i++) { for (i = 0, len = who.length; i < len; i++) {
const sub = Vector.sub(that.position, who[i].position); const sub = Vector.sub(that.position, who[i].position);
const dist = Vector.magnitude(sub); const dist = Vector.magnitude(sub);
@@ -2783,13 +2814,15 @@ const b = {
y: 0 y: 0
}); });
//draw suck //draw suck
const radius = 3 * this.explodeRad * (this.endCycle - game.cycle) / 35 const radius = 3 * this.explodeRad * (this.endCycle - game.cycle) / 50
ctx.fillStyle = "rgba(0,0,0,0.1)"; ctx.fillStyle = "rgba(0,0,0,0.1)";
ctx.beginPath(); ctx.beginPath();
ctx.arc(this.position.x, this.position.y, radius, 0, 2 * Math.PI); ctx.arc(this.position.x, this.position.y, radius, 0, 2 * Math.PI);
ctx.fill(); ctx.fill();
} }
} else { } else {
mech.fireCDcycle = mech.cycle + 10 //can't fire until after the explosion
// flashing lights to show armed // flashing lights to show armed
if (!(game.cycle % 10)) { if (!(game.cycle % 10)) {
if (this.isFlashOn) { if (this.isFlashOn) {

View File

@@ -14,7 +14,7 @@ const level = {
start() { start() {
if (level.levelsCleared === 0) { if (level.levelsCleared === 0) {
// level.difficultyIncrease(9) // level.difficultyIncrease(9)
// b.giveGuns("ice IX") // b.giveGuns("vacuum bomb")
// mech.setField("time dilation field") // mech.setField("time dilation field")
// mech.energy = 0.1; // mech.energy = 0.1;
// b.giveMod("ground state"); // b.giveMod("ground state");
@@ -476,21 +476,30 @@ const level = {
level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel"); level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump
document.body.style.backgroundColor = "#fff"; document.body.style.backgroundColor = "#eee";
level.fillBG.push({ level.fillBG.push({
x: 2600, x: 2600,
y: -600, y: -600,
width: 400, width: 400,
height: 500, height: 500,
color: "#edf9f9" color: "#cee"
}); });
level.fill.push({
x: -150,
y: -1000,
width: 2750,
height: 1000,
color: "rgba(0,20,40,0.1)"
});
const lineColor = "#ddd"
level.fillBG.push({ level.fillBG.push({
x: 1600, x: 1600,
y: -500, y: -500,
width: 100, width: 100,
height: 100, height: 100,
color: "#eee" color: lineColor
}); });
level.fillBG.push({ level.fillBG.push({
@@ -498,7 +507,7 @@ const level = {
y: -283, y: -283,
width: 12, width: 12,
height: 100, height: 100,
color: "#eee" color: lineColor
}); });
//faster way to draw a wire //faster way to draw a wire
@@ -509,7 +518,7 @@ const level = {
y: y, y: y,
width: width, width: width,
height: height, height: height,
color: "#aaa" color: lineColor
}); });
} else { } else {
level.fillBG.push({ level.fillBG.push({
@@ -517,11 +526,10 @@ const level = {
y: y, y: y,
width: width, width: width,
height: height, height: height,
color: "#eee" color: lineColor
}); });
} }
} }
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
wallWire(100 - 10 * i, -1050 - 10 * i, 5, 800); wallWire(100 - 10 * i, -1050 - 10 * i, 5, 800);
wallWire(100 - 10 * i, -255 - 10 * i, -300, 5); wallWire(100 - 10 * i, -255 - 10 * i, -300, 5);

View File

@@ -1366,7 +1366,7 @@ const mech = {
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed
mech.grabPowerUp(); mech.grabPowerUp();
mech.lookForPickUp(); mech.lookForPickUp();
const DRAIN = 0.0005 const DRAIN = 0.00065
if (mech.energy > DRAIN) { if (mech.energy > DRAIN) {
mech.energy -= DRAIN; mech.energy -= DRAIN;
if (mech.energy < 0) { if (mech.energy < 0) {

View File

@@ -1670,7 +1670,7 @@ const spawn = {
if (mech.pos.x > breakingPoint) { if (mech.pos.x > breakingPoint) {
this.freeOfWires = true; this.freeOfWires = true;
this.force.x += -0.0006; this.force.x += -0.0006;
this.fill = "#222"; this.fill = "#111";
} }
//move mob to player //move mob to player
mech.calcLeg(0, 0); mech.calcLeg(0, 0);
@@ -1685,7 +1685,7 @@ const spawn = {
ctx.quadraticCurveTo(wireX, 0, this.position.x, this.position.y); ctx.quadraticCurveTo(wireX, 0, this.position.x, this.position.y);
ctx.lineWidth = 5; ctx.lineWidth = 5;
ctx.lineCap = "butt"; ctx.lineCap = "butt";
ctx.strokeStyle = "#222"; ctx.strokeStyle = "#111";
ctx.stroke(); ctx.stroke();
ctx.lineCap = "round"; ctx.lineCap = "round";
}; };
@@ -1719,7 +1719,7 @@ const spawn = {
if (mech.pos.x > breakingPoint) { if (mech.pos.x > breakingPoint) {
this.freeOfWires = true; this.freeOfWires = true;
this.force.x += -0.0005; this.force.x += -0.0005;
this.fill = "#333"; this.fill = "#222";
} }
//move mob to player //move mob to player
mech.calcLeg(Math.PI, -3); mech.calcLeg(Math.PI, -3);
@@ -1733,7 +1733,7 @@ const spawn = {
ctx.moveTo(wireX, wireY); ctx.moveTo(wireX, wireY);
ctx.quadraticCurveTo(wireX, 0, this.position.x, this.position.y); ctx.quadraticCurveTo(wireX, 0, this.position.x, this.position.y);
ctx.lineWidth = 5; ctx.lineWidth = 5;
ctx.strokeStyle = "#333"; ctx.strokeStyle = "#222";
ctx.lineCap = "butt"; ctx.lineCap = "butt";
ctx.stroke(); ctx.stroke();
ctx.lineCap = "round"; ctx.lineCap = "round";

View File

@@ -1,6 +1,9 @@
mod - electromagnetic pulse - vacuum bomb does 9x damage to shields
************** TODO - n-gon ************** ************** TODO - n-gon **************
cryonics : a mod that increases the freezing time of mobs.
mob Boss - time skipper: sends a pulse wave out that will cause time to jump forward 1 second. mob Boss - time skipper: sends a pulse wave out that will cause time to jump forward 1 second.
what about a series of short time skips forward 10 cycles at a time what about a series of short time skips forward 10 cycles at a time
@@ -47,16 +50,6 @@ mod - robot that attack nearby mobs, and delivers a stun status effect
settings - auto aim at nearest mob settings - auto aim at nearest mob
settings - custom keys binding settings - custom keys binding
gun - buff vacuum bomb
it's weak late game
can't spam it faster
bad vs. shields
doesn't scale up to huge groups
buff collision damage?
mod - double explosions?
mod - doesn't suck player in?
mod - DoT damage after exploding
mod - energy recharges faster when not moving mod - energy recharges faster when not moving
lore - a robot (the player) gains self awareness lore - a robot (the player) gains self awareness