Beispiel #1
0
 public ActorStats(System.IO.BinaryReader 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();
 }
Beispiel #2
0
 public ActorStats()
 {
     pvp                    = true;
     team                   = -1;
     life                   = new Container(50, 50);
     breath                 = new FloatContainer(15f, 15f);
     power                  = new Container(100, 100);
     share_power            = true;
     ammo                   = new Container(0, 0);
     experience             = 0;
     level                  = 1 + (int)Math.Pow(experience / 5, .5f);
     experience_to_level    = new Container(0, (int)Math.Pow((level), 2) * 5);
     complexity             = 12;
     armor                  = "0";
     jump_speed             = 350f;
     run_speed              = 350f;
     jump_max_time          = 0.20f;
     jump_cur_time          = 0f; //not written
     can_swim               = true;
     boyant                 = false;
     jump_can_resume        = false;
     life_regen             = 0f;
     accum_life_regen       = 0f;
     ammo_regen             = 0f;
     accum_ammo_regen       = 0f;
     energy_regen           = 0f;
     accum_energy_regen     = 0f;
     water_jump_proficiency = 0.55f;
     max_safe_fall          = 500;
     //(int)Math.Pow((plevel-1),2)*5; <-- formula for experience required to reach level plevel.
 }