Exemplo n.º 1
0
        public static EntityEquipableAbility ReadEntityEquipableAbility(this NetworkReader reader)
        {
            AbilityData        ability         = (AbilityData)PinouApp.Resources.Data.Databases.GetItem(DatabaseType.Ability, reader.ReadInt32());
            bool               overrideTrigger = reader.ReadBoolean();
            AbilityTriggerData triggerData     = null;

            if (overrideTrigger)
            {
                triggerData = reader.ReadAbilityTriggerData();
            }
            bool  overrideCooldown = reader.ReadBoolean();
            float cooldown         = 0f;

            if (overrideCooldown)
            {
                cooldown = (float)reader.ReadDouble();
            }

            int abilitiesResourcesInfluencesLength = reader.ReadInt32();

            EntityEquipableAbilityResourcesInfluences[] abilitiesResourcesInfluences = new EntityEquipableAbilityResourcesInfluences[abilitiesResourcesInfluencesLength];
            for (int i = 0; i < abilitiesResourcesInfluencesLength; i++)
            {
                abilitiesResourcesInfluences[i] = reader.ReadEntityEquipableAbilityResourcesInfluences();
            }

            return(new EntityEquipableAbility(
                       ability,
                       overrideTrigger,
                       triggerData,
                       overrideCooldown,
                       cooldown,
                       abilitiesResourcesInfluences));
        }
Exemplo n.º 2
0
 public static void EntityEquipableAbilityResourcesInfluences(this NetworkWriter writer, EntityEquipableAbilityResourcesInfluences eeari)
 {
     writer.WriteAbilitiesResourcesInfluenceData(eeari.AbilitiesResourcesInfluences);
     writer.WriteBoolean(eeari.UseFlat);
     writer.WriteDouble(eeari.Flat);
     writer.WriteBoolean(eeari.UseFactor);
     writer.WriteDouble(eeari.Factor);
 }