just testy things
parent
30d50188ec
commit
ecacb25bd7
|
|
@ -9,13 +9,3 @@ restore {
|
||||||
this.nitrogen ??= Math.floor(Math.random() * 50);
|
this.nitrogen ??= Math.floor(Math.random() * 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
async takeNitrogen (requested) {
|
|
||||||
// give as much nutrients as we can!
|
|
||||||
const given = Math.max(this.nitrogen, requested);
|
|
||||||
this.nitrogen -= given;
|
|
||||||
return given;
|
|
||||||
}
|
|
||||||
|
|
||||||
ping {
|
|
||||||
return new Date().getTime();
|
|
||||||
}
|
|
||||||
|
|
@ -6,5 +6,7 @@ async restore {
|
||||||
console.log('~ Welcome to Vogue ~');
|
console.log('~ Welcome to Vogue ~');
|
||||||
// process.stdout.write(JSON.stringify(console, null, 2))
|
// process.stdout.write(JSON.stringify(console, null, 2))
|
||||||
this.currentSave ??= create('world', {});
|
this.currentSave ??= create('world', {});
|
||||||
const choice = await console.choice('select a thing', ['a', 'b', 'c', 'd']);
|
// const choice = await console.choice('select a thing', ['a', 'b', 'c', 'd']);
|
||||||
|
|
||||||
|
await this.currentSave.render();
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.1",
|
"chalk": "^4.1.1",
|
||||||
|
"random-world": "^1.2.1",
|
||||||
"signale": "^1.4.0",
|
"signale": "^1.4.0",
|
||||||
"sisteransi": "^1.0.5",
|
"sisteransi": "^1.0.5",
|
||||||
"terminal-kit": "^2.1.2"
|
"terminal-kit": "^2.1.2"
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,4 @@ required link land;
|
||||||
restore {
|
restore {
|
||||||
alive ??= true;
|
alive ??= true;
|
||||||
age ??= 0;
|
age ??= 0;
|
||||||
}
|
|
||||||
|
|
||||||
tick (days) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
22
test/world.v
22
test/world.v
|
|
@ -2,17 +2,23 @@ link[] places;
|
||||||
link place;
|
link place;
|
||||||
link character;
|
link character;
|
||||||
|
|
||||||
|
import random from 'random-world';
|
||||||
|
|
||||||
restore {
|
restore {
|
||||||
if(this.places.empty) {
|
if(this.places.empty) {
|
||||||
for(let i = 0; i < 3; i ++) {
|
for(let i = 0; i < 10; i ++) {
|
||||||
const place = create('places.forest', {
|
const name = random.city();
|
||||||
world: this
|
if(name.indexOf(' ') > -1) {
|
||||||
});
|
i --;
|
||||||
this.places.push(place);
|
continue;
|
||||||
|
}
|
||||||
|
console.log(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(const place of this.places) {
|
character ??= create('')
|
||||||
console.log(place.ping());
|
}
|
||||||
}
|
|
||||||
|
async render() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -164,6 +164,11 @@ locate-path@^2.0.0:
|
||||||
p-locate "^2.0.0"
|
p-locate "^2.0.0"
|
||||||
path-exists "^3.0.0"
|
path-exists "^3.0.0"
|
||||||
|
|
||||||
|
moment@^2.11.2:
|
||||||
|
version "2.29.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
|
||||||
|
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
|
||||||
|
|
||||||
ndarray-pack@^1.1.1:
|
ndarray-pack@^1.1.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.npmjs.org/ndarray-pack/-/ndarray-pack-1.2.1.tgz"
|
resolved "https://registry.npmjs.org/ndarray-pack/-/ndarray-pack-1.2.1.tgz"
|
||||||
|
|
@ -236,6 +241,21 @@ pngjs@^5.0.0:
|
||||||
version "5.0.0"
|
version "5.0.0"
|
||||||
resolved "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz"
|
resolved "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz"
|
||||||
|
|
||||||
|
random-world@^1.2.1:
|
||||||
|
version "1.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/random-world/-/random-world-1.2.1.tgz#aca953a169dc5ffa455a2bc39d7ee81da6f12480"
|
||||||
|
integrity sha1-rKlToWncX/pFWivDnX7oHabxJIA=
|
||||||
|
dependencies:
|
||||||
|
moment "^2.11.2"
|
||||||
|
seedrandom "^2.4.2"
|
||||||
|
underscore "^1.8.3"
|
||||||
|
uuid "^3.0.1"
|
||||||
|
|
||||||
|
seedrandom@^2.4.2:
|
||||||
|
version "2.4.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-2.4.4.tgz#b25ea98632c73e45f58b77cfaa931678df01f9ba"
|
||||||
|
integrity sha512-9A+PDmgm+2du77B5i0Ip2cxOqqHjgNxnBgglxLcX78A2D6c2rTo61z4jnVABpF4cKeDMDG+cmXXvdnqse2VqMA==
|
||||||
|
|
||||||
setimmediate@^1.0.5:
|
setimmediate@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz"
|
resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz"
|
||||||
|
|
@ -305,10 +325,20 @@ tree-kit@^0.7.0:
|
||||||
version "0.7.0"
|
version "0.7.0"
|
||||||
resolved "https://registry.npmjs.org/tree-kit/-/tree-kit-0.7.0.tgz"
|
resolved "https://registry.npmjs.org/tree-kit/-/tree-kit-0.7.0.tgz"
|
||||||
|
|
||||||
|
underscore@^1.8.3:
|
||||||
|
version "1.13.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1"
|
||||||
|
integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==
|
||||||
|
|
||||||
uniq@^1.0.0:
|
uniq@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz"
|
resolved "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz"
|
||||||
|
|
||||||
|
uuid@^3.0.1:
|
||||||
|
version "3.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
||||||
|
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
||||||
|
|
||||||
which@^2.0.1:
|
which@^2.0.1:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz"
|
resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz"
|
||||||
|
|
|
||||||
Reference in New Issue