Example #1
0
            private static void SavePersistentEffect(CreatureBoardAsset creatureAsset, IOldPersistentEffect persistentEffect)
            {
                Log.Indent();
                string defaultNewEffect = JsonConvert.SerializeObject(persistentEffect);

                if (!creatureAsset.HasAttachedData(STR_PersistentEffect))
                {
                    Log.Warning($"SavePersistentEffect -- StatMessaging.SetInfo({creatureAsset.CreatureId}, {defaultNewEffect})");
                    StatMessaging.SetInfo(creatureAsset.CreatureId, STR_PersistentEffect, defaultNewEffect);
                }
                else
                {
                    Log.Warning($"  Attached data = \"{creatureAsset.GetAttachedData()[STR_PersistentEffect]}\"");
                }
                Log.Unindent();
            }
Example #2
0
            private static bool IsMiniAnUninitializedEffect(CreatureBoardAsset creatureAsset)
            {
                if (!creatureAsset.HasAttachedData(STR_PersistentEffect))
                {
                    return(false);
                }

                GameObject assetLoader = creatureAsset.GetAssetLoader();

                if (assetLoader == null)
                {
                    return(false);
                }

                GameObject goatClone = assetLoader.FindChild(STR_UninitializedMiniMeshName);

                return(goatClone != null);
            }
Example #3
0
            private static void AttachEffect(CreatureBoardAsset creatureAsset, IOldPersistentEffect persistentEffect, string newCreatureName)
            {
                if (persistentEffect == null)
                {
                    Log.Error($"AttachEffect - persistentEffect is null!!!");
                    return;
                }

                if (creatureAsset == null)
                {
                    Log.Error($"AttachEffect - creatureAsset is null!");
                    return;
                }

                if (!creatureAsset.HasAttachedData(STR_PersistentEffect))
                {
                    savedEffectsData.Add(new SavedCreatureEffect(creatureAsset.CreatureId, persistentEffect, newCreatureName));
                }

                AttachEffects(creatureAsset, persistentEffect);
            }