There's one small pitfall when using CheckReplacement to replace actors; there's no way to get the actual replacee with it.
So what I suggest is CheckReplacee using a ReplacedEvent struct:
Code: Select all
struct ReplacedEvent native version("2.4")
{
native Class<Actor> Replacee;
native readonly Class<Actor> Replacement;
native bool IsFinal;
}
Code: Select all
override void CheckReplacee(ReplacedEvent e)
{
Class<Actor> rep = e.Replacement;
static const Class<Actor> mons[] =
{
'MiniMind',
'Demolisher',
'Sentient'
};
for (int i = 0; i < mons.Size(); i++)
{
if (rep == mons[i])
{
e.Replacee = 'SpiderMastermind';
e.IsFinal = true;
return;
}
}
}
- A_BossDeath is partly broken (but can be fixed by using a randomspawner instead)
- CheckReplacee, if used by mods that have little to no 'replaces' being used, is equally just as useless.