zoom now only works in testing mode with keys: i / o

minigun is now nailgun  (higher damage, lower ammo)
mod: pneumatic actuator - nail gun's ramp up time is 50% shorter
mod: powder-actuated - removes ramp up time and increases nail speed

removed mod depleted uranium
mod: super size - larger super balls
This commit is contained in:
landgreen
2020-08-29 08:54:32 -07:00
parent d3514ee4f1
commit 00859f15ed
8 changed files with 175 additions and 108 deletions

View File

@@ -797,7 +797,7 @@ const b = {
});
},
foam(position, velocity, radius) {
radius *= Math.sqrt(mod.bulletSize)
// radius *= Math.sqrt(mod.bulletSize)
const me = bullet.length;
bullet[me] = Bodies.polygon(position.x, position.y, 20, radius, {
// angle: 0,
@@ -807,7 +807,7 @@ const b = {
// friction: 0.2,
// restitution: 0.2,
dmg: mod.isFastFoam ? 0.02 : 0.0055, //damage done in addition to the damage from momentum
scale: 1 - 0.005 / mod.isBulletsLastLonger * (mod.isFastFoam ? 1.7 : 1),
scale: 1 - 0.005 / mod.isBulletsLastLonger * (mod.isFastFoam ? 1.6 : 1),
classType: "bullet",
collisionFilter: {
category: cat.bullet,
@@ -1534,56 +1534,78 @@ const b = {
game.makeGunHUD();
},
guns: [{
name: "minigun",
description: "<strong>rapidly</strong> fire a stream of small <strong>bullets</strong><br>fire <strong>delay</strong> decreases as you shoot",
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: 65,
defaultAmmoPack: 65,
ammoPack: 60,
defaultAmmoPack: 60,
recordedAmmo: 0,
have: false,
nextFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
startingHoldCycle: 0,
fire() {
//fire delay decreases as you hold fire, down to 3 from 15
const pos = {
x: mech.pos.x + 23 * Math.cos(mech.angle),
y: mech.pos.y + 23 * Math.sin(mech.angle)
}
if (mod.nailGun) {
mech.fireCDcycle = mech.cycle + Math.floor(2.1 * b.fireCD); // cool down
const speed = 33 + 10 * Math.random()
const angle = mech.angle + (Math.random() - 0.5) * (Math.random() - 0.5) * (mech.crouch ? 0.22 : 0.65)
const velocity = {
x: speed * Math.cos(angle),
y: speed * Math.sin(angle)
let CD
if (mod.nailFireRate) { //fire delay decreases as you hold fire, down to 3 from 15
if (mod.nailInstantFireRate) {
CD = 2
} else {
if (this.nextFireCycle + 1 < mech.cycle) this.startingHoldCycle = mech.cycle //reset if not constantly firing
CD = Math.max(5 - 0.06 * (mech.cycle - this.startingHoldCycle), 2) //CD scales with cycles fire is held down
this.nextFireCycle = mech.cycle + CD * b.fireCD //predict next fire cycle if the fire button is held down
}
b.nail(pos, velocity, 1) //position, velocity, damage
} else {
if (this.nextFireCycle + 1 < mech.cycle) this.startingHoldCycle = mech.cycle //reset if not constantly firing
const CD = Math.max(11 - 0.06 * (mech.cycle - this.startingHoldCycle), 2) //CD scales with cycles fire is held down
CD = Math.max(11 - 0.06 * (mech.cycle - this.startingHoldCycle), 2) //CD scales with cycles fire is held down
this.nextFireCycle = mech.cycle + CD * b.fireCD //predict next fire cycle if the fire button is held down
const me = bullet.length;
const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.01 : 0.1);
bullet[me] = Bodies.rectangle(pos.x, pos.y, 20 * mod.bulletSize, 6 * mod.bulletSize, b.fireAttributes(dir));
b.fireProps(CD, mech.crouch ? 38 : 34, dir, me); //cd , speed
bullet[me].endCycle = game.cycle + 70;
bullet[me].dmg = 0.25;
bullet[me].frictionAir = mech.crouch ? 0.001 : 0.003;
if (mod.isIceCrystals) {
bullet[me].onDmg = function (who) {
mobs.statusSlow(who, 30)
};
mech.energy -= mech.fieldRegen + 0.0075
if (mech.energy < 0.02) {
mech.fireCDcycle = mech.cycle + 60; // cool down
}
}
bullet[me].do = function () {
this.force.y += this.mass * 0.0003;
};
}
mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down
const speed = 28 + 8 * Math.random() + 6 * mod.nailInstantFireRate
const angle = mech.angle + (Math.random() - 0.5) * (Math.random() - 0.5) * (mech.crouch ? 1.35 : 3.2) / CD
b.nail({
x: mech.pos.x + 23 * Math.cos(mech.angle),
y: mech.pos.y + 23 * Math.sin(mech.angle)
}, {
x: mech.Vx / 2 + speed * Math.cos(angle),
y: mech.Vy / 2 + speed * Math.sin(angle)
}, 0.9) //position, velocity, damage
if (mod.isIceCrystals) {
bullet[bullet.length - 1].onDmg = function (who) {
mobs.statusSlow(who, 30)
};
mech.energy -= mech.fieldRegen + 0.008
if (mech.energy < 0.02) mech.fireCDcycle = mech.cycle + 60; // cool down
}
// } else {
// if (this.nextFireCycle + 1 < mech.cycle) this.startingHoldCycle = mech.cycle //reset if not constantly firing
// const CD = Math.max(11 - 0.06 * (mech.cycle - this.startingHoldCycle), 2) //CD scales with cycles fire is held down
// this.nextFireCycle = mech.cycle + CD * b.fireCD //predict next fire cycle if the fire button is held down
// const me = bullet.length;
// const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.01 : 0.1);
// bullet[me] = Bodies.rectangle(pos.x, pos.y, 20 * mod.bulletSize, 6 * mod.bulletSize, b.fireAttributes(dir));
// b.fireProps(CD, mech.crouch ? 38 : 34, dir, me); //cd , speed
// bullet[me].endCycle = game.cycle + 70;
// bullet[me].dmg = 0.25;
// bullet[me].frictionAir = mech.crouch ? 0.001 : 0.003;
// if (mod.isIceCrystals) {
// bullet[me].onDmg = function (who) {
// mobs.statusSlow(who, 30)
// };
// mech.energy -= mech.fieldRegen + 0.0075
// if (mech.energy < 0.02) {
// mech.fireCDcycle = mech.cycle + 60; // cool down
// }
// }
// bullet[me].do = function () {
// this.force.y += this.mass * 0.0003;
// };
// }
}
},
{
@@ -1632,7 +1654,7 @@ const b = {
b.nail(pos, velocity, 1)
}
} else {
const side = 21 * mod.bulletSize
const side = 21
for (let i = 0; i < 17; i++) {
const me = bullet.length;
const dir = mech.angle + (Math.random() - 0.5) * spread
@@ -2559,7 +2581,7 @@ const b = {
have: false,
fire() {
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 20 : 6) * b.fireCD); // cool down
const radius = mech.crouch ? 10 + 7 * Math.random() : 4 + 6 * Math.random() //(4 + (mech.crouch ? 15 : 6) * Math.random())
const radius = (mech.crouch ? 10 + 7 * Math.random() : 4 + 6 * Math.random())
const dir = mech.angle + 0.2 * (Math.random() - 0.5)
const position = {
x: mech.pos.x + 30 * Math.cos(mech.angle),

View File

@@ -286,18 +286,6 @@ const game = {
// mech.drop();
},
keyPress() { //runs on key down event
if (keys[189] || keys[79]) {
// - key
game.isAutoZoom = false;
game.zoomScale /= 0.9;
game.setZoom();
} else if (keys[187] || keys[73]) {
// = key
game.isAutoZoom = false;
game.zoomScale *= 0.9;
game.setZoom();
}
//full screen toggle
// if (keys[13]) {
// //enter key
@@ -314,8 +302,6 @@ const game = {
// }
// setupCanvas();
// }
if (keys[69]) { // e swap to next active gun
game.nextGun();
} else if (keys[81]) { //q swap to previous active gun
@@ -359,6 +345,19 @@ const game = {
}
//in testing mode
if (game.testing) {
if (keys[79]) {
// - key
game.isAutoZoom = false;
game.zoomScale /= 0.9;
game.setZoom();
} else if (keys[73]) {
// = key
game.isAutoZoom = false;
game.zoomScale *= 0.9;
game.setZoom();
}
if (keys[192]) { // `
powerUps.directSpawn(game.mouseInGame.x, game.mouseInGame.y, "reroll");
} else if (keys[49]) { // give power ups with 1

View File

@@ -445,7 +445,7 @@ if (localSettings) {
isCommunityMaps: false,
difficultyMode: '1',
fpsCapDefault: 'max',
runCount: -1,
runCount: 0,
};
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
document.getElementById("community-maps").checked = localSettings.isCommunityMaps

View File

@@ -16,9 +16,9 @@ const level = {
// game.zoomScale = 1000;
// game.setZoom();
// mech.isStealth = true;
// b.giveGuns("minigun")
// b.giveGuns("nail gun")
// mech.setField("standing wave harmonics")
// mod.giveMod("nail gun");
// mod.giveMod("pneumatic actuator");
level.intro(); //starting level
// level.testing(); //not in rotation

View File

@@ -67,7 +67,7 @@ const mod = {
!build.isCustomSelection &&
b.inventory.length > 2 &&
name !== b.guns[b.activeGun].name &&
Math.random() < -0.1 + 0.1 * (b.inventory.length + mod.isGunCycle * 2) //lower chance of mods specific to a gun if you have lots of guns
Math.random() > 2 / (b.inventory.length + mod.isGunCycle * 3) //lower chance of mods specific to a gun if you have lots of guns
) {
return false
}
@@ -82,7 +82,7 @@ const mod = {
if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length
if (mod.isLowHealthDmg) dmg *= 1 + 0.5 * Math.max(0, 1 - mech.health)
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
if (mod.isEnergyLoss) dmg *= 1.33;
if (mod.isEnergyLoss) dmg *= 1.37;
if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4;
if (mod.isRest && player.speed < 1) dmg *= 1.20;
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
@@ -128,7 +128,7 @@ const mod = {
},
{
name: "acute stress response",
description: "increase <strong class='color-d'>damage</strong> by <strong>33%</strong><br>if a mob <strong>dies</strong> drain stored <strong class='color-f'>energy</strong> by <strong>25%</strong>",
description: "increase <strong class='color-d'>damage</strong> by <strong>37%</strong><br>if a mob <strong>dies</strong> drain stored <strong class='color-f'>energy</strong> by <strong>25%</strong>",
maxCount: 1,
count: 0,
allowed() {
@@ -557,7 +557,7 @@ const mod = {
},
{
name: "scrap bots",
description: "<strong>12%</strong> chance to build a <strong>bot</strong> after killing a mob<br>the bot only functions until the end of the level",
description: "<strong>11%</strong> chance to build a <strong>bot</strong> after killing a mob<br>the bot only functions until the end of the level",
maxCount: 6,
count: 0,
allowed() {
@@ -565,7 +565,7 @@ const mod = {
},
requires: "a bot",
effect() {
mod.isBotSpawner += 0.12;
mod.isBotSpawner += 0.11;
},
remove() {
mod.isBotSpawner = 0;
@@ -1371,50 +1371,50 @@ const mod = {
}
},
{
name: "depleted uranium rounds",
description: `your <strong>bullets</strong> are <strong>18%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
count: 0,
maxCount: 9,
allowed() {
return (mod.haveGunCheck("minigun") && !mod.nailGun) || mod.haveGunCheck("shotgun") || mod.haveGunCheck("super balls")
},
requires: "minigun, shotgun, super balls",
effect() {
mod.bulletSize += 0.18
},
remove() {
mod.bulletSize = 1;
}
},
{
name: "nail gun",
description: "the <strong>minigun</strong> is modified to fire <strong>nails</strong><br>with a short <strong>fire delay</strong> and a low <strong>precision</strong>",
name: "pneumatic actuator",
description: "<strong>nail gun</strong> takes <strong>50%</strong> less time to ramp up<br>to it's shortest <strong>delay</strong> after firing",
maxCount: 1,
count: 0,
allowed() {
return mod.haveGunCheck("minigun") && !mod.isIceCrystals
return mod.haveGunCheck("nail gun")
},
requires: "minigun",
requires: "nail gun",
effect() {
mod.nailGun = true
mod.nailFireRate = true
},
remove() {
mod.nailGun = false
mod.nailFireRate = false
}
},
{
name: "powder-actuated",
description: "<strong>nail gun</strong> takes <strong>no</strong> time to ramp up<br>nails have a <strong>20%</strong> faster muzzle <strong>speed</strong>",
maxCount: 1,
count: 0,
allowed() {
return mod.haveGunCheck("nail gun") && mod.nailFireRate && !mod.isIceCrystals
},
requires: "nail gun",
effect() {
mod.nailInstantFireRate = true
},
remove() {
mod.nailInstantFireRate = false
}
},
{
name: "ice crystal nucleation",
description: "the <strong>minigun</strong> uses <strong class='color-f'>energy</strong> to condense<br>unlimited <strong class='color-s'>freezing</strong> <strong>bullets</strong> from water vapor",
description: "the <strong>nail gun</strong> uses <strong class='color-f'>energy</strong> to condense<br>unlimited <strong class='color-s'>freezing</strong> <strong>ice shards</strong>",
maxCount: 1,
count: 0,
allowed() {
return mod.haveGunCheck("minigun") && !mod.nailGun
return mod.haveGunCheck("nail gun") && !mod.nailInstantFireRate
},
requires: "minigun",
requires: "nail gun",
effect() {
mod.isIceCrystals = true;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "minigun") {
if (b.guns[i].name === "nail gun") {
b.guns[i].ammoPack = Infinity
b.guns[i].recordedAmmo = b.guns[i].ammo
b.guns[i].ammo = Infinity
@@ -1426,7 +1426,7 @@ const mod = {
remove() {
mod.isIceCrystals = false;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "minigun") {
if (b.guns[i].name === "nail gun") {
b.guns[i].ammoPack = b.guns[i].defaultAmmoPack;
b.guns[i].ammo = b.guns[i].recordedAmmo
game.updateGunHUD();
@@ -1527,6 +1527,22 @@ const mod = {
mod.oneSuperBall = false;
}
},
{
name: "super sized",
description: `your <strong>super balls</strong> are <strong>22%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
count: 0,
maxCount: 9,
allowed() {
return mod.haveGunCheck("super balls")
},
requires: "super balls",
effect() {
mod.bulletSize += 0.22
},
remove() {
mod.bulletSize = 1;
}
},
{
name: "flechettes cartridges",
description: "<strong>flechettes</strong> release <strong>three</strong> needles in each shot<br><strong class='color-g'>ammo</strong> cost are increases by <strong>3x</strong>",
@@ -1843,7 +1859,7 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return mod.nailBotCount + mod.grenadeFragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isRailNails + mod.isNailShot + mod.nailGun) * 2 > 1
return mod.nailBotCount + mod.grenadeFragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isRailNails + mod.isNailShot + (mod.haveGunCheck("nail gun") && !mod.isIceCrystals)) * 2 > 1
},
requires: "nails",
effect() {
@@ -2016,7 +2032,7 @@ const mod = {
},
{
name: "colloidal foam",
description: "increase <strong>foam</strong> <strong class='color-d'>damage</strong> by <strong>200%</strong><br><strong>foam</strong> dissipates <strong>50%</strong> faster",
description: "increase <strong>foam</strong> <strong class='color-d'>damage</strong> by <strong>200%</strong><br><strong>foam</strong> dissipates <strong>40%</strong> faster",
maxCount: 1,
count: 0,
allowed() {
@@ -2030,6 +2046,22 @@ const mod = {
mod.isFastFoam = false;
}
},
// {
// name: "foam size",
// description: "increase <strong>foam</strong> <strong class='color-d'>damage</strong> by <strong>200%</strong><br><strong>foam</strong> dissipates <strong>50%</strong> faster",
// maxCount: 1,
// count: 0,
// allowed() {
// return mod.haveGunCheck("foam") || mod.foamBotCount > 2
// },
// requires: "foam",
// effect() {
// mod.isLargeFoam = true
// },
// remove() {
// mod.isLargeFoam = false;
// }
// },
{
name: "frame-dragging",
description: "<strong>slow time</strong> while charging the <strong>rail gun</strong><br>charging no longer drains <strong class='color-f'>energy</strong>",
@@ -2651,5 +2683,6 @@ const mod = {
isFastFoam: null,
isSporeGrowth: null,
isBayesian: null,
nailGun: null
nailGun: null,
nailInstantFireRate: null
}