added player history

balance: mod capacitor - gives 1% damage for every 7% energy (was 5.5%)
some fixes on community level detour
added a once every 7 second check to try to undo the crouch bug
  (I have no idea how to crouch bug is happening, so I can't even test this fix)

mod: slow light propagation - laser is divided into your past, and increase total damage by 200%
  let me know about balance (is this too strong or too weak)
This commit is contained in:
landgreen
2020-11-24 06:40:25 -08:00
parent 463bacc977
commit 313a9f861f
7 changed files with 319 additions and 128 deletions

View File

@@ -1847,8 +1847,8 @@ const b = {
name: "nail gun",
description: "use compressed air to fire a stream of <strong>nails</strong><br><strong>delay</strong> after firing <strong>decreases</strong> as you shoot",
ammo: 0,
ammoPack: 60,
defaultAmmoPack: 60,
ammoPack: 55,
defaultAmmoPack: 55,
recordedAmmo: 0,
have: false,
nextFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
@@ -1918,7 +1918,7 @@ const b = {
if (mech.energy < 0.01) {
mech.fireCDcycle = mech.cycle + 60; // cool down
} else {
mech.energy -= mech.fieldRegen + 0.009
mech.energy -= mech.fieldRegen + 0.01
}
}
}
@@ -1929,8 +1929,8 @@ const b = {
name: "shotgun",
description: "fire a <strong>burst</strong> of short range <strong> bullets</strong> <br><em>crouch to reduce recoil</em>",
ammo: 0,
ammoPack: 6,
defaultAmmoPack: 6,
ammoPack: 5.5,
defaultAmmoPack: 5.5,
have: false,
fire() {
let knock, spread
@@ -2924,7 +2924,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: 3.25,
ammoPack: 3.15,
have: false,
fire() {
function pushAway(range) { //push away blocks when firing
@@ -3261,6 +3261,19 @@ const b = {
nextFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
fire() {
},
chooseFireMethod() {
if (mod.isPulseLaser) {
this.fire = this.firePulse
} else if (mod.beamSplitter) {
this.fire = this.fireSplit
} else if (mod.historyLaser) {
this.fire = this.fireHistory
} else if (mod.isWideLaser) {
this.fire = this.fireWideBeam
} else {
this.fire = this.fireLaser
}
},
fireLaser() {
if (mech.energy < mod.laserFieldDrain) {
@@ -3268,74 +3281,128 @@ const b = {
} else {
mech.fireCDcycle = mech.cycle
mech.energy -= mech.fieldRegen + mod.laserFieldDrain * mod.isLaserDiode
if (mod.wideLaser) {
b.laser();
}
},
fireSplit() {
if (mech.energy < mod.laserFieldDrain) {
mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy
} else {
mech.fireCDcycle = mech.cycle
mech.energy -= mech.fieldRegen + mod.laserFieldDrain * mod.isLaserDiode
const divergence = mech.crouch ? 0.15 : 0.2
let dmg = 0.1 + mod.laserDamage * Math.pow(0.9, mod.laserDamage)
const where = {
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
}
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle),
y: where.y + 3000 * Math.sin(mech.angle)
}, dmg)
for (let i = 1; i < 1 + mod.beamSplitter; i++) {
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle + i * divergence),
y: where.y + 3000 * Math.sin(mech.angle + i * divergence)
}, dmg)
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle - i * divergence),
y: where.y + 3000 * Math.sin(mech.angle - i * divergence)
}, dmg)
}
}
},
fireWideBeam() {
if (mech.energy < mod.laserFieldDrain) {
mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy
} else {
mech.fireCDcycle = mech.cycle
mech.energy -= mech.fieldRegen + mod.laserFieldDrain * mod.isLaserDiode
const dmg = 0.55 * mod.laserDamage // 3.5 * 0.55 = 200% more damage
const wideLaser = function(where = {
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
}, angle = mech.angle) {
ctx.strokeStyle = "#f00";
ctx.lineWidth = 8
ctx.globalAlpha = 0.5;
ctx.beginPath();
const off = 7.5
const dmg = 0.55 * mod.laserDamage // 3.5 * 0.55 = 200% more damage
const where = {
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
}
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle),
y: where.y + 3000 * Math.sin(mech.angle)
x: where.x + 3000 * Math.cos(angle),
y: where.y + 3000 * Math.sin(angle)
}, dmg, 0, true)
for (let i = 1; i < mod.wideLaser; i++) {
let whereOff = Vector.add(where, {
x: i * off * Math.cos(mech.angle + Math.PI / 2),
y: i * off * Math.sin(mech.angle + Math.PI / 2)
x: i * off * Math.cos(angle + Math.PI / 2),
y: i * off * Math.sin(angle + Math.PI / 2)
})
b.laser(whereOff, {
x: whereOff.x + 3000 * Math.cos(mech.angle),
y: whereOff.y + 3000 * Math.sin(mech.angle)
x: whereOff.x + 3000 * Math.cos(angle),
y: whereOff.y + 3000 * Math.sin(angle)
}, dmg, 0, true)
whereOff = Vector.add(where, {
x: i * off * Math.cos(mech.angle - Math.PI / 2),
y: i * off * Math.sin(mech.angle - Math.PI / 2)
x: i * off * Math.cos(angle - Math.PI / 2),
y: i * off * Math.sin(angle - Math.PI / 2)
})
b.laser(whereOff, {
x: whereOff.x + 3000 * Math.cos(mech.angle),
y: whereOff.y + 3000 * Math.sin(mech.angle)
x: whereOff.x + 3000 * Math.cos(angle),
y: whereOff.y + 3000 * Math.sin(angle)
}, dmg, 0, true)
}
ctx.stroke();
ctx.globalAlpha = 1;
} else if (mod.beamSplitter) {
const divergence = mech.crouch ? 0.15 : 0.2
let dmg = 0.1 + mod.laserDamage * Math.pow(0.9, mod.laserDamage)
const where = {
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
}
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle),
y: where.y + 3000 * Math.sin(mech.angle)
}, dmg)
for (let i = 1; i < 1 + mod.beamSplitter; i++) {
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle + i * divergence),
y: where.y + 3000 * Math.sin(mech.angle + i * divergence)
}, dmg)
b.laser(where, {
x: where.x + 3000 * Math.cos(mech.angle - i * divergence),
y: where.y + 3000 * Math.sin(mech.angle - i * divergence)
}, dmg)
// dmg *= 0.9
}
} else {
b.laser()
}
wideLaser();
}
},
fireHistory() {
if (mech.energy < mod.laserFieldDrain) {
mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy
} else {
mech.fireCDcycle = mech.cycle
mech.energy -= mech.fieldRegen + mod.laserFieldDrain * mod.isLaserDiode
const dmg = 0.25 * mod.laserDamage // 3.5 * 0.55 = 200% more damage
ctx.strokeStyle = "#f00";
let spacing, len
if (mod.wideLaser === 3) {
ctx.lineWidth = 2
spacing = 1
len = 19 + mod.historyLaser * 10
} else if (mod.wideLaser === 4) {
ctx.lineWidth = 3
spacing = 1
len = 29 + mod.historyLaser * 10
} else {
ctx.lineWidth = 1
spacing = 3
len = 9 + mod.historyLaser * 10
}
ctx.beginPath();
b.laser({
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
}, {
x: mech.pos.x + 3000 * Math.cos(mech.angle),
y: mech.pos.y + 3000 * Math.sin(mech.angle)
}, dmg, 0, true);
for (let i = 0; i < len; i++) {
const history = mech.history[(mech.cycle - i * spacing) % 300]
b.laser({
x: history.position.x + 20 * Math.cos(history.angle),
y: history.position.y + 20 * Math.sin(history.angle)
}, {
x: history.position.x + 3000 * Math.cos(history.angle),
y: history.position.y + 3000 * Math.sin(history.angle)
}, dmg, 0, true);
}
ctx.stroke();
}
},
firePulse() {
mech.fireCDcycle = mech.cycle + Math.floor((mod.isPulseAim ? 25 : 50) * b.fireCD); // cool down
let energy = 0.27 * Math.min(mech.energy, 1.5)
mech.energy -= energy * mod.isLaserDiode
if (mod.beamSplitter) {
energy *= 0.66
b.pulse(energy, mech.angle)

View File

@@ -747,6 +747,19 @@ const game = {
fallCheck(mob);
fallCheck(body);
fallCheck(powerUp, true);
//check for double crouch
//crouch playerHead.position.y - player.position.y = 9.7 //positive
//standing playerHead.position.y - player.position.y = -30 //negative
if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) {
// mech.undoCrouch()
Matter.Body.translate(playerHead, {
x: 0,
y: 40
});
}
// else if (mech.crouch && ((playerHead.position.y - player.position.y) < 0)) {}
}
}
},

