minor bug fixes

This commit is contained in:
landgreen
2019-12-11 05:52:52 -08:00
committed by GitHub
parent e3022bea0c
commit 69c5a2bc33
4 changed files with 16 additions and 14 deletions

View File

@@ -102,7 +102,7 @@ const b = {
},
{
name: "ceramic plating",
description: "protection from to high <strong>temperatures</strong><br>5x less <strong class='color-d'>damage</strong> from <strong class='color-e'>explosions</strong>, lasers",
description: "protection from to high <strong>temperatures</strong><br>5x less <strong class='color-d'>damage</strong> from <strong class='color-e'>explosions</strong> and lasers",
have: false, //5
effect: () => {
b.isModTempResist = true; //good for guns with explosions
@@ -174,7 +174,7 @@ const b = {
},
{
name: "Gauss rifle",
description: "<strong>launch blocks</strong> at much higher speeds<br>carry more massive blocks",
description: "<strong>launch blocks</strong> at much higher speeds<br>hold onto larger blocks even after getting hit",
have: false, //14
effect: () => { // good with guns that run out of ammo
mech.throwChargeRate = 4;
@@ -398,7 +398,7 @@ const b = {
},
explode(me) {
// typically explode is used for some bullets with .onEnd
const radius = bullet[me].explodeRad * b.modExplosionRadius
let radius = bullet[me].explodeRad * b.modExplosionRadius
//add dmg to draw queue
game.drawList.push({
x: bullet[me].position.x,
@@ -482,7 +482,8 @@ const b = {
knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 18);
mob[i].force.x += knock.x;
mob[i].force.y += knock.y;
damageScale *= 0.8 //reduced damage for each additional explosion target
radius *= 0.9 //reduced range for each additional explosion target
damageScale *= 0.9 //reduced damage for each additional explosion target
} else if (!mob[i].seePlayer.recall && dist < alertRange) {
mob[i].locatePlayer();
knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 35);
@@ -1222,7 +1223,7 @@ const b = {
name: "flak", //8
description: "fire a cluster of short range projectiles<br><strong class='color-e'>explodes</strong> on contact or after half a second",
ammo: 0,
ammoPack: 20,
ammoPack: 22,
have: false,
isStarterGun: true,
fire() {
@@ -1265,7 +1266,7 @@ const b = {
name: "grenades", //9
description: "lob a single bouncy projectile<br><strong class='color-e'>explodes</strong> on contact or after one second",
ammo: 0,
ammoPack: 9,
ammoPack: 10,
have: false,
isStarterGun: false,
fire() {
@@ -1278,9 +1279,10 @@ const b = {
bullet[me].totalCycles = 100;
bullet[me].endCycle = game.cycle + Math.floor((mech.crouch ? 120 : 60) * b.isModBulletsLastLonger);
bullet[me].restitution = 0.5;
bullet[me].explodeRad = 210;
bullet[me].explodeRad = 270;
bullet[me].onEnd = b.explode; //makes bullet do explosive damage before despawn
bullet[me].minDmgSpeed = 1;
Matter.Body.setDensity(bullet[me], 0.0002);
bullet[me].onDmg = function () {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
@@ -1311,6 +1313,7 @@ const b = {
bullet[me].inertia = Infinity; //prevents rotation
bullet[me].restitution = 0;
bullet[me].friction = 1;
Matter.Body.setDensity(bullet[me], 0.0002);
bullet[me].explodeRad = 380 + Math.floor(Math.random() * 60);
bullet[me].onEnd = b.explode; //makes bullet do explosive damage before despawn
@@ -1724,9 +1727,8 @@ const b = {
}
}
const FIELD_DRAIN = 0.0016
if (this.lockedOn && this.lockedOn.alive && mech.fieldMeter > FIELD_DRAIN) { //hit target with laser
mech.fieldMeter -= FIELD_DRAIN
if (this.lockedOn && this.lockedOn.alive && mech.fieldMeter > 0.15) { //hit target with laser
mech.fieldMeter -= 0.0016
//make sure you can still see target
const DIST = Matter.Vector.magnitude(Matter.Vector.sub(this.vertices[0], this.lockedOn.position));

View File

@@ -187,8 +187,8 @@ document.getElementById("build-button").addEventListener("click", () => {
</g>
</svg>
</div>
<div class="build-grid-module" style="font-size: 19px; line-height: 110%;">
Choose up to five power ups. Once you start, only health and ammo will drop, so pick carefully.
<div class="build-grid-module" style="font-size: 0.85em; line-height: 170%;">
Choose five power ups.<br>Click start to begin.
</div>`
for (let i = 1, len = mech.fieldUpgrades.length; i < len; i++) {
text += `<div class="build-grid-module" onclick="build.choosePowerUp(this,${i},'field')" ><div class="circle-grid field"></div> &nbsp; <strong style='font-size:1.3em;'>${mech.fieldUpgrades[i].name}</strong><br> ${mech.fieldUpgrades[i].description}</div>`

View File

@@ -461,7 +461,7 @@ const mech = {
// freeze game and display a full screen red color
if (dmg > 0.05) {
this.drop(); //drop block if holding
if (dmg > 0.07 && mech.holdingMassScale > 0.2) this.drop(); //drop block if holding
game.fpsCap = 4 //40 - Math.min(25, 100 * dmg)
game.fpsInterval = 1000 / game.fpsCap;
} else {

View File

@@ -70,7 +70,7 @@ summary {
display: none;
/* display: grid; */
grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
grid-auto-rows: minmax(auto, auto);
grid-gap: 15px;