Random Lycanthropy?

https://attnam.com/topics/Random-Lycanthropy

The Cathedral of Attnam > Tips, Tricks, and Secrets

#1 Nov 29, 2014, 8:55 am Hide

Batman?

I was resting on GC 4 (after accidently kicking in the door of Merka shop Ruh-Roh) and the game randomly asked me if I wanted to turn into a werewolf. I had not eaten a werewolf corpses, and I checked myself wit ha stethescope and i did not have Lycanthropy.

and ideas what caused this?
#2 Nov 29, 2014, 3:40 pm Hide

Pent

I've had this happen a few times, though I never bothered to look into the cause. Did you have polycontrol when it happened?
#3 Nov 29, 2014, 4:34 pm Hide

Batman?

No polycontrol
#4 Nov 29, 2014, 4:35 pm Hide

Batman?

I did have a chameleon corpse in my inventory
#5 Nov 29, 2014, 6:52 pm Hide

Pent

Hmm... I tried taking a look, but nothing stood out in the code. The only hunch I have is that it somehow confused another state you had with lycanthropy, but that would probably result in another state not working, which would be more noticeable; do you remember what states you had when it happened?
#6 Nov 29, 2014, 7:11 pm Hide

fejoa

Did you drink from any fountains? I can't remember whether this is a source of lycanthropy or not.
#7 Nov 29, 2014, 9:51 pm Hide

Pent

It is. I remember the good ol' days when the only way I could manage to kill Jenny was to drink from all of the fountains and hope I'd turn into a werewolf. But in this case it just asks you randomly when you don't even have the lycanthropy state. It's happened to me a few times, but I can't remember if I've ever taken it up on the offer.
#8 Nov 30, 2014, 4:30 pm Hide

Batman?

i had been panicked, i had a chameleon corpse rot away in my inventory, and was healing. thats about it.
#9 Dec 1, 2014, 12:02 am Hide

chaostrom

Had the chameleon turned into a werewolf? I seem to recall their bites are infectious.
#10 Dec 1, 2014, 8:42 am Hide

Batman?

yes, i think it had, it only happened once though, and long after i defeated it.
#11 Dec 1, 2014, 12:02 pm Hide

capristo

Wait, the chameleon changed into a werewolf after it was defeated (dead)?
#12 Dec 1, 2014, 1:12 pm Hide

Pent

capristo wrote
Wait, the chameleon changed into a werewolf after it was defeated (dead)?

No, I think he's saying it turned into a werewolf at some point when it was alive. I can confirm though that you do sometimes get a "Would you like to turn into a werewolf?" prompt even when you don't have the lycanthropy state. There's nothing in the code that supports this happening, so I've just chalked it up to a wonky bug.

EDIT: I can't check right now, but it's possible that a different character on the floor had lycanthropy, but that the state is only programmed to ask the player if they want to become a werewolf. I'll look over the code again later. It's under LycanthropyHandler() in char.cpp if anyone wants to check it out.
#13 Dec 1, 2014, 1:33 pm Hide

fejoa

Well, it seems to be a real poser. From the code, you have to have the PolyControl state activated in order to be asked the question.
#14 Dec 1, 2014, 2:37 pm Hide

Pent

Alright, I took another look at the code:

void character::LycanthropyHandler()
{
  if(!(RAND() % 2000))
  {
    if(StateIsActivated(POLYMORPH_CONTROL)
        && !game::TruthQuestion(CONST_S("Do you wish to change into a werewolf? [y/N]")))
      return;
    Polymorph(werewolfwolf::Spawn(), 1000 + RAND() % 2000);
  }
}

As I thought, it doesn't ever check whether the affected character is the player. Since TruthQuestions apply to the game itself, and not a specific character, you're actually seeing the prompt for another lycanthropic character that has polycontrol.

I just tested it in wizmode: I gave the werewolf from the GC a ring of polycontrol then sat around until he transformed. Sure enough, it prompted me, and selecting yes caused him to change into a werewolf.
#15 Dec 1, 2014, 3:44 pm Hide

fejoa

Holy banana! Good spotting Pent. Well, looks like a bug after all. Pretty rare bug though I suppose we can add this to the list. I'd say the second if statement needs an
 && IsPlayer()
somewhere.
#16 Dec 1, 2014, 5:00 pm Hide

capristo

Nice work Batman? for identifying and Pent for investigating It always makes me happy to see a bug squashed
#17 Dec 1, 2014, 5:15 pm Hide

slob

Probably magic mushroom related or somebody ate a bunny, though it might be a good way to find a ring of polycontrol.
#18 Dec 1, 2014, 9:27 pm Hide

Pent

I pushed the fix to the repo.

I'd also like to point out that I'm very proud of the fact that I figured this out while on the toilet.
#19 Dec 1, 2014, 9:58 pm Hide

chaostrom

Best place to figure things out.