varous balance changes

pilot wave field adjustments
pilot wave mod
This commit is contained in:
landgreen
2020-04-17 05:03:10 -07:00
parent 4e1c5467e3
commit ae8a3ec9ce
4 changed files with 153 additions and 158 deletions

View File

@@ -79,6 +79,7 @@ const b = {
isModNailPoison: null,
isModEnergyHealth: null,
isModPulseStun: null,
isModPilotFreeze: null,
modOnHealthChange() { //used with acid mod
if (b.isModAcidDmg && mech.health > 0.8) {
b.modAcidDmg = 0.5
@@ -211,22 +212,6 @@ const b = {
b.isModHarmDamage = false;
}
},
{
name: "thermal runaway",
description: "mobs <strong class='color-e'>explode</strong> when they <strong>die</strong><br><em>be careful</em>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
b.isModExplodeMob = true;
},
remove() {
b.isModExplodeMob = false;
}
},
{
name: "auto-loading heuristics",
description: "your <strong>delay</strong> after firing is <strong>+14% shorter</strong>",
@@ -386,6 +371,22 @@ const b = {
b.modSporesOnDeath = 0;
}
},
{
name: "thermal runaway",
description: "mobs <strong class='color-e'>explode</strong> when they <strong>die</strong><br><em>be careful</em>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
b.isModExplodeMob = true;
},
remove() {
b.isModExplodeMob = false;
}
},
{
name: "reaction inhibitor",
description: "mobs <strong>die</strong> if their life goes below <strong>12%</strong>",
@@ -504,7 +505,7 @@ const b = {
}
},
{
name: "weak anthropic principle",
name: "anthropic principle",
description: "<strong>fatal harm</strong> can't happen<br><strong>saves</strong> you up to once every <strong>3</strong> seconds",
maxCount: 1,
count: 0,
@@ -749,7 +750,7 @@ const b = {
},
{
name: "leveraged investment",
description: "<strong>remove</strong> all future <strong>ammo</strong> power ups<br>spawn <strong>6</strong> <strong class='color-m'>mods</strong> and <strong>3</strong> <strong class='color-h'>healing</strong> power ups",
description: "<strong>remove</strong> all future <strong>ammo</strong> power ups<br>spawn <strong>5</strong> <strong class='color-m'>mods</strong> and <strong>3</strong> <strong class='color-h'>healing</strong> power ups",
maxCount: 1,
count: 0,
allowed() {
@@ -758,7 +759,7 @@ const b = {
requires: "",
effect: () => {
b.isModNoAmmo = true;
for (let i = 0; i < 6; i++) { //if you change the six also change it in Born rule
for (let i = 0; i < 5; i++) { //if you change the six also change it in Born rule
powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
if (Math.random() < b.isModBayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
}
@@ -814,7 +815,7 @@ const b = {
bullet = [];
let count = b.modCount
if (b.isModNoAmmo) count - 6 //remove the 6 bonus mods when getting rid of leveraged investment
if (b.isModNoAmmo) count - 5 //remove the 5 bonus mods when getting rid of leveraged investment
for (let i = 0; i < count; i++) { // spawn new mods
powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
}
@@ -1496,6 +1497,22 @@ const b = {
b.superposition = false;
}
},
{
name: "Bose Einstein condensate",
description: "<strong>mobs</strong> in superposition with the <strong>pilot wave</strong><br>are <strong class='color-s'>frozen</strong> for <strong>2</strong> second",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "pilot wave"
},
requires: "pilot wave",
effect() {
b.isModPilotFreeze = true
},
remove() {
b.isModPilotFreeze = false
}
},
],
removeMod(index) {
b.mods[index].remove();
@@ -1533,9 +1550,15 @@ const b = {
}
} else {
if (isNaN(index)) { //find index by name
let found = false;
for (let i = 0; i < b.mods.length; i++) {
if (index === b.mods[i].name) index = i
if (index === b.mods[i].name) {
index = i;
found = true;
break;
}
}
if (!found) return //if name not found don't give any mod
}
b.mods[index].effect(); //give specific mod
@@ -1818,7 +1841,7 @@ const b = {
bullet[me].onEnd = function () {
b.explosion(this.position, this.explodeRad * size); //makes bullet do explosive damage at end
for (let i = 0; i < spawn; i++) {
b.missile(this.position, 2 * Math.PI * Math.random(), 0, 0.75)
b.missile(this.position, 2 * Math.PI * Math.random(), 0, 0.65)
}
}
bullet[me].onDmg = function () {
@@ -2124,7 +2147,7 @@ const b = {
friction: 0,
frictionAir: 0.10,
restitution: 0.3,
dmg: 0.17, //damage done in addition to the damage from momentum
dmg: 0.16, //damage done in addition to the damage from momentum
lookFrequency: 10 + Math.floor(7 * Math.random()),
endCycle: game.cycle + 120 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger),
classType: "bullet",
@@ -2195,7 +2218,7 @@ const b = {
frictionAir: 0.0005,
restitution: 1,
dmg: 0.17, //damage done in addition to the damage from momentum
lookFrequency: 83 + Math.floor(41 * Math.random()),
lookFrequency: 107 + Math.floor(47 * Math.random()),
endCycle: game.cycle + Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger),
classType: "bullet",
collisionFilter: {
@@ -2205,18 +2228,21 @@ const b = {
minDmgSpeed: 0,
lockedOn: null,
isFollowMouse: true,
deathCycles: 110 + RADIUS * 5,
onDmg() {
this.lockedOn = null
if (this.endCycle > game.cycle + 180 && b.isModDroneCollide) {
if (this.endCycle > game.cycle + this.deathCycles && b.isModDroneCollide) {
this.endCycle -= 60
if (game.cycle + 180 > this.endCycle) this.endCycle = game.cycle + 180
if (game.cycle + this.deathCycles > this.endCycle) this.endCycle = game.cycle + this.deathCycles
}
},
onEnd() {},
do() {
if (game.cycle + 180 > this.endCycle) { //fall and die
if (game.cycle + this.deathCycles > this.endCycle) { //fall shrink and die
this.force.y += this.mass * 0.0012;
this.restitution = 0.2;
const scale = 0.99;
Matter.Body.scale(this, scale, scale);
} else {
this.force.y += this.mass * 0.0002;
//find mob targets
@@ -2496,9 +2522,15 @@ const b = {
}
} else {
if (isNaN(gun)) { //find gun by name
let found = false;
for (let i = 0; i < b.guns.length; i++) {
if (gun === b.guns[i].name) gun = i
if (gun === b.guns[i].name) {
gun = i
found = true;
break
}
}
if (!found) return //if no gun found don't give a gun
}
if (!b.guns[gun].have) b.inventory.push(gun);
b.guns[gun].have = true;
@@ -3151,7 +3183,7 @@ const b = {
name: "ice IX", //11
description: "synthesize <strong>short-lived</strong> ice crystals<br>crystals <strong>seek</strong> out and <strong class='color-s'>freeze</strong> mobs",
ammo: 0,
ammoPack: 80,
ammoPack: 75,
have: false,
isStarterGun: true,
isEasyToAim: true,
@@ -3898,70 +3930,5 @@ const b = {
// player.force.x -= KNOCK * Math.cos(dir)
// player.force.y -= KNOCK * Math.sin(dir) * 0.3 //reduce knock back in vertical direction to stop super jumps
// },
// {
// name: "triboelectricty", //14
// description: "release <strong>particles</strong> that quickly seek out targets",
// ammo: 0,
// ammoPack: 40,
// have: false,
// isStarterGun: true,
// fire() {
// const dir = mech.angle + 0.2 * (Math.random() - 0.5);
// const me = bullet.length;
// const RADIUS = 6
// bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), RADIUS, {
// angle: dir,
// inertia: Infinity,
// // friction: 0.05,
// // frictionAir: 0.05,
// restitution: 0.8,
// dmg: 0.14, //damage done in addition to the damage from momentum
// lookFrequency: 3,
// endCycle: game.cycle + Math.floor(120 * b.isModBulletsLastLonger),
// classType: "bullet",
// collisionFilter: {
// category: 0x000100,
// mask: 0x010111 //self collide
// },
// minDmgSpeed: 0,
// lockedOn: null,
// isFollowMouse: true,
// onDmg() {
// this.endCycle = 0;
// },
// onEnd() {},
// do() {
// if (this.lockedOn) { //accelerate towards mobs
// this.force = Vector.mult(Vector.normalise(Vector.sub(this.position, this.lockedOn.position)), -this.mass * 0.01)
// Matter.Body.setVelocity(this, {
// x: this.velocity.x * 0.93,
// y: this.velocity.y * 0.93
// });
// } else {
// this.force.y += this.mass * 0.0004;
// }
// }
// })
// b.fireProps(mech.crouch ? 19 : 15, mech.crouch ? 45 : 30, dir, me); //cd , speed
// //find mob targets
// let closeDist = Infinity;
// for (let i = 0, len = mob.length; i < len; ++i) {
// if (
// Matter.Query.ray(map, bullet[me].position, mob[i].position).length === 0 &&
// Matter.Query.ray(body, bullet[me].position, mob[i].position).length === 0
// ) {
// const TARGET_VECTOR = Vector.sub(bullet[me].position, mob[i].position)
// const DIST = Vector.magnitude(TARGET_VECTOR);
// if (DIST < closeDist) {
// closeDist = DIST;
// bullet[me].lockedOn = mob[i]
// }
// }
// }
// }
// },
// {
]
};