in game music

mob effect: freeze - now only slows mobs down
  all freeze effects are about 50% longer

junk tech: music - adds background music to n-gon
junk tech: performance - adds fps tracker to n-gon

tech: dormancy - if a mob has died in the last 5 seconds increase damage by 50% else decrease damage by 50%
tech: torpor   - if a mob has died in the last 5 seconds reduce harm by 66% else increase harm by 33%
This commit is contained in:
landgreen
2021-02-19 06:13:33 -08:00
parent 7e963881f6
commit c085b30af4
10 changed files with 157 additions and 61 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1732,7 +1732,7 @@ const b = {
},
beforeDmg(who) {
this.endCycle = 0; //bullet ends cycle after doing damage
if (this.isFreeze) mobs.statusSlow(who, 60)
if (this.isFreeze) mobs.statusSlow(who, 90)
},
onEnd() {
if (tech.isMutualism && this.isMutualismActive && !tech.isEnergyHealth) {
@@ -1845,7 +1845,7 @@ const b = {
lockedOn: null,
isFollowMouse: true,
beforeDmg(who) {
mobs.statusSlow(who, 120)
mobs.statusSlow(who, 180)
this.endCycle = simulation.cycle
// if (tech.isHeavyWater) mobs.statusDoT(who, 0.15, 300)
if (tech.iceEnergy && !who.shield && !who.isShielded && who.dropPowerUp && who.alive) {
@@ -2549,10 +2549,10 @@ const b = {
restitution: 0.5 * (1 + 0.5 * Math.random()),
dmg: 0, // 0.14 //damage done in addition to the damage from momentum
minDmgSpeed: 2,
lookFrequency: 40 + Math.floor(7 * Math.random()),
lookFrequency: 40 + Math.floor(7 * Math.random()) - 10 * tech.isLaserBotUpgrade,
drainThreshold: tech.isEnergyHealth ? 0.6 : 0.4,
acceleration: 0.0015 * (1 + 0.3 * Math.random()),
range: 700 * (1 + 0.1 * Math.random()) + 300 * tech.isLaserBotUpgrade,
range: 700 * (1 + 0.1 * Math.random()) + 500 * tech.isLaserBotUpgrade,
playerRange: 150 + Math.floor(30 * Math.random()),
offPlayer: {
x: 0,
@@ -3155,7 +3155,7 @@ const b = {
}, dmg) //position, velocity, damage
if (tech.isIceCrystals) {
bullet[bullet.length - 1].beforeDmg = function(who) {
mobs.statusSlow(who, 30)
mobs.statusSlow(who, 60)
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 150 + 30 * Math.random()); //makes bullet do explosive damage at end
}

View File

@@ -754,9 +754,7 @@ window.addEventListener("keydown", function(event) {
simulation.testing = false;
simulation.loop = simulation.normalLoop
if (simulation.isConstructionMode) document.getElementById("construct").style.display = 'none'
// document.getElementById("text-log").innerHTML = ""
simulation.lastLogTime = 0 //clear text log
// simulation.makeTextLog(`<em>exiting testing mode</em>`);
simulation.makeTextLog("", 0);
} else { //if (keys[191])
simulation.testing = true;
simulation.loop = simulation.testingLoop

View File

@@ -63,7 +63,6 @@ const mobs = {
function applySlow() {
if (!who.shield && !who.isShielded && !m.isBodiesAsleep) {
if (who.isBoss) cycles = Math.floor(cycles * 0.25)
let i = who.status.length
while (i--) {
if (who.status[i].type === "slow") who.status.splice(i, 1); //remove other "slow" effects on this mob
@@ -71,9 +70,11 @@ const mobs = {
who.isSlowed = true;
who.status.push({
effect() {
const speedCap = 3
const drag = 0.95
Matter.Body.setVelocity(who, {
x: 0,
y: 0
x: Math.min(speedCap, who.velocity.x) * drag,
y: Math.min(speedCap, who.velocity.y) * drag
});
Matter.Body.setAngularVelocity(who, 0);
ctx.beginPath();

View File

@@ -473,8 +473,11 @@ const m = {
harmReduction() {
let dmg = 1
dmg *= m.fieldHarmReduction
if (tech.isBlockHarm && m.isHolding) dmg *= 0.2
if (tech.isHarmReduceAfterKill) dmg *= (m.lastKillCycle + 300 > m.cycle) ? 0.33 : 1.33
if (tech.healthDrain) dmg *= 1 + 2.667 * tech.healthDrain //tech.healthDrain = 0.03 at one stack //cause more damage
if (tech.squirrelFx !== 1) dmg *= 1 + (tech.squirrelFx - 1) / 5 //cause more damage
if (tech.isBlockHarm && m.isHolding) dmg *= 0.2
if (tech.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55)
if (tech.isSlowFPS) dmg *= 0.8
if (tech.isPiezo) dmg *= 0.85
@@ -688,7 +691,7 @@ const m = {
m.defaultFPSCycle = m.cycle + 20 + Math.min(90, Math.floor(200 * dmg))
if (tech.isHarmFreeze) { //freeze all mobs
for (let i = 0, len = mob.length; i < len; i++) {
mobs.statusSlow(mob[i], 300)
mobs.statusSlow(mob[i], 450)
}
}
} else {
@@ -1311,7 +1314,7 @@ const m = {
if (tech.isFreezeMobs) {
for (let i = 0, len = mob.length; i < len; ++i) {
Matter.Sleeping.set(mob[i], false)
mobs.statusSlow(mob[i], 60)
mobs.statusSlow(mob[i], 90)
}
} else {
wake(mob);
@@ -1346,7 +1349,7 @@ const m = {
},
fieldUpgrades: [{
name: "field emitter",
description: "use <strong class='color-f'>energy</strong> to <strong>block</strong> mobs,<br><strong>grab</strong> power ups, and <strong>throw</strong> blocks",
description: "use <strong class='color-f'>energy</strong> to <strong>block</strong> mobs,<br><strong>grab</strong> power ups, and <strong>throw</strong> blocks<br>regen <strong>6</strong> <strong class='color-f'>energy</strong> per second",
effect: () => {
m.hold = function() {
if (m.isHolding) {
@@ -1620,7 +1623,7 @@ const m = {
if (m.energy > ICE_DRAIN * 2) {
m.energy -= ICE_DRAIN;
this.fieldDrawRadius -= 2;
mobs.statusSlow(mob[i], 45)
mobs.statusSlow(mob[i], 60)
} else {
break;
}
@@ -2187,7 +2190,7 @@ const m = {
if (tech.isFreezeMobs) {
for (let i = 0, len = mob.length; i < len; ++i) {
if (Vector.magnitude(Vector.sub(mob[i].position, m.fieldPosition)) < m.fieldRadius) {
mobs.statusSlow(mob[i], 120)
mobs.statusSlow(mob[i], 180)
}
}
}
@@ -2571,7 +2574,7 @@ const m = {
if (!mob[i].freeOfWires) mob[i].freeOfWires = true
}
m.isShipMode = true
simulation.isCheating = true
// simulation.isCheating = true
const points = [
{ x: 29.979168754143455, y: 4.748337243898336 },
{ x: 27.04503734408824, y: 13.7801138209198 },
@@ -2604,7 +2607,7 @@ const m = {
// Matter.Body.setDensity(player, 0.01); //extra dense //normal is 0.001 //makes effective life much larger
m.defaultMass = 30
Matter.Body.setMass(player, m.defaultMass);
player.friction = 0.05
player.friction = 0.01
player.restitution = 0.2
// player.frictionStatic = 0.1
// Matter.Body.setInertia(player, Infinity); //disable rotation

View File

@@ -262,7 +262,7 @@ const simulation = {
}
},
lastLogTime: 0,
lastLogTimeBig: 0,
// lastLogTimeBig: 0,
boldActiveGunHUD() {
if (b.inventory.length > 0) {
for (let i = 0, len = b.inventory.length; i < len; ++i) document.getElementById(b.inventory[i]).style.opacity = "0.3";

View File

@@ -50,33 +50,33 @@ const spawn = {
randomGroup(x, y, chance = 1) {
if (spawn.spawnChance(chance) && simulation.difficulty > 2 || chance == Infinity) {
//choose from the possible picklist
let pick = this.pickList[Math.floor(Math.random() * this.pickList.length)];
let pick = spawn.pickList[Math.floor(Math.random() * spawn.pickList.length)];
//is the pick able to be a group?
let canBeGroup = false;
for (let i = 0, len = this.allowedGroupList.length; i < len; ++i) {
if (this.allowedGroupList[i] === pick) {
for (let i = 0, len = spawn.allowedGroupList.length; i < len; ++i) {
if (spawn.allowedGroupList[i] === pick) {
canBeGroup = true;
break;
}
}
if (canBeGroup) {
if (Math.random() < 0.55) {
this.nodeGroup(x, y, pick);
spawn.nodeGroup(x, y, pick);
} else {
this.lineGroup(x, y, pick);
spawn.lineGroup(x, y, pick);
}
} else {
if (Math.random() < 0.07) {
this[pick](x, y, 90 + Math.random() * 40); //one extra large mob
spawn.spawnOrbitals(mob[mob.length - 1], radius + 50 + 200 * Math.random(), 1)
spawn[pick](x, y, 90 + Math.random() * 40); //one extra large mob
spawn.spawnOrbitals(mob[mob.length - 1], mob[mob.length - 1].radius + 50 + 200 * Math.random(), 1)
} else if (Math.random() < 0.35) {
this.blockGroup(x, y) //hidden grouping blocks
spawn.blockGroup(x, y) //hidden grouping blocks
} else {
pick = (Math.random() < 0.5) ? "randomList" : "random";
if (Math.random() < 0.55) {
this.nodeGroup(x, y, pick);
spawn.nodeGroup(x, y, pick);
} else {
this.lineGroup(x, y, pick);
spawn.lineGroup(x, y, pick);
}
}
}
@@ -1355,7 +1355,7 @@ const spawn = {
me.isBoss = true;
me.vertices = Matter.Vertices.rotate(me.vertices, Math.PI, me.position); //make the pointy side of triangle the front
Matter.Body.rotate(me, Math.random() * Math.PI * 2);
me.accelMag = 0.0002 * Math.sqrt(simulation.accelScale);
me.accelMag = 0.00022 * Math.sqrt(simulation.accelScale);
me.seePlayerFreq = Math.floor(30 * simulation.lookFreqScale);
me.memory = 420;
me.restitution = 1;
@@ -1371,7 +1371,7 @@ const spawn = {
}
Matter.Body.setDensity(me, 0.023); //extra dense //normal is 0.001 //makes effective life much larger
spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 100 + 100 * Math.random())
spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random())
me.onHit = function() {
//run this function on hitting player
// this.explode();

View File

@@ -109,6 +109,7 @@
},
damageFromTech() {
let dmg = m.fieldDamage
if (tech.isDamageAfterKill) dmg *= (m.lastKillCycle + 300 > m.cycle) ? 1.5 : 0.5
if (tech.isTechDamage) dmg *= 2
if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance())
if (tech.isLowEnergyDamage) dmg *= 1 + Math.max(0, 1 - m.energy) * 0.5
@@ -433,7 +434,7 @@
},
{
name: "squirrel-cage rotor",
description: "<strong>move</strong> and <strong>jump</strong> about <strong>30%</strong> faster<br>but you take <strong>5%</strong> more <strong class='color-harm'>harm</strong>",
description: "<strong>move</strong> and <strong>jump</strong> about <strong>30%</strong> faster<br>take <strong>5%</strong> more <strong class='color-harm'>harm</strong>",
maxCount: 9,
count: 0,
allowed() {
@@ -1181,7 +1182,7 @@
},
{
name: "complex spin-statistics",
description: `become <strong>immune</strong> to <strong class='color-harm'>harm</strong> for <strong>+1</strong> second<br>once every <strong>7</strong> seconds`,
description: `become <strong>immune</strong> to <strong class='color-harm'>harm</strong> for <strong>1</strong> second<br>once every <strong>7</strong> seconds`,
maxCount: 3,
count: 0,
allowed() {
@@ -1248,7 +1249,7 @@
},
{
name: "liquid cooling",
description: `<strong class='color-s'>freeze</strong> all mobs for <strong>5</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong>`,
description: `<strong class='color-s'>freeze</strong> all mobs for <strong>7</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong>`,
maxCount: 1,
count: 0,
allowed() {
@@ -1569,9 +1570,9 @@
maxCount: 1,
count: 0,
allowed() {
return m.maxEnergy > 0.99
return m.maxEnergy > 0.99 && !tech.isHealthRecovery
},
requires: "max energy >= 1",
requires: "max energy >= 1, not scrap recycling",
effect() {
tech.isEnergyRecovery = true;
},
@@ -1585,9 +1586,9 @@
maxCount: 1,
count: 0,
allowed() {
return !tech.isEnergyHealth
return !tech.isEnergyHealth && !tech.isEnergyRecovery
},
requires: "not mass-energy equivalence",
requires: "not mass-energy equivalence, waste energy recovery",
effect() {
tech.isHealthRecovery = true;
},
@@ -1595,6 +1596,38 @@
tech.isHealthRecovery = false;
}
},
{
name: "dormancy",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br><span style = 'font-size:93%;'>increase <strong class='color-d'>damage</strong> by <strong>50%</strong> else decrease it by <strong>50%</strong></span>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
tech.isDamageAfterKill = true;
},
remove() {
tech.isDamageAfterKill = false;
}
},
{
name: "torpor",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>66%</strong> else increase it by <strong>50%</strong>",
maxCount: 1,
count: 0,
allowed() {
return tech.isDamageAfterKill
},
requires: "dormancy",
effect() {
tech.isHarmReduceAfterKill = true;
},
remove() {
tech.isHarmReduceAfterKill = false;
}
},
{
name: "negative feedback",
description: "increase <strong class='color-d'>damage</strong> by <strong>6%</strong><br>for every <strong>10</strong> <strong class='color-h'>health</strong> below <strong>100</strong>",
@@ -1628,7 +1661,7 @@
},
{
name: "entropy exchange",
description: "<strong class='color-h'>heal</strong> for <strong>1%</strong> of <strong class='color-d'>damage</strong> done",
description: "<strong class='color-h'>heal</strong> for <strong>3%</strong> of <strong class='color-d'>damage</strong> done<br>take <strong>8%</strong> more <strong class='color-harm'>harm</strong>",
maxCount: 9,
count: 0,
allowed() {
@@ -1636,7 +1669,7 @@
},
requires: "some increased damage, not mass-energy equivalence",
effect() {
tech.healthDrain += 0.01;
tech.healthDrain += 0.03;
},
remove() {
tech.healthDrain = 0;
@@ -3090,7 +3123,7 @@
},
{
name: "cryodesiccation",
description: "<strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> release <strong>2</strong> more <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> <strong class='color-s'>freeze</strong> mobs for <strong>1</strong> second",
description: "<strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> release <strong>2</strong> more <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> <strong class='color-s'>freeze</strong> mobs for <strong>1.5</strong> second",
// <br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> do <strong>1/3</strong> <strong class='color-d'>damage</strong>
isGunTech: true,
maxCount: 1,
@@ -3743,7 +3776,7 @@
tech.giveTech("dynamo-bot upgrade")
tech.setTechoNonRefundable("dynamo-bot upgrade")
for (let i = 0; i < 2; i++) {
b.orbitBot()
b.dynamoBot()
tech.dynamoBotCount++;
}
simulation.makeTextLog(`tech.isDynamoBotUpgrade = true`)
@@ -3753,7 +3786,7 @@
tech.giveTech("dynamo-bot upgrade")
tech.setTechoNonRefundable("dynamo-bot upgrade")
for (let i = 0; i < 2; i++) {
b.orbitBot()
b.dynamoBot()
tech.dynamoBotCount++;
}
simulation.makeTextLog(`tech.isDynamoBotUpgrade = true`)
@@ -4291,7 +4324,58 @@
// remove() {}
// },
{
name: "banish",
name: "music",
description: "add music to n-gon",
maxCount: 1,
count: 0,
numberInPool: 0,
isNonRefundable: true,
isExperimentHide: true,
isJunk: true,
allowed() {
return true
},
requires: "",
effect() {
window.open('https://www.youtube.com/results?search_query=music', '_blank')
},
remove() {}
},
{
name: "performance",
description: "display performance stats to n-gon",
maxCount: 1,
count: 0,
numberInPool: 0,
isNonRefundable: true,
isExperimentHide: true,
isJunk: true,
allowed() {
return true
},
requires: "",
effect() {
(function() {
var script = document.createElement('script');
script.onload = function() {
var stats = new Stats();
document.body.appendChild(stats.dom);
requestAnimationFrame(function loop() {
stats.update();
requestAnimationFrame(loop)
});
};
script.src = 'https://unpkg.com/stats.js@0.17.0/build/stats.min.js';
document.head.appendChild(script);
})()
//move health to the right
document.getElementById("health").style.left = "86px"
document.getElementById("health-bg").style.left = "86px"
},
remove() {}
},
{
name: "defragment",
description: "<strong>erase</strong> all junk <strong class='color-m'>tech</strong> from the possible pool<br><em>probably...</em>",
maxCount: 1,
count: 0,
@@ -4496,7 +4580,7 @@
},
{
name: "energy investment",
description: "every 10 seconds drain your <strong class='color-f'>energy</strong> and return it doubled 10 seconds later<br>lasts 180 seconds",
description: "every 10 seconds drain your <strong class='color-f'>energy</strong><br>return it doubled 10 seconds later<br>lasts 180 seconds",
maxCount: 9,
count: 0,
numberInPool: 0,
@@ -4931,7 +5015,7 @@
},
{
name: "quantum black hole",
description: "use all your <strong class='color-f'>energy</strong> to <strong>spawn</strong> inside the event horizon of a huge <strong>black hole</strong>",
description: "use all your <strong class='color-f'>energy</strong> to<br><strong>spawn</strong> inside the event horizon of a huge <strong>black hole</strong>",
maxCount: 9,
count: 0,
numberInPool: 0,
@@ -5175,5 +5259,7 @@
isBlockHarm: null,
foamFutureFire: null,
isBotSwap: null,
botSwapCycleIndex: null
botSwapCycleIndex: null,
isDamageAfterKill: null,
isHarmReduceAfterKill: null
}

View File

@@ -650,8 +650,8 @@ summary {
}
.junk {
background: hsl(254, 59%, 74%);
border-radius: 35%;
background: hsl(254, 44%, 75%);
border-radius: 25%;
/* animation: 3s linear infinite alternate pulse; */
}

View File

@@ -1,12 +1,13 @@
******************************************************** NEXT PATCH ********************************************************
ship mode can be found in the experimental menu
mob effect: freeze - now only slows mobs down
all freeze effects are about 50% longer
some mobs now have orbitals at random
new level boss: orbitalBoss
junk tech: music - adds background music to n-gon
junk tech: performance - adds fps tracker to n-gon
most late game bot tech has been buffed
tech: get 2 random bots, also when you switch guns cycle all bots to the same type
tech: dormancy - if a mob has died in the last 5 seconds increase damage by 50% else decrease damage by 50%
tech: torpor - if a mob has died in the last 5 seconds reduce harm by 66% else increase harm by 33%
******************************************************** BUGS ********************************************************
@@ -36,7 +37,19 @@ use the floor of portal sensor on the player? to unstuck player
******************************************************** TODO ********************************************************
add a shipMode tech that only shows up in experimental mode
decrease healing effects by 50%
decrease level scaling healing reduction
net effect: healing at difficulty 40 (level 10 hard) should be 25% higher then current levels
bosses should have 2x health, but only do about 50 health damage
options:
cap all damage at 50 health
this makes high health/energy/harm reduction build much better
make boss flag cut damage done to player by 10x
boss flag cut damage done to boss by 20x <----
make bosses not have extra density
tech: spawn a bot after taking collision damage
@@ -72,7 +85,6 @@ copy time-like foam to other guns?
shotgun
nail gun
lore: a tutorial / lore intro
needs to be optional so it doesn't slow experienced players
put something on the intro map
@@ -358,10 +370,6 @@ n-gon outreach ideas
hacker news - show hacker news post
paste this into console to see fps
javascript:(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//mrdoob.github.io/stats.js/build/stats.min.js';document.head.appendChild(script);})()
******************************************************** LORE ********************************************************
cool names for tech