void Room::RespawnMobs() { std::vector<GameEntity*> currentMobs = mobs_->GetEntityVector(); std::map<int, int> mobs_to_add; for (int i : original_mobs_) { mobs_to_add.insert(std::pair<int, int>(i, i)); } for (GameEntity* m : currentMobs) { mobs_to_add.erase(((NPC*)m)->GetMasterId()); } for (std::pair<int, int> m : mobs_to_add) { SpawnMob(m.second); } }
void TrySpawn(void) { Sint32 ccx = spawnx, ccy = spawny; if (wavemobleft) if (mobdelay) { mobdelay--; } else { wavemobleft--; mobdelay = iwavedata[wave][7]; newvline[0] = 20; newvline[1] = 4; newvline[2] = ccx - 32768; newvline[3] = 1000; newvline[4] = ccy; newvline[5] = ccx; newvline[6] = 1000; newvline[7] = ccy + 32768; newvline[8] = -8000; newvline[9] = 2000; newvline[10] = 000; newvline[11] = 000; newvline[12] = 2000; newvline[13] = 8000; SpawnLine(); newvline[0] = 20; newvline[1] = 4; newvline[2] = ccx + 32768; newvline[3] = 1000; newvline[4] = ccy; newvline[5] = ccx; newvline[6] = 1000; newvline[7] = ccy + 32768; newvline[8] = +8000; newvline[9] = 2000; newvline[10] = 000; newvline[11] = 000; newvline[12] = 2000; newvline[13] = 8000; SpawnLine(); newvline[0] = 20; newvline[1] = 4; newvline[2] = ccx - 32768; newvline[3] = 1000; newvline[4] = ccy; newvline[5] = ccx; newvline[6] = 1000; newvline[7] = ccy - 32768; newvline[8] = -8000; newvline[9] = 2000; newvline[10] = 000; newvline[11] = 000; newvline[12] = 2000; newvline[13] = -8000; SpawnLine(); newvline[0] = 20; newvline[1] = 4; newvline[2] = ccx + 32768; newvline[3] = 1000; newvline[4] = ccy; newvline[5] = ccx; newvline[6] = 1000; newvline[7] = ccy - 32768; newvline[8] = +8000; newvline[9] = 2000; newvline[10] = 000; newvline[11] = 000; newvline[12] = 2000; newvline[13] = -8000; SpawnLine(); SpawnMob(); } }