Пример #1
0
 private static void ShowNPCParticleEffect(SpriteBatch b, NPC instance, string key, ParticleEffectData ped)
 {
     if (!npcEffectDict.TryGetValue(instance.Name, out EntityParticleData entityParticleData))
     {
         entityParticleData           = new EntityParticleData();
         npcEffectDict[instance.Name] = entityParticleData;
     }
     if (!entityParticleData.particleDict.TryGetValue(key, out var particleList))
     {
         particleList = new List <ParticleData>();
         npcEffectDict[instance.Name].particleDict[key] = particleList;
     }
     ShowParticleEffect(b, particleList, ped, instance.GetBoundingBox().Center.ToVector2() + new Vector2(ped.fieldOffsetX, ped.fieldOffsetY), 1f);
     npcEffectDict[instance.Name] = entityParticleData;
 }
Пример #2
0
 private static void ShowFarmerParticleEffect(SpriteBatch b, Farmer instance, string key, ParticleEffectData ped)
 {
     if (!farmerEffectDict.TryGetValue(instance.UniqueMultiplayerID, out EntityParticleData entityParticleData))
     {
         entityParticleData = new EntityParticleData();
         farmerEffectDict[instance.UniqueMultiplayerID] = entityParticleData;
     }
     if (!entityParticleData.particleDict.TryGetValue(key, out var particleList))
     {
         particleList = new List <ParticleData>();
         farmerEffectDict[instance.UniqueMultiplayerID].particleDict[key] = particleList;
     }
     ShowParticleEffect(b, particleList, ped, instance.GetBoundingBox().Center.ToVector2() + new Vector2(ped.fieldOffsetX, ped.fieldOffsetY), instance.getDrawLayer());
     farmerEffectDict[instance.UniqueMultiplayerID] = entityParticleData;
 }
Пример #3
0
        private static void ShowLocationParticleEffect(SpriteBatch b, GameLocation instance, ParticleEffectData ped)
        {
            if (!locationEffectDict.TryGetValue(instance.Name, out EntityParticleData entityParticleData))
            {
                entityParticleData = new EntityParticleData();
                locationEffectDict[instance.Name] = entityParticleData;
            }
            List <ParticleData> particleList;

            if (!entityParticleData.particleDict.TryGetValue(ped.key, out particleList))
            {
                particleList = new List <ParticleData>();
                locationEffectDict[instance.Name].particleDict[ped.key] = particleList;
            }
            ShowParticleEffect(b, particleList, ped, new Vector2(ped.fieldOffsetX, ped.fieldOffsetY), 1f);
            locationEffectDict[instance.Name] = entityParticleData;
        }
Пример #4
0
        private static void ShowObjectParticleEffect(SpriteBatch b, Object instance, int x, int y, string key, ParticleEffectData ped)
        {
            var oKey = instance.Name + "|" + x + "," + y;

            if (!objectEffectDict.TryGetValue(oKey, out EntityParticleData entityParticleData))
            {
                entityParticleData     = new EntityParticleData();
                objectEffectDict[oKey] = entityParticleData;
            }
            if (!entityParticleData.particleDict.TryGetValue(key, out var particleList))
            {
                particleList = new List <ParticleData>();
                objectEffectDict[oKey].particleDict[key] = particleList;
            }
            ShowParticleEffect(b, particleList, ped, instance.getBoundingBox(new Vector2(x, y)).Center.ToVector2() + new Vector2(ped.fieldOffsetX, ped.fieldOffsetY), Math.Max(0f, ((y + 1) * 64 - 24) / 10000f) + x * 1E-05f);
            objectEffectDict[oKey] = entityParticleData;
        }