downpour and buttonbutton community maps

community map downpour by DesBoot
community map buttonbutton by ||Destabilized E||

rounded borders on no-image mode selection cards
foam gun has some recoil
new superball gun image

bug fixes
This commit is contained in:
landgreen
2023-03-24 19:50:45 -07:00
parent e2bf9aae66
commit 3ea8bfd638
9 changed files with 70 additions and 26 deletions

View File

@@ -7143,6 +7143,7 @@ const b = {
have: false,
charge: 0,
isDischarge: false,
knockBack: 0.001,
chooseFireMethod() {
if (tech.isFoamPressure) {
this.do = this.doCharges
@@ -7170,6 +7171,9 @@ const b = {
y: m.pos.y + 30 * Math.sin(m.angle)
}
b.foam(position, Vector.rotate(velocity, spread), radius)
//knock back player
player.force.x -= this.knockBack * velocity.x
player.force.y -= this.knockBack * velocity.y
m.fireCDcycle = m.cycle + Math.floor(1.5 * b.fireCDscale);
},
doCharges() {
@@ -7196,6 +7200,9 @@ const b = {
y: m.pos.y + 30 * Math.sin(m.angle)
}
b.foam(position, Vector.rotate(velocity, spread), radius)
//knock back player
player.force.x -= this.knockBack * velocity.x
player.force.y -= this.knockBack * velocity.y
this.charge -= 0.75
m.fireCDcycle = m.cycle + 2; //disable firing and adding more charge until empty
} else if (!input.fire) {
@@ -7241,6 +7248,9 @@ const b = {
// } else {
// }
b.foam(position, Vector.rotate(velocity, spread), radius)
//knock back player
player.force.x -= this.knockBack * velocity.x
player.force.y -= this.knockBack * velocity.y
m.fireCDcycle = m.cycle + Math.floor(1.5 * b.fireCDscale);
this.charge += 1 + tech.isCapacitor
},

View File

@@ -107,7 +107,7 @@ function collisionChecks(event) {
!mob[k].isSlowed && !mob[k].isStunned
) {
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * simulation.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
if (m.isCloak) dmg *= 0.75
if (m.isCloak) dmg *= 0.5
mob[k].foundPlayer();
if (tech.isRewindAvoidDeath && (m.energy + 0.05) > Math.min(0.95, m.maxEnergy) && dmg > 0.01) { //CPT reversal runs in m.damage, but it stops the rest of the collision code here too
m.damage(dmg);
@@ -336,15 +336,15 @@ function collisionChecks(event) {
}
//determine if player is on the ground
Events.on(engine, "collisionStart", function(event) {
Events.on(engine, "collisionStart", function (event) {
playerOnGroundCheck(event);
// playerHeadCheck(event);
collisionChecks(event);
});
Events.on(engine, "collisionActive", function(event) {
Events.on(engine, "collisionActive", function (event) {
playerOnGroundCheck(event);
// playerHeadCheck(event);
});
Events.on(engine, "collisionEnd", function(event) {
Events.on(engine, "collisionEnd", function (event) {
playerOffGroundCheck(event);
});

View File

@@ -10,7 +10,7 @@ const level = {
// playableLevels: ["pavilion", "pavilion", "pavilion", "pavilion", "pavilion", "pavilion", "pavilion", "pavilion", "pavilion", "pavilion", "pavilion"],
//see level.populateLevels: (intro, ... , reservoir or factory, reactor, ... , gauntlet, final) added later
playableLevels: ["labs", "rooftops", "skyscrapers", "warehouse", "highrise", "office", "aerie", "satellite", "sewers", "testChamber", "pavilion", "lock"],
communityLevels: ["stronghold", "basement", "crossfire", "vats", "run", "n-gon", "house", "perplex", "coliseum", "tunnel", "islands", "temple", "dripp", "biohazard", "stereoMadness", "yingYang", "staircase", "fortress", "commandeer", "clock", "buttonbutton"],
communityLevels: ["stronghold", "basement", "crossfire", "vats", "run", "n-gon", "house", "perplex", "coliseum", "tunnel", "islands", "temple", "dripp", "biohazard", "stereoMadness", "yingYang", "staircase", "fortress", "commandeer", "clock", "buttonbutton", "downpour"],
trainingLevels: ["walk", "crouch", "jump", "hold", "throw", "throwAt", "deflect", "heal", "fire", "nailGun", "shotGun", "superBall", "matterWave", "missile", "stack", "mine", "grenades", "harpoon"],
levels: [],
start() {
@@ -27,14 +27,14 @@ const level = {
// m.immuneCycle = Infinity //you can't take damage
// tech.tech[297].frequency = 100
// m.couplingChange(5)
// m.setField("wormhole") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole
// m.setField("metamaterial cloaking") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole
// 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.giveGuns("wave") //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.giveGuns("foam") //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 = 100000000
// tech.giveTech("recycling")
// tech.giveTech("dead reckoning")
// tech.giveTech("pressure vessel")
// for (let i = 0; i < 1; ++i) tech.giveTech("pseudoscience")
// for (let i = 0; i < 1; ++i) tech.giveTech("options exchange")
// for (let i = 0; i < 1; i++) tech.giveTech("laser-bot")
@@ -42,7 +42,7 @@ const level = {
// for (let i = 0; i < 3; i++) powerUps.directSpawn(450, -50, "tech");
// 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();
// level.downpour();
// spawn.nodeGroup(3200, -300, "sniper")
// spawn.nodeGroup(2200, -300, "sniper")
// spawn.nodeGroup(2200, -300, "sniper")
@@ -18166,6 +18166,7 @@ const level = {
},
downpour() {
simulation.makeTextLog(`<strong>Downpour</strong> by <span class='color-var'>DesBoot</span>`);
simulation.makeTextLog(`<span class='color-var'>level</span>.onLevel = "Downpour"`);
let mobsspawned = 0
const laser = level.hazard(7492, -2612, 10, 500, 0.3) //laserintro
@@ -18205,7 +18206,7 @@ const level = {
do {
ctx.beginPath()
// ctx.fillStyle = "rgba(30,150,117,255)"
ctx.fillStyle = "rgba(30,150,117,255)"
ctx.rect(Math.random() * 4500 - 2000, -5000, Math.random() * 3 + 2.5, 5000)
ctx.rect(Math.random() * 4500 - 2000, -5000, Math.random() * 3 + 2.5, 5000)
ctx.rect(Math.random() * 4500 - 2000, -5000, Math.random() * 3 + 2.5, 5000)

View File

@@ -3841,7 +3841,7 @@ const m = {
//not shooting (or using field) enable cloak
if (m.energy < 0.05 && m.fireCDcycle < m.cycle && !input.fire) m.fireCDcycle = m.cycle
if (m.fireCDcycle + 30 < m.cycle && !input.fire) { //automatically cloak if not firing
const drain = 0.03
const drain = 0.02
if (!m.isCloak && m.energy > drain + 0.03) {
m.energy -= drain
m.isCloak = true //enter cloak
@@ -3878,7 +3878,7 @@ const m = {
if (tech.isCloakStun) { //stun nearby mobs after exiting cloak
let isMobsAround = false
const stunRange = m.fieldDrawRadius * 1.5
const drain = 0.15
const drain = 0.14
if (m.energy > drain) {
for (let i = 0, len = mob.length; i < len; ++i) {
if (Vector.magnitude(Vector.sub(mob[i].position, m.pos)) < stunRange && Matter.Query.ray(map, mob[i].position, m.pos).length === 0 && !mob[i].isBadTarget) {
@@ -3900,7 +3900,7 @@ const m = {
}
}
if (m.isCloak) {
m.fieldRange = m.fieldRange * 0.85 + 115
m.fieldRange = m.fieldRange * 0.85 + 130
m.fieldDrawRadius = m.fieldRange * 1.1 //* 0.88 //* Math.min(1, 0.3 + 0.5 * Math.min(1, energy * energy));
m.drawCloak()
} else if (m.fieldRange < 4000) {

View File

@@ -5799,7 +5799,7 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.haveGunCheck("mine") && !tech.isFoamMine
return tech.haveGunCheck("mine")
},
requires: "mines, not elephants toothpaste",
effect() {
@@ -6520,6 +6520,27 @@ const tech = {
b.guns[8].chooseFireMethod()
}
},
// {
// name: "cavitation",
// description: "increase <strong>foam</strong> <strong class='color-g'>gun</strong> <strong>recoil</strong> by <strong>300%</strong><br>",
// isGunTech: true,
// maxCount: 1,
// count: 0,
// frequency: 2,
// frequencyDefault: 2,
// allowed() {
// return tech.haveGunCheck("foam")
// },
// requires: "foam",
// effect() {
// tech.isFoamCavitation = true;
// b.guns[8].knockBack = 0.003
// },
// remove() {
// tech.isFoamCavitation = false;
// b.guns[8].knockBack = 0.001
// }
// },
{
name: "capacitor bank",
// description: "<strong>charge</strong> effects build up almost <strong>instantly</strong><br><em style = 'font-size:97%;'>throwing <strong class='color-block'>blocks</strong>, foam, railgun, pulse, tokamak</em>",
@@ -11413,5 +11434,6 @@ const tech = {
hardLanding: null,
isNoGroundDamage: null,
isSuperBounce: null,
isDivisor: null
isDivisor: null,
isFoamCavitation: null,
}