Skip to content

Commit

Permalink
Asphodel Encampment
Browse files Browse the repository at this point in the history
  • Loading branch information
pmotschmann committed Feb 20, 2024
1 parent 75098ee commit 2c48f0e
Show file tree
Hide file tree
Showing 18 changed files with 280 additions and 111 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ update.*.json
strings/last-strings.json
node_modules/*
docs
dist
dist
*.map
10 changes: 10 additions & 0 deletions buildEvolveDebug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require("esbuild")
.build({
logLevel: "debug",
entryPoints: ["./src/main.js"],
bundle: true,
minify: false,
sourcemap : true,
outfile: "evolve/main.js",
})
.catch(() => process.exit(1));
10 changes: 10 additions & 0 deletions buildWikiDebug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require("esbuild")
.build({
logLevel: "debug",
entryPoints: ["./src/wiki/wiki.js"],
bundle: true,
minify: false,
sourcemap : true,
outfile: "wiki/wiki.js",
})
.catch(() => process.exit(1));
92 changes: 46 additions & 46 deletions evolve/main.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"build": "npm run evolve && npm run evolve-less && npm run wiki && npm run wiki-less",
"build-win": "npm run evolve && npm run evolve-less-win && npm run wiki && npm run wiki-less-win",
"evolve": "node buildEvolve.js",
"evolve-debug": "node buildEvolveDebug.js",
"evolve-less": "lessc src/evolve.less evolve/evolve-unminified.css && csso -i evolve/evolve-unminified.css -o evolve/evolve.css && rm evolve/evolve-unminified.css",
"evolve-less-win": "lessc src/evolve.less evolve/evolve-unminified.css && csso -i evolve/evolve-unminified.css -o evolve/evolve.css && del evolve\\evolve-unminified.css",
"wiki": "node buildWiki.js",
"wiki-debug": "node buildWikiDebug.js",
"wiki-less": "lessc src/wiki/wiki.less wiki/wiki-unminified.css && csso -i wiki/wiki-unminified.css -o wiki/wiki.css && rm wiki/wiki-unminified.css",
"wiki-less-win": "lessc src/wiki/wiki.less wiki/wiki-unminified.css && csso -i wiki/wiki-unminified.css -o wiki/wiki.css && del wiki\\wiki-unminified.css",
"serve": "servehere -c",
Expand Down
72 changes: 65 additions & 7 deletions src/edenic.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,77 @@
import { global, seededRandom, keyMultiplier, p_on, quantum_level, sizeApproximation } from './vars.js';
import { vBind, clearElement, popover, clearPopper, timeFormat, powerCostMod, spaceCostMultiplier, messageQueue, powerModifier, calcPillar, deepClone, popCost, calcPrestige } from './functions.js';
import { unlockAchieve, alevel, universeAffix } from './achieve.js';
import { traits, races, fathomCheck } from './races.js';
import { vBind, clearElement, popover, clearPopper, timeFormat, powerCostMod, spaceCostMultiplier, messageQueue, powerModifier } from './functions.js';
import { defineResources, spatialReasoning } from './resources.js';
import { loadFoundry, jobScale, limitCraftsmen } from './jobs.js';
import { armyRating, govCivics, garrisonSize, mercCost } from './civics.js';
import { payCosts, powerOnNewStruct, setAction, drawTech, bank_vault, updateDesc } from './actions.js';
import { checkRequirements} from './space.js';
import { checkRequirements, incrementStruct} from './space.js';
import { loc } from './locale.js';

const edenicModules = {
eden_asphodel: {
info: {
name: loc('eden_asphodel_name'),
desc: loc('eden_asphodel_desc'),
desc(){ return `${loc('eden_asphodel_desc')} ${loc('eden_asohodel_desc_peaceful')}`; },
support: 'encampment'
},
survery_meadows: {
id: 'eden-survery_meadows',
title(){
return loc('eden_survery_meadows_title');
},
desc(){
return $(this)[0].title();
},
reqs: { edenic: 3 },
grant: ['edenic',4],
queue_complete(){ return global.tech.edenic >= 4 ? 0 : 1; },
cost: {
Oil(offset,wiki){ return 10000000; }
},
effect(){
return loc('eden_survery_meadows_effect');
},
action(){
if (payCosts($(this)[0])){
messageQueue(loc('eden_survery_meadows_action'),'info',false,['progress']);
return true;
}
return false;
}
},
encampment: {
id: 'eden-encampment',
title: loc('eden_encampment_title'),
desc(){ return `<div>${loc('eden_encampment_title')}</div><div class="has-text-special">${loc('requires_power')}</div>`; },
reqs: { edenic: 4 },
cost: {
Money(offset){ return spaceCostMultiplier('encampment', offset, 1590000000, 1.235, 'eden'); },
Lumber(offset){ return spaceCostMultiplier('encampment', offset, 860000000, 1.235, 'eden'); },
},
effect(){
let desc = `<div>${loc('eden_encampment_effect',[$(this)[0].support()])}</div>`;

if (global.tech.hasOwnProperty('asphodel') && global.tech.asphodel >= 1){
let powder = spatialReasoning(250);
desc += `<div>${loc('plus_max_resource',[powder,loc('resource_Asphodel_Powder_name')])}</div>`;
}

desc += `<div class="has-text-caution">${loc('minus_power',[$(this)[0].powered()])}</div>`;

return desc;
},
support(){ return 10; },
powered(){ return powerCostMod(616); },
powerBalancer(){
return [{ s: global.eden.encampment.s_max - global.eden.encampment.support }];
},
refresh: true,
action(){
if (payCosts($(this)[0])){
incrementStruct('encampment','eden');
global['resource']['Asphodel_Powder'].max += spatialReasoning(250);
return true;
}
return false;
}
},
},
eden_elysium: {
Expand Down
5 changes: 4 additions & 1 deletion src/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export function powerGrid(type,reset){
'city:rock_quarry','city:cement_plant','city:sawmill','city:mass_driver','int_neutron:neutron_miner','prtl_fortress:war_droid','prtl_pit:soul_forge','gxy_chthonian:excavator',
'int_blackhole:far_reach','prtl_badlands:sensor_drone','prtl_badlands:attractor','city:metal_refinery','gxy_stargate:gateway_station','gxy_alien1:vitreloy_plant','gxy_alien2:foothold',
'gxy_gorddon:symposium','int_blackhole:mass_ejector','city:casino','spc_hell:spc_casino','tau_home:tauceti_casino','prtl_fortress:repair_droid','gxy_stargate:defense_platform','prtl_ruins:guard_post',
'prtl_lake:cooling_tower','prtl_lake:harbour','prtl_spire:purifier','prtl_ruins:archaeology','prtl_pit:gun_emplacement','prtl_gate:gate_turret','prtl_pit:soul_attractor',
'prtl_lake:cooling_tower','prtl_lake:harbour','prtl_spire:purifier','prtl_ruins:archaeology','prtl_pit:gun_emplacement','prtl_gate:gate_turret','prtl_pit:soul_attractor','eden_asphodel:encampment',
'prtl_gate:infernite_mine','int_sirius:ascension_trigger','spc_kuiper:orichalcum_mine','spc_kuiper:elerium_mine','spc_kuiper:uranium_mine','spc_kuiper:neutronium_mine','spc_dwarf:m_relay',
'tau_home:tau_factory','tau_home:infectious_disease_lab','tau_home:alien_outpost','tau_gas:womling_station','spc_red:atmo_terraformer','tau_star:matrix','tau_home:tau_cultural_center',
'prtl_pit:soul_capacitor','city:replicator'
Expand Down Expand Up @@ -326,6 +326,9 @@ export function powerGrid(type,reset){
case 'tau_roid':
power_structs = ['tau_roid:mining_ship','tau_roid:whaling_ship'];
break;
case 'asphodel':
power_structs = [];
break;
}

if (reset){
Expand Down
1 change: 1 addition & 0 deletions src/industry.js
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,7 @@ export function gridDefs(){
tau_home: { l: global.support.tau_home, n: loc(`tau_planet`,[races[global.race.species].home]), s: global.settings.tau.home, r: 'tauceti', rs: 'orbital_station' },
tau_red: { l: global.support.tau_red, n: loc(`tau_planet`,[planetName().red]), s: global.settings.tau.red, r: 'tauceti', rs: 'orbital_platform' },
tau_roid: { l: global.support.tau_roid, n: loc(`tau_roid_title`), s: global.settings.tau.roid, r: 'tauceti', rs: 'patrol_ship' },
asphodel: { l: global.support.asphodel, n: loc(`eden_asphodel_name`), s: global.settings.eden.asphodel, r: 'eden', rs: 'encampment' },
};
}

Expand Down
13 changes: 12 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ function fastLoop(){
'Money','Knowledge','Food','Lumber','Stone','Chrysotile','Crystal','Furs','Copper','Iron',
'Cement','Coal','Oil','Uranium','Aluminium','Steel','Titanium','Alloy','Polymer','Iridium',
'Helium_3','Water','Deuterium','Neutronium','Adamantite','Infernite','Elerium','Nano_Tube',
'Graphene','Stanene','Bolognium','Vitreloy','Orichalcum','Unobtainium','Quantium',
'Graphene','Stanene','Bolognium','Vitreloy','Orichalcum','Asphodel_Powder','Unobtainium','Quantium',
'Plywood','Brick','Wrought_Iron','Sheet_Metal','Mythril','Aerogel','Nanoweave','Scarletite',
'Cipher','Nanite','Mana'
];
Expand Down Expand Up @@ -2018,6 +2018,7 @@ function fastLoop(){
{ a: 'tauceti', r: 'tau_home', s: 'orbital_station', g: 'tau_home' },
{ a: 'tauceti', r: 'tau_red', s: 'orbital_platform', g: 'tau_red' },
{ a: 'tauceti', r: 'tau_roid', s: 'patrol_ship', g: 'tau_roid', oc: true },
{ a: 'eden', r: 'eden_asphodel', s: 'encampment', g: 'asphodel' },
].forEach(function(sup){
sup['r2'] = sup['r2'] || sup.r;
if (global[sup.a][sup.s] && global[sup.a][sup.s].count > 0){
Expand Down Expand Up @@ -7412,6 +7413,7 @@ function midLoop(){
Bolognium: 0,
Vitreloy: 0,
Orichalcum: 0,
Asphodel_Powder: 0,
Unobtainium: 0,
Cipher: 0,
Nanite: 0,
Expand Down Expand Up @@ -7532,6 +7534,7 @@ function midLoop(){
var bd_Bolognium = { [loc('base')]: caps['Bolognium']+'v' };
var bd_Vitreloy = { [loc('base')]: caps['Vitreloy']+'v' };
var bd_Orichalcum = { [loc('base')]: caps['Orichalcum']+'v' };
var bd_Asphodel_Powder = { [loc('base')]: caps['Asphodel_Powder']+'v' };
var bd_Unobtainium = { [loc('base')]: caps['Unobtainium']+'v' };
var bd_Cipher = { [loc('base')]: caps['Cipher']+'v' };
var bd_Nanite = { [loc('base')]: caps['Nanite']+'v' };
Expand Down Expand Up @@ -7578,6 +7581,7 @@ function midLoop(){
Bolognium: bd_Bolognium,
Vitreloy: bd_Vitreloy,
Orichalcum: bd_Orichalcum,
Asphodel_Powder: bd_Asphodel_Powder,
Unobtainium: bd_Unobtainium,
Nanite: bd_Nanite,
Cipher: bd_Cipher,
Expand Down Expand Up @@ -8743,6 +8747,13 @@ function midLoop(){
caps['Knowledge'] += gain;
bd_Knowledge[loc('galaxy_scavenger')] = gain+'v';
}

if (global.eden['encampment']){
let powder = global.eden.encampment.count * spatialReasoning(250);
caps['Asphodel_Powder'] += powder;
breakdown.c.Asphodel_Powder[loc('eden_encampment_title')] = powder+'v';
}

breakdown['t_route'] = {};
global.city.market.mtrade = 0;
if (global.race['banana']){
Expand Down
3 changes: 3 additions & 0 deletions src/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,9 @@ const fortressModules = {
global.tech.edenic = 3;
global.settings.showEden = true;
global.settings.eden.asphodel = true;
global.settings.spaceTabs = 7;
global.resource.Blessed_Essence.display = false;
global.eden['encampment'] = { count: 0, on: 0, support: 0, s_max: 0 };
renderFortress();
renderEdenic();
return true;
Expand Down
3 changes: 3 additions & 0 deletions src/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const resource_values = {
Bolognium: 9000,
Vitreloy: 10200,
Orichalcum: 99000,
Asphodel_Powder: 249000,
Horseshoe: 0,
Nanite: 0,
Genes: 0,
Expand Down Expand Up @@ -117,6 +118,7 @@ export const atomic_mass = {
Unobtainium: 168.59,
Vitreloy: 41.08,
Orichalcum: 237.8,
Asphodel_Powder: 0.01,
Water: 18.01,
Plywood: 7.666,
Brick: 20.009,
Expand Down Expand Up @@ -683,6 +685,7 @@ export function defineResources(wiki){
loadResource('Bolognium',wiki,0,1,false,true,'advanced');
loadResource('Vitreloy',wiki,0,1,false,true,'advanced');
loadResource('Orichalcum',wiki,0,1,false,true,'advanced');
loadResource('Asphodel_Powder',wiki,0,1,false,false,'advanced');
loadResource('Unobtainium',wiki,0,1,false,false,'advanced');
loadResource('Materials',wiki,0,1,false,false,'advanced');
loadResource('Horseshoe',wiki,-2,0,false,false,'advanced');
Expand Down
3 changes: 3 additions & 0 deletions src/space.js
Original file line number Diff line number Diff line change
Expand Up @@ -5336,6 +5336,9 @@ export function convertSpaceSector(part){
else if (part.substr(0,4) === 'tau_'){
space = 'tauceti';
}
else if (part.substr(0,5) === 'eden_'){
space = 'eden';
}
return space;
}

Expand Down
22 changes: 22 additions & 0 deletions src/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -13900,6 +13900,28 @@ const techs = {
}
return false;
}
},
asphodel_flowers: {
id: 'tech-asphodel_flowers',
title: loc('tech_asphodel_flowers'),
desc: loc('tech_asphodel_flowers'),
category: 'edenic',
era: 'existential',
reqs: { edenic: 4 },
grant: ['asphodel',1],
cost: {
Knowledge(){ return 61000000; }
},
effect(){ return loc('tech_asphodel_flowers_effect'); },
action(){
if (payCosts($(this)[0])){
messageQueue(loc('tech_asphodel_flowers_msg'),'info',false,['progress']);
global.eden['asphodel_harvester'] = { count: 0, on: 0 };
global.resource.Asphodel_Powder.display = true;
return true;
}
return false;
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ if (!global.hasOwnProperty('support')){

[
'moon','red','belt','alpha','nebula','gateway','alien2','lake','spire',
'titan','enceladus','eris','tau_home','tau_red','tau_roid'
'titan','enceladus','eris','tau_home','tau_red','tau_roid','asphodel'
].forEach(function(s){
if (!global.support.hasOwnProperty(s)){
global.support[s] = [];
Expand Down
28 changes: 28 additions & 0 deletions src/wiki/structures.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export function renderStructurePage(zone,path){
case 'hell':
hellPage(content);
break;
case 'edenic':
edenPage(content);
break;
case 'tauceti':
taucetiPage(content);
break;
Expand All @@ -51,6 +54,7 @@ const extraInformation = {
interstellar: {},
intergalactic: {},
hell: {},
eden: {},
tauceti: {},
};

Expand Down Expand Up @@ -229,6 +233,10 @@ function addCalcInputs(parent,key,section,region,path){
action = actions.portal[region][key];
inputs.real_owned = global.portal[key] ? global.portal[key].count : 0;
break;
case 'eden':
action = actions.eden[region][key];
inputs.real_owned = global.eden[key] ? global.eden[key].count : 0;
break;
case 'tauceti':
action = actions.tauceti[region][key];
inputs.real_owned = global.tauceti[key] ? global.tauceti[key].count : 0;
Expand Down Expand Up @@ -517,6 +525,26 @@ function hellPage(content){
});
}

function edenPage(content){
Object.keys(actions.eden).forEach(function (region){
let name = typeof actions.eden[region].info.name === 'string' ? actions.eden[region].info.name : actions.eden[region].info.name();
let desc = typeof actions.eden[region].info.desc === 'string' ? actions.eden[region].info.desc : actions.eden[region].info.desc();

Object.keys(actions.eden[region]).forEach(function (struct){
if (struct !== 'info' && (!actions.eden[region][struct].hasOwnProperty('wiki') || actions.eden[region][struct].wiki)){
let id = actions.eden[region][struct].id.split('-');
let info = $(`<div id="${id[1]}" class="infoBox"></div>`);
content.append(info);
actionDesc(info, actions.eden[region][struct],`<span id="pop${actions.eden[region][struct].id}">${name}</span>`, true);
addInfomration(info,'eden',struct);
addCalcInputs(info,struct,'eden',region);
sideMenu('add',`eden-structures`,id[1],typeof actions.eden[region][struct].title === 'function' ? actions.eden[region][struct].title() : actions.eden[region][struct].title);
popover(`pop${actions.eden[region][struct].id}`,$(`<div>${desc}</div>`));
}
});
});
}

function taucetiPage(content){
Object.keys(actions.tauceti).forEach(function (region){
let name = typeof actions.tauceti[region].info.name === 'string' ? actions.tauceti[region].info.name : actions.tauceti[region].info.name();
Expand Down
3 changes: 2 additions & 1 deletion src/wiki/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ function initPage(){
{ key: 'space' },
{ key: 'interstellar' },
{ key: 'intergalactic' },
{ key: 'hell' }
{ key: 'hell' },
{ key: 'edenic' }
]
},
{
Expand Down
Loading

0 comments on commit 2c48f0e

Please sign in to comment.