orbital bot
mod: orbital-bot - 2 bots orbit you and damage mobs mod: orbital-bot upgrade - orbital bots orbit farther away
This commit is contained in:
66
js/bullet.js
66
js/bullet.js
@@ -1013,6 +1013,7 @@ const b = {
|
|||||||
for (let i = 0; i < mod.foamBotCount; i++) b.foamBot()
|
for (let i = 0; i < mod.foamBotCount; i++) b.foamBot()
|
||||||
for (let i = 0; i < mod.boomBotCount; i++) b.boomBot()
|
for (let i = 0; i < mod.boomBotCount; i++) b.boomBot()
|
||||||
for (let i = 0; i < mod.plasmaBotCount; i++) b.plasmaBot()
|
for (let i = 0; i < mod.plasmaBotCount; i++) b.plasmaBot()
|
||||||
|
for (let i = 0; i < mod.orbitBotCount; i++) b.orbitBot()
|
||||||
if (mod.isIntangible && mech.isCloak) {
|
if (mod.isIntangible && mech.isCloak) {
|
||||||
for (let i = 0; i < bullet.length; i++) {
|
for (let i = 0; i < bullet.length; i++) {
|
||||||
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.bullet | cat.mobBullet | cat.mobShield
|
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.bullet | cat.mobBullet | cat.mobShield
|
||||||
@@ -1020,7 +1021,11 @@ const b = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
randomBot(where = mech.pos, isKeep = true) {
|
randomBot(where = mech.pos, isKeep = true) {
|
||||||
if (Math.random() < 0.25) {
|
if (Math.random() < 0.2) {
|
||||||
|
b.orbitBot(where)
|
||||||
|
b.orbitBot(where)
|
||||||
|
if (isKeep) mod.orbitBotCount += 2
|
||||||
|
} else if (Math.random() < 0.25) {
|
||||||
b.nailBot(where)
|
b.nailBot(where)
|
||||||
if (isKeep) mod.nailBotCount++;
|
if (isKeep) mod.nailBotCount++;
|
||||||
} else if (Math.random() < 0.33) {
|
} else if (Math.random() < 0.33) {
|
||||||
@@ -1513,6 +1518,65 @@ const b = {
|
|||||||
})
|
})
|
||||||
World.add(engine.world, bullet[me]); //add bullet to world
|
World.add(engine.world, bullet[me]); //add bullet to world
|
||||||
},
|
},
|
||||||
|
orbitBot(position = mech.pos) {
|
||||||
|
const me = bullet.length;
|
||||||
|
bullet[me] = Bodies.polygon(position.x, position.y, 9, 7, {
|
||||||
|
isUpgraded: mod.isOrbitBotUpgrade,
|
||||||
|
botType: "orbit",
|
||||||
|
friction: 0,
|
||||||
|
frictionStatic: 0,
|
||||||
|
frictionAir: 0,
|
||||||
|
restitution: 0,
|
||||||
|
dmg: 0, // 0.14 //damage done in addition to the damage from momentum
|
||||||
|
minDmgSpeed: 0,
|
||||||
|
endCycle: Infinity,
|
||||||
|
classType: "bullet",
|
||||||
|
collisionFilter: {
|
||||||
|
category: cat.bullet,
|
||||||
|
mask: 0 //cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet | cat.mobShield
|
||||||
|
},
|
||||||
|
onDmg() {},
|
||||||
|
onEnd() {},
|
||||||
|
range: 100 + (100 + 220 * mod.isOrbitBotUpgrade) * (0.7 + 0.6 * Math.random()),
|
||||||
|
orbitalSpeed: 0,
|
||||||
|
phase: 2 * Math.PI * Math.random(),
|
||||||
|
// smoothPlayerPosition: {
|
||||||
|
// x: player.position.x,
|
||||||
|
// y: player.position.y
|
||||||
|
// },
|
||||||
|
do() {
|
||||||
|
//check for damage
|
||||||
|
if (!mech.isCloak && !mech.isBodiesAsleep) { //if time dilation isn't active
|
||||||
|
q = Matter.Query.point(mob, this.position)
|
||||||
|
for (let i = 0; i < q.length; i++) {
|
||||||
|
let dmg = 2.5 * b.dmgScale
|
||||||
|
q[i].damage(dmg);
|
||||||
|
q[i].foundPlayer();
|
||||||
|
game.drawList.push({ //add dmg to draw queue
|
||||||
|
x: this.position.x,
|
||||||
|
y: this.position.y,
|
||||||
|
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||||
|
color: 'rgba(0,0,0,0.4)',
|
||||||
|
time: game.drawTime
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//orbit player
|
||||||
|
const time = game.cycle * this.orbitalSpeed + this.phase
|
||||||
|
const orbit = {
|
||||||
|
x: Math.cos(time),
|
||||||
|
y: 1.1 * Math.sin(time)
|
||||||
|
}
|
||||||
|
// Matter.Body.setPosition(this, Vector.add(player.position, Vector.mult(orbit, this.range))) //bullets move with player
|
||||||
|
// this.smoothPlayerPosition = Vector.add(Vector.mult(Vector.add(player.position, Vector.mult(player.velocity, 5)), 0.1), Vector.mult(this.smoothPlayerPosition, 0.9))
|
||||||
|
// this.smoothPlayerPosition = Vector.add(Vector.mult(player.position, 0.1), Vector.mult(this.smoothPlayerPosition, 0.9))
|
||||||
|
Matter.Body.setPosition(this, Vector.add(player.position, Vector.mult(orbit, this.range))) //bullets move with player
|
||||||
|
}
|
||||||
|
})
|
||||||
|
bullet[me].orbitalSpeed = Math.sqrt(0.7 / bullet[me].range)
|
||||||
|
World.add(engine.world, bullet[me]); //add bullet to world
|
||||||
|
},
|
||||||
// **************************************************************************************************
|
// **************************************************************************************************
|
||||||
// **************************************************************************************************
|
// **************************************************************************************************
|
||||||
// ******************************** Guns *********************************************
|
// ******************************** Guns *********************************************
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ const level = {
|
|||||||
// mech.isCloak = true;
|
// mech.isCloak = true;
|
||||||
// mech.setField("metamaterial cloaking")
|
// mech.setField("metamaterial cloaking")
|
||||||
// b.giveGuns("laser")
|
// b.giveGuns("laser")
|
||||||
// mod.giveMod("Bayesian statistics");
|
// mod.giveMod("orbit-bot");
|
||||||
|
|
||||||
|
|
||||||
level.intro(); //starting level
|
level.intro(); //starting level
|
||||||
// level.testing(); //not in rotation
|
// level.testing(); //not in rotation
|
||||||
|
|||||||
48
js/mods.js
48
js/mods.js
@@ -98,7 +98,7 @@ const mod = {
|
|||||||
return dmg * mod.slowFire * mod.aimDamage
|
return dmg * mod.slowFire * mod.aimDamage
|
||||||
},
|
},
|
||||||
totalBots() {
|
totalBots() {
|
||||||
return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount + mod.boomBotCount + mod.plasmaBotCount
|
return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount + mod.boomBotCount + mod.plasmaBotCount + mod.orbitBotCount
|
||||||
},
|
},
|
||||||
mods: [{
|
mods: [{
|
||||||
name: "integrated armament",
|
name: "integrated armament",
|
||||||
@@ -640,6 +640,46 @@ const mod = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "orbital-bot",
|
||||||
|
description: "2 bots are locked in <strong>orbit</strong> around you<br><strong class='color-d'>damages</strong> mobs on <strong>contact</strong>",
|
||||||
|
maxCount: 9,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
requires: "",
|
||||||
|
effect() {
|
||||||
|
mod.orbitBotCount += 2;
|
||||||
|
b.orbitBot();
|
||||||
|
b.orbitBot();
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
mod.orbitBotCount = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "orbit-bot upgrade",
|
||||||
|
description: "<strong>125%</strong> increased orbital radius <br><em>applies to all current and future orbit-bots</em>",
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return mod.orbitBotCount > 2
|
||||||
|
},
|
||||||
|
requires: "2 or more orbit bots",
|
||||||
|
effect() {
|
||||||
|
mod.isOrbitBotUpgrade = true
|
||||||
|
for (let i = 0; i < bullet.length; i++) {
|
||||||
|
if (bullet[i].botType = 'orbit') bullet[i].isUpgraded = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
mod.isOrbitBotUpgrade = false
|
||||||
|
for (let i = 0; i < bullet.length; i++) {
|
||||||
|
if (bullet[i].botType = 'orbit') bullet[i].isUpgraded = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "perimeter defense",
|
name: "perimeter defense",
|
||||||
description: "reduce <strong class='color-harm'>harm</strong> by <strong>4%</strong><br>for each of your permanent <strong>bots</strong>",
|
description: "reduce <strong class='color-harm'>harm</strong> by <strong>4%</strong><br>for each of your permanent <strong>bots</strong>",
|
||||||
@@ -691,6 +731,10 @@ const mod = {
|
|||||||
b.plasmaBot();
|
b.plasmaBot();
|
||||||
}
|
}
|
||||||
mod.plasmaBotCount *= 2
|
mod.plasmaBotCount *= 2
|
||||||
|
for (let i = 0; i < mod.orbitBotCount; i++) {
|
||||||
|
b.orbitBot();
|
||||||
|
}
|
||||||
|
mod.orbitBotCount *= 2
|
||||||
},
|
},
|
||||||
remove() {}
|
remove() {}
|
||||||
},
|
},
|
||||||
@@ -2811,6 +2855,7 @@ const mod = {
|
|||||||
foamBotCount: null,
|
foamBotCount: null,
|
||||||
boomBotCount: null,
|
boomBotCount: null,
|
||||||
plasmaBotCount: null,
|
plasmaBotCount: null,
|
||||||
|
orbitBotCount: null,
|
||||||
collisionImmuneCycles: null,
|
collisionImmuneCycles: null,
|
||||||
blockDmg: null,
|
blockDmg: null,
|
||||||
isPiezo: null,
|
isPiezo: null,
|
||||||
@@ -2896,6 +2941,7 @@ const mod = {
|
|||||||
isFoamBotUpgrade: null,
|
isFoamBotUpgrade: null,
|
||||||
isLaserBotUpgrade: null,
|
isLaserBotUpgrade: null,
|
||||||
isBoomBotUpgrade: null,
|
isBoomBotUpgrade: null,
|
||||||
|
isOrbitBotUpgrade: null,
|
||||||
isDroneGrab: null,
|
isDroneGrab: null,
|
||||||
isOneGun: null,
|
isOneGun: null,
|
||||||
isDamageForGuns: null,
|
isDamageForGuns: null,
|
||||||
|
|||||||
@@ -1368,7 +1368,7 @@ const mech = {
|
|||||||
}
|
}
|
||||||
} else if (mod.isMissileField) {
|
} else if (mod.isMissileField) {
|
||||||
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
|
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
|
||||||
mech.energy -= 0.55;
|
mech.energy -= 0.5;
|
||||||
b.missile({
|
b.missile({
|
||||||
x: mech.pos.x + 40 * Math.cos(mech.angle),
|
x: mech.pos.x + 40 * Math.cos(mech.angle),
|
||||||
y: mech.pos.y + 40 * Math.sin(mech.angle) - 3
|
y: mech.pos.y + 40 * Math.sin(mech.angle) - 3
|
||||||
@@ -1382,7 +1382,7 @@ const mech = {
|
|||||||
b.iceIX(1)
|
b.iceIX(1)
|
||||||
} else {
|
} else {
|
||||||
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
|
// mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
|
||||||
mech.energy -= 0.3;
|
mech.energy -= 0.33;
|
||||||
b.drone(1)
|
b.drone(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
todo.txt
12
todo.txt
@@ -1,8 +1,5 @@
|
|||||||
mod: decorrelation - 2 seconds after you don't use your gun or field get 40% harm reduction
|
mod: orbital-bot - 2 bots orbit you and damage mobs
|
||||||
|
mod: orbital-bot upgrade - orbital bots orbit farther away
|
||||||
mod: anticorrelation - 2 seconds after you don't use your gun or field get 50% damage
|
|
||||||
requires decorrelation
|
|
||||||
|
|
||||||
|
|
||||||
************** TODO - n-gon **************
|
************** TODO - n-gon **************
|
||||||
|
|
||||||
@@ -50,10 +47,7 @@ a bot that eats up health and ammo, but poops a reroll after picking up 2 power
|
|||||||
disable crystalized armor?
|
disable crystalized armor?
|
||||||
could convert rerolls, ammo, and health into mods instead
|
could convert rerolls, ammo, and health into mods instead
|
||||||
|
|
||||||
laser-bot orbits player
|
|
||||||
bot that does AOE damage while it rotates around player
|
|
||||||
no physics / collisions
|
|
||||||
cap 3 ?
|
|
||||||
|
|
||||||
mod: radiation effects can spread to nearby mobs
|
mod: radiation effects can spread to nearby mobs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user