added new mods, discord link

This commit is contained in:
landgreen
2019-11-17 17:48:18 -08:00
parent d9def3fb07
commit 7f234bc43b
11 changed files with 237 additions and 123 deletions

View File

@@ -113,6 +113,22 @@
</tr> -->
</table>
<br>
<br>
<a href="https://discord.gg/2eC9pgJ">
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 235">
<style>
.st0 {
fill: #1B1F23;
}
</style>
<path class="st0" d="M142.8 120.1c-5.7 0-10.2 4.9-10.2 11s4.6 11 10.2 11c5.7 0 10.2-4.9 10.2-11s-4.6-11-10.2-11zM106.3 120.1c-5.7 0-10.2 4.9-10.2 11s4.6 11 10.2 11c5.7 0 10.2-4.9 10.2-11 .1-6.1-4.5-11-10.2-11z" />
<path class="st0" d="M191.4 36.9h-134c-11.3 0-20.5 9.2-20.5 20.5v134c0 11.3 9.2 20.5 20.5 20.5h113.4l-5.3-18.3 12.8 11.8 12.1 11.1 21.6 18.7V57.4c-.1-11.3-9.3-20.5-20.6-20.5zm-38.6 129.5s-3.6-4.3-6.6-8c13.1-3.7 18.1-11.8 18.1-11.8-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.4-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.6-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.2-1.8-1-2.8-1.7-2.8-1.7s4.8 7.9 17.5 11.7c-3 3.8-6.7 8.2-6.7 8.2-22.1-.7-30.5-15.1-30.5-15.1 0-31.9 14.4-57.8 14.4-57.8 14.4-10.7 28-10.4 28-10.4l1 1.2c-18 5.1-26.2 13-26.2 13s2.2-1.2 5.9-2.8c10.7-4.7 19.2-5.9 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.5 0 0-7.9-7.5-24.9-12.6l1.4-1.6s13.7-.3 28 10.4c0 0 14.4 25.9 14.4 57.8 0-.1-8.4 14.3-30.5 15zM303.8 79.7h-33.2V117l22.1 19.9v-36.2h11.8c7.5 0 11.2 3.6 11.2 9.4v27.7c0 5.8-3.5 9.7-11.2 9.7h-34v21.1h33.2c17.8.1 34.5-8.8 34.5-29.2v-29.8c.1-20.8-16.6-29.9-34.4-29.9zm174 59.7v-30.6c0-11 19.8-13.5 25.8-2.5l18.3-7.4c-7.2-15.8-20.3-20.4-31.2-20.4-17.8 0-35.4 10.3-35.4 30.3v30.6c0 20.2 17.6 30.3 35 30.3 11.2 0 24.6-5.5 32-19.9l-19.6-9c-4.8 12.3-24.9 9.3-24.9-1.4zM417.3 113c-6.9-1.5-11.5-4-11.8-8.3.4-10.3 16.3-10.7 25.6-.8l14.7-11.3c-9.2-11.2-19.6-14.2-30.3-14.2-16.3 0-32.1 9.2-32.1 26.6 0 16.9 13 26 27.3 28.2 7.3 1 15.4 3.9 15.2 8.9-.6 9.5-20.2 9-29.1-1.8l-14.2 13.3c8.3 10.7 19.6 16.1 30.2 16.1 16.3 0 34.4-9.4 35.1-26.6 1-21.7-14.8-27.2-30.6-30.1zm-67 55.5h22.4V79.7h-22.4v88.8zM728 79.7h-33.2V117l22.1 19.9v-36.2h11.8c7.5 0 11.2 3.6 11.2 9.4v27.7c0 5.8-3.5 9.7-11.2 9.7h-34v21.1H728c17.8.1 34.5-8.8 34.5-29.2v-29.8c0-20.8-16.7-29.9-34.5-29.9zm-162.9-1.2c-18.4 0-36.7 10-36.7 30.5v30.3c0 20.3 18.4 30.5 36.9 30.5 18.4 0 36.7-10.2 36.7-30.5V109c0-20.4-18.5-30.5-36.9-30.5zm14.4 60.8c0 6.4-7.2 9.7-14.3 9.7-7.2 0-14.4-3.1-14.4-9.7V109c0-6.5 7-10 14-10 7.3 0 14.7 3.1 14.7 10v30.3zM682.4 109c-.5-20.8-14.7-29.2-33-29.2h-35.5v88.8h22.7v-28.2h4l20.6 28.2h28L665 138.1c10.7-3.4 17.4-12.7 17.4-29.1zm-32.6 12h-13.2v-20.3h13.2c14.1 0 14.1 20.3 0 20.3z" />
</svg>
</a>
Chat about n-gon in the <a href="https://discord.gg/2eC9pgJ">discord</a>.<br> Let me know about ideas, or bugs.
<br>
<br>
<br>
<a href="https://github.com/landgreen/n-gon">
<svg viewBox="0 0 100 16" xmlns="http://www.w3.org/2000/svg" fill="#1B1F23">
<path d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z" />
@@ -121,9 +137,10 @@
</g>
</svg>
</a>
<p>Written by Ross Landgreen</p>
<a href="https://github.com/landgreen/n-gon">Github</a> hosts the source code for n-gon.<br> It's written in JavaScript, CSS, and HTML.
<br>
<br>
</div>
</details>
</div>
@@ -319,9 +336,6 @@
<path style="fill:#FFFFFF;" d="M309.506,190.234h-23.773c-4.572,0-8.276-3.705-8.276-8.276s3.704-8.276,8.276-8.276h23.773
c4.572,0,8.276,3.705,8.276,8.276S314.077,190.234,309.506,190.234z" />
</g>
</g>
<!-- <g id="gamepad" transform="translate(640,640) scale(0.3)" style="display: none;" stroke="#333" stroke-width="0.5" fill="#444">
<path d="M115.824,187.891c-2.95,2.95-4.576,6.872-4.576,11.045c0,4.172,1.625,8.095,4.575,11.045l10.322,10.322

