From 76105ea77f0d5abdf9921bbf4b7e55321720f389 Mon Sep 17 00:00:00 2001 From: landgreen Date: Thu, 5 Mar 2020 18:01:13 -0800 Subject: [PATCH] added graphics to phase field and mod --- js/index.js | 1 - js/level.js | 4 ++-- js/player.js | 24 +++++++++++++++++++++++- todo.txt | 6 ++++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/js/index.js b/js/index.js index 0c6926f..5fa056b 100644 --- a/js/index.js +++ b/js/index.js @@ -241,7 +241,6 @@ document.getElementById("build-button").addEventListener("click", () => { //setu let localSettings = JSON.parse(localStorage.getItem("localSettings")); // console.log(localSettings) if (localSettings) { - console.log('exist') game.isBodyDamage = localSettings.isBodyDamage document.getElementById("body-damage").checked = localSettings.isBodyDamage diff --git a/js/level.js b/js/level.js index e33a64f..382353e 100644 --- a/js/level.js +++ b/js/level.js @@ -15,8 +15,8 @@ const level = { if (level.levelsCleared === 0) { // level.difficultyIncrease(9) // b.giveGuns("wave beam") - // mech.setField("phase decoherence field") - // b.giveMod("wave phase velocity"); + mech.setField("phase decoherence field") + b.giveMod("quantum dissipation"); // b.giveMod("reflective cavity"); level.intro(); //starting level diff --git a/js/player.js b/js/player.js index 4e04596..12203bc 100644 --- a/js/player.js +++ b/js/player.js @@ -1615,9 +1615,31 @@ const mech = { for (let i = 0; i < inPlayer.length; i++) { if (inPlayer[i].shield) { mech.energy -= 0.01; //shields drain player energy + //draw outline of shield + ctx.fillStyle = `rgba(0, 204, 255,0.6)` + ctx.fill() } else if (b.isModPhaseFieldDamage && mech.energy > 0.006 && inPlayer[i].dropPowerUp && !inPlayer[i].isShielded) { - inPlayer[i].damage(0.2 * b.dmgScale); //damage mobs inside the player + inPlayer[i].damage(0.4 * b.dmgScale); //damage mobs inside the player mech.energy -= 0.002; + + //draw outline of mob in a few random locations to show blurriness + const vertices = inPlayer[i].vertices; + const off = 30 + for (let k = 0; k < 3; k++) { + const xOff = off * (Math.random() - 0.5) + const yOff = off * (Math.random() - 0.5) + ctx.beginPath(); + ctx.moveTo(xOff + vertices[0].x, yOff + vertices[0].y); + for (let j = 1, len = vertices.length; j < len; ++j) { + ctx.lineTo(xOff + vertices[j].x, yOff + vertices[j].y); + } + ctx.lineTo(xOff + vertices[0].x, yOff + vertices[0].y); + // ctx.strokeStyle = "#000" + // ctx.lineWidth = 1 + // ctx.stroke() + ctx.fillStyle = "rgba(0,0,0,0.3)" + ctx.fill() + } break; } } diff --git a/todo.txt b/todo.txt index ab6b7ee..affafd8 100644 --- a/todo.txt +++ b/todo.txt @@ -2,8 +2,10 @@ mod - vacuum bomb pulls shields off the mob or just greatly damages shields during the suck phase if the pulling doesn't work +mod - vacuum bomb stuns after the explosion + maybe it also does DoT damage -mod - blocking with nano-scale is more efficient +mod - blocking with nano-scale is more efficient, like perfect diamagnetism mod - time dilation - Quantum Recovery Expending all your energy while using the field will @@ -26,7 +28,7 @@ mobs - add in a function to the main loops that does injected code for each mob stun - blind, slow, but increased gravity effects mod - flechettes mod for DoT poison damage mod - grenade explosions stun enemies - + mod - give crystal minigun a slowing effect and rename it ice crystals mod - get your next recursive mod 3 times are players aware of what a recursive mod is?