From 8b73c9ffc4c006d33c35945f1a26ea90f5e24989 Mon Sep 17 00:00:00 2001 From: landgreen Date: Thu, 1 Jul 2021 07:41:16 -0700 Subject: [PATCH] pseudoscience tech: pseudoscience - renewing power up choices costs no research, but adds 1-5 JUNK to the potential tech pool >update text now shows the last 20 updates and has a scroll bar --- .DS_Store | Bin 6148 -> 6148 bytes index.html | 2 +- js/index.js | 2 +- js/level.js | 1 - js/player.js | 8 ++++---- js/powerup.js | 44 ++++++++++++++++++++++++-------------------- js/tech.js | 36 ++++++++++++++++++++++-------------- todo.txt | 44 +++++++++++++++++--------------------------- 8 files changed, 69 insertions(+), 68 deletions(-) diff --git a/.DS_Store b/.DS_Store index 4df85bda790a2b3db6962257e8fc35c5c4f0c2c2..3848cd4e71cbabbda691641f8bd0320f83a24845 100644 GIT binary patch delta 21 ccmZoMXffEJ#mw~T=wuycKgJ82tC>4R09By}rT_o{ delta 21 ccmZoMXffEJ#mw|9e6kL+ALEA2)y$nD08fPn6aWAK diff --git a/index.html b/index.html index 9424d56..dbe79a3 100644 --- a/index.html +++ b/index.html @@ -202,7 +202,7 @@
updates -
+
diff --git a/js/index.js b/js/index.js index b9219fe..dfe995a 100644 --- a/js/index.js +++ b/js/index.js @@ -1152,7 +1152,7 @@ document.getElementById("updates").addEventListener("toggle", function() { loadJSON('https://api.github.com/repos/landgreen/n-gon/commits', function(data) { // console.log(data) - for (let i = 0, len = 3; i < len; i++) { + for (let i = 0, len = 20; i < len; i++) { text += "" + data[i].commit.author.date.substr(0, 10) + " - "; //+ "
" text += data[i].commit.message if (i < len - 1) text += "
" diff --git a/js/level.js b/js/level.js index 56fe8ff..1ec8493 100644 --- a/js/level.js +++ b/js/level.js @@ -9,7 +9,6 @@ const level = { levelsCleared: 0, playableLevels: ["skyscrapers", "rooftops", "warehouse", "highrise", "office", "aerie", "satellite", "sewers", "testChamber"], levels: [], - start() { if (level.levelsCleared === 0) { //this code only runs on the first level // simulation.enableConstructMode() //used to build maps in testing mode diff --git a/js/player.js b/js/player.js index c0cd448..f529c55 100644 --- a/js/player.js +++ b/js/player.js @@ -1572,7 +1572,7 @@ const m = { if (input.field) { const oldHarmonicRadius = m.harmonicRadius m.harmonicRadius = 0.985 * m.harmonicRadius + 0.015 * 2.5 - m.energy -= 0.45 * (m.harmonicRadius - oldHarmonicRadius) + m.energy -= 0.35 * (m.harmonicRadius - oldHarmonicRadius) } else { m.harmonicRadius = 0.997 * m.harmonicRadius + 0.003 * 1 } @@ -2488,9 +2488,9 @@ const m = { }, { name: "wormhole", - description: "use energy to tunnel through a wormhole
wormholes attract blocks and power ups
10% chance to duplicate spawned power ups", //
bullets may also traverse wormholes + description: "use energy to tunnel through a wormhole
wormholes attract blocks and power ups
11% chance to duplicate spawned power ups", //
bullets may also traverse wormholes effect: function() { - m.duplicateChance = 0.1 + m.duplicateChance = 0.11 powerUps.setDo(); //needed after adjusting duplication chance m.hold = function() { @@ -2539,7 +2539,7 @@ const m = { dyP = dyP2 } dist2 = dxP * dxP + dyP * dyP; - if (dist2 < 600000 && !(m.health === m.maxHealth && powerUp[i].name === "heal")) { + if (dist2 < 600000) { //&& !(m.health === m.maxHealth && powerUp[i].name === "heal") powerUp[i].force.x += 4 * (dxP / dist2) * powerUp[i].mass; // float towards hole powerUp[i].force.y += 4 * (dyP / dist2) * powerUp[i].mass - powerUp[i].mass * simulation.g; //negate gravity Matter.Body.setVelocity(powerUp[i], { //extra friction diff --git a/js/powerup.js b/js/powerup.js index 8dc572d..4d8e8e6 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -248,7 +248,11 @@ const powerUps = { } }, use(type) { //runs when you actually research a list of selections, type can be field, gun, or tech - powerUps.research.changeRerolls(-1) + if (tech.isJunkResearch) { + tech.addJunkTechToPool(tech.junkResearchNumber) + } else { + powerUps.research.changeRerolls(-1) + } // simulation.makeTextLog(`m.research-- //
${powerUps.research.count}`) if (tech.isBanish && type === 'tech') { // banish researched tech @@ -402,7 +406,12 @@ const powerUps = { powerUps.field.choiceLog.push(choice2) powerUps.field.choiceLog.push(choice3) - if (powerUps.research.count) { + if (tech.isJunkResearch) { + tech.junkResearchNumber = Math.ceil(5 * Math.random()) + text += `
` + for (let i = 0; i < tech.junkResearchNumber; i++) text += `
` + text += `
  pseudoscience
` + } else if (powerUps.research.count) { text += `
` for (let i = 0, len = Math.min(powerUps.research.count, 30); i < len; i++) text += `
` text += `
  research
` @@ -510,26 +519,15 @@ const powerUps = { powerUps.tech.choiceLog.push(choice3) // if (powerUps.research.count) text += `
  research ${powerUps.research.count}
` - if (powerUps.research.count) { + if (tech.isJunkResearch) { + tech.junkResearchNumber = Math.ceil(5 * Math.random()) + text += `
` + for (let i = 0; i < tech.junkResearchNumber; i++) text += `
` + text += `
  pseudoscience
` + } else if (powerUps.research.count) { text += `
` for (let i = 0, len = Math.min(powerUps.research.count, 30); i < len; i++) text += `
` text += `
  research
` - - - // text += ` - //
- // - //
- //
- //
- //   research
` - - // text += `
- // - //
- //
- //
- //         ${tech.tech[choose].name} ${isCount}
${tech.tech[choose].description}
` } document.getElementById("choose-grid").innerHTML = text @@ -612,7 +610,13 @@ const powerUps = { powerUps.gun.choiceLog.push(choice2) powerUps.gun.choiceLog.push(choice3) // if (powerUps.research.count) text += `
  research ${powerUps.research.count}
` - if (powerUps.research.count) { + + if (tech.isJunkResearch) { + tech.junkResearchNumber = Math.ceil(5 * Math.random()) + text += `
` + for (let i = 0; i < tech.junkResearchNumber; i++) text += `
` + text += `
  pseudoscience
` + } else if (powerUps.research.count) { text += `
` for (let i = 0, len = Math.min(powerUps.research.count, 30); i < len; i++) text += `
` text += `
  research
` diff --git a/js/tech.js b/js/tech.js index 70c800e..80b48d2 100644 --- a/js/tech.js +++ b/js/tech.js @@ -2799,6 +2799,24 @@ tech.isRerollDamage = false; } }, + { + name: "pseudoscience", + description: "renewing power up choices costs no research
but adds 1-5 JUNK to the potential tech pool", + maxCount: 1, + count: 0, + frequency: 1, + frequencyDefault: 1, + allowed() { + return tech.isResearchBoss || tech.isMetaAnalysis || tech.isRerollBots || tech.isDeathAvoid || tech.isRerollDamage || build.isExperimentSelection + }, + requires: "abiogenesis, meta-analysis, bot fabrication, anthropic principle, or Bayesian statistics", + effect() { + tech.isJunkResearch = true; + }, + remove() { + tech.isJunkResearch = false; + } + }, { name: "Born rule", description: "remove all current tech
spawn new tech to replace them", @@ -3184,18 +3202,6 @@ } } }, - - - // allowed() { - // return (b.totalBots() > 1 && powerUps.research.count > 0) || build.isExperimentSelection - // }, - // requires: "at least 2 bots, 1 research", - // effect: () => { - // if (powerUps.research.count > 0) { - // powerUps.research.changeRerolls(-1) - // b.randomBot() - // } - { name: "backward induction", description: "use 2 research to choose all the unchosen
tech from your previous tech selection", @@ -6930,7 +6936,7 @@ remove() {} }, { - name: "quantum black hole", + name: "quantum hole", description: "use your energy and 1 research to spawn
inside the event horizon of a huge black hole", maxCount: 9, count: 0, @@ -7293,5 +7299,7 @@ isDroneRadioactive: null, droneRadioDamage: null, isFoamTeleport: null, - isResearchBoss: null + isResearchBoss: null, + isJunkResearch: null, + junkResearchNumber: null } \ No newline at end of file diff --git a/todo.txt b/todo.txt index f34fb9f..9be6687 100644 --- a/todo.txt +++ b/todo.txt @@ -1,31 +1,32 @@ ******************************************************** NEXT PATCH ******************************************************** -tech: abiogenesis - spawn a second level boss on each level, but costs 5 research or if you don't have the research add 49 JUNK tech to the pool - note to level builders I rewrote the add duplicate boss code in all levels: spawn.secondaryBossChance(x,y) +tech: pseudoscience - renewing power up choices costs no research, but adds 1-5 JUNK to the potential tech pool -foam tech: uncertainty principle - foam bullets change position randomly, increase foam damage by 66% - -throwing blocks now charges faster with reduced fire cooldown -tech renormalization now has a 40% chance to refund a research (was 37%) -performance- now precalculate player gradient fill +>update text now shows the last 20 updates and has a scroll bar ******************************************************** TODO ******************************************************** -should ammo apply to all guns, or just one of your guns? - if one gun only, it would make multi-gun builds weaker +add a short pause before selection menu pops up + this stops a second selection popping up and a possible wrong selection + +make a tech that improves all charge guns + for: pulse, foam, rail gun + effect: + faster charge rate? + fire speed already does that... + harm reduction while charging + less ammo/energy used while charging? + +researching new tech doesn't cost any research, but adds 5-10 JUNK to the potential tech pool in testing mode console log the body you click on -throwing a block removes the block and rewinds time 10 seconds (including health and energy) - requires CPT, CPT gun, time dilation? - tech plasma : plasma length increases then decreases as you hold down the field button (like stabbing with a spear) grows to 1.5 longer after 0.3 seconds, then returns to normal length over 1 second, until field is pressed again extra energy is drained when field is longer energy conservation 6% damage recovered as energy - add a negative effect: - junk tech + there is space for a negative effect in the text Weak Anthropic Principle: you get a second chance at life, but .... @@ -35,8 +36,6 @@ tech: use the ability for power ups to have custom code attracted to other power ups explode if they touch? -tech: wormhole through walls? - pause should show the last in game console message nail-gun, or .... @@ -47,14 +46,6 @@ nail-gun, or .... current location or location when fired? explode when turning back -make a tech that improves all charge guns - for: pulse, foam, rail gun - effect: - faster charge rate? - fire speed already does that... - harm reduction while charging - less ammo/energy used while charging? - apply the new gun.do functions to other guns rail gun crouching missile? @@ -78,9 +69,6 @@ add back in gamepad support but does anyone care? https://github.com/landgreen/landgreen.github.io/search?q=gamepadconnected -rename intro level to something lore related - - RPG default or tech: grenades detonate on your cursor / where your cursor was when they were fired tech: time dilation - when you exit time dilation rewind to the state you entered @@ -206,6 +194,8 @@ is there a way to check if the player is stuck inside the map or block ******************************************************** LEVELS ******************************************************** +rename intro level to something lore related + labs - procedural generation bugs mob spawns shouldn't be based on probability?