1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-31 19:36:16 +00:00

dual:: shmup

This commit is contained in:
Zeno Rogue 2019-05-29 20:20:52 +02:00
parent 7affa0c07f
commit 182df69535
2 changed files with 19 additions and 0 deletions

View File

@ -21,6 +21,7 @@ void gamedata_all(gamedata& gd) {
gd.store(sightrange_bonus); gd.store(sightrange_bonus);
gd.store(genrange_bonus); gd.store(genrange_bonus);
gd.store(gamerange_bonus); gd.store(gamerange_bonus);
gd.store(targets);
if(GOLDBERG) gd.store(gp::param); if(GOLDBERG) gd.store(gp::param);
callhooks(hooks_gamedata, &gd); callhooks(hooks_gamedata, &gd);
} }

View File

@ -3767,6 +3767,23 @@ void clearMemory() {
for(int i=0; i<MAXPLAYER; i++) pc[i] = NULL; for(int i=0; i<MAXPLAYER; i++) pc[i] = NULL;
} }
void gamedata(hr::gamedata* gd) {
if(shmup::on) {
for(int i=0; i<MAXPLAYER; i++) gd->store(pc[i]);
gd->store(nextmove);
gd->store(curtime);
gd->store(nextdragon);
gd->store(visibleAt);
gd->store(traplist);
gd->store(monstersAt);
gd->store(active);
gd->store(mousetarget);
gd->store(lmousetarget);
gd->store(nonvirtual);
gd->store(additional);
}
}
cell *playerpos(int i) { cell *playerpos(int i) {
if(!pc[i]) return NULL; if(!pc[i]) return NULL;
return pc[i]->base; return pc[i]->base;
@ -3798,6 +3815,7 @@ void addShmupHelp(string& out) {
} }
auto hooks = addHook(clearmemory, 0, shmup::clearMemory) + auto hooks = addHook(clearmemory, 0, shmup::clearMemory) +
addHook(hooks_gamedata, 0, shmup::gamedata) +
addHook(hooks_removecells, 0, [] () { addHook(hooks_removecells, 0, [] () {
for(mit it = monstersAt.begin(); it != monstersAt.end();) { for(mit it = monstersAt.begin(); it != monstersAt.end();) {
if(is_cell_removed(it->first)) { if(is_cell_removed(it->first)) {