├── .gitattributes ├── evolved.ico ├── lib ├── mine.png ├── noise.png ├── copper-miner.png ├── blocking-stack.png ├── blocking-resource.png ├── lz-string.min.js └── html5sortable.min.js ├── evolved-light.ico ├── .gitignore ├── font ├── weathericons-regular-webfont.eot ├── weathericons-regular-webfont.ttf ├── weathericons-regular-webfont.woff └── weathericons-regular-webfont.woff2 ├── src ├── wiki │ ├── init.js │ ├── arpa.js │ ├── prestige.js │ ├── perks.js │ ├── gameplay.js │ ├── faq.js │ ├── basics.js │ ├── planets.js │ ├── crispr.js │ ├── combat.js │ ├── universes.js │ ├── government.js │ ├── blood.js │ ├── species.js │ ├── wiki.less │ ├── projects.js │ ├── governor.js │ ├── wiki.js │ ├── resets.js │ └── functions.js ├── debug.js ├── locale.js ├── seasons.js └── prod.js ├── webpack.evolve.dev.js ├── webpack.evolve.prod.js ├── webpack.wiki.dev.js ├── webpack.wiki.prod.js ├── strings ├── convert zh-CN to zh-TW using opencc.py ├── readme.md ├── updateStrings.py └── checkStrings.py ├── evolve └── evolve.js ├── save.html ├── package.json ├── wiki.html ├── README.md ├── index.html └── wiki └── wiki.css /.gitattributes: -------------------------------------------------------------------------------- 1 | evolve/* -diff 2 | wiki/* -diff 3 | -------------------------------------------------------------------------------- /evolved.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/evolved.ico -------------------------------------------------------------------------------- /lib/mine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/lib/mine.png -------------------------------------------------------------------------------- /lib/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/lib/noise.png -------------------------------------------------------------------------------- /evolved-light.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/evolved-light.ico -------------------------------------------------------------------------------- /lib/copper-miner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/lib/copper-miner.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *# 3 | update.*.json 4 | strings/last-strings.json 5 | node_modules/* 6 | docs -------------------------------------------------------------------------------- /lib/blocking-stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/lib/blocking-stack.png -------------------------------------------------------------------------------- /lib/blocking-resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/lib/blocking-resource.png -------------------------------------------------------------------------------- /font/weathericons-regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/font/weathericons-regular-webfont.eot -------------------------------------------------------------------------------- /font/weathericons-regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/font/weathericons-regular-webfont.ttf -------------------------------------------------------------------------------- /font/weathericons-regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/font/weathericons-regular-webfont.woff -------------------------------------------------------------------------------- /font/weathericons-regular-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xzya/EvolveFast/master/font/weathericons-regular-webfont.woff2 -------------------------------------------------------------------------------- /src/wiki/init.js: -------------------------------------------------------------------------------- 1 | import { } from './../achieve.js'; 2 | import { defineResources } from './../resources.js'; 3 | 4 | defineResources(true); 5 | -------------------------------------------------------------------------------- /webpack.evolve.dev.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | mode: 'development', 5 | entry: './src/main.js', 6 | output: { 7 | path: path.resolve(__dirname, 'evolve'), 8 | filename: 'main.js' 9 | } 10 | }; -------------------------------------------------------------------------------- /webpack.evolve.prod.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | mode: 'production', 5 | entry: './src/main.js', 6 | output: { 7 | path: path.resolve(__dirname, 'evolve'), 8 | filename: 'main.js' 9 | } 10 | }; -------------------------------------------------------------------------------- /webpack.wiki.dev.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | mode: 'development', 5 | entry: './src/wiki/wiki.js', 6 | output: { 7 | path: path.resolve(__dirname, 'wiki'), 8 | filename: 'wiki.js' 9 | } 10 | }; -------------------------------------------------------------------------------- /webpack.wiki.prod.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | mode: 'production', 5 | entry: './src/wiki/wiki.js', 6 | output: { 7 | path: path.resolve(__dirname, 'wiki'), 8 | filename: 'wiki.js' 9 | } 10 | }; -------------------------------------------------------------------------------- /strings/convert zh-CN to zh-TW using opencc.py: -------------------------------------------------------------------------------- 1 | # pip install opencc-python-reimplemented 2 | from opencc import OpenCC 3 | 4 | 5 | with open('strings.zh-CN.json', 'r', encoding='utf-8') as f: 6 | zh_CN = f.read() 7 | # convert zh_CN to zh_TW 8 | zh_TW = OpenCC('s2tw').convert(zh_CN) 9 | with open('strings.zh-TW.json', 'w', encoding='utf-8') as f: 10 | f.write(zh_TW) 11 | -------------------------------------------------------------------------------- /src/wiki/arpa.js: -------------------------------------------------------------------------------- 1 | import { clearElement } from './../functions.js'; 2 | import { projectsPage } from './projects.js'; 3 | import { crisprPage } from './crispr.js'; 4 | import { bloodPage } from './blood.js'; 5 | 6 | export function arpaPage(zone){ 7 | let content = $(`#content`); 8 | clearElement(content); 9 | 10 | switch (zone){ 11 | case 'projects': 12 | projectsPage(content); 13 | break; 14 | case 'genetics': 15 | //geneticsPage(content); 16 | break; 17 | case 'crispr': 18 | crisprPage(content); 19 | break; 20 | case 'blood': 21 | bloodPage(content); 22 | break; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/wiki/prestige.js: -------------------------------------------------------------------------------- 1 | import { clearElement } from './../functions.js'; 2 | import { crisprPage } from './crispr.js'; 3 | import { bloodPage } from './blood.js'; 4 | import { pResPage } from './p_res.js'; 5 | import { resetsPage } from './resets.js'; 6 | import { perksPage } from './perks.js'; 7 | 8 | export function prestigePage(zone){ 9 | let content = $(`#content`); 10 | clearElement(content); 11 | 12 | switch (zone){ 13 | case 'resets': 14 | resetsPage(content); 15 | break; 16 | case 'resources': 17 | pResPage(content); 18 | break; 19 | case 'crispr': 20 | crisprPage(content); 21 | break; 22 | case 'blood': 23 | bloodPage(content); 24 | break; 25 | case 'perks': 26 | perksPage(content); 27 | break; 28 | } 29 | } -------------------------------------------------------------------------------- /evolve/evolve.js: -------------------------------------------------------------------------------- 1 | var intervals = {}; 2 | self.addEventListener('message', function(e){ 3 | var data = e.data; 4 | switch (data.loop) { 5 | case 'short': 6 | intervals['main_loop'] = setInterval(function(){ 7 | self.postMessage('fast'); 8 | }, data.period); 9 | break; 10 | case 'mid': 11 | intervals['mid_loop'] = setInterval(function(){ 12 | self.postMessage('mid'); 13 | }, data.period); 14 | break; 15 | case 'long': 16 | intervals['long_loop'] = setInterval(function(){ 17 | self.postMessage('long'); 18 | }, data.period); 19 | break; 20 | case 'clear': 21 | clearInterval(intervals['main_loop']); 22 | clearInterval(intervals['mid_loop']); 23 | clearInterval(intervals['long_loop']); 24 | break; 25 | }; 26 | }, false); 27 | -------------------------------------------------------------------------------- /save.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Evolve Save String 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 32 | 33 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "evolveidle", 3 | "version": "1.3.9", 4 | "description": "Evolve Idle", 5 | "private": true, 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "less": "lessc -x src/evolve.less evolve/evolve.css", 9 | "dev": "npx webpack --config webpack.evolve.dev.js", 10 | "evolve": "npx webpack --config webpack.evolve.prod.js", 11 | "build": "npx webpack --config webpack.evolve.prod.js && npx webpack --config webpack.wiki.prod.js", 12 | "build-dev": "npx webpack --config webpack.evolve.dev.js && npx webpack --config webpack.wiki.dev.js", 13 | "wiki-dev": "npx webpack --config webpack.wiki.dev.js", 14 | "wiki": "npx webpack --config webpack.wiki.prod.js", 15 | "wiki-less": "lessc -x src/wiki/wiki.less wiki/wiki.css", 16 | "serve": "servehere -c" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/pmotschmann/Evolve.git" 21 | }, 22 | "keywords": [ 23 | "Evolve" 24 | ], 25 | "author": "Peter Motschmann", 26 | "license": "MPL-2.0", 27 | "bugs": { 28 | "url": "https://github.com/pmotschmann/Evolve/issues" 29 | }, 30 | "homepage": "https://github.com/pmotschmann/Evolve#readme", 31 | "devDependencies": { 32 | "ini": "^1.3.8", 33 | "less": "^3.13.0", 34 | "servehere": "^1.7.0", 35 | "webpack": "^5.76.0", 36 | "webpack-cli": "^4.10.0" 37 | }, 38 | "dependencies": { 39 | "node": "^16.1.0", 40 | "npmcli": "^1.2.2" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/wiki/perks.js: -------------------------------------------------------------------------------- 1 | import { perkList } from './../achieve.js'; 2 | import { sideMenu } from './functions.js'; 3 | 4 | export function perksPage(content){ 5 | let mainContent = $(`
`); 6 | let perkContent = sideMenu('create',mainContent); 7 | content.append(mainContent); 8 | 9 | Object.keys(perkList).forEach(function (perk){ 10 | perkDesc(perkContent, perk); 11 | sideMenu('add',`perks-prestige`,`${perk}`,perkList[perk].name); 12 | }); 13 | } 14 | 15 | function perkDesc(content, perk){ 16 | let perkbox = $(`
`); 17 | if (perkList[perk].hasOwnProperty('group')){ 18 | let gperk = $(`
${perkList[perk].name}
`); 19 | perkList[perk].group.forEach(function(subperk){ 20 | gperk.append($(`
${subperk.desc(true)}
`)); 21 | }); 22 | perkbox.append(gperk); 23 | } 24 | else { 25 | perkbox.append($(`
${perkList[perk].name}
${perkList[perk].desc(true)}
`)); 26 | } 27 | if (perkList[perk].notes.length > 0){ 28 | let notes = $(`
`); 29 | perkList[perk].notes.forEach(function(note){ 30 | notes.append(`
${note}
`); 31 | }); 32 | perkbox.append(notes); 33 | } 34 | content.append(perkbox); 35 | } -------------------------------------------------------------------------------- /src/wiki/gameplay.js: -------------------------------------------------------------------------------- 1 | import { clearElement } from './../functions.js'; 2 | import { basicsPage } from './basics.js'; 3 | import { mechanicsPage } from './mechanics.js'; 4 | import { govPage } from './government.js'; 5 | import { governPage } from './governor.js'; 6 | import { combatPage } from './combat.js'; 7 | import { challengesPage } from './challenges.js'; 8 | import { resetsPage } from './resets.js'; 9 | import { planetsPage } from './planets.js'; 10 | import { universePage } from './universes.js'; 11 | import { hellPage } from './hell.js'; 12 | 13 | export function gamePlayPage(zone){ 14 | let content = $(`#content`); 15 | clearElement(content); 16 | 17 | switch (zone){ 18 | case 'basics': 19 | basicsPage(content); 20 | break; 21 | case 'mechanics': 22 | mechanicsPage(content); 23 | break; 24 | case 'government': 25 | govPage(content); 26 | break; 27 | case 'governor': 28 | governPage(content); 29 | break; 30 | case 'combat': 31 | combatPage(content); 32 | break; 33 | case 'challenges': 34 | challengesPage(content); 35 | break; 36 | case 'resets': 37 | resetsPage(content); 38 | break; 39 | case 'planets': 40 | planetsPage(content); 41 | break; 42 | case 'universes': 43 | universePage(content); 44 | break; 45 | case 'hell': 46 | hellPage(content); 47 | break; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/wiki/faq.js: -------------------------------------------------------------------------------- 1 | import { global } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { clearElement } from './../functions.js'; 4 | import { races } from './../races.js'; 5 | 6 | export function faqPage(){ 7 | let content = $(`#content`); 8 | clearElement(content); 9 | 10 | let questions = [ 11 | 'update','hotkeys','sethotkeys','offline','moonphase','orbital','lumber','farm', 12 | 'steel','aluminium','titanium','titanium_balorg','polymer','mythril','neutronium', 13 | 'adamantite','infernite','graphene','stanene','aerogel','crates','soft_reset', 14 | 'hard_reset','combat','morale','stress','genetic_decay','cache','aphrodisiac', 15 | 'religion','tax_riots','race','weather','sundial','plasmid','plasmid_keep','plasmid_earn', 16 | 'crispr','creep','phage','phage_earn','phage_benefit','anti_plasmids','temple', 17 | 'temple_break','demonic','celestial','mastery','challenges','perks','feats','support', 18 | 'micro','valdi','quantum','quantum_level','exotic','soul_gem','soul_gem_spend', 19 | 'hell_patrol','surveyors','defense','infusion','dark_energy' 20 | ]; 21 | 22 | let values = { 23 | neutronium: [races[global.race.species].solar.gas_moon], 24 | }; 25 | 26 | for (let i=0; i`); 28 | content.append(qna); 29 | let tokens = []; 30 | if (values.hasOwnProperty(questions[i])){ 31 | tokens = values[questions[i]]; 32 | } 33 | 34 | qna.append(`

${loc(`wiki_faq_q_${questions[i]}`)}

`); 35 | qna.append(`
${loc(`wiki_faq_a_${questions[i]}`,tokens)}
`); 36 | } 37 | } -------------------------------------------------------------------------------- /strings/readme.md: -------------------------------------------------------------------------------- 1 | # Translation tools 2 | 3 | There are two python scripts to help to translate the strings.json file: updateStrings.py and checkStrings.py. 4 | 5 | ## updateStrings.py 6 | 7 | ```shell 8 | python updateStrings.py 9 | ``` 10 | 11 | This script reads the strings.json and strings.\.json, and overwrite its contents, putting the keys in the same order as those in strings.json. This doesn't write the keys that are not in strings.json in the output (show as deleted keys count in the shell), and add a 'TRANS:' in the start of every value which key is in strings.json but not was in strings.\.json. 12 | 13 | If there is a last-strings.json file, it will be used to keep track of changes in keys values, which will be format as 'CHANGE:\~FROM:\~TO:\'. In the end of the operation, the strings.json contents will be again copied to last-strings.json. 14 | 15 | ## checkStrings.py 16 | 17 | ```shell 18 | python checkStrings.py 19 | ``` 20 | This script reads the strings.json and string.\.json files and outputs every line that: 21 | - is out of json format 22 | - the value is marked with tag 'TRANS:' or 'CHANGE:' 23 | - the number of periods (.) in the strings.json differs from strings.\.json. The translation does not need to have the same number of periods, but this helps find phrases that end with periods that were forgotten in the translation 24 | - the number of leading spaces (spaces before the first character) in the strings.json differs from strings.\.json 25 | - the number of tokens (like %0) in the strings.json differs from strings.\.json 26 | - the numbers in the strings.json differ from strings.\.json 27 | 28 | You can disable some of the checks if you open the script and change the values to ```True``` or ```False```: 29 | ```python 30 | check_tags = True 31 | check_tokens = True 32 | check_leading_space = True 33 | check_periods = True 34 | check_numbers = True 35 | ``` 36 | -------------------------------------------------------------------------------- /src/debug.js: -------------------------------------------------------------------------------- 1 | import { global, breakdown } from './vars.js'; 2 | import { deepClone, adjustCosts, messageQueue } from './functions.js'; 3 | import { races, traits } from './races.js'; 4 | import { craftCost, tradeRatio, atomic_mass, tradeBuyPrice, tradeSellPrice } from './resources.js'; 5 | import { actions, checkAffordable } from './actions.js'; 6 | import { fuel_adjust, int_fuel_adjust } from './space.js'; 7 | import { shipCosts } from './truepath.js'; 8 | import { f_rate } from './industry.js'; 9 | import { armyRating } from './civics.js'; 10 | import { alevel } from './achieve.js'; 11 | import { loc } from './locale.js'; 12 | 13 | export function enableDebug(){ 14 | if (global.settings.expose){ 15 | window.evolve = { 16 | actions: deepClone(actions), 17 | races: deepClone(races), 18 | traits: deepClone(traits), 19 | tradeRatio: deepClone(tradeRatio), 20 | craftCost: deepClone(craftCost()), 21 | atomic_mass: deepClone(atomic_mass), 22 | f_rate: deepClone(f_rate), 23 | checkAffordable: deepClone(checkAffordable), 24 | adjustCosts: deepClone(adjustCosts), 25 | armyRating: deepClone(armyRating), 26 | tradeBuyPrice: deepClone(tradeBuyPrice), 27 | tradeSellPrice: deepClone(tradeSellPrice), 28 | fuel_adjust: deepClone(fuel_adjust), 29 | int_fuel_adjust: deepClone(int_fuel_adjust), 30 | alevel: deepClone(alevel), 31 | messageQueue: deepClone(messageQueue), 32 | loc: deepClone(loc), 33 | shipCosts: deepClone(shipCosts), 34 | updateDebugData: deepClone(updateDebugData), 35 | global: {}, 36 | breakdown: {}, 37 | }; 38 | } 39 | } 40 | 41 | export function updateDebugData(){ 42 | if (global.settings.expose){ 43 | window.evolve.global = deepClone(global); 44 | window.evolve.craftCost = deepClone(craftCost()), 45 | window.evolve.breakdown = deepClone(breakdown); 46 | } 47 | } -------------------------------------------------------------------------------- /src/wiki/basics.js: -------------------------------------------------------------------------------- 1 | import { loc } from './../locale.js'; 2 | import { infoBoxBuilder } from './functions.js'; 3 | 4 | export function basicsPage(content){ 5 | infoBoxBuilder(content,{ name: 'start', template: 'basics', paragraphs: 2, h_level: 2 }); 6 | 7 | infoBoxBuilder(content,{ name: 'prehistoric', template: 'basics', paragraphs: 14, break: [2,6,13], h_level: 2, 8 | para_data: { 9 | 3: [loc(`resource_RNA_name`),loc(`resource_DNA_name`)], 10 | 4: [loc(`evo_organelles_title`),loc(`resource_RNA_name`),loc(`evo_nucleus_title`),loc(`resource_DNA_name`)], 11 | 5: [loc(`evo_membrane_title`),loc(`evo_eukaryotic_title`),loc(`evo_mitochondria_title`)], 12 | 7: [loc('genelab_genus')], 13 | 8: [3], 14 | 13: [loc('evo_sentience_title')], 15 | }, 16 | data_link: { 17 | 7: ['wiki.html#races-species'] 18 | } 19 | }); 20 | 21 | infoBoxBuilder(content,{ name: 'civilization', template: 'basics', paragraphs: 14, break: [2,8,13], h_level: 2, 22 | para_data: { 23 | 3: [loc(`tab_civics`)], 24 | 4: [loc(`resource_Food_name`),loc(`job_farmer`),loc(`job_hunter`)], 25 | 5: ['*'], 26 | 8: [loc(`resource_Food_name`)], 27 | 9: [loc(`resource_Food_name`),loc(`hunger`)], 28 | 10: [loc(`resource_Food_name`)], 29 | 11: [loc(`resource_Food_name`)], 30 | 12: [loc(`resource_Food_name`)], 31 | 13: [loc(`resource_Knowledge_name`)], 32 | 14: [loc(`resource_Knowledge_name`),loc(`city_university`)] 33 | } 34 | }); 35 | 36 | infoBoxBuilder(content,{ name: 'government', template: 'basics', paragraphs: 8, break: [4], h_level: 2, 37 | para_data: { 38 | 1: [loc(`tech_government`),loc(`tab_civics`),loc(`govern_anarchy`)], 39 | 2: [loc(`tech_government`),loc(`govern_anarchy`)], 40 | 3: [loc(`tech_government`)], 41 | 4: [loc('morale')], 42 | 5: [loc('morale')], 43 | 6: [loc('morale'),loc('job_entertainer'),loc('morale_stress')], 44 | 7: [loc('morale_tax'),loc('morale')], 45 | 8: [25,100] 46 | } 47 | }); 48 | 49 | infoBoxBuilder(content,{ name: 'mad', template: 'basics', paragraphs: 4, h_level: 2, 50 | para_data: { 51 | 1: [loc(`wiki_resets_mad`)], 52 | 2: [loc(`wiki_basics_mad_reset`),loc(`tab_civics`),loc(`tab_military`)], 53 | 3: [loc(`tab_space`)], 54 | }, 55 | data_link: { 56 | 2: ['wiki.html#resets-prestige'] 57 | } 58 | }); 59 | } 60 | -------------------------------------------------------------------------------- /wiki.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Evolve Wiki 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 50 |
51 | 52 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Evolve 2 | 3 | ## Play 4 | 5 | https://pmotschmann.github.io/Evolve/ 6 | 7 | ## About 8 | 9 | An incremental game about evolving a civilization from primordial ooze into a space faring empire. 10 | Evolve combines elements of a clicker with an idler and has lots of micromanagement. 11 | 12 | What will you evolve into? 13 | 14 | ## Submitting Issues 15 | If you think you have discovered a bug or have some other issue with the game then you can open an issue here on Github. 16 | Please do not open Github issues to ask gameplay questions, use Reddit or Discord for that. 17 | Links for both can be found in the footer of the game. 18 | 19 | ## Contributing a Language file 20 | If you are interested in a contributing a new language for Evolve the process is fairly straight forward (although a bit tedious). 21 | 22 | Make a copy of strings/strings.json and name the copy as strings/strings.\.json (EX: strings.es_US.json). The locale format is the language alpha-2 code joined with the country alpha-2 code. 23 | 24 | The strings are stored in a json format and will look like this: 25 | ``` 26 | "job_farmer_desc": "Farmers create food to feed your population. Each farmer generates %0 food per second.", 27 | ``` 28 | If you are unfamiliar with json the first part is a **key** and cannot be altered, **do not translate or modify the key in any way**. The second part is the string to be translated. Many game strings use **tokens** (**%0**, **%1**, **%2**, etc) to represent game values, as such these tokens must remain in the final translated string. Their position can be moved accordingly, the number represents a specific value and not its position in the string. 29 | 30 | To enable your language translation in the game you must add it to the locales constant in locale.js (bottom of the file). 31 | 32 | Once you feel your translation file is ready send a pull request with it to the Evolve main branch. 33 | 34 | 35 | ## Contributing to the game 36 | Bug fixes, additional translations, themes, or UI improvements can simply be submitted as pull requests; once reviewed and accepted they will be merged into the main game branch. If you want to contribute a new feature it can not arbitrarily make something easier without making something else harder. If your new feature idea simply makes the game easier it will not be accepted. 37 | 38 | ## CSS Changes 39 | Evolve uses LESS to build its CSS, you can not just edit the minified CSS file. You must instead edit src/evolve.less then use the less compiler to rebuild the CSS file. 40 | 41 | ## Build Commands 42 | Assuming you configured your build environment correctly the game can be built using the following scripts 43 | ``` 44 | npm run build // Builds the game bundle 45 | npm run dev // Builds the game bundle in debug mode 46 | npm run less // Builds the CSS file 47 | npm run wiki // Builds the wiki bundle 48 | npm run wiki-dev // Builds the wiki bundle in debug mode 49 | npm run wiki-less // Builds the Wiki CSS file 50 | ``` 51 | -------------------------------------------------------------------------------- /strings/updateStrings.py: -------------------------------------------------------------------------------- 1 | import json 2 | from shutil import copyfile 3 | import sys 4 | import os.path as path 5 | 6 | print() 7 | 8 | if len(sys.argv) < 2: 9 | print("inform locale key (python updateString.py )") 10 | else: 11 | locale = sys.argv[1] 12 | 13 | if not path.isfile('strings.{}.json'.format(locale)): 14 | print("'strings.{}.json' not found.\nCreate that file with a line write '{{ }}' if need.".format(locale)) 15 | exit() 16 | 17 | with open('strings.json', encoding='utf-8') as default_file, \ 18 | open('strings.{}.json'.format(locale), 'r+', encoding='utf-8') as loc_file:#, \ 19 | 20 | try: 21 | default_strings = json.load(default_file) 22 | except: 23 | print("the 'strings.json' file is a malformed json file.") 24 | exit() 25 | 26 | try: 27 | locale_strings = json.load(loc_file) 28 | except: 29 | print("the 'strings.{}.json' file is a malformed json file.".format(locale)) 30 | exit() 31 | 32 | if path.isfile('last-strings.json'.format(locale)): 33 | last_file = open('last-strings.json', encoding='utf-8') 34 | try: 35 | last_strings = json.load(last_file) 36 | except: 37 | print("the last-strings.json was a malformed json file.") 38 | last_strings = None 39 | last_file.close(); 40 | else: 41 | last_strings = None 42 | 43 | writing = {} 44 | 45 | trans_count = 0 46 | change_count = 0 47 | 48 | for key in default_strings: 49 | if key in locale_strings: 50 | if locale_strings[key][0:6] == "TRANS:": 51 | writing[key] = "TRANS:" + default_strings[key] 52 | trans_count+=1 53 | elif last_strings is not None and key in last_strings and default_strings[key] != last_strings[key]: 54 | writing[key] = "CHANGE:" + locale_strings[key] + "~FROM:{}~TO:{}".format(last_strings[key], default_strings[key]) 55 | change_count+=1 56 | else: 57 | writing[key] = locale_strings[key] 58 | del locale_strings[key] 59 | else: 60 | writing[key] = "TRANS:" + default_strings[key] 61 | trans_count+=1 62 | 63 | print("{} values are marked with tag 'CHANGE:'".format(change_count)) 64 | print("{} values are marked with tag 'TRANS:'".format(trans_count)) 65 | if len(locale_strings) > 0: 66 | print("{} keys was deleted: ".format(len(locale_strings))) 67 | for key in locale_strings: 68 | print(key) 69 | else: 70 | print("0 keys was deleted.".format(len(locale_strings))) 71 | 72 | loc_file.seek(0,0); 73 | loc_file.truncate(0); 74 | json.dump(writing, loc_file, ensure_ascii=False, indent=2) 75 | 76 | copyfile("strings.json", "last-strings.json"); 77 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Evolve 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 53 |
54 | 55 | 56 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/locale.js: -------------------------------------------------------------------------------- 1 | import { global, save } from './vars.js'; 2 | 3 | let strings; 4 | getString(global.settings.locale); 5 | 6 | export function loc(key, variables) { 7 | let string = strings[key]; 8 | if (!string) { 9 | if (global.settings.expose){ 10 | console.error(`string ${key} not found`); 11 | console.log(strings); 12 | } 13 | return key; 14 | } 15 | if (variables) { 16 | if(variables instanceof Array) { 17 | for (let i = 0; i < variables.length; i++){ 18 | let re = new RegExp(`%${i}(?!\\d)`, "g"); 19 | if(!re.exec(string)){ 20 | if (global.settings.expose){ 21 | console.error(`"%${i}" was not found in the string "${key}" to be replace by "${variables[i]}"`); 22 | } 23 | continue; 24 | } 25 | string = string.replace(re, variables[i]); 26 | } 27 | let re = new RegExp("%\\d+(?!\\d)", 'g'); 28 | const results = string.match(re); 29 | if(results && global.settings.expose){ 30 | console.error(`${results} was found in the string, but there is no variables to make the replacement`); 31 | } 32 | } 33 | else { 34 | if (global.settings.expose){ 35 | console.error('"variables" need be a instance of "Array"'); 36 | } 37 | } 38 | } 39 | return string; 40 | } 41 | 42 | function getString(locale) { 43 | $.ajaxSetup({ async: false }); 44 | 45 | let defaultString; 46 | $.getJSON("strings/strings.json", (data) => { defaultString = data; }); 47 | 48 | if (locale != "en-US"){ 49 | let localeString; 50 | try { 51 | $.getJSON(`strings/strings.${locale}.json`, (data) => { localeString = data; }) 52 | } 53 | catch (e) { 54 | console.error(e,e.stack); 55 | } 56 | const defSize = defaultString.length; 57 | 58 | if (localeString) { 59 | Object.assign(defaultString, localeString); 60 | } 61 | 62 | if(defaultString.length != defSize && global.settings.expose){ 63 | console.error(`string.${locale}.json has extra keys.`); 64 | } 65 | } 66 | let string_pack = save.getItem('string_pack') || false; 67 | if (string_pack && global.settings.sPackOn){ 68 | let themeString; 69 | try { 70 | themeString = JSON.parse(LZString.decompressFromUTF16(string_pack)); 71 | } 72 | catch (e) { 73 | console.error(e,e.stack); 74 | } 75 | const defSize = defaultString.length; 76 | 77 | if (themeString) { 78 | Object.assign(defaultString, themeString); 79 | } 80 | 81 | if (defaultString.length != defSize && global.settings.expose){ 82 | console.error(`string pack has extra keys.`); 83 | } 84 | } 85 | 86 | $.ajaxSetup({ async: true }); 87 | strings = defaultString; 88 | } 89 | 90 | export const locales = { 91 | 'en-US': 'English (US)', 92 | 'es-ES': 'Spanish (ESP)', 93 | 'pt-BR': 'Português (BR)', 94 | 'zh-CN': '简体中文', 95 | 'zh-TW': '繁體中文', 96 | 'ko-KR': '한국어', 97 | 'cs-CZ': 'Čeština', 98 | 'ru-RU': 'Русский', 99 | 'im-PL': 'Igpay-Atinlay' 100 | }; 101 | -------------------------------------------------------------------------------- /strings/checkStrings.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | import os.path as path 4 | import re 5 | 6 | print() 7 | 8 | check_tags = True 9 | check_tokens = True 10 | check_leading_space = True 11 | check_periods = True 12 | check_numbers = True 13 | 14 | def led_spaces(str): 15 | return len(str) - len(str.lstrip(' ')) 16 | 17 | if len(sys.argv) < 2: 18 | print("inform locale key (example 'python checkString.py pt-BR')") 19 | else: 20 | locale = sys.argv[1] 21 | 22 | if not path.isfile('strings.{}.json'.format(locale)): 23 | print("'strings.{}.json' not found. Create it before calling this script.".format(locale)) 24 | exit() 25 | 26 | with open('strings.json', encoding='utf-8') as default_file, \ 27 | open('strings.{}.json'.format(locale), encoding='utf-8') as loc_file: 28 | defstr = json.load(default_file) 29 | 30 | json_regex = re.compile(r'"(?P.+)"\s*:\s"(?P.*)"\s*$') 31 | period_count = re.compile(r'(\.(\D|$))|。') 32 | tokens_regex = re.compile(r'%\d+(?!\d)') 33 | numbers_regex = re.compile(r'\d+') 34 | 35 | for (nl, line) in enumerate(loc_file): 36 | line = line.strip() 37 | if line == '{' or line == '}' or len(line) == 0: 38 | continue 39 | 40 | if line[-1] == ',': 41 | line = line[:-1] 42 | 43 | line = re.search(json_regex, line) 44 | 45 | if line == None: 46 | print('failed parse line {}'.format(nl+1)) 47 | continue 48 | line = line.groupdict() 49 | 50 | if not line['key'] in defstr: 51 | print("key '{}' is not found in string.json, from line {}".format(line['key'], nl)) 52 | continue 53 | else: 54 | defline = defstr[line['key']] 55 | 56 | if check_tags: 57 | if line['value'][0:6] == "TRANS:": 58 | print("key '{}' is marked with tag 'TRANS:', from line {}".format(line['key'], nl)) 59 | if line['value'][0:7] == "CHANGE:": 60 | print("key '{}' is marked with tag 'CHANGE:', from line {}".format(line['key'], nl)) 61 | 62 | if check_tokens: 63 | tcdef = len(tokens_regex.findall(defline)) 64 | tcloc = len(tokens_regex.findall(line['value'])) 65 | if tcdef != tcloc: 66 | print("Number of tokens (like %0) number differ (def: {} != loc: {}), in key '{}', line {}" \ 67 | .format(tcdef, tcloc, line['key'], nl+1)) 68 | 69 | if check_leading_space: 70 | leddef = led_spaces(defline) 71 | ledloc = led_spaces(line['value']) 72 | if leddef != ledloc: 73 | print("leading spaces differ (def: {} != loc: {}), in key '{}', line {}".format(leddef, ledloc, line['key'], nl+1)) 74 | 75 | if check_periods: 76 | pcdef = len(period_count.findall(defline)) 77 | pcloc = len(period_count.findall(line['value'])) 78 | if pcdef != pcloc: 79 | print("periods number differ (def: {} != loc: {}), in key '{}', line {}" \ 80 | .format(pcdef, pcloc, line['key'], nl+1)) 81 | 82 | if check_numbers: 83 | pcdef = numbers_regex.findall(defline) 84 | pcloc = numbers_regex.findall(line['value']) 85 | if sorted(pcdef) != sorted(pcloc): 86 | print("Numbers differ (def: {} != loc: {}), in key '{}', line {}" \ 87 | .format(pcdef, pcloc, line['key'], nl+1)) -------------------------------------------------------------------------------- /src/wiki/planets.js: -------------------------------------------------------------------------------- 1 | import { global } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { planetTraits, biomes } from './../races.js'; 4 | import { headerBoxBuilder, infoBoxBuilder } from './functions.js'; 5 | 6 | export function planetsPage(content) { 7 | let info = $('
'); 8 | 9 | let intro = headerBoxBuilder(content,{ name: 'planet', template: 'planet', paragraphs: 4, full: true, 10 | para_data: { 11 | 2: [365,'25%'], 12 | 3: [4], 13 | 4: ['200-600'] 14 | } 15 | }); 16 | infoBoxBuilder(content,{ name: 'geology', template: 'planet', label: loc('wiki_menu_planets'), paragraphs: 4, h_level: 2, 17 | para_data: { 18 | 2: [2], 19 | 3: ['-10%','+19%'], 20 | 4: [7,'+44%'] 21 | } 22 | },intro); 23 | 24 | let planetInfo = infoForFeature(biomes, $(`

${loc('wiki_planet_biome')}

`)); 25 | let planetTraitsInfo = infoForFeature(planetTraits, $(`

${loc('wiki_planet_trait')}

`)); 26 | info.append(planetInfo); 27 | info.append(planetTraitsInfo); 28 | content.append(info); 29 | } 30 | 31 | const extraInfo = { 32 | oceanic: ['trait','genus'], 33 | forest: ['genus'], 34 | desert: ['trait','genus'], 35 | volcanic: ['weather','genus'], 36 | tundra: ['weather','genus'], 37 | savanna: ['condition'], 38 | swamp: ['trait','trait2','genus','condition'], 39 | ashland: ['weather','trait','genus','condition'], 40 | taiga: ['weather','genus','condition'], 41 | hellscape: ['weather','genus','universe'], 42 | eden: ['geology', 'genus','universe'], 43 | stormy: ['trait'], 44 | ozone: ['trait'], 45 | trashed: ['trait'], 46 | elliptical: ['trait'], 47 | flare: ['event'], 48 | unstable: ['trait','event'], 49 | permafrost: ['trait'], 50 | retrograde: ['trait'] 51 | }; 52 | 53 | function infoForFeature(planetFeatures, content) { 54 | Object.keys(planetFeatures).forEach(function (planetFeatureName) { 55 | let planetFeature = planetFeatures[planetFeatureName]; 56 | let info = $(`
`); 57 | content.append(info); 58 | 59 | info.append(`

${planetFeature.label}

`); 60 | info.append(`
${planetFeature.desc}
`); 61 | 62 | let modifiers = $(`
`); 63 | if (planetFeature['vars'] && planetFeature['wiki']) { 64 | for (let i=0; i${loc(`wiki_planet_${planetFeatureName}${i}`,[formatBonusNumber(planetFeature.vars()[i], type)])}
`)); 67 | } 68 | } 69 | info.append(modifiers); 70 | 71 | if (extraInfo[planetFeatureName]){ 72 | extraInfo[planetFeatureName].forEach(function (label){ 73 | info.append($(`
${loc(`wiki_planet_${planetFeatureName}_${label}`)}
`)); 74 | }); 75 | } 76 | }); 77 | return content; 78 | } 79 | 80 | export function formatBonusNumber(num, style) { 81 | let modRes = num - 1 * (style === 'percent' || style === 'inverted' ? 1 : 0); 82 | if (style === 'inverted' || style === 'inverted-decimal'){ 83 | modRes *= -1; 84 | if (style === 'inverted'){ 85 | style = 'percent'; 86 | } 87 | else { 88 | style = 'decimal'; 89 | } 90 | } 91 | let modResText = (modRes >= 0 ? '+' : '') + modRes.toLocaleString(global.settings.locale, { style: style, maximumFractionDigits: 2 }); 92 | let textColor = modRes >= 0 ? 'success' : 'danger'; 93 | let modResTextColored = `${modResText}`; 94 | return modResTextColored; 95 | } -------------------------------------------------------------------------------- /lib/lz-string.min.js: -------------------------------------------------------------------------------- 1 | var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;ne;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;ie;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString); -------------------------------------------------------------------------------- /wiki/wiki.css: -------------------------------------------------------------------------------- 1 | html{overflow-y:auto}span,div{-moz-user-select:initial;-khtml-user-select:initial;-webkit-user-select:initial;-ms-user-select:initial;user-select:initial;cursor:default}.main{overflow-y:initial}#sideContent.sticky{height:95vh}.wiki{display:flex;margin:0 1rem;padding-top:1rem}.wiki .mainMenu{margin-left:.5rem;width:10rem}.wiki .mainMenu .sticky{height:calc(100vh - 1rem)}.wiki .mainMenu .menu-list li{cursor:pointer}.wiki .mainMenu .menu-list li span{cursor:pointer}.wiki .mainContent{margin-left:1rem;flex:1}.wiki .mainContent .b-tabs:not(:last-child){margin-bottom:0}.wiki .paragraph{margin:0 1rem 1rem 0}.wiki .header{margin:.25rem 0 1rem}.wiki .achievements.header{margin:1rem 0 .25rem}.wiki .menu-label{font-size:1rem}.wiki .infoBox{max-width:50rem;margin-bottom:.5rem;margin-right:.5rem;padding:.25rem .5rem;border:.0625rem solid}.wiki .infoBox span[role=button]{cursor:pointer}.wiki .infoBox span.row{display:block}.wiki .infoBox.wide{max-width:100%;margin-right:0}.wiki .infoBox h2{margin-bottom:.25rem;border-bottom:.0625rem solid}.wiki .infoBox div{margin-bottom:.5rem;clear:both}.wiki .infoBox li{list-style-position:inside}.wiki .infoBox .type{display:flex;justify-content:space-between}.wiki .infoBox .type>span:nth-child(1){display:block;text-align:left}.wiki .infoBox .type>span:nth-child(2){display:block;text-align:right}.wiki .infoBox .itemlist span{display:inline-block;margin-right:1rem}.wiki .infoBox .propList{display:flex;flex-wrap:wrap;justify-content:space-between}.wiki .infoBox .propList>div{margin-right:1rem}.wiki .infoBox .stats{display:flex;justify-content:space-between;border-top:.0625rem solid;margin-top:.5rem;padding-top:.5rem}.wiki .infoBox .stats .effect{width:70%}.wiki .infoBox .stats .cost{width:30%}.wiki .infoBox .stats .right{margin-left:.5rem;padding-left:.5rem;border-left:.0625rem solid}.wiki .infoBox .reqs span:not(:first-child):not(.subreqs){margin-left:.5rem}.wiki .infoBox .extra{border-top:.0625rem solid;margin-top:.5rem;padding-top:.5rem}.wiki .infoBox .extra .calcButton button{height:1.5rem}.wiki .infoBox div.aTable{columns:2}.wiki .infoBox div.aTable span{display:flex}.wiki .infoBox .para>span{margin-right:.25rem}.wiki .infoBox .infoSummary{display:inline-grid;text-align:left;max-width:18rem;border-radius:.25rem;line-height:1.3125rem;margin-right:1rem}.wiki .infoBox.col2{display:flex;flex-wrap:wrap;align-content:space-between}.wiki .infoBox.col2>h2,.wiki .infoBox.col2>h3,.wiki .infoBox.col2>h4{width:100%}.wiki .infoBox.col2>div{width:50%}.wiki .infoBox.sk1 div:first-of-type{width:100%}.wiki .question{margin-bottom:.75rem}.wiki .question h2{margin-bottom:.25rem;text-decoration:underline}.wiki .achieveList{display:flex;flex-wrap:wrap}.wiki .achieveList .achievement{display:inline-flex;justify-content:space-between;width:23rem;margin-right:1rem}.wiki .achieveList .achievement :first-child{width:initial}.wiki .achieveList .achievement span.achieve{display:block}.wiki .achieveList .achievement span.icons{display:block;text-align:right}.wiki .achieveList .achievement p.flair{display:inline;position:initial;line-height:1rem}.wiki .duelList{display:flex;flex-flow:wrap}.wiki .duelList .itemlist{display:flex}.wiki .duelList .listSide{min-width:30rem;width:50%;border:.0625rem solid;text-align:center}.wiki .duelList .listSide .infoBox{list-style:none;text-align:left;margin:.5rem}@media only screen and (max-width:74.5rem){.wiki .duelList .listSide{width:100%}.wiki .duelList .listSide .infoBox{max-width:100%}}.wiki .flexed{display:flex;flex-wrap:wrap;justify-content:space-between}.wiki .flexed>span{text-align:left;width:4rem;display:block;margin:0 .5rem;padding:0 .5rem}.wiki .flexed .wide{width:6.9375rem}.wiki .flexed .swide{width:12rem}.wiki .flexed.wide{width:40rem}.wiki .flex{display:flex}.wiki ul.disc{list-style:disc;margin-left:1.25rem}.wiki .tbl{display:table}.wiki .tbl .trow{display:table-row}.wiki .tbl .trow .tcell{display:table-cell;padding-right:.75rem}.wiki .tbl .trow .tcell:last-child{padding-right:0}.wiki .tbl .trow .eggsol,.wiki .tbl .trow .totsol{cursor:pointer}.wiki .reveal{cursor:pointer;margin-bottom:.5rem}.wiki .calcInput{width:7.5rem;display:inline-block;height:1.25rem;margin-bottom:.5rem;text-align:center}.wiki .calcInput input{height:1.25rem;line-height:1.25rem;text-align:center}.wiki .calcInput .dropdown button{height:1.25rem;padding:0 .75rem}.wiki .calcInput .calcInputButton{height:1.25rem;padding:0 .25rem;margin:0}.wiki .calcButton{margin-bottom:1rem}.main>div.popper.wide.w25,body .modal>div.popper.wide.w25{max-width:25rem}html.dark .menu-label,html.night .menu-label,html.redgreen .menu-label,html.darkNight .menu-label,html.gruvboxDark .menu-label,html.orangeSoda .menu-label,html.dracula .menu-label{color:#ffa500 !important}html.dark .iclr2,html.night .iclr2,html.redgreen .iclr2,html.darkNight .iclr2,html.gruvboxDark .iclr2,html.orangeSoda .iclr2,html.dracula .iclr2{color:#fff}html.dark .iclr3,html.night .iclr3,html.redgreen .iclr3,html.darkNight .iclr3,html.gruvboxDark .iclr3,html.orangeSoda .iclr3,html.dracula .iclr3{color:#cd7f32}html.dark .iclr4,html.night .iclr4,html.redgreen .iclr4,html.darkNight .iclr4,html.gruvboxDark .iclr4,html.orangeSoda .iclr4,html.dracula .iclr4{color:#c0c0c0}html.dark .iclr5,html.night .iclr5,html.redgreen .iclr5,html.darkNight .iclr5,html.gruvboxDark .iclr5,html.orangeSoda .iclr5,html.dracula .iclr5{color:#d4af37}html.light .menu-label,html.gruvboxLight .menu-label{color:#966100 !important}html.light .iclr2,html.gruvboxLight .iclr2{color:#000}html.light .iclr3,html.gruvboxLight .iclr3{color:#cd7f32}html.light .iclr4,html.gruvboxLight .iclr4{color:#c0c0c0}html.light .iclr5,html.gruvboxLight .iclr5{color:#d4af37} -------------------------------------------------------------------------------- /src/wiki/crispr.js: -------------------------------------------------------------------------------- 1 | import { global } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { genePool } from './../arpa.js'; 4 | import { sideMenu } from './functions.js'; 5 | 6 | export function crisprPage(content){ 7 | content.append(`
${loc('wiki_arpa_crispr')}
`); 8 | 9 | let mainContent = $(`
`); 10 | let crisprContent = sideMenu('create',mainContent); 11 | content.append(mainContent); 12 | 13 | Object.keys(genePool).forEach(function (gene){ 14 | let id = genePool[gene].id.split('-'); 15 | let info = $(`
`); 16 | crisprContent.append(info); 17 | geneDesc(info,gene); 18 | sideMenu('add',`crispr-prestige`,id[1],genePool[gene].title); 19 | }); 20 | } 21 | 22 | const specialRequirements = { 23 | universal: [ 24 | { 25 | title: loc(`wiki_tech_special_universe_not`,[loc(`universe_standard`)]), 26 | color: global.race.universe !== 'standard', 27 | link: 'wiki.html#universes-gameplay-standard' 28 | } 29 | ], 30 | standard: [ 31 | { 32 | title: loc(`wiki_tech_special_universe_not`,[loc(`universe_standard`)]), 33 | color: global.race.universe !== 'standard', 34 | link: 'wiki.html#universes-gameplay-standard' 35 | } 36 | ], 37 | ancients: [ 38 | { 39 | title: loc(`wiki_arpa_crispr_special_ancients`), 40 | color: global.genes['old_gods'] ? true : false, 41 | link: 'wiki.html#resets-prestige-intro' 42 | } 43 | ], 44 | bleeding_effect: [ 45 | { 46 | title: loc(`wiki_tech_special_universe`,[loc(`universe_antimatter`)]), 47 | color: global.race.universe === 'antimatter', 48 | link: 'wiki.html#universes-gameplay-antimatter' 49 | } 50 | ], 51 | blood_remembrance: [ 52 | { 53 | title: loc(`wiki_arpa_crispr_special_blood_remembrance`), 54 | color: global.prestige.Blood_Stone.count >= 1, 55 | link: 'wiki.html#resources-prestige-blood' 56 | } 57 | ] 58 | } 59 | 60 | var crisprTrees = {}; 61 | Object.keys(genePool).forEach(function (gene){ 62 | let crispr = genePool[gene]; 63 | if (!crisprTrees[crispr.grant[0]]){ 64 | crisprTrees[crispr.grant[0]] = {}; 65 | } 66 | let text = typeof genePool[gene].title === 'string' ? genePool[gene].title : genePool[gene].title(); 67 | crisprTrees[crispr.grant[0]][crispr.grant[1]] = { 68 | name: gene 69 | }; 70 | }); 71 | 72 | function geneDesc(info,gene){ 73 | let owned = global.genes[genePool[gene].grant[0]] && global.genes[genePool[gene].grant[0]] >= genePool[gene].grant[1] ? true : false; 74 | 75 | info.append(`

${genePool[gene].title}

${owned ? `${loc('wiki_arpa_purchased')}` : ``}${loc(`wiki_arpa_crispr_${genePool[gene].grant[0]}`)}: ${genePool[gene].grant[1]}
`); 76 | 77 | let stats = $(`
`); 78 | info.append(stats); 79 | 80 | stats.append(`
${genePool[gene].desc}
`); 81 | 82 | let costs = $(`
`); 83 | stats.append(costs); 84 | Object.keys(genePool[gene].cost).forEach(function(res){ 85 | let res_cost = genePool[gene].cost[res](); 86 | if (res_cost > 0){ 87 | if (res === 'Plasmid' && global.race.universe === 'antimatter'){ 88 | res = 'AntiPlasmid'; 89 | } 90 | let label = loc(`resource_${res}_name`); 91 | costs.append(`
${label}: ${res_cost}
`); 92 | } 93 | }); 94 | 95 | if (Object.keys(genePool[gene].reqs).length > 0){ 96 | let reqs = $(`
${loc('wiki_arpa_crispr_req')}
`); 97 | info.append(reqs); 98 | 99 | let comma = false; 100 | Object.keys(genePool[gene].reqs).forEach(function (req){ 101 | let color = global.genes[req] && global.genes[req] >= genePool[gene].reqs[req] ? 'success' : 'danger'; 102 | reqs.append(`${comma ? `, ` : ``}${loc(`wiki_arpa_crispr_${req}`)} ${genePool[gene].reqs[req]}`); 103 | comma = true; 104 | }); 105 | } 106 | if (specialRequirements.hasOwnProperty(gene)){ 107 | let comma = false; 108 | let specialReq = $(`
${loc('wiki_arpa_crispr_req_extra')}
`); 109 | info.append(specialReq); 110 | Object.keys(specialRequirements[gene]).forEach(function (req){ 111 | let color = specialRequirements[gene][req].color ? 'success' : 'danger'; 112 | let text = specialRequirements[gene][req].link ? `${specialRequirements[gene][req].title}` : specialRequirements[gene][req].title; 113 | specialReq.append(`${comma ? `, ` : ``}${text}`); 114 | 115 | comma = true; 116 | }); 117 | } 118 | } -------------------------------------------------------------------------------- /src/wiki/combat.js: -------------------------------------------------------------------------------- 1 | import { loc } from './../locale.js'; 2 | import { sideMenu, infoBoxBuilder } from './functions.js'; 3 | 4 | export function combatPage(content){ 5 | let mainContent = sideMenu('create',content); 6 | 7 | infoBoxBuilder(mainContent,{ name: 'basics', template: 'combat', label: loc('wiki_combat_basics'), paragraphs: 4, h_level: 2}); 8 | sideMenu('add',`combat-gameplay`,`basics`,loc('wiki_combat_basics')); 9 | 10 | infoBoxBuilder(mainContent,{ name: 'campaign', template: 'combat', label: loc('wiki_combat_campaign'), paragraphs: 14, break: [5,11], h_level: 2, 11 | para_data: { 12 | 1: [5, loc('civics_garrison_tactic_ambush'), loc('civics_garrison_tactic_raid'), loc('civics_garrison_tactic_pillage'), loc('civics_garrison_tactic_assault'), loc('civics_garrison_tactic_siege')], 13 | 3: [loc('civics_garrison_tactic_ambush')], 14 | 4: [loc('civics_garrison_tactic_siege'), 20], 15 | 11: ['0%', '50%'], 16 | 12: [50], 17 | 13: ['50%', '100%'], 18 | 14: ['50%'], 19 | } 20 | }); 21 | sideMenu('add',`combat-gameplay`,`campaign`,loc('wiki_combat_campaign')); 22 | 23 | infoBoxBuilder(mainContent,{ name: 'loot', template: 'combat', label: loc('wiki_combat_loot'), paragraphs: 30, break: [3,5,10,13,16,19,22,26,27,28,29,30], h_level: 2, 24 | para_data: { 25 | 2: [3, loc('civics_garrison_campaign'), loc('civics_gov_eco_rate'), loc('civics_garrison_battalion')], 26 | 3: [loc('civics_garrison_campaign')], 27 | 4: [4, loc('wiki_combat_loot_money'), loc('wiki_combat_loot_basic'), loc('wiki_combat_loot_common'), loc('wiki_combat_loot_rare')], 28 | 5: [loc('wiki_combat_loot_basic'), loc('resource_Food_name'), loc('resource_Lumber_name'), loc('resource_Stone_name')], 29 | 6: [loc('wiki_combat_loot_common'), loc('resource_Copper_name'), loc('resource_Iron_name'), loc('resource_Aluminium_name'), loc('resource_Coal_name')], 30 | 7: [loc('wiki_combat_loot_rare'), loc('resource_Cement_name'), loc('resource_Steel_name')], 31 | 8: [loc('wiki_universe_magic'), loc('wiki_combat_loot_rare'), loc('resource_Crystal_name'), loc('trait_terrifying_name') , loc('resource_Titanium_name')], 32 | 9: [loc('wiki_combat_loot_money')], 33 | 10: [loc('civics_garrison_tactic_ambush'),3,loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common')], 34 | 11: [loc('trait_beast_of_burden_name'),loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common')], 35 | 12: [5], 36 | 13: [loc('civics_garrison_tactic_raid'),4,loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 37 | 14: [loc('trait_beast_of_burden_name'),loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 38 | 15: [10], 39 | 16: [loc('civics_garrison_tactic_pillage'),5,loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 40 | 17: [loc('trait_beast_of_burden_name'),loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 41 | 18: [25], 42 | 19: [loc('civics_garrison_tactic_assault'),5,loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 43 | 20: [loc('trait_beast_of_burden_name'),loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 44 | 21: [50], 45 | 22: [loc('civics_garrison_tactic_siege'),5,loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 46 | 23: [loc('trait_beast_of_burden_name'),loc('wiki_combat_loot_money'),loc('wiki_combat_loot_basic'),loc('wiki_combat_loot_common'),loc('wiki_combat_loot_rare')], 47 | 24: [loc('civics_garrison_tactic_siege')], 48 | 25: [999], 49 | 28: [`base loot * log(looters + 1)`], 50 | 29: [loc('civics_gov_eco_rate')], 51 | 30: [`floor(loot * economic rating / 100)`] 52 | }, 53 | data_color: { 54 | 5: ['warning','caution','caution','caution'], 55 | 6: ['warning','caution','caution','caution','caution'], 56 | 7: ['warning','caution','caution'], 57 | 8: ['warning','warning','caution','warning','caution'], 58 | 10: ['warning','warning','caution','caution','caution'], 59 | 11: ['warning','caution','caution','caution'], 60 | 13: ['warning','warning','caution','caution','caution','caution'], 61 | 14: ['warning','caution','caution','caution','caution'], 62 | 16: ['warning','warning','caution','caution','caution','caution'], 63 | 17: ['warning','caution','caution','caution','caution'], 64 | 19: ['warning','warning','caution','caution','caution','caution'], 65 | 20: ['warning','caution','caution','caution','caution'], 66 | 22: ['warning','warning','caution','caution','caution','caution'], 67 | 23: ['warning','caution','caution','caution','caution'], 68 | 28: ['advanced'], 69 | 30: ['advanced'], 70 | } 71 | }); 72 | sideMenu('add',`combat-gameplay`,`loot`,loc('wiki_combat_loot')); 73 | 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/wiki/universes.js: -------------------------------------------------------------------------------- 1 | import { loc } from './../locale.js'; 2 | import { universe_types } from './../space.js'; 3 | import { darkEffect } from './../functions.js'; 4 | import { infoBoxBuilder } from './functions.js'; 5 | import { sideMenu } from './functions.js'; 6 | 7 | export function universePage(content){ 8 | let mainContent = sideMenu('create',content); 9 | 10 | let universes = []; 11 | Object.keys(universe_types).forEach(function (universe){ 12 | universes.push(universe); 13 | }); 14 | let universe_labels = universes.map(x => `${loc(`universe_${x}`)}`); 15 | 16 | infoBoxBuilder(mainContent,{ name: 'intro', template: 'universe', paragraphs: 3, break: [2], h_level: 2, 17 | para_data: { 18 | 1: [universes.length, universe_labels.slice(0, -1).join(', ') + `, ${loc('or')} ${universe_labels[universe_labels.length - 1]}`], 19 | 2: [loc(`universe_standard`)], 20 | 3: [loc(`wiki_resets_blackhole`)] 21 | }, 22 | data_color: { 23 | 1: ['warning','plain'], 24 | 2: ['caution'] 25 | }, 26 | data_link: { 27 | 3: ['wiki.html#resets-gameplay-blackhole'] 28 | } 29 | }); 30 | sideMenu('add',`universes-gameplay`,'intro',loc('wiki_menu_intro')); 31 | 32 | infoBoxBuilder(mainContent,{ name: 'standard', template: 'universe', paragraphs: 3, break: [2], h_level: 2, 33 | para_data: { 34 | 1: [loc(`universe_standard`)], 35 | 2: [loc('wiki_p_res_dark')], 36 | 3: [loc('wiki_p_res_dark'),+((darkEffect('standard',false,true) - 1) * 100).toFixed(3) + '%'] 37 | }, 38 | data_color: { 39 | 1: ['caution'] 40 | } 41 | }); 42 | sideMenu('add',`universes-gameplay`,'standard',loc('wiki_universe_standard')); 43 | 44 | let heavy_space = +((1.25 + (0.5 * darkEffect('heavy',false,true)) - 1) * 100).toFixed(3) + '%'; 45 | let heavy_int = +((1.2 + (0.3 * darkEffect('heavy',false,true)) - 1) * 100).toFixed(3) + '%'; 46 | infoBoxBuilder(mainContent,{ name: 'heavy', template: 'universe', paragraphs: 9, break: [5,8], h_level: 2, 47 | para_data: { 48 | 1: [universe_types.heavy.desc], 49 | 2: [loc('resource_Oil_name'),loc('resource_Helium_3_name'),loc('resource_Deuterium_name')], 50 | 3: [loc('tab_space'),'75%'], 51 | 4: [loc('tab_interstellar'),loc('tab_galactic'),'50%'], 52 | 5: [loc('wiki_universe_heavy')], 53 | 6: ['5%',loc('resource_Plasmid_plural_name'),loc('resource_Phage_name'),loc('resource_Dark_name')], 54 | 7: [loc('resource_Harmony_name'),'20%'], 55 | 8: [loc('wiki_p_res_dark')], 56 | 9: [loc('wiki_p_res_dark'),heavy_space,heavy_int] 57 | }, 58 | data_color: { 59 | 1: ['plain'] 60 | }, 61 | data_link: { 62 | 6: ['plain','wiki.html#resources-prestige-plasmids','wiki.html#resources-prestige-phage','wiki.html#resources-prestige-dark'], 63 | 7: ['wiki.html#resources-prestige-harmony','plain'] 64 | } 65 | }); 66 | sideMenu('add',`universes-gameplay`,'heavy',loc('wiki_universe_heavy')); 67 | 68 | infoBoxBuilder(mainContent,{ name: 'antimatter', template: 'universe', paragraphs: 9, break: [3,6,8], h_level: 2, 69 | para_data: { 70 | 1: [loc(`universe_antimatter`)], 71 | 2: [loc('resource_AntiPlasmid_plural_name'),loc('resource_Plasmid_plural_name')], 72 | 3: [loc('evo_challenge_plasmid'),loc('evo_challenge_mastery')], 73 | 4: ['50%'], 74 | 5: ['50%','6%'], 75 | 7: ['10%'], 76 | 8: [loc('wiki_p_res_dark')], 77 | 9: [loc('wiki_p_res_dark'),+((darkEffect('antimatter',false,true) - 1) * 100).toFixed(3) + '%'] 78 | }, 79 | data_color: { 80 | 1: ['caution'] 81 | }, 82 | data_link: { 83 | 2: ['wiki.html#resources-prestige-antiplasmids','wiki.html#resources-prestige-plasmids'] 84 | } 85 | }); 86 | sideMenu('add',`universes-gameplay`,'antimatter',loc('wiki_universe_antimatter')); 87 | 88 | infoBoxBuilder(mainContent,{ name: 'evil', template: 'universe', paragraphs: 7, break: [2,5], h_level: 2, 89 | para_data: { 90 | 2: [loc('trait_evil_name')], 91 | 3: [loc('trait_evil_name')], 92 | 4: [loc('biome_hellscape_name'),loc('biome_eden_name')], 93 | 5: [loc('wiki_p_res_dark')], 94 | 7: [loc('wiki_p_res_dark'),+((darkEffect('evil',false,true) - 1) * 100).toFixed(3) + '%'] 95 | } 96 | }); 97 | sideMenu('add',`universes-gameplay`,'evil',loc('wiki_universe_evil')); 98 | 99 | infoBoxBuilder(mainContent,{ name: 'micro', template: 'universe', paragraphs: 6, break: [2,4], h_level: 2, 100 | para_data: { 101 | 1: ['75%'], 102 | 4: [loc('wiki_p_res_dark')], 103 | 5: [loc('wiki_p_res_dark'),darkEffect('micro',false,true),darkEffect('micro',true,true)], 104 | 6: ['1.005'] 105 | } 106 | }); 107 | sideMenu('add',`universes-gameplay`,'micro',loc('wiki_universe_micro')); 108 | 109 | infoBoxBuilder(mainContent,{ name: 'magic', template: 'universe', paragraphs: 8, break: [4,7], h_level: 2, 110 | para_data: { 111 | 6: [80], 112 | 7: [loc('wiki_p_res_dark')], 113 | 8: [loc('wiki_p_res_dark'),+((darkEffect('magic',false,true) - 1) * 100).toFixed(3) + '%'], 114 | } 115 | }); 116 | sideMenu('add',`universes-gameplay`,'magic',loc('wiki_universe_magic')); 117 | } 118 | -------------------------------------------------------------------------------- /src/wiki/government.js: -------------------------------------------------------------------------------- 1 | import { loc } from './../locale.js'; 2 | import { sideMenu, infoBoxBuilder } from './functions.js'; 3 | 4 | export function govPage(content){ 5 | let mainContent = sideMenu('create',content); 6 | 7 | infoBoxBuilder(mainContent,{ name: 'info', template: 'government', label: loc('tab_gov'), paragraphs: 8, break: [3,6], h_level: 2, 8 | para_data: { 9 | 2: [loc('govern_anarchy')], 10 | 3: [loc('civics_revolution')], 11 | 4: [loc('civics_revolution')], 12 | 5: [1000] 13 | }, 14 | data_color: { 2: ['caution'] } 15 | }); 16 | sideMenu('add',`government-gameplay`,`info`,loc('tab_gov')); 17 | 18 | let govs = { 19 | anarchy: { 20 | paragraphs: 5, 21 | break: [2,5], 22 | para_data: { 23 | 2: [10], 24 | 3: ['10th','0.25%','1/2'] 25 | } 26 | }, 27 | autocracy: { 28 | paragraphs: 4, 29 | break: [2,4], 30 | para_data: { 31 | 2: ['35%','25%'], 32 | 3: ['18%',loc('tech_electricity'),'10%',loc('tech_virtual_reality')] 33 | }, 34 | para_color: {} 35 | }, 36 | democracy: { 37 | paragraphs: 6, 38 | break: [2,5], 39 | para_data: { 40 | 2: [loc('job_entertainer'),'20%'], 41 | 3: [loc('job_entertainer')], 42 | 4: ['25%',loc('tech_electricity'),'30%',loc('tech_virtual_reality')], 43 | 5: ['5%'], 44 | 6: [ 45 | loc('job_farmer'),loc('job_lumberjack'),loc('job_quarry_worker'),loc('job_miner'),loc('job_crystal_miner'), 46 | loc('job_coal_miner'),loc('job_cement_worker'),loc('job_professor'),loc('job_scientist'),loc('soldiers') 47 | ] 48 | } 49 | }, 50 | oligarchy: { 51 | paragraphs: 5, 52 | break: [2,4,5], 53 | text: { 54 | 1: `govern_oligarchy_desc`, 55 | 2: `govern_oligarchy_effect` 56 | }, 57 | para_data: { 58 | 2: [5,20], 59 | 3: ['2%',loc('tech_electricity'),loc('tech_virtual_reality')], 60 | 4: ['45%'], 61 | 5: ['0.5%','20%'] 62 | } 63 | }, 64 | theocracy: { 65 | paragraphs: 7, 66 | break: [2,6,7], 67 | para_data: { 68 | 2: ['12%'], 69 | 3: ['25%'], 70 | 4: ['50%'], 71 | 6: ['40%',loc('tech_virtual_reality'),'25%',loc('tech_metaphysics')] 72 | } 73 | }, 74 | republic: { 75 | paragraphs: 7, 76 | break: [2,5,6], 77 | para_data: { 78 | 2: ['25%'], 79 | 3: ['20%'], 80 | 5: ['30%',loc('tech_virtual_reality'),'40%',loc('tech_metaphysics')], 81 | 6: ['30%'], 82 | 7: [30,90], 83 | }, 84 | para_color: {} 85 | }, 86 | socialist: { 87 | paragraphs: 6, 88 | break: [2,6], 89 | para_data: { 90 | 2: ['35%'], 91 | 3: ['10%'], 92 | 4: ['10%'], 93 | 5: ['20%'], 94 | 6: ['42%',loc('tech_virtual_reality'),'50%',loc('tech_metaphysics')] 95 | }, 96 | }, 97 | corpocracy: { 98 | paragraphs: 9, 99 | break: [2,8,9], 100 | para_data: { 101 | 2: ['50%'], 102 | 3: ['200%'], 103 | 4: ['150%'], 104 | 5: ['100%'], 105 | 6: ['10%'], 106 | 7: ['30%'], 107 | 8: ['5%',loc('tech_virtual_reality')], 108 | 9: ['40%',loc('tech_metaphysics')] 109 | } 110 | }, 111 | technocracy: { 112 | paragraphs: 5, 113 | break: [2,4], 114 | para_data: { 115 | 2: ['8%'], 116 | 3: ['10%'], 117 | 4: ['2%'], 118 | 5: ['1%',loc('tech_virtual_reality'),loc('tech_metaphysics')] 119 | } 120 | }, 121 | federation: { 122 | paragraphs: 7, 123 | break: [2,5,6], 124 | para_data: { 125 | 2: ['3%'], 126 | 4: ['25%'], 127 | 5: ['10%'], 128 | 6: ['25%','32%'], 129 | 7: ['36%',loc('tech_virtual_reality'),'40%',loc('tech_metaphysics')] 130 | } 131 | }, 132 | magocracy: { 133 | paragraphs: 5, 134 | break: [2,3,5], 135 | para_data: { 136 | 2: ['25%'], 137 | 3: ['25%'], 138 | 4: ['40%',loc('tech_virtual_reality'),'50%',loc('tech_metaphysics')] 139 | } 140 | } 141 | }; 142 | 143 | Object.keys(govs).forEach(function (gov){ 144 | infoBoxBuilder(mainContent,{ name: gov, template: 'government', label: loc(`govern_${gov}`), paragraphs: govs[gov].paragraphs, break: govs[gov].break, h_level: 2, 145 | text: govs[gov].hasOwnProperty('text') ? govs[gov].text : { 146 | 1: `govern_${gov}_desc` 147 | }, 148 | para_data: govs[gov].hasOwnProperty('para_data') ? govs[gov].para_data : {}, 149 | para_color: govs[gov].hasOwnProperty('para_color') ? govs[gov].para_color : {}, 150 | }); 151 | sideMenu('add',`government-gameplay`,gov,loc(`govern_${gov}`)); 152 | }); 153 | } 154 | -------------------------------------------------------------------------------- /src/wiki/blood.js: -------------------------------------------------------------------------------- 1 | import { global } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { vBind } from './../functions.js'; 4 | import { bloodPool } from './../arpa.js'; 5 | import { sideMenu } from './functions.js'; 6 | 7 | export function bloodPage(content){ 8 | content.append(`
${loc('wiki_arpa_blood')}
`); 9 | 10 | let mainContent = $(`
`); 11 | let crisprContent = sideMenu('create',mainContent); 12 | content.append(mainContent); 13 | 14 | Object.keys(bloodPool).forEach(function (trait){ 15 | let id = bloodPool[trait].id.split('-'); 16 | let info = $(`
`); 17 | crisprContent.append(info); 18 | bloodDesc(info,trait); 19 | sideMenu('add',`blood-prestige`,id[1],bloodPool[trait].title); 20 | }); 21 | } 22 | 23 | var bloodTrees = {}; 24 | Object.keys(bloodPool).forEach(function (blood){ 25 | let infusion = bloodPool[blood]; 26 | if (!bloodTrees[infusion.grant[0]]){ 27 | bloodTrees[infusion.grant[0]] = {}; 28 | } 29 | let text = typeof bloodPool[blood].title === 'string' ? bloodPool[blood].title : bloodPool[blood].title(); 30 | bloodTrees[infusion.grant[0]][infusion.grant[1]] = { 31 | name: blood 32 | }; 33 | }); 34 | 35 | function bloodDesc(info,trait){ 36 | let owned = global.blood[bloodPool[trait].grant[0]] && global.blood[bloodPool[trait].grant[0]] >= bloodPool[trait].grant[1] ? true : false; 37 | 38 | info.append(`

${bloodPool[trait].title}

${owned ? `${loc('wiki_arpa_purchased')}` : ``}${loc(`wiki_arpa_blood_${bloodPool[trait].grant[0]}`)}: ${bloodPool[trait].grant[1]}
`); 39 | 40 | let stats = $(`
`); 41 | info.append(stats); 42 | 43 | stats.append(`
${bloodPool[trait].desc}
`); 44 | 45 | let costs = $(`
`); 46 | stats.append(costs); 47 | Object.keys(bloodPool[trait].cost).forEach(function(res){ 48 | let label = loc(`resource_${res}_name`); 49 | if (bloodPool[trait].grant[1] === '*'){ 50 | costs.append(`
${label}: {{ r.${res}.cost }}
`); 51 | } 52 | else { 53 | let res_cost = bloodPool[trait].cost[res](); 54 | if (res_cost > 0){ 55 | costs.append(`
${label}: ${res_cost}
`); 56 | } 57 | } 58 | }); 59 | 60 | if (Object.keys(bloodPool[trait].reqs).length > 0 || bloodPool[trait].hasOwnProperty('condition')){ 61 | let reqs = $(`
${loc('wiki_arpa_crispr_req')}
`); 62 | info.append(reqs); 63 | 64 | let comma = false; 65 | if (Object.keys(bloodPool[trait].reqs).length > 0){ 66 | Object.keys(bloodPool[trait].reqs).forEach(function (req){ 67 | let color = global.blood[req] && global.blood[req] >= bloodPool[trait].reqs[req] ? 'success' : 'danger'; 68 | reqs.append(`${comma ? `, ` : ``}${loc(`wiki_arpa_blood_${req}`)} ${bloodPool[trait].reqs[req]}`); 69 | comma = true; 70 | }); 71 | } 72 | if (bloodPool[trait].hasOwnProperty('condition')){ 73 | let color = global.genes['blood'] && global.genes.blood >= 3 ? 'success' : 'danger'; 74 | reqs.append(`${comma ? `, ` : ``}${loc(`wiki_arpa_crispr_blood`)} 3`); 75 | } 76 | } 77 | 78 | if (bloodPool[trait].grant[1] === '*'){ 79 | addCalcInputs(info,trait); 80 | } 81 | } 82 | 83 | function addCalcInputs(parent,key){ 84 | let inputs = { 85 | owned: 0, 86 | }; 87 | let resources = {}; 88 | 89 | let action = bloodPool[key]; 90 | inputs.real_owned = global.blood[key] ? global.blood[key] : 0; 91 | 92 | let cost = action.cost; 93 | Object.keys(cost).forEach(function (res){ 94 | resources[res] = {}; 95 | }); 96 | 97 | //Functions to update costs and cost creeps 98 | let updateCosts = function(){ 99 | Object.keys(resources).forEach(function (res){ 100 | let new_cost = cost[res] ? cost[res](inputs.owned - inputs.real_owned) : 0; 101 | resources[res].vis = new_cost > 0 ? true : false; 102 | resources[res].cost = new_cost; 103 | }); 104 | }; 105 | updateCosts(); 106 | 107 | //Add calculator inputs 108 | parent.append($(` 109 |
110 |
111 |
${loc('wiki_calc_level')} -+
112 |
113 |
114 | 115 |
116 |
117 | `)); 118 | 119 | vBind({ 120 | el: `#${key}`, 121 | data: { 122 | i: inputs, 123 | r: resources 124 | }, 125 | methods: { 126 | val(type){ 127 | inputs[type] = Math.round(inputs[type]); 128 | if (inputs[type] && inputs[type] < 0){ 129 | inputs[type] = 0; 130 | } 131 | updateCosts(); 132 | }, 133 | less(type){ 134 | if (inputs[type] > 0){ 135 | inputs[type]--; 136 | } 137 | }, 138 | more(type){ 139 | inputs[type]++; 140 | }, 141 | importInputs(){ 142 | inputs.owned = inputs.real_owned; 143 | } 144 | } 145 | }); 146 | } -------------------------------------------------------------------------------- /src/wiki/species.js: -------------------------------------------------------------------------------- 1 | import { global } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { clearElement, popover, getEaster, getTraitDesc } from './../functions.js'; 4 | import { races, traits, genus_traits, traitSkin } from './../races.js'; 5 | import { ascendLab } from './../space.js'; 6 | import { sideMenu, infoBoxBuilder } from './functions.js'; 7 | 8 | export function speciesPage(zone){ 9 | let content = $(`#content`); 10 | clearElement(content); 11 | 12 | switch (zone){ 13 | case 'races': 14 | racesPage(content); 15 | break; 16 | case 'traits': 17 | traitsPage(content); 18 | break; 19 | case 'custom': 20 | customPage(content); 21 | break; 22 | } 23 | } 24 | 25 | export function customPage(content) { 26 | infoBoxBuilder(content,{ name: 'custom', template: 'mechanics', label: loc('wiki_mechanics_custom'), paragraphs: 12, break: [3,5,9,11], full: true, h_level: 2, 27 | para_data: { 28 | 1: [loc('wiki_resets_ascension')], 29 | 2: [loc('wiki_resets_ascension')], 30 | 5: [loc('resource_Genes_name')], 31 | 6: [loc('resource_Genes_name')], 32 | 7: [2], 33 | 8: [loc('achieve_technophobe_name'),5,7], 34 | 9: [loc('tech_fanaticism'),loc('tech_deify')], 35 | 11: [0,loc('resource_Genes_name')], 36 | 12: [loc('resource_Genes_name'),loc('trait_untapped_name')] 37 | }, 38 | data_link: { 39 | 1: ['wiki.html#resets-prestige-ascension'], 40 | 2: ['wiki.html#resets-prestige-ascension'], 41 | 8: ['wiki.html#perks-prestige-technophobe'], 42 | 9: [(global.genes['transcendence'] ? 'wiki.html#civilized-tech-alt_fanaticism' : 'wiki.html#civilized-tech-fanaticism'),'wiki.html#early_space-tech-deify'] 43 | } 44 | }); 45 | let lab = $(`
`); 46 | content.append(lab); 47 | ascendLab(lab); 48 | } 49 | 50 | export function racesPage(content){ 51 | content = sideMenu('create',content); 52 | 53 | let list = []; 54 | Object.keys(races).forEach(function (race){ 55 | if ((race === 'custom' && !global.custom.hasOwnProperty('race0')) || race === 'protoplasm'){ 56 | return; 57 | } 58 | 59 | let info = $(`
`); 60 | content.append(info); 61 | 62 | info.append(`

${races[race].name}

${loc(`genelab_genus_${races[race].type}`)}
`); 63 | info.append(`
${typeof races[race].desc === 'string' ? races[race].desc : races[race].desc()}
`); 64 | 65 | let traitList = []; 66 | let extraTraits = extraTraitList(race); 67 | 68 | let genes = $(`
`); 69 | Object.keys(genus_traits[races[race].type]).sort().forEach(function (trait){ 70 | let id = `raceTrait${race}${trait}`; 71 | let color = races[race].fanaticism === trait ? 'danger' : 'caution'; 72 | genes.append(`${traits[trait].name}`); 73 | traitList.push({ t: trait, r: 1}); 74 | }); 75 | Object.keys(races[race].traits).sort().forEach(function (trait){ 76 | let id = `raceTrait${race}${trait}`; 77 | let color = races[race].fanaticism === trait ? 'danger' : 'info'; 78 | genes.append(`${traits[trait].name}`); 79 | traitList.push({ t: trait, r: races[race].traits[trait] }); 80 | }); 81 | for (let i=0; i${traits[extraTraits[i].t].name}`); 85 | traitList.push(extraTraits[i]); 86 | } 87 | info.append(genes); 88 | list.push(race); 89 | 90 | popover(`genus${race}`,$(`
${loc(`genelab_genus_${races[race].type}_desc`)}
`),{ wide: true, classes: 'w25' }); 91 | 92 | for (let i=0; i`); 95 | 96 | getTraitDesc(desc, traitList[i].t, { 97 | fanatic: traitList[i].t === races[race].fanaticism ? races[race].name : false, 98 | trank: traitList[i].r, 99 | wiki: true 100 | }); 101 | 102 | popover(id,desc,{ wide: true, classes: 'w25' }); 103 | } 104 | }); 105 | 106 | list.sort((a,b) => races[a].name < races[b].name ? -1 : 1).forEach(function(race){ 107 | sideMenu('add',`races-species`,race,races[race].name); 108 | }); 109 | } 110 | 111 | function extraTraitList(race){ 112 | const date = new Date(); 113 | let easter = getEaster(); 114 | switch (race){ 115 | case 'wolven': 116 | return easter.active ? [{t: 'hyper', r: 1},{t: 'fast_growth', r: 1},{t: 'rainbow', r: 1},{t: 'optimistic', r: 1}] : []; 117 | case 'vulpine': 118 | return easter.active ? [{t: 'cannibalize', r: 1},{t: 'rage', r: 1},{t: 'blood_thirst', r: 1},{t: 'sticky', r: 1}] : []; 119 | case 'elven': 120 | return date.getMonth() === 11 && date.getDate() >= 17 ? [{t: 'slaver', r: 2},{t: 'resourceful', r: 0.5},{t: 'small', r: 0.25}] : []; 121 | case 'capybara': 122 | return date.getMonth() === 11 && date.getDate() >= 17 ? [{t: 'beast_of_burden', r: 1},{t: 'pack_rat', r: 0.5},{t: 'musical', r: 0.25}] : []; 123 | case 'centaur': 124 | return date.getMonth() === 11 && date.getDate() >= 17 ? [{t: 'beast_of_burden', r: 1},{t: 'curious', r: 0.5},{t: 'blissful', r: 0.25}] : []; 125 | case 'wendigo': 126 | return date.getMonth() === 11 && date.getDate() >= 17 ? [{t: 'immoral', r: 3},{t: 'cannibalize', r: 0.5},{t: 'claws', r: 0.25}] : []; 127 | case 'yeti': 128 | return date.getMonth() === 11 && date.getDate() >= 17 ? [{t: 'scavenger', r: 3},{t: 'regenerative', r: 0.5},{t: 'musical', r: 0.25}] : []; 129 | case 'entish': 130 | return date.getMonth() === 11 && date.getDate() >= 17 ? [{t: 'photosynth', r: 3},{t: 'optimistic', r: 0.5},{t: 'armored', r: 0.25}] : []; 131 | default: 132 | return []; 133 | } 134 | } 135 | 136 | export function traitsPage(content){ 137 | content = sideMenu('create',content); 138 | 139 | let types = [['genus','major'],['minor'],['special']]; 140 | for (let i=0; i traitSkin('name',a).localeCompare(traitSkin('name',b)) ).forEach(function (trait){ 142 | if (types[i].includes(traits[trait].type)){ 143 | let info = $(`
`); 144 | content.append(info); 145 | getTraitDesc(info, trait, { tpage: true, wiki: true }); 146 | sideMenu('add',`traits-species`,`${traits[trait].type}_${trait}`,traitSkin('name',trait)); 147 | } 148 | }); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/wiki/wiki.less: -------------------------------------------------------------------------------- 1 | html { 2 | overflow-y: auto; 3 | } 4 | 5 | span, div { 6 | -moz-user-select: initial; 7 | -khtml-user-select: initial; 8 | -webkit-user-select: initial; 9 | -ms-user-select: initial; 10 | user-select: initial; 11 | cursor: default; 12 | } 13 | 14 | .main { 15 | overflow-y: initial; 16 | } 17 | 18 | #sideContent.sticky { 19 | height: 95vh; 20 | } 21 | 22 | .wiki { 23 | display: flex; 24 | margin: 0 1rem; 25 | padding-top: 1rem; 26 | 27 | .mainMenu { 28 | margin-left: .5rem; 29 | width: 10rem; 30 | 31 | .sticky { 32 | height: ~"calc(100vh - 1rem)"; 33 | } 34 | 35 | .menu-list { 36 | li { 37 | cursor: pointer; 38 | span { 39 | cursor: pointer; 40 | } 41 | } 42 | } 43 | } 44 | 45 | .mainContent { 46 | margin-left: 1rem; 47 | flex: 1; 48 | 49 | .b-tabs:not(:last-child){ 50 | margin-bottom: 0; 51 | } 52 | } 53 | 54 | .paragraph { 55 | margin: 0 1rem 1rem 0; 56 | } 57 | 58 | .header { 59 | margin: 0.25rem 0 1rem; 60 | } 61 | .achievements.header { 62 | margin: 1rem 0 0.25rem; 63 | } 64 | 65 | .menu-label { 66 | font-size: 1rem; 67 | } 68 | 69 | .infoBox { 70 | max-width: 50rem; 71 | margin-bottom: .5rem; 72 | margin-right: .5rem; 73 | padding: .25rem .5rem; 74 | border: .0625rem solid; 75 | 76 | span[role=button] { 77 | cursor: pointer; 78 | } 79 | 80 | span.row { 81 | display: block; 82 | } 83 | 84 | &.wide { 85 | max-width: 100%; 86 | margin-right: 0; 87 | } 88 | 89 | h2 { 90 | margin-bottom: .25rem; 91 | border-bottom: .0625rem solid; 92 | } 93 | 94 | div { 95 | margin-bottom: .5rem; 96 | clear: both; 97 | } 98 | 99 | li { 100 | list-style-position: inside; 101 | } 102 | 103 | .type { 104 | display: flex; 105 | justify-content: space-between; 106 | > span:nth-child(1) { 107 | display: block; 108 | text-align: left; 109 | } 110 | > span:nth-child(2) { 111 | display: block; 112 | text-align: right; 113 | } 114 | } 115 | 116 | .itemlist { 117 | span { 118 | display: inline-block; 119 | margin-right: 1rem; 120 | } 121 | } 122 | 123 | .propList { 124 | display: flex; 125 | flex-wrap: wrap; 126 | justify-content: space-between; 127 | > div { 128 | margin-right: 1rem; 129 | } 130 | } 131 | 132 | .stats { 133 | display: flex; 134 | justify-content: space-between; 135 | border-top: .0625rem solid; 136 | margin-top: .5rem; 137 | padding-top: .5rem; 138 | 139 | .effect { 140 | width: 70%; 141 | } 142 | 143 | .cost { 144 | width: 30%; 145 | } 146 | 147 | .right { 148 | margin-left: .5rem; 149 | padding-left: .5rem; 150 | border-left: .0625rem solid; 151 | } 152 | } 153 | 154 | .reqs { 155 | span:not(:first-child):not(.subreqs) { 156 | margin-left: 0.5rem; 157 | } 158 | } 159 | 160 | .extra { 161 | border-top: .0625rem solid; 162 | margin-top: .5rem; 163 | padding-top: .5rem; 164 | 165 | .calcButton button { 166 | height: 1.5rem; 167 | } 168 | } 169 | 170 | div.aTable { 171 | columns: 2; 172 | span { 173 | display: flex; 174 | } 175 | } 176 | 177 | .para { 178 | > span { 179 | margin-right: .25rem; 180 | } 181 | } 182 | 183 | .infoSummary { 184 | display: inline-grid; 185 | text-align: left; 186 | max-width: 18rem; 187 | border-radius: .25rem; 188 | line-height: 1.3125rem; 189 | margin-right: 1rem; 190 | } 191 | 192 | &.col2 { 193 | display: flex; 194 | flex-wrap: wrap; 195 | align-content: space-between; 196 | > h2, 197 | > h3, 198 | > h4 { 199 | width: 100%; 200 | } 201 | > div { 202 | width: 50%; 203 | } 204 | } 205 | 206 | &.sk1 { 207 | div:first-of-type { 208 | width: 100%; 209 | } 210 | } 211 | } 212 | 213 | .question { 214 | h2 { 215 | margin-bottom: .25rem; 216 | text-decoration: underline; 217 | } 218 | margin-bottom: .75rem; 219 | } 220 | 221 | .achieveList { 222 | display: flex; 223 | flex-wrap: wrap; 224 | .achievement { 225 | display: inline-flex; 226 | justify-content: space-between; 227 | width: 23rem; 228 | margin-right: 1rem; 229 | :first-child { 230 | width: initial; 231 | } 232 | span.achieve { 233 | display: block; 234 | } 235 | span.icons { 236 | display: block; 237 | text-align: right; 238 | } 239 | p.flair { 240 | display: inline; 241 | position: initial; 242 | line-height: 1rem; 243 | } 244 | } 245 | } 246 | 247 | .duelList { 248 | display: flex; 249 | flex-flow: wrap; 250 | 251 | .itemlist { 252 | display: flex; 253 | } 254 | 255 | .listSide { 256 | min-width: 30rem; 257 | width: 50%; 258 | border: .0625rem solid; 259 | text-align: center; 260 | 261 | .infoBox { 262 | list-style: none; 263 | text-align: left; 264 | margin: 0.5rem; 265 | } 266 | 267 | @media only screen and (max-width: 74.5rem){ 268 | width: 100%; 269 | .infoBox { 270 | max-width: 100%; 271 | } 272 | } 273 | } 274 | } 275 | 276 | .flexed { 277 | display: flex; 278 | flex-wrap: wrap; 279 | justify-content: space-between; 280 | > span { 281 | text-align: left; 282 | width: 4rem; 283 | display: block; 284 | margin: 0 .5rem; 285 | padding: 0 .5rem; 286 | } 287 | .wide { 288 | width: 6.9375rem; 289 | } 290 | .swide { 291 | width: 12rem; 292 | } 293 | &.wide { 294 | width: 40rem; 295 | } 296 | } 297 | 298 | .flex { 299 | display: flex; 300 | } 301 | 302 | ul.disc { 303 | list-style: disc; 304 | margin-left: 1.25rem; 305 | } 306 | 307 | .tbl { 308 | display: table; 309 | .trow { 310 | display: table-row; 311 | .tcell { 312 | display: table-cell; 313 | padding-right: 0.75rem; 314 | } 315 | .tcell:last-child { 316 | padding-right: 0; 317 | } 318 | .eggsol, 319 | .totsol { 320 | cursor: pointer; 321 | } 322 | } 323 | } 324 | 325 | .reveal { 326 | cursor: pointer; 327 | margin-bottom: .5rem; 328 | } 329 | .calcInput { 330 | width: 7.5rem; 331 | display: inline-block; 332 | height: 1.25rem; 333 | margin-bottom: .5rem; 334 | text-align: center; 335 | 336 | input { 337 | height: 1.25rem; 338 | line-height: 1.25rem; 339 | text-align: center; 340 | } 341 | 342 | .dropdown button { 343 | height: 1.25rem; 344 | padding: 0 .75rem; 345 | } 346 | 347 | .calcInputButton { 348 | height: 1.25rem; 349 | padding: 0 .25rem; 350 | margin: 0; 351 | } 352 | } 353 | .calcButton{ 354 | margin-bottom: 1rem; 355 | } 356 | } 357 | 358 | .main>div.popper.wide.w25, 359 | body .modal>div.popper.wide.w25 { 360 | max-width: 25rem; 361 | } 362 | 363 | html.dark, 364 | html.night, 365 | html.redgreen, 366 | html.darkNight, 367 | html.gruvboxDark, 368 | html.orangeSoda, 369 | html.dracula { 370 | .menu-label { 371 | color: #ffa500 !important; 372 | } 373 | .iclr2 { 374 | color: #fff; 375 | } 376 | .iclr3 { 377 | color: #cd7f32; 378 | } 379 | .iclr4 { 380 | color: #c0c0c0; 381 | } 382 | .iclr5 { 383 | color: #d4af37; 384 | } 385 | } 386 | 387 | html.light, 388 | html.gruvboxLight { 389 | .menu-label { 390 | color: #966100 !important; 391 | } 392 | .iclr2 { 393 | color: #000; 394 | } 395 | .iclr3 { 396 | color: #cd7f32; 397 | } 398 | .iclr4 { 399 | color: #c0c0c0; 400 | } 401 | .iclr5 { 402 | color: #d4af37; 403 | } 404 | } 405 | -------------------------------------------------------------------------------- /src/wiki/projects.js: -------------------------------------------------------------------------------- 1 | import { global, sizeApproximation } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { vBind } from './../functions.js'; 4 | import { arpaProjects, arpaAdjustCosts } from './../arpa.js'; 5 | import { sideMenu } from './functions.js'; 6 | 7 | const extraInformation = { 8 | launch_facility: [loc('wiki_arpa_project_launch_facility')], 9 | monument: [monumentExtra(),loc('wiki_arpa_project_monument_random'),loc('wiki_arpa_project_monument_exceptions')], 10 | railway: [loc('wiki_arpa_project_railway_homeless',[3,7,11,17,25,38,59,100,225])], 11 | roid_eject: [loc('wiki_arpa_project_roid_eject')], 12 | tp_depot: [loc('wiki_arpa_project_depot')], 13 | nexus: [loc('wiki_arpa_project_magic')], 14 | syphon: [loc('wiki_arpa_project_magic')] 15 | }; 16 | 17 | export function projectsPage(content){ 18 | content.append(`
${loc('wiki_arpa_projects')}
`); 19 | 20 | let mainContent = $(`
`); 21 | let projectContent = sideMenu('create',mainContent); 22 | content.append(mainContent); 23 | 24 | Object.keys(arpaProjects).forEach(function (project){ 25 | let info = $(`
`); 26 | projectContent.append(info); 27 | projectDesc(info,project); 28 | sideMenu('add',`projects-arpa`,project,typeof arpaProjects[project].title === 'string' ? arpaProjects[project].title : arpaProjects[project].title(true)); 29 | }); 30 | } 31 | 32 | function projectDesc(info,project){ 33 | let title = typeof arpaProjects[project].title === 'string' ? arpaProjects[project].title : arpaProjects[project].title(true); 34 | info.append(`

${title}

`); 35 | 36 | let stats = $(`
`); 37 | info.append(stats); 38 | 39 | stats.append(`
${typeof arpaProjects[project].desc === 'string' ? arpaProjects[project].desc : arpaProjects[project].desc()}
`); 40 | stats.append(`
${typeof arpaProjects[project].effect === 'string' ? arpaProjects[project].effect : arpaProjects[project].effect()}
`); 41 | 42 | if (extraInformation[project]){ 43 | let extra = $(`
`); 44 | info.append(extra); 45 | addInformation(extra,project); 46 | } 47 | addCosts(info,project); 48 | } 49 | 50 | function addInformation(parent,key){ 51 | let extra = $(`
`); 52 | parent.append(extra); 53 | if (extraInformation.hasOwnProperty(key)){ 54 | for (let i=0; i${extraInformation[key][i]}`); 56 | } 57 | } 58 | } 59 | 60 | function addCosts(parent,key){ 61 | let inputs = { 62 | owned: 0, 63 | creepVis: true, 64 | extra: { 65 | creative: false 66 | } 67 | }; 68 | let resources = {}; 69 | 70 | switch (key){ 71 | case 'monument': 72 | inputs.extra.m_type = 'Obelisk'; 73 | break; 74 | case 'launch_facility': 75 | inputs.creepVis = false; 76 | break; 77 | } 78 | 79 | let action = arpaProjects[key]; 80 | inputs.real_owned = global.arpa[key] ? global.arpa[key].rank : 0; 81 | 82 | let costContain = $(`
`); 83 | parent.append(costContain); 84 | let costs = $(`

${loc('wiki_calc_cost')}

`); 85 | let costCreep = $(`

${loc('wiki_calc_cost_creep')}

`); 86 | costContain.append(costs); 87 | costContain.append(costCreep); 88 | 89 | let cost = action.cost; 90 | Object.keys(arpaAdjustCosts(cost)).forEach(function (res){ 91 | resources[res] = {}; 92 | let label = res === 'Money' ? '$' : global.resource[res].name + ': '; 93 | costs.append($(`
${label}{{ r.${res}.cost }}
`)); 94 | costCreep.append($(`
{{ r.${res}.creep }}
`)); 95 | }); 96 | 97 | //Functions to update costs and cost creeps 98 | let updateCosts = function(){ 99 | let new_costs = arpaAdjustCosts(cost,inputs.owned - inputs.real_owned,inputs.extra); 100 | Object.keys(resources).forEach(function (res){ 101 | let new_cost = new_costs[res] ? new_costs[res](inputs.owned - inputs.real_owned,inputs.extra) : 0; 102 | resources[res].vis = new_cost > 0 ? true : false; 103 | resources[res].cost = sizeApproximation(new_cost,1); 104 | }); 105 | }; 106 | updateCosts(); 107 | 108 | let updateCostCreep = function(){ 109 | if (key !== 'launch_facility'){ 110 | let upper = arpaAdjustCosts(cost,100,inputs.extra); 111 | let lower = arpaAdjustCosts(cost,99,inputs.extra); 112 | Object.keys(resources).forEach(function (res){ 113 | if (upper[res]){ 114 | resources[res].creep = +(upper[res](100,inputs.extra) / lower[res](99,inputs.extra)).toFixed(4); 115 | } 116 | }); 117 | } 118 | }; 119 | updateCostCreep(); 120 | 121 | //Add calculator inputs 122 | let calcInputs = ` 123 |
124 |
`; 125 | if (key !== 'launch_facility'){ 126 | calcInputs += ` 127 |
${loc('wiki_calc_level')} -+
`; 128 | } 129 | if (key === 'monument'){ 130 | calcInputs += ` 131 |
${loc('wiki_calc_m_type')} 132 | 136 | {{ 'Obelisk' | monumentLabel }} 137 | {{ 'Statue' | monumentLabel }} 138 | {{ 'Sculpture' | monumentLabel }} 139 | {{ 'Monolith' | monumentLabel }} 140 | {{ 'Pillar' | monumentLabel }} 141 | {{ 'Megalith' | monumentLabel }} 142 |
143 | `; 144 | } 145 | calcInputs += ` 146 |
${loc('trait_creative_name')}
147 |
148 |
149 | 150 |
151 |
152 | `; 153 | parent.append($(calcInputs)); 154 | 155 | vBind({ 156 | el: `#${key}`, 157 | data: { 158 | i: inputs, 159 | r: resources 160 | }, 161 | methods: { 162 | val(type){ 163 | inputs[type] = Math.round(inputs[type]); 164 | if (inputs[type] && inputs[type] < 0){ 165 | inputs[type] = 0; 166 | } 167 | updateCosts(); 168 | }, 169 | less(type){ 170 | if (inputs[type] > 0){ 171 | inputs[type]--; 172 | } 173 | }, 174 | more(type){ 175 | inputs[type]++; 176 | }, 177 | pickMonument(type){ 178 | inputs.extra.m_type = type; 179 | updateCosts(); 180 | updateCostCreep(); 181 | }, 182 | update(){ 183 | updateCosts(); 184 | updateCostCreep(); 185 | }, 186 | importInputs(){ 187 | if (key !== 'launch_facility'){ 188 | inputs.owned = inputs.real_owned; 189 | } 190 | inputs.extra.creative = global.race['creative'] ? true : false; 191 | if (key === 'monument' && global.arpa['m_type']){ 192 | inputs.extra.m_type = global.arpa.m_type; 193 | } 194 | } 195 | }, 196 | filters: { 197 | monumentLabel(type){ 198 | switch(type){ 199 | case 'Obelisk': 200 | return loc('arpa_project_monument_obelisk'); 201 | case 'Statue': 202 | return loc('arpa_project_monument_statue'); 203 | case 'Sculpture': 204 | return loc('arpa_project_monument_sculpture'); 205 | case 'Monolith': 206 | return loc('arpa_project_monument_monolith'); 207 | case 'Pillar': 208 | return loc('arpa_project_monument_pillar'); 209 | case 'Megalith': 210 | return loc('arpa_project_monument_megalith'); 211 | } 212 | } 213 | } 214 | }); 215 | } 216 | 217 | function monumentExtra(){ 218 | let monuments = [ 219 | loc('arpa_project_monument_obelisk'), 220 | loc('arpa_project_monument_statue'), 221 | loc('arpa_project_monument_sculpture'), 222 | loc('arpa_project_monument_monolith'), 223 | loc('arpa_project_monument_pillar'), 224 | loc('arpa_project_monument_megalith') 225 | ]; 226 | let materials = [ 227 | loc('resource_Stone_name'), 228 | loc('resource_Aluminium_name'), 229 | loc('resource_Steel_name'), 230 | loc('resource_Cement_name'), 231 | loc('resource_Bones_name'), 232 | loc('resource_Crystal_name'), 233 | ]; 234 | let desc = `
${loc('wiki_arpa_project_monument',[monuments.length, monuments.join(", ")])}
`; 235 | for (let i=0; i${loc('wiki_arpa_project_monument_type',[ 237 | `${monuments[i]}`, 238 | `${materials[i]}` 239 | ])}`; 240 | } 241 | return desc; 242 | } -------------------------------------------------------------------------------- /src/wiki/governor.js: -------------------------------------------------------------------------------- 1 | import { loc } from './../locale.js'; 2 | import { sideMenu, infoBoxBuilder } from './functions.js'; 3 | import { gmen, gov_traits, gov_tasks } from './../governor.js'; 4 | import { hoovedRename } from './../functions.js'; 5 | import { hoovedReskin } from './../races.js'; 6 | 7 | export function governPage(content){ 8 | let mainContent = sideMenu('create',content); 9 | 10 | { 11 | let govern = infoBoxBuilder(mainContent,{ name: 'intro', template: 'governor', label: loc('governor'), paragraphs: 4, h_level: 2, 12 | para_data: { 13 | 1: [loc('arpa_genepool_governance_title')], 14 | 2: [Object.keys(gmen).length] 15 | }, 16 | data_link: { 17 | 1: ['wiki.html#crispr-prestige-governance'] 18 | } 19 | }); 20 | sideMenu('add',`governor-gameplay`,`intro`,loc('governor')); 21 | 22 | Object.keys(gmen).forEach(function (gov){ 23 | let desc = ''; 24 | Object.keys(gmen[gov].traits).forEach(function (t){ 25 | desc += (gov_traits[t].hasOwnProperty('effect') ? gov_traits[t].effect() : '') + ' '; 26 | }); 27 | 28 | infoBoxBuilder(govern,{ name: gov, template: 'government', label: loc(`governor_${gov}`), paragraphs: 2, break: [2], h_level: 3, 29 | text: { 30 | 1: `governor_${gov}_desc` 31 | }, 32 | rawtext: { 33 | 2: desc 34 | } 35 | }); 36 | sideMenu('add',`governor-gameplay`,gov,loc(`governor_${gov}`)); 37 | }); 38 | } 39 | 40 | { 41 | let govern = infoBoxBuilder(mainContent,{ name: 'task', template: 'governor', paragraphs: 2, h_level: 2, 42 | para_data: { 43 | 2: [3,loc('governor_bureaucrat'),4], 44 | 3: [Object.keys(gov_tasks).length] 45 | } 46 | }); 47 | sideMenu('add',`governor-gameplay`,`task`,loc('wiki_governor_task')); 48 | 49 | { 50 | let task = 'tax'; 51 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 3, break: [3], h_level: 3, 52 | text: { 53 | 1: `wiki_governor_task_${task}1`, 54 | 2: `wiki_governor_task_${task}2`, 55 | 3: `wiki_governor_task_unlock` 56 | }, 57 | para_data: { 58 | 3: [loc(`tech_tax_rates`)], 59 | }, 60 | data_link: { 61 | 3: ['wiki.html#civilized-tech-tax_rates'] 62 | } 63 | }); 64 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 65 | } 66 | 67 | { 68 | let task = 'storage'; 69 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 3, break: [3], h_level: 3, 70 | text: { 71 | 1: `wiki_governor_task_${task}1`, 72 | 2: `wiki_governor_task_${task}2`, 73 | 3: `wiki_governor_task_unlock` 74 | }, 75 | para_data: { 76 | 3: [loc(`tech_containerization`)], 77 | }, 78 | data_link: { 79 | 3: ['wiki.html#civilized-tech-containerization'] 80 | } 81 | }); 82 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 83 | } 84 | 85 | { 86 | let task = 'bal_storage'; 87 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 4, break: [4], h_level: 3, 88 | text: { 89 | 1: `wiki_governor_task_${task}1`, 90 | 2: `wiki_governor_task_${task}2`, 91 | 3: `wiki_governor_task_${task}3`, 92 | 4: `wiki_governor_task_unlock` 93 | }, 94 | para_data: { 95 | 4: [loc(`tech_containerization`)], 96 | }, 97 | data_link: { 98 | 4: ['wiki.html#civilized-tech-containerization'] 99 | } 100 | }); 101 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 102 | } 103 | 104 | { 105 | let task = 'merc'; 106 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 4, break: [4], h_level: 3, 107 | text: { 108 | 1: `wiki_governor_task_${task}1`, 109 | 2: `wiki_governor_task_${task}2`, 110 | 3: `wiki_governor_task_${task}3`, 111 | 4: `wiki_governor_task_unlock` 112 | }, 113 | para_data: { 114 | 4: [loc(`tech_mercs`)], 115 | }, 116 | data_link: { 117 | 4: ['wiki.html#civilized-tech-mercs'] 118 | } 119 | }); 120 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 121 | } 122 | 123 | { 124 | let task = 'spy'; 125 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 3, break: [2,3], h_level: 3, 126 | text: { 127 | 1: `wiki_governor_task_${task}1`, 128 | 2: `wiki_governor_task_unlock`, 129 | 3: `wiki_governor_task_disabled` 130 | }, 131 | para_data: { 132 | 2: [loc(`tech_spy`)], 133 | 3: [loc(`tech_unification`)], 134 | }, 135 | data_link: { 136 | 2: ['wiki.html#civilized-tech-spy'], 137 | 3: ['wiki.html#early_space-tech-unification2'] 138 | } 139 | }); 140 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 141 | } 142 | 143 | { 144 | let task = 'spyop'; 145 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 8, break: [2,3,4,5,6,7,8], h_level: 3, 146 | text: { 147 | 1: `wiki_governor_task_${task}1`, 148 | 2: `wiki_governor_task_${task}2`, 149 | 3: `wiki_governor_task_${task}3`, 150 | 4: `wiki_governor_task_${task}3`, 151 | 5: `wiki_governor_task_${task}4`, 152 | 6: `wiki_governor_task_${task}5`, 153 | 7: `wiki_governor_task_unlock`, 154 | 8: `wiki_governor_task_disabled` 155 | }, 156 | para_data: { 157 | 2: [1,loc(`civics_spy_sabotage`)], 158 | 3: [2,loc(`civics_spy_influence`)], 159 | 4: [3,loc(`civics_spy_incite`)], 160 | 6: [loc(`civics_spy_sabotage`),loc(`civics_spy_incite`),loc(`civics_spy_influence`)], 161 | 7: [loc(`tech_espionage`)], 162 | 8: [loc(`tech_unification`)], 163 | }, 164 | data_link: { 165 | 6: ['wiki.html#civilized-tech-spy'], 166 | 7: ['wiki.html#early_space-tech-unification2'] 167 | } 168 | }); 169 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 170 | } 171 | 172 | { 173 | let task = 'slave'; 174 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 2, break: [2], h_level: 3, 175 | text: { 176 | 1: `wiki_governor_task_${task}1`, 177 | 2: `wiki_governor_task_trait` 178 | }, 179 | para_data: { 180 | 2: [loc(`trait_slaver_name`)], 181 | }, 182 | data_link: { 183 | 2: ['wiki.html#traits-species-major_slaver'] 184 | } 185 | }); 186 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 187 | } 188 | 189 | { 190 | let task = 'sacrifice'; 191 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 2, break: [2], h_level: 3, 192 | text: { 193 | 1: `wiki_governor_task_${task}1`, 194 | 2: `wiki_governor_task_trait` 195 | }, 196 | para_data: { 197 | 2: [loc(`trait_cannibalize_name`)], 198 | }, 199 | data_link: { 200 | 2: ['wiki.html#traits-species-major_cannibalize'] 201 | } 202 | }); 203 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 204 | } 205 | 206 | { 207 | let task = 'horseshoe'; 208 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 2, break: [2], h_level: 3, 209 | text: { 210 | 1: `wiki_governor_task_${task}1`, 211 | 2: `wiki_governor_task_trait` 212 | }, 213 | para_data: { 214 | 1: [loc(`city_${hoovedRename(true)}`,[hoovedRename(false)]),hoovedRename(false)], 215 | 2: [hoovedReskin(false)], 216 | }, 217 | data_link: { 218 | 2: ['wiki.html#traits-species-major_hooved'] 219 | } 220 | }); 221 | sideMenu('add',`governor-gameplay`,task,loc(`city_${hoovedRename(true)}`,[hoovedRename(false)])); 222 | } 223 | 224 | { 225 | let task = 'trash'; 226 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 7, break: [3,5,7], h_level: 3, 227 | text: { 228 | 1: `wiki_governor_task_${task}1`, 229 | 2: `wiki_governor_task_${task}2`, 230 | 3: `wiki_governor_task_${task}3`, 231 | 4: `wiki_governor_task_${task}3min`, 232 | 5: `wiki_governor_task_${task}3a`, 233 | 6: `wiki_governor_task_${task}3max`, 234 | 7: `wiki_governor_task_${task}4` 235 | }, 236 | para_data: { 237 | 7: [loc(`interstellar_mass_ejector`)], 238 | }, 239 | data_link: { 240 | 7: ['wiki.html#interstellar-structures-mass_ejector'] 241 | } 242 | }); 243 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 244 | } 245 | 246 | { 247 | let task = 'mech'; 248 | infoBoxBuilder(govern,{ name: task, template: 'government', label: loc(`gov_task_${task}`), paragraphs: 4, break: [4], h_level: 3, 249 | text: { 250 | 1: `wiki_governor_task_${task}1`, 251 | 2: `wiki_governor_task_${task}2`, 252 | 3: `wiki_governor_task_${task}3`, 253 | 4: `wiki_governor_task_${task}4` 254 | }, 255 | para_data: { 256 | 4: [1,loc(`wiki_resets_infusion`),loc(`portal_spire_name`)], 257 | }, 258 | data_link: { 259 | 4: [false,'wiki.html#resets-prestige-infusion','wiki.html#hell-structures-spire'] 260 | } 261 | }); 262 | sideMenu('add',`governor-gameplay`,task,loc(`gov_task_${task}`)); 263 | } 264 | } 265 | } -------------------------------------------------------------------------------- /src/wiki/wiki.js: -------------------------------------------------------------------------------- 1 | import { global, setGlobal, save } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import {} from './init.js'; 4 | import {} from './../achieve.js'; 5 | import { vBind, clearElement, tagEvent } from './../functions.js'; 6 | import { faqPage } from './faq.js'; 7 | import { speciesPage } from './species.js'; 8 | import { planetsPage } from './planets.js'; 9 | import { renderStructurePage } from './structures.js'; 10 | import { renderTechPage } from './tech.js'; 11 | import { renderAchievePage } from './achieve.js'; 12 | import { gamePlayPage } from './gameplay.js'; 13 | import { prestigePage } from './prestige.js'; 14 | import { eventsPage } from './events.js'; 15 | import { arpaPage } from './arpa.js'; 16 | import { changeLog } from './change.js'; 17 | 18 | $('body').empty(); 19 | initPage(); 20 | 21 | function initPage(){ 22 | $('body').append($(`

${loc('wiki_menu_evolve')}

`)); 23 | 24 | let wiki = $(`
`) 25 | $('body').append(wiki); 26 | 27 | let menu = $(``); 28 | wiki.append(menu); 29 | 30 | let menuItems = [ 31 | { 32 | key: 'intro', 33 | }, 34 | { 35 | key: 'faq', 36 | }, 37 | { 38 | key: 'gameplay', 39 | submenu: [ 40 | { key: 'basics' }, 41 | { key: 'mechanics' }, 42 | { key: 'government' }, 43 | { key: 'governor' }, 44 | { key: 'combat' }, 45 | { key: 'challenges' }, 46 | { key: 'resets' }, 47 | { key: 'planets' }, 48 | { key: 'universes' }, 49 | { key: 'hell' } 50 | ] 51 | }, 52 | { 53 | key: 'prestige', 54 | submenu: [ 55 | { key: 'resets' }, 56 | { key: 'resources' }, 57 | { key: 'crispr' }, 58 | { key: 'blood' }, 59 | { key: 'perks' } 60 | ] 61 | }, 62 | { 63 | key: 'events', 64 | submenu: [ 65 | { key: 'major' }, 66 | { key: 'minor' }, 67 | { key: 'progress' }, 68 | { key: 'special' } 69 | ] 70 | }, 71 | { 72 | key: 'species', 73 | submenu: [ 74 | { key: 'races' }, 75 | { key: 'traits' }, 76 | { key: 'custom' } 77 | ] 78 | }, 79 | { 80 | key: 'structures', 81 | submenu: [ 82 | { key: 'prehistoric' }, 83 | { key: 'planetary' }, 84 | { key: 'space' }, 85 | { key: 'interstellar' }, 86 | { key: 'intergalactic' }, 87 | { key: 'hell' } 88 | ] 89 | }, 90 | { 91 | key: 'tech', 92 | submenu: [ 93 | { key: 'primitive' }, 94 | { key: 'civilized' }, 95 | { key: 'discovery' }, 96 | { key: 'industrialized' }, 97 | { key: 'globalized' }, 98 | { key: 'early_space' }, 99 | { key: 'deep_space' }, 100 | { key: 'interstellar' }, 101 | { key: 'intergalactic' }, 102 | { key: 'dimensional' } 103 | ] 104 | }, 105 | { 106 | key: 'tp_structures', 107 | submenu: [ 108 | { key: 'prehistoric' }, 109 | { key: 'planetary' }, 110 | { key: 'space' }, 111 | { key: 'tauceti' } 112 | ] 113 | }, 114 | { 115 | key: 'tp_tech', 116 | submenu: [ 117 | { key: 'primitive' }, 118 | { key: 'civilized' }, 119 | { key: 'discovery' }, 120 | { key: 'industrialized' }, 121 | { key: 'globalized' }, 122 | { key: 'early_space' }, 123 | { key: 'deep_space' }, 124 | { key: 'solar' }, 125 | { key: 'tauceti' } 126 | ] 127 | }, 128 | { 129 | key: 'arpa', 130 | submenu: [ 131 | { key: 'projects' }, 132 | //{ key: 'genetics' }, 133 | { key: 'crispr' }, 134 | { key: 'blood' } 135 | ] 136 | }, 137 | { 138 | key: 'achievements', 139 | submenu: [ 140 | { key: 'list' }, 141 | { key: 'feats' } 142 | ] 143 | }, 144 | { 145 | key: 'changelog', 146 | } 147 | ]; 148 | 149 | let wikiMenu = ``; 152 | menu.append(wikiMenu); 153 | 154 | var menuData = {}; 155 | vBind({ 156 | el: `#menu`, 157 | data: menuData, 158 | methods: { 159 | loadPage(main,sub){ 160 | menuDispatch(main,sub); 161 | } 162 | } 163 | }); 164 | 165 | let content = $(`
`); 166 | wiki.append(content); 167 | 168 | if (window.location.hash){ 169 | let hash = window.location.hash.substring(1).split('-'); 170 | if (hash.length > 1){ 171 | hash.length > 2 ? menuDispatch(hash[1],hash[0],hash[2]) : menuDispatch(hash[1],hash[0]); 172 | } 173 | else { 174 | menuDispatch(hash[0]); 175 | } 176 | } 177 | else { 178 | mainPage(); 179 | } 180 | } 181 | 182 | function menuDispatch(main,sub,frag){ 183 | $(`#content`).removeClass('flex'); 184 | 185 | var global_data = save.getItem('evolved') || false; 186 | if (global_data){ 187 | setGlobal(JSON.parse(LZString.decompressFromUTF16(global_data))); 188 | } 189 | 190 | tagEvent('page_view',{ page_title: `Evolve Wiki - ${main}` }); 191 | 192 | switch (main){ 193 | case 'intro': 194 | mainPage(); 195 | window.location.hash = `#${main}`; 196 | break; 197 | 198 | case 'faq': 199 | faqPage(); 200 | window.location.hash = `#${main}`; 201 | break; 202 | 203 | case 'gameplay': 204 | gamePlayPage(sub); 205 | setWindowHash(main,sub,frag); 206 | break; 207 | 208 | case 'prestige': 209 | prestigePage(sub); 210 | setWindowHash(main,sub,frag); 211 | break; 212 | 213 | case 'events': 214 | eventsPage(sub); 215 | setWindowHash(main,sub,frag); 216 | break; 217 | 218 | case 'species': 219 | switch (sub){ 220 | case 'planets': 221 | planetsPage(); 222 | break; 223 | default: 224 | speciesPage(sub); 225 | break; 226 | } 227 | setWindowHash(main,sub,frag); 228 | break; 229 | 230 | case 'structures': 231 | renderStructurePage(sub,'standard'); 232 | setWindowHash(main,sub,frag); 233 | break; 234 | 235 | case 'tech': 236 | renderTechPage(sub,'standard'); 237 | setWindowHash(main,sub,frag); 238 | break; 239 | 240 | case 'tp_structures': 241 | renderStructurePage(sub,'truepath'); 242 | setWindowHash(main,sub,frag); 243 | break; 244 | 245 | case 'tp_tech': 246 | renderTechPage(sub,'truepath'); 247 | setWindowHash(main,sub,frag); 248 | break; 249 | 250 | case 'arpa': 251 | arpaPage(sub); 252 | setWindowHash(main,sub,frag); 253 | break; 254 | 255 | case 'achievements': 256 | switch (sub){ 257 | case 'tracker': 258 | //loadTracker(); 259 | break; 260 | default: 261 | renderAchievePage(sub); 262 | break; 263 | } 264 | setWindowHash(main,sub,frag); 265 | break; 266 | 267 | case 'changelog': 268 | changeLog(); 269 | window.location.hash = `#${main}`; 270 | break; 271 | } 272 | } 273 | 274 | function setWindowHash(main,sub,frag){ 275 | if (typeof frag === 'undefined'){ 276 | window.location.hash = `#${sub}-${main}`; 277 | } 278 | else { 279 | window.location.hash = `#${sub}-${main}-${frag}`; 280 | setTimeout(function(){ 281 | document.getElementById(frag).scrollIntoView({ 282 | block: 'start', 283 | behavior: 'smooth' 284 | }); 285 | }, 125); 286 | 287 | } 288 | } 289 | 290 | function buiildMenu(items,set,parent){ 291 | let hash = window.location.hash ? window.location.hash.substring(1).split('-') : false; 292 | 293 | let menu = ``; 294 | for (let i=0; i 1 && hash[1] === items[i].key) ? ` :active="true" expanded` : ''; 298 | menu = menu + ``; 299 | menu = menu + buiildMenu(items[i].submenu,false,items[i].key); 300 | menu = menu + ``; 301 | } 302 | else { 303 | let active = (!hash && set && i === 0) || (hash && hash[0] === items[i].key) ? ` :active="true"` : ''; 304 | let args = parent ? `'${parent}','${items[i].key}'` : `'${items[i].key}',false`; 305 | menu = menu + `` 306 | } 307 | } 308 | return menu; 309 | } 310 | 311 | function mainPage(){ 312 | let content = $(`#content`); 313 | clearElement(content); 314 | 315 | let contribute = `${['Beorseder','Rodrigodd','Volch'].join(', ').replace(/, ([^,]*)$/, `, & $1`)}`; 316 | 317 | let version = global['beta'] ? `beta v${global.version}.${global.beta}` : 'v'+global.version; 318 | content.append(`
${loc(`wiki_main_title`)} - ${version}
`); 319 | content.append(`
${loc(`wiki_main_author`,['Demagorddon'])}
`); 320 | content.append(`
${loc(`wiki_main_spoiler`)}
`); 321 | content.append(`
${loc(`wiki_main_blurb`)}
`); 322 | content.append(`
${loc(`wiki_main_contribution`,[contribute])}
`); 323 | content.append(`
${loc(`wiki_resources`)}
`); 324 | 325 | let list = $(`
    `); 326 | content.append(list); 327 | 328 | list.append(`
  • ${loc(`wiki_resources_begin_guide`)} ${loc(`wiki_resources_by`,['GreyCat'])}
  • `); 329 | list.append(`
  • ${loc(`wiki_resources_tracker`)} ${loc(`wiki_resources_by`,['Karsen777'])}
  • `); 330 | //list.append(`
  • ${loc(`wiki_resources_hell_sim`)} ${loc(`wiki_resources_by`,['Jotun'])}
  • `); 331 | } 332 | -------------------------------------------------------------------------------- /lib/html5sortable.min.js: -------------------------------------------------------------------------------- 1 | var sortable=function(){"use strict";function c(e,t,n){if(void 0===n)return e&&e.h5s&&e.h5s.data&&e.h5s.data[t];e.h5s=e.h5s||{},e.h5s.data=e.h5s.data||{},e.h5s.data[t]=n}var d=function(e,t){if(!(e instanceof NodeList||e instanceof HTMLCollection||e instanceof Array))throw new Error("You must provide a nodeList/HTMLCollection/Array of elements to be filtered.");return"string"!=typeof t?Array.from(e):Array.from(e).filter(function(e){return 1===e.nodeType&&e.matches(t)})},u=new Map,t=function(){function e(){this._config=new Map,this._placeholder=void 0,this._data=new Map}return Object.defineProperty(e.prototype,"config",{get:function(){var n={};return this._config.forEach(function(e,t){n[t]=e}),n},set:function(e){if("object"!=typeof e)throw new Error("You must provide a valid configuration object to the config setter.");var t=Object.assign({},e);this._config=new Map(Object.entries(t))},enumerable:!0,configurable:!0}),e.prototype.setConfig=function(e,t){if(!this._config.has(e))throw new Error("Trying to set invalid configuration item: "+e);this._config.set(e,t)},e.prototype.getConfig=function(e){if(!this._config.has(e))throw new Error("Invalid configuration item requested: "+e);return this._config.get(e)},Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){if(!(e instanceof HTMLElement)&&null!==e)throw new Error("A placeholder must be an html element or null.");this._placeholder=e},enumerable:!0,configurable:!0}),e.prototype.setData=function(e,t){if("string"!=typeof e)throw new Error("The key must be a string.");this._data.set(e,t)},e.prototype.getData=function(e){if("string"!=typeof e)throw new Error("The key must be a string.");return this._data.get(e)},e.prototype.deleteData=function(e){if("string"!=typeof e)throw new Error("The key must be a string.");return this._data.delete(e)},e}(),p=function(e){if(!(e instanceof HTMLElement))throw new Error("Please provide a sortable to the store function.");return u.has(e)||u.set(e,new t),u.get(e)};function a(e,t,n){if(e instanceof Array)for(var r=0;r':t=document.createElement("div")),"string"==typeof n&&(r=t.classList).add.apply(r,n.split(" ")),t},b=function(e){if(!(e instanceof HTMLElement))throw new Error("You must provide a valid dom element");var n=window.getComputedStyle(e);return["height","padding-top","padding-bottom"].map(function(e){var t=parseInt(n.getPropertyValue(e),10);return isNaN(t)?0:t}).reduce(function(e,t){return e+t})},s=function(e,t){if(!(e instanceof Array))throw new Error("You must provide a Array of HTMLElements to be filtered.");return"string"!=typeof t?e:e.filter(function(e){return e.querySelector(t)instanceof HTMLElement||e.shadowRoot&&e.shadowRoot.querySelector(t)instanceof HTMLElement}).map(function(e){return e.querySelector(t)||e.shadowRoot&&e.shadowRoot.querySelector(t)})},T=function(e){return e.composedPath&&e.composedPath()[0]||e.target},f=function(e,t,n){return{element:e,posX:n.pageX-t.left,posY:n.pageY-t.top}},L=function(e,t,n){if(!(e instanceof Event))throw new Error("setDragImage requires a DragEvent as the first argument.");if(!(t instanceof HTMLElement))throw new Error("setDragImage requires the dragged element as the second argument.");if(n||(n=f),e.dataTransfer&&e.dataTransfer.setDragImage){var r=n(t,m(t),e);if(!(r.element instanceof HTMLElement)||"number"!=typeof r.posX||"number"!=typeof r.posY)throw new Error("The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].");e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setData("text/plain",T(e).id),e.dataTransfer.setDragImage(r.element,r.posX,r.posY)}},C=function(e,t){if(!0===e.isSortable){var n=p(e).getConfig("acceptFrom");if(null!==n&&!1!==n&&"string"!=typeof n)throw new Error('HTML5Sortable: Wrong argument, "acceptFrom" must be "null", "false", or a valid selector string.');if(null!==n)return!1!==n&&0=parseInt(r.maxItems)&&D.parentElement!==n||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=!0===p(n).getConfig("copy")?"copy":"move",o(n,t,e.pageY))}};a(t.concat(s),"dragover",r),a(t.concat(s),"dragenter",r)}),e)}return X.destroy=function(e){var t,n,r,o;n=c(t=e,"opts")||{},r=d(t.children,n.items),o=s(r,n.handle),i(t,"dragover"),i(t,"dragenter"),i(t,"drop"),F(t),i(o,"mousedown"),P(r),N(r)},X.enable=function(e){z(e)},X.disable=function(e){var t,n,r,o;n=c(t=e,"opts"),r=d(t.children,n.items),o=s(r,n.handle),l(t,"aria-dropeffect","none"),c(t,"_disabled","true"),l(o,"draggable","false"),i(o,"mousedown")},X.__testing={_data:c,_removeItemEvents:P,_removeItemData:N,_removeSortableData:F},X}(); 2 | //# sourceMappingURL=html5sortable.min.js.map 3 | -------------------------------------------------------------------------------- /src/wiki/resets.js: -------------------------------------------------------------------------------- 1 | import { loc } from './../locale.js'; 2 | import { universe_types } from './../space.js'; 3 | import { infoBoxBuilder, sideMenu, createCalcSection } from './functions.js'; 4 | import { prestigeCalc } from './p_res.js'; 5 | 6 | export function resetsPage(content){ 7 | let mainContent = sideMenu('create',content); 8 | 9 | let resets = ['mad','bioseed','blackhole','ascension','cataclysm','vacuum','infusion','ai','terraform']; 10 | let reset_labels = resets.map(x => `${loc(`wiki_resets_${x}`)}`); 11 | 12 | infoBoxBuilder(mainContent,{ name: 'intro', template: 'resets', paragraphs: 3, h_level: 2, 13 | para_data: { 1: [resets.length, reset_labels.slice(0, -1).join(', ') + `, & ${reset_labels[reset_labels.length - 1]}`] }, 14 | data_color: { 1: ['warning','plain'] } 15 | }); 16 | sideMenu('add',`resets-prestige`,'intro',loc('wiki_menu_intro')); 17 | 18 | // MAD 19 | let section = infoBoxBuilder(mainContent,{ name: 'mad', template: 'resets', paragraphs: 9, break: [6,9], h_level: 2, 20 | para_data: { 21 | 3: [loc('wiki_p_res_plasmids')], 22 | 4: [loc('tech_rocketry'),loc('tech_mad')], 23 | 5: [loc('tab_civics'),loc('tab_military')], 24 | 6: [loc('wiki_p_res_plasmids')], 25 | 7: [loc('wiki_p_res_plasmids')], 26 | 9: [loc('wiki_resets_mad')] 27 | }, 28 | data_color: { 29 | 3: ['danger'], 30 | 6: ['danger'], 31 | 7: ['danger'] 32 | } 33 | }); 34 | section = createCalcSection(section,'mad','gain'); 35 | prestigeCalc(section,'plasmid',false,'mad'); 36 | sideMenu('add',`resets-prestige`,'mad',loc('wiki_resets_mad')); 37 | 38 | // Bioseed 39 | section = infoBoxBuilder(mainContent,{ name: 'bioseed', template: 'resets', paragraphs: 12, break: [5,8,12], h_level: 2, 40 | para_data: { 41 | 2: [loc('tech_genesis_ship')], 42 | 3: [loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage')], 43 | 4: [loc('wiki_p_res_plasmids')], 44 | 5: [loc('tech_genesis_ship'),loc('tech_star_dock')], 45 | 6: [loc('tech_interstellar'),loc('tech_star_dock')], 46 | 7: [loc('tech_genesis_ship')], 47 | 9: [loc('tech_interstellar'),loc('star_dock_probe_desc')], 48 | 10: [loc('wiki_planet_planet')], 49 | 12: [loc('wiki_resets_bioseed')] 50 | }, 51 | data_color: { 52 | 3: ['danger','danger'], 53 | 4: ['danger'] 54 | }, 55 | data_link: { 10: ['wiki.html#planets-gameplay'] } 56 | }); 57 | section = createCalcSection(section,'bioseed','gain'); 58 | prestigeCalc(section,'plasmid',false,'bioseed'); 59 | prestigeCalc(section,'phage',false,'bioseed'); 60 | sideMenu('add',`resets-prestige`,'bioseed',loc('wiki_resets_bioseed')); 61 | 62 | // Blackhole 63 | let universes = []; 64 | Object.keys(universe_types).forEach(function (universe){ 65 | universes.push(universe); 66 | }); 67 | let universe_labels = universes.map(x => `${loc(`universe_${x}`)}`); 68 | 69 | section = infoBoxBuilder(mainContent,{ name: 'blackhole', template: 'resets', paragraphs: 12, break: [3,6,9,12], h_level: 2, 70 | para_data: { 71 | 2: [loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('wiki_p_res_dark')], 72 | 3: [loc('tech_dist_stellar_engine')], 73 | 4: [loc('tech_mass_ejector'),loc('wiki_resets_blackhole_exotic'),0.025,loc('resource_Elerium_name'),loc('resource_Infernite_name')], 74 | 5: [loc('wiki_p_res_dark')], 75 | 6: [loc('wiki_resets_blackhole_exotic'),loc('tech_exotic_infusion')], 76 | 7: [10,loc('wiki_hell_soul_gem')], 77 | 8: [loc('tech_stabilize_blackhole'),loc('wiki_resets_blackhole_exotic')], 78 | 10: [universes.length, universe_labels.slice(0, -1).join(', ') + `, ${loc('or')} ${universe_labels[universe_labels.length - 1]}`], 79 | 12: [loc('wiki_resets_blackhole')] 80 | }, 81 | data_color: { 82 | 2: ['danger','danger','danger'], 83 | 4: ['warning','warning','warning','caution','caution'], 84 | 5: ['danger'], 85 | 7: ['warning','caution'], 86 | 10: ['warning','plain'] 87 | } 88 | }); 89 | section = createCalcSection(section,'bigbang','gain'); 90 | prestigeCalc(section,'plasmid',false,'bigbang'); 91 | prestigeCalc(section,'phage',false,'bigbang'); 92 | prestigeCalc(section,'dark',false,'bigbang'); 93 | sideMenu('add',`resets-prestige`,'blackhole',loc('wiki_resets_blackhole')); 94 | 95 | // Vacuum Collapse 96 | section = infoBoxBuilder(mainContent,{ name: 'vacuum', template: 'resets', paragraphs: 10, break: [4,8,10], h_level: 2, 97 | para_data: { 98 | 4: [80], 99 | 6: [loc('arpa_syphon_damage')], 100 | 7: [80], 101 | 8: [loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('wiki_p_res_dark')], 102 | 9: [loc('wiki_p_res_dark')], 103 | 10: [loc('wiki_resets_vacuum')], 104 | }, 105 | data_color: { 106 | 6: ['danger'], 107 | 8: ['danger','danger','danger'], 108 | 9: ['danger'], 109 | } 110 | }); 111 | section = createCalcSection(section,'vacuum','gain'); 112 | prestigeCalc(section,'plasmid',false,'vacuum'); 113 | prestigeCalc(section,'phage',false,'vacuum'); 114 | prestigeCalc(section,'dark','vacuum','vacuum'); 115 | sideMenu('add',`resets-prestige`,'vacuum',loc('wiki_resets_vacuum')); 116 | 117 | // Ascension 118 | section = infoBoxBuilder(mainContent,{ name: 'ascension', template: 'resets', paragraphs: 10, break: [3,5,7,10], h_level: 2, 119 | para_data: { 120 | 2: [loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('wiki_p_res_harmony')], 121 | 3: [loc('interstellar_ascension_machine'),'10,000',loc('interstellar_thermal_collector')], 122 | 4: [100,25], 123 | 7: [`+2%`], 124 | 8: [`+2`,`+5%`,`+10%`], 125 | 10: [loc('wiki_resets_ascension')] 126 | }, 127 | data_color: { 128 | 2: ['danger','danger','danger'], 129 | } 130 | }); 131 | section = createCalcSection(section,'ascend','gain'); 132 | prestigeCalc(section,'plasmid',false,'ascend'); 133 | prestigeCalc(section,'phage',false,'ascend'); 134 | prestigeCalc(section,'harmony',false,'ascend'); 135 | sideMenu('add',`resets-prestige`,'ascension',loc('wiki_resets_ascension')); 136 | 137 | // Cataclysm 138 | section = infoBoxBuilder(mainContent,{ name: 'cataclysm', template: 'resets', paragraphs: 10, break: [4,7,10], h_level: 2, 139 | para_data: { 140 | 1: [loc('planet_unstable')], 141 | 2: [loc('tech_world_collider')], 142 | 3: [loc('tech_dial_it_to_11'),loc('tech_limit_collider')], 143 | 6: [loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage')], 144 | 10: [loc('wiki_resets_cataclysm')] 145 | }, 146 | data_color: { 147 | 6: ['danger','danger'] 148 | } 149 | }); 150 | section = createCalcSection(section,'cataclysm','gain'); 151 | prestigeCalc(section,'plasmid',false,'cataclysm'); 152 | prestigeCalc(section,'phage',false,'cataclysm'); 153 | sideMenu('add',`resets-prestige`,'cataclysm',loc('wiki_resets_cataclysm')); 154 | 155 | // Terraform 156 | section = infoBoxBuilder(mainContent,{ name: 'terraform', template: 'resets', paragraphs: 19, break: [3,6,7,10,12,19], h_level: 2, 157 | para_data: { 158 | 1: [loc('wiki_resets_terraform'),loc(`evo_challenge_orbit_decay`)], 159 | 2: [loc('wiki_resets_ascension')], 160 | 3: [loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('wiki_p_res_harmony')], 161 | 7: [loc('achieve_lamentis_name')], 162 | 8: [1], 163 | 10: [loc('rejuvenated')], 164 | 13: ['10%'], 165 | 14: ['5%'], 166 | 16: ['2%','50%'], 167 | 17: ['50%'], 168 | 19: [loc('wiki_resets_terraform')], 169 | } 170 | }); 171 | section = createCalcSection(section,'terraform','gain'); 172 | prestigeCalc(section,'plasmid',false,'terraform'); 173 | prestigeCalc(section,'phage',false,'terraform'); 174 | prestigeCalc(section,'harmony',false,'terraform'); 175 | sideMenu('add',`resets-prestige`,'terraform',loc('wiki_resets_terraform')); 176 | 177 | section = infoBoxBuilder(mainContent,{ name: 'infusion', template: 'resets', paragraphs: 8, break: [4,8], h_level: 2, 178 | para_data: { 179 | 2: [loc('resource_Artifact_name')], 180 | 5: [loc('resource_Demonic_Essence_name')], 181 | 6: [loc('resource_Demonic_Essence_name')], 182 | 7: [loc('achieve_corrupted_name')], 183 | 8: [loc('wiki_resets_infusion')], 184 | }, 185 | data_color: { 186 | 2: ['danger'], 187 | 7: ['caution'] 188 | } 189 | }); 190 | section = createCalcSection(section,'descend','gain'); 191 | prestigeCalc(section,'artifact',false,'descend'); 192 | sideMenu('add',`resets-prestige`,'infusion',loc('wiki_resets_infusion')); 193 | 194 | // AI Appoc 195 | section = infoBoxBuilder(mainContent,{ name: 'ai', template: 'resets', paragraphs: 8, break: [3,6,7,8], h_level: 2, 196 | para_data: { 197 | 2: [loc('evo_challenge_truepath')], 198 | 3: [loc('space_ai_core'),loc('wiki_resets_ai_drift'),'100%'], 199 | 4: [loc('tech_protocol66')], 200 | 5: [loc('space_ai_colonist_title'),loc('space_decoder_title'),loc('space_shock_trooper_title'),loc('space_tank_title')], 201 | 6: [loc('wiki_resets_ai'),loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('wiki_p_res_ai_core')], 202 | 7: [loc('genelab_genus_synthetic')], 203 | 8: [loc('wiki_resets_ai')], 204 | }, 205 | data_color: { 206 | 6: ['warning','danger','danger','danger'], 207 | }, 208 | data_link: { 209 | 2: ['wiki.html#challenges-gameplay-scenarios_truepath'], 210 | 3: ['wiki.html#space-tp_structures-ai_core'], 211 | 4: ['wiki.html#solar-tp_tech-protocol66'], 212 | 5: ['#space-tp_structures-ai_colonist','#space-tp_structures-decoder','#space-tp_structures-shock_trooper','#space-tp_structures-tank'], 213 | } 214 | }); 215 | section = createCalcSection(section,'ai','gain'); 216 | prestigeCalc(section,'plasmid',false,'ai'); 217 | prestigeCalc(section,'phage',false,'ai'); 218 | prestigeCalc(section,'cores',false,'ai'); 219 | sideMenu('add',`resets-prestige`,'ai',loc('wiki_resets_ai')); 220 | 221 | // Matrix 222 | section = infoBoxBuilder(mainContent,{ name: 'matrix', template: 'resets', paragraphs: 6, break: [3,5,6], h_level: 2, 223 | para_data: { 224 | 2: [loc('evo_challenge_truepath')], 225 | 3: [loc('tau_star_ringworld')], 226 | 5: [loc('wiki_resets_matrix'),loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('civics_servants')], 227 | 6: [loc('wiki_resets_matrix')], 228 | }, 229 | data_color: { 230 | 5: ['warning','danger','danger','danger'], 231 | }, 232 | data_link: { 233 | 2: ['wiki.html#challenges-gameplay-scenarios_truepath'], 234 | 3: ['wiki.html#tauceti-structures-ringworld'], 235 | } 236 | }); 237 | section = createCalcSection(section,'matrix','gain'); 238 | prestigeCalc(section,'plasmid',false,'matrix'); 239 | prestigeCalc(section,'phage',false,'matrix'); 240 | sideMenu('add',`resets-prestige`,'matrix',loc('wiki_resets_matrix')); 241 | 242 | // Retirement 243 | section = infoBoxBuilder(mainContent,{ name: 'retired', template: 'resets', paragraphs: 6, break: [3,5,6], h_level: 2, 244 | para_data: { 245 | 2: [loc('evo_challenge_truepath')], 246 | 3: [loc('tech_matrioshka_brain'),loc('tech_ignition_device')], 247 | 5: [loc('wiki_resets_retired'),loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('civics_servants')], 248 | 6: [loc('wiki_resets_retired')], 249 | }, 250 | data_color: { 251 | 5: ['warning','danger','danger','danger'], 252 | }, 253 | data_link: { 254 | 2: ['wiki.html#challenges-gameplay-scenarios_truepath'], 255 | 3: ['wiki.html#tauceti-structures-matrioshka_brain','wiki.html#tauceti-structures-ignition_device'], 256 | } 257 | }); 258 | section = createCalcSection(section,'retired','gain'); 259 | prestigeCalc(section,'plasmid',false,'retired'); 260 | prestigeCalc(section,'phage',false,'retired'); 261 | sideMenu('add',`resets-prestige`,'retired',loc('wiki_resets_retired')); 262 | 263 | // Garden of Eden 264 | section = infoBoxBuilder(mainContent,{ name: 'eden', template: 'resets', paragraphs: 6, break: [3,5,6], h_level: 2, 265 | para_data: { 266 | 2: [loc('evo_challenge_lone_survivor')], 267 | 3: [loc('tau_star_ringworld')], 268 | 4: [loc('tau_star_goe_facility')], 269 | 5: [loc('wiki_resets_eden'),loc('wiki_p_res_plasmids'),loc('wiki_p_res_phage'),loc('civics_servants')], 270 | 6: [loc('wiki_resets_eden')], 271 | }, 272 | data_color: { 273 | 5: ['warning','danger','danger','danger'], 274 | }, 275 | data_link: { 276 | 2: ['wiki.html#challenges-gameplay-scenarios_truepath'], 277 | 3: ['wiki.html#tauceti-structures-ringworld'], 278 | 4: ['wiki.html#tauceti-structures-goe_facility'], 279 | } 280 | }); 281 | section = createCalcSection(section,'eden','gain'); 282 | prestigeCalc(section,'plasmid',false,'eden'); 283 | prestigeCalc(section,'phage',false,'eden'); 284 | sideMenu('add',`resets-prestige`,'eden',loc('wiki_resets_eden')); 285 | } 286 | -------------------------------------------------------------------------------- /src/wiki/functions.js: -------------------------------------------------------------------------------- 1 | import { global, sizeApproximation } from './../vars.js'; 2 | import { loc } from './../locale.js'; 3 | import { clearElement, vBind, adjustCosts } from './../functions.js'; 4 | import { actions } from './../actions.js'; 5 | import { races, genusVars } from './../races.js'; 6 | import { planetName } from './../space.js'; 7 | 8 | export function headerBoxBuilder(parent,args,box){ 9 | if (!args.hasOwnProperty('h_level')){ 10 | args['h_level'] = 2; 11 | } 12 | args['header'] = true; 13 | return infoBoxBuilder(parent,args,box); 14 | } 15 | 16 | export function infoBoxBuilder(parent,args,box){ 17 | if (!args.hasOwnProperty('name')){ return; } 18 | if (!args.hasOwnProperty('template')){ return; } 19 | if (!args.hasOwnProperty('paragraphs')){ args['paragraphs'] = 0; } 20 | if (!args.hasOwnProperty('text')){ args['text'] = {}; } 21 | if (!args.hasOwnProperty('rawtext')){ args['rawtext'] = {}; } 22 | if (!args.hasOwnProperty('para_data')){ args['para_data'] = {}; } 23 | if (!args.hasOwnProperty('data_color')){ args['data_color'] = {}; } 24 | if (!args.hasOwnProperty('data_link')){ args['data_link'] = {}; } 25 | if (!args.hasOwnProperty('h_level')){ args['h_level'] = 3; } 26 | if (!args.hasOwnProperty('header')){ args['header'] = false; } 27 | if (!args.hasOwnProperty('full')){ args['full'] = false; } 28 | if (!args.hasOwnProperty('break')){ args['break'] = false; } 29 | if (!args.hasOwnProperty('default_color')){ args['default_color'] = 'warning'; } 30 | if (!args.hasOwnProperty('examples')){ args['examples'] = false; } 31 | 32 | let info = false; 33 | if (box){ 34 | info = box; 35 | } 36 | else { 37 | info = $(`
    `); 38 | if (args['h_level']){ 39 | info.append(`${args['label'] ? args['label'] : loc(`wiki_${args.template}_${args.name}`)}`); 40 | } 41 | } 42 | 43 | let ranges = [{s: 1, e: args.break ? args.break[0] - 1 : args.paragraphs}]; 44 | 45 | if (args.break){ 46 | for (let i=0; i`); 54 | for (let i=range.s; i<=range.e; i++){ 55 | if ((args.text[i] || args.rawtext[i] || args.para_data[i]) && Array.isArray(args.para_data[i])){ 56 | let inputs = args.para_data[i]; 57 | if (args.data_link[i] && Array.isArray(args.data_link[i])){ 58 | for (let j=0; j${inputs[j]}`; 61 | } 62 | } 63 | } 64 | let color_list = args.data_color[i] && Array.isArray(args.data_color[i]) ? args.data_color[i] : args.para_data[i].map(x => args.default_color); 65 | for (let j=0; j${inputs[j]}
    `; 68 | } 69 | } 70 | let string = args.rawtext[i] ? args.rawtext[i] : (loc(args.text[i] ? args.text[i] : `wiki_${args.template}_${args.name}_para${i}`,inputs)); 71 | para.append(`${string}`); 72 | } 73 | else { 74 | let string = args.rawtext[i] ? args.rawtext[i] : (loc(args.text[i] ? args.text[i] : `wiki_${args.template}_${args.name}_para${i}`)); 75 | para.append(`${string}`); 76 | } 77 | } 78 | info.append(para); 79 | }); 80 | 81 | if (args.examples){ 82 | info.append($(`
    ${loc(`wiki_examples`)}
    `)); 83 | 84 | args.examples.forEach(function(example){ 85 | info.append($(`
    - ${example}
    `)); 86 | }); 87 | } 88 | 89 | if (!box){ 90 | parent.append(info); 91 | } 92 | return info; 93 | } 94 | 95 | export function actionDesc(info, c_action, extended, isStruct){ 96 | let title = typeof c_action.title === 'string' ? c_action.title : c_action.title(); 97 | if (extended){ 98 | info.append(`

    ${title}

    ${extended}
    `); 99 | } 100 | else if (!isStruct){ 101 | let owned = global.tech[c_action.grant[0]] && global.tech[c_action.grant[0]] >= c_action.grant[1]; 102 | info.append(`

    ${title}

    ${owned ? `${loc('wiki_arpa_purchased')}` : ``}${loc(`wiki_tech_tree_${c_action.grant[0]}`)}: ${c_action.grant[1]}
    `); 103 | } 104 | else { 105 | info.append(`

    ${title}

    `); 106 | } 107 | 108 | let desc = typeof c_action.desc === 'string' ? c_action.desc : c_action.desc(true); 109 | if (desc !== title){ 110 | info.append(`
    ${desc}
    `); 111 | } 112 | 113 | let stats = $(`
    `); 114 | 115 | let hasEffect = false; 116 | if (c_action.hasOwnProperty('effect')){ 117 | if (isStruct){ 118 | let effect = typeof c_action.effect === 'string' ? c_action.effect : false; 119 | if (effect !== false){ 120 | stats.append(`
    ${effect}
    `); 121 | } 122 | else { 123 | stats.append(`
    `); 124 | } 125 | hasEffect = true; 126 | } 127 | else { 128 | let effect = typeof c_action.effect === 'string' ? c_action.effect : c_action.effect(true); 129 | if (effect !== false){ 130 | stats.append(`
    ${effect}
    `); 131 | hasEffect = true; 132 | } 133 | } 134 | info.append(stats); 135 | } 136 | 137 | if (c_action.hasOwnProperty('cost')){ 138 | let costs = adjustCosts(c_action, true); 139 | let cost = hasEffect ? $(`
    `) : $(`
    `); 140 | let costCreep = ``; 141 | if (isStruct){ 142 | cost.append($(`

    ${loc('wiki_calc_cost')}

    `)); 143 | costCreep = $(`

    ${loc('wiki_calc_cost_creep')}

    `); 144 | } 145 | let render = false; 146 | 147 | let addCost = function(res,res_cost,label,color,structBypass){ 148 | if (isStruct){ 149 | cost.append($(`
    ${label}{{ r.${res}.cost }}
    `)); 150 | costCreep.append($(`
    {{ r.${res}.creep }}
    `)); 151 | render = true; 152 | } 153 | else if (res_cost > 0){ 154 | cost.append($(`
    ${label}${sizeApproximation(res_cost,1)}
    `)); 155 | render = true; 156 | } 157 | }; 158 | 159 | let color = 'has-text-success'; 160 | Object.keys(costs).forEach(function (res){ 161 | if (res === 'Structs'){ 162 | let structs = costs[res](); 163 | Object.keys(structs).forEach(function (region){ 164 | Object.keys(structs[region]).forEach(function (struct){ 165 | let res_cost = structs[region][struct].hasOwnProperty('on') ? structs[region][struct].on : structs[region][struct].count; 166 | 167 | let label = ''; 168 | if (structs[region][struct].hasOwnProperty('s')){ 169 | let sector = structs[region][struct].s; 170 | label = typeof actions[region][sector][struct].title === 'string' ? actions[region][sector][struct].title : actions[region][sector][struct].title(); 171 | } 172 | else { 173 | label = typeof actions[region][struct].title === 'string' ? actions[region][struct].title : actions[region][struct].title(); 174 | } 175 | cost.append($(`
    ${label}: ${res_cost}
    `)); 176 | if (isStruct){ 177 | costCreep.append($(`
    ${loc('wiki_calc_none')}
    `)); 178 | } 179 | render = true; 180 | }); 181 | }); 182 | } 183 | else if (['Plasmid','Phage','Dark','Harmony','AICore','Artifact','Blood_Stone','AntiPlasmid'].includes(res)){ 184 | let resName = res; 185 | if (res === 'Plasmid' && global.race.universe === 'antimatter'){ 186 | resName = 'AntiPlasmid'; 187 | } 188 | addCost(res,costs[res](),loc(`resource_${resName}_name`) + ': ',color); 189 | } 190 | else if (res === 'Supply'){ 191 | addCost(res,costs[res](),loc(`resource_${res}_name`) + ': ',color); 192 | } 193 | else if (res === 'Custom'){ 194 | cost.append($(`
    ${costs[res]().label}
    `)); 195 | render = true; 196 | } 197 | else if (res !== 'Morale' && res !== 'Army' && res !== 'Bool'){ 198 | let f_res = res === 'Species' ? global.race.species : res; 199 | let label = f_res === 'Money' ? '$' : (res === 'HellArmy' ? loc('fortress_troops') : global.resource[f_res].name) + ': '; 200 | label = label.replace("_", " "); 201 | addCost(res,costs[res](),label,color); 202 | } 203 | }); 204 | 205 | if (render){ 206 | if (!c_action.hasOwnProperty('effect')){ 207 | info.append(stats); 208 | } 209 | stats.append(cost); 210 | if (isStruct){ 211 | stats.append(costCreep); 212 | } 213 | } 214 | } 215 | } 216 | 217 | export function bindScroll(elm, target){ 218 | elm.click(function(){ 219 | window.location.hash = `#${target}`; 220 | document.getElementById(target).scrollIntoView({ 221 | block: 'start', 222 | behavior: 'smooth' 223 | }); 224 | }); 225 | } 226 | 227 | export function sideMenu(action,arg1,arg2,arg3){ 228 | if (action === 'create'){ 229 | let content = arg1 ? (typeof arg1 === 'string' ? $(`#${arg1}`) : arg1) : $(`#content`); 230 | clearElement(content); 231 | content.addClass('flex'); 232 | let mainContent = $(`
    `); 233 | let sideContent = $(`
    `); 234 | let sideMenu = $(`
      `); 235 | content.append(mainContent); 236 | content.append(sideContent); 237 | sideContent.append(sideMenu); 238 | return mainContent; 239 | } 240 | else { 241 | let anchor = $(`${arg3}`); 242 | let li = $(`
    • `); 243 | li.append(anchor); 244 | $(`#sideContent ul`).append(li); 245 | bindScroll(anchor, arg2); 246 | } 247 | 248 | } 249 | 250 | export function subSideMenu(action,arg1,arg2,arg3){ 251 | sideMenu(action,arg1,arg2,`ᄂ` + arg3); 252 | } 253 | 254 | export function getSolarName(planet) { 255 | if (['moon','belt'].includes(planet)){ 256 | return loc('space_'+planet+'_info_name'); 257 | } 258 | else if (['kuiper'].includes(planet)){ 259 | return loc('space_'+planet+'_title'); 260 | } 261 | 262 | return planetName()[planet]; 263 | } 264 | 265 | export function createRevealSection(info,id,type,insert){ 266 | let reveal = $(`
      `); 267 | info.append(reveal); 268 | reveal.append(`{{ vis | label }}`); 269 | let section = $(``); 270 | reveal.append(section); 271 | 272 | let modSection = document.getElementById(id + type + 'Section'); 273 | let modDisplay = { vis: false }; 274 | 275 | vBind({ 276 | el: `#${id}${type}Button`, 277 | data: modDisplay, 278 | methods: { 279 | show(){ 280 | if (modSection.style.display === 'block'){ 281 | modSection.style.display = 'none'; 282 | modDisplay.vis = false; 283 | } 284 | else { 285 | modSection.style.display = 'block'; 286 | modDisplay.vis = true; 287 | } 288 | } 289 | }, 290 | filters: { 291 | label(vis){ 292 | return vis ? loc(`wiki_reveal_hide`,[insert]) : loc(`wiki_reveal_show`,[insert]); 293 | } 294 | } 295 | }); 296 | 297 | return section; 298 | } 299 | 300 | export function createCalcSection(info,id,type,insert){ 301 | insert = insert || loc(`wiki_calc_insert_` + type); 302 | let calc = $(`
      `); 303 | info.append(calc); 304 | calc.append(`{{ vis | label }}`); 305 | let section = $(``); 306 | calc.append(section); 307 | 308 | let modSection = document.getElementById(id + type + 'Section'); 309 | let modDisplay = { vis: false }; 310 | 311 | vBind({ 312 | el: `#${id}${type}Button`, 313 | data: modDisplay, 314 | methods: { 315 | show(){ 316 | if (modSection.style.display === 'block'){ 317 | modSection.style.display = 'none'; 318 | modDisplay.vis = false; 319 | } 320 | else { 321 | modSection.style.display = 'block'; 322 | modDisplay.vis = true; 323 | } 324 | } 325 | }, 326 | filters: { 327 | label(vis){ 328 | return vis ? loc(`wiki_calc_hide`,[insert]) : loc(`wiki_calc_show`,[insert]); 329 | } 330 | } 331 | }); 332 | 333 | return section; 334 | } -------------------------------------------------------------------------------- /src/seasons.js: -------------------------------------------------------------------------------- 1 | import { global } from './vars.js'; 2 | import { loc } from './locale.js'; 3 | import { clearElement, easterEgg } from './functions.js'; 4 | 5 | export function setWeather(){ 6 | // Moon Phase 7 | switch(global.city.calendar.moon){ 8 | case 0: 9 | global.city.ptrait.includes('retrograde') 10 | ? $('#moon').removeClass('wi-moon-waxing-crescent-1') 11 | : $('#moon').removeClass('wi-moon-waning-crescent-6'); 12 | $('#moon').addClass('wi-moon-new'); 13 | break; 14 | case 1: 15 | global.city.ptrait.includes('retrograde') 16 | ? $('#moon').removeClass('wi-moon-waxing-crescent-2') 17 | : $('#moon').removeClass('wi-moon-new'); 18 | $('#moon').addClass('wi-moon-waxing-crescent-1'); 19 | break; 20 | case 2: 21 | global.city.ptrait.includes('retrograde') 22 | ? $('#moon').removeClass('wi-moon-waxing-crescent-3') 23 | : $('#moon').removeClass('wi-moon-waxing-crescent-1'); 24 | $('#moon').addClass('wi-moon-waxing-crescent-2'); 25 | break; 26 | case 3: 27 | global.city.ptrait.includes('retrograde') 28 | ? $('#moon').removeClass('wi-moon-waxing-crescent-4') 29 | : $('#moon').removeClass('wi-moon-waxing-crescent-2'); 30 | $('#moon').addClass('wi-moon-waxing-crescent-3'); 31 | break; 32 | case 4: 33 | global.city.ptrait.includes('retrograde') 34 | ? $('#moon').removeClass('wi-moon-waxing-crescent-5') 35 | : $('#moon').removeClass('wi-moon-waxing-crescent-3'); 36 | $('#moon').addClass('wi-moon-waxing-crescent-4'); 37 | break; 38 | case 5: 39 | global.city.ptrait.includes('retrograde') 40 | ? $('#moon').removeClass('wi-moon-waxing-crescent-6') 41 | : $('#moon').removeClass('wi-moon-waxing-crescent-4'); 42 | $('#moon').addClass('wi-moon-waxing-crescent-5'); 43 | break; 44 | case 6: 45 | global.city.ptrait.includes('retrograde') 46 | ? $('#moon').removeClass('wi-moon-first-quarter') 47 | : $('#moon').removeClass('wi-moon-waxing-crescent-5'); 48 | $('#moon').addClass('wi-moon-waxing-crescent-6'); 49 | break; 50 | case 7: 51 | global.city.ptrait.includes('retrograde') 52 | ? $('#moon').removeClass('wi-moon-waxing-gibbous-1') 53 | : $('#moon').removeClass('wi-moon-waxing-crescent-6'); 54 | $('#moon').addClass('wi-moon-first-quarter'); 55 | break; 56 | case 8: 57 | global.city.ptrait.includes('retrograde') 58 | ? $('#moon').removeClass('wi-moon-waxing-gibbous-2') 59 | : $('#moon').removeClass('wi-moon-first-quarter'); 60 | $('#moon').addClass('wi-moon-waxing-gibbous-1'); 61 | break; 62 | case 9: 63 | global.city.ptrait.includes('retrograde') 64 | ? $('#moon').removeClass('wi-moon-waxing-gibbous-3') 65 | : $('#moon').removeClass('wi-moon-waxing-gibbous-1'); 66 | $('#moon').addClass('wi-moon-waxing-gibbous-2'); 67 | break; 68 | case 10: 69 | global.city.ptrait.includes('retrograde') 70 | ? $('#moon').removeClass('wi-moon-waxing-gibbous-4') 71 | : $('#moon').removeClass('wi-moon-waxing-gibbous-2'); 72 | $('#moon').addClass('wi-moon-waxing-gibbous-3'); 73 | break; 74 | case 11: 75 | global.city.ptrait.includes('retrograde') 76 | ? $('#moon').removeClass('wi-moon-waxing-gibbous-5') 77 | : $('#moon').removeClass('wi-moon-waxing-gibbous-3'); 78 | $('#moon').addClass('wi-moon-waxing-gibbous-4'); 79 | break; 80 | case 12: 81 | global.city.ptrait.includes('retrograde') 82 | ? $('#moon').removeClass('wi-moon-waxing-gibbous-6') 83 | : $('#moon').removeClass('wi-moon-waxing-gibbous-4'); 84 | $('#moon').addClass('wi-moon-waxing-gibbous-5'); 85 | break; 86 | case 13: 87 | clearElement($('#moon')); 88 | global.city.ptrait.includes('retrograde') 89 | ? $('#moon').removeClass('wi-moon-full') 90 | : $('#moon').removeClass('wi-moon-waxing-gibbous-5'); 91 | $('#moon').addClass('wi-moon-waxing-gibbous-6'); 92 | break; 93 | case 14: 94 | global.city.ptrait.includes('retrograde') 95 | ? $('#moon').removeClass('wi-moon-waning-gibbous-1') 96 | : $('#moon').removeClass('wi-moon-waxing-gibbous-6'); 97 | let egg = easterEgg(2); 98 | if (egg.length > 0){ 99 | $('#moon').append(egg); 100 | } 101 | else { 102 | $('#moon').addClass('wi-moon-full'); 103 | } 104 | break; 105 | case 15: 106 | clearElement($('#moon')); 107 | global.city.ptrait.includes('retrograde') 108 | ? $('#moon').removeClass('wi-moon-waning-gibbous-2') 109 | : $('#moon').removeClass('wi-moon-full'); 110 | $('#moon').addClass('wi-moon-waning-gibbous-1'); 111 | break; 112 | case 16: 113 | global.city.ptrait.includes('retrograde') 114 | ? $('#moon').removeClass('wi-moon-waning-gibbous-3') 115 | : $('#moon').removeClass('wi-moon-waning-gibbous-1'); 116 | $('#moon').addClass('wi-moon-waning-gibbous-2'); 117 | break; 118 | case 17: 119 | global.city.ptrait.includes('retrograde') 120 | ? $('#moon').removeClass('wi-moon-waning-gibbous-4') 121 | : $('#moon').removeClass('wi-moon-waning-gibbous-2'); 122 | $('#moon').addClass('wi-moon-waning-gibbous-3'); 123 | break; 124 | case 18: 125 | global.city.ptrait.includes('retrograde') 126 | ? $('#moon').removeClass('wi-moon-waning-gibbous-5') 127 | : $('#moon').removeClass('wi-moon-waning-gibbous-3'); 128 | $('#moon').addClass('wi-moon-waning-gibbous-4'); 129 | break; 130 | case 19: 131 | global.city.ptrait.includes('retrograde') 132 | ? $('#moon').removeClass('wi-moon-waning-gibbous-6') 133 | : $('#moon').removeClass('wi-moon-waning-gibbous-4'); 134 | $('#moon').addClass('wi-moon-waning-gibbous-5'); 135 | break; 136 | case 20: 137 | global.city.ptrait.includes('retrograde') 138 | ? $('#moon').removeClass('wi-moon-third-quarter') 139 | : $('#moon').removeClass('wi-moon-waning-gibbous-5'); 140 | $('#moon').addClass('wi-moon-waning-gibbous-6'); 141 | break; 142 | case 21: 143 | global.city.ptrait.includes('retrograde') 144 | ? $('#moon').removeClass('wi-moon-waning-crescent-1') 145 | : $('#moon').removeClass('wi-moon-waning-gibbous-6'); 146 | $('#moon').addClass('wi-moon-third-quarter'); 147 | break; 148 | case 22: 149 | global.city.ptrait.includes('retrograde') 150 | ? $('#moon').removeClass('wi-moon-waning-crescent-2') 151 | : $('#moon').removeClass('wi-moon-third-quarter'); 152 | $('#moon').addClass('wi-moon-waning-crescent-1'); 153 | break; 154 | case 23: 155 | global.city.ptrait.includes('retrograde') 156 | ? $('#moon').removeClass('wi-moon-waning-crescent-3') 157 | : $('#moon').removeClass('wi-moon-waning-crescent-1'); 158 | $('#moon').addClass('wi-moon-waning-crescent-2'); 159 | break; 160 | case 24: 161 | global.city.ptrait.includes('retrograde') 162 | ? $('#moon').removeClass('wi-moon-waning-crescent-4') 163 | : $('#moon').removeClass('wi-moon-waning-crescent-2'); 164 | $('#moon').addClass('wi-moon-waning-crescent-3'); 165 | break; 166 | case 25: 167 | global.city.ptrait.includes('retrograde') 168 | ? $('#moon').removeClass('wi-moon-waning-crescent-5') 169 | : $('#moon').removeClass('wi-moon-waning-crescent-3'); 170 | $('#moon').addClass('wi-moon-waning-crescent-4'); 171 | break; 172 | case 26: 173 | global.city.ptrait.includes('retrograde') 174 | ? $('#moon').removeClass('wi-moon-waning-crescent-6') 175 | : $('#moon').removeClass('wi-moon-waning-crescent-4'); 176 | $('#moon').addClass('wi-moon-waning-crescent-5'); 177 | break; 178 | case 27: 179 | global.city.ptrait.includes('retrograde') 180 | ? $('#moon').removeClass('wi-moon-new') 181 | : $('#moon').removeClass('wi-moon-waning-crescent-5'); 182 | $('#moon').addClass('wi-moon-waning-crescent-6'); 183 | break; 184 | } 185 | 186 | // Temp 187 | $('#temp').removeClass('wi-thermometer'); 188 | $('#temp').removeClass('wi-thermometer-exterior'); 189 | if (global.city.calendar.temp === 0){ 190 | $('#temp').addClass('wi-thermometer-exterior'); 191 | } 192 | else if (global.city.calendar.temp === 2){ 193 | $('#temp').addClass('wi-thermometer'); 194 | } 195 | 196 | // Sky 197 | $('#weather').removeClass('wi-day-sunny'); 198 | $('#weather').removeClass('wi-day-windy'); 199 | $('#weather').removeClass('wi-cloud'); 200 | $('#weather').removeClass('wi-cloudy-gusts'); 201 | $('#weather').removeClass('wi-rain'); 202 | $('#weather').removeClass('wi-storm-showers'); 203 | $('#weather').removeClass('wi-snow'); 204 | $('#weather').removeClass('wi-snow-wind'); 205 | 206 | let weather; 207 | if (global.city.calendar.weather === 0){ 208 | if (global.city.calendar.temp === 0){ 209 | weather = global.city.calendar.wind === 0 ? 'wi-snow' : 'wi-snow-wind'; 210 | } 211 | else { 212 | weather = global.city.calendar.wind === 0 ? 'wi-rain' : 'wi-storm-showers'; 213 | } 214 | } 215 | else if (global.city.calendar.weather === 1){ 216 | weather = global.city.calendar.wind === 0 ? 'wi-cloud' : 'wi-cloudy-gusts'; 217 | } 218 | else if (global.city.calendar.weather === 2){ 219 | weather = global.city.calendar.wind === 0 ? 'wi-day-sunny' : 'wi-day-windy'; 220 | } 221 | $('#weather').addClass(weather); 222 | } 223 | 224 | export function seasonDesc(type){ 225 | switch (type){ 226 | case 'moon': 227 | return moonDescription(); 228 | case 'weather': 229 | return weatherDescription(); 230 | case 'temp': 231 | return tempDescription(); 232 | case 'sign': 233 | return astrologyDescription(); 234 | case 'astrology': 235 | return astrologySymbol(); 236 | } 237 | } 238 | 239 | function moonDescription(){ 240 | if (global.race['orbit_decayed']){ 241 | return loc('moon0'); // New Moon 242 | } 243 | else if (global.city.calendar.moon === 0){ 244 | return loc('moon1'); // New Moon 245 | } 246 | else if (global.city.calendar.moon > 0 && global.city.calendar.moon < 7){ 247 | return loc('moon2'); // Waxing Crescent Moon 248 | } 249 | else if (global.city.calendar.moon === 7){ 250 | return loc('moon3'); // First Quarter Moon 251 | } 252 | else if (global.city.calendar.moon > 7 && global.city.calendar.moon < 14){ 253 | return loc('moon4'); // Waxing Gibbous Moon 254 | } 255 | else if (global.city.calendar.moon === 14){ 256 | return loc('moon5'); // Full Moon 257 | } 258 | else if (global.city.calendar.moon > 14 && global.city.calendar.moon < 21){ 259 | return loc('moon6'); // Waning Gibbous Moon 260 | } 261 | else if (global.city.calendar.moon === 21){ 262 | return loc('moon7'); // Third Quarter Moon 263 | } 264 | else if (global.city.calendar.moon > 21){ 265 | return loc('moon8'); // Waning Crescent Moon 266 | } 267 | } 268 | 269 | function weatherDescription(){ 270 | switch(global.city.calendar.weather){ 271 | case 0: 272 | if (global.city.calendar.temp === 0){ 273 | return global.city.calendar.wind === 1 ? loc('snowstorm') : loc('snow'); 274 | } 275 | else { 276 | return global.city.calendar.wind === 1 ? loc('thunderstorm') : loc('rain'); 277 | } 278 | case 1: 279 | return global.city.calendar.wind === 1 ? loc('cloudy_windy') : loc('cloudy'); 280 | case 2: 281 | return global.city.calendar.wind === 1 ? loc('sunny_windy') : loc('sunny'); 282 | } 283 | } 284 | 285 | function tempDescription(){ 286 | switch(global.city.calendar.temp){ 287 | case 0: 288 | return loc('cold');// weather, cold weather may reduce food output.'; 289 | case 1: 290 | return loc('moderate'); 291 | case 2: 292 | return loc('hot');// weather, hot weather may reduce worker productivity.'; 293 | } 294 | } 295 | 296 | export function astroVal(sign){ 297 | switch (sign){ 298 | case 'aries': // Combat Rating 299 | return [10]; 300 | case 'taurus': // Unification Bonus 301 | return [2]; 302 | case 'gemini': // Knowledge 303 | return [20]; 304 | case 'cancer': // Soldier Healing 305 | return [5]; 306 | case 'leo': // Power 307 | return [4]; 308 | case 'virgo': // Food Bonus 309 | return [15]; 310 | case 'libra': // Pop growth rate 311 | return [25]; 312 | case 'scorpio': // Cheaper and more effective spies 313 | return [12,1]; 314 | case 'sagittarius': // Entertainer Morale 315 | return [5]; 316 | case 'capricorn': // Trade gains 317 | return [10]; 318 | case 'aquarius': // Boosts tourism revenue 319 | return [20]; 320 | case 'pisces': // Random Events are more common 321 | return [49,25]; 322 | } 323 | } 324 | 325 | export function astrologySign(){ 326 | const date = new Date(); 327 | if ((date.getMonth() === 0 && date.getDate() >= 20) || (date.getMonth() === 1 && date.getDate() <= 18)){ 328 | return 'aquarius'; 329 | } 330 | else if ((date.getMonth() === 1 && date.getDate() >= 19) || (date.getMonth() === 2 && date.getDate() <= 20)){ 331 | return 'pisces'; 332 | } 333 | else if ((date.getMonth() === 2 && date.getDate() >= 21) || (date.getMonth() === 3 && date.getDate() <= 19)){ 334 | return 'aries'; 335 | } 336 | else if ((date.getMonth() === 3 && date.getDate() >= 20) || (date.getMonth() === 4 && date.getDate() <= 20)){ 337 | return 'taurus'; 338 | } 339 | else if ((date.getMonth() === 4 && date.getDate() >= 21) || (date.getMonth() === 5 && date.getDate() <= 21)){ 340 | return 'gemini'; 341 | } 342 | else if ((date.getMonth() === 5 && date.getDate() >= 22) || (date.getMonth() === 6 && date.getDate() <= 22)){ 343 | return 'cancer'; 344 | } 345 | else if ((date.getMonth() === 6 && date.getDate() >= 23) || (date.getMonth() === 7 && date.getDate() <= 22)){ 346 | return 'leo'; 347 | } 348 | else if ((date.getMonth() === 7 && date.getDate() >= 23) || (date.getMonth() === 8 && date.getDate() <= 22)){ 349 | return 'virgo'; 350 | } 351 | else if ((date.getMonth() === 8 && date.getDate() >= 23) || (date.getMonth() === 9 && date.getDate() <= 22)){ 352 | return 'libra'; 353 | } 354 | else if ((date.getMonth() === 9 && date.getDate() >= 23) || (date.getMonth() === 10 && date.getDate() <= 22)){ 355 | return 'scorpio'; 356 | } 357 | else if ((date.getMonth() === 10 && date.getDate() >= 23) || (date.getMonth() === 11 && date.getDate() <= 21)){ 358 | return 'sagittarius'; 359 | } 360 | else if ((date.getMonth() === 11 && date.getDate() >= 22) || (date.getMonth() === 0 && date.getDate() <= 19)){ 361 | return 'capricorn'; 362 | } 363 | else { 364 | return 'time itself is broken'; 365 | } 366 | } 367 | 368 | function astrologyDescription(){ 369 | let sign = astrologySign(); 370 | let desc = `
      ${loc(`sign_description`,[loc(`sign_${sign}`),loc(`sign_${sign}_desc`)])}
      `; 371 | desc += `
      ${astroEffect(sign)}
      `; 372 | return desc; 373 | } 374 | 375 | function astroEffect(sign){ 376 | if (sign === 'pisces' || sign === 'cancer'){ 377 | return loc(`sign_${sign}_effect`); 378 | } 379 | else { 380 | return loc(`sign_${sign}_effect`,[astroVal(sign)[0]]); 381 | } 382 | } 383 | 384 | function astrologySymbol(){ 385 | let sign = astrologySign(); 386 | return loc(`sign_${sign}_symbol`); 387 | } 388 | -------------------------------------------------------------------------------- /src/prod.js: -------------------------------------------------------------------------------- 1 | import { global, p_on } from './vars.js'; 2 | import { biomes, traits, fathomCheck } from './races.js'; 3 | import { govRelationFactor } from './civics.js'; 4 | import { jobScale } from './jobs.js'; 5 | import { hellSupression } from './portal.js'; 6 | import { flib } from './functions.js'; 7 | import { govActive } from './governor.js'; 8 | 9 | export function highPopAdjust(v){ 10 | if (global.race['high_pop']){ 11 | v *= traits.high_pop.vars()[1] / 100; 12 | } 13 | return v; 14 | } 15 | 16 | export function production(id,val){ 17 | switch (id){ 18 | case 'transmitter': 19 | { 20 | return 2.5; 21 | } 22 | case 'oil_well': 23 | { 24 | let oil = global.tech['oil'] >= 4 ? 0.48 : 0.4; 25 | if (global.tech['oil'] >= 7){ 26 | oil *= 2; 27 | } 28 | else if (global.tech['oil'] >= 5){ 29 | oil *= global.tech['oil'] >= 6 ? 1.75 : 1.25; 30 | } 31 | if (global.city.geology['Oil']){ 32 | oil *= global.city.geology['Oil'] + 1; 33 | } 34 | if (global.city.biome === 'desert'){ 35 | oil *= biomes.desert.vars()[1]; 36 | } 37 | else if (global.city.biome === 'tundra'){ 38 | oil *= biomes.tundra.vars()[1]; 39 | } 40 | else if (global.city.biome === 'taiga'){ 41 | oil *= biomes.taiga.vars()[2]; 42 | } 43 | let dirtVal = govActive('dirty_jobs',2); 44 | if (dirtVal){ 45 | oil *= 1 + (dirtVal / 100); 46 | } 47 | return oil; 48 | } 49 | case 'iridium_mine': 50 | { 51 | switch (val){ 52 | case 'iridium': 53 | { 54 | let iridium = 0.035; 55 | if (global.city.geology['Iridium']){ 56 | iridium *= global.city.geology['Iridium'] + 1; 57 | } 58 | let base = iridium; 59 | let gov = govRelationFactor(3); 60 | return { 61 | b: base, 62 | g: gov - 1, 63 | f: base * gov 64 | }; 65 | } 66 | case 'coal': 67 | return 0.55; 68 | } 69 | } 70 | case 'helium_mine': 71 | { 72 | let base = 0.18; 73 | let gov = govRelationFactor(3); 74 | return { 75 | b: base, 76 | g: gov - 1, 77 | f: base * gov 78 | }; 79 | } 80 | case 'red_mine': 81 | { 82 | switch (val){ 83 | case 'copper': 84 | { 85 | let base = highPopAdjust(0.25); 86 | let gov = govRelationFactor(3); 87 | return { 88 | b: base, 89 | g: gov - 1, 90 | f: base * gov 91 | }; 92 | } 93 | case 'titanium': 94 | { 95 | let base = highPopAdjust(0.02); 96 | let gov = govRelationFactor(3); 97 | return { 98 | b: base, 99 | g: gov - 1, 100 | f: base * gov 101 | }; 102 | } 103 | case 'stone': 104 | return highPopAdjust(0.75); 105 | case 'asbestos': 106 | return highPopAdjust(1.25); 107 | case 'aluminium': 108 | return highPopAdjust(0.066); 109 | } 110 | } 111 | case 'biodome': 112 | { 113 | switch (val){ 114 | case 'food': 115 | return highPopAdjust(0.25); 116 | case 'cat_food': 117 | return 2; 118 | case 'lumber': 119 | return highPopAdjust(1.5); 120 | } 121 | } 122 | case 'gas_mining': 123 | { 124 | return (global.tech['helium'] ? 0.65 : 0.5); 125 | } 126 | case 'outpost': 127 | { 128 | let vals = { 129 | b: 0.025, 130 | d: 0, 131 | n: 0 132 | }; 133 | if (global.tech['drone']){ 134 | let rate = global.stats.achieve['iron_will'] && global.stats.achieve.iron_will.l >= 3 ? 0.12 : 0.06; 135 | vals.d = global.space.drone.count * rate; 136 | vals.n = vals.b * (1 + (vals.d)); 137 | } 138 | else { 139 | vals.n = vals.b; 140 | } 141 | 142 | return val ? vals : vals.n; 143 | } 144 | case 'oil_extractor': 145 | { 146 | let oil = global.tech['oil'] >= 4 ? 0.48 : 0.4; 147 | if (global.tech['oil'] >= 7){ 148 | oil *= 2; 149 | } 150 | else if (global.tech['oil'] >= 5){ 151 | oil *= global.tech['oil'] >= 6 ? 1.75 : 1.25; 152 | } 153 | return oil; 154 | } 155 | case 'elerium_ship': 156 | { 157 | return (global.tech.asteroid >= 6 ? (global.tech.asteroid >= 7 ? 0.009 : 0.0075) : 0.005); 158 | } 159 | case 'iridium_ship': 160 | { 161 | return (global.tech.asteroid >= 6 ? (global.tech.asteroid >= 7 ? 0.1 : 0.08) : 0.055); 162 | } 163 | case 'iron_ship': 164 | { 165 | return (global.tech.asteroid >= 6 ? (global.tech.asteroid >= 7 ? 4 : 3) : 2); 166 | } 167 | case 'g_factory': 168 | { 169 | if (global.race['truepath']){ 170 | if (global.tech['isolation']){ 171 | return 1.8; 172 | } 173 | else { 174 | let titan_colonists = p_on['ai_colonist'] ? global.civic.titan_colonist.workers + jobScale(p_on['ai_colonist']) : global.civic.titan_colonist.workers; 175 | let gain = 0.05 * titan_colonists; 176 | if (global.race['high_pop']){ 177 | gain = highPopAdjust(gain); 178 | } 179 | return gain; 180 | } 181 | } 182 | else { 183 | return 0.6; 184 | } 185 | } 186 | case 'harvester': 187 | { 188 | switch (val){ 189 | case 'helium': 190 | return 0.85; 191 | case 'deuterium': 192 | return 0.15; 193 | } 194 | } 195 | case 'elerium_prospector': 196 | { 197 | return 0.014; 198 | } 199 | case 'neutron_miner': 200 | { 201 | return 0.055; 202 | } 203 | case 'bolognium_ship': 204 | { 205 | return 0.008; 206 | } 207 | case 'excavator': 208 | { 209 | return 0.2; 210 | } 211 | case 'vitreloy_plant': 212 | { 213 | let vitreloy = 0.18; 214 | if (global.civic.govern.type === 'corpocracy'){ 215 | vitreloy *= global.tech['high_tech'] && global.tech['high_tech'] >= 16 ? 1.4 : 1.3; 216 | } 217 | if (global.civic.govern.type === 'socialist'){ 218 | vitreloy *= 1.1; 219 | } 220 | return vitreloy; 221 | } 222 | case 'infernite_mine': 223 | { 224 | let sup = hellSupression('gate'); 225 | return 0.5 * sup.supress; 226 | } 227 | case 'water_freighter': 228 | { 229 | return 1.25; 230 | } 231 | case 'titan_mine': 232 | { 233 | switch (val){ 234 | case 'adamantite': 235 | { 236 | let base = highPopAdjust(0.02); 237 | return base * (global.space['titan_mine'] ? global.space.titan_mine.ratio : 50) / 100; 238 | } 239 | case 'aluminium': 240 | { 241 | let base = highPopAdjust(0.12); 242 | return base * (100 - (global.space['titan_mine'] ? global.space.titan_mine.ratio : 50)) / 100; 243 | } 244 | } 245 | } 246 | case 'lander': 247 | { 248 | if (global.space.crashed_ship.count === 100){ 249 | return 0.005; 250 | } 251 | return 0; 252 | } 253 | case 'orichalcum_mine': 254 | { 255 | return 0.08; 256 | } 257 | case 'uranium_mine': 258 | { 259 | return 0.025; 260 | } 261 | case 'neutronium_mine': 262 | { 263 | return 0.04; 264 | } 265 | case 'elerium_mine': 266 | { 267 | return 0.009; 268 | } 269 | case 'shock_trooper': 270 | { 271 | if (global.space.digsite.count === 100){ 272 | return 0.0018; 273 | } 274 | return 0; 275 | } 276 | case 'tank': 277 | { 278 | if (global.space.digsite.count === 100){ 279 | return 0.0018; 280 | } 281 | return 0; 282 | } 283 | case 'mining_pit': 284 | { 285 | let mats = 0; 286 | switch (val){ 287 | case 'materials': 288 | { 289 | mats = global.tech['isolation'] ? 0.12 : 0.09; 290 | break; 291 | } 292 | case 'bolognium': 293 | { 294 | mats = global.tech['isolation'] ? 0.0288 : 0.0216; 295 | break; 296 | } 297 | case 'stone': 298 | { 299 | mats = global.tech['isolation'] ? 0.8 : 0.6; 300 | break; 301 | } 302 | case 'adamantite': 303 | { 304 | mats = global.tech['isolation'] ? 0.448 : 0.336; 305 | break; 306 | } 307 | case 'copper': 308 | { 309 | mats = 0.58; 310 | break; 311 | } 312 | case 'coal': 313 | { 314 | mats = 0.13; 315 | break; 316 | } 317 | case 'iron': 318 | { 319 | mats = 0.74; 320 | break; 321 | } 322 | case 'aluminium': 323 | { 324 | mats = 0.88; 325 | break; 326 | } 327 | case 'chrysotile': 328 | { 329 | mats = 1.44; 330 | break; 331 | } 332 | } 333 | if (global.race['tough']){ 334 | mats *= 1 + (traits.tough.vars()[0] / 100); 335 | } 336 | let fathom = fathomCheck('ogre'); 337 | if (fathom > 0){ 338 | mats *= 1 + (traits.tough.vars(1)[0] / 100 * fathom); 339 | } 340 | if (global.tech['tau_pit_mining']){ 341 | mats *= 1.18; 342 | } 343 | return mats; 344 | } 345 | case 'tau_farm': 346 | { 347 | switch (val){ 348 | case 'food': 349 | { 350 | return global.tech['isolation'] ? 15 : 9; 351 | } 352 | case 'lumber': 353 | { 354 | return global.tech['isolation'] ? 12 : 5.5; 355 | } 356 | case 'water': 357 | { 358 | return 0.35; 359 | } 360 | } 361 | } 362 | case 'womling_mine': 363 | { 364 | let boost = 1; 365 | if (global.tech['womling_mining']){ 366 | boost += global.tech.womling_mining * 0.15; 367 | } 368 | if (global.stats.achieve['overlord'] && global.stats.achieve.overlord.l >= 5){ 369 | boost *= 1.1; 370 | } 371 | if (global.tech['womling_gene']){ 372 | boost *= 1.25; 373 | } 374 | 375 | switch (val){ 376 | case 'unobtainium': 377 | { 378 | return 0.0305 * boost; 379 | } 380 | case 'uranium': 381 | { 382 | return 0.047 * boost; 383 | } 384 | case 'titanium': 385 | { 386 | return 0.616 * boost; 387 | } 388 | case 'copper': 389 | { 390 | return 1.191 * boost; 391 | } 392 | case 'iron': 393 | { 394 | return 1.377 * boost; 395 | } 396 | case 'aluminium': 397 | { 398 | return 1.544 * boost; 399 | } 400 | case 'neutronium': 401 | { 402 | return 0.382 * boost; 403 | } 404 | case 'iridium': 405 | { 406 | return 0.535 * boost; 407 | } 408 | } 409 | } 410 | case 'refueling_station': 411 | { 412 | return global.tech['isolation'] ? 18.5 : 9.35; 413 | } 414 | case 'ore_refinery': 415 | { 416 | return global.tech['tau_ore_mining'] ? 40 : 25; 417 | } 418 | case 'whaling_station': 419 | { 420 | return 12; 421 | } 422 | case 'mining_ship': 423 | { 424 | if (global.tauceti['patrol_ship']){ 425 | let patrol = 1; 426 | if (global.tauceti.patrol_ship.support > global.tauceti.patrol_ship.s_max){ 427 | patrol = flib('curve',global.tauceti.patrol_ship.s_max / global.tauceti.patrol_ship.support,1.4); 428 | } 429 | return (global.tech['tau_ore_mining'] && global.tech.tau_ore_mining >= 2 ? 12 : 10) * patrol; 430 | } 431 | return 0; 432 | } 433 | case 'mining_ship_ore': 434 | { 435 | switch (val){ 436 | case 'iron': 437 | { 438 | return global.tech['isolation'] ? 2.22 : 1.85; 439 | } 440 | case 'aluminium': 441 | { 442 | return global.tech['isolation'] ? 2.22 : 1.85; 443 | } 444 | case 'iridium': 445 | { 446 | return global.tech['isolation'] ? 0.42 : 0.35; 447 | } 448 | case 'neutronium': 449 | { 450 | return global.tech['isolation'] ? 0.42 : 0.35; 451 | } 452 | case 'orichalcum': 453 | { 454 | return global.tech['isolation'] ? 0.3 : 0.25; 455 | } 456 | case 'elerium': 457 | { 458 | return global.tech['isolation'] ? 0.024 : 0.02; 459 | } 460 | } 461 | } 462 | case 'whaling_ship': 463 | { 464 | if (global.tauceti['patrol_ship']){ 465 | let patrol = 1; 466 | if (global.tauceti.patrol_ship.support > global.tauceti.patrol_ship.s_max){ 467 | patrol = flib('curve',global.tauceti.patrol_ship.s_max / global.tauceti.patrol_ship.support,1.4); 468 | } 469 | return 8 * patrol; 470 | } 471 | return 0; 472 | } 473 | case 'whaling_ship_oil': 474 | { 475 | return global.tech['isolation'] ? 0.78 : 0.42; 476 | } 477 | case 'alien_outpost': 478 | { 479 | return 0.01; 480 | } 481 | case 'psychic_boost': 482 | { 483 | if (global.tech['psychic'] && global.race['psychic'] && global.race['psychicPowers'] && global.race.psychicPowers.boost.r === val && global.race.psychicPowers.hasOwnProperty('boostTime')){ 484 | let boost = 0; 485 | if (global.race.psychicPowers.boostTime > 0){ 486 | boost += traits.psychic.vars()[3] / 100; 487 | } 488 | if (global.tech.psychic >= 4 && global.race.psychicPowers['channel']){ 489 | let rank = global.stats.achieve['nightmare'] && global.stats.achieve.nightmare['mg'] ? global.stats.achieve.nightmare.mg : 0; 490 | boost += +(traits.psychic.vars()[3] / 50000 * rank * global.race.psychicPowers.channel.boost).toFixed(3); 491 | } 492 | return 1 + boost; 493 | } 494 | return 1; 495 | } 496 | case 'psychic_cash': 497 | { 498 | if (global.tech['psychic'] && global.race['psychic'] && global.race['psychicPowers'] && global.race.psychicPowers.hasOwnProperty('cash')){ 499 | let boost = 0; 500 | if (global.race.psychicPowers.cash > 0){ 501 | boost += traits.psychic.vars()[3] / 100; 502 | } 503 | if (global.tech.psychic >= 4 && global.race.psychicPowers['channel']){ 504 | let rank = global.stats.achieve['nightmare'] && global.stats.achieve.nightmare['mg'] ? global.stats.achieve.nightmare.mg : 0; 505 | boost += +(traits.psychic.vars()[3] / 50000 * rank * global.race.psychicPowers.channel.cash).toFixed(3); 506 | } 507 | return 1 + boost; 508 | } 509 | return 1; 510 | } 511 | } 512 | } 513 | --------------------------------------------------------------------------------