more pulse balance, and general balance

This commit is contained in:
landgreen
2019-12-22 07:02:25 -08:00
parent adbb9c37ec
commit 989ebc478b
3 changed files with 37 additions and 49 deletions

View File

@@ -134,7 +134,7 @@ const b = {
}, },
{ {
name: "ablative synthesis", name: "ablative synthesis",
description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after taking <strong class='color-d'>damage</strong>", description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after being <strong>harmed</strong>",
have: false, //9 have: false, //9
effect: () => { //makes dangerous situations more survivable effect: () => { //makes dangerous situations more survivable
b.isModDroneOnDamage = true; b.isModDroneOnDamage = true;
@@ -142,32 +142,24 @@ const b = {
}, },
{ {
name: "annihilation", name: "annihilation",
description: "after <strong>touching</strong> enemies, they are annihilated<br><em>doesn't trigger health or energy transfer</em>", description: "after <strong>touching</strong> enemies, they are annihilated",
have: false, //10 have: false, //10
effect: () => { //good with mods that heal: superconductive healing, entropy transfer effect: () => { //good with mods that heal: superconductive healing, entropy transfer
b.modAnnihilation = true b.modAnnihilation = true
} }
}, },
{ {
name: "anti-matter cores", name: "high explosives",
description: "your <strong class='color-e'>explosions</strong> are doubled in <strong>size</strong><br>immune to <strong class='color-d'>damage</strong> from <strong class='color-e'>explosions</strong>", description: "<strong class='color-e'>explosions</strong> are 50% <strong>larger</strong><br>immune to <strong>harm</strong> from <strong class='color-e'>explosions</strong>",
have: false, //11 have: false, //11
effect: () => { effect: () => {
b.modExplosionRadius = 1.5; b.modExplosionRadius = 1.3;
b.isModImmuneExplosion = true; b.isModImmuneExplosion = true;
} }
}, },
// {
// name: "ceramic plating",
// description: "protection from to high <strong>temperatures</strong><br>5x less <strong class='color-d'>damage</strong> from <strong class='color-e'>explosions</strong> and lasers",
// have: false, //12
// effect: () => {
// b.isModImmuneExplosion = true; //good for guns with explosions
// }
// },
{ {
name: "entanglement", name: "entanglement",
description: "using your first gun reduces <strong class='color-d'>damage</strong> taken<br><em>scales by <strong>7%</strong> for each gun in your inventory</em>", description: "using your first gun reduces <strong>harm</strong><br>scales by <strong>7%</strong> for each gun in your inventory",
have: false, //13 have: false, //13
effect: () => { // good with laser-bots effect: () => { // good with laser-bots
b.isModMonogamy = true b.isModMonogamy = true
@@ -241,7 +233,7 @@ const b = {
}, },
{ {
name: "squirrel-cage rotor", name: "squirrel-cage rotor",
description: "<strong>jump</strong> higher and <strong>move</strong> faster<br>reduced <strong>falling</strong> <strong class='color-d'>damage</strong>", description: "<strong>jump</strong> higher and <strong>move</strong> faster<br>reduced <strong>harm</strong> from <strong>falling</strong> ",
have: false, //22 have: false, //22
effect: () => { // good with melee builds, content skipping builds effect: () => { // good with melee builds, content skipping builds
b.modSquirrelFx = 1.2; b.modSquirrelFx = 1.2;
@@ -1306,17 +1298,17 @@ const b = {
name: "grenades", //8 name: "grenades", //8
description: "lob a single bouncy projectile<br><strong class='color-e'>explodes</strong> on contact or after one second", description: "lob a single bouncy projectile<br><strong class='color-e'>explodes</strong> on contact or after one second",
ammo: 0, ammo: 0,
ammoPack: 11, ammoPack: 12,
have: false, have: false,
isStarterGun: false, isStarterGun: false,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
const dir = mech.angle; // + Math.random() * 0.05; const dir = mech.angle; // + Math.random() * 0.05;
bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 15 * b.modBulletSize, b.fireAttributes(dir, false)); bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 20 * b.modBulletSize, b.fireAttributes(dir, false));
b.fireProps(mech.crouch ? 30 : 20, mech.crouch ? 43 : 32, dir, me); //cd , speed b.fireProps(mech.crouch ? 30 : 20, mech.crouch ? 43 : 32, dir, me); //cd , speed
// Matter.Body.setDensity(bullet[me], 0.000001); Matter.Body.setDensity(bullet[me], 0.0005);
bullet[me].totalCycles = 100; bullet[me].totalCycles = 100;
bullet[me].endCycle = game.cycle + Math.floor((mech.crouch ? 120 : 60) * b.isModBulletsLastLonger); bullet[me].endCycle = game.cycle + Math.floor((mech.crouch ? 120 : 80) * b.isModBulletsLastLonger);
bullet[me].restitution = 0.5; bullet[me].restitution = 0.5;
bullet[me].explodeRad = 290; bullet[me].explodeRad = 290;
bullet[me].onEnd = b.explode; //makes bullet do explosive damage before despawn bullet[me].onEnd = b.explode; //makes bullet do explosive damage before despawn
@@ -1327,7 +1319,7 @@ 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.002; this.force.y += this.mass * 0.0025;
}; };
} }
}, { }, {
@@ -1556,7 +1548,7 @@ const b = {
}, },
{ {
name: "drones", //12 name: "drones", //12
description: "deploy <strong>drones</strong> that seek out enemies<br>collisions reduce drone <strong>cycles</strong> by 1 second", description: "deploy drones that <strong>crash</strong> into enemies<br>collisions reduce drone <strong>cycles</strong> by 1 second",
ammo: 0, ammo: 0,
ammoPack: 17, ammoPack: 17,
have: false, have: false,
@@ -1568,7 +1560,7 @@ const b = {
}, },
{ {
name: "guardian", //13 name: "guardian", //13
description: "deploy a bot that protect you for one level<br>uses a short range laser that drains <strong class='color-f'>energy</strong>", description: "deploy a bot that <strong>protects</strong> you for <strong>one level</strong><br>uses a <strong>short range</strong> laser that drains <strong class='color-f'>energy</strong>",
ammo: 0, ammo: 0,
ammoPack: 1, ammoPack: 1,
have: false, have: false,
@@ -1668,16 +1660,13 @@ const b = {
}, },
{ {
name: "laser", //14 name: "laser", //14
description: "emit a beam of collimation coherent light<br>uses <strong class='color-f'>energy</strong> instead of ammunition", description: "emit a beam of collimated coherent <strong>light</strong><br>uses <strong class='color-f'>energy</strong> instead of ammunition",
ammo: 0, ammo: 0,
// ammoPack: 350,
ammoPack: Infinity, ammoPack: Infinity,
have: false, have: false,
isStarterGun: true, isStarterGun: true,
fire() { fire() {
// mech.fireCDcycle = mech.cycle + 1 const FIELD_DRAIN = 0.002 //laser drains energy as well as bullets
//laser drains energy as well as bullets
const FIELD_DRAIN = 0.002
const damage = 0.05 const damage = 0.05
if (mech.fieldMeter < FIELD_DRAIN) { if (mech.fieldMeter < FIELD_DRAIN) {
mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy
@@ -1830,7 +1819,7 @@ const b = {
}, },
{ {
name: "pulse", //15 name: "pulse", //15
description: "emit an <strong class='color-e'>explosive</strong> laser pulse<br>each pulse uses 20% of your <strong class='color-f'>energy</strong>", description: "power a <strong>laser</strong> that initiates a fusion <strong class='color-e'>explosion</strong><br>each pulse drains 25% of your current <strong class='color-f'>energy</strong>",
ammo: 0, ammo: 0,
ammoPack: Infinity, ammoPack: Infinity,
have: false, have: false,
@@ -1838,15 +1827,14 @@ const b = {
fire() { fire() {
//calculate laser collision //calculate laser collision
let best; let best;
let range = 6000 let range = 4000
const dir = mech.angle // + 0.04 * (Math.random() - 0.5)
const path = [{ const path = [{
x: mech.pos.x + 20 * Math.cos(dir), x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(dir) y: mech.pos.y + 20 * Math.sin(mech.angle)
}, },
{ {
x: mech.pos.x + range * Math.cos(dir), x: mech.pos.x + range * Math.cos(mech.angle),
y: mech.pos.y + range * Math.sin(dir) y: mech.pos.y + range * Math.sin(mech.angle)
} }
]; ];
const vertexCollision = function (v1, v1End, domain) { const vertexCollision = function (v1, v1End, domain) {
@@ -1909,10 +1897,11 @@ const b = {
}; };
} }
const energy = mech.fieldMeter * 0.2 //use energy to explode
const energy = mech.fieldMeter * 0.25
mech.fieldMeter -= energy mech.fieldMeter -= energy
if (best.who) b.explosion(path[1], 1300 * energy) if (best.who) b.explosion(path[1], 1300 * energy)
mech.fireCDcycle = mech.cycle + Math.floor(20 * b.modFireRate); // cool down mech.fireCDcycle = mech.cycle + Math.floor(60 * b.modFireRate); // cool down
//draw laser beam //draw laser beam
ctx.beginPath(); ctx.beginPath();
@@ -1928,17 +1917,17 @@ const b = {
ctx.lineWidth = 4 ctx.lineWidth = 4
ctx.stroke(); ctx.stroke();
//draw little dot sparkles //draw little dots along the laser path
const sub = Matter.Vector.sub(path[1], path[0]) const sub = Matter.Vector.sub(path[1], path[0])
const mag = Matter.Vector.magnitude(sub) const mag = Matter.Vector.magnitude(sub)
for (let i = 0, len = Math.floor(mag * 0.03 * energy / 0.2); i < len; i++) { for (let i = 0, len = Math.floor(mag * 0.03 * energy / 0.2); i < len; i++) {
const dist = Math.random() const dist = Math.random()
game.drawList.push({ game.drawList.push({
x: path[0].x + sub.x * dist + 30 * (Math.random() - 0.5), x: path[0].x + sub.x * dist + 13 * (Math.random() - 0.5),
y: path[0].y + sub.y * dist + 30 * (Math.random() - 0.5), y: path[0].y + sub.y * dist + 13 * (Math.random() - 0.5),
radius: 1 + 2 * Math.random(), radius: 1 + 4 * Math.random(),
color: "rgba(255,0,0,0.5)", color: "rgba(255,0,0,0.5)",
time: Math.floor(2 + 7 * Math.random()) time: Math.floor(2 + 33 * Math.random() * Math.random())
}); });
} }
} }

View File

@@ -301,7 +301,7 @@ const mech = {
game.clearNow = true; //triggers a map reset game.clearNow = true; //triggers a map reset
//count mods //count mods
let totalMods = -2; //lose the immortality mod and one more, so -2 let totalMods = -2; //lose 2 mods for balance reasons
for (let i = 0; i < b.mods.length; i++) { for (let i = 0; i < b.mods.length; i++) {
if (b.mods[i].have) totalMods++ if (b.mods[i].have) totalMods++
} }
@@ -311,9 +311,9 @@ const mech = {
for (let i = 0; i < totalMods; i++) { for (let i = 0; i < totalMods; i++) {
//find what mods I don't have //find what mods I don't have
let options = []; let options = [];
for (let i = 0; i < b.mods.length; i++) { for (let i = 0, len = b.mods.length; i < len; i++) {
//can't get quantum immortality again //can't get quantum immortality again
if (i !== 7 && !b.mods[i].have) options.push(i); if (b.mods[i].name !== "quantum immortality" && !b.mods[i].have) options.push(i);
} }
//add a new mod //add a new mod
if (options.length > 0) { if (options.length > 0) {
@@ -1287,15 +1287,14 @@ const mech = {
ctx.lineWidth = 2 * Math.random(); ctx.lineWidth = 2 * Math.random();
ctx.stroke(); ctx.stroke();
//draw shield around player //draw shield around player
const pushRange = 110;
ctx.beginPath(); ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y, pushRange, 0, 2 * Math.PI); ctx.arc(mech.pos.x, mech.pos.y, 110, 0, 2 * Math.PI);
ctx.fillStyle = "rgba(255,0,255,0.05)" ctx.fillStyle = "rgba(255,0,255,0.05)"
ctx.fill(); ctx.fill();
mech.grabPowerUp(); mech.grabPowerUp();
mech.lookForPickUp(); mech.lookForPickUp();
mech.pushMobs360(pushRange); mech.pushMobs360(120);
// mech.pushBody360(100); //disabled because doesn't work at short range // mech.pushBody360(100); //disabled because doesn't work at short range
} else { } else {
mech.fieldCDcycle = mech.cycle + 120; //if out of energy mech.fieldCDcycle = mech.cycle + 120; //if out of energy
@@ -1398,7 +1397,7 @@ const mech = {
}, },
{ {
name: "standing wave harmonics", name: "standing wave harmonics",
description: "three oscillating <strong>shields</strong> are perminantly active<br><strong class='color-f'>energy</strong> regenerates at normal rate", description: "three oscillating <strong>shields</strong> are perminantly active<br><strong class='color-f'>energy</strong> regenerates while field is active",
effect: () => { effect: () => {
mech.fieldMode = 4; mech.fieldMode = 4;
mech.fieldText(); mech.fieldText();

View File

@@ -70,7 +70,7 @@ summary {
display: none; display: none;
/* display: grid; */ /* display: grid; */
grid-template-columns: repeat(auto-fit, minmax(305px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
grid-auto-rows: minmax(auto, auto); grid-auto-rows: minmax(auto, auto);
grid-gap: 16px; grid-gap: 16px;