rule 30
plasma ball damage radius is 2x bigger map collisions radius is unchanged it no longer pops after hitting mobs energy drain is 50% higher JUNK tech: rule 30 generalist cycles guns with final boss phases
This commit is contained in:
15
js/player.js
15
js/player.js
@@ -2108,6 +2108,7 @@ const m = {
|
||||
Matter.Composite.remove(engine.world, m.plasmaBall);
|
||||
}
|
||||
if (tech.isPlasmaBall) {
|
||||
const circleRadiusScale = 2
|
||||
m.plasmaBall = Bodies.circle(m.pos.x + 10 * Math.cos(m.angle), m.pos.y + 10 * Math.sin(m.angle), 1, {
|
||||
// collisionFilter: {
|
||||
// group: 0,
|
||||
@@ -2120,12 +2121,12 @@ const m = {
|
||||
isPopping: false,
|
||||
isAttached: false,
|
||||
isOn: false,
|
||||
drain: 0.0011,
|
||||
drain: 0.0017,
|
||||
radiusLimit: 10,
|
||||
damage: 0.8,
|
||||
setPositionToNose() {
|
||||
const nose = { x: m.pos.x + 10 * Math.cos(m.angle), y: m.pos.y + 10 * Math.sin(m.angle) }
|
||||
Matter.Body.setPosition(this, Vector.add(nose, Vector.mult(Vector.normalise(Vector.sub(nose, m.pos)), this.circleRadius)));
|
||||
Matter.Body.setPosition(this, Vector.add(nose, Vector.mult(Vector.normalise(Vector.sub(nose, m.pos)), circleRadiusScale * this.circleRadius)));
|
||||
},
|
||||
fire() {
|
||||
this.isAttached = false;
|
||||
@@ -2149,6 +2150,7 @@ const m = {
|
||||
this.isPopping = false
|
||||
},
|
||||
do() {
|
||||
// console.log(this.circleRadius)
|
||||
if (this.isOn) {
|
||||
//collisions with map
|
||||
if (Matter.Query.collides(this, map).length > 0) {
|
||||
@@ -2203,12 +2205,13 @@ const m = {
|
||||
//damage nearby mobs
|
||||
const dmg = this.damage * m.dmgScale
|
||||
const arcList = []
|
||||
const dischargeRange = 150 + 1600 * tech.plasmaDischarge + 1.3 * this.circleRadius
|
||||
const damageRadius = circleRadiusScale * this.circleRadius
|
||||
const dischargeRange = 150 + 1600 * tech.plasmaDischarge + 1.3 * damageRadius
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (mob[i].alive && (!mob[i].isBadTarget || mob[i].isMobBullet)) {
|
||||
const sub = Vector.magnitude(Vector.sub(this.position, mob[i].position))
|
||||
if (sub < this.circleRadius + mob[i].radius) {
|
||||
if (!this.isAttached && !mob[i].isMobBullet) this.isPopping = true
|
||||
if (sub < damageRadius + mob[i].radius) {
|
||||
// if (!this.isAttached && !mob[i].isMobBullet) this.isPopping = true
|
||||
mob[i].damage(dmg);
|
||||
if (mob[i].speed > 5) {
|
||||
Matter.Body.setVelocity(mob[i], { //friction
|
||||
@@ -2271,7 +2274,7 @@ const m = {
|
||||
}
|
||||
|
||||
//graphics
|
||||
const radius = this.circleRadius * (0.99 + 0.02 * Math.random()) + 3 * Math.random()
|
||||
const radius = circleRadiusScale * this.circleRadius * (0.99 + 0.02 * Math.random()) + 3 * Math.random()
|
||||
const gradient = ctx.createRadialGradient(this.position.x, this.position.y, 0, this.position.x, this.position.y, radius);
|
||||
const alpha = this.alpha + 0.1 * Math.random()
|
||||
gradient.addColorStop(0, `rgba(255,255,255,${alpha})`);
|
||||
|
||||
Reference in New Issue
Block a user