Tweak this function to include scarves?
Posted: Sunday, 29th October 2017, 04:36
I just got back into the game after a while, and noticed that if I had a scarf equipped, I was automatically picking up every cloak I found, because of this great quality-of-life function I'd found and put in my init.txt. Could someone show me how to adjust it to account for scarves too, so that I'll only automatically pick up plain cloaks when I have neither a cloak nor a scarf equipped?
- Code:
if (class == "armour") then
if it.is_useless then return false end
sub_type = it.subtype()
equipped_item = items.equipped_at(armour_slots[sub_type])
if (sub_type == "cloak") or (sub_type == "helmet") or (sub_type == "gloves") or (sub_type == "boots") then
if not equipped_item then
return true
else
return it.artefact or it.branded or it.ego
end
end