Esempio n. 1
0
 public ActorStats(Lidgren.Network.NetIncomingMessage r)
 {
     life        = new Container(r);
     breath      = new FloatContainer(r);
     power       = new Container(r);
     share_power = r.ReadBoolean();
     ammo        = new Container(r);
     experience  = r.ReadInt32();
     level       = 1 + (int)Math.Pow(experience / 5, .5f);
     if (level > 1)
     {
         experience_to_level = new Container(experience - ((int)Math.Pow((level - 1), 2) * 5), ((int)Math.Pow((level), 2) * 5) - (int)Math.Pow((level - 1), 2) * 5);
     }
     else
     {
         experience_to_level = new Container(experience, (int)Math.Pow((level), 2) * 5);
     }
     complexity             = r.ReadInt32();
     armor                  = r.ReadString();
     jump_speed             = r.ReadSingle();
     run_speed              = r.ReadSingle();
     jump_max_time          = r.ReadSingle();
     jump_cur_time          = 0f;
     can_swim               = r.ReadBoolean();
     boyant                 = r.ReadBoolean();
     jump_can_resume        = r.ReadBoolean();
     life_regen             = r.ReadSingle();
     accum_life_regen       = 0f;
     ammo_regen             = r.ReadSingle();
     accum_ammo_regen       = 0f;
     energy_regen           = r.ReadSingle();
     accum_energy_regen     = 0f;
     water_jump_proficiency = r.ReadSingle();
     max_safe_fall          = r.ReadInt32();
 }
Esempio n. 2
0
 public DamageMove(Lidgren.Network.NetIncomingMessage p)
 {
     time_execute = p.ReadSingle();
     attacker     = (TargetType)p.ReadByte();
     attacker_id  = p.ReadUInt16();
     target       = (TargetType)p.ReadByte();
     target_id    = p.ReadUInt16();
     damage       = p.ReadInt16();
     damage_code  = (CauseDamage)p.ReadByte();
     range        = p.ReadUInt16();
 }
Esempio n. 3
0
 public FloatContainer(Lidgren.Network.NetIncomingMessage r)
 {
     max_val = r.ReadSingle();
     cur_val = r.ReadSingle();
     percent = (float)Math.Round(cur_val / max_val, 3);
 }