Complete overhaul of code structure and relevant files (#639)
This commit is contained in:
17
src/Sim/SimulationData/SimWin.js
Normal file
17
src/Sim/SimulationData/SimWin.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { SimAchievements, SimAchievementsOwned } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function "wins" an achievement in the current sim data
|
||||
* It functions similarly to Game.Win()
|
||||
* It is not created by CM.Sim.CreateSimFunctions() in order to avoid spamming pop-ups upon winning
|
||||
* @param {string} what Name of the achievement
|
||||
*/
|
||||
export default function SimWin(what) {
|
||||
if (SimAchievements[what]) {
|
||||
if (SimAchievements[what].won === 0) {
|
||||
SimAchievements[what].won = 1;
|
||||
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user