Since the game won't let you waste (known) scrolls or wand charges of teleportation if it's known that you can't teleport (you're wearing an identified artefact which prevents teleportation) do something similar for invisiblity: if you're haloed because of worshipping TSO then refuse to use known wands or potions of invisibility, and if you're glowing from magical contamination then prompt before usage (since the glow might wear off before the invisibility).
Also: 1) add some informational messages about the interaction of invisibility and being backlit, 2) if you use-identify invisibility while haloed then just print a message, but don't actually get the invisibility duration.
LDNLHHR25F4EK4WFK2LKPOI3HPS22RRZUZT6JHJME3QZI545P6HQC XM4DDV26SBMFDCHSFKIOPWCFDKFHBFA3VDEDRZWXZSXHXOII762AC AVEOSLDREJHWFZE6ULAWGQPDT24YX4OAOGL7YAUCFVRGHCS22UCAC ENOQQ6DEA6ECRNTBGYYNK7G3DFEILMKQBNKP4SUQIZW2L6HWVR7QC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC QDTKLKOH4PGAXKUDONBMKQKNTLSZMZGOZQEDXE7VMRHMNDI276BAC JZTWTPXIUEVACX5B6FYQRVRJD3KQN653C4G4GXT2VSMX4EP7WS3AC RQR4PTMGQLTRWLYRU3KXIIDGND7FBORESJWMWFVD3WYU5SISZXAAC FIYBXLWALQINNQTHG2KNDUUTAQAZRDDLXW2XOVSKDKBADJ3XCJ4AC YFTBPIE5W5TLEYSELYOQNWD6L6EMORIRZZWJX4TH2XMLB35PY5XQC I2B33Z7NZGC33AMDSSK446AZZYWKPHWLAGULVHKKZU4MVB4BNJOAC 6GT5JAWOIIL4SQ5MWIID6ZVO3KKQFWDQDZNVFHZ6DNK5QCBXJ4UAC }static bool _dont_use_invis(){if (!you.backlit())return (false);if (you.haloed()){mpr("You can't turn invisible.");return (true);}else if (get_contamination_level() > 0&& !yesno("Invisibility will do you no good right now; ""use anyways?")){return (true);}return (false);
mpr("You cannot teleport right now.");return;
if (wand.sub_type == WAND_TELEPORTATION&& scan_artefacts(ARTP_PREVENT_TELEPORTATION, false)){mpr("You cannot teleport right now.");return;}else if (wand.sub_type == WAND_INVISIBILITY&& _dont_use_invis()){return;}
mpr(!you.duration[DUR_INVIS] ? "You fade into invisibility!": "You fade further into invisibility.",
if (you.haloed()){// You can't turn invisible while haloed, but identify the// effect anyways.mpr("You briefly turn translucent.");// And also cancel backlight (for whatever good that will// do).you.duration[DUR_BACKLIGHT] = 0;return (true);}if (get_contamination_level() > 0){mprf(MSGCH_DURATION,"You become %stransparent, but the glow from your ""magical contamination prevents you from becoming ""completely invisible.",you.duration[DUR_INVIS] ? "further " : "");}else{mpr(!you.duration[DUR_INVIS] ? "You fade into invisibility!": "You fade further into invisibility.",