<s> """<STR_LIT>""" <EOL> from evennia import DefaultExit , utils , Command <EOL> MOVE_DELAY = { "<STR_LIT>" : <NUM_LIT:6> , <EOL> "<STR_LIT>" : <NUM_LIT:4> , <EOL> "<STR_LIT>" : <NUM_LIT:2> , <EOL> "<STR_LIT>" : <NUM_LIT:1> } <EOL> class SlowExit ( DefaultExit ) : <EOL> """<STR_LIT>""" <EOL> def at_traverse ( self , traversing_object , target_location ) : <EOL> """<STR_LIT>""" <EOL> move_speed = traversing_object . db . move_speed or "<STR_LIT>" <EOL> move_delay = MOVE_DELAY . get ( move_speed , <NUM_LIT:4> ) <EOL> def move_callback ( ) : <EOL> "<STR_LIT>" <EOL> source_location = traversing_object . location <EOL> if traversing_object . move_to ( target_location ) : <EOL> self . at_after_traverse ( traversing_object , source_location ) <EOL> else : <EOL> if self . db . err_traverse : <EOL> self . caller . msg ( self . db . err_traverse ) <EOL> else : <EOL> self . at_failed_traverse ( traversing_object ) <EOL> traversing_object . msg ( "<STR_LIT>" % ( self . key , move_speed ) ) <EOL> deferred = utils . delay ( move_delay , callback = move_callback ) <EOL> traversing_object . ndb . currently_moving = deferred <EOL> SPEED_DESCS = { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> class CmdSetSpeed ( Command ) : <EOL> """<STR_LIT>""" <EOL> key = "<STR_LIT>" <EOL> def func ( self ) : <EOL> """<STR_LIT>""" <EOL> speed = self . args . lower ( ) . strip ( ) <EOL> if speed not in SPEED_DESCS : <EOL> self . caller . msg ( "<STR_LIT>" ) <EOL> elif self . caller . db . move_speed == speed : <EOL> self . caller . msg ( "<STR_LIT>" % SPEED_DESCS [ speed ] ) <EOL> else : <EOL> self . caller . db . move_speed = speed <EOL> self . caller . msg ( "<STR_LIT>" % SPEED_DESCS [ speed ] ) <EOL> class CmdStop ( Command ) : <EOL> """<STR_LIT>""" <EOL> key = "<STR_LIT>" <EOL> def func ( self ) : <EOL> """<STR_LIT>""" <EOL> currently_moving = self . caller . ndb . currently_moving <EOL> if currently_moving : <EOL> currently_moving . cancel ( ) <EOL> self . caller . msg ( "<STR_LIT>" ) <EOL> else : <EOL> self . caller . msg ( "<STR_LIT>" ) </s>
