Make PEP8 cleanup of line spaces and character distances as well as indents
This commit is contained in:
parent
7ff783fea1
commit
b278337172
189 changed files with 2039 additions and 1583 deletions
|
|
@ -13,6 +13,7 @@ from evennia import Command, CmdSet
|
|||
from evennia import logger
|
||||
from evennia.contrib.tutorial_world import objects as tut_objects
|
||||
|
||||
|
||||
class CmdMobOnOff(Command):
|
||||
"""
|
||||
Activates/deactivates Mob
|
||||
|
|
@ -51,9 +52,11 @@ class MobCmdSet(CmdSet):
|
|||
"""
|
||||
Holds the admin command controlling the mob
|
||||
"""
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
self.add(CmdMobOnOff())
|
||||
|
||||
|
||||
class Mob(tut_objects.TutorialObject):
|
||||
"""
|
||||
This is a state-machine AI mobile. It has several states which are
|
||||
|
|
@ -91,6 +94,7 @@ class Mob(tut_objects.TutorialObject):
|
|||
happen to roam into a room with no exits.
|
||||
|
||||
"""
|
||||
|
||||
def at_init(self):
|
||||
"""
|
||||
When initialized from cache (after a server reboot), set up
|
||||
|
|
@ -122,7 +126,7 @@ class Mob(tut_objects.TutorialObject):
|
|||
self.db.patrolling_pace = 6
|
||||
self.db.aggressive_pace = 2
|
||||
self.db.hunting_pace = 1
|
||||
self.db.death_pace = 100 # stay dead for 100 seconds
|
||||
self.db.death_pace = 100 # stay dead for 100 seconds
|
||||
|
||||
# we store the call to the tickerhandler
|
||||
# so we can easily deactivate the last
|
||||
|
|
@ -179,19 +183,19 @@ class Mob(tut_objects.TutorialObject):
|
|||
we need to remember this across reloads.
|
||||
|
||||
"""
|
||||
idstring = "tutorial_mob" # this doesn't change
|
||||
idstring = "tutorial_mob" # this doesn't change
|
||||
last_interval = self.db.last_ticker_interval
|
||||
last_hook_key = self.db.last_hook_key
|
||||
if last_interval and last_hook_key:
|
||||
# we have a previous subscription, kill this first.
|
||||
TICKER_HANDLER.remove(interval=last_interval,
|
||||
callback=getattr(self, last_hook_key), idstring=idstring)
|
||||
callback=getattr(self, last_hook_key), idstring=idstring)
|
||||
self.db.last_ticker_interval = interval
|
||||
self.db.last_hook_key = hook_key
|
||||
if not stop:
|
||||
# set the new ticker
|
||||
TICKER_HANDLER.add(interval=interval,
|
||||
callback=getattr(self, hook_key), idstring=idstring)
|
||||
callback=getattr(self, hook_key), idstring=idstring)
|
||||
|
||||
def _find_target(self, location):
|
||||
"""
|
||||
|
|
@ -206,7 +210,7 @@ class Mob(tut_objects.TutorialObject):
|
|||
|
||||
"""
|
||||
targets = [obj for obj in location.contents_get(exclude=self)
|
||||
if obj.has_account and not obj.is_superuser]
|
||||
if obj.has_account and not obj.is_superuser]
|
||||
return targets[0] if targets else None
|
||||
|
||||
def set_alive(self, *args, **kwargs):
|
||||
|
|
@ -379,7 +383,6 @@ class Mob(tut_objects.TutorialObject):
|
|||
else:
|
||||
logger.log_err("Mob: mob.db.send_defeated_to not found: %s" % self.db.send_defeated_to)
|
||||
|
||||
|
||||
# response methods - called by other objects
|
||||
|
||||
def at_hit(self, weapon, attacker, damage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue