f key is bound to fire
pausing time or being cloaked gives you 50% harm reduction from mob collisions no-cloning theorem duplication => down to 42%, but no longer removes 1% on bosses dazzler => drains 25%->10% energy, and it has a 15% bigger radius boson composite => only drains energy when you touch shields 'F' key lets you fire, and it can be rebound to other keys might be some bugs here, I didn't do much testing
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
<table id="control-table">
|
||||
<tr>
|
||||
<th>FIRE</th>
|
||||
<td></td>
|
||||
<td id='key-fire' class='key-input'>F</td>
|
||||
<td class='key-used'>MouseLeft</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
@@ -106,8 +106,9 @@ function collisionChecks(event) {
|
||||
// (obj === player) &&
|
||||
!(tech.isFreezeHarmImmune && (mob[k].isSlowed || mob[k].isStunned))
|
||||
) {
|
||||
mob[k].foundPlayer();
|
||||
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * simulation.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
|
||||
if (m.isBodiesAsleep || m.isCloak) dmg *= 0.5
|
||||
mob[k].foundPlayer();
|
||||
if (tech.isRewindAvoidDeath && m.energy > 0.66) { //CPT reversal runs in m.damage, but it stops the rest of the collision code here too
|
||||
m.damage(dmg);
|
||||
return
|
||||
|
||||
17
js/index.js
17
js/index.js
@@ -665,7 +665,7 @@ const input = {
|
||||
right: false,
|
||||
isPauseKeyReady: true,
|
||||
key: {
|
||||
// fire: "ShiftLeft",
|
||||
fire: "KeyF",
|
||||
field: "Space",
|
||||
up: "KeyW", // jump
|
||||
down: "KeyS", // crouch
|
||||
@@ -678,7 +678,7 @@ const input = {
|
||||
},
|
||||
setDefault() {
|
||||
input.key = {
|
||||
// fire: "ShiftLeft",
|
||||
fire: "KeyF",
|
||||
field: "Space",
|
||||
up: "KeyW", // jump
|
||||
down: "KeyS", // crouch
|
||||
@@ -695,6 +695,7 @@ const input = {
|
||||
function cleanText(text) {
|
||||
return text.replace('Key', '').replace('Digit', '')
|
||||
}
|
||||
document.getElementById("key-fire").innerHTML = cleanText(input.key.fire)
|
||||
document.getElementById("key-field").innerHTML = cleanText(input.key.field)
|
||||
document.getElementById("key-up").innerHTML = cleanText(input.key.up)
|
||||
document.getElementById("key-down").innerHTML = cleanText(input.key.down)
|
||||
@@ -718,6 +719,7 @@ const input = {
|
||||
focus: null,
|
||||
setTextFocus() {
|
||||
const backgroundColor = "#fff"
|
||||
document.getElementById("key-fire").style.background = backgroundColor
|
||||
document.getElementById("key-field").style.background = backgroundColor
|
||||
document.getElementById("key-up").style.background = backgroundColor
|
||||
document.getElementById("key-down").style.background = backgroundColor
|
||||
@@ -736,6 +738,7 @@ const input = {
|
||||
event.code === "ArrowLeft" ||
|
||||
event.code === "ArrowUp" ||
|
||||
event.code === "ArrowDown" ||
|
||||
event.code === input.key.fire ||
|
||||
event.code === input.key.field ||
|
||||
event.code === input.key.up ||
|
||||
event.code === input.key.down ||
|
||||
@@ -747,6 +750,9 @@ const input = {
|
||||
event.code === input.key.testing
|
||||
)) {
|
||||
switch (input.focus.id) {
|
||||
case "key-fire":
|
||||
input.key.fire = event.code
|
||||
break;
|
||||
case "key-field":
|
||||
input.key.field = event.code
|
||||
break;
|
||||
@@ -818,6 +824,9 @@ window.addEventListener("keyup", function(event) {
|
||||
case "ArrowDown":
|
||||
input.down = false
|
||||
break;
|
||||
case input.key.fire:
|
||||
input.fire = false
|
||||
break
|
||||
case input.key.field:
|
||||
input.field = false
|
||||
break
|
||||
@@ -842,6 +851,10 @@ window.addEventListener("keydown", function(event) {
|
||||
case "ArrowDown":
|
||||
input.down = true
|
||||
break;
|
||||
case input.key.fire:
|
||||
// event.preventDefault();
|
||||
input.fire = true
|
||||
break
|
||||
case input.key.field:
|
||||
event.preventDefault();
|
||||
input.field = true
|
||||
|
||||
@@ -1168,7 +1168,7 @@ const mobs = {
|
||||
m.setMaxHealth();
|
||||
}
|
||||
}
|
||||
if (tech.cloakDuplication) {
|
||||
if (tech.cloakDuplication && !this.isBoss) {
|
||||
tech.cloakDuplication -= 0.01
|
||||
powerUps.setDupChance(); //needed after adjusting duplication chance
|
||||
}
|
||||
|
||||
36
js/player.js
36
js/player.js
@@ -2027,7 +2027,7 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "time dilation",
|
||||
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 1px;'>stop time</strong><br><strong>move</strong> and <strong>fire</strong> while time is stopped<br>mobs still do <strong class='color-harm'>harm</strong> while time is stopped",
|
||||
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 1px;'>stop time</strong><br><strong>move</strong> and <strong>fire</strong> while time is stopped<br>mobs do <strong>50%</strong> <strong class='color-harm'>harm</strong> while time is stopped",
|
||||
effect: () => {
|
||||
// m.fieldMeterColor = "#000"
|
||||
m.fieldFire = true;
|
||||
@@ -2108,7 +2108,7 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "metamaterial cloaking", //"weak photonic coupling" "electromagnetically induced transparency" "optical non-coupling" "slow light field" "electro-optic transparency"
|
||||
description: "when not firing activate a <strong class='color-cloaked'>cloaking</strong> effect<br>if a mob has <strong>not died</strong> in the last <strong>3 seconds</strong><br>increase <strong class='color-d'>damage</strong> by <strong>300%</strong>",
|
||||
description: "when not firing activate a <strong class='color-cloaked'>cloaking</strong> effect<br><strong>+333%</strong> <strong class='color-d'>damage</strong> if a mob hasn't recently <strong>died</strong><br>mobs do <strong>50%</strong> <strong class='color-harm'>harm</strong> while you're <strong class='color-cloaked'>cloaked</strong>",
|
||||
effect: () => {
|
||||
m.fieldFire = true;
|
||||
m.fieldMeterColor = "#333";
|
||||
@@ -2156,30 +2156,26 @@ const m = {
|
||||
}
|
||||
if (tech.isCloakStun) { //stun nearby mobs after exiting cloak
|
||||
let isMobsAround = false
|
||||
const stunRange = m.fieldDrawRadius * 1.3
|
||||
const drain = 0.25 * m.energy
|
||||
const stunRange = m.fieldDrawRadius * 1.4
|
||||
const drain = 0.1
|
||||
const stunTime = 180
|
||||
if (m.energy > drain) {
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
if (
|
||||
Vector.magnitude(Vector.sub(mob[i].position, m.pos)) < stunRange &&
|
||||
Matter.Query.ray(map, mob[i].position, m.pos).length === 0
|
||||
) {
|
||||
if (Vector.magnitude(Vector.sub(mob[i].position, m.pos)) < stunRange && Matter.Query.ray(map, mob[i].position, m.pos).length === 0) {
|
||||
isMobsAround = true
|
||||
mobs.statusStun(mob[i], 120 + drain * 360)
|
||||
mobs.statusStun(mob[i], stunTime)
|
||||
}
|
||||
}
|
||||
if (isMobsAround && m.energy > drain) {
|
||||
if (isMobsAround) {
|
||||
m.energy -= drain
|
||||
simulation.drawList.push({
|
||||
x: m.pos.x,
|
||||
y: m.pos.y,
|
||||
radius: stunRange,
|
||||
color: "hsla(0,50%,100%,0.6)",
|
||||
time: 4
|
||||
color: "hsla(0,50%,100%,0.8)",
|
||||
time: 7
|
||||
});
|
||||
// ctx.beginPath();
|
||||
// ctx.arc(m.pos.x, m.pos.y, 800, 0, 2 * Math.PI);
|
||||
// ctx.fillStyle = "#000"
|
||||
// ctx.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2217,13 +2213,7 @@ const m = {
|
||||
let inPlayer = Matter.Query.region(mob, player.bounds)
|
||||
if (inPlayer.length > 0) {
|
||||
for (let i = 0; i < inPlayer.length; i++) {
|
||||
if (m.energy > 0) {
|
||||
if (inPlayer[i].shield) { //shields drain player energy
|
||||
m.energy -= 0.012;
|
||||
} else {
|
||||
m.energy -= 0.005;
|
||||
}
|
||||
}
|
||||
if (m.energy > 0 && inPlayer[i].shield) m.energy -= 0.012;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
10
js/tech.js
10
js/tech.js
@@ -6042,18 +6042,18 @@
|
||||
},
|
||||
{
|
||||
name: "no-cloning theorem",
|
||||
description: `<strong>50%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br>after a <strong>mob</strong> <strong>dies</strong>, lose <strong>1%</strong> <strong class='color-dup'>duplication</strong> chance`,
|
||||
description: `<strong>42%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br>after a <strong>mob</strong> <strong>dies</strong>, lose <strong>1%</strong> <strong class='color-dup'>duplication</strong> chance`,
|
||||
isFieldTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
frequency: 2,
|
||||
frequencyDefault: 2,
|
||||
allowed() {
|
||||
return (m.fieldUpgrades[m.fieldMode].name === "wormhole" || m.fieldUpgrades[m.fieldMode].name === "time dilation" || m.fieldUpgrades[m.fieldMode].name === "metamaterial cloaking") && tech.duplicationChance() < 1
|
||||
return (m.fieldUpgrades[m.fieldMode].name === "time dilation" || m.fieldUpgrades[m.fieldMode].name === "metamaterial cloaking") && tech.duplicationChance() < 1 //m.fieldUpgrades[m.fieldMode].name === "wormhole" ||
|
||||
},
|
||||
requires: "cloaking, wormhole or time dilation and below 100% duplication chance",
|
||||
effect() {
|
||||
tech.cloakDuplication = 0.5
|
||||
tech.cloakDuplication = 0.42
|
||||
powerUps.setDupChance(); //needed after adjusting duplication chance
|
||||
|
||||
},
|
||||
@@ -6127,7 +6127,7 @@
|
||||
// },
|
||||
{
|
||||
name: "boson composite",
|
||||
description: "<strong>intangible</strong> to <strong class='color-block'>blocks</strong> and mobs while <strong class='color-cloaked'>cloaked</strong><br>passing through <strong>mobs</strong> drains your <strong class='color-f'>energy</strong>",
|
||||
description: "<strong>intangible</strong> to <strong class='color-block'>blocks</strong> and mobs while <strong class='color-cloaked'>cloaked</strong><br>passing through <strong>shields</strong> drains your <strong class='color-f'>energy</strong>",
|
||||
isFieldTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
@@ -6149,7 +6149,7 @@
|
||||
},
|
||||
{
|
||||
name: "dazzler",
|
||||
description: "<strong class='color-cloaked'>decloaking</strong> <strong>stuns</strong> nearby mobs<br>drains <strong>25%</strong> of your stored <strong class='color-f'>energy</strong>",
|
||||
description: "<strong class='color-cloaked'>decloaking</strong> <strong>stuns</strong> nearby mobs<br>and drains 10 <strong class='color-f'>energy</strong>",
|
||||
isFieldTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
|
||||
15
todo.txt
15
todo.txt
@@ -1,11 +1,20 @@
|
||||
******************************************************** NEXT PATCH **************************************************
|
||||
|
||||
metamaterial cloaking field 300% -> 333% damage
|
||||
no-cloning theorem 43% -> 50% duplication
|
||||
symbiosis lose 2% -> 1% max health
|
||||
pausing time or being cloaked gives you 50% harm reduction from mob collisions
|
||||
|
||||
no-cloning theorem duplication => down to 42%, but no longer removes 1% on bosses
|
||||
dazzler => drains 25%->10% energy, and it has a 15% bigger radius
|
||||
boson composite => only drains energy when you touch shields
|
||||
|
||||
'F' key lets you fire, and it can be rebound to other keys
|
||||
might be some bugs here, I didn't do much testing
|
||||
|
||||
|
||||
******************************************************** TODO ********************************************************
|
||||
|
||||
how to make only killing mobs more viable:
|
||||
reduce damage from mobs that are asleep or unaware of the player when you touch them?
|
||||
|
||||
JUNK tech: planetesimals game inside n-gon
|
||||
https://codepen.io/lilgreenland/pen/jrMvaB?editors=0010
|
||||
|
||||
|
||||
Reference in New Issue
Block a user