1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-06-08 13:52:11 +00:00

ru:: save gameseed

This commit is contained in:
Zeno Rogue
2026-03-15 16:11:17 +01:00
parent 94ae80937e
commit f8308b6b3a
4 changed files with 5 additions and 2 deletions
+1
View File
@@ -393,6 +393,7 @@ struct man : public entity {
int last_action;
int gameseed;
int experience;
stat profession;
string backstory;
+2 -1
View File
@@ -65,7 +65,8 @@ void man::hs(stater& s) {
.act("attack_when", attack_when, 0)
.act("on_floor_when", on_floor_when, 0)
.act("xp", experience, 0)
.act("last_action", last_action, 0);
.act("last_action", last_action, 0)
.act("gameseed", gameseed, 0);
sact(s1, "hair", hair);
sact(s1, "eyes", eye);
string z = unspace(backstory);
+1 -1
View File
@@ -54,7 +54,7 @@ power& power::be_armor(const vector<vector<string>>& v) {
get_desc = [this, gd, v] () -> string {
auto desc = gd();
std::mt19937 armorgen;
armorgen.seed(statseed ^ v[0][0][0] ^ (v[1][0][0] << 8));
armorgen.seed(m.gameseed ^ v[0][0][0] ^ (v[1][0][0] << 8));
println(hlog, "after armorgen");
vector<int> qty(v.size(), 0);
for(int i=0; i<qty_filled; i++) {
+1
View File
@@ -68,6 +68,7 @@ void randomize_stats() {
void generate_character() {
statseed = time(NULL);
m.gameseed = statseed;
randomize_stories();
randomize_stats();
}