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:
@@ -393,6 +393,7 @@ struct man : public entity {
|
||||
|
||||
int last_action;
|
||||
|
||||
int gameseed;
|
||||
int experience;
|
||||
stat profession;
|
||||
string backstory;
|
||||
|
||||
+2
-1
@@ -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);
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -68,6 +68,7 @@ void randomize_stats() {
|
||||
|
||||
void generate_character() {
|
||||
statseed = time(NULL);
|
||||
m.gameseed = statseed;
|
||||
randomize_stories();
|
||||
randomize_stats();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user