<s> from lampost . context . resource import m_requires <EOL> from lampost . datastore . dbofield import DBOField , DBOLField <EOL> from lampost . env . room import Room <EOL> from lampost . gameops . action import ActionError <EOL> from lampost . context . config import m_configured <EOL> from lampost . lpmud . entity import EntityLP <EOL> from lampost . model . item import BaseItem <EOL> from lampost . model . player import Player <EOL> m_requires ( __name__ , '<STR_LIT>' , '<STR_LIT>' ) <EOL> m_configured ( __name__ , '<STR_LIT>' ) <EOL> class PlayerLP ( Player , EntityLP , BaseItem ) : <EOL> dbo_key_type = '<STR_LIT>' <EOL> race = DBOLField ( dbo_class_id = '<STR_LIT>' ) <EOL> affinity = '<STR_LIT>' <EOL> skills = DBOField ( { } , '<STR_LIT>' ) <EOL> touchstone = DBOField ( ) <EOL> can_die = True <EOL> size = DBOField ( '<STR_LIT>' ) <EOL> def on_loaded ( self ) : <EOL> self . auto_fight = False <EOL> for skill in self . skills . values ( ) : <EOL> self . _apply_skill ( skill ) <EOL> def check_logout ( self ) : <EOL> if self . last_opponent : <EOL> self . display_line ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> if self . imm_level : <EOL> self . display_line ( "<STR_LIT>" ) <EOL> raise ActionError ( ) <EOL> def status_change ( self ) : <EOL> if not self . session : <EOL> return <EOL> status = self . display_status <EOL> if self . last_opponent and self . last_opponent . env == self . env : <EOL> status [ '<STR_LIT>' ] = self . last_opponent . display_status <EOL> status [ '<STR_LIT>' ] [ '<STR_LIT:name>' ] = self . last_opponent . name <EOL> else : <EOL> status [ '<STR_LIT>' ] = None <EOL> self . session . update_status ( status ) <EOL> def die ( self ) : <EOL> if not self . can_die : <EOL> self . broadcast ( s = "<STR_LIT>" , e = "<STR_LIT>" ) <EOL> self . health = <NUM_LIT:1> <EOL> self . start_refresh ( ) <EOL> return <EOL> self . display_line ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> self . display_line ( "<STR_LIT>" <EOL> "<STR_LIT>" , '<STR_LIT>' ) <EOL> self . _death_effects ( ) <EOL> self . _bind_pulse = register_once ( self . resurrect , seconds = <NUM_LIT> ) <EOL> self . status_change ( ) <EOL> def resurrect ( self , auto = True ) : <EOL> unregister ( self . _bind_pulse ) <EOL> del self . _bind_pulse <EOL> res_room = None <EOL> if self . touchstone : <EOL> res_room = load_object ( self . touchstone , Room ) <EOL> if not res_room : <EOL> res_room = load_object ( default_start_room , Room ) <EOL> self . change_env ( res_room ) <EOL> self . display_line ( "<STR_LIT>" ) <EOL> self . status = '<STR_LIT>' <EOL> self . heath = <NUM_LIT:1> <EOL> self . start_refresh ( ) </s>
