mods for guns and fields have an extra circle in selection menus
This commit is contained in:
12
js/bullet.js
12
js/bullet.js
@@ -689,6 +689,7 @@ const b = {
|
||||
mech.fieldCDcycle = mech.cycle + 120;
|
||||
mech.energy = 0;
|
||||
}
|
||||
mech.isExtruderOn = true
|
||||
const SPEED = 10
|
||||
const me = bullet.length;
|
||||
const where = Vector.add(mech.pos, player.velocity)
|
||||
@@ -740,9 +741,9 @@ const b = {
|
||||
this.cycle++
|
||||
const wiggleMag = (mech.crouch ? 6 : 12) * Math.cos(game.cycle * 0.09)
|
||||
const wiggle = Vector.mult(transverse, wiggleMag * Math.cos(this.cycle * 0.36)) //+ wiggleMag * Math.cos(game.cycle * 0.3))
|
||||
const velocity = Vector.mult(player.velocity, 0.25) //move with player
|
||||
Matter.Body.setPosition(this, Vector.add(velocity, Vector.add(this.position, wiggle)))
|
||||
// Matter.Body.setPosition(this, Vector.add(this.position, wiggle))
|
||||
// const velocity = Vector.mult(player.velocity, 0.25) //move with player
|
||||
// Matter.Body.setPosition(this, Vector.add(velocity, Vector.add(this.position, wiggle)))
|
||||
Matter.Body.setPosition(this, Vector.add(this.position, wiggle))
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -755,9 +756,6 @@ const b = {
|
||||
if (180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180) > 0.3) bullet[me].isBranch = true; //don't draw stroke for this bullet
|
||||
b.lastAngle = mech.angle //track last angle for the above angle difference calculation
|
||||
if (!mech.wasExtruderOn) bullet[me].isBranch = true;
|
||||
mech.isExtruderOn = true
|
||||
} else {
|
||||
mech.isExtruderOn = false
|
||||
}
|
||||
},
|
||||
plasma() {
|
||||
@@ -1338,7 +1336,7 @@ const b = {
|
||||
const THRUST = 0.004
|
||||
const dir = mech.angle + spread * (Math.random() - 0.5);
|
||||
const RADIUS = 18
|
||||
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, {
|
||||
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 4, RADIUS, {
|
||||
angle: dir - Math.PI,
|
||||
inertia: Infinity,
|
||||
friction: 0,
|
||||
|
||||
39
js/index.js
39
js/index.js
@@ -212,11 +212,30 @@ const build = {
|
||||
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[mech.fieldMode].name}</div> ${mech.fieldUpgrades[mech.fieldMode].description}</div>`
|
||||
for (let i = 0, len = mod.mods.length; i < len; i++) {
|
||||
if (mod.mods[i].count > 0) {
|
||||
if (mod.mods[i].count === 1) {
|
||||
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div> ${mod.mods[i].description}</div>`
|
||||
const isCount = mod.mods[i].count > 1 ? `(${mod.mods[i].count}x)` : "";
|
||||
|
||||
if (mod.mods[i].isFieldMod) {
|
||||
text += `<div class="pause-grid-module"><div class="grid-title">
|
||||
<span style="position:relative;">
|
||||
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:1;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
||||
</span>
|
||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
||||
} else if (mod.mods[i].isGunMod) {
|
||||
text += `<div class="pause-grid-module"><div class="grid-title">
|
||||
<span style="position:relative;">
|
||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.75;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
||||
</span>
|
||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
||||
} else {
|
||||
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div> ${mod.mods[i].description}</div>`
|
||||
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
||||
}
|
||||
// if (mod.mods[i].count === 1) {
|
||||
// text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div> ${mod.mods[i].description}</div>`
|
||||
// } else {
|
||||
// text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div> ${mod.mods[i].description}</div>`
|
||||
// }
|
||||
countMods++
|
||||
}
|
||||
}
|
||||
@@ -281,14 +300,14 @@ const build = {
|
||||
modID.innerHTML = ` <div class="grid-title">
|
||||
<span style="position:relative;">
|
||||
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:1;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
||||
</span>
|
||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div>`
|
||||
} else if (mod.mods[i].isGunMod) {
|
||||
modID.innerHTML = ` <div class="grid-title">
|
||||
<span style="position:relative;">
|
||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.6;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.75;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
||||
</span>
|
||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div>`
|
||||
} else {
|
||||
@@ -349,7 +368,6 @@ const build = {
|
||||
for (let i = 0, len = mech.fieldUpgrades.length; i < len; i++) {
|
||||
text += `<div id ="field-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'field')"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[i].name}</div> ${mech.fieldUpgrades[i].description}</div>`
|
||||
}
|
||||
|
||||
for (let i = 0, len = b.guns.length; i < len; i++) {
|
||||
text += `<div id = "gun-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'gun')"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[i].name}</div> ${b.guns[i].description}</div>`
|
||||
}
|
||||
@@ -360,14 +378,7 @@ const build = {
|
||||
} else if (mod.mods[i].count > 1) {
|
||||
text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div> ${mod.mods[i].description}</div>`
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div> ${mod.mods[i].description}</div>`
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,12 +155,12 @@ const level = {
|
||||
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
|
||||
// spawn.boost(1500, 0, 900);
|
||||
|
||||
spawn.starter(1900, -500, 200)
|
||||
// spawn.starter(1900, -500, 200) //big boy
|
||||
// spawn.exploder(2900, -500)
|
||||
// spawn.launcherBoss(1200, -500)
|
||||
// spawn.laserTargetingBoss(1600, -400)
|
||||
// spawn.striker(1600, -500)
|
||||
// spawn.shooter(1700, -120)
|
||||
spawn.shooter(1700, -120)
|
||||
// spawn.bomberBoss(1400, -500)
|
||||
// spawn.sniper(1800, -120)
|
||||
// spawn.cellBossCulture(1600, -500)
|
||||
|
||||
@@ -3391,7 +3391,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "micro-extruder",
|
||||
description: "<strong class='color-plasma'>plasma</strong> torch ejects a thin <strong class='color-plasma'>hot</strong> wire<br>increases <strong class='color-d'>damage</strong>, and <strong class='color-f'>energy</strong> drain",
|
||||
description: "<strong class='color-plasma'>plasma</strong> <strong>torch</strong> extrudes a thin <strong class='color-plasma'>hot</strong> wire<br>increases <strong class='color-d'>damage</strong>, and <strong class='color-f'>energy</strong> drain",
|
||||
isFieldMod: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
|
||||
@@ -1641,6 +1641,7 @@ const mech = {
|
||||
effect() {
|
||||
mech.fieldMeterColor = "#f0f"
|
||||
mech.hold = function() {
|
||||
mech.isExtruderOn = false
|
||||
if (mech.isHolding) {
|
||||
mech.drawHold(mech.holdingTarget);
|
||||
mech.holding();
|
||||
|
||||
@@ -313,7 +313,27 @@ const powerUps = {
|
||||
|
||||
if (options.length > 0) {
|
||||
const choose = options[Math.floor(Math.random() * options.length)]
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[choose].name}</div> ${mod.mods[choose].description}</div>`
|
||||
const isCount = mod.mods[choose].count > 0 ? `(${mod.mods[choose].count+1}x)` : "";
|
||||
|
||||
if (mod.mods[choose].isFieldMod) {
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title">
|
||||
<span style="position:relative;">
|
||||
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:1;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
||||
</span>
|
||||
${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div></div>`
|
||||
} else if (mod.mods[choose].isGunMod) {
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title">
|
||||
<span style="position:relative;">
|
||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.75;"></div>
|
||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
||||
</span>
|
||||
${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div></div>`
|
||||
} else {
|
||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div>`
|
||||
}
|
||||
|
||||
// text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[choose].name}</div> ${mod.mods[choose].description}</div>`
|
||||
return choose
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user