示例#1
0
 public MobileAvatar(
     World world,
     Schema.TemplateMobileRow mobile,
     Schema.TemplateObjectRow template,
     Schema.ObjectInstanceRow instance
     )
     : base(mobile, template, instance)
 {
     World = world;
 }
示例#2
0
 public MobileAvatar LoadMobile(int instanceId)
 {
     Schema.ObjectInstanceRow rpr = Global.ModelSchema.ObjectInstance.FindByObjectInstanceID(instanceId);
     if (rpr == null)
     {
         return(null);
     }
     Schema.TemplateObjectRow por = Global.ModelSchema.TemplateObject.FindByTemplateObjectID(rpr.TemplateObjectID);
     if (por == null)
     {
         return(null);
     }
     Schema.TemplateMobileRow mr = Global.ModelSchema.TemplateMobile.FindByTemplateObjectID(rpr.TemplateObjectID);
     if (mr == null)
     {
         return(null);
     }
     return(new MobileAvatar(this, mr, por, rpr));
 }
示例#3
0
 public Mobile(
     Schema.TemplateMobileRow mobile,
     Schema.TemplateObjectRow template,
     Schema.ObjectInstanceRow instance
     )
     : base(template, instance)
 {
     Level        = mobile.Level;
     Cognition    = mobile.Cognition;
     Willpower    = mobile.Willpower;
     Dexterity    = mobile.Dexterity;
     Strength     = mobile.Strength;
     Constitution = mobile.Constitution;
     Race         = (EnumRace)mobile.EnumRaceID;
     MobileSize   = (EnumMobileSize)mobile.EnumMobileSizeID;
     MobileState  = (EnumMobileState)mobile.EnumMobileStateID;
     MaxHitPoints = mobile.EnumMobileSizeID * 100 + Level * Constitution / 2;
     HitPoints    = (float)instance.HitpointsCurrent;
     MaxEnergy    = mobile.EnumMobileSizeID * 100 + Level * Constitution / 2;
     Energy       = (float)instance.EnergyCurrent;
     Possessable  = instance.GetMobilePossesableByPlayerRows().Length > 0;
 }