HomeWildfire Games

Basic regicide gamemode. Based on patch by Sandarac, refs #2160.

Description

Basic regicide gamemode. Based on patch by Sandarac, refs #2160.

Spawn a random hero at gamestart and defeat the player if the hero dies.
Consider nomad maps where units spawn without buildings or start on a ship.
Correct a comment for TriggerHelper.SpawnUnits.
Make shuffleArray available to GUI and simulation and use it to randomize heroes.

Details

Committed
elexisJul 21 2016, 5:12 PM
Parents
rP18543: Add reddish dust to red sea. Actor by Stan, reviewed by _kali.
Branches
Unknown
Tags
Unknown

Event Timeline

elexis added a subscriber: elexis.Mar 14 2017, 6:35 AM
elexis added inline comments.
/ps/trunk/binaries/data/mods/public/maps/scripts/Regicide.js
91

Not sure, but perhaps this is better off with cmpGarrisonHolder.Garrison or PerformGarrison function, in order to skip the delay and force the garrisoning.

lyv added a subscriber: lyv.Dec 16 2018, 10:09 AM

Is it intended that hero entity renames such as Promotion would defeat the player?
Since, the trigger component does not seem to listen to OnGlobalEntityRenamed, maybe it was just a forgotten TODO?

No that wasn't left out intentionally, it probably didn't occur to us as that doesn't happen without mods.
Other edge cases that could be checked again are maps that start with a hero, multiple heroes and not hardcoding the "Hero" class.
There was a work-not-anymore-in-progress hero selection patch somewhere too.

lyv added a comment.Dec 16 2018, 12:57 PM

not hardcoding the "Hero" class.

The cleanest solution would have to use classes. So I guess a new Regicide class or something would be needed. But, as of now, the Hero class would suffice. And it's pretty much the same thing.

multiple heroes

Maybe support for it should be added here regardless of whether it is going to be an available feature from the gamesetup.

Since I already have a patch, I would fix those edge cases and upload it.

/ps/trunk/binaries/data/mods/public/maps/scripts/Regicide.js
53

This would mean any map placed heroes would be ignored. I am not sure whether that is how it should be.
It might be weird seeing this spawn the exact same hero as the map specific one. Can cover a few cases but maps themselves should take this into account.