View File

@@ -16,6 +16,9 @@ const b = {
modSpores: null,
AoEImmunity: null,
makeDroneOnDamage: null,
extraDmg: null,
annihilation: null,
fullHeal: null,
setModDefaults() {
b.modCount = 0;
b.modFireRate = 1;
@@ -29,6 +32,9 @@ const b = {
b.modBulletsLastLonger = 1;
b.modIsImmortal = false;
b.modSpores = 0;
b.extraDmg = 0;
b.annihilation = false;
b.fullHeal = false;
for (let i = 0; i < b.mods.length; i++) {
b.mods[i].have = false;
}
@@ -36,49 +42,42 @@ const b = {
mods: [{
name: "depleted uranium rounds",
description: "your <strong class='color-b'>bullets</strong> are larger and do more physical <span class='color-d'>damage</span>",
have: false,
have: false, //0
effect: () => {
//good for guns that do mostly projectile damage:
//testing done at 1.15: one shot(+0.38), rapid fire(+0.25), spray, wave beam(+0.4 adds range and dmg), needles(+0.1)
//testing at 1.08: spray(point blank)(+0.25), one shot(+0.16), wave beam(point blank)(+0.14)
b.modBulletSize = 1.07;
//ADD: maybe add in something that changes game play
}
},
{
name: "auto-loading heuristics",
description: "your rate of fire is 15% higher",
have: false,
effect: () => {
//good for guns with extra ammo: needles, M80, rapid fire, flak, super balls
have: false, //1
effect: () => { //good for guns with extra ammo: needles, M80, rapid fire, flak, super balls
b.modFireRate = 0.85
//ADD: maybe add in something that changes game play
}
},
{
name: "desublimated ammunition",
description: "use 50% less <strong class='color-b'>ammo</strong> when <strong>crouching</strong>",
have: false,
effect: () => {
//good with guns that have less ammo: one shot, grenades, missiles, super balls, spray
have: false, //2
effect: () => { //good with guns that have less ammo: one shot, grenades, missiles, super balls, spray
b.modNoAmmo = 1
}
},
{
name: "Lorentzian topology",
description: "your <strong class='color-b'>bullets</strong> last 40% longer",
have: false,
effect: () => {
//good with: drones, super balls, spore, missiles, wave beam(range), rapid fire(range), flak(range)
have: false, //3
effect: () => { //good with: drones, super balls, spore, missiles, wave beam(range), rapid fire(range), flak(range)
b.modBulletsLastLonger = 1.40
}
},
{
name: "anti-matter cores",
description: "the radius of your <strong class='color-e'>explosions</strong> is doubled<br><span style='opacity:0.3;'>be careful</span>",
have: false,
effect: () => {
//at 1.4 gives a flat 40% increase, and increased range, balanced by limited guns and self damage
have: false, //4
effect: () => { //at 1.4 gives a flat 40% increase, and increased range, balanced by limited guns and self damage
//testing at 1.3: grenade(+0.3), missiles, flak, M80
b.modExplosionRadius = 1.8; //good for guns with explosions
}
@@ -86,58 +85,76 @@ const b = {
{
name: "ceramic plating",
description: "you take no damage from area effects<br>immune to <strong class='color-e'>explosions</strong> and enemy fields",
have: false,
have: false, //5
effect: () => {
b.AoEImmunity = true; //good for guns with explosions
}
},
{
name: "ablative synthesis",
description: "your <span class='color-d'>damaged</span> parts are rebuilt as <strong class='color-b'>drones</strong>",
have: false,
effect: () => {
b.makeDroneOnDamage = true; //makes dangerous situations more survivable
description: "after taking <span class='color-d'>damage</span>, there is a chance that your damaged parts will be rebuilt as <strong class='color-b'>drones</strong>",
have: false, //6
effect: () => { //makes dangerous situations more survivable
b.makeDroneOnDamage = true;
}
},
{
name: "zoospore vector",
description: "when an enemy <span style='color: #888;'>dies</span> it has a 20% chance to release <strong class='color-s'>spores</strong>",
have: false,
effect: () => {
b.modSpores = 0.20; //good late game maybe?
have: false, //7
effect: () => { //good late game maybe?
b.modSpores = 0.20;
}
},
{
name: "field siphon",
description: "regenerate <span class='color-f'>field energy</span> proportional to your <span class='color-d'>damage</span> done",
have: false,
effect: () => {
//good with laser, and all fields
have: false, //8
effect: () => { //good with laser, and all fields
b.modEnergySiphon = 0.2;
}
},
{
name: "entropy transfer",
description: "<span class='color-h'>heal</span> proportional to your <span class='color-d'>damage</span> done",
have: false,
effect: () => {
//good with guns that overkill: one shot, grenade
have: false, //9
effect: () => { //good with guns that overkill: one shot, grenade
b.modHealthDrain = 0.01;
}
},
{
name: "quantum immortality",
description: "after you <strong style='color: #606;'>die</strong> continue in an <em>alternate reality</em><br>guns, ammo, and field are randomized",
have: false,
have: false, //10
effect: () => {
b.modIsImmortal = true;
}
},
// () => {
// b.mod = 8;
// game.makeTextLog("<strong style='font-size:30px;'>Relativistic Velocity</strong><br> <span class='faded'>(left click)</span><p>Your bullets are effected extra by your own velocity</p>", 1200);
// b.setModDefaults(); //good with: one shot, rapid fire, spray, super balls
// },
{
name: "fluoroantimonic acid",
description: "Your bullets do extra chemical <span class='color-d'>damage</span> each time they make contact",
have: false, //11
effect: () => { //good with guns that fire many bullets at low speeds, minigun, drones, junk-bots, shotgun, superballs, wavebeam
b.extraDmg = 0.1
}
},
{
name: "annihilation",
description: "after you touch an enemy, they become <strong class='color-l'>light</strong><br><em>touching enemies still damages you</em>",
have: false, //12
effect: () => { //good with mods that heal: superconductive healing, entropy transfer
b.annihilation = true
}
},
{
name: "superconductive healing",
description: "<span class='color-h'>heals</span> have zero resistance, and maximum efficiency<br><span class='color-h'>heals</span> bring you to full health",
have: false, //13
effect: () => { // good with ablative synthesis, electrostatic field
b.fullHeal = true
}
},
],
giveMod(i) {
b.mods[i].effect(); //give specific mod
@@ -234,7 +251,7 @@ const b = {
angle: dir,
friction: 0.5,
frictionAir: 0,
dmg: 0, //damage done in addition to the damage from momentum
dmg: b.extraDmg, //damage done in addition to the damage from momentum
classType: "bullet",
collisionFilter: {
category: 0x000100,
@@ -394,17 +411,17 @@ const b = {
bullet[bIndex] = Bodies.circle(who.position.x, who.position.y, RADIUS, {
// density: 0.0015, //frictionAir: 0.01,
inertia: Infinity,
restitution: 0.9,
restitution: 0.5,
angle: Math.random() * 2 * Math.PI,
friction: 0,
frictionAir: 0.01,
frictionAir: 0.011,
dmg: 1.8, //damage done in addition to the damage from momentum
classType: "bullet",
collisionFilter: {
category: 0x000100,
mask: 0x000011 //no collide with body
},
endCycle: game.cycle + Math.floor((300 + Math.floor(Math.random() * 240)) * b.modBulletsLastLonger),
endCycle: game.cycle + Math.floor((360 + Math.floor(Math.random() * 240)) * b.modBulletsLastLonger),
minDmgSpeed: 0,
onDmg() {
this.endCycle = 0; //bullet ends cycle after doing damage
@@ -432,7 +449,7 @@ const b = {
}
}
//accelerate towards mobs
const THRUST = this.mass * 0.0008
const THRUST = this.mass * 0.0009
if (this.lockedOn) {
this.force.x -= THRUST * this.lockedOn.x
this.force.y -= THRUST * this.lockedOn.y
@@ -450,7 +467,7 @@ const b = {
World.add(engine.world, bullet[bIndex]); //add bullet to world
},
guns: [{
name: "laser",
name: "laser", //0
description: "fire a <span style='color:#f00;'>beam</span> of coherent light<br>reflects off walls at 75% intensity<br>uses <span class='color-f'>energy</span> instead of ammunition",
ammo: 0,
// ammoPack: 350,
@@ -611,7 +628,7 @@ const b = {
}
}
}, {
name: "kinetic slugs",
name: "kinetic slugs", //1
description: "fire a large <strong>rod</strong> that does excessive physical <span class='color-d'>damage</span><br><em>high recoil</em>",
ammo: 0,
ammoPack: 5,
@@ -636,7 +653,7 @@ const b = {
}
},
{
name: "minigun",
name: "minigun", //2
description: "rapidly fire a stream of small <strong>bullets</strong>",
ammo: 0,
ammoPack: 105,
@@ -657,7 +674,7 @@ const b = {
}
},
{
name: "wave beam",
name: "wave beam", //3
description: "fire a stream of oscillating particles<br><strong style='opacity: 0.4;'>propagates through solids</strong>",
ammo: 0,
ammoPack: 85,
@@ -675,7 +692,7 @@ const b = {
inertia: Infinity,
frictionAir: 0,
minDmgSpeed: 0,
dmg: 0.13, //damage done in addition to the damage from momentum
dmg: 0.13 + b.extraDmg, //damage done in addition to the damage from momentum
classType: "bullet",
collisionFilter: {
category: 0x000100,
@@ -711,7 +728,7 @@ const b = {
}
},
{
name: "super balls",
name: "super balls", //4
description: "fire 3 very <strong>bouncy</strong> balls",
ammo: 0,
ammoPack: 11,
@@ -728,7 +745,7 @@ const b = {
b.fireProps(mech.crouch ? 40 : 20, mech.crouch ? 34 : 26, dir, me); //cd , speed
Matter.Body.setDensity(bullet[me], 0.0001);
bullet[me].endCycle = game.cycle + Math.floor(360 * b.modBulletsLastLonger);
bullet[me].dmg = 0.5;
bullet[me].dmg = 0.5 + b.extraDmg;
bullet[me].minDmgSpeed = 0;
bullet[me].restitution = 0.96;
bullet[me].friction = 0;
@@ -740,7 +757,7 @@ const b = {
}
},
{
name: "shotgun",
name: "shotgun", //5
description: "fire a <strong>burst</strong> of bullets<br><em>high recoil</em>",
ammo: 0,
ammoPack: 8,
@@ -769,32 +786,44 @@ const b = {
}
},
{
name: "fléchettes",
description: "fire an accurate high speed needle<br>",
name: "fléchettes", //6
description: "fire accurate high speed needles<br>crouch to fire 6 needles at once",
ammo: 0,
ammoPack: 16,
ammoPack: 35,
have: false,
isStarterGun: true,
fire() {
function spawnFlechette(dir = mech.angle, speed, size = 1) {
const me = bullet.length;
const dir = mech.angle;
if (mech.crouch) {
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 40 * b.modBulletSize, 3 * b.modBulletSize, b.fireAttributes(dir));
} else {
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 31 * b.modBulletSize, 2 * b.modBulletSize, b.fireAttributes(dir));
}
b.fireProps(mech.crouch ? 50 : 30, mech.crouch ? 45 : 37, dir, me); //cd , speed
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(dir), mech.pos.y + 40 * Math.sin(dir), 36 * size * b.modBulletSize, 2.5 * size * b.modBulletSize, b.fireAttributes(dir));
bullet[me].endCycle = game.cycle + Math.floor(180 * b.modBulletsLastLonger);
bullet[me].dmg = mech.crouch ? 2.2 : 1.6;
bullet[me].dmg = 0.5 * size + b.extraDmg;
b.drawOneBullet(bullet[me].vertices);
bullet[me].do = function () {
//low gravity
this.force.y += this.mass * 0.0002;
};
Matter.Body.setVelocity(bullet[me], {
x: mech.Vx / 2 + speed * Math.cos(dir),
y: mech.Vy / 2 + speed * Math.sin(dir)
});
World.add(engine.world, bullet[me]); //add bullet to world
}
if (mech.crouch) {
mech.fireCDcycle = mech.cycle + Math.floor(60 * b.modFireRate); // cool down
// b.guns[6].ammo -= b.modNoAmmo ? Math.floor(COST / 2) : COST
for (let i = 0; i < 6; i++) {
spawnFlechette(mech.angle + 0.14 * (Math.random() - 0.5), 30 + 6 * Math.random(), 0.7)
}
} else {
mech.fireCDcycle = mech.cycle + Math.floor(30 * b.modFireRate); // cool down
spawnFlechette(mech.angle, 45)
}
}
},
{
name: "missiles",
name: "missiles", //7
description: "fire a missile that accelerates towards nearby targets<br><span class='color-e'>explodes</span> when near target",
ammo: 0,
ammoPack: 8,
@@ -900,7 +929,7 @@ const b = {
}
},
{
name: "flak",
name: "flak", //8
description: "fire a cluster of short range projectiles<br><span class='color-e'>explode</span> on contact or after half a second",
ammo: 0,
ammoPack: 20,
@@ -944,7 +973,7 @@ const b = {
}
},
{
name: "grenades",
name: "grenades", //9
description: "fire a projectile that <span class='color-e'>explodes</span> on contact or after one second",
ammo: 0,
ammoPack: 9,
@@ -973,7 +1002,7 @@ const b = {
}
},
{
name: "vacuum bomb",
name: "vacuum bomb", //10
description: "fire a huge <strong>bomb</strong> that sucks before it <span class='color-e'>explodes</span><br>click left mouse <strong>again</strong> to detonate",
ammo: 0,
ammoPack: 4,
@@ -1084,7 +1113,7 @@ const b = {
}
},
{
name: "ferro frag",
name: "ferro frag", //11
description: "fire a <strong>grenade</strong> that ejects <strong class='color-m'>magnetized</strong> nails<br>nails are <strong class='color-m'>attracted</strong> to enemy targets",
ammo: 0,
ammoPack: 8,
@@ -1142,7 +1171,7 @@ const b = {
Matter.Body.setVelocity(bullet[me], velocity);
World.add(engine.world, bullet[me]); //add bullet to world
bullet[me].endCycle = game.cycle + 60 + Math.floor(15 * Math.random());
// bullet[me].dmg = 1.1;
// bullet[me].dmg = 1.1+b.extraDmg;
bullet[me].do = function () {};
}
}
@@ -1152,7 +1181,7 @@ const b = {
}
},
{
name: "spores",
name: "spores", //12
description: "release an orb that discharges <span class='color-s'>spores</span> after 2 seconds<br>seeks out targets<br>passes through blocks",
ammo: 0,
ammoPack: 5,
@@ -1196,17 +1225,17 @@ const b = {
bullet[bIndex] = Bodies.circle(this.position.x, this.position.y, RADIUS, {
// density: 0.0015, //frictionAir: 0.01,
inertia: Infinity,
restitution: 0.9,
restitution: 0.5,
angle: dir,
friction: 0,
frictionAir: 0.01,
dmg: 1.8, //damage done in addition to the damage from momentum
frictionAir: 0.011,
dmg: 1.8 + b.extraDmg, //damage done in addition to the damage from momentum
classType: "bullet",
collisionFilter: {
category: 0x000100,
mask: 0x000011 //no collide with body
},
endCycle: game.cycle + Math.floor((300 + Math.floor(Math.random() * 240)) * b.modBulletsLastLonger),
endCycle: game.cycle + Math.floor((360 + Math.floor(Math.random() * 240)) * b.modBulletsLastLonger),
minDmgSpeed: 0,
onDmg() {
this.endCycle = 0; //bullet ends cycle after doing damage
@@ -1234,12 +1263,12 @@ const b = {
}
}
//accelerate towards mobs
const THRUST = this.mass * 0.0008
const THRUST = this.mass * 0.0009
if (this.lockedOn) {
this.force.x -= THRUST * this.lockedOn.x
this.force.y -= THRUST * this.lockedOn.y
} else {
this.force.y += this.mass * 0.00027; //gravity
this.force.y += this.mass * 0.00025; //gravity
}
},
});
@@ -1256,7 +1285,7 @@ const b = {
}
},
{
name: "drones",
name: "drones", //13
description: "release <strong>drones</strong> that seek out targets for 16 seconds<br>follows mouse if no targets are found",
ammo: 0,
ammoPack: 20,
@@ -1273,7 +1302,7 @@ const b = {
friction: 0,
frictionAir: 0.0005,
restitution: 1,
dmg: 0.14, //damage done in addition to the damage from momentum
dmg: 0.14 + b.extraDmg, //damage done in addition to the damage from momentum
lookFrequency: 79 + Math.floor(37 * Math.random()),
endCycle: game.cycle + Math.floor((780 + 360 * Math.random()) * b.modBulletsLastLonger),
classType: "bullet",
@@ -1352,8 +1381,8 @@ const b = {
},
{
//draw a halo, since there will only be 1-3 balls
name: "hornets",
description: "release large <strong>drones</strong> that defend the space around the player for 5 seconds",
name: "junk-bots", //14
description: "release large <strong>drones</strong> that defend the space around the player<br>despawn after not doing <span class='color-d'>damage</span> for 3 seconds",
ammo: 0,
ammoPack: 20,
have: false,
@@ -1362,18 +1391,19 @@ const b = {
const THRUST = 0.004
const dir = mech.angle + 0.2 * (Math.random() - 0.5);
const me = bullet.length;
const RADIUS = (10 + 5 * Math.random()) * b.modBulletSize
bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), RADIUS, {
const RADIUS = (18 + 5 * Math.random()) * b.modBulletSize
const LENGTH = 0.6 + 0.8 * Math.random()
bullet[me] = Bodies.rectangle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), RADIUS * LENGTH, RADIUS / LENGTH, {
isOrb: true,
angle: dir,
inertia: Infinity,
// inertia: Infinity,
friction: 0,
frictionAir: 0.06,
restitution: 1,
dmg: 0, // 0.14 //damage done in addition to the damage from momentum
dmg: b.extraDmg, // 0.14 //damage done in addition to the damage from momentum
minDmgSpeed: 2,
lookFrequency: 37 + Math.floor(37 * Math.random()),
endCycle: game.cycle + Math.floor((300 + 140 * Math.random()) * b.modBulletsLastLonger),
endCycle: game.cycle + Math.floor((170 + 120 * Math.random()) * b.modBulletsLastLonger),
classType: "bullet",
collisionFilter: {
category: 0x000100,
@@ -1384,6 +1414,7 @@ const b = {
onDmg() {
// this.endCycle = 0;
this.lockedOn = null
this.endCycle = game.cycle + Math.floor(180 * b.modBulletsLastLonger)
},
onEnd() {},
do() {

41
js/dssd.js Normal file
View File

@@ -0,0 +1,41 @@
name: "depleted uranium rounds",
description: "your <strong class='color-b'>bullets</strong> are larger and do more physical <span class='color-d'>damage</span>",
name: "auto-loading heuristics",
description: "your rate of fire is 15% higher",
name: "desublimated ammunition",
description: "use 50% less <strong class='color-b'>ammo</strong> when <strong>crouching</strong>",
name: "Lorentzian topology",
description: "your <strong class='color-b'>bullets</strong> last 40% longer",
name: "anti-matter cores",
description: "the radius of your <strong class='color-e'>explosions</strong> is doubled<br><span style='opacity:0.3;'>be careful</span>",
name: "ceramic plating",
description: "you take no damage from area effects<br>immune to <strong class='color-e'>explosions</strong> and enemy fields",
name: "ablative synthesis",
description: "after taking <span class='color-d'>damage</span>, there is a chance that your damaged parts will be rebuilt as <strong class='color-b'>drones</strong>",
name: "zoospore vector",
description: "when an enemy <span style='color: #888;'>dies</span> it has a 20% chance to release <strong class='color-s'>spores</strong>",
name: "field siphon",
description: "regenerate <span class='color-f'>field energy</span> proportional to your <span class='color-d'>damage</span> done",
name: "entropy transfer",
description: "<span class='color-h'>heal</span> proportional to your <span class='color-d'>damage</span> done",
name: "quantum immortality",
description: "after you <strong style='color: #606;'>die</strong> continue in an <em>alternate reality</em><br>guns, ammo, and field are randomized",
name: "fluoroantimonic acid",
description: "Your bullets do extra chemical <span class='color-d'>damage</span> each time they make contact",
name: "annihilation",
description: "after you touch an enemy, they become <strong class='color-l'>light</strong><br><em>touching enemies still damages you</em>",
name: "superconductive healing",
description: "<span class='color-h'>heals</span> have zero resistance, and maximum efficiency<br><span class='color-h'>heals</span> bring you to full health",

View File

@@ -96,6 +96,17 @@ function mobCollisionChecks(event) {
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * game.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
mech.damage(dmg);
if (mob[k].onHit) mob[k].onHit(k);
if (b.annihilation && mob[k].dropPowerUp) {
mob[k].death();
game.drawList.push({
//add dmg to draw queue
x: pairs[i].activeContacts[0].vertex.x,
y: pairs[i].activeContacts[0].vertex.y,
radius: dmg * 2000,
color: "rgba(255,0,255,0.2)",
time: game.drawTime
});
} else {
game.drawList.push({
//add dmg to draw queue
x: pairs[i].activeContacts[0].vertex.x,
@@ -104,6 +115,8 @@ function mobCollisionChecks(event) {
color: game.mobDmgColor,
time: game.drawTime
});
}
}
//extra kick between player and mob
//this section would be better with forces but they don't work...
@@ -121,8 +134,8 @@ function mobCollisionChecks(event) {
//bullet mob collisions
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
mob[k].foundPlayer();
const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Matter.Vector.magnitude(Matter.Vector.sub(mob[k].velocity, obj.velocity)));
// console.log(dmg)
// const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Matter.Vector.magnitude(Matter.Vector.sub(mob[k].velocity, obj.velocity)));
const dmg = b.dmgScale * (obj.dmg + b.extraDmg + 0.15 * obj.mass * Matter.Vector.magnitude(Matter.Vector.sub(mob[k].velocity, obj.velocity)))
mob[k].damage(dmg);
obj.onDmg(); //some bullets do actions when they hits things, like despawn
game.drawList.push({

View File

@@ -2,10 +2,15 @@
/* TODO: *******************************************
*****************************************************
mouse can get suck as clicked if the user clicks off the window
can lead to gun lock up until player pressed mouse again
should I really need to fix this?
diegetic field meter
show as the player head filling with teal color
atmosphere levels
large rotating fan that the player has to move through
give the user a rest, between combat
low combat
nonaggressive mobs

View File

@@ -12,11 +12,11 @@ const level = {
onLevel: 0,
start() {
if (game.levelsCleared === 0) {
// game.levelsCleared = 16; //for testing to simulate possible mobs spawns
// b.giveGuns("all", 1000)
// b.giveGuns(11) // set a starting gun for testing
// mech.fieldUpgrades[6].effect(); //give a field power up for testing
// b.giveMod(6)
// game.levelsCleared = 6; //for testing to simulate possible mobs spawns
// b.giveGuns(6)
// mech.fieldUpgrades[6].effect();
// b.giveMod(13)
// spawn.pickList = ["ghoster", "ghoster"]
this.intro(); //starting level
// this.testingMap();
@@ -36,8 +36,8 @@ const level = {
game.draw.setPaths();
},
difficultyIncrease() {
game.dmgScale += 0.3; //damage done by mobs increases each level
b.dmgScale *= 0.94; //damage done by player decreases each level
game.dmgScale += 0.2; //damage done by mobs increases each level
b.dmgScale *= 0.95; //damage done by player decreases each level
game.accelScale *= 1.05 //mob acceleration increases each level
game.lookFreqScale *= 0.95 //mob cycles between looks decreases each level
game.CDScale *= 0.95 //mob CD time decreases each level

View File

@@ -689,7 +689,7 @@ const mobs = {
//accelerate towards the searchTarget
if (!this.seePlayer.recall) {
const newTarget = function (that) {
if (Math.random() < 0.05) {
if (Math.random() < 0.025) {
that.searchTarget = player.position; //chance to target player
} else {
//target random body
@@ -721,7 +721,7 @@ const mobs = {
if (this.seePlayer.recall && this.cd < game.cycle) {
const dist = Matter.Vector.sub(this.seePlayer.position, this.position);
const distMag = Matter.Vector.magnitude(dist);
if (distMag < 430) {
if (distMag < 400) {
this.cd = game.cycle + this.delay;
ctx.beginPath();
ctx.moveTo(this.position.x, this.position.y);
@@ -902,8 +902,10 @@ const mobs = {
//this.fill = this.color + this.health + ')';
if (this.health < 0.1) this.death();
this.onDamage(this); //custom damage effects
if (dmg !== Infinity) {
if (b.modEnergySiphon) mech.fieldMeter += dmg * b.modEnergySiphon
if (b.modHealthDrain) mech.addHealth(dmg * b.modHealthDrain)
}
},
onDamage() {
// a placeholder for custom effects on mob damage

View File

@@ -63,10 +63,11 @@ const mech = {
stand: 49,
jump: 70
},
defaultMass: 5,
mass: 5,
Fx: 0.015, //run Force on ground
FxAir: 0.015, //run Force in Air
definePlayerMass(mass = 5) {
definePlayerMass(mass = mech.defaultMass) {
Matter.Body.setMass(player, mass);
//reduce air and ground move forces
this.Fx = 0.075 / mass
@@ -1026,7 +1027,7 @@ const mech = {
pickUp() {
//triggers when a hold target exits and field button is released
this.isHolding = true;
this.definePlayerMass(5 + this.holdingTarget.mass * this.holdingMassScale)
this.definePlayerMass(mech.defaultMass + this.holdingTarget.mass * this.holdingMassScale)
//collide with nothing
this.holdingTarget.collisionFilter.category = 0x000000;
this.holdingTarget.collisionFilter.mask = 0x000000;

View File

@@ -9,6 +9,7 @@ const powerUps = {
},
effect() {
let heal = (this.size / 40) ** 2
if (b.fullHeal) heal = Infinity
heal = Math.min(1 - mech.health, heal)
mech.addHealth(heal);
if (heal > 0) game.makeTextLog("<span style='font-size:115%;'> <strong class='color-h' style = 'letter-spacing: 2px;'>heal</strong> " + (heal * 100).toFixed(0) + "%</span>", 300)
@@ -44,7 +45,7 @@ const powerUps = {
if (!game.lastLogTime) game.makeTextLog("<span style='font-size:115%;'><span class='color-f'>+energy</span></span>", 300);
} else {
//ammo given scales as mobs take more hits to kill
const ammo = Math.ceil((target.ammoPack * (0.55 + 0.08 * Math.random())) / b.dmgScale);
const ammo = Math.ceil((target.ammoPack * (0.45 + 0.08 * Math.random())) / b.dmgScale);
target.ammo += ammo;
game.updateGunHUD();
game.makeTextLog("<span style='font-size:110%;'>+" + ammo + " ammo for " + target.name + "</span>", 300);

View File

@@ -515,9 +515,11 @@ const spawn = {
if (this.seePlayer.recall) {
//accelerate towards the player
const forceMag = this.accelMag * this.mass;
const angle = Math.atan2(this.seePlayer.position.y - this.position.y, this.seePlayer.position.x - this.position.x);
this.force.x += forceMag * Math.cos(angle);
this.force.y += forceMag * Math.sin(angle);
const dx = this.seePlayer.position.x - this.position.x
const dy = this.seePlayer.position.y - this.position.y
const mag = Math.sqrt(dx * dx + dy * dy)
this.force.x += forceMag * dx / mag;
this.force.y += forceMag * dy / mag;
//eventHorizon waves in and out
eventHorizon = this.eventHorizon * (1 + 0.2 * Math.sin(game.cycle * 0.008))
@@ -685,7 +687,7 @@ const spawn = {
me.g = 0.0002; //required if using 'gravity'
me.frictionStatic = 0;
me.friction = 0;
me.delay = 60;
me.delay = 90;
Matter.Body.rotate(me, Math.PI * 0.1);
me.onDamage = function () {
this.cd = game.cycle + this.delay;
@@ -752,7 +754,7 @@ const spawn = {
mobs.spawn(x, y, 7, radius, "transparent");
me = mob[mob.length - 1];
me.seeAtDistance2 = 1000000;
me.accelMag = 0.00014 * game.accelScale;
me.accelMag = 0.00012 * game.accelScale;
if (map.length) me.searchTarget = map[Math.floor(Math.random() * (map.length - 1))].position; //required for search
Matter.Body.setDensity(me, 0.00065); //normal is 0.001 //makes effective life much lower
me.stroke = "transparent"; //used for drawGhost
@@ -764,7 +766,7 @@ const spawn = {
me.do = function () {
//cap max speed
if (this.speed > 5) {
Matter.Body.setVelocity(mob[mob.length - 1], {
Matter.Body.setVelocity(this, {
x: this.velocity.x * 0.8,
y: this.velocity.y * 0.8
});

View File

@@ -212,6 +212,10 @@ em {
color: #f05;
}
.color-l {
color: #f0f;
}
.color-h {
color: #0d9;
}