diff --git a/js/bullets.js b/js/bullets.js index ea35403..4f600cd 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -27,15 +27,14 @@ const b = { game.makeTextLog("Auto-Loading Heuristics
(left click)

your rate of fire 15% is faster

", 1200); b.setModDefaults(); //good for guns with extra ammo: needles, M80, rapid fire, flak, super balls b.modFireRate = 0.85 - //ADD: need to add in something that changes game play + //ADD: maybe add in something that changes game play }, () => { b.mod = 1; game.makeTextLog("Anti-Matter Cores
(left click)

your explosions are larger and do more damage

", 1200); b.setModDefaults(); //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.25; //good for guns with explosions: - //ADD: take no damage from explosions, explosive guns use double ammo, 1.5 radius + b.modExplosionRadius = 2; //good for guns with explosions: }, () => { b.mod = 2; @@ -44,7 +43,7 @@ const b = { //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: need to add in something that changes game play + //ADD: maybe add in something that changes game play }, () => { b.mod = 3; @@ -60,7 +59,7 @@ const b = { }, () => { b.mod = 5; - game.makeTextLog("Desublimated Ammunition
(left click)

1 out of 3 shots will not consume ammo when crouching

", 1200); + game.makeTextLog("Desublimated Ammunition
(left click)

1 out of 2 shots will not consume ammo when crouching

", 1200); b.setModDefaults(); //good with guns that have less ammo: one shot, grenades, missiles, super balls, spray b.modNoAmmo = 1 }, @@ -97,17 +96,16 @@ const b = { }, fire() { if (game.mouseDown && mech.fireCDcycle < mech.cycle && (!(keys[32] || game.mouseDownRight) || mech.fieldFire) && b.inventory.length) { - if (b.guns[this.activeGun].ammo > 0) { - b.guns[this.activeGun].fire(); - + if (b.guns[b.activeGun].ammo > 0) { + b.guns[b.activeGun].fire(); if (b.modNoAmmo && mech.crouch) { - if (b.modNoAmmo % 3) { - b.guns[this.activeGun].ammo--; + if (b.modNoAmmo % 2) { + b.guns[b.activeGun].ammo--; game.updateGunHUD(); } b.modNoAmmo++ //makes the no ammo toggle off and on } else { - b.guns[this.activeGun].ammo--; + b.guns[b.activeGun].ammo--; game.updateGunHUD(); } } else { @@ -264,6 +262,7 @@ const b = { mech.drop(); } + //body knock backs for (let i = 0, len = body.length; i < len; ++i) { sub = Matter.Vector.sub(bullet[me].position, body[i].position); @@ -839,6 +838,7 @@ const b = { const me = bullet.length; bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle) - 3, 30 * b.modBulletSize, 4 * b.modBulletSize, b.fireAttributes(dir)); b.fireProps(mech.crouch ? 70 : 30, -3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8), dir, me); //cd , speed + b.drawOneBullet(bullet[me].vertices); // Matter.Body.setDensity(bullet[me], 0.01) //doesn't help with reducing explosion knock backs bullet[me].force.y += 0.00045; //a small push down at first to make it seem like the missile is briefly falling @@ -931,7 +931,7 @@ const b = { }, { name: "flak", - description: "fire a cluster of high speed explosive projectiles
explode on contact or after half a second", + description: "fire a cluster of explosive projectiles
explode on contact or after half a second", ammo: 0, ammoPack: 18, have: false, @@ -945,11 +945,13 @@ const b = { let dir = mech.angle - angleStep * totalBullets / 2; const side1 = 17 * b.modBulletSize const side2 = 4 * b.modBulletSize + for (let i = 0; i < totalBullets; i++) { //5 -> 7 dir += angleStep const me = bullet.length; bullet[me] = Bodies.rectangle(mech.pos.x + 50 * Math.cos(mech.angle), mech.pos.y + 50 * Math.sin(mech.angle), side1, side2, b.fireAttributes(dir)); b.fireProps(CD, SPEED + 25 * Math.random() - i, dir, me); //cd , speed + //Matter.Body.setDensity(bullet[me], 0.00001); bullet[me].endCycle = i + game.cycle + END bullet[me].restitution = 0; @@ -1011,6 +1013,7 @@ const b = { bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 22 * b.modBulletSize, b.fireAttributes(dir, false)); bullet[me].radius = 22; //used from drawing timer b.fireProps(mech.crouch ? 60 : 40, mech.crouch ? 38 : 30, dir, me); //cd , speed + b.drawOneBullet(bullet[me].vertices); Matter.Body.setDensity(bullet[me], 0.000001); bullet[me].endCycle = game.cycle + Math.floor(140 * b.modBulletsLastLonger); diff --git a/js/player.js b/js/player.js index 344d297..089bb57 100644 --- a/js/player.js +++ b/js/player.js @@ -949,10 +949,12 @@ const mech = { game.makeTextLog("Kinetic Energy Field
(right mouse or space bar)

field does damage on contact
blocks are thrown at a higher velocity

", 1200); mech.setHoldDefaults(); //throw quicker and harder + mech.fieldShieldingScale = 3; + mech.fieldRegen *= 3; mech.throwChargeRate = 3; mech.throwChargeMax = 140; - mech.fieldDamage = 2.5; //passive field does extra damage - mech.fieldArc = 0.09 + mech.fieldDamage = 3; //passive field does extra damage + mech.fieldArc = 0.11 mech.calculateFieldThreshold(); //run after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) mech.hold = function () { @@ -962,7 +964,7 @@ const mech = { mech.throw(); } else if ((keys[32] || game.mouseDownRight) && mech.fieldMeter > 0.15) { //not hold but field button is pressed //draw field - const range = mech.grabRange - 20; + const range = mech.grabRange - 15; ctx.beginPath(); ctx.arc(mech.pos.x, mech.pos.y, range, mech.angle - Math.PI * mech.fieldArc, mech.angle + Math.PI * mech.fieldArc, false); let eye = 13; @@ -1013,9 +1015,8 @@ const mech = { mech.holding(); mech.throw(); } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away - const DRAIN = 0.001 + const DRAIN = 0.0007 if (mech.fieldMeter > DRAIN) { - mech.fieldMeter -= DRAIN; mech.pushMobs360(170); mech.grabPowerUp(); mech.lookForPickUp(170); @@ -1034,25 +1035,28 @@ const mech = { // zeroG(bullet); //works fine, but not that noticeable and maybe not worth the possible performance hit // zeroG(mob); //mobs are too irregular to make this work? - - - player.force.y -= 0.0009 + player.mass * mech.gravity; //constant upward drift Matter.Body.setVelocity(player, { x: player.velocity.x, y: player.velocity.y * 0.97 }); if (keys[83] || keys[40]) { //down - player.force.y += 0.003 - mech.grabRange = mech.grabRange * 0.97 + 350 * 0.03; + player.force.y -= 0.8 * player.mass * mech.gravity; + mech.grabRange = mech.grabRange * 0.97 + 400 * 0.03; + } else if (keys[87] || keys[38]) { //up + mech.fieldMeter -= 3 * DRAIN; + mech.grabRange = mech.grabRange * 0.97 + 750 * 0.03; + player.force.y -= 1.2 * player.mass * mech.gravity; } else { + mech.fieldMeter -= DRAIN; mech.grabRange = mech.grabRange * 0.97 + 650 * 0.03; + player.force.y -= 1.07 * player.mass * mech.gravity; // slow upward drift } //add extra friction for horizontal motion if (keys[65] || keys[68] || keys[37] || keys[39]) { Matter.Body.setVelocity(player, { - x: player.velocity.x * 0.88, + x: player.velocity.x * 0.85, y: player.velocity.y }); }