wave beam balance
This commit is contained in:
@@ -1516,22 +1516,22 @@ const b = {
|
|||||||
name: "wave beam", //4
|
name: "wave beam", //4
|
||||||
description: "emit a <strong>sine wave</strong> of oscillating particles<br>particles propagate through <strong>walls</strong>",
|
description: "emit a <strong>sine wave</strong> of oscillating particles<br>particles propagate through <strong>walls</strong>",
|
||||||
ammo: 0,
|
ammo: 0,
|
||||||
ammoPack: 35,
|
ammoPack: 40,
|
||||||
have: false,
|
have: false,
|
||||||
isStarterGun: true,
|
isStarterGun: true,
|
||||||
fire() {
|
fire() {
|
||||||
const me = bullet.length;
|
const me = bullet.length;
|
||||||
const dir = mech.angle
|
const dir = mech.angle
|
||||||
const SCALE = (mech.crouch ? 0.967 : 0.955) + 0.03 * Math.min(1, 0.5 * (b.isModBulletsLastLonger - 1))
|
const SCALE = 0.955 + 0.03 * Math.min(1, 0.5 * (b.isModBulletsLastLonger - 1))
|
||||||
const wiggleMag = ((mech.crouch) ? 0.004 : 0.005) * ((mech.flipLegs === 1) ? 1 : -1)
|
const wiggleMag = ((mech.crouch) ? 0.01 : 0.024) * ((mech.flipLegs === 1) ? 1 : -1)
|
||||||
bullet[me] = Bodies.polygon(mech.pos.x + 25 * Math.cos(dir), mech.pos.y + 25 * Math.sin(dir), 10, 10 * b.modBulletSize, {
|
bullet[me] = Bodies.polygon(mech.pos.x + 25 * Math.cos(dir), mech.pos.y + 25 * Math.sin(dir), 10, 13 * b.modBulletSize, {
|
||||||
angle: dir,
|
angle: dir,
|
||||||
cycle: -0.43, //adjust this number until the bullets line up with the cross hairs
|
cycle: -0.43, //adjust this number until the bullets line up with the cross hairs
|
||||||
endCycle: game.cycle + Math.floor((mech.crouch ? 170 : 130) * b.isModBulletsLastLonger),
|
endCycle: game.cycle + Math.floor(130 * b.isModBulletsLastLonger),
|
||||||
inertia: Infinity,
|
inertia: Infinity,
|
||||||
frictionAir: 0,
|
frictionAir: 0,
|
||||||
minDmgSpeed: 0,
|
minDmgSpeed: 0,
|
||||||
dmg: 0.4, //damage done in addition to the damage from momentum
|
dmg: 0.6, //damage done in addition to the damage from momentum
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: cat.bullet,
|
category: cat.bullet,
|
||||||
@@ -1542,7 +1542,7 @@ const b = {
|
|||||||
do() {
|
do() {
|
||||||
if (!mech.isBodiesAsleep) {
|
if (!mech.isBodiesAsleep) {
|
||||||
this.cycle++
|
this.cycle++
|
||||||
const THRUST = wiggleMag * Math.cos(this.cycle * 0.3)
|
const THRUST = wiggleMag * Math.cos(this.cycle * 0.35)
|
||||||
this.force = Vector.mult(Vector.normalise(this.direction), this.mass * THRUST) //wiggle
|
this.force = Vector.mult(Vector.normalise(this.direction), this.mass * THRUST) //wiggle
|
||||||
|
|
||||||
if (this.cycle > 0 && !(Math.floor(this.cycle) % 6)) Matter.Body.scale(this, SCALE, SCALE); //shrink
|
if (this.cycle > 0 && !(Math.floor(this.cycle) % 6)) Matter.Body.scale(this, SCALE, SCALE); //shrink
|
||||||
@@ -1550,19 +1550,13 @@ const b = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
World.add(engine.world, bullet[me]); //add bullet to world
|
World.add(engine.world, bullet[me]); //add bullet to world
|
||||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 8 : 4) * b.modFireRate); // cool down
|
mech.fireCDcycle = mech.cycle + Math.floor(4 * b.modFireRate); // cool down
|
||||||
const SPEED = 8.5;
|
const SPEED = 8;
|
||||||
Matter.Body.setVelocity(bullet[me], {
|
Matter.Body.setVelocity(bullet[me], {
|
||||||
x: SPEED * Math.cos(dir),
|
x: SPEED * Math.cos(dir),
|
||||||
y: SPEED * Math.sin(dir)
|
y: SPEED * Math.sin(dir)
|
||||||
});
|
});
|
||||||
bullet[me].direction = Vector.perp(bullet[me].velocity)
|
bullet[me].direction = Vector.perp(bullet[me].velocity)
|
||||||
// if (mech.angle + Math.PI / 2 > 0) {
|
|
||||||
// bullet[me].direction = Vector.perp(bullet[me].velocity, true)
|
|
||||||
// } else {
|
|
||||||
// bullet[me].direction = Vector.perp(bullet[me].velocity)
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const level = {
|
|||||||
start() {
|
start() {
|
||||||
if (level.levelsCleared === 0) {
|
if (level.levelsCleared === 0) {
|
||||||
// level.difficultyIncrease(5)
|
// level.difficultyIncrease(5)
|
||||||
b.giveGuns("wave beam")
|
// b.giveGuns("wave beam")
|
||||||
// mech.setField("phase decoherence field")
|
// mech.setField("phase decoherence field")
|
||||||
// b.giveMod("mass-energy equivalence");
|
// b.giveMod("mass-energy equivalence");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user