keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

Scripted SPELL_DISEASE doesn't spread

Open AdamPlenty opened this issue 1 year ago • 5 comments

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

AdamPlenty avatar Nov 03 '24 20:11 AdamPlenty

~~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. 🤔

walt253 avatar Nov 04 '24 09:11 walt253

~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?

Loobinex avatar Nov 04 '24 10:11 Loobinex

~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. ☹️

walt253 avatar Nov 04 '24 11:11 walt253

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?

AdamPlenty avatar Nov 04 '24 18:11 AdamPlenty

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?

walt253 avatar Nov 04 '24 18:11 walt253