diff --git a/package-lock.json b/package-lock.json
index 20f6dc9..d8d12ab 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -25,7 +25,6 @@
"nanoevents": "^6.0.2",
"semver": "^7.3.8",
"socket.io-client": "^4.6.0",
- "unique-names-generator": "^4.7.1",
"vite": "^2.9.12",
"vite-plugin-pwa": "^0.12.0",
"vite-tsconfig-paths": "^3.5.0",
@@ -7134,14 +7133,6 @@
"node": ">=4"
}
},
- "node_modules/unique-names-generator": {
- "version": "4.7.1",
- "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz",
- "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/unique-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz",
@@ -13131,11 +13122,6 @@
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz",
"integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ=="
},
- "unique-names-generator": {
- "version": "4.7.1",
- "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz",
- "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow=="
- },
"unique-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz",
diff --git a/package.json b/package.json
index 8f2946f..5874d52 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,6 @@
"nanoevents": "^6.0.2",
"semver": "^7.3.8",
"socket.io-client": "^4.6.0",
- "unique-names-generator": "^4.7.1",
"vite": "^2.9.12",
"vite-plugin-pwa": "^0.12.0",
"vite-tsconfig-paths": "^3.5.0",
diff --git a/src/components/Nav.vue b/src/components/Nav.vue
index b265635..d9a2478 100644
--- a/src/components/Nav.vue
+++ b/src/components/Nav.vue
@@ -36,11 +36,6 @@
info
-
-
- library_books
-
-
settings
@@ -53,11 +48,6 @@
v{{ versionNumber }}
-
-
- library_books
-
-
settings
diff --git a/src/components/Options.vue b/src/components/Options.vue
index 93b57fa..6fcca33 100644
--- a/src/components/Options.vue
+++ b/src/components/Options.vue
@@ -16,10 +16,10 @@
Manually save
+
-
diff --git a/src/data/CharacterSlot.vue b/src/data/CharacterSlot.vue
new file mode 100644
index 0000000..e2a5c3a
--- /dev/null
+++ b/src/data/CharacterSlot.vue
@@ -0,0 +1,40 @@
+
+
+ {{ character?.type }}
+
+
+
+
+
+
diff --git a/src/data/layers/prestige.tsx b/src/data/layers/prestige.tsx
deleted file mode 100644
index 4490ded..0000000
--- a/src/data/layers/prestige.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @module
- * @hidden
- */
-import { main } from "data/projEntry";
-import { createCumulativeConversion, createPolynomialScaling } from "features/conversion";
-import { jsx } from "features/feature";
-import { createHotkey } from "features/hotkey";
-import { createReset } from "features/reset";
-import MainDisplay from "features/resources/MainDisplay.vue";
-import { createResource } from "features/resources/resource";
-import { addTooltip } from "features/tooltips/tooltip";
-import { createResourceTooltip } from "features/trees/tree";
-import { BaseLayer, createLayer } from "game/layers";
-import type { DecimalSource } from "util/bignum";
-import { render } from "util/vue";
-import { createLayerTreeNode, createResetButton } from "../common";
-
-const id = "p";
-const layer = createLayer(id, function (this: BaseLayer) {
- const name = "Prestige";
- const color = "#4BDC13";
- const points = createResource(0, "prestige points");
-
- const conversion = createCumulativeConversion(() => ({
- scaling: createPolynomialScaling(10, 0.5),
- baseResource: main.points,
- gainResource: points,
- roundUpCost: true
- }));
-
- const reset = createReset(() => ({
- thingsToReset: (): Record[] => [layer]
- }));
-
- const treeNode = createLayerTreeNode(() => ({
- layerID: id,
- color,
- reset
- }));
- addTooltip(treeNode, {
- display: createResourceTooltip(points),
- pinnable: true
- });
-
- const resetButton = createResetButton(() => ({
- conversion,
- tree: main.tree,
- treeNode
- }));
-
- const hotkey = createHotkey(() => ({
- description: "Reset for prestige points",
- key: "p",
- onPress: resetButton.onClick
- }));
-
- return {
- name,
- color,
- points,
- display: jsx(() => (
- <>
-
- {render(resetButton)}
- >
- )),
- treeNode,
- hotkey
- };
-});
-
-export default layer;
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index e4640b6..c534665 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -1,75 +1,93 @@
+import Row from "components/layout/Row.vue";
import Spacer from "components/layout/Spacer.vue";
import { jsx } from "features/feature";
-import { createResource, trackBest, trackOOMPS, trackTotal } from "features/resources/resource";
-import type { GenericTree } from "features/trees/tree";
-import { branchedResetPropagation, createTree } from "features/trees/tree";
-import { globalBus } from "game/events";
import type { BaseLayer, GenericLayer } from "game/layers";
import { createLayer } from "game/layers";
import type { Player } from "game/player";
-import player from "game/player";
-import type { DecimalSource } from "util/bignum";
-import Decimal, { format, formatTime } from "util/bignum";
-import { render } from "util/vue";
-import { computed, toRaw } from "vue";
-import prestige from "./layers/prestige";
+import { computed, ref } from "vue";
+import CharacterSlot from "./CharacterSlot.vue";
+import "./socket";
+import { nickname } from "./socket";
+
+export const characters: Record = {
+ coots: {
+ nickname: "Coots Prime",
+ initialRelevancy: 1
+ },
+ ludwig: {
+ nickname: "Ludwig",
+ initialRelevancy: 1
+ },
+ qt: {
+ nickname: "QtCinderella",
+ initialRelevancy: 1
+ },
+ ders: {
+ nickname: "Ders",
+ initialRelevancy: 1
+ },
+ slime: {
+ nickname: "Slime",
+ initialRelevancy: 1
+ },
+ stanz: {
+ nickname: "Stanz",
+ initialRelevancy: 1
+ },
+ beast: {
+ nickname: "Mr.Beast",
+ initialRelevancy: 1
+ },
+ car: {
+ nickname: "Red Car",
+ initialRelevancy: 1
+ }
+};
/**
* @hidden
*/
export const main = createLayer("main", function (this: BaseLayer) {
- const points = createResource(10);
- const best = trackBest(points);
- const total = trackTotal(points);
-
- const pointGain = computed(() => {
- // eslint-disable-next-line prefer-const
- let gain = new Decimal(1);
- return gain;
- });
- globalBus.on("update", diff => {
- points.value = Decimal.add(points.value, Decimal.times(pointGain.value, diff));
- });
- const oomps = trackOOMPS(points, pointGain);
-
- const tree = createTree(() => ({
- nodes: [[prestige.treeNode]],
- branches: [],
- onReset() {
- points.value = toRaw(this.resettingNode.value) === toRaw(prestige.treeNode) ? 0 : 10;
- best.value = points.value;
- total.value = points.value;
- },
- resetPropagation: branchedResetPropagation
- })) as GenericTree;
+ const lives = ref(3);
+ const wins = ref(0);
+ const turn = ref(0);
+ const team = ref([]);
+ const shop = ref([]);
return {
- name: "Tree",
- links: tree.links,
+ name: "Game",
+ minimizable: false,
display: jsx(() => (
- <>
- {player.devSpeed === 0 ? Game Paused
: null}
- {player.devSpeed != null && player.devSpeed !== 0 && player.devSpeed !== 1 ? (
- Dev Speed: {format(player.devSpeed)}x
- ) : null}
- {player.offlineTime != null && player.offlineTime !== 0 ? (
- Offline Time: {formatTime(player.offlineTime)}
- ) : null}
-
- {Decimal.lt(points.value, "1e1000") ? You have : null}
-
{format(points.value)}
- {Decimal.lt(points.value, "1e1e6") ? points : null}
-
- {Decimal.gt(pointGain.value, 0) ? ({oomps.value})
: null}
+
+
{nickname.value}
+
+
+
+
+
+
+
+
+ {shop.value.map(item => (
+ console.log(item)}
+ />
+ ))}
+
- {render(tree)}
- >
+
+
)),
- points,
- best,
- total,
- oomps,
- tree
+ lives,
+ wins,
+ turn,
+ team,
+ shop
};
});
@@ -80,7 +98,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
export const getInitialLayers = (
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
player: Partial
-): Array => [main, prestige];
+): Array => [main];
/**
* A computed ref whose value is true whenever the game is over.
diff --git a/src/data/projInfo.json b/src/data/projInfo.json
index b32ef22..8fd6e13 100644
--- a/src/data/projInfo.json
+++ b/src/data/projInfo.json
@@ -1,17 +1,17 @@
{
"$schema": "./projInfo-schema.json",
- "title": "Profectus",
+ "title": "Super Auto Coots",
"description": "A project made in Profectus",
- "id": "",
- "author": "",
+ "id": "superautocoots",
+ "author": "thepaperpilot and crea",
"discordName": "",
"discordLink": "",
- "versionNumber": "0.0",
+ "versionNumber": "0.0.0",
"versionTitle": "Initial Commit",
- "allowGoBack": true,
+ "allowGoBack": false,
"defaultShowSmall": false,
"defaultDecimalsShown": 2,
"useHeader": true,
diff --git a/src/data/socket.tsx b/src/data/socket.tsx
new file mode 100644
index 0000000..e9952b6
--- /dev/null
+++ b/src/data/socket.tsx
@@ -0,0 +1,110 @@
+import Text from "components/fields/Text.vue";
+import projInfo from "data/projInfo.json";
+import { jsx, setDefault } from "features/feature";
+import { globalBus } from "game/events";
+import { registerSettingField } from "game/settings";
+import satisfies from "semver/functions/satisfies";
+import { io, Socket } from "socket.io-client";
+import { ref, watch } from "vue";
+import { useToast } from "vue-toastification";
+import { main } from "./projEntry";
+
+export const connected = ref(false);
+export const nickname = ref("");
+
+const toast = useToast();
+
+const socket = ref | null>();
+const connectionError = ref("");
+
+export function emit(
+ event: T,
+ ...args: Parameters
+): void {
+ if (!connected.value) {
+ return;
+ }
+ socket.value?.emit(event, ...args);
+}
+
+globalBus.on("loadSettings", settings => {
+ setDefault(settings, "server", "https://Super-Auto-Coots.thepaperpilot.repl.co");
+
+ watch(
+ () => settings.server,
+ server => {
+ if (socket.value) {
+ socket.value.close();
+ }
+
+ socket.value = io(server);
+ setupSocket(socket.value);
+
+ connected.value = false;
+ connectionError.value = "";
+ socket.value.connect();
+ },
+ { immediate: true }
+ );
+
+ registerSettingField(
+ jsx(() => (
+ <>
+ (settings.server = value)}
+ modelValue={settings.server}
+ />
+
+ {connected.value ? (
+ Connected!
+ ) : connectionError.value ? (
+ {connectionError.value}
+ ) : (
+ Connecting...
+ )}
+
+ >
+ ))
+ );
+});
+
+function setupSocket(socket: Socket) {
+ socket.on("connect", () => {
+ connectionError.value = "";
+ connected.value = true;
+ });
+ socket.on("connect_error", error => {
+ connectionError.value = `${error.name}: ${error.message}`;
+ });
+ socket.on("disconnect", (reason, details) => {
+ connectionError.value =
+ details instanceof Error
+ ? `${details.name}: ${details.message}`
+ : details?.description ?? reason;
+ connected.value = false;
+ });
+ socket.on("server version", semver => {
+ if (!satisfies(projInfo.versionNumber, semver)) {
+ toast.info("Server only accepts game versions in range: " + semver);
+ socket.disconnect();
+ }
+ });
+
+ socket.on("info", message => {
+ toast.info(message);
+ });
+ socket.on("nickname", nick => {
+ nickname.value = nick;
+ });
+
+ socket.on("shop", shop => {
+ main.shop.value = shop;
+ });
+}
+
+declare module "game/settings" {
+ interface Settings {
+ server: string;
+ }
+}
diff --git a/src/data/types.d.ts b/src/data/types.d.ts
new file mode 100644
index 0000000..29dfa82
--- /dev/null
+++ b/src/data/types.d.ts
@@ -0,0 +1,18 @@
+interface CharacterInfo {
+ nickname: string;
+ initialRelevancy: number;
+}
+
+interface Character {
+ type: string;
+ relevancy: number;
+}
+
+interface ServerToClientEvents {
+ "server version": (semver: string) => void;
+ nickname: (nickname: string) => void;
+ info: (message: string) => void;
+ shop: (shop: string[]) => void;
+}
+
+interface ClientToServerEvents {}