[IF7] Changing player class during play

I’m trying to make a class system in my IF that supports changing class throughout the game. I tried to create an action that instantly changes the player’s class for debugging purposes, but I’m getting an error. Here’s my relevant code:

[code]Class is a kind of value. The classes are prisoner, fighter, thief, and mage. The player has a class. The player is a prisoner.

Changing to is an action applying to a class.

Understand “change to [class]” and “change class to [class]” as changing to.

Check changing to:
if the noun is the class of the player:
say “You are already a [the noun]!” instead.

Carry out changing to:
now the class of the player is the noun.

Report changing to:
say “You are now a [the noun].”

The description of the player is “Class: [class of the player]”

And here’s the error I’m getting:

If I go through and change every instance of “the noun” to “the class”, fixing the comparison mismatch, I get this error:

So is there any way to change the kind of something? Or am I going about this the wrong way entirely?

For actions applying to a value rather than an object, you need to refer to “the [type] understood”. In this case, that would be the class understood.

Thanks, that worked!