minigun ramp up

mod flechettes do all DoT damage in 1/2 a second
minigun increases fire speed as you hold the fire button
This commit is contained in:
landgreen
2020-06-04 05:40:44 -07:00
parent 10a8f44424
commit cea1bcc7a3
5 changed files with 67 additions and 84 deletions

View File

@@ -1184,49 +1184,61 @@ const b = {
name: "minigun", name: "minigun",
description: "<strong>rapidly</strong> fire a stream of small <strong>bullets</strong>", description: "<strong>rapidly</strong> fire a stream of small <strong>bullets</strong>",
ammo: 0, ammo: 0,
ammoPack: 65, ammoPack: 75,
defaultAmmoPack: 65, defaultAmmoPack: 75,
recordedAmmo: 0, recordedAmmo: 0,
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
nextFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
startingHoldCycle: 0,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.01 : 0.1); const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.01 : 0.1);
bullet[me] = Bodies.rectangle(mech.pos.x + 23 * Math.cos(mech.angle), mech.pos.y + 23 * Math.sin(mech.angle), 20 * mod.bulletSize, 6 * mod.bulletSize, b.fireAttributes(dir)); bullet[me] = Bodies.rectangle(mech.pos.x + 23 * Math.cos(mech.angle), mech.pos.y + 23 * Math.sin(mech.angle), 20 * mod.bulletSize, 6 * mod.bulletSize, b.fireAttributes(dir));
b.fireProps(mech.crouch ? 7 : 4, mech.crouch ? 40 : 34, dir, me); //cd , speed
//fire delay decreases as you hold fire, down to 3 from 15
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
b.fireProps(CD, mech.crouch ? 38 : 34, dir, me); //cd , speed
// b.fireProps(mech.crouch ? 7 : 4, mech.crouch ? 40 : 34, dir, me); //cd , speed
bullet[me].endCycle = game.cycle + 70; bullet[me].endCycle = game.cycle + 70;
bullet[me].dmg = 0.25; bullet[me].dmg = 0.25;
bullet[me].frictionAir = mech.crouch ? 0.001 : 0.003; bullet[me].frictionAir = mech.crouch ? 0.001 : 0.003;
if (mod.isIceCrystals && mech.energy > 0.01) { if (mod.isIceCrystals) {
mech.energy -= mech.fieldRegen + 0.005
bullet[me].onDmg = function (who) { bullet[me].onDmg = function (who) {
mobs.statusSlow(who, 30) mobs.statusSlow(who, 30)
}; };
mech.energy -= mech.fieldRegen + 0.007
if (mech.energy < 0.02) {
mech.fireCDcycle = mech.cycle + 60; // cool down
}
} }
bullet[me].do = function () { bullet[me].do = function () {
this.force.y += this.mass * 0.0003; this.force.y += this.mass * 0.0003;
}; };
} }
}, },
{ {
name: "shotgun", name: "shotgun",
description: "fire a <strong>burst</strong> of short range bullets<br><em>crouch to reduce recoil</em>", description: "fire a <strong>burst</strong> of short range bullets<br><em>crouch to reduce recoil</em>",
ammo: 0, ammo: 0,
ammoPack: 11, ammoPack: 9,
have: false, have: false,
isStarterGun: true,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
let knock, spread let knock, spread
if (mech.crouch) { if (mech.crouch) {
mech.fireCDcycle = mech.cycle + Math.floor(55 * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor(55 * b.fireCD); // cool down
if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(55 * b.fireCD); //player is immune to collision damage for 30 cycles if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(58 * b.fireCD); //player is immune to collision damage for 30 cycles
spread = 0.75 spread = 0.75
knock = 0.01 * mod.bulletSize * mod.bulletSize knock = 0.01 * mod.bulletSize * mod.bulletSize
} else { } else {
mech.fireCDcycle = mech.cycle + Math.floor(45 * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor(45 * b.fireCD); // cool down
if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(45 * b.fireCD); //player is immune to collision damage for 30 cycles if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(47 * b.fireCD); //player is immune to collision damage for 30 cycles
spread = 1.3 spread = 1.3
knock = 0.08 * mod.bulletSize * mod.bulletSize knock = 0.08 * mod.bulletSize * mod.bulletSize
} }
@@ -1235,7 +1247,7 @@ const b = {
b.muzzleFlash(35); b.muzzleFlash(35);
if (mod.isNailShot) { if (mod.isNailShot) {
for (let i = 0; i < 15; i++) { for (let i = 0; i < 14; i++) {
const dir = mech.angle + (Math.random() - 0.5) * spread * 0.2 const dir = mech.angle + (Math.random() - 0.5) * spread * 0.2
const pos = { const pos = {
x: mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5), x: mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5),
@@ -1281,7 +1293,6 @@ const b = {
ammoPack: 15, ammoPack: 15,
have: false, have: false,
num: 5, num: 5,
isStarterGun: true,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
const SPEED = mech.crouch ? 40 : 30 const SPEED = mech.crouch ? 40 : 30
@@ -1335,10 +1346,9 @@ const b = {
name: "flechettes", name: "flechettes",
description: "fire a volley of <strong class='color-p'>uranium-235</strong> <strong>needles</strong><br>does <strong class='color-d'>damage</strong> over <strong>3</strong> seconds", description: "fire a volley of <strong class='color-p'>uranium-235</strong> <strong>needles</strong><br>does <strong class='color-d'>damage</strong> over <strong>3</strong> seconds",
ammo: 0, ammo: 0,
ammoPack: 36, ammoPack: 42,
defaultAmmoPack: 36, defaultAmmoPack: 42,
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
count: 0, //used to track how many shots are in a volley before a big CD count: 0, //used to track how many shots are in a volley before a big CD
lastFireCycle: 0, //use to remember how longs its been since last fire, used to reset count lastFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
@@ -1364,11 +1374,13 @@ const b = {
if (!immune) { if (!immune) {
this.immuneList.push(who.id) this.immuneList.push(who.id)
who.foundPlayer(); who.foundPlayer();
if (mod.isDotFlechette) {
mobs.statusDoT(who, 0.5, 360) if (mod.isFastDot) {
mobs.statusDoT(who, 3.6, 30)
} else { } else {
mobs.statusDoT(who, 0.5, 180) mobs.statusDoT(who, 0.6, mod.isSlowDot ? 360 : 180)
} }
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue
x: this.position.x, x: this.position.x,
y: this.position.y, y: this.position.y,
@@ -1380,10 +1392,10 @@ const b = {
} else { } else {
this.endCycle = 0; this.endCycle = 0;
who.foundPlayer(); who.foundPlayer();
if (mod.isDotFlechette) { if (mod.isFastDot) {
mobs.statusDoT(who, 0.5, 360) mobs.statusDoT(who, 3.78, 30)
} else { } else {
mobs.statusDoT(who, 0.5, 180) mobs.statusDoT(who, 0.63, mod.isSlowDot ? 360 : 180)
} }
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue
x: this.position.x, x: this.position.x,
@@ -1421,42 +1433,18 @@ const b = {
makeFlechette(mech.angle - 0.02 - 0.005 * Math.random()) makeFlechette(mech.angle - 0.02 - 0.005 * Math.random())
} }
const CD = (mech.crouch) ? 60 : 30 const CD = (mech.crouch) ? 68 : 35
if (this.lastFireCycle + CD < mech.cycle) this.count = 0 //reset count if it cycles past the CD if (this.lastFireCycle + CD < mech.cycle) this.count = 0 //reset count if it cycles past the CD
this.lastFireCycle = mech.cycle this.lastFireCycle = mech.cycle
if (this.count > ((mech.crouch) ? 7 : 1)) { if (this.count > ((mech.crouch) ? 7 : 1)) {
this.count = 0 this.count = 0
mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down
const who = bullet[bullet.length - 1] const who = bullet[bullet.length - 1]
Matter.Body.setDensity(who, 0.00001); Matter.Body.setDensity(who, 0.00001);
// who.onDmg = function (who) {
// if (mod.isDotFlechette) {
// mobs.statusDoT(who, 0.33, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
// mobs.statusSlow(who, 120) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
// } else {
// mobs.statusDoT(who, 0.33, 180) // (2.3) / 6 ticks (3 seconds)
// mobs.statusSlow(who, 60) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
// }
// this.endCycle = 0;
// };
// who.onEnd = function () {
// b.explosion(this.position, 220); //makes bullet do explosive damage at end
// }
// who.do = function () {
// if (this.speed < 10) this.force.y += this.mass * 0.0003; //no gravity until it slows don to improve aiming
// if (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length) {
// this.endCycle = 0; //explode if touching map or blocks
// }
// }
} else { } else {
this.count++ this.count++
mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor(2 * b.fireCD); // cool down
} }
} }
}, },
{ {
@@ -1465,7 +1453,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 110, ammoPack: 110,
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down
@@ -1602,7 +1589,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 4, ammoPack: 4,
have: false, have: false,
isStarterGun: false,
isEasyToAim: true, isEasyToAim: true,
fireCycle: 0, fireCycle: 0,
ammoLoaded: 0, ammoLoaded: 0,
@@ -1661,7 +1647,6 @@ const b = {
ammoPack: 6, ammoPack: 6,
defaultAmmoPack: 6, //use to revert ammoPack after mod changes drop rate defaultAmmoPack: 6, //use to revert ammoPack after mod changes drop rate
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 10) * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 10) * b.fireCD); // cool down
@@ -1706,7 +1691,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 7, ammoPack: 7,
have: false, have: false,
isStarterGun: false,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
@@ -1759,7 +1743,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 3, ammoPack: 3,
have: false, have: false,
isStarterGun: false,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
@@ -1881,7 +1864,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 7, ammoPack: 7,
have: false, have: false,
isStarterGun: false,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
@@ -2039,7 +2021,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 3, ammoPack: 3,
have: false, have: false,
isStarterGun: false,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
const pos = { const pos = {
@@ -2063,7 +2044,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 5, ammoPack: 5,
have: false, have: false,
isStarterGun: false,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
@@ -2180,7 +2160,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 14, ammoPack: 14,
have: false, have: false,
isStarterGun: true,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
b.drone(mech.crouch ? 45 : 1) b.drone(mech.crouch ? 45 : 1)
@@ -2193,7 +2172,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 73, ammoPack: 73,
have: false, have: false,
isStarterGun: true,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
if (mech.crouch) { if (mech.crouch) {
@@ -2212,7 +2190,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 50, ammoPack: 50,
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 20 : 6) * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 20 : 6) * b.fireCD); // cool down
@@ -2236,7 +2213,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: 4, ammoPack: 4,
have: false, have: false,
isStarterGun: false,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
@@ -2467,7 +2443,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: Infinity, ammoPack: Infinity,
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
const reflectivity = 1 - 1 / (mod.laserReflections * 1.5) const reflectivity = 1 - 1 / (mod.laserReflections * 1.5)
@@ -2626,7 +2601,6 @@ const b = {
ammo: 0, ammo: 0,
ammoPack: Infinity, ammoPack: Infinity,
have: false, have: false,
isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
//calculate laser collision //calculate laser collision
@@ -2823,7 +2797,7 @@ const b = {
// ammo: 0, // ammo: 0,
// ammoPack: 5, // ammoPack: 5,
// have: false, // have: false,
// isStarterGun: true, //
// fire() { // fire() {
// b.muzzleFlash(45); // b.muzzleFlash(45);
// // mobs.alert(800); // // mobs.alert(800);

View File

@@ -84,8 +84,10 @@ const build = {
<br>health: ${(mech.health*100).toFixed(0)}% &nbsp; energy: ${(mech.energy*100).toFixed(0)}% &nbsp; <br>health: ${(mech.health*100).toFixed(0)}% &nbsp; energy: ${(mech.energy*100).toFixed(0)}% &nbsp;
<br>mass: ${player.mass.toFixed(1)} &nbsp; rerolls: ${powerUps.reroll.rerolls} <br>mass: ${player.mass.toFixed(1)} &nbsp; rerolls: ${powerUps.reroll.rerolls}
<br>position: (${player.position.x.toFixed(1)}, ${player.position.y.toFixed(1)}) &nbsp; velocity: (${player.velocity.x.toFixed(1)}, ${player.velocity.y.toFixed(1)}) <br>position: (${player.position.x.toFixed(1)}, ${player.position.y.toFixed(1)}) &nbsp; velocity: (${player.velocity.x.toFixed(1)}, ${player.velocity.y.toFixed(1)})
<br>global damage increase: ${((mod.damageFromMods()-1)*100).toFixed(0)}% <br>
<br>global harm reduction: ${((1-mech.harmReduction())*100).toFixed(0)}% <br>damage increase: ${((mod.damageFromMods()-1)*100).toFixed(0)}%
<br>harm reduction: ${((1-mech.harmReduction())*100).toFixed(0)}%
<br>fire delay decrease: ${((1-b.fireCD)*100).toFixed(0)}%
</div>`; </div>`;
let countGuns = 0 let countGuns = 0
let countMods = 0 let countMods = 0

View File

@@ -20,8 +20,7 @@ const level = {
// mod.giveMod("timelike world line"); // mod.giveMod("timelike world line");
// mod.giveMod("Lorentz transformation"); // mod.giveMod("Lorentz transformation");
b.giveGuns("minigun")
// b.giveGuns("drones")
// b.giveGuns("spores") // b.giveGuns("spores")
// mech.setField("pilot wave") // mech.setField("pilot wave")
// mech.setField("phase decoherence field") // mech.setField("phase decoherence field")

View File

@@ -473,7 +473,7 @@ const mod = {
}, },
{ {
name: "zoospore vector", name: "zoospore vector",
description: "mobs discharge <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br><strong>+11%</strong> chance", description: "mobs produce <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> when they <strong>die</strong><br><strong>+11%</strong> chance",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
@@ -540,7 +540,7 @@ const mod = {
}, },
{ {
name: "scrap recycling", name: "scrap recycling",
description: "<strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second<br>active for <strong>5 seconds</strong> after a mob <strong>dies</strong>", description: "<strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -556,7 +556,7 @@ const mod = {
}, },
{ {
name: "waste energy recovery", name: "waste energy recovery",
description: "regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second<br>active for <strong>5 seconds</strong> after a mob <strong>dies</strong>", description: "regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1184,19 +1184,35 @@ const mod = {
} }
}, },
{ {
name: "irradiated needles", name: "6s half-life",
description: "<strong>needles</strong> are exposed to <strong class='color-p'>plutonium-238</strong><br><strong>2x</strong> <strong class='color-d'>damage</strong> spread over <strong>6</strong> seconds", description: "<strong>needles</strong> are exposed to <strong class='color-p'>plutonium-238</strong><br><strong>2x</strong> <strong class='color-d'>damage</strong> spread over <strong>6</strong> seconds",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.haveGunCheck("flechettes") return mod.haveGunCheck("flechettes") && !mod.isFastDot
}, },
requires: "flechettes", requires: "flechettes",
effect() { effect() {
mod.isDotFlechette = true; mod.isSlowDot = true;
}, },
remove() { remove() {
mod.isDotFlechette = false; mod.isSlowDot = false;
}
},
{
name: "1/2s half-life",
description: "<strong>needles</strong> are exposed to <strong class='color-p'>lithium-8</strong><br>flechette <strong class='color-d'>damage</strong> occurs after <strong>1/2</strong> a second",
maxCount: 1,
count: 0,
allowed() {
return mod.haveGunCheck("flechettes") && !mod.isSlowDot
},
requires: "flechettes",
effect() {
mod.isFastDot = true;
},
remove() {
mod.isFastDot = false;
} }
}, },
{ {
@@ -1974,4 +1990,5 @@ const mod = {
fastTime: null, fastTime: null,
squirrelJump: null, squirrelJump: null,
fastTimeJump: null, fastTimeJump: null,
isFastDot: null,
} }

View File

@@ -1,12 +1,6 @@
new mod - heal: gives heals mod flechettes do all DoT damage in 1/2 a second
new mod - ammo: gives ammo minigun increases fire speed as you hold the fire button
mod mass-energy equivalence no longer benefits from harm reduction effects,
but it also takes 25% less damage than before
mod - timelike world line gives 2x faster speed and harm immunity when time dilation is active
mod - Lorentz transformation improves move jump and fire speed even when time dilation isn't active
(the same as 1 rank of squirrel cage rotor and auto-loading heuristics)
************** TODO - n-gon ************** ************** TODO - n-gon **************
@@ -15,9 +9,6 @@ shrink font on small screens (so you can see 5 options on power ups)
graphic idea: bezier curve that moves smoothly from mob to mob graphic idea: bezier curve that moves smoothly from mob to mob
loops around player loops around player
add air control check box
set mech.airSpeedLimit to 0? to disable
give rail gun projectile a trail give rail gun projectile a trail
only draw above speed 5 only draw above speed 5
track previous positions? track previous positions?