Feature - Implemented Add _lastCombatLost Preference

Baden

Member
Similar to the _lastCombatWon preference that was added, it would be valuable to know when the previously combat was lost. This information is now accessible via the LOSELOSELOSE tag (see image below). I suggest adding a similar preference called "_lastCombatLost".
Screen_Shot_2022-12-12_at_3.13.35_PM.png
 

Tokoeka

Member
I may be missing some nuance here, but I'm struggling to see how this a new preference of "_lastCombatLost" would be any different from [NOT "_lastCombatWon"] given at the moment when I'd want to determine if I lost the last combat I'd do "!get_preference("_lastCombatWon") ?
 
I may be missing some nuance here, but I'm struggling to see how this a new preference of "_lastCombatLost" would be any different from [NOT "_lastCombatWon"] given at the moment when I'd want to determine if I lost the last combat I'd do "!get_preference("_lastCombatWon") ?
Running from combats does not register as a win (as you didn't win), but would similarly not register as a loss (because you also don't trigger <!--LOSELOSELOSE-->). You could combine _lastCombatWon with a check for beaten up or low hp, but the Personal Massager (and possibly other items) will disguise your losses in those contexts
 

Tokoeka

Member
yeah, that's the nuance i missed - would a single preference "_lastCombatResult" with expected answers of "lost" "won" and [blank] (or something for situations such as runaway) be better than one preference for each of lost / won?
 

Baden

Member
Yeah either implementation would surface the needed information for scripters. A single preference would be useful if they added a RUNRUNRUN flag or other combat-ending flags in the future.
 

Baden

Member
After getting back into scripting recently, I still think a "_lastCombatLost" preference would be a valuable addition to mafia.
 

fronobulax

Developer
Staff member
After getting back into scripting recently, I still think a "_lastCombatLost" preference would be a valuable addition to mafia.

Several months later I still don't understand the benefit. Specifically is there something that could be done with a new preference that cannot be done now with existing preferences? Is implementing this actually a New capability or merely making a (possibly) niche case easier to handle for some scripts?

The relevance is that I am lazy and the answer influences whether I personally would consider implementing this. Asking the question increases the chances that someone with more time or who is less lazy might decide to do this instead.
 
Top