Esempio n. 1
0
        public AircraftData(int entityId, int typeId, CampType camp)
            : base(entityId, typeId, camp)
        {
            IDataTable <DRAircraft> dtAircraft = GameEntry.DataTable.GetDataTable <DRAircraft>();
            DRAircraft drAircraft = dtAircraft.GetDataRow(TypeId);

            if (drAircraft == null)
            {
                return;
            }

            m_ThrusterData = new ThrusterData(GameEntry.Entity.GenerateSerialId(), drAircraft.ThrusterId, Id, Camp);

            for (int index = 0, weaponId = 0; (weaponId = drAircraft.GetWeaponIdAt(index)) > 0; index++)
            {
                AttachWeaponData(new WeaponData(GameEntry.Entity.GenerateSerialId(), weaponId, Id, Camp));
            }

            for (int index = 0, armorId = 0; (armorId = drAircraft.GetArmorIdAt(index)) > 0; index++)
            {
                AttachArmorData(new ArmorData(GameEntry.Entity.GenerateSerialId(), armorId, Id, Camp));
            }

            m_DeadEffectId = drAircraft.DeadEffectId;
            m_DeadSoundId  = drAircraft.DeadSoundId;

            HP = m_MaxHP;
        }
Esempio n. 2
0
        protected internal override void OnShow(object userData)
#endif
        {
            base.OnShow(userData);

            m_ThrusterData = userData as ThrusterData;
            if (m_ThrusterData == null)
            {
                Log.Error("Thruster data is invalid.");
                return;
            }

            GameEntry.Entity.AttachEntity(this, m_ThrusterData.OwnerId, AttachPoint);
        }
Esempio n. 3
0
 public static void ShowThruster(this EntityComponent entityComponent, ThrusterData data)
 {
     entityComponent.ShowEntity(typeof(Thruster), "Thruster", Constant.AssetPriority.ThrusterAsset, data);
 }