1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-29 19:40:35 +00:00

multi:: split_screen for standard shmup, not racing

This commit is contained in:
Zeno Rogue 2022-03-27 11:09:05 +02:00
parent 9a25da1989
commit fbb75309d0
2 changed files with 12 additions and 5 deletions

View File

@ -5032,7 +5032,9 @@ EX void drawthemap() {
mapeditor::draw_dtshapes();
if(multi::players > 1 && !shmup::on) {
if(multi::centerplayer != -1)
if(multi::split_screen)
cwtV = multi::whereis[subscreens::current_player];
else if(multi::centerplayer != -1)
cwtV = multi::whereis[multi::centerplayer];
else {
hyperpoint h = Hypc;
@ -5046,9 +5048,11 @@ EX void drawthemap() {
}
if(shmup::on) {
if(multi::players == 1)
if(multi::split_screen)
cwtV = shmup::pc[subscreens::current_player]->pat;
else if(multi::players == 1)
cwtV = shmup::pc[0]->pat;
else if(multi::centerplayer != -1)
else if(multi::centerplayer != -1)
cwtV = shmup::pc[multi::centerplayer]->pat;
else {
hyperpoint h = Hypc;

View File

@ -443,11 +443,13 @@ monster *playerCrash(monster *who, shiftpoint where) {
if(who->isVirtual) return NULL;
for(int j=0; j<players; j++) if(pc[j] && pc[j]!=who) {
if(pc[j]->isVirtual) continue;
if(!gmatrix.count(pc[j]->base)) continue;
double d = sqdist(pc[j]->pat*C0, where);
/* crash into another player -- not taken into account in racing */
if(d < 0.1 * SCALE2 && !racing::on) return pc[j];
/* too far away -- irrelevant in split_screen */
if(!split_screen && (d > 100 || (WDIM == 3 && hdist(tC0(pc[j]->pat), where) > sightranges[geometry]/2))) return pc[j];
if(!split_screen && (d > 100 || (WDIM == 3 && hdist(tC0(pc[j]->pat), where) > sightranges[geometry]/2)))
return pc[j];
}
return NULL;
}
@ -1447,6 +1449,7 @@ EX int reflect(cell*& c2, cell*& mbase, shiftmatrix& nat) {
}
void moveMimic(monster *m) {
if(multi::players > 1 && multi::split_screen && cpid != subscreens::current_player) return;
virtualize(m);
shiftmatrix nat = m->pat;
cpid = m->pid;
@ -2515,7 +2518,7 @@ EX hookset<bool(int)> hooks_turn;
EX void turn(int delta) {
if(racing::on && subscreens::split( [delta] () { turn(delta); })) return;
if(split_screen && subscreens::split( [delta] () { turn(delta); })) return;
int id = 0;
#if CAP_MOUSEGRAB