mod- drone harvester

This commit is contained in:
landgreen
2020-07-24 08:06:38 -07:00
parent b6e9410bad
commit dd4e66bde8
3 changed files with 32 additions and 9 deletions

View File

@@ -675,7 +675,7 @@ const b = {
frictionAir: FRICTION,
restitution: 1,
dmg: 0.28, //damage done in addition to the damage from momentum
lookFrequency: 100 + Math.floor(23 * Math.random()),
lookFrequency: 80 + Math.floor(23 * Math.random()),
endCycle: game.cycle + Math.floor((1100 + 420 * Math.random()) * mod.isBulletsLastLonger),
classType: "bullet",
collisionFilter: {
@@ -686,6 +686,7 @@ const b = {
lockedOn: null,
isFollowMouse: true,
deathCycles: 110 + RADIUS * 5,
isImproved: false,
onDmg(who) {
//move away from target after hitting
const unit = Vector.mult(Vector.normalise(Vector.sub(this.position, who.position)), -20)
@@ -727,8 +728,7 @@ const b = {
}
}
}
if (!this.lockedOn && !mod.isArmorFromPowerUps) {
//grab a power up if it is (ammo) or (a heal when player is low)
if (!this.lockedOn && !mod.isArmorFromPowerUps && !this.isImproved) { //grab a power up
let closeDist = Infinity;
for (let i = 0, len = powerUp.length; i < len; ++i) {
if (
@@ -739,11 +739,19 @@ const b = {
const TARGET_VECTOR = Vector.sub(this.position, powerUp[i].position)
const DIST = Vector.magnitude(TARGET_VECTOR);
if (DIST < closeDist) {
if (DIST < 60) { //eat the power up if close enough
if (DIST < 100) { //eat the power up if close enough
powerUps.onPickUp();
powerUp[i].effect();
Matter.World.remove(engine.world, powerUp[i]);
powerUp.splice(i, 1);
if (mod.isDroneGrab) {
this.isImproved = true;
const SCALE = 2
Matter.Body.scale(this, SCALE, SCALE);
this.lookFrequency = 30;
this.endCycle = game.cycle + Math.floor((1100 + 420 * Math.random()) * mod.isBulletsLastLonger) * 2 //set to double a normal lifespan
// this.dmg *= 1.5;
}
break;
}
closeDist = DIST;

View File

@@ -863,7 +863,7 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
return !mod.isEnergyHealth && !mod.isDroneGrab
},
requires: "not mass-energy equivalence",
effect() {
@@ -1802,6 +1802,22 @@ const mod = {
mod.isFastDrones = false
}
},
{
name: "harvester",
description: "when <strong>drones</strong> pick up <strong>power ups</strong><br> improve drone size, lifespan, and vision rate",
maxCount: 1,
count: 0,
allowed() {
return !mod.isArmorFromPowerUps && (mod.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField)))
},
requires: "drones",
effect() {
mod.isDroneGrab = true
},
remove() {
mod.isDroneGrab = false
}
},
{
name: "superfluidity",
description: "<strong class='color-s'>freeze</strong> effects apply to mobs near it's target",
@@ -2454,6 +2470,7 @@ const mod = {
isMineDrop: null,
isRerollBots: null,
isRailTimeSlow: null,
isBotUpgrade: null
isBotUpgrade: null,
isDroneGrab: null
// isMaxHealthRemove: null
}