static void DataChangeCallback(StatMessaging.Change[] obj) { foreach (StatMessaging.Change change in obj) { if (change.action == StatMessaging.ChangeType.added || change.action == StatMessaging.ChangeType.modified) { CreaturePresenter.TryGetAsset(change.cid, out CreatureBoardAsset creatureAsset); UpdatePersistentEffect(creatureAsset, change.value); } } }
private static void InitializeFromEffectName(string creatureId, string effectName, string name) { CreaturePresenter.TryGetAsset(new CreatureGuid(creatureId), out CreatureBoardAsset creatureAsset); if (creatureAsset != null) { PersistentEffects.InitializeMiniAsEffect(creatureAsset, effectName, name); } else { Log.Debug($"creatureAsset is null this update cycle...."); } }
private static void InitializeFromPersistentEffect(string creatureId, IOldPersistentEffect persistentEffect, string newCreatureName) { CreaturePresenter.TryGetAsset(new CreatureGuid(creatureId), out CreatureBoardAsset creatureAsset); if (creatureAsset != null) { PersistentEffects.InitializeMiniFromPersistentEffect(creatureAsset, persistentEffect, newCreatureName); } else { Log.Warning($"creatureAsset is null (ID = {creatureId}) this update cycle...."); } }
public static void TryCreateCrocodile(Vector3 position) { //CreatureManager.CreateAndAddNewCreature(data, position, rotation) CreaturePresenter.TryGetAsset(new CreatureGuid("ff5f5a76-bef7-4f83-a823-dd1be9dc01f3"), out CreatureBoardAsset crocodile); if (crocodile != null) { Log.Debug($"Crocodile created."); CreaturePresenter.TeleportCreature(crocodile, position); } else { Log.Debug($"Crocodile not found."); } }