diff --git a/js/bullet.js b/js/bullet.js
index d13d80d..6faedf6 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -485,7 +485,7 @@ const b = {
spore(where, isFreeze = mod.isSporeFreeze) { //used with the mod upgrade in mob.death()
const bIndex = bullet.length;
const side = 4;
- bullet[bIndex] = Bodies.polygon(where.x, where.y, 5, side, {
+ bullet[bIndex] = Bodies.polygon(where.x, where.y, 4, side, {
// density: 0.0015, //frictionAir: 0.01,
inertia: Infinity,
isFreeze: isFreeze,
@@ -1578,7 +1578,7 @@ const b = {
name: "shotgun",
description: "fire a burst of short range bullets
crouch to reduce recoil",
ammo: 0,
- ammoPack: 8,
+ ammoPack: 6,
have: false,
fire() {
let knock, spread
@@ -1591,7 +1591,7 @@ const b = {
mech.fireCDcycle = mech.cycle + Math.floor(45 * b.fireCD); // cool down
if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(47 * b.fireCD); //player is immune to collision damage for 30 cycles
spread = 1.3
- knock = 0.08
+ knock = 0.1
}
if (mod.isShotgunRecoil) {
@@ -1616,27 +1616,27 @@ const b = {
x: speed * Math.cos(dir),
y: speed * Math.sin(dir)
}
- b.nail(pos, velocity, 0.6)
+ b.nail(pos, velocity, 1)
}
} else {
- const side = 19 * mod.bulletSize
+ const side = 21 * mod.bulletSize
for (let i = 0; i < 15; i++) {
const me = bullet.length;
const dir = mech.angle + (Math.random() - 0.5) * spread
bullet[me] = Bodies.rectangle(mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5), mech.pos.y + 35 * Math.sin(mech.angle) + 15 * (Math.random() - 0.5), side, side, b.fireAttributes(dir));
World.add(engine.world, bullet[me]); //add bullet to world
- const SPEED = 50 + Math.random() * 10
+ const SPEED = 52 + Math.random() * 8
Matter.Body.setVelocity(bullet[me], {
x: SPEED * Math.cos(dir),
y: SPEED * Math.sin(dir)
});
bullet[me].endCycle = game.cycle + 40
- bullet[me].minDmgSpeed = 20
+ bullet[me].minDmgSpeed = 15
// bullet[me].dmg = 0.1
bullet[me].frictionAir = 0.034;
bullet[me].do = function () {
if (!mech.isBodiesAsleep) {
- const scale = 1 - 0.035 / mod.isBulletsLastLonger
+ const scale = 1 - 0.034 / mod.isBulletsLastLonger
Matter.Body.scale(this, scale, scale);
}
};
@@ -2093,7 +2093,7 @@ const b = {
name: "vacuum bomb",
description: "fire a bomb that sucks before exploding
click left mouse again to detonate",
ammo: 0,
- ammoPack: 3,
+ ammoPack: 2.5,
have: false,
fire() {
const me = bullet.length;
@@ -2105,7 +2105,7 @@ const b = {
bullet[me].restitution = 0.2;
bullet[me].friction = 0.3;
bullet[me].endCycle = Infinity
- bullet[me].explodeRad = 450 + Math.floor(Math.random() * 30);
+ bullet[me].explodeRad = 450 + Math.floor(Math.random() * 50);
bullet[me].onEnd = function () {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
@@ -2562,7 +2562,7 @@ const b = {
name: "rail gun",
description: "use energy to launch a high-speed dense rod
hold left mouse to charge, release to fire",
ammo: 0,
- ammoPack: 4,
+ ammoPack: 3,
have: false,
fire() {
const me = bullet.length;
diff --git a/js/game.js b/js/game.js
index f2f1f17..696eda1 100644
--- a/js/game.js
+++ b/js/game.js
@@ -199,7 +199,7 @@ const game = {
if (b.inventory[0] === b.activeGun) {
let lessDamage = 1
for (let i = 0, len = b.inventory.length; i < len; i++) {
- lessDamage *= 0.85 // 1 - 0.15
+ lessDamage *= 0.87 // 1 - 0.15
}
document.getElementById("mod-entanglement").innerHTML = " " + ((1 - lessDamage) * 100).toFixed(0) + "%"
} else {
@@ -595,24 +595,6 @@ const game = {
document.getElementById("dmg").style.display = "inline";
document.getElementById("health-bg").style.display = "inline";
- // window.onmousedown = function (e) {
- // //mouse up event in set in index.js
-
- // // game.mouseDown = true;
- // if (e.which === 3) {
- // game.mouseDownRight = true;
- // } else {
- // game.mouseDown = true;
- // }
- // // keep this disabled unless building maps
- // // if (!game.mouseDown){
- // // game.getCoords.pos1.x = Math.round(game.mouseInGame.x / 25) * 25;
- // // game.getCoords.pos1.y = Math.round(game.mouseInGame.y / 25) * 25;
- // // }
-
- // // mech.throwBlock();
- // };
-
if (game.firstRun) {
mech.spawn(); //spawns the player
mod.setupAllMods(); //doesn't run on reset so that gun mods carry over to new runs
diff --git a/js/index.js b/js/index.js
index 45c9a27..6e01e20 100644
--- a/js/index.js
+++ b/js/index.js
@@ -51,7 +51,66 @@ window.addEventListener('load', (event) => {
const set = getUrlVars()
if (Object.keys(set).length !== 0) {
build.isURLBuild = true;
- game.startGame()
+ // game.startGame()
+ openCustomBuildMenu();
+ //add custom selections based on url
+ for (const property in set) {
+ // console.log(set[property], property);
+ set[property] = set[property].replace(/%20/g, " ")
+ if (property.substring(0, 3) === "gun") {
+ let found = false
+ let index
+ for (let i = 0; i < b.guns.length; i++) {
+ if (set[property] === b.guns[i].name) {
+ index = i;
+ found = true;
+ break;
+ }
+ }
+ if (found) build.choosePowerUp(document.getElementById(`gun-${index}`), index, 'gun')
+ }
+
+ if (property.substring(0, 3) === "mod") {
+ let found = false
+ let index
+ for (let i = 0; i < mod.mods.length; i++) {
+ if (set[property] === mod.mods[i].name) {
+ index = i;
+ found = true;
+ break;
+ }
+ }
+ if (found) build.choosePowerUp(document.getElementById(`mod-${index}`), index, 'mod')
+ }
+
+ if (property === "field") {
+ let found = false
+ let index
+ for (let i = 0; i < mech.fieldUpgrades.length; i++) {
+ if (set[property] === mech.fieldUpgrades[i].name) {
+ index = i;
+ found = true;
+ break;
+ }
+ }
+ if (found) build.choosePowerUp(document.getElementById(`field-${index}`), index, 'field')
+ }
+ if (property === "difficulty") {
+ game.difficultyMode = Number(set[property])
+ localSettings.difficultyMode = Number(set[property])
+ localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
+ document.getElementById("difficulty-select").value = Number(set[property])
+ document.getElementById("difficulty-select-custom").value = Number(set[property])
+ }
+ if (property === "level") {
+ document.getElementById("starting-level").value = Number(set[property])
+
+ // level.levelsCleared += Number(set[property]);
+ // level.difficultyIncrease(Number(set[property]) * game.difficultyMode) //increase difficulty based on modes
+ // spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
+ // level.onLevel++
+ }
+ }
}
});
@@ -248,7 +307,7 @@ const build = {
text += `