If the arena option "respawn" is used then when one of the originally placed monster dies it will be replaced by a copy.
V6QW7FEXB26MVZWS42442MCLMYPESRXYYOP3EOQC6J6SSWZ4VQXAC
JSODDAQIE6WN3C4KMW2OUCVRRPHHPIZR5KO7V27CKELMCT23XEKQC
3EREXXQMWTOWPI5ZV4UABEIR4RTGPNM7V2O6CG2EOFPHA5GEB2WAC
PKXXBHS3LWLPZI2QVRX22MSQ4R2626IXRSNHFFYHXYTLJJQU54LQC
K4CJM2GNQKZAPQT3FD2FSG4IXBUUZS42VSXH3QCVSWTZ3JOZT6YQC
3HBQJBTXTMATEKEZ7ANDLAXVKS4F45YS647KYWNKQE32GQW22S3AC
CKKQS65COJ4KKOWYCKSEAPTH2X6HZSCFOT62JQOK5QDSILBKSFDAC
ESHSNJO7LNU6GCDNEBRZAXZYVJK63CUGSXO5FO2Q6ZVGJGJ5NXOQC
R32CQ6FQJTQLB35P3HENIDCBDT3UWXBBCDAAUWHUQO6G6NKEDPKQC
WGM77XP66ZEIRWAOKAJDICJ4ZBEUKGAEY6MZQQJ2LUWG5PCG722QC
HAIAZ6XVHKMUAQBV67DR54CMWRGRFAW6VY3S4BBUWS32XAWC2JIQC
void do_respawn(faction &fac)
{
for (unsigned int i = 0; i < fac.respawn_list.size(); i++)
{
coord_def pos = fac.respawn_pos[i];
int spec_idx = fac.respawn_list[i];
mons_spec spec = fac.members.get_monster(spec_idx);
if (fac.friendly)
spec.attitude = ATT_FRIENDLY;
int idx = dgn_place_monster(spec, 0, pos, false, true);
if (idx != -1)
to_respawn[idx] = spec_idx;
}
fac.respawn_list.clear();
fac.respawn_pos.clear();
}
// Only respawn those monsers which were initally placed in the
// arena.
const int midx = monster->mindex();
if (arena::respawn && arena::to_respawn[midx] != -1)
{
arena::faction *fac = NULL;
if (monster->attitude == ATT_FRIENDLY)
fac = &arena::faction_a;
else if (monster->attitude == ATT_HOSTILE)
fac = &arena::faction_b;
if (fac)
{
fac->respawn_list.push_back(arena::to_respawn[midx]);
fac->respawn_pos.push_back(monster->pos());
arena::to_respawn[midx] = -1;
}
}
* respawn: When one of the originally replaced monsters is killed it will
be replaced by the same type of monster. This allows for an endless
fight between exactly specified factions, rather than the random
kind you get by pitting two test spawners against each other.