public SpecialShipWeaponComponentData(XElement element) : base(element)
 {
     gen = new WeaponGenList {
         id              = element.GetString("wid"),
         template        = element.GetString("template"),
         level           = element.GetInt("level"),
         optimalDistance = element.GetFloat("od"),
         color           = (ObjectColor)Enum.Parse(typeof(ObjectColor), element.GetString("color")),
         critChance      = element.GetFloat("crit_chance"),
         workshop        = (Workshop)Enum.Parse(typeof(Workshop), element.GetString("workshop")),
         rocketDamage    = element.GetFloat("rocket_dmg"),
         acidDamage      = element.GetFloat("acid_dmg"),
         laserDamage     = element.GetFloat("laser_dmg"),
         baseType        = (WeaponBaseType)Enum.Parse(typeof(WeaponBaseType), element.GetString("base_type"))
     };
 }
Пример #2
0
 public WeaponObject(WeaponGenList gen)
 {
     this.id              = gen.id;
     this.template        = gen.template;
     this.level           = gen.level;
     this.optimalDistance = gen.optimalDistance;
     this.color           = gen.color;
     this.damageType      = WeaponDamageType.damage;
     this.baseCritChance  = gen.critChance;
     this.mWorkshop       = (byte)gen.workshop;
     this.binded          = false;
     this.isNew           = false;
     m_Damage.SetRocketDamage(gen.rocketDamage);
     m_Damage.SetLaserDamage(gen.laserDamage);
     m_Damage.SetAcidDamage(gen.acidDamage);
     m_Damage.SetBaseType(gen.baseType);
     mRaw = GetInfo();
 }