Skip to content

Commit

Permalink
v0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jwklong committed Feb 14, 2022
1 parent 66b4837 commit 5035a5a
Show file tree
Hide file tree
Showing 18 changed files with 119 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ωEngine v0.2.1
# ωEngine v0.2.2
### A engine made from Ω-Lλγers built for making mods
#### <a href='https://veprogames.github.io/omega-layers'>Ω-Lλγers</a> (the original) by VeproGames
#### Play the engine <a href='https://jwklong.github.io/omega-engine'>now</a>
Expand Down
32 changes: 31 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ header nav button{
font-size: 110%;
}

header .omega{
.omega{
color: var(--color-primary);
}

Expand Down Expand Up @@ -164,6 +164,36 @@ img.inline{
font-size: 3vh;
}

#endgame{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: var(--background-body);
z-index: 1000;
text-align: center;

transition: opacity 2000ms;
}

#endgame > * {
position: absolute;
transform: translateX(-50%);
left: 50%;
}

#endgame h2{
top: 20%;
font-size: 10vh;
width: 100%;
}

#endgame p{
top: 50%;
font-size: 3vh;
}

/*Layer Navigation*/

div.layer-navigation{
Expand Down
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ <h2 id="superImportantTitle"><span class="omega">ω</span>Engine</h2>
<changelog-tab v-if="settings.tab === 'Changelog'"></changelog-tab>
<engine-tab v-if="settings.tab === 'Engine Changelog'"></engine-tab>
<debug-tab v-if="settings.tab === 'Debug'"></debug-tab>
<endgame-tab v-if="settings.tab === 'Endgame'"></endgame-tab>
</main>
<footer>
<div>
Expand Down Expand Up @@ -101,7 +102,7 @@ <h2 id="superImportantTitle"><span class="omega">ω</span>Engine</h2>
<script src="js/mod.js"></script>

<script src="js/debug/test.js"></script>
<script src="js/debug/test2.js"></script>
<script src="js/debug/TabTesting.js"></script>

<script src="js/classes/generator.js"></script>
<script src="js/classes/powergenerator.js"></script>
Expand Down Expand Up @@ -153,9 +154,11 @@ <h2 id="superImportantTitle"><span class="omega">ω</span>Engine</h2>
<script src="js/components/changelog-tab.js"></script>
<script src="js/components/engine-tab.js"></script>
<script src="js/components/debug-tab.js"></script>
<script src="js/components/endgame-tab.js"></script>

<script src="js/data/functions.js"></script>
<script src="js/data/computed.js"></script>
<script src="js/data/temp.js"></script>
<script src="js/data/game.js"></script>

<script src="js/main.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion js/classes/challenge.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const CHALLENGE_EFFECT_UPGRADESTRENGTH_SIMPLEBOOST = 0, CHALLENGE_EFFECT_PRICES_POWER = 1, CHALLENGE_EFFECT_GENMULTI = 2,
CHALLENGE_EFFECT_PRESTIGEREWARD = 3;
const CHALLENGE_REWARD_POWERGENERATORS = 0, CHALLENGE_REWARD_GENMULTI = 1, CHALLENGE_REWARD_PRESTIGEREWARD = 2,
CHALLENGE_REWARD_GENMULTI_ABS = 3;
CHALLENGE_REWARD_GENMULTI_ABS = 3, CHALLENGE_REWARD_RESTACK = 4;

class Challenge
{
Expand Down Expand Up @@ -60,6 +60,8 @@ class Challenge
return "Prestige Reward of Layer " + PrestigeLayer.getNameForLayer(this.cfg.layerid) + " is x" + functions.formatNumber(this.applyReward(), 2, 2) + " higher";
case CHALLENGE_REWARD_GENMULTI_ABS:
return "All Alpha Generators are x" + functions.formatNumber(this.applyReward(), 2, 2) + " stronger";
case CHALLENGE_REWARD_RESTACK:
return "Restack gain is multiplied by x" + functions.formatNumber(this.applyReward(), 2, 2);
default:
return "A Cake."
}
Expand Down
15 changes: 10 additions & 5 deletions js/classes/featureunlockmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FeatureUnlockManager

static getUpgradeTypes(layer)
{
const upgTypes = [UPGRADE_RESOURCE, UPGRADE_GENERATOR];
var upgTypes = [UPGRADE_RESOURCE, UPGRADE_GENERATOR];
if(layer >= 1 && layer < 8)
{
upgTypes.push(UPGRADE_GENMULTI);
Expand All @@ -46,11 +46,16 @@ class FeatureUnlockManager

static getChallengeRewardTypes(layer)
{
if(layer >= 4)
{
return [CHALLENGE_REWARD_POWERGENERATORS, CHALLENGE_REWARD_GENMULTI_ABS, CHALLENGE_REWARD_PRESTIGEREWARD];
var rewardTypes = [CHALLENGE_REWARD_POWERGENERATORS, CHALLENGE_REWARD_PRESTIGEREWARD];
if(layer >= 4) {
rewardTypes.push(CHALLENGE_REWARD_GENMULTI_ABS)
} else {
rewardTypes.push(CHALLENGE_REWARD_GENMULTI)
}
if(layer >= 9) {
rewardTypes.push(CHALLENGE_REWARD_RESTACK)
}
return [CHALLENGE_REWARD_POWERGENERATORS, CHALLENGE_REWARD_GENMULTI, CHALLENGE_REWARD_PRESTIGEREWARD];
return rewardTypes
}

static getUpgradeTreeTypes(layer)
Expand Down
7 changes: 7 additions & 0 deletions js/classes/prestigelayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ class PrestigeLayer
return Decimal.pow(10, baseLog.mul(level));
}
break;
case CHALLENGE_REWARD_RESTACK:
const randomthing = rand.nextDouble()*this.layer
formula_reward = function(level)
{
return new Decimal(1+((0.02*randomthing)*level))
}
break;
default:
return;
}
Expand Down
15 changes: 13 additions & 2 deletions js/classes/restacklayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,18 @@ class ReStackLayer
getRestackGain()
{
const l = game.metaLayer.active ? game.metaLayer.layer : new Decimal(game.layers.length - 1);
return l >= 9 ? Decimal.pow(10, l.sub(9).floor()) : new Decimal(0);
let gain = l >= 9 ? Decimal.pow(10, l.sub(9).floor()) : new Decimal(0);
if (!game.metaLayer.active) {
for (const layer of game.layers) {
if (layer.hasChallenges() && layer.layer >= 9) {
for(const c of layer.challenges.filter(ch => ch.rewardType === CHALLENGE_REWARD_RESTACK))
{
gain = gain.mul(c.applyReward());
}
}
}
}
return gain
}

allPermUpgradesBought()
Expand Down Expand Up @@ -253,7 +264,7 @@ class ReStackLayer
game.layers = [];
functions.generateLayer(0);
game.currentLayer = game.layers[0];
if(this.upgradeTreeNames.noReset.apply() === "Resets") {
if(this.upgradeTreeNames.noReset.level == 0) {
this.timeSpent = 0;
}
if(game.metaLayer.active)
Expand Down
17 changes: 17 additions & 0 deletions js/components/endgame-tab.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Vue.component("endgame-tab", {
computed: {
timeSpent: function() {
time = game.timeSpent;
formattedTime = functions.formatTime(time)
return formattedTime
},
},
methods: {
hardResetGame: () => functions.hardResetGame(),
},
template: `<div id="endgame">
<h2><span class="omega">You</span> Win!</h2>
<p>You beat the game in <span class="omega">{{timeSpent}}</span><br>
<button onclick="game.settings.tab = 'Layers'">Continue</button> <button @click="hardResetGame()">Wipe Game</button></p>
</div>`
})
5 changes: 5 additions & 0 deletions js/components/engine-tab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Vue.component("engine-tab", {
template: `<div class="changelog-tab">
<guide-item>
<template v-slot:title>v0.2.2</template>
<template v-slot:text>Challenges can now give a restack reward and endgame menu added!
</template>
</guide-item>
<guide-item>
<template v-slot:title>v0.2.1</template>
<template v-slot:text>All buttons menu in debug mode, new random layer names and 4th infinity!
</template>
Expand Down
3 changes: 3 additions & 0 deletions js/data/computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const computed = {
case "Debug":
category = "Settings";
break;
default:
category = "Unknown";
break;
}
return category
},
Expand Down
1 change: 1 addition & 0 deletions js/data/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ const functions = {
functions.generateLayer(0);
functions.loadGame(initialGame);
game.currentLayer = game.layers[0];
game.settings.tab = "Layers"
},
hslToHex: function(h, s, l) {
l /= 100;
Expand Down
2 changes: 1 addition & 1 deletion js/data/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ const game = {
font: mod.fonts[0][1],
saveInfo: "i have no idea"
},
console: console
isEndgame: false //this.metaLayer.layer.gte(Infinities[0])
};
const initialGame = functions.getSaveString();
3 changes: 3 additions & 0 deletions js/data/temp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var temp = {
endgameOverride: false
}
6 changes: 6 additions & 0 deletions js/debug/TabTesting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mod.debugClasses.push(new DebugClass("Tab Testing", "Test some tabs!", "0.1", [
[
"Test Endgame Tab",
'game.settings.tab = "Endgame"'
]
]))
6 changes: 5 additions & 1 deletion js/debug/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ mod.debugClasses.push(new DebugClass("test.js", "test", "0.0.0", [
[
"test button 2",
'console.warn("too many test buttons")'
]
],
[
"test button 3",
'console.error("test overload!!!")'
],
]))
6 changes: 0 additions & 6 deletions js/debug/test2.js

This file was deleted.

5 changes: 5 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ function tickGame(seconds)
saveTimer += seconds;
localTimer += seconds;

if (game.isEndgame && !temp.endgameOverride) {
game.settings.tab = "Endgame"
temp.endgameOverride = true
}

let titleInfo = "";
switch(game.settings.titleStyle)
{
Expand Down
8 changes: 4 additions & 4 deletions js/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var mod = {
primaryName: "ω",
secondaryName: "Engine",
version: "1.0.0",
engineVer: "0.2.1", //DO NOT MODIFY
engineVer: "0.2.2", //DO NOT MODIFY
debugMode: true,
themes: [
["Dark", "css/themes/dark.css"],
Expand Down Expand Up @@ -39,9 +39,9 @@ var mod = {
]],
["Random",
[
Utils.createRandomWord(10),
Utils.createRandomWord(10),
[Utils.createRandomWord(2),Utils.createRandomWord(3),Utils.createRandomWord(4),Utils.createRandomWord(5)]
Utils.createRandomWord(10, new Random(Date.now()).nextInt()),
Utils.createRandomWord(10, new Random(Math.floor(Date.now()/2)).nextInt()),
[Utils.createRandomWord(2, new Random(Math.floor(Date.now()/3)).nextInt()),Utils.createRandomWord(3, new Random(Math.floor(Date.now()/4)).nextInt()),Utils.createRandomWord(4, new Random(Math.floor(Date.now()/5)).nextInt()),Utils.createRandomWord(5, new Random(Math.floor(Date.now()/6)).nextInt())]
]]
],
fonts: [
Expand Down

0 comments on commit 5035a5a

Please sign in to comment.