View File

@@ -17,10 +17,10 @@ const level = {
// game.zoomScale = 1000;
// game.setZoom();
// mech.setField("wormhole")
// b.giveGuns("rail gun")
// b.giveGuns("laser")
// mod.is3Missiles = true
// mod.giveMod("dielectric polarization")
// mod.giveMod("capacitor bank")
// mod.giveMod("history laser")
// mod.giveMod("diffuse beam")
level.intro(); //starting level
// level.testing(); //not in rotation
@@ -56,6 +56,21 @@ const level = {
level.addToWorld(); //add bodies to game engine
game.draw.setPaths();
b.respawnBots();
for (let i = 0; i < 300; i++) { //reset history
mech.history[i] = {
position: {
x: mech.pos.x,
y: mech.pos.y,
},
velocity: {
x: player.velocity.x,
y: player.velocity.y
},
angle: mech.angle,
health: mech.health,
energy: mech.energy,
}
}
if (mod.isArmorFromPowerUps) {
mod.armorFromPowerUps += 0.05 * powerUps.totalPowerUps
mech.setMaxHealth();
@@ -142,10 +157,10 @@ const level = {
// spawn.boost(1500, 0, 900);
// spawn.starter(1900, -500, 20)
// spawn.bomberBoss(2900, -500)
// spawn.sucker(2900, -500)
// spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400)
spawn.striker(1600, -500)
// spawn.striker(1600, -500)
// spawn.shooter(1700, -120)
// spawn.bomberBoss(1400, -500)
// spawn.sniper(1800, -120)
@@ -156,7 +171,7 @@ const level = {
// spawn.nodeBoss(1200, -500, "launcher")
// spawn.snakeBoss(1200, -500)
// spawn.powerUpBoss(2900, -500)
spawn.powerUpBoss(2900, -500)
// spawn.randomMob(1600, -500)
},
template() {
@@ -2957,6 +2972,13 @@ const level = {
height: 475,
color: BGColor
});
level.fill.push({
x: 1800,
y: -1120,
width: 775,
height: 600,
color: BGColor
});
drawOnTheMapMapRect(3800, -270, 75, 75);
drawOnTheMapMapRect(3900, -895, 500, 75);
drawOnTheMapMapRect(3900, -1195, 75, 375);
@@ -2981,15 +3003,6 @@ const level = {
drawOnTheMapBodyRect(4850, -720, 250, 200);
drawOnTheMapBodyRect(4050, -970, 25, 25);
drawOnTheMapBodyRect(3075, -1245, 50, 50);
buttonSortieSalle = level.button(3000, -1745)
spawn.mapVertex(3065, -1745, "100 10 -100 10 -70 -10 70 -10");
len = map.length - 1
map[len].collisionFilter.category = cat.map;
map[len].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.powerUp | cat.mob | cat.mobBullet;
Matter.Body.setStatic(map[len], true); //make static
World.add(engine.world, map[len]); //add to world
game.draw.setPaths() //update map graphics
portalEnHaut = level.portal({
x: 3650,
y: -1470
@@ -3001,13 +3014,14 @@ const level = {
spawn.randomSmallMob(2500, -2070 + Math.random(), 1);
spawn.randomSmallMob(5000, -1370, 1);
spawn.randomMob(5000, -645, 0.9);
spawn.randomMob(4050, 970, 0.9);
spawn.randomMob(4050, -970, 0.9);
spawn.randomSmallMob(2800, -1620, 0.7);
spawn.randomMob(2400, -1370, 0.5);
spawn.randomMob(3725, -1320, 0.3);
spawn.randomBoss(2115, -2020, 0.1)
powerUps.spawn(5000, -1275, "heal");
levelCustom2();
}
//////////////////////////////////////////
@@ -3029,16 +3043,6 @@ const level = {
portalEnHaut[2].query();
portalEnHaut[3].query();
rotor.rotate();
// rotor2.rotate
buttonSortieSalle.query();
buttonSortieSalle.draw();
////////////
if (buttonSortieSalle.isUp) {
doorSortieSalle.isOpen = door3isOpen;
} else {
doorSortieSalle.isOpen = false;
door3isOpen = false;
}
doorSortieSalle.openClose();
level.playerExitCheck();
};
@@ -3053,6 +3057,7 @@ const level = {
ctx.beginPath();
ctx.arc(balance.pointA.x, balance.pointA.y, 9, 0, 2 * Math.PI);
ctx.fill();
};
}
//spawn box
@@ -3091,7 +3096,7 @@ const level = {
spawn.bodyRect(1700, -195, 50, 50);
spawn.mapRect(450, -520, 1600, 100); //plafond 1
spawn.mapRect(450, 255, 1600, 100); //sol 1
spawn.mapRect(2250, -95, 1450, 75); //entresol
spawn.mapRect(2250, -45, 1450, 75); //entresol
spawn.mapRect(3900, -520, 2000, 100); //plafond 2
spawn.mapRect(3900, 255, 2000, 100); //sol 2
//grande salle
@@ -3135,40 +3140,43 @@ const level = {
spawn.randomMob(8800, -45, 0.2);
spawn.randomBoss(8025, -845, 0.2);
// if (game.difficulty > 2) {
if (Math.random() < 0.2) {
// tether ball
spawn.tetherBoss(8000, 630)
if (game.difficulty > 2) {
if (Math.random() < 0.2) {
// tether ball
spawn.tetherBoss(8000, 630)
let me = mob[mob.length - 1];
me.onDeath = function() {
this.removeCons(); //remove constraint
spawnCouloirEnHaut()
doorSortieSalle.isOpen = false;
};
cons[cons.length] = Constraint.create({
pointA: {
x: 8550,
y: 680
},
bodyB: mob[mob.length - 1],
stiffness: 0.00015
});
World.add(engine.world, cons[cons.length - 1]);
if (game.difficulty > 4) spawn.nodeBoss(8000, 630, "spawns", 8, 20, 105);
} else {
spawn.randomLevelBoss(8000, 630, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "spiderBoss", "laserBoss", "bomberBoss"]);
let me = mob[mob.length - 1];
me.onDeath = function() {
this.removeCons(); //remove constraint
spawnCouloirEnHaut()
doorSortieSalle.isOpen = false;
};
}
} else {
spawn.randomLevelBoss(8000, 630, ["shooterBoss"]);
let me = mob[mob.length - 1];
me.onDeath = function() {
this.removeCons(); //remove constraint
spawnCouloirEnHaut()
};
cons[cons.length] = Constraint.create({
pointA: {
x: 8550,
y: 680
},
bodyB: mob[mob.length - 1],
stiffness: 0.00015
});
World.add(engine.world, cons[cons.length - 1]);
if (game.difficulty > 4) spawn.nodeBoss(8000, 630, "spawns", 8, 20, 105);
} else if (game.difficulty > 3) {
spawn.randomLevelBoss(8000, 630, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "spiderBoss", "laserBoss", "bomberBoss"]);
let me = mob[mob.length - 1];
me.onDeath = function() {
this.removeCons(); //remove constraint
spawnCouloirEnHaut()
doorSortieSalle.isOpen = false;
};
}
// } else {
// spawn.randomLevelBoss(8000, 630, ["shooterBoss"]);
// let me = mob[mob.length - 1];
// me.onDeath = function () {
// spawnCouloirEnHaut()
// };
// }
},
house() {
const rotor = level.rotor(4315, -315, -0.0002, 120, 20, 200);

View File

@@ -90,7 +90,7 @@ const mod = {
if (mod.isEnergyLoss) dmg *= 1.5;
if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4;
if (mod.restDamage > 1 && player.speed < 1) dmg *= mod.restDamage
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 7;
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038
if (mod.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls
if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25
@@ -117,7 +117,7 @@ const mod = {
}
}, {
name: "capacitor",
description: "increase <strong class='color-d'>damage</strong> by <strong>1%</strong><br>for every <strong>5.5%</strong> stored <strong class='color-f'>energy</strong>",
description: "increase <strong class='color-d'>damage</strong> by <strong>1%</strong><br>for every <strong>7%</strong> stored <strong class='color-f'>energy</strong>",
maxCount: 1,
count: 0,
allowed() {
@@ -2518,7 +2518,7 @@ const mod = {
maxCount: 9,
count: 0,
allowed() {
return mod.haveGunCheck("laser") && !mod.isWideLaser && !mod.isPulseLaser
return mod.haveGunCheck("laser") && !mod.isWideLaser && !mod.isPulseLaser && !mod.historyLaser
},
requires: "laser, not wide beam",
effect() {
@@ -2538,14 +2538,20 @@ const mod = {
maxCount: 9,
count: 0,
allowed() {
return mod.haveGunCheck("laser") && !mod.isWideLaser && !mod.isPulseAim
return mod.haveGunCheck("laser") && !mod.isWideLaser && !mod.isPulseAim && !mod.historyLaser
},
requires: "laser, not specular reflection",
effect() {
mod.beamSplitter++
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
},
remove() {
mod.beamSplitter = 0
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
}
},
{
@@ -2560,10 +2566,16 @@ const mod = {
effect() {
if (mod.wideLaser === 0) mod.wideLaser = 3
mod.isWideLaser = true;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
},
remove() {
mod.wideLaser = 0
mod.isWideLaser = false;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
}
},
{
@@ -2577,6 +2589,9 @@ const mod = {
requires: "laser, not specular reflection<br>not diffraction grating",
effect() {
mod.wideLaser = 4
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
},
remove() {
if (mod.isWideLaser) {
@@ -2584,6 +2599,34 @@ const mod = {
} else {
mod.wideLaser = 0
}
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
}
},
{
name: "slow light propagation",
description: "",
maxCount: 9,
count: 0,
allowed() {
return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.beamSplitter && !mod.isPulseLaser
},
requires: "laser, not specular reflection<br>not diffraction grating",
effect() {
this.description = `add 10 more <strong>laser</strong> beams into into your past`
//`<strong>8%</strong> chance to <strong>duplicate</strong> spawned <strong>power ups</strong><br><em>chance to duplicate = ${mod.duplicateChance}</em>`
mod.historyLaser++
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
},
remove() {
this.description = "<strong>laser</strong> beam is <strong>spread</strong> into your recent <strong>past</strong><br>increase total beam <strong class='color-d'>damage</strong> by <strong>200%</strong>"
mod.historyLaser = 0
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
}
},
{
@@ -2592,19 +2635,19 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.isWideLaser
return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.isWideLaser && !mod.historyLaser
},
requires: "laser, not specular reflection, not diffuse",
effect() {
mod.isPulseLaser = true;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].fire = b.guns[i].firePulse
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
},
remove() {
mod.isPulseLaser = false;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].fire = b.guns[i].fireLaser
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()
}
}
},
@@ -3315,5 +3358,6 @@ const mod = {
isIncendiary: null,
overfillDrain: null,
isNeutronSlow: null,
isRailAreaDamage: null
isRailAreaDamage: null,
historyLaser: null
}

View File

@@ -52,7 +52,7 @@ const mech = {
});
World.add(engine.world, mech.holdConstraint);
},
cycle: 0,
cycle: 300, //starts at 300 cycles instead of 0 to prevent bugs with mech.history
lastKillCycle: 0,
lastHarmCycle: 0,
width: 50,
@@ -65,7 +65,6 @@ const mech = {
light: 100,
},
setFillColors() {
// console.log(mech.color)
this.fillColor = `hsl(${mech.color.hue},${mech.color.sat}%,${mech.color.light}%)`
this.fillColorDark = `hsl(${mech.color.hue},${mech.color.sat}%,${mech.color.light-20}%)`
},
@@ -134,7 +133,26 @@ const mech = {
legLength2: 45,
transX: 0,
transY: 0,
history: [], //tracks the last second of player position
move() {
//tracks the last second of player information
// console.log(mech.history)
mech.history.splice(mech.cycle % 300, 1, {
position: {
x: mech.pos.x,
y: mech.pos.y,
},
velocity: {
x: player.velocity.x,
y: player.velocity.y
},
angle: mech.angle,
health: mech.health,
energy: mech.energy,
});
// const back = 59 // 59 looks at 1 second ago //29 looks at 1/2 a second ago
// historyIndex = (mech.cycle - back) % 60
mech.pos.x = player.position.x;
mech.pos.y = playerBody.position.y - mech.yOff;
mech.Vx = player.velocity.x;
@@ -1344,26 +1362,23 @@ const mech = {
mech.hold = function() {
if (mech.energy > mech.maxEnergy - 0.02 && mech.fieldCDcycle < mech.cycle && !input.field) {
if (mod.isSporeField) {
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
const len = Math.floor(5 + 5 * Math.random())
mech.energy -= len * 0.1;
const len = Math.floor(5 + 4 * Math.random())
mech.energy -= len * 0.105;
for (let i = 0; i < len; i++) {
b.spore(mech.pos)
}
} else if (mod.isMissileField) {
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
mech.energy -= 0.5;
mech.energy -= 0.55;
b.missile({ x: mech.pos.x, y: mech.pos.y - 40 }, -Math.PI / 2, 0, 1, mod.recursiveMissiles)
} else if (mod.isIceField) {
// mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones
mech.energy -= 0.05;
mech.energy -= 0.057;
b.iceIX(1)
} else {
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
mech.energy -= 0.35;
mech.energy -= 0.4;
b.drone(1)
}
}
if (mech.isHolding) {
mech.drawHold(mech.holdingTarget);
mech.holding();

View File

@@ -749,7 +749,7 @@ const spawn = {
let me = mob[mob.length - 1];
me.stroke = "transparent"; //used for drawSneaker
me.eventHorizon = radius * 23; //required for blackhole
me.seeAtDistance2 = (me.eventHorizon + 200) * (me.eventHorizon + 200); //vision limit is event horizon
me.seeAtDistance2 = (me.eventHorizon + 300) * (me.eventHorizon + 300); //vision limit is event horizon
me.accelMag = 0.00009 * game.accelScale;
me.frictionAir = 0.025;
me.collisionFilter.mask = cat.player | cat.bullet

View File

@@ -1,15 +1,19 @@
*********** NEXT PATCH ***********
balance: mod capacitor - gives 1% damage for every 7% energy (was 5.5%)
some fixes on community level detour
added a once every 7 second check to try to undo the crouch bug
(I have no idea how to crouch bug is happening, so I can't even test this fix)
mod: slow light propagation - laser is divided into your past, and increase total damage by 200%
let me know about balance (is this too strong or too weak)
************** BUGS **************
(4+ reports before potential fix) bug - crouch and worm hole? -> crouch locked in
players have extra gravity
might be from the short jump code
added a line to wormhole to reset possible short jump
(3 reports) bug - getting locked into crouch on community levels, but showing the player as still standing
maybe improper vertices for map bodies
add in a check every 5 seconds to try and fix it
(intermittent, but almost every time) bug - capping the fps causes random slow downs, that can be fixed with pause
@@ -21,6 +25,46 @@
************** TODO **************
mod - if you take damage and you have full energy remove your energy and go back in time 1 second
for time dilation field?
check to see if your previous location is clear or mobs, blocks
go back proportional to your energy
pause game, switch the game.loop to cycle backwards in player position until energy runs out
mod plasma : plasma length increases then decreases as you hold down the field button (like stabbing with a spear)
grows to 1.5 longer after 0.3 seconds, then returns to normal length over 1 second, until field is pressed again
extra energy is drained when field is longer
write custom dialogue for field / guns / mods used in last game
you'd have to store an array of guns/fields/mod used last game
mod laser history
what about only works with diffuse
no energy cost increase
each stack makes each beam thicker?
separate the beam into individual nonreflecting lines each 3 cycles farther into the past
taking wider diffuse beam means more lines farther into the past?
or double thickness beam
technology - player data logging
mod/field - pressing field while crouched sends the player back in time
mod for time dilation?
mod - When you fire your laser also fire from where you were 1/2 a second in the past
stacking mod each stack produces another laser from farther in the past
drains extra energy
could be used in mob targeting
build a new type of attraction for mobs
if mobs can't see player, they check to see if they can see where the player was in the history
if mobs can't see player, they could check to see if they can find player in the past
mod bot - a bot follows where the player was 1 second ago
gives player a harm reduction bonus when it is near the player
using a reroll gives 3 options for mods, and 3 options for guns/fields/mods
or 6 options for mods (rewrite mod selection to work with 1-6 options)
the second stack of 3 mods could have repeats, so you don't have to write new mod code
adjust css to make 2 columns of 3
can't use with cardinality
Laser mod: For each reflection of laser, damage increases by 10%