Пример #1
0
 def init(self):
     self.hotspot = [16,32]
     self.facing = [-1,0]
     self.next_frame = 10
     self.animdelay = 5
     self.frame = 0
     self.anim = None
     self.animating = False
     self.walk_speed = 2
     self.vector = [0,0]
     
     self.radius = 14   #collision radius around hotspot
     
     self.last_hit = None
     
     self.following = None
     self.following_points = []
     
     self.last_random_point = None
     self.next_random_point = 0
     
     self.items = []
     names = Item.names[:]
     for i in range(random.randint(1,4)):
         name = random.choice(names)
         names.remove(name)
         item = Item()
         item.name = name
         self.items.append(item)
     
     self.menu = None
     self.texter = None
     
     self.pickpocketing = None
Пример #2
0
 def init_properties(self):
     if hasattr(self,"chest"):
         self.items = []
         if not self.chest:
             names = Item.names[:]
             random.sort(names)
             names = names[:4]
         else:
             names = self.chest.split(",")
         for name in names:
             item = Item()
             item.name = name
             self.items.append(item)