SOLVED--Self.costOf error message


#1

When I try to use self.costOf, I get this error message:

Is there a level that teaches this? I thought it was only necessary in Javascript or something. I’m using Python. :confounded:

Thanks much!


#2

How are you calling self.costOf? It should be something like,

if self.gold >= self.costOf("archer"):
    self.summon("archer")

#3

Here is the relevant code:

if enemy.type != "wizard" and enemy.type != "cage" and enemy.type != "yeti":
    value += self.costOf(enemy.type)

It has worked before elsewhere.

It’s on Zero Sum, so no other unsummonable enemy types should appear.


#4

Pender’s type isn’t "wizard". It’s "sorcerer". I believe that is your problem.