make EXP computation match the client
This commit is contained in:
+104
-98
@@ -62,45 +62,46 @@ void Map::add_enemy(
|
||||
Episode episode,
|
||||
uint8_t difficulty,
|
||||
uint8_t event,
|
||||
uint8_t floor,
|
||||
size_t index,
|
||||
const EnemyEntry& e,
|
||||
const RareEnemyRates& rare_rates) {
|
||||
switch (e.base_type) {
|
||||
case 0x40: {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.hildeblue);
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::HILDEBLUE : EnemyType::HILDEBEAR);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::HILDEBLUE : EnemyType::HILDEBEAR);
|
||||
break;
|
||||
}
|
||||
case 0x41: {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.rappy);
|
||||
switch (episode) {
|
||||
case Episode::EP1:
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::AL_RAPPY : EnemyType::RAG_RAPPY);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::AL_RAPPY : EnemyType::RAG_RAPPY);
|
||||
break;
|
||||
case Episode::EP2:
|
||||
if (is_rare) {
|
||||
switch (event) {
|
||||
case 0x01:
|
||||
this->add_enemy(e.floor, EnemyType::SAINT_RAPPY);
|
||||
this->add_enemy(floor, EnemyType::SAINT_RAPPY);
|
||||
break;
|
||||
case 0x04:
|
||||
this->add_enemy(e.floor, EnemyType::EGG_RAPPY);
|
||||
this->add_enemy(floor, EnemyType::EGG_RAPPY);
|
||||
break;
|
||||
case 0x05:
|
||||
this->add_enemy(e.floor, EnemyType::HALLO_RAPPY);
|
||||
this->add_enemy(floor, EnemyType::HALLO_RAPPY);
|
||||
break;
|
||||
default:
|
||||
this->add_enemy(e.floor, EnemyType::LOVE_RAPPY);
|
||||
this->add_enemy(floor, EnemyType::LOVE_RAPPY);
|
||||
}
|
||||
} else {
|
||||
this->add_enemy(e.floor, EnemyType::RAG_RAPPY);
|
||||
this->add_enemy(floor, EnemyType::RAG_RAPPY);
|
||||
}
|
||||
break;
|
||||
case Episode::EP4:
|
||||
if (e.floor > 0x05) {
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::DEL_RAPPY_ALT : EnemyType::SAND_RAPPY_ALT);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::DEL_RAPPY_ALT : EnemyType::SAND_RAPPY_ALT);
|
||||
} else {
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::DEL_RAPPY : EnemyType::SAND_RAPPY);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::DEL_RAPPY : EnemyType::SAND_RAPPY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -109,292 +110,292 @@ void Map::add_enemy(
|
||||
break;
|
||||
}
|
||||
case 0x42: {
|
||||
this->add_enemy(e.floor, EnemyType::MONEST);
|
||||
this->add_enemy(floor, EnemyType::MONEST);
|
||||
for (size_t x = 0; x < 30; x++) {
|
||||
this->add_enemy(e.floor, EnemyType::MOTHMANT);
|
||||
this->add_enemy(floor, EnemyType::MOTHMANT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x43: {
|
||||
this->add_enemy(e.floor, e.fparam2 ? EnemyType::BARBAROUS_WOLF : EnemyType::SAVAGE_WOLF);
|
||||
this->add_enemy(floor, e.fparam2 ? EnemyType::BARBAROUS_WOLF : EnemyType::SAVAGE_WOLF);
|
||||
break;
|
||||
}
|
||||
case 0x44:
|
||||
static const EnemyType types[3] = {EnemyType::BOOMA, EnemyType::GOBOOMA, EnemyType::GIGOBOOMA};
|
||||
this->add_enemy(e.floor, types[e.uparam1 % 3]);
|
||||
this->add_enemy(floor, types[e.uparam1 % 3]);
|
||||
break;
|
||||
case 0x60:
|
||||
this->add_enemy(e.floor, EnemyType::GRASS_ASSASSIN);
|
||||
this->add_enemy(floor, EnemyType::GRASS_ASSASSIN);
|
||||
break;
|
||||
case 0x61:
|
||||
if ((episode == Episode::EP2) && (e.floor > 0x0F)) {
|
||||
this->add_enemy(e.floor, EnemyType::DEL_LILY);
|
||||
this->add_enemy(floor, EnemyType::DEL_LILY);
|
||||
} else {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.nar_lily);
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::NAR_LILY : EnemyType::POISON_LILY);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::NAR_LILY : EnemyType::POISON_LILY);
|
||||
}
|
||||
break;
|
||||
case 0x62:
|
||||
this->add_enemy(e.floor, EnemyType::NANO_DRAGON);
|
||||
this->add_enemy(floor, EnemyType::NANO_DRAGON);
|
||||
break;
|
||||
case 0x63: {
|
||||
static const EnemyType types[3] = {EnemyType::EVIL_SHARK, EnemyType::PAL_SHARK, EnemyType::GUIL_SHARK};
|
||||
this->add_enemy(e.floor, types[e.uparam1 % 3]);
|
||||
this->add_enemy(floor, types[e.uparam1 % 3]);
|
||||
break;
|
||||
}
|
||||
case 0x64: {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.pouilly_slime);
|
||||
for (size_t x = 0; x < 5; x++) { // Main slime + 4 clones
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::POFUILLY_SLIME : EnemyType::POUILLY_SLIME);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::POFUILLY_SLIME : EnemyType::POUILLY_SLIME);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x65:
|
||||
this->add_enemy(e.floor, EnemyType::PAN_ARMS);
|
||||
this->add_enemy(e.floor, EnemyType::HIDOOM);
|
||||
this->add_enemy(e.floor, EnemyType::MIGIUM);
|
||||
this->add_enemy(floor, EnemyType::PAN_ARMS);
|
||||
this->add_enemy(floor, EnemyType::HIDOOM);
|
||||
this->add_enemy(floor, EnemyType::MIGIUM);
|
||||
break;
|
||||
case 0x80:
|
||||
this->add_enemy(e.floor, (e.uparam1 & 0x01) ? EnemyType::GILLCHIC : EnemyType::DUBCHIC);
|
||||
this->add_enemy(floor, (e.uparam1 & 0x01) ? EnemyType::GILLCHIC : EnemyType::DUBCHIC);
|
||||
break;
|
||||
case 0x81:
|
||||
this->add_enemy(e.floor, EnemyType::GARANZ);
|
||||
this->add_enemy(floor, EnemyType::GARANZ);
|
||||
break;
|
||||
case 0x82: {
|
||||
EnemyType type = e.fparam2 ? EnemyType::SINOW_GOLD : EnemyType::SINOW_BEAT;
|
||||
size_t count = (e.num_children == 0) ? 5 : (e.num_children + 1);
|
||||
for (size_t z = 0; z < count; z++) {
|
||||
this->add_enemy(e.floor, type);
|
||||
this->add_enemy(floor, type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x83:
|
||||
this->add_enemy(e.floor, EnemyType::CANADINE);
|
||||
this->add_enemy(floor, EnemyType::CANADINE);
|
||||
break;
|
||||
case 0x84:
|
||||
this->add_enemy(e.floor, EnemyType::CANANE);
|
||||
this->add_enemy(floor, EnemyType::CANANE);
|
||||
for (size_t x = 0; x < 8; x++) {
|
||||
this->add_enemy(e.floor, EnemyType::CANADINE_GROUP);
|
||||
this->add_enemy(floor, EnemyType::CANADINE_GROUP);
|
||||
}
|
||||
break;
|
||||
case 0x85:
|
||||
this->add_enemy(e.floor, EnemyType::DUBWITCH);
|
||||
this->add_enemy(floor, EnemyType::DUBWITCH);
|
||||
break;
|
||||
case 0xA0:
|
||||
this->add_enemy(e.floor, EnemyType::DELSABER);
|
||||
this->add_enemy(floor, EnemyType::DELSABER);
|
||||
break;
|
||||
case 0xA1:
|
||||
this->add_enemy(e.floor, EnemyType::CHAOS_SORCERER);
|
||||
this->add_enemy(e.floor, EnemyType::BEE_R);
|
||||
this->add_enemy(e.floor, EnemyType::BEE_L);
|
||||
this->add_enemy(floor, EnemyType::CHAOS_SORCERER);
|
||||
this->add_enemy(floor, EnemyType::BEE_R);
|
||||
this->add_enemy(floor, EnemyType::BEE_L);
|
||||
break;
|
||||
case 0xA2:
|
||||
this->add_enemy(e.floor, EnemyType::DARK_GUNNER);
|
||||
this->add_enemy(floor, EnemyType::DARK_GUNNER);
|
||||
break;
|
||||
case 0xA3:
|
||||
this->add_enemy(e.floor, EnemyType::DEATH_GUNNER);
|
||||
this->add_enemy(floor, EnemyType::DEATH_GUNNER);
|
||||
break;
|
||||
case 0xA4:
|
||||
this->add_enemy(e.floor, EnemyType::CHAOS_BRINGER);
|
||||
this->add_enemy(floor, EnemyType::CHAOS_BRINGER);
|
||||
break;
|
||||
case 0xA5:
|
||||
this->add_enemy(e.floor, EnemyType::DARK_BELRA);
|
||||
this->add_enemy(floor, EnemyType::DARK_BELRA);
|
||||
break;
|
||||
case 0xA6: {
|
||||
static const EnemyType types[3] = {EnemyType::DIMENIAN, EnemyType::LA_DIMENIAN, EnemyType::SO_DIMENIAN};
|
||||
this->add_enemy(e.floor, types[e.uparam1 % 3]);
|
||||
this->add_enemy(floor, types[e.uparam1 % 3]);
|
||||
break;
|
||||
}
|
||||
case 0xA7:
|
||||
this->add_enemy(e.floor, EnemyType::BULCLAW);
|
||||
this->add_enemy(floor, EnemyType::BULCLAW);
|
||||
for (size_t x = 0; x < 4; x++) {
|
||||
this->add_enemy(e.floor, EnemyType::CLAW);
|
||||
this->add_enemy(floor, EnemyType::CLAW);
|
||||
}
|
||||
break;
|
||||
case 0xA8:
|
||||
this->add_enemy(e.floor, EnemyType::CLAW);
|
||||
this->add_enemy(floor, EnemyType::CLAW);
|
||||
break;
|
||||
case 0xC0:
|
||||
if (episode == Episode::EP1) {
|
||||
this->add_enemy(e.floor, EnemyType::DRAGON);
|
||||
this->add_enemy(floor, EnemyType::DRAGON);
|
||||
} else if (episode == Episode::EP2) {
|
||||
this->add_enemy(e.floor, EnemyType::GAL_GRYPHON);
|
||||
this->add_enemy(floor, EnemyType::GAL_GRYPHON);
|
||||
} else {
|
||||
throw runtime_error("DRAGON-type enemy placed outside of Episodes 1 or 2");
|
||||
}
|
||||
break;
|
||||
case 0xC1:
|
||||
this->add_enemy(e.floor, EnemyType::DE_ROL_LE);
|
||||
this->add_enemy(floor, EnemyType::DE_ROL_LE);
|
||||
for (size_t z = 0; z < 0x0A; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::DE_ROL_LE_BODY);
|
||||
this->add_enemy(floor, EnemyType::DE_ROL_LE_BODY);
|
||||
}
|
||||
for (size_t z = 0; z < 0x09; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::DE_ROL_LE_MINE);
|
||||
this->add_enemy(floor, EnemyType::DE_ROL_LE_MINE);
|
||||
}
|
||||
break;
|
||||
case 0xC2:
|
||||
this->add_enemy(e.floor, EnemyType::VOL_OPT_1);
|
||||
this->add_enemy(floor, EnemyType::VOL_OPT_1);
|
||||
for (size_t z = 0; z < 6; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::VOL_OPT_PILLAR);
|
||||
this->add_enemy(floor, EnemyType::VOL_OPT_PILLAR);
|
||||
}
|
||||
for (size_t z = 0; z < 24; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::VOL_OPT_MONITOR);
|
||||
this->add_enemy(floor, EnemyType::VOL_OPT_MONITOR);
|
||||
}
|
||||
for (size_t z = 0; z < 2; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::NONE);
|
||||
this->add_enemy(floor, EnemyType::NONE);
|
||||
}
|
||||
this->add_enemy(e.floor, EnemyType::VOL_OPT_AMP);
|
||||
this->add_enemy(e.floor, EnemyType::VOL_OPT_CORE);
|
||||
this->add_enemy(e.floor, EnemyType::NONE);
|
||||
this->add_enemy(floor, EnemyType::VOL_OPT_AMP);
|
||||
this->add_enemy(floor, EnemyType::VOL_OPT_CORE);
|
||||
this->add_enemy(floor, EnemyType::NONE);
|
||||
break;
|
||||
case 0xC5:
|
||||
this->add_enemy(e.floor, EnemyType::VOL_OPT_2);
|
||||
this->add_enemy(floor, EnemyType::VOL_OPT_2);
|
||||
break;
|
||||
case 0xC8:
|
||||
if (difficulty) {
|
||||
this->add_enemy(e.floor, EnemyType::DARK_FALZ_3);
|
||||
this->add_enemy(floor, EnemyType::DARK_FALZ_3);
|
||||
} else {
|
||||
this->add_enemy(e.floor, EnemyType::DARK_FALZ_2);
|
||||
this->add_enemy(floor, EnemyType::DARK_FALZ_2);
|
||||
}
|
||||
for (size_t x = 0; x < 0x1FD; x++) {
|
||||
this->add_enemy(e.floor, difficulty == 3 ? EnemyType::DARVANT_ULTIMATE : EnemyType::DARVANT);
|
||||
this->add_enemy(floor, difficulty == 3 ? EnemyType::DARVANT_ULTIMATE : EnemyType::DARVANT);
|
||||
}
|
||||
this->add_enemy(e.floor, EnemyType::DARK_FALZ_3);
|
||||
this->add_enemy(e.floor, EnemyType::DARK_FALZ_2);
|
||||
this->add_enemy(e.floor, EnemyType::DARK_FALZ_1);
|
||||
this->add_enemy(floor, EnemyType::DARK_FALZ_3);
|
||||
this->add_enemy(floor, EnemyType::DARK_FALZ_2);
|
||||
this->add_enemy(floor, EnemyType::DARK_FALZ_1);
|
||||
break;
|
||||
case 0xCA:
|
||||
for (size_t z = 0; z < 0x201; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::OLGA_FLOW_2);
|
||||
this->add_enemy(floor, EnemyType::OLGA_FLOW_2);
|
||||
}
|
||||
break;
|
||||
case 0xCB:
|
||||
this->add_enemy(e.floor, EnemyType::BARBA_RAY);
|
||||
this->add_enemy(floor, EnemyType::BARBA_RAY);
|
||||
for (size_t z = 0; z < 0x2F; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::PIG_RAY);
|
||||
this->add_enemy(floor, EnemyType::PIG_RAY);
|
||||
}
|
||||
break;
|
||||
case 0xCC:
|
||||
for (size_t z = 0; z < 6; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::GOL_DRAGON);
|
||||
this->add_enemy(floor, EnemyType::GOL_DRAGON);
|
||||
}
|
||||
break;
|
||||
case 0xD4: {
|
||||
EnemyType type = (e.uparam1 & 1) ? EnemyType::SINOW_SPIGELL : EnemyType::SINOW_BERILL;
|
||||
for (size_t z = 0; z < 5; z++) {
|
||||
this->add_enemy(e.floor, type);
|
||||
this->add_enemy(floor, type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0xD5:
|
||||
this->add_enemy(e.floor, (e.uparam1 & 0x01) ? EnemyType::MERILTAS : EnemyType::MERILLIA);
|
||||
this->add_enemy(floor, (e.uparam1 & 0x01) ? EnemyType::MERILTAS : EnemyType::MERILLIA);
|
||||
break;
|
||||
case 0xD6:
|
||||
if (e.uparam1 == 0) {
|
||||
this->add_enemy(e.floor, EnemyType::MERICAROL);
|
||||
this->add_enemy(floor, EnemyType::MERICAROL);
|
||||
} else {
|
||||
this->add_enemy(e.floor, ((e.uparam1 % 3) == 2) ? EnemyType::MERICUS : EnemyType::MERIKLE);
|
||||
this->add_enemy(floor, ((e.uparam1 % 3) == 2) ? EnemyType::MERICUS : EnemyType::MERIKLE);
|
||||
}
|
||||
break;
|
||||
case 0xD7:
|
||||
this->add_enemy(e.floor, (e.uparam1 & 0x01) ? EnemyType::ZOL_GIBBON : EnemyType::UL_GIBBON);
|
||||
this->add_enemy(floor, (e.uparam1 & 0x01) ? EnemyType::ZOL_GIBBON : EnemyType::UL_GIBBON);
|
||||
break;
|
||||
case 0xD8:
|
||||
this->add_enemy(e.floor, EnemyType::GIBBLES);
|
||||
this->add_enemy(floor, EnemyType::GIBBLES);
|
||||
break;
|
||||
case 0xD9:
|
||||
this->add_enemy(e.floor, EnemyType::GEE);
|
||||
this->add_enemy(floor, EnemyType::GEE);
|
||||
break;
|
||||
case 0xDA:
|
||||
this->add_enemy(e.floor, EnemyType::GI_GUE);
|
||||
this->add_enemy(floor, EnemyType::GI_GUE);
|
||||
break;
|
||||
case 0xDB:
|
||||
this->add_enemy(e.floor, EnemyType::DELDEPTH);
|
||||
this->add_enemy(floor, EnemyType::DELDEPTH);
|
||||
break;
|
||||
case 0xDC:
|
||||
this->add_enemy(e.floor, EnemyType::DELBITER);
|
||||
this->add_enemy(floor, EnemyType::DELBITER);
|
||||
break;
|
||||
case 0xDD:
|
||||
this->add_enemy(e.floor, (e.uparam1 & 0x01) ? EnemyType::DOLMDARL : EnemyType::DOLMOLM);
|
||||
this->add_enemy(floor, (e.uparam1 & 0x01) ? EnemyType::DOLMDARL : EnemyType::DOLMOLM);
|
||||
break;
|
||||
case 0xDE:
|
||||
this->add_enemy(e.floor, EnemyType::MORFOS);
|
||||
this->add_enemy(floor, EnemyType::MORFOS);
|
||||
break;
|
||||
case 0xDF:
|
||||
this->add_enemy(e.floor, EnemyType::RECOBOX);
|
||||
this->add_enemy(floor, EnemyType::RECOBOX);
|
||||
for (size_t x = 0; x < e.num_children; x++) {
|
||||
this->add_enemy(e.floor, EnemyType::RECON);
|
||||
this->add_enemy(floor, EnemyType::RECON);
|
||||
}
|
||||
break;
|
||||
case 0xE0:
|
||||
if ((episode == Episode::EP2) && (e.floor > 0x0F)) {
|
||||
this->add_enemy(e.floor, EnemyType::EPSILON);
|
||||
this->add_enemy(floor, EnemyType::EPSILON);
|
||||
for (size_t z = 0; z < 4; z++) {
|
||||
this->add_enemy(e.floor, EnemyType::EPSIGUARD);
|
||||
this->add_enemy(floor, EnemyType::EPSIGUARD);
|
||||
}
|
||||
} else {
|
||||
this->add_enemy(e.floor, (e.uparam1 & 0x01) ? EnemyType::SINOW_ZELE : EnemyType::SINOW_ZOA);
|
||||
this->add_enemy(floor, (e.uparam1 & 0x01) ? EnemyType::SINOW_ZELE : EnemyType::SINOW_ZOA);
|
||||
}
|
||||
break;
|
||||
case 0xE1:
|
||||
this->add_enemy(e.floor, EnemyType::ILL_GILL);
|
||||
this->add_enemy(floor, EnemyType::ILL_GILL);
|
||||
break;
|
||||
case 0x0110:
|
||||
this->add_enemy(e.floor, EnemyType::ASTARK);
|
||||
this->add_enemy(floor, EnemyType::ASTARK);
|
||||
break;
|
||||
case 0x0111:
|
||||
if (e.floor > 0x05) {
|
||||
this->add_enemy(e.floor, e.fparam2 ? EnemyType::YOWIE_ALT : EnemyType::SATELLITE_LIZARD_ALT);
|
||||
this->add_enemy(floor, e.fparam2 ? EnemyType::YOWIE_ALT : EnemyType::SATELLITE_LIZARD_ALT);
|
||||
} else {
|
||||
this->add_enemy(e.floor, e.fparam2 ? EnemyType::YOWIE : EnemyType::SATELLITE_LIZARD);
|
||||
this->add_enemy(floor, e.fparam2 ? EnemyType::YOWIE : EnemyType::SATELLITE_LIZARD);
|
||||
}
|
||||
break;
|
||||
case 0x0112: {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.merissa_aa);
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::MERISSA_AA : EnemyType::MERISSA_A);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::MERISSA_AA : EnemyType::MERISSA_A);
|
||||
break;
|
||||
}
|
||||
case 0x0113:
|
||||
this->add_enemy(e.floor, EnemyType::GIRTABLULU);
|
||||
this->add_enemy(floor, EnemyType::GIRTABLULU);
|
||||
break;
|
||||
case 0x0114: {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.pazuzu);
|
||||
if (e.floor > 0x05) {
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::PAZUZU_ALT : EnemyType::ZU_ALT);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::PAZUZU_ALT : EnemyType::ZU_ALT);
|
||||
} else {
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::PAZUZU : EnemyType::ZU);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::PAZUZU : EnemyType::ZU);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0115:
|
||||
if (e.uparam1 & 2) {
|
||||
this->add_enemy(e.floor, EnemyType::BA_BOOTA);
|
||||
this->add_enemy(floor, EnemyType::BA_BOOTA);
|
||||
} else {
|
||||
this->add_enemy(e.floor, (e.uparam1 & 1) ? EnemyType::ZE_BOOTA : EnemyType::BOOTA);
|
||||
this->add_enemy(floor, (e.uparam1 & 1) ? EnemyType::ZE_BOOTA : EnemyType::BOOTA);
|
||||
}
|
||||
break;
|
||||
case 0x0116: {
|
||||
bool is_rare = this->check_and_log_rare_enemy(e.uparam1 & 0x01, rare_rates.dorphon_eclair);
|
||||
this->add_enemy(e.floor, is_rare ? EnemyType::DORPHON_ECLAIR : EnemyType::DORPHON);
|
||||
this->add_enemy(floor, is_rare ? EnemyType::DORPHON_ECLAIR : EnemyType::DORPHON);
|
||||
break;
|
||||
}
|
||||
case 0x0117: {
|
||||
static const EnemyType types[3] = {EnemyType::GORAN, EnemyType::PYRO_GORAN, EnemyType::GORAN_DETONATOR};
|
||||
this->add_enemy(e.floor, types[e.uparam1 % 3]);
|
||||
this->add_enemy(floor, types[e.uparam1 % 3]);
|
||||
break;
|
||||
}
|
||||
case 0x0119: {
|
||||
bool is_rare = this->check_and_log_rare_enemy((e.fparam2 != 0.0f), rare_rates.kondrieu);
|
||||
if (is_rare) {
|
||||
this->add_enemy(e.floor, EnemyType::KONDRIEU);
|
||||
this->add_enemy(floor, EnemyType::KONDRIEU);
|
||||
} else {
|
||||
this->add_enemy(e.floor, (e.uparam1 & 1) ? EnemyType::SHAMBERTIN : EnemyType::SAINT_MILLION);
|
||||
this->add_enemy(floor, (e.uparam1 & 1) ? EnemyType::SHAMBERTIN : EnemyType::SAINT_MILLION);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
for (size_t z = 0; z < static_cast<size_t>(e.num_children + 1); z++) {
|
||||
this->add_enemy(e.floor, EnemyType::UNKNOWN);
|
||||
this->add_enemy(floor, EnemyType::UNKNOWN);
|
||||
}
|
||||
static_game_data_log.warning(
|
||||
"(Entry %zu, offset %zX in file) Unknown enemy type %04hX",
|
||||
@@ -407,6 +408,7 @@ void Map::add_enemies_from_map_data(
|
||||
Episode episode,
|
||||
uint8_t difficulty,
|
||||
uint8_t event,
|
||||
uint8_t floor,
|
||||
const void* data,
|
||||
size_t size,
|
||||
const RareEnemyRates& rare_rates) {
|
||||
@@ -417,7 +419,7 @@ void Map::add_enemies_from_map_data(
|
||||
|
||||
StringReader r(data, size);
|
||||
for (size_t y = 0; y < entry_count; y++) {
|
||||
this->add_enemy(episode, difficulty, event, y, r.get<EnemyEntry>(), rare_rates);
|
||||
this->add_enemy(episode, difficulty, event, floor, y, r.get<EnemyEntry>(), rare_rates);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,6 +502,7 @@ void Map::add_random_enemies_from_map_data(
|
||||
Episode episode,
|
||||
uint8_t difficulty,
|
||||
uint8_t event,
|
||||
uint8_t floor,
|
||||
StringReader wave_events_segment_r,
|
||||
StringReader locations_segment_r,
|
||||
StringReader definitions_segment_r,
|
||||
@@ -579,6 +582,7 @@ void Map::add_random_enemies_from_map_data(
|
||||
e.base_type = rand_enemy_base_types.at(weight_entry.base_type_index);
|
||||
e.wave_number = wave_number;
|
||||
e.section = entry.section;
|
||||
e.floor = floor;
|
||||
|
||||
size_t bs_min = 0;
|
||||
size_t bs_max = definitions_header.entry_count - 1;
|
||||
@@ -619,7 +623,7 @@ void Map::add_random_enemies_from_map_data(
|
||||
|
||||
enemy_log.info("Creating enemy with base_type %04hX fparam2 %g uparam1 %04hX", e.base_type.load(), e.fparam2.load(), e.uparam1.load());
|
||||
// Trace: at 0080E6FE CX is base_type
|
||||
this->add_enemy(episode, difficulty, event, 0, e, rare_rates);
|
||||
this->add_enemy(episode, difficulty, event, floor, 0, e, rare_rates);
|
||||
} else {
|
||||
enemy_log.info("Cannot create enemy: parameters are missing");
|
||||
}
|
||||
@@ -743,6 +747,7 @@ void Map::add_enemies_and_objects_from_quest_data(
|
||||
episode,
|
||||
difficulty,
|
||||
event,
|
||||
floor,
|
||||
r.pgetv(sections.enemies + sizeof(header), header.data_size),
|
||||
header.data_size,
|
||||
rare_rates);
|
||||
@@ -758,6 +763,7 @@ void Map::add_enemies_and_objects_from_quest_data(
|
||||
episode,
|
||||
difficulty,
|
||||
event,
|
||||
floor,
|
||||
r.sub(sections.wave_events + sizeof(SectionHeader), wave_events_header.data_size),
|
||||
r.sub(sections.random_enemy_locations + sizeof(SectionHeader), random_enemy_locations_header.data_size),
|
||||
r.sub(sections.random_enemy_definitions + sizeof(SectionHeader), random_enemy_definitions_header.data_size),
|
||||
|
||||
Reference in New Issue
Block a user