Use DNA (not tested)

This commit is contained in:
Eric Fredricksen
2010-07-06 00:34:27 -07:00
parent 8b04760309
commit f597f85ff9
2 changed files with 8 additions and 21 deletions
+7 -21
View File
@@ -1,6 +1,7 @@
// Copyright (c)2002-2010 Eric Fredricksen <e@fredricksen.net> all rights reserved // Copyright (c)2002-2010 Eric Fredricksen <e@fredricksen.net> all rights reserved
// TODO: All these Hints // TODO: All these Hints
// TODO: Test use of seed as DNA
// revs: // revs:
// 6: pq 6.3/web // 6: pq 6.3/web
@@ -791,31 +792,14 @@ function CompleteAct() {
function Log(line) { function Log(line) {
/* TODO if (game.log)
if (FLogEvents) { game.log[+new Date()] = line;
var logname = ChangeFileExt(GameSaveName(), '.log'); // TODO: and now what?
DateTimeToString(stamp, '[yyyy-mm-dd hh:nn:ss]', Now);
AssignFile(log, logname);
if (FileExists(logname)) Append(log); else Rewrite(log);
WriteLn(log, stamp + ' ' + line);
Flush(log);
CloseFile(log);
}
*/
}
function ExportCharSheet() {
/* TODO
AssignFile(f, ChangeFileExt(GameSaveName(), '.sheet'));
Rewrite(f);
Write(f, CharSheet());
Flush(f);
CloseFile(f);
*/
} }
function CharSheet() { function CharSheet() {
return template("sheet", game); return template("sheet", game);
// TODO: make this a separate page
} }
@@ -1137,11 +1121,13 @@ function SaveGame() {
HotOrNot(); HotOrNot();
game.date = ''+new Date(); game.date = ''+new Date();
game.stamp = +new Date(); game.stamp = +new Date();
game.seed = randseed();
return addToRoster(game); return addToRoster(game);
} }
function LoadGame(sheet) { function LoadGame(sheet) {
game = sheet; game = sheet;
randseed(game.seed);
$.each(AllBars.concat(AllLists), function (i, e) { e.load(game); }); $.each(AllBars.concat(AllLists), function (i, e) { e.load(game); });
Kill.text(game.kill); Kill.text(game.kill);
ClearAllSelections(); ClearAllSelections();
+1
View File
@@ -142,6 +142,7 @@ function sold() {
name: $("#Name").val(), name: $("#Name").val(),
race: $("input:radio[name=Race]:checked").val(), race: $("input:radio[name=Race]:checked").val(),
'class': $("input:radio[name=Class]:checked").val(), 'class': $("input:radio[name=Class]:checked").val(),
dna: stats.seed,
seed: stats.seed, seed: stats.seed,
birthday: ''+new Date(), birthday: ''+new Date(),
birthstamp: +new Date(); birthstamp: +new Date();