Skip to content

Commit

Permalink
updated uni speed
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed Jan 10, 2024
1 parent e41628c commit 4c8d3b8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
28 changes: 15 additions & 13 deletions packages/mainnet/frontend/src/constants/costs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Resources } from "../shared/types";
import { Resources } from '../shared/types';

export const uniSpeed = 5;

export const baseTechCost: { [key: string]: Resources } = {
digital: { steel: 0, quartz: 400, tritium: 600 },
Expand Down Expand Up @@ -34,16 +36,16 @@ type BaseTechCostKey = keyof typeof baseTechCost;

// Mapping from functionCallName to baseTechCost key
export const techCostMapping: { [key: string]: BaseTechCostKey } = {
digital_systems: "digital",
weapons_development: "weapon",
shield_tech: "shield",
armour_innovation: "armour",
energy_innovation: "energy",
combustive_engine: "combustion",
thrust_propulsion: "thrust",
warp_drive: "warp",
spacetime_warp: "spacetime",
beam_technology: "beam",
ion_systems: "ion",
plasma_engineering: "plasma",
digital_systems: 'digital',
weapons_development: 'weapon',
shield_tech: 'shield',
armour_innovation: 'armour',
energy_innovation: 'energy',
combustive_engine: 'combustion',
thrust_propulsion: 'thrust',
warp_drive: 'warp',
spacetime_warp: 'spacetime',
beam_technology: 'beam',
ion_systems: 'ion',
plasma_engineering: 'plasma',
};
13 changes: 10 additions & 3 deletions packages/testnet/frontend/src/shared/utils/Formulas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,25 @@ function calculateCost(
return { steel, quartz, tritium };
}

const UNI_SPEED = 5;
// Functions grouped in a single object
export const CompoundsFormulas = {
steelProduction(level: number) {
return Math.round(30 * level * Math.pow(GROWTH_FACTOR_LINEAR, level));
return (
Math.round(30 * level * Math.pow(GROWTH_FACTOR_LINEAR, level)) * UNI_SPEED
);
},

quartzProduction(level: number) {
return Math.round(20 * level * Math.pow(GROWTH_FACTOR_LINEAR, level));
return (
Math.round(20 * level * Math.pow(GROWTH_FACTOR_LINEAR, level)) * UNI_SPEED
);
},

tritiumProduction(level: number) {
return Math.round(10 * level * Math.pow(GROWTH_FACTOR_LINEAR, level));
return (
Math.round(10 * level * Math.pow(GROWTH_FACTOR_LINEAR, level)) * UNI_SPEED
);
},

energyProduction(level: number) {
Expand Down

0 comments on commit 4c8d3b8

Please sign in to comment.