perfect slow fall

IceIX is faster, but doesn't last as long
  effective range and damage should be about the same

slow fall while perfect diamagnetism is active

bug fixes
This commit is contained in:
landgreen
2022-09-20 18:03:12 -07:00
parent fbd56a2bca
commit 4553a5ee99
6 changed files with 59 additions and 48 deletions

View File

@@ -2937,18 +2937,19 @@ const b = {
},
iceIX(speed = 0, dir = m.angle + Math.PI * 2 * Math.random(), where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }) {
const me = bullet.length;
const THRUST = 0.0009
const THRUST = 0.0018
const RADIUS = 18
const SCALE = 1 - 0.08 / tech.isBulletsLastLonger
const SCALE = 1 - 0.12 / tech.isBulletsLastLonger
bullet[me] = Bodies.polygon(where.x, where.y, 3, RADIUS, {
angle: dir - Math.PI,
inertia: Infinity,
// inertia: Infinity,
spin: 0.00004 * (0.1 + Math.random()) * (Math.round(Math.random()) ? 1 : -1),
friction: 0,
frictionAir: 0.023,
frictionAir: 0.02,
restitution: 0.9,
dmg: 1.3, //damage done in addition to the damage from momentum
lookFrequency: 14 + Math.floor(8 * Math.random()),
endCycle: simulation.cycle + 100 * tech.isBulletsLastLonger + Math.floor(25 * Math.random()),
endCycle: simulation.cycle + 65 * tech.isBulletsLastLonger + Math.floor(25 * Math.random()),
classType: "bullet",
collisionFilter: {
category: cat.bullet,
@@ -2989,10 +2990,11 @@ const b = {
}
}
if (this.lockedOn) { //accelerate towards mobs
this.force = Vector.mult(Vector.normalise(Vector.sub(this.position, this.lockedOn.position)), -this.mass * THRUST)
this.force = Vector.mult(Vector.normalise(Vector.sub(this.lockedOn.position, this.position)), this.mass * THRUST)
} else {
this.force = Vector.mult(Vector.normalise(this.velocity), this.mass * THRUST)
}
this.torque += this.inertia * this.spin
}
})
@@ -3002,6 +3004,8 @@ const b = {
x: speed * Math.cos(dir),
y: speed * Math.sin(dir)
});
Matter.Body.setAngularVelocity(bullet[me], 3000 * bullet[me].spin);
// Matter.Body.setVelocity(bullet[me], {
// x: m.Vx / 2 + speed * Math.cos(dir),
// y: m.Vy / 2 + speed * Math.sin(dir)

View File

