made draft mode default, bug fixes
This commit is contained in:
@@ -309,7 +309,7 @@ const b = {
|
||||
game.replaceTextLog = true;
|
||||
game.makeTextLog("<div style='font-size:140%;'>NO AMMO</div> <p style='font-size:90%;'><strong>Q</strong>, <strong>E</strong>, and <strong>mouse wheel</strong> change weapons</p>", 200);
|
||||
}
|
||||
if (mech.isHolding) {
|
||||
if (mech.holdingTarget) {
|
||||
mech.drop();
|
||||
}
|
||||
}
|
||||
@@ -1761,7 +1761,7 @@ const b = {
|
||||
//use energy to explode
|
||||
const energy = mech.fieldMeter * 0.25
|
||||
mech.fieldMeter -= energy
|
||||
if (best.who) b.explosion(path[1], 1200 * energy)
|
||||
if (best.who) b.explosion(path[1], 1000 * energy)
|
||||
mech.fireCDcycle = mech.cycle + Math.floor(65 * b.modFireRate); // cool down
|
||||
|
||||
//draw laser beam
|
||||
|
||||
@@ -86,7 +86,6 @@ const game = {
|
||||
accelScale: null, //set in levels.setDifficulty
|
||||
CDScale: null, //set in levels.setDifficulty
|
||||
lookFreqScale: null, //set in levels.setDifficulty
|
||||
isDraftMode: false,
|
||||
// dropFPS(cap = 40, time = 15) {
|
||||
// game.fpsCap = cap
|
||||
// game.fpsInterval = 1000 / game.fpsCap;
|
||||
@@ -501,7 +500,6 @@ const game = {
|
||||
document.getElementById("choose-grid").style.display = "none"
|
||||
document.getElementById("controls").style.display = "inline";
|
||||
document.getElementById("build-button").style.display = "inline"
|
||||
document.getElementById("draft-button").style.display = "inline"
|
||||
isShowingBuilds = false
|
||||
document.getElementById("settings").style.display = "inline";
|
||||
document.getElementById("splash").style.display = "inline";
|
||||
@@ -520,7 +518,6 @@ const game = {
|
||||
document.getElementById("controls").style.display = "none";
|
||||
document.getElementById("settings").style.display = "none";
|
||||
document.getElementById("build-button").style.display = "none";
|
||||
document.getElementById("draft-button").style.display = "none"
|
||||
document.getElementById("splash").onclick = null; //removes the onclick effect so the function only runs once
|
||||
document.getElementById("splash").style.display = "none"; //hides the element that spawned the function
|
||||
document.getElementById("dmg").style.display = "inline";
|
||||
|
||||
11
js/index.js
11
js/index.js
@@ -2,8 +2,6 @@
|
||||
/* TODO: *******************************************
|
||||
*****************************************************
|
||||
|
||||
make draft mode default and add in negative mods
|
||||
|
||||
field: catch mobs in your field and make them into guardian bullets
|
||||
|
||||
negative mod effect ideas
|
||||
@@ -11,6 +9,8 @@ negative mod effect ideas
|
||||
-fire rate
|
||||
-slow life decay
|
||||
|
||||
mod: gain an extra choice of power ups
|
||||
|
||||
mod: if you fire when out of ammo you gain 1 ammo pack at the cost of
|
||||
10% max health
|
||||
20% of your current health
|
||||
@@ -104,12 +104,6 @@ const cat = {
|
||||
}
|
||||
|
||||
|
||||
document.getElementById("draft-button").addEventListener("click", () => {
|
||||
game.isDraftMode = true;
|
||||
game.startGame();
|
||||
});
|
||||
|
||||
|
||||
//build build grid display
|
||||
const build = {
|
||||
isShowingBuilds: false,
|
||||
@@ -163,7 +157,6 @@ const build = {
|
||||
|
||||
document.getElementById("build-button").addEventListener("click", () => {
|
||||
document.getElementById("build-button").style.display = "none";
|
||||
document.getElementById("draft-button").style.display = "none";
|
||||
const el = document.getElementById("build-grid")
|
||||
if (build.isShowingBuilds) {
|
||||
el.style.display = "none"
|
||||
|
||||
@@ -67,6 +67,7 @@ const level = {
|
||||
//******************************************************************************************************************
|
||||
testingMap() {
|
||||
//start with all guns
|
||||
level.difficultyIncrease(8)
|
||||
game.zoomScale = 1400 //1400 is normal
|
||||
spawn.setSpawnList();
|
||||
mech.setPosToSpawn(-75, -60); //normal spawn
|
||||
@@ -117,11 +118,11 @@ const level = {
|
||||
// powerUps.spawn(450, -400, "mod", false, 6);
|
||||
// powerUps.spawn(450, -400, "mod", false);
|
||||
// spawn.bodyRect(-45, -100, 40, 50);
|
||||
spawn.groupBoss(800, -1050);
|
||||
spawn.shooter(400, -1050);
|
||||
spawn.shooter(1200, -1050);
|
||||
// spawn.groupBoss(800, -1050);
|
||||
spawn.spinner(400, -1050);
|
||||
spawn.spinner(1200, -1050);
|
||||
// spawn.groupBoss(-600, -550);
|
||||
spawn.hopper(800, -150);
|
||||
spawn.spinner(800, -150);
|
||||
// spawn.beamer(800, -150);
|
||||
// spawn.grower(800, -250);
|
||||
// spawn.blinker(800, -250, 40);
|
||||
|
||||
44
js/player.js
44
js/player.js
@@ -687,7 +687,7 @@ const mech = {
|
||||
return false;
|
||||
},
|
||||
drop() {
|
||||
if (mech.isHolding) {
|
||||
if (mech.isHolding && mech.holdingTarget) {
|
||||
mech.isHolding = false;
|
||||
mech.definePlayerMass()
|
||||
mech.holdingTarget.collisionFilter.category = cat.body;
|
||||
@@ -735,6 +735,7 @@ const mech = {
|
||||
}
|
||||
},
|
||||
holding() {
|
||||
// if (mech.holdingTarget) {
|
||||
mech.fieldMeter -= mech.fieldRegen;
|
||||
if (mech.fieldMeter < 0) mech.fieldMeter = 0;
|
||||
Matter.Body.setPosition(mech.holdingTarget, {
|
||||
@@ -743,32 +744,35 @@ const mech = {
|
||||
});
|
||||
Matter.Body.setVelocity(mech.holdingTarget, player.velocity);
|
||||
Matter.Body.rotate(mech.holdingTarget, 0.01 / mech.holdingTarget.mass); //gently spin the block
|
||||
// }
|
||||
},
|
||||
throw () {
|
||||
if ((keys[32] || game.mouseDownRight)) {
|
||||
if (mech.fieldMeter > 0.0007) {
|
||||
mech.fieldMeter -= 0.0007;
|
||||
mech.throwCharge += mech.throwChargeRate;;
|
||||
//draw charge
|
||||
const x = mech.pos.x + 15 * Math.cos(mech.angle);
|
||||
const y = mech.pos.y + 15 * Math.sin(mech.angle);
|
||||
const len = mech.holdingTarget.vertices.length - 1;
|
||||
const edge = mech.throwCharge * mech.throwCharge * 0.02;
|
||||
const grd = ctx.createRadialGradient(x, y, edge, x, y, edge + 5);
|
||||
grd.addColorStop(0, "rgba(255,50,150,0.3)");
|
||||
grd.addColorStop(1, "transparent");
|
||||
ctx.fillStyle = grd;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[len].x, mech.holdingTarget.vertices[len].y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[0].x, mech.holdingTarget.vertices[0].y);
|
||||
ctx.fill();
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (mech.holdingTarget) {
|
||||
mech.fieldMeter -= 0.0007;
|
||||
mech.throwCharge += mech.throwChargeRate;;
|
||||
//draw charge
|
||||
const x = mech.pos.x + 15 * Math.cos(mech.angle);
|
||||
const y = mech.pos.y + 15 * Math.sin(mech.angle);
|
||||
const len = mech.holdingTarget.vertices.length - 1;
|
||||
const edge = mech.throwCharge * mech.throwCharge * 0.02;
|
||||
const grd = ctx.createRadialGradient(x, y, edge, x, y, edge + 5);
|
||||
grd.addColorStop(0, "rgba(255,50,150,0.3)");
|
||||
grd.addColorStop(1, "transparent");
|
||||
ctx.fillStyle = grd;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[i].x, mech.holdingTarget.vertices[i].y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[i + 1].x, mech.holdingTarget.vertices[i + 1].y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[len].x, mech.holdingTarget.vertices[len].y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[0].x, mech.holdingTarget.vertices[0].y);
|
||||
ctx.fill();
|
||||
for (let i = 0; i < len; i++) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[i].x, mech.holdingTarget.vertices[i].y);
|
||||
ctx.lineTo(mech.holdingTarget.vertices[i + 1].x, mech.holdingTarget.vertices[i + 1].y);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mech.drop()
|
||||
|
||||
185
js/powerups.js
185
js/powerups.js
@@ -43,7 +43,7 @@ const powerUps = {
|
||||
heal = Math.min(mech.maxHealth - mech.health, heal)
|
||||
if (b.isModRecursiveHealing) heal *= 2
|
||||
mech.addHealth(heal);
|
||||
if (heal > 0) game.makeTextLog("<div class='circle heal'></div> <span style='font-size:115%;'> <strong style = 'letter-spacing: 2px;'>heal</strong> " + (heal * 100).toFixed(0) + "%</span>", 300)
|
||||
if (heal > 0) game.makeTextLog("<div class='circle heal'></div> <span style='font-size:115%;'> <strong style = 'letter-spacing: 2px;'>heal</strong> " + (heal * game.healScale * 100).toFixed(0) + "%</span>", 300)
|
||||
}
|
||||
},
|
||||
ammo: {
|
||||
@@ -91,54 +91,27 @@ const powerUps = {
|
||||
return 45;
|
||||
},
|
||||
effect() {
|
||||
if (game.isDraftMode) {
|
||||
function doNotHave(who, skip1 = -1, skip2 = -1) {
|
||||
let options = [];
|
||||
for (let i = 1; i < who.length; i++) {
|
||||
if (i !== mech.fieldMode && i !== skip1 && i !== skip2) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
function doNotHave(who, skip1 = -1, skip2 = -1) {
|
||||
let options = [];
|
||||
for (let i = 1; i < who.length; i++) {
|
||||
if (i !== mech.fieldMode && i !== skip1 && i !== skip2) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
|
||||
let choice1 = doNotHave(mech.fieldUpgrades)
|
||||
let choice2 = doNotHave(mech.fieldUpgrades, choice1)
|
||||
let choice3 = doNotHave(mech.fieldUpgrades, choice1, choice2)
|
||||
if (choice1 > -1) {
|
||||
let text = `<h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a field</h3>`
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice1})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice1].name}</div> ${mech.fieldUpgrades[choice1].description}</div>`
|
||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice2})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice2].name}</div> ${mech.fieldUpgrades[choice2].description}</div>`
|
||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice3})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice3].name}</div> ${mech.fieldUpgrades[choice3].description}</div>`
|
||||
// text += `<div style = 'color:#fff'>${game.SVGrightMouse} activate the shield with the right mouse<br>fields shield you from damage <br>and let you pick up and throw blocks</div>`
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
powerUps.showDraft();
|
||||
} else {
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
let choice1 = doNotHave(mech.fieldUpgrades)
|
||||
let choice2 = doNotHave(mech.fieldUpgrades, choice1)
|
||||
let choice3 = doNotHave(mech.fieldUpgrades, choice1, choice2)
|
||||
if (choice1 > -1) {
|
||||
let text = `<h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a field</h3>`
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice1})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice1].name}</div> ${mech.fieldUpgrades[choice1].description}</div>`
|
||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice2})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice2].name}</div> ${mech.fieldUpgrades[choice2].description}</div>`
|
||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice3})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice3].name}</div> ${mech.fieldUpgrades[choice3].description}</div>`
|
||||
// text += `<div style = 'color:#fff'>${game.SVGrightMouse} activate the shield with the right mouse<br>fields shield you from damage <br>and let you pick up and throw blocks</div>`
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
powerUps.showDraft();
|
||||
} else {
|
||||
const previousMode = mech.fieldMode
|
||||
if (this.mode) { //this.mode is set if the power up has been ejected from player
|
||||
// mech.fieldUpgrades[this.mode].effect(); //set a predetermined power up
|
||||
mech.setField(this.mode)
|
||||
} else { //choose a random mode that you don't already have
|
||||
availableModes = []
|
||||
for (let i = 1; i < mech.fieldUpgrades.length; i++) { //start on 1 to skip the default field
|
||||
if (i !== previousMode) {
|
||||
availableModes.push(i)
|
||||
}
|
||||
}
|
||||
const mode = availableModes[Math.floor(Math.random() * availableModes.length)]
|
||||
mech.setField(mode)
|
||||
}
|
||||
game.replaceTextLog = true;
|
||||
game.makeTextLog(`${game.SVGrightMouse}<strong style='font-size:30px;'> ${mech.fieldUpgrades[mech.fieldMode].name}</strong><br><span class='faded'></span><br>${mech.fieldUpgrades[mech.fieldMode].description}`, 600);
|
||||
game.replaceTextLog = false;
|
||||
//pop the old field out in case player wants to swap back
|
||||
if (previousMode !== 0) {
|
||||
mech.fieldCDcycle = mech.cycle + 40; //trigger fieldCD to stop power up grab automatic pick up of spawn
|
||||
setTimeout(function () {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y - 15, "field", false, previousMode);
|
||||
}, 100);
|
||||
}
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -149,43 +122,26 @@ const powerUps = {
|
||||
return 42;
|
||||
},
|
||||
effect() {
|
||||
if (game.isDraftMode) {
|
||||
function doNotHave(who, skip1 = -1, skip2 = -1) {
|
||||
let options = [];
|
||||
for (let i = 0; i < who.length; i++) {
|
||||
if (!who[i].have && i !== skip1 && i !== skip2) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
|
||||
let choice1 = doNotHave(b.mods)
|
||||
let choice2 = doNotHave(b.mods, choice1)
|
||||
let choice3 = doNotHave(b.mods, choice1, choice2)
|
||||
if (choice1 > -1) {
|
||||
let text = "<h3 style = 'color:#fff; text-align:center; margin: 0px;'>choose a mod</h3>"
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice1})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice1].name}</div> ${b.mods[choice1].description}</div>`
|
||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice2})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice2].name}</div> ${b.mods[choice2].description}</div>`
|
||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice3})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice3].name}</div> ${b.mods[choice3].description}</div>`
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
powerUps.showDraft();
|
||||
} else {
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
} else {
|
||||
//find what mods I don't have
|
||||
function doNotHave(who, skip1 = -1, skip2 = -1) {
|
||||
let options = [];
|
||||
for (let i = 0; i < b.mods.length; i++) {
|
||||
if (!b.mods[i].have) options.push(i);
|
||||
for (let i = 0; i < who.length; i++) {
|
||||
if (!who[i].have && i !== skip1 && i !== skip2) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
|
||||
// give a random mod from the mods I don 't have
|
||||
if (options.length > 0) {
|
||||
let newMod = options[Math.floor(Math.random() * options.length)]
|
||||
b.giveMod(newMod)
|
||||
game.replaceTextLog = true;
|
||||
game.makeTextLog(`<div class="circle mod"></div> <strong style='font-size:30px;'>${b.mods[newMod].name}</strong><br><br> ${b.mods[newMod].description}`, 1000);
|
||||
game.replaceTextLog = false;
|
||||
}
|
||||
let choice1 = doNotHave(b.mods)
|
||||
let choice2 = doNotHave(b.mods, choice1)
|
||||
let choice3 = doNotHave(b.mods, choice1, choice2)
|
||||
if (choice1 > -1) {
|
||||
let text = "<h3 style = 'color:#fff; text-align:center; margin: 0px;'>choose a mod</h3>"
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice1})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice1].name}</div> ${b.mods[choice1].description}</div>`
|
||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice2})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice2].name}</div> ${b.mods[choice2].description}</div>`
|
||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice3})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice3].name}</div> ${b.mods[choice3].description}</div>`
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
powerUps.showDraft();
|
||||
} else {
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -196,58 +152,27 @@ const powerUps = {
|
||||
return 35;
|
||||
},
|
||||
effect() {
|
||||
if (game.isDraftMode) {
|
||||
|
||||
function doNotHave(who, skip1 = -1, skip2 = -1) {
|
||||
let options = [];
|
||||
for (let i = 0; i < who.length; i++) {
|
||||
if (!who[i].have && i !== skip1 && i !== skip2) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
|
||||
let choice1 = doNotHave(b.guns)
|
||||
let choice2 = doNotHave(b.guns, choice1)
|
||||
let choice3 = doNotHave(b.guns, choice1, choice2)
|
||||
|
||||
if (choice1 > -1) {
|
||||
let text = "<h3 style = 'color:#fff; text-align:center; margin: 0px;'>choose a gun</h3>"
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice1})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice1].name}</div> ${b.guns[choice1].description}</div>`
|
||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice2})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice2].name}</div> ${b.guns[choice2].description}</div>`
|
||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice3})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice3].name}</div> ${b.guns[choice3].description}</div>`
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
powerUps.showDraft();
|
||||
} else {
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
} else {
|
||||
//find what guns I don't have
|
||||
function doNotHave(who, skip1 = -1, skip2 = -1) {
|
||||
let options = [];
|
||||
if (b.activeGun === null && game.difficulty < 3) {
|
||||
//choose the first gun to be one that is good for the early game
|
||||
for (let i = 0; i < b.guns.length; ++i) {
|
||||
if (!b.guns[i].have && b.guns[i].isStarterGun) options.push(i);
|
||||
}
|
||||
} else {
|
||||
//choose a gun you don't have
|
||||
for (let i = 0; i < b.guns.length; ++i) {
|
||||
if (!b.guns[i].have) options.push(i);
|
||||
}
|
||||
for (let i = 0; i < who.length; i++) {
|
||||
if (!who[i].have && i !== skip1 && i !== skip2) options.push(i);
|
||||
}
|
||||
//give player a gun they don't already have if possible
|
||||
game.replaceTextLog = true;
|
||||
if (options.length > 0) {
|
||||
let newGun = options[Math.floor(Math.random() * options.length)];
|
||||
if (b.activeGun === null) b.activeGun = newGun //if no active gun switch to new gun
|
||||
b.guns[newGun].have = true;
|
||||
b.inventory.push(newGun);
|
||||
b.guns[newGun].ammo += b.guns[newGun].ammoPack * 2;
|
||||
game.makeGunHUD();
|
||||
game.makeTextLog(`${game.SVGleftMouse} <strong style='font-size:30px;'>${b.guns[newGun].name}</strong><br><br>${b.guns[newGun].description}`, 900);
|
||||
} else {
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
game.replaceTextLog = false
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
|
||||
let choice1 = doNotHave(b.guns)
|
||||
let choice2 = doNotHave(b.guns, choice1)
|
||||
let choice3 = doNotHave(b.guns, choice1, choice2)
|
||||
|
||||
if (choice1 > -1) {
|
||||
let text = "<h3 style = 'color:#fff; text-align:center; margin: 0px;'>choose a gun</h3>"
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice1})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice1].name}</div> ${b.guns[choice1].description}</div>`
|
||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice2})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice2].name}</div> ${b.guns[choice2].description}</div>`
|
||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice3})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice3].name}</div> ${b.guns[choice3].description}</div>`
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
powerUps.showDraft();
|
||||
} else {
|
||||
powerUps.giveRandomAmmo()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user