power up boss adjustments

This commit is contained in:
landgreen
2020-08-04 15:27:32 -07:00
parent 07f77e41a5
commit d13b1fb16d
8 changed files with 56 additions and 79 deletions

View File

@@ -1495,7 +1495,7 @@ const b = {
// ******************************** Guns *********************************************
// **************************************************************************************************
// **************************************************************************************************
giveGuns(gun = "random", ammoPacks = 6) {
giveGuns(gun = "random", ammoPacks = 10) {
if (mod.isOneGun) b.removeAllGuns();
if (gun === "random") {
//find what guns player doesn't have
@@ -1538,8 +1538,8 @@ const b = {
name: "minigun",
description: "<strong>rapidly</strong> fire a stream of small <strong>bullets</strong><br>fire <strong>delay</strong> decreases as you shoot",
ammo: 0,
ammoPack: 75,
defaultAmmoPack: 75,
ammoPack: 70,
defaultAmmoPack: 70,
recordedAmmo: 0,
have: false,
nextFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
@@ -1577,7 +1577,7 @@ 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: 9,
ammoPack: 8,
have: false,
fire() {
let knock, spread
@@ -1647,7 +1647,7 @@ const b = {
name: "super balls",
description: "fire <strong>four</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss",
ammo: 0,
ammoPack: 15,
ammoPack: 13,
have: false,
num: 5,
fire() {
@@ -1702,8 +1702,8 @@ const b = {
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",
ammo: 0,
ammoPack: 42,
defaultAmmoPack: 42,
ammoPack: 38,
defaultAmmoPack: 38,
have: false,
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
@@ -1806,7 +1806,7 @@ const b = {
name: "wave beam",
description: "emit a <strong>sine wave</strong> of oscillating particles<br>particles <strong>slowly</strong> propagate through <strong>solids</strong>",
ammo: 0,
ammoPack: 110,
ammoPack: 100,
have: false,
fire() {
mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down
@@ -1941,7 +1941,7 @@ const b = {
name: "missiles",
description: "launch missiles that <strong>accelerate</strong> towards <strong>mobs</strong><br><strong class='color-e'>explodes</strong> when near target",
ammo: 0,
ammoPack: 5,
ammoPack: 4,
have: false,
fireCycle: 0,
ammoLoaded: 0,
@@ -1997,8 +1997,8 @@ const b = {
name: "flak",
description: "fire a <strong>cluster</strong> of short range <strong>projectiles</strong><br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after half a second",
ammo: 0,
ammoPack: 6,
defaultAmmoPack: 6, //use to revert ammoPack after mod changes drop rate
ammoPack: 5,
defaultAmmoPack: 5, //use to revert ammoPack after mod changes drop rate
have: false,
fire() {
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 10) * b.fireCD); // cool down
@@ -2041,7 +2041,7 @@ const b = {
name: "grenades",
description: "lob a single <strong>bouncy</strong> projectile<br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after one second",
ammo: 0,
ammoPack: 7,
ammoPack: 6,
have: false,
fire() {
const me = bullet.length;
@@ -2211,7 +2211,7 @@ const b = {
name: "neutron bomb",
description: "toss a chunk of <strong class='color-p'>Cf-252</strong> that emits <strong class='color-p'>neutrons</strong><br><strong class='color-d'>damages</strong> and drains <strong class='color-f'>energy</strong> in area of effect",
ammo: 0,
ammoPack: 7,
ammoPack: 6,
have: false,
fire() {
const me = bullet.length;
@@ -2391,7 +2391,7 @@ const b = {
name: "spores",
description: "fire a <strong>sporangium</strong> that discharges <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> seek out nearby mobs",
ammo: 0,
ammoPack: 5,
ammoPack: 4,
have: false,
fire() {
const me = bullet.length;
@@ -2511,7 +2511,7 @@ const b = {
name: "drones",
description: "deploy drones that <strong>crash</strong> into mobs<br>crashes reduce their <strong>lifespan</strong> by 1 second",
ammo: 0,
ammoPack: 15,
ammoPack: 13,
have: false,
fire() {
b.drone(mech.crouch ? 45 : 1)
@@ -2522,7 +2522,7 @@ const b = {
name: "ice IX",
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: 73,
ammoPack: 69,
have: false,
fire() {
if (mech.crouch) {
@@ -2539,7 +2539,7 @@ const b = {
name: "foam",
description: "spray bubbly foam that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time",
ammo: 0,
ammoPack: 50,
ammoPack: 45,
have: false,
fire() {
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 20 : 6) * b.fireCD); // cool down

View File

@@ -175,8 +175,8 @@ function collisionChecks(event) {
y: mob[k].velocity.y - 8 * Math.sin(angle)
});
if (mod.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mech.energy > 0.2) {
mech.energy -= 0.2
if (mod.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mech.energy > 0.33) {
mech.energy -= 0.33
mech.immuneCycle = 0; //player doesn't go immune to collision damage
mob[k].death();
game.drawList.push({
@@ -224,7 +224,7 @@ function collisionChecks(event) {
if (v > 9) {
let dmg = 0.06 * b.dmgScale * v * obj.mass * mod.throwChargeRate;
if (mod.isCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
if (mob[k].isShielded) dmg *= 0.4
if (mob[k].isShielded) dmg *= 0.35
mob[k].damage(dmg, true);
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
game.drawList.push({

View File

@@ -306,20 +306,6 @@ const mobs = {
}
}
},
seePlayerByDistAndLOS() {
if (!(game.cycle % this.seePlayerFreq)) {
if (
this.distanceToPlayer2() < this.seeAtDistance2 &&
Matter.Query.ray(map, this.position, this.mechPosRange()).length === 0 &&
Matter.Query.ray(body, this.position, this.mechPosRange()).length === 0 &&
!mech.isStealth
) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
this.lostPlayer();
}
}
},
isLookingAtPlayer(threshold) {
const diff = Vector.normalise(Vector.sub(player.position, this.position));
//make a vector for the mob's direction of length 1

View File

@@ -268,14 +268,14 @@ const mod = {
},
{
name: "electrostatic discharge",
description: "increase <strong class='color-d'>damage</strong> by <strong>25%</strong><br><strong>25%</strong> increased <strong>delay</strong> after firing",
description: "increase <strong class='color-d'>damage</strong> by <strong>20%</strong><br><strong>20%</strong> increased <strong>delay</strong> after firing",
maxCount: 1,
count: 0,
allowed() {
return true
},
effect() {
mod.slowFire = 1.25
mod.slowFire = 1.2
b.setFireCD();
},
remove() {
@@ -2124,7 +2124,7 @@ const mod = {
},
{
name: "plasma jet",
description: "increase <strong>plasma torch's</strong> range by <strong>33%</strong>",
description: "increase <strong>plasma torch's</strong> range by <strong>27%</strong>",
maxCount: 9,
count: 0,
allowed() {
@@ -2132,7 +2132,7 @@ const mod = {
},
requires: "plasma torch",
effect() {
mod.isPlasmaRange += 0.33;
mod.isPlasmaRange += 0.27;
},
remove() {
mod.isPlasmaRange = 1;
@@ -2174,7 +2174,7 @@ const mod = {
},
{
name: "annihilation",
description: "after <strong>touching</strong> mobs, they are <strong>annihilated</strong><br>drains <strong>20%</strong> of base <strong class='color-f'>energy</strong>",
description: "after <strong>touching</strong> mobs, they are <strong>annihilated</strong><br>drains <strong>33%</strong> of base <strong class='color-f'>energy</strong>",
maxCount: 1,
count: 0,
allowed() {
@@ -2214,7 +2214,7 @@ const mod = {
},
requires: "standing wave harmonics",
effect() {
mod.blockDmg += 0.5 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
mod.blockDmg += 0.35 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
},
remove() {
mod.blockDmg = 0;

View File

@@ -972,7 +972,7 @@ const mech = {
//draw electricity
const step = 40
ctx.beginPath();
for (let i = 0, len = 2 * mod.blockDmg; i < len; i++) {
for (let i = 0, len = 2.5 * mod.blockDmg; i < len; i++) {
let x = mech.pos.x - 20 * unit.x;
let y = mech.pos.y - 20 * unit.y;
ctx.moveTo(x, y);
@@ -1298,9 +1298,8 @@ const mech = {
},
{
name: "nano-scale manufacturing",
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong class='color-f'>energy</strong> regeneration is <strong>doubled</strong>",
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br>increase <strong class='color-f'>energy</strong> regeneration by <strong>100%</strong>",
effect: () => {
// mech.fieldRegen *= 2;
mech.hold = function () {
if (mech.energy > mech.maxEnergy - 0.02 && mech.fieldCDcycle < mech.cycle) {
if (mod.isSporeField) {
@@ -1483,7 +1482,7 @@ const mech = {
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed
mech.grabPowerUp();
mech.lookForPickUp();
const DRAIN = 0.0017
const DRAIN = 0.002
if (mech.energy > DRAIN) {
mech.energy -= DRAIN;
if (mech.energy < 0) {
@@ -1492,7 +1491,7 @@ const mech = {
}
//calculate laser collision
let best;
let range = mod.isPlasmaRange * (140 + (mech.crouch ? 400 : 300) * Math.sqrt(Math.random())) //+ 100 * Math.sin(mech.cycle * 0.3);
let range = mod.isPlasmaRange * (120 + (mech.crouch ? 400 : 300) * Math.sqrt(Math.random())) //+ 100 * Math.sin(mech.cycle * 0.3);
// const dir = mech.angle // + 0.04 * (Math.random() - 0.5)
const path = [{
x: mech.pos.x + 20 * Math.cos(mech.angle),

View File

@@ -488,7 +488,7 @@ const powerUps = {
}
},
addRerollToLevel() { //add a random power up to a location that has a mob, mostly used to give each level one randomly placed reroll
if (mob.length && Math.random() < 0.9) { // 80% chance
if (mob.length && Math.random() < 0.8) { // 80% chance
const index = Math.floor(Math.random() * mob.length)
powerUps.spawn(mob[index].position.x, mob[index].position.y, "reroll");
if (Math.random() < mod.bayesian) powerUps.spawn(mob[index].position.x, mob[index].position.y, "reroll");

View File

@@ -81,7 +81,8 @@ const spawn = {
}
}
},
randomLevelBoss(x, y, options = ["shooterBoss", "cellBossCulture", "bomberBoss", "spiderBoss", "launcherBoss", "laserTargetingBoss", "powerUpBoss"]) {
//"shooterBoss", "cellBossCulture", "bomberBoss", "spiderBoss", "launcherBoss", "laserTargetingBoss",
randomLevelBoss(x, y, options = ["powerUpBoss"]) {
// other bosses: suckerBoss, laserBoss, tetherBoss, snakeBoss //all need a particular level to work so they are not included
spawn[options[Math.floor(Math.random() * options.length)]](x, y)
},
@@ -108,7 +109,7 @@ const spawn = {
this.gravity();
this.checkStatus();
if (this.seePlayer.recall) {
this.seePlayerByDistAndLOS();
this.seePlayerCheck();
this.attraction();
//tether to other blocks
ctx.beginPath();
@@ -116,7 +117,7 @@ const spawn = {
if (mob[i].isGrouper && mob[i] != this && mob[i].dropPowerUp) { //don't tether to self, bullets, shields, ...
const distance2 = Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position))
if (distance2 < this.groupingRangeMax) {
if (!mob[i].seePlayer.recall) mob[i].seePlayerByDistAndLOS(); //wake up sleepy mobs
if (!mob[i].seePlayer.recall) mob[i].seePlayerCheck(); //wake up sleepy mobs
if (distance2 > this.groupingRangeMin) {
const angle = Math.atan2(mob[i].position.y - this.position.y, mob[i].position.x - this.position.x);
const forceMag = this.groupingStrength * mob[i].mass;
@@ -231,23 +232,28 @@ const spawn = {
mobs.spawn(x, y, vertices, radius, "transparent");
let me = mob[mob.length - 1];
me.isBoss = true;
me.frictionAir = 0.05
me.seeAtDistance2 = 600000;
me.accelMag = 0.0005 * game.accelScale;
if (map.length) me.searchTarget = map[Math.floor(Math.random() * (map.length - 1))].position; //required for search
Matter.Body.setDensity(me, 0.001); //normal is 0.001
me.frictionAir = 0.025
me.seeAtDistance2 = 9000000;
me.accelMag = 0.0006 * game.accelScale;
Matter.Body.setDensity(me, 0.002); //normal is 0.001
me.collisionFilter.mask = cat.bullet | cat.player
// me.memory = 480;
// me.seePlayerFreq = 40 + Math.floor(10 * Math.random())
me.memory = Infinity;
me.seePlayerFreq = 85 + Math.floor(10 * Math.random())
me.lockedOn = null;
if (vertices === 9) {
//on primary spawn
powerUps.spawnBossPowerUp(me.position.x, me.position.y)
powerUp[powerUp.length - 1].collisionFilter.mask = 0
me.powerUpInventory = [powerUp[powerUp.length - 1]];
powerUps.spawn(me.position.x, me.position.y, "heal");
powerUps.spawn(me.position.x, me.position.y, "ammo");
} else {
me.foundPlayer();
}
me.onDeath = function () {
this.leaveBody = false;
this.dropPowerUp = false;
if (vertices > 3) spawn.powerUpBoss(this.position.x, this.position.y, vertices - 1)
for (let i = 0; i < powerUp.length; i++) {
powerUp[i].collisionFilter.mask = cat.map | cat.powerUp
@@ -266,7 +272,7 @@ const spawn = {
})
}
this.seePlayerByLookingAt();
this.seePlayerCheckByDistance();
this.attraction();
this.checkStatus();
};

View File

@@ -1,27 +1,13 @@
removed eay to aim setting
the addition of gun selection make this setting less important
mod: bot upgrades - forked into 4 different mods for each bot
effect is increased to 100% improvement (up from 40%)
drones are more likely to pick up power ups
mod harvester: now also gives the drone immortality
new level boss: after it dies it returns with one less vertex
also it steals all your power ups (what!)
power up level boss: adjustments
************** TODO - n-gon **************
ghosters are always visible
ghoster mobs eat power ups and drop them on death
draw ghoster if it has a power up
or just always draw ghoster?
if no power ups on map go for player
level concept: several stationary platforms that are free to rotate, but with some air friction
give mobs more animal-like behaviors
like rain world
give mobs something to do when they don't see player
explore map
foam isFoamGrowOnDeath causes performance issues when too many mobs die fast
give mobs more animal-like behaviors like rain world
mobs play, look for food, explore
mobs some times aren't aggressive
when low on life or after taking a large hit
mobs can fight each other