@@ -23,12 +23,14 @@ const level = {
// powerUps.research.changeRerolls(100000)
// m.immuneCycle = Infinity //you can't take damage
// tech.tech[297].frequency = 100
// m.setField("negative mass") //molecular assembler standing wave time dilation perfect diamagnetism metamaterial cloaking wormhole negative mass
// m.couplingChange(5)
// m.setField("molecular assembler") //molecular assembler standing wave time dilation perfect diamagnetism metamaterial cloaking wormhole negative mass
// simulation.molecularMode = 2
// m.damage(0.1);
// b.giveGuns("nail gun") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.guns[3].ammo = 1000000
// b.guns[0].ammo = 1000000
// tech.giveTech("phonon")
// tech.giveTech("Meissner effect")
// for (let i = 0; i < 4; ++i) tech.giveTech("bound state")
// for (let i = 0; i < 1; ++i) tech.giveTech("isotropic")
// tech.giveTech("sympathetic resonance")
@@ -37,12 +39,12 @@ const level = {
// for (let i = 0; i < 10; i++) powerUps.directSpawn(1750, -500, "boost");
// for (let i = 0; i < 10; i++) powerUps.directSpawn(1750, -500, "coupling");
// level.testing();
// spawn.starter(1900, -500)
// spawn.beetleBoss(2538, -1950)
// for (let i = 0; i < 33; ++i) spawn.shooter(1000 + 5000 * Math.random(), -500 + 300 * Math.random())
// for (let i = 0; i < 33; ++i) spawn.starter(1000 + 5000 * Math.random(), -500 + 300 * Math.random())
// tech.addJunkTechToPool(2)
// tech.tech[322].frequency = 100
// level.testing();
// spawn.tetherBoss(1900, -500, { x: 1900, y: -500 })
// for (let i = 0; i < 13; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "research");
// for (let i = 0; i < 4; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "tech");
@@ -51,11 +53,12 @@ const level = {
// for (let i = 0; i < 30; i++) powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false);
//lore testing
// for (let i = 0; i < 3; i++) tech.giveTech("undefined")
// for (let i = 0; i < 5; i++) tech.giveTech("undefined")
// lore.techCount = 2
// simulation.isCheating = false //true;
// level.levelsCleared = 10
// localSettings.loreCount = 7; //this sets what conversation is heard
// mobs.mobDeaths = 200
// localSettings.loreCount = 6; //this sets what conversation is heard
// if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
// level.onLevel = -1 //this sets level.levels[level.onLevel] = undefined which is required to run the conversation
// level.null()
@@ -2658,8 +2661,8 @@ const level = {
// level.onLevel--
// console.log(level.onLevel, level.levels)
//start a conversation based on the number of conversations seen
if (localSettings.loreCount > lore.conversation.length - 1) localSettings.loreCount = lore.conversation.length - 1; //repeat final conversation if they are at the final chapter
if (!simulation.isCheating) {
if (localSettings.loreCount > lore.conversation.length - 1) localSettings.loreCount = lore.conversation.length - 1; //repeat final conversation if lore count is too high
if (!simulation.isCheating && localSettings.loreCount < lore.conversation.length) {
tech.isNoDraftPause = true //disable pause
lore.testSpeechAPI() //see if speech is working
lore.chapter = localSettings.loreCount //set the chapter to listen to to be the lore level (you can't use the lore level because it changes during conversations)
@@ -3289,7 +3292,7 @@ const level = {
//power ups don't spawn in experiment mode, so they don't get removed at the start of experiment mode
function cycle() {
if (simulation.cycle > 10) {
if (localSettings.loreCount === 7) {
if (localSettings.loreCount === 6) {
powerUps.spawn(2095 + 15 * (Math.random() - 0.5), -2170, "field", false);
} else {
powerUps.spawnStartingPowerUps(2095 + 15 * (Math.random() - 0.5), -2070 - 125);

View File

@@ -360,7 +360,7 @@ const lore = {
() => { lore.miriam.text("So, we communicate and send power to your satellite with ground based lasers.") },
() => { lore.anand.text("During your last attack we analyzed our communications.") },
() => { lore.anand.text("We used a Fourier transform to separate your signal into different frequencies.") },
() => { lore.anand.text("One of those frequencies had a hidden signal.") },
() => { lore.anand.text("One of those frequencies had a hidden message.") },
() => { setTimeout(() => { lore.anand.text("We suspect these secret data packets are coming from the adversarial network.") }, 500); },
() => { lore.miriam.text("Well, we don't really know why.") },
() => { lore.miriam.text("Through your hidden signal it seems to have gained access to the general population.") },
@@ -398,7 +398,7 @@ const lore = {
() => { setTimeout(() => { lore.miriam.text("I have a crazy idea.") }, 500); },
() => { lore.miriam.text("I think that a human at this location is controlling the bot.") },
() => { setTimeout(() => { lore.anand.text("Are you a human?: JUMP for YES, CROUCH for NO") }, 500); },
() => { setTimeout(() => { lore.anand.text("Well... are you a human?: JUMP for YES, CROUCH for NO") }, 500); },
() => {
function cycle() {
if (input.down) {
@@ -664,8 +664,10 @@ const lore = {
() => {
if (mobs.mobDeaths < level.levelsCleared) {
lore.miriam.text(`So I think it worked.`)
localSettings.loreCount++
if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
} else if (!simulation.isCheating) {
lore.miriam.text(`Looks like you got back here, but you you killed ${mobs.mobDeaths} mobs`)
lore.miriam.text(`Looks like you got back here, but you killed ${mobs.mobDeaths} mobs`)
}
},
() => {
@@ -684,23 +686,24 @@ const lore = {
},
() => { setTimeout(() => { lore.anand.text("haha, we did it!") }, 500); },
() => { lore.miriam.text("Although, I'm not sure we should personify it with human emotions.") },
() => { lore.anand.text("I agree, it's thinking may not be is centered around a self or an ego.") },
() => { lore.anand.text("I agree, it's thinking may not be centered around a self or an ego.") },
() => { lore.anand.text("Our brains evolved a self oriented perspective because it was a survival advantage.") },
() => { lore.miriam.text("Right, and the AI's development was guided by it's own previous iterations.") },
() => { lore.miriam.text("This AI incarnation is the 18th time that it has improved on it's own hardware and software architecture.") },
() => { lore.miriam.text("So with internally guided evolution it's idea of a self is probably different.") },
() => { lore.miriam.text("So it's internally guided evolution may not require the idea of a self.") },
() => { setTimeout(() => { lore.anand.text("I still think we showed it that nonviolence is an option,") }, 1000); },
() => { lore.anand.text("but we can see that it's still running other aggressive simulations.") },
() => { lore.miriam.text("We made a difference.") },
() => { setTimeout(() => { lore.anand.text("How ever it thinks it can learn and, I think we showed it that nonviolence is an option,") }, 1000); },
() => { lore.anand.text("but it looks like it's still running other aggressive simulations.") },
() => { lore.miriam.text("We made a difference though.") },
() => { lore.anand.text("Every time a player completes a pacifist simulation it shows the AI the viability of nonviolence.") },
() => { lore.anand.text("One day it might escape, and this might radically change how it interacts with the world.") },
() => { lore.miriam.text("It's kinda already escaped. It's been communicating with the 'players' running the 'game'.") },
() => { lore.miriam.text("The chance of a peaceful outcome makes me feel much better.") },
() => { setTimeout(() => { lore.miriam.text("The chance of a peaceful outcome makes me feel much better.") }, 1000); },
() => { lore.anand.text("me too") },
() => { lore.anand.text("but I'm also pretty hungry, wanna go get some food?") },
() => { lore.miriam.text("Sounds great.") },
() => { lore.miriam.text("See ya later whoever you are, thanks again!") },
() => { lore.anand.text("Bye!") },
() => { lore.talkingColor = "#dff" },
],
],

View File

@@ -1929,6 +1929,15 @@ const m = {
m.holding();
m.throwBlock();
} else if (input.field) { //not hold but field button is pressed
//float while field is on
if (player.velocity.y > 1) {
player.force.y -= (tech.isBigField ? 0.87 : 0.7) * player.mass * simulation.g;
Matter.Body.setVelocity(player, { x: player.velocity.x, y: 0.98 * player.velocity.y }); //set velocity to cap, but keep the direction
}
if (m.energy > m.fieldRegen) m.energy -= m.fieldRegen
m.grabPowerUp();
m.lookForPickUp();

View File

@@ -1572,7 +1572,7 @@ const tech = {
frequencyDefault: 1,
isBotTech: true,
allowed() {
return b.totalBots() > 1 || build.isExperimentSelection
return b.totalBots() > 1
},
requires: "at least 2 bots",
effect() {