mod- drone harvester
This commit is contained in:
16
js/bullet.js
16
js/bullet.js
@@ -675,7 +675,7 @@ const b = {
|
|||||||
frictionAir: FRICTION,
|
frictionAir: FRICTION,
|
||||||
restitution: 1,
|
restitution: 1,
|
||||||
dmg: 0.28, //damage done in addition to the damage from momentum
|
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),
|
endCycle: game.cycle + Math.floor((1100 + 420 * Math.random()) * mod.isBulletsLastLonger),
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
@@ -686,6 +686,7 @@ const b = {
|
|||||||
lockedOn: null,
|
lockedOn: null,
|
||||||
isFollowMouse: true,
|
isFollowMouse: true,
|
||||||
deathCycles: 110 + RADIUS * 5,
|
deathCycles: 110 + RADIUS * 5,
|
||||||
|
isImproved: false,
|
||||||
onDmg(who) {
|
onDmg(who) {
|
||||||
//move away from target after hitting
|
//move away from target after hitting
|
||||||
const unit = Vector.mult(Vector.normalise(Vector.sub(this.position, who.position)), -20)
|
const unit = Vector.mult(Vector.normalise(Vector.sub(this.position, who.position)), -20)
|
||||||
@@ -727,8 +728,7 @@ const b = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.lockedOn && !mod.isArmorFromPowerUps) {
|
if (!this.lockedOn && !mod.isArmorFromPowerUps && !this.isImproved) { //grab a power up
|
||||||
//grab a power up if it is (ammo) or (a heal when player is low)
|
|
||||||
let closeDist = Infinity;
|
let closeDist = Infinity;
|
||||||
for (let i = 0, len = powerUp.length; i < len; ++i) {
|
for (let i = 0, len = powerUp.length; i < len; ++i) {
|
||||||
if (
|
if (
|
||||||
@@ -739,11 +739,19 @@ const b = {
|
|||||||
const TARGET_VECTOR = Vector.sub(this.position, powerUp[i].position)
|
const TARGET_VECTOR = Vector.sub(this.position, powerUp[i].position)
|
||||||
const DIST = Vector.magnitude(TARGET_VECTOR);
|
const DIST = Vector.magnitude(TARGET_VECTOR);
|
||||||
if (DIST < closeDist) {
|
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();
|
powerUps.onPickUp();
|
||||||
powerUp[i].effect();
|
powerUp[i].effect();
|
||||||
Matter.World.remove(engine.world, powerUp[i]);
|
Matter.World.remove(engine.world, powerUp[i]);
|
||||||
powerUp.splice(i, 1);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
closeDist = DIST;
|
closeDist = DIST;
|
||||||
|
|||||||
21
js/mods.js
21
js/mods.js
@@ -863,7 +863,7 @@ const mod = {
|
|||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
return !mod.isEnergyHealth
|
return !mod.isEnergyHealth && !mod.isDroneGrab
|
||||||
},
|
},
|
||||||
requires: "not mass-energy equivalence",
|
requires: "not mass-energy equivalence",
|
||||||
effect() {
|
effect() {
|
||||||
@@ -1802,6 +1802,22 @@ const mod = {
|
|||||||
mod.isFastDrones = false
|
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",
|
name: "superfluidity",
|
||||||
description: "<strong class='color-s'>freeze</strong> effects apply to mobs near it's target",
|
description: "<strong class='color-s'>freeze</strong> effects apply to mobs near it's target",
|
||||||
@@ -2454,6 +2470,7 @@ const mod = {
|
|||||||
isMineDrop: null,
|
isMineDrop: null,
|
||||||
isRerollBots: null,
|
isRerollBots: null,
|
||||||
isRailTimeSlow: null,
|
isRailTimeSlow: null,
|
||||||
isBotUpgrade: null
|
isBotUpgrade: null,
|
||||||
|
isDroneGrab: null
|
||||||
// isMaxHealthRemove: null
|
// isMaxHealthRemove: null
|
||||||
}
|
}
|
||||||
4
todo.txt
4
todo.txt
@@ -1,8 +1,6 @@
|
|||||||
|
|
||||||
heal power ups scale in size to indicate mod effects, and level based heal scaling
|
|
||||||
testingChamber changes
|
|
||||||
|
|
||||||
************** TODO - n-gon **************
|
************** TODO - n-gon **************
|
||||||
|
|
||||||
new gun - deploy a turret that last for 20 seconds
|
new gun - deploy a turret that last for 20 seconds
|
||||||
fire nails at nearby targets once a second.
|
fire nails at nearby targets once a second.
|
||||||
use mine code and bot code
|
use mine code and bot code
|
||||||
|
|||||||
Reference in New Issue
Block a user