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.