dark star

community map crimsonTowers by Richard0820

new MACHO animation

tech: dark star - MACHO is bigger and damages mobs
This commit is contained in:
landgreen
2023-08-21 21:21:43 -07:00
parent bffaeedcfb
commit 99bd1c876e
7 changed files with 1207 additions and 34 deletions

BIN
img/dark star.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -396,7 +396,7 @@
</g> </g>
</svg> </svg>
<script src='lib/matter.min.js'></script> <script src='lib/matter.min.js'></script>
<script src='lib/decomp.min.js'></script> <!-- <script src='lib/decomp.min.js'></script> -->
<script src="js/simulation.js"></script> <script src="js/simulation.js"></script>
<script src="js/player.js"></script> <script src="js/player.js"></script>
<script src="js/powerup.js"></script> <script src="js/powerup.js"></script>

View File

@@ -2241,7 +2241,7 @@ const b = {
ctx.stroke(); ctx.stroke();
ctx.lineJoin = "round" ctx.lineJoin = "round"
ctx.miterLimit = 10 ctx.miterLimit = 10
ctx.strokeStyle = "#000" ctx.fillStyle = "#000"
ctx.fill(); ctx.fill();
}, },
drawString() { drawString() {
@@ -2855,21 +2855,14 @@ const b = {
let lastBestOdd let lastBestOdd
let lastBestEven = best.who //used in hack below let lastBestEven = best.who //used in hack below
if (best.dist2 !== Infinity) { //if hitting something if (best.dist2 !== Infinity) { //if hitting something
path[path.length - 1] = { path[path.length - 1] = { x: best.x, y: best.y };
x: best.x,
y: best.y
};
laserHitMob(); laserHitMob();
for (let i = 0; i < reflections; i++) { for (let i = 0; i < reflections; i++) {
reflection(); reflection();
checkForCollisions(); checkForCollisions();
if (best.dist2 !== Infinity) { //if hitting something if (best.dist2 !== Infinity) { //if hitting something
lastReflection = best lastReflection = best
path[path.length - 1] = { x: best.x, y: best.y };
path[path.length - 1] = {
x: best.x,
y: best.y
};
damage *= reflectivity damage *= reflectivity
laserHitMob(); laserHitMob();
//I'm not clear on how this works, but it gets rid of a bug where the laser reflects inside a block, often vertically. //I'm not clear on how this works, but it gets rid of a bug where the laser reflects inside a block, often vertically.

File diff suppressed because it is too large Load Diff

View File

@@ -150,7 +150,7 @@ const spawn = {
me.do = function () { me.do = function () {
if (!simulation.isTimeSkipping) { if (!simulation.isTimeSkipping) {
const sine = Math.sin(simulation.cycle * 0.015) const sine = Math.sin(simulation.cycle * 0.015)
this.radius = 370 * (1 + 0.1 * sine) this.radius = 55 * tech.isDarkStar + 370 * (1 + 0.1 * sine)
//chase player //chase player
const sub = Vector.sub(player.position, this.position) const sub = Vector.sub(player.position, this.position)
const mag = Vector.magnitude(sub) const mag = Vector.magnitude(sub)
@@ -188,6 +188,34 @@ const spawn = {
ctx.strokeStyle = "#000" ctx.strokeStyle = "#000"
ctx.lineWidth = 1; ctx.lineWidth = 1;
ctx.stroke(); ctx.stroke();
if (tech.isDarkStar && !m.isCloak) { //&& !m.isBodiesAsleep
ctx.fillStyle = "rgba(10,0,40,0.4)"
ctx.fill()
//damage mobs
for (let i = 0, len = mob.length; i < len; ++i) {
if (mob[i].alive && !mob[i].isShielded) {
if (Vector.magnitude(Vector.sub(this.position, mob[i].position)) - mob[i].radius < this.radius) {
mob[i].damage(0.02 * m.dmgScale);
// mob[i].locatePlayer();//
simulation.drawList.push({ //add dmg to draw queue
x: mob[i].position.x,
y: mob[i].position.y,
radius: mob[i].radius + 8,
color: `rgba(10,0,40,0.1)`, // random hue, but not red
time: 4
});
}
}
}
}
//draw growing and fading out ring around the arc
ctx.beginPath();
const rate = 150
const r = simulation.cycle % rate
ctx.arc(this.position.x, this.position.y, 15 + this.radius + 0.3 * r, 0, 2 * Math.PI);
ctx.strokeStyle = `rgba(0,0,0,${0.5 * Math.max(0, 1 - 1.4 * r / rate)})`
ctx.stroke();
} }
} }
}, },
@@ -3889,10 +3917,7 @@ const spawn = {
me.frictionStatic = 0; me.frictionStatic = 0;
me.friction = 0; me.friction = 0;
me.lookTorque = 0.0000055 * (Math.random() > 0.5 ? -1 : 1) * (1 + 0.1 * Math.sqrt(simulation.difficulty)) me.lookTorque = 0.0000055 * (Math.random() > 0.5 ? -1 : 1) * (1 + 0.1 * Math.sqrt(simulation.difficulty))
me.fireDir = { me.fireDir = { x: 0, y: 0 }
x: 0,
y: 0
}
Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random()) spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random())
@@ -5627,7 +5652,7 @@ const spawn = {
mobs.spawn(x, y, 6, radius, "rgb(180,199,245)"); mobs.spawn(x, y, 6, radius, "rgb(180,199,245)");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
Matter.Body.rotate(me, 2 * Math.PI * Math.random()); Matter.Body.rotate(me, 2 * Math.PI * Math.random());
me.accelMag = 0.0009 * simulation.accelScale; me.accelMag = 0.001 * simulation.accelScale;
me.torqueMagnitude = -0.000012 * me.inertia //* (Math.random() > 0.5 ? -1 : 1); me.torqueMagnitude = -0.000012 * me.inertia //* (Math.random() > 0.5 ? -1 : 1);
me.frictionStatic = 0; me.frictionStatic = 0;
me.friction = 0; me.friction = 0;
@@ -5636,7 +5661,7 @@ const spawn = {
me.cd = 0; me.cd = 0;
me.swordRadius = 0; me.swordRadius = 0;
me.swordVertex = 1 me.swordVertex = 1
me.swordRadiusMax = 275 + 3.5 * simulation.difficulty; me.swordRadiusMax = 320 + 3.6 * simulation.difficulty;
me.swordRadiusGrowRate = me.swordRadiusMax * (0.011 + 0.0002 * simulation.difficulty) me.swordRadiusGrowRate = me.swordRadiusMax * (0.011 + 0.0002 * simulation.difficulty)
me.isSlashing = false; me.isSlashing = false;
me.swordDamage = 0.03 * simulation.dmgScale me.swordDamage = 0.03 * simulation.dmgScale
@@ -5744,7 +5769,7 @@ const spawn = {
mobs.spawn(x, y, sides, radius, "rgb(180,215,235)"); mobs.spawn(x, y, sides, radius, "rgb(180,215,235)");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
Matter.Body.rotate(me, 2 * Math.PI * Math.random()); Matter.Body.rotate(me, 2 * Math.PI * Math.random());
me.accelMag = 0.0005 * simulation.accelScale; me.accelMag = 0.00055 * simulation.accelScale;
me.frictionStatic = 0; me.frictionStatic = 0;
me.friction = 0; me.friction = 0;
me.frictionAir = 0.02; me.frictionAir = 0.02;
@@ -5754,11 +5779,11 @@ const spawn = {
me.swordVertex = 1 me.swordVertex = 1
me.swordRadiusInitial = radius / 2; me.swordRadiusInitial = radius / 2;
me.swordRadius = me.swordRadiusInitial; me.swordRadius = me.swordRadiusInitial;
me.swordRadiusMax = 750 + 6 * simulation.difficulty; me.swordRadiusMax = 800 + 6 * simulation.difficulty;
me.swordRadiusGrowRateInitial = 1.08 me.swordRadiusGrowRateInitial = 1.08
me.swordRadiusGrowRate = me.swordRadiusGrowRateInitial//me.swordRadiusMax * (0.009 + 0.0002 * simulation.difficulty) me.swordRadiusGrowRate = me.swordRadiusGrowRateInitial//me.swordRadiusMax * (0.009 + 0.0002 * simulation.difficulty)
me.isSlashing = false; me.isSlashing = false;
me.swordDamage = 0.04 * simulation.dmgScale me.swordDamage = 0.03 * simulation.dmgScale
me.laserAngle = 3 * Math.PI / 5 me.laserAngle = 3 * Math.PI / 5
const seeDistance2 = me.swordRadiusMax * me.swordRadiusMax const seeDistance2 = me.swordRadiusMax * me.swordRadiusMax
spawn.shield(me, x, y); spawn.shield(me, x, y);

View File

@@ -2487,6 +2487,24 @@ const tech = {
tech.isAxion = false tech.isAxion = false
} }
}, },
{
name: "dark star",
description: "mobs inside the <strong>MACHO</strong> are <strong class='color-d'>damaged</strong><br>increase <strong>MACHO</strong> radius by <strong>15%</strong>",
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.isMACHO
},
requires: "MACHO",
effect() {
tech.isDarkStar = true
},
remove() {
tech.isDarkStar = false
}
},
{ {
name: "ablative drones", name: "ablative drones",
description: "after losing <strong class='color-h'>health</strong> there is a chance<br>to rebuild your broken parts as <strong>drones</strong>", description: "after losing <strong class='color-h'>health</strong> there is a chance<br>to rebuild your broken parts as <strong>drones</strong>",
@@ -11677,6 +11695,7 @@ const tech = {
isRewindField: null, isRewindField: null,
isCrouchRegen: null, isCrouchRegen: null,
isAxion: null, isAxion: null,
isDarkStar: null,
isWormholeMapIgnore: null, isWormholeMapIgnore: null,
isLessDamageReduction: null, isLessDamageReduction: null,
needleTunnel: null, needleTunnel: null,

View File

@@ -1,12 +1,10 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
community map ace by Richard0820
field tech: additive manufacturing - crouch while activating your field to print a throwable block community map crimsonTowers by Richard0820
blocks 80% faster and 80% more dense/more damage
molecular assembler, pilot wave
inflation: 85->90% defense, 300->200% larger blocks new MACHO animation
buckling: can spawn boosts or coupling in addition to heals, ammo, and research
tech: dark star - MACHO is bigger and damages mobs
*********************************************************** TODO ***************************************************** *********************************************************** TODO *****************************************************
@@ -23,6 +21,10 @@ more (all) bosses need to be made of parts
"sneakBoss" could get sneaker adds after each hide phase "sneakBoss" could get sneaker adds after each hide phase
"laserTargetingBoss" could have close range stabbers constrained, a few long range shooters, and a few laser shooters "laserTargetingBoss" could have close range stabbers constrained, a few long range shooters, and a few laser shooters
defense power up - a short term defense boost, like the ones for damage.
Or maybe it would last until you take one hit.
Or last until you lost a total of 20 health.
use cross product rotation for other mobs? use cross product rotation for other mobs?
snipers, shooters? snipers, shooters?
//gently rotate towards the player with a torque, use cross product to decided clockwise or counterclockwise //gently rotate towards the player with a torque, use cross product to decided clockwise or counterclockwise
@@ -1104,7 +1106,8 @@ possible names for tech
memetics memetics
magnetorquers - produce spin by pushing on earth's magnetic field magnetorquers - produce spin by pushing on earth's magnetic field
Josephson junction - superconducting junction Josephson junction - superconducting junction
Pyroelectricity - voltage from temp changes - upgrade from piezoelectricity
dark star - upgrade to WIMPs
******************************************************** CARS IMAGES ******************************************************** ******************************************************** CARS IMAGES ********************************************************