Auto-translated
If the developers hadn't removed all the standard Lua functions, we could freely move mountains, but as it is - pfft!
Maybe try this:
Hero touches the portal,
turn on the portal
make interact
has the hero's position changed?
if yes, turn off the portal
otherwise, turn on everything within a 2-cell radius of the portal
make interact
turn off the portal.
Added 2 minutes ago
Although, maybe we should temporarily block all portals at that moment? Because blocking the outgoing portal won't matter anymore.
Added 2 minutes ago
But then we'll have to definitely turn the portals back on later (both of them) after clearing the mobs. So that the path highlighting for heroes traveling through the portals is adequate. And what if the portals are in a more complex system of 3 or 4 in a group?
Added 4 minutes ago
And how is this any different from having the mobs around the portal activated?
Added 6 minutes ago
In IRMG, people sometimes complain during tournaments that they can't find out who's behind the portal without a test battle.
We could then temporarily remove all the mobs behind the portals (during contact) and after teleporting, return only those where the hero is not standing. Then throw the hero back to the old position, return the damaged mob with Haffad's effect, activate it, and offer a battle with whoever is behind the portal; if the battle is refused, return the squad to the original number.
Added 9 minutes ago
With the algorithm described above, we'll kill two birds with one stone: we'll know about the guard behind the portal, and Haffad's special ability will work. The question is, will it put too much strain on the system?
Added 8 minutes ago
Okay, never mind, let them be activated anyway)))
Added 1 minute ago
Is there an abbreviation for a word that defines all monoliths and portals on the surface? Besides the portal, everything is defined as MONO