mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2025-07-18 01:53:53 +08:00
update daily
This commit is contained in:
30
src/index.js
30
src/index.js
@@ -1,6 +1,24 @@
|
||||
import App from './app.js';
|
||||
import Life from './modules/life.js';
|
||||
|
||||
globalThis.$$eventMap = new Map();
|
||||
globalThis.$$event = (tag, data) => {
|
||||
const listener = $$eventMap.get(tag);
|
||||
if(listener) listener.forEach(fn=>fn(data));
|
||||
}
|
||||
globalThis.$$on = (tag, fn) => {
|
||||
let listener = $$eventMap.get(tag);
|
||||
if(!listener) {
|
||||
listener = new Set();
|
||||
$$eventMap.set(tag, listener);
|
||||
}
|
||||
listener.add(fn);
|
||||
}
|
||||
globalThis.$$off = (tag, fn) => {
|
||||
const listener = $$eventMap.get(tag);
|
||||
if(listener) listener.delete(fn);
|
||||
}
|
||||
|
||||
const core = new Life();
|
||||
const game = new App();
|
||||
globalThis.core = core;
|
||||
@@ -12,4 +30,16 @@ location.search.substr(1).split('&').forEach(item => {
|
||||
query[parts[0]] = parts[1];
|
||||
});
|
||||
|
||||
core.config({
|
||||
defaultPropertyPoints: 20, // default number of points for a property
|
||||
talentSelectLimit: 3, // max number of talents that can be selected
|
||||
propertyAllocateLimit: [0, 10], // scoop of properties that can be allocated
|
||||
talentConfig: { // config for talent
|
||||
talentPullCount: 10, // number of talents to pull from the talent pool
|
||||
talentRate: { 1:100, 2:10, 3:1, total: 1000 }, // rate of talent pull
|
||||
},
|
||||
defaultPropertys: {
|
||||
SPR: 5,
|
||||
}
|
||||
})
|
||||
game.start(query);
|
||||
|
Reference in New Issue
Block a user