title: 'int' object has no attribute - passing through __call__ to method in class
body: <p>What this is:
  A class uses to control game characters stats and interaction for both NPCs and players.</p>
  <p>The <strong>call</strong> method was added to create mew &quot;mob types&quot; that can have their stat scaling controlled based on the player level.</p>
  <p>I am trying to use the Mob.wyvern(player_level) method to create a &quot;Wyvern&quot; type NPC. In this case the code flows successfully until we try to modify a_wyvern.life using the self.playerlevel call.</p>
  <p>Error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;c:\Users\User\mystuff\Classes Game\Characters.py&quot;, line 74, in &lt;module&gt;
      a_wyvern = Mobs.wyvern(player_level)
    File &quot;c:\Users\User\mystuff\Classes Game\Characters.py&quot;, line 36, in wyvern
      a_wyvern.life += a_wyvern.player_level
  AttributeError: 'Mobs' object has no attribute 'player_level'
  </code></pre>
  <pre><code>#Initializer, passing variables to all 
  class Mobs():
      def __init__(self):
          self.life = 10
          self.atk = 2
          self.arm = 1
          self.name = villains.gen()
          self.playername = heroes.gen()
          self.type = type
              
      def __call__(self, player_level):
          self.player_level = player_level
          pass
  
      def attack(self, enemy):
          damage_amount = enemy.take_damage(self.atk)
          return damage_amount
  
      def take_damage(self, amount):
          damage_amount = (amount - self.arm)
          self.life -= damage_amount
          return damage_amount
  
      
      def wyvern(self):
          a_wyvern = Mobs()
          a_wyvern.type = &quot;Wyvern&quot;
          a_wyvern.life += self.player_level
          return a_wyvern
  </code></pre>
  <pre><code>player_level = 20
  
  a_wyvern = Mobs.wyvern(player_level)
  a_wyvern.type
  a_wyvern.life
  a_wyvern.atk
  
  print(a_wyvern.life)
  print(a_wyvern.atk)
  print(a_wyvern.name)
  </code></pre>