Feature - Implemented Handle conditionally granted skills during combat

slyz

Developer
In r9637, buttons are now enabled if:
Code:
hasSkill && FightRequest.getCurrentRound() > 0
The problem is that hasSkill is true only for skills that have been added via KoLCharacter.addAvailableSkill(). Currently, EquipmentManager.setEquipment() adds some skills associated to equipment, but not all of them. It also adds them definitively.

I guess the availability of those skills could be detected from the contents of fight.php, but since this seems rather low priority, I'll simply remove hasSkill from the line quoted above.
 

Veracity

Developer
Staff member
Currently, EquipmentManager.setEquipment() adds some skills associated to equipment, but not all of them. It also adds them definitively.
That's not good. Skills could/should be added depending on equipment, effects, outfits...

Perhaps we need a separate list - conditionalSkills, say - which is skills which are currently but temporarily available, but which gets refreshed when things change.
Perhaps we need to augment classskills.txt to describe exactly what conditions grant a skill, rather than hardcoding (some of) them into EquipmentManager.

Code:
7003	Hot Breath	5	5	0	Effect: Hot Breath
7008	Moxious Maneuver	5	0	0	Class: Disco Bandit OR Accordion Thief
7010	Fire red bottle-rocket	5	5	0	Item: bottle-rocket crossbow
7015	Creepy Grin	5	30	0	Item: V for Vivala mask
7018	Trashquake	5	100	0	Outfit: Vile Vagrant Vestments AND Zone: Hobopolis
7025	Get a You-Eye View	5	30	0	Effect: Form of...Bird!
7042	Rise From Your Ashes	5	20	0	Effect: Form of...Bird! AND ...what?
7061	Spring Raindrop Attack	5	0	0	Item: haiku katana AND ... once per combat
7076	Play a Guitar Solo	5	10	0	Item: Elvish sunglasses AND ... once per combat
7097	Turtle of Seven Tails	5	15	0	Item: Flail of the Seven Aspects
7114	Throw Shield	5	0	0	Item: Operation Patriot Shield AND ... once per combat
Looks complicated. For example, if you have summoned a hobo underling - a combat skill available if you have Hodgman's outfit - you are granted 5 additional skills, with weird limitations on how you can mix and match them for the duration of the combat.

I do like having the source of the skill - effect, item, outfit - available there so we can automatically give you a button to remind you of the existence of the skill, perhaps, when you equip the item that grants it. Sort of like how we have an automatic Jiggle button when you have a chefstaff equipped.

I guess the availability of those skills could be detected from the contents of fight.php, but since this seems rather low priority, I'll simply remove hasSkill from the line quoted above.
This sounds simpler. Perhaps a combo approach using a change to the data file AND parsing the fightpage.

- add a field to conditional skills in classskills.txt showing the simplest thing that makes the skill available: item, effect, outfit.
- create a conditionalSkills list which is updated every time you gain or lose and effect, equip or remove equipment, and so on.
- create a availableCombatSkills list which is cleared and refreshed at the beginning of every round of a fight from what KoL lists in the Use Skill dropdown on the fight page.
- when generating the stationary buttons for a round, start with attack/script etc., followed by class-granted skills - steal, moxman - followed by common skills everybody wants to remember - noodles, olfaction - followed by the last <n> skills the player actually used in combat - and then add a button for every skill in conditionalSkills which is also in availableCombatSkills.
- as always, buttons are greyed out if you don't have enough mana or have already cast it this round or ... hmm. Well, if they don't appear on availableCombatSkills, eh?

That will do the trick for relay browser + stationary buttons.

In the old days of pre-macrofied CCS, that would also have allowed us to automatically skip unavailable skills as we execute the CCS round by round. Now that CCSs are compiled into macros, not so helpful; it will tell you if you have a skill at the beginning of a macro.

If you happen to have a consult script which does things a round or two at a time, KoLmafia parsing each fight response as it comes in to detect what combat skills are CURRENTLY available could be useful.
 

Veracity

Developer
Staff member
Yes. I gave an example of that with the Turtle of Seven Tails skill coming from Item: Flail of the Seven Aspects
 

Theraze

Active member
Sorry, I thought that was the complete list of exceptions, as it stood. I did check for your new FReq, but didn't see it yet. :(
 

Theraze

Active member
Well that definitely makes them easier to find then. :) Sorry, I'll try to avoid posting any lists then, since, well, yeah. :)
 

slyz

Developer
Maybe parsing from fight.php isn't as simple as it sounds, as Zarqon's BatBrain.ash has showed us, since some skills (Shieldbutt for example) are always present in the KoL drop-down, even if you don't have a melee weapon + shield equipped.
 

Veracity

Developer
Staff member
I'm suggesting looking ONLY for the skills in the 7000's - the conditional skills. I'll bet that those show up only if the applicable condition holds.
 

Winterbay

Active member
I'm suggesting looking ONLY for the skills in the 7000's - the conditional skills. I'll bet that those show up only if the applicable condition holds.

That's definitely true for the ULEW skills at least, you have to have the item equipped for the skill to show up in the CAB and thus I presume in the html as well.
 

slyz

Developer
A less ambitious version of this has been added in r9648 (one of the most poorly worded commit logs I have seen, by the way).

I didn't touch the data files (yet?). Instead, I created KoLConstants.availableConditionalSkills, which is cleared and filled each time fight.php is processed. Any skill found in fight.php in the 7000-7999 range is added.

When adding stationary buttons, first come the hardcoded ones (attack, steal, summon ghost, jiggle, noodles, olfaction, script), then the last <n> non-conditional skills the player has used, then all the skills in availableConditionalSkills.

When a skill is used via the Relay Browser, only add it to a stationaryButtonX preference if it is not a conditionally acquired skill.

I hope this solves the recent problem I tried to fix, as well as the problems I created with my first attempt. The only drawback I can foresee is the great number of buttons that will be added for players who wear an outfit with many IoTMs :)
 
Last edited:

Veracity

Developer
Staff member
Looking good so far. I only tested Birdform. I like the way non-Birdform-usable skills disappeared and all the Birdform skills that I had MP for appeared when I was in Brirdform, and when I returned to Veracityform, the Birdform skills all disappeared.

I think it's interesting that the ones I did NOT have MP for did not show up. Before, we would have shown the buttons and greyed them out. Is this new behavior because KoL does not show you skills you don't have MP for? In any case, I think this is fine.
 

slyz

Developer
Is this new behavior because KoL does not show you skills you don't have MP for? In any case, I think this is fine.
Exactly. All the Birdform skills are in the 7XXX range, so they only appear when KoL puts them in the Skills drop-down.

Regarding the rest of what you had envisioned, especially the change to the data file, the only place in Mafia that could benefit from knowing which conditionally granted skills are currently available is the battleAction dropdown of the adventure tab. And even then, we would need to filter out the once-per-combat actions.

EDIT: I don't use the Mafia stationary buttons, but I think it would be possible to add macros that have been used by the player to the stationary buttons, just like we already add non-condtional skills.
 
Last edited:
Looking good so far. I only tested Birdform. I like the way non-Birdform-usable skills disappeared and all the Birdform skills that I had MP for appeared when I was in Brirdform, and when I returned to Veracityform, the Birdform skills all disappeared.

I think it's interesting that the ones I did NOT have MP for did not show up. Before, we would have shown the buttons and greyed them out. Is this new behavior because KoL does not show you skills you don't have MP for? In any case, I think this is fine.
Ah, different desires are interesting. I actually liked the old way of the (bird form-only) buttons appeared only after I used them during that journey. It's related to why I changed my non-stationary button count to 2 (then 3) -- the buttons are so long that they run waaayyy out of my fight pane view.

This is especially true for the bird form buttons, because they have huge names. I definitely do not want the button for getting a you-eye view pushing something like "shoot web" out of view. Most bothersome of all, to me, is that a newly-used skill still appears at the far right, the only place where it has a chance to be out of view, instead of at the left of that group of buttons. In this case, the button for getting a you-eye view appears at the far left as soon as I have enough MP for it. In all the years I've been gonging, I have nearly never used that skill.

If the way the bird form skills appear is part of a larger overhaul to skills, then I'll be getting used to it. But if bird form is handled separately, I'll just say I liked it when the skills appeared after use. For what that's worth. ;-)
 

Veracity

Developer
Staff member
Ah, different desires are interesting. I actually liked the old way of the (bird form-only) buttons appeared only after I used them during that journey. It's related to why I changed my non-stationary button count to 2 (then 3) -- the buttons are so long that they run waaayyy out of my fight pane view.
Ah, yes - you are the one (and only?) person for whom the stationary buttons don't automatically wrap to a second (and third...) line.

Which would seem to be a browser issue. Unless otherwise directed, HTML is supposed to wrap across lines.
 

slyz

Developer
newly-used skill still appears at the far right
This shouldn't be the case.

The way buttons should work now is:

- first come the hardcoded ones (attack, steal, summon ghost, jiggle, noodles, olfaction, script)
- then the last <n> non-conditional skills the player has used
- then all the conditional skills that KoL offers you in the skill drop-down.

When in BirdForm, the last <n> non-conditional skills do not show up.
Since Birdform skills are conditional (they have a skill # between 7000 and 7999), they always show up if KoL offers them as a choice.

Any "regular" skill that you use (class skills, for example), should come after the hardcoded ones, not at the far right. "shoot web" is a conditional skill, so it will always appear if it's in the KoL drop-down.
 
Top