dkfans / keeperfx

Open source remake and Fan Expansion of Dungeon Keeper.
https://keeperfx.net/
GNU General Public License v2.0
776 stars 77 forks source link

Scripted SPELL_DISEASE doesn't spread #3627

Open AdamPlenty opened 1 week ago

AdamPlenty commented 1 week ago

POWER_DISEASE was fixed by #3626, but SPELL_DISEASE remains problematic, because it's cast by PLAYER_NEUTRAL:

https://github.com/dkfans/keeperfx/blob/cdb6f864271fef54189e66ad0c37db952a886827/src/lvl_script_value.c#L213

and Disease is hardcoded to not spread when cast by PLAYER_NEUTRAL:

https://github.com/dkfans/keeperfx/blob/6d3a8e8cb139fe1517e91e9d223c148090f9a6fe/src/power_process.c#L212

walt253 commented 1 week ago

I'd argue some people would like to keep this behaviour, so maybe an option on the script command?

EDIT: nevermind, I guess if anyone want a disease that doesn't spread they can use USE_POWER_ON_CREATURE or USE_POWER_ON_PLAYERS_CREATURES with PLAYER_NEUTRAL set as caster.

So yeah +1 for the fix you propose. Mh. 🤔

Loobinex commented 1 week ago

~I'd argue some people would like to keep this behaviour, so maybe an option on the script command?~

EDIT: nevermind, I guess if anyone want a disease that doesn't spread they can use USE_POWER_ON_CREATURE or USE_POWER_ON_PLAYERS_CREATURES with PLAYER_NEUTRAL set as caster.

So yeah +1 for the fix you propose.

Would adams fix proposal not also make it spread when PLAYER_NEUTRAL is set as a caster on USE_POWER_ON_PLAYERS_CREATURES?

walt253 commented 1 week ago

~I'd argue some people would like to keep this behaviour, so maybe an option on the script command?~ EDIT: nevermind, I guess if anyone want a disease that doesn't spread they can use USE_POWER_ON_CREATURE or USE_POWER_ON_PLAYERS_CREATURES with PLAYER_NEUTRAL set as caster. So yeah +1 for the fix you propose.

Would adams fix proposal not also make it spread when PLAYER_NEUTRAL is set as a caster on USE_POWER_ON_PLAYERS_CREATURES?

Mh I didn't consider that. Annoying. ☹️

AdamPlenty commented 1 week ago

The only other way to fix this that I can see is to add a casting player parameter to USE_SPELL_ON_CREATURE. However, this would have to go at the end, which is inconsistent with USE_POWER_ON_CREATURE, because otherwise it would break existing maps. But is it really worth it just for Disease? The spells this was intended to be used for (Freeze, Slow, etc) have no casting player, so this parameter was not and is not needed. We could just leave it as it is, and put a warning saying to use POWER_DISEASE instead.

Edit: Actually, with the porting of creature spells into Keeper spells, is continuing to use USE_SPELL_ON_CREATURE at all still worth it?

walt253 commented 1 week ago

Actually, with the porting of creature spells into Keeper spells, is continuing to use USE_SPELL_ON_CREATURE at all still worth it?

Yes, personally I prefer to use this command. So maybe we shouldn't change it at all and let it be used by player neutral. Then add a notice on the wiki about disease that it can't spread with this command?