public void SetupScriptableObjects(SystemDataFactory systemDataFactory) { item = null; if (itemName != null) { Item tmpItem = systemDataFactory.GetResource <Item>(itemName); if (tmpItem != null) { item = tmpItem; } else { Debug.LogError("SystemSkillManager.SetupScriptableObjects(): Could not find item : " + itemName + " while inititalizing a vendor item. CHECK INSPECTOR"); } } itemQuality = null; if (itemQualityName != null && itemQualityName != string.Empty) { ItemQuality tmpItemQuality = systemDataFactory.GetResource <ItemQuality>(itemQualityName); if (tmpItemQuality != null) { itemQuality = tmpItemQuality; } else { Debug.LogError("SystemSkillManager.SetupScriptableObjects(): Could not find item : " + itemName + " while inititalizing a vendor item. CHECK INSPECTOR"); } } }
public override void SetGameManagerReferences() { base.SetGameManagerReferences(); uIManager = systemGameManager.UIManager; objectPooler = systemGameManager.ObjectPooler; systemDataFactory = systemGameManager.SystemDataFactory; }
// converts the currency amount to its base currency and returns it public int GetBaseCurrencyAmount(Currency currency, int currencyAmount) { //Debug.Log("CurrencyConverter.GetBaseCurrencyAmount(" + currency.DisplayName + ", " + currencyAmount + ")"); CurrencyGroup currencyGroup = FindCurrencyGroup(currency); if (currencyGroup != null) { // attemp redistribution Currency baseCurrency = currencyGroup.MyBaseCurrency; // convert everything in the group to the base amount if (SystemDataFactory.MatchResource(currency.DisplayName, currencyGroup.MyBaseCurrency.DisplayName)) { //Debug.Log("CurrencyConverter.GetBaseCurrencyAmount(" + currency.DisplayName + ", " + currencyAmount + ") return: " + currencyAmount); return(currencyAmount); } // the currency needs conversion foreach (CurrencyGroupRate currencyGroupRate in currencyGroup.MyCurrencyGroupRates) { if (SystemDataFactory.MatchResource(currencyGroupRate.Currency.DisplayName, currency.DisplayName)) { //Debug.Log("CurrencyConverter.GetBaseCurrencyAmount(" + currency.DisplayName + ", " + currencyAmount + ") return: " + (currencyGroupRate.MyBaseMultiple * currencyAmount)); return(currencyGroupRate.BaseMultiple * currencyAmount); } } //Debug.Log("CurrencyConverter.GetBaseCurrencyAmount(" + currency.DisplayName + ", " + currencyAmount + ") return: " + currencyAmount); return(currencyAmount); } //Debug.Log("CurrencyConverter.GetBaseCurrencyAmount(" + currency.DisplayName + ", " + currencyAmount + ") return: " + currencyAmount); return(currencyAmount); }
public override void SetGameManagerReferences() { base.SetGameManagerReferences(); systemDataFactory = systemGameManager.SystemDataFactory; uIManager = systemGameManager.UIManager; newGameManager = systemGameManager.NewGameManager; }
public override void SetGameManagerReferences() { base.SetGameManagerReferences(); systemDataFactory = systemGameManager.SystemDataFactory; playerManager = systemGameManager.PlayerManager; systemEventManager = systemGameManager.SystemEventManager; }
public override void Configure(SystemGameManager systemGameManager) { base.Configure(systemGameManager); playerManager = systemGameManager.PlayerManager; systemDataFactory = systemGameManager.SystemDataFactory; CreateEventSubscriptions(); }
public override void SetGameManagerReferences() { //Debug.Log("CharacterClassPrerequisite.SetGameManagerReferences()"); base.SetGameManagerReferences(); systemDataFactory = systemGameManager.SystemDataFactory; playerManager = systemGameManager.PlayerManager; systemEventManager = systemGameManager.SystemEventManager; }
public override void Configure(SystemGameManager systemGameManager) { base.Configure(systemGameManager); objectPooler = systemGameManager.ObjectPooler; systemDataFactory = systemGameManager.SystemDataFactory; newGameManager = systemGameManager.NewGameManager; }
public override void Configure(SystemGameManager systemGameManager) { base.Configure(systemGameManager); systemDataFactory = systemGameManager.SystemDataFactory; foreach (AchievementButton achievementButton in resourceButtons) { achievementButton.Configure(systemGameManager); } }
public override void SetGameManagerReferences() { base.SetGameManagerReferences(); saveManager = systemGameManager.SaveManager; systemDataFactory = systemGameManager.SystemDataFactory; characterCreatorManager = systemGameManager.CharacterCreatorManager; uIManager = systemGameManager.UIManager; levelManager = systemGameManager.LevelManager; newGameManager = systemGameManager.NewGameManager; }
/// <summary> /// used to prevent multiple copies of a unique item from dropping since the other check requires it to be in your bag, so multiple can still drop if you haven't looted a mob yet /// </summary> /// <param name="itemName"></param> /// <returns></returns> public bool droppedItemsContains(LootTableState lootTableState, string itemName) { foreach (LootDrop lootDrop in lootTableState.DroppedItems) { if ((lootDrop as ItemLootDrop) is ItemLootDrop) { } if (SystemDataFactory.MatchResource((lootDrop as ItemLootDrop).Item.DisplayName, itemName)) { return(true); } } return(false); }
/// <summary> /// Get a new copy of an item based on the factory template. This is necessary so items can be deleted without deleting the entire item from the database /// </summary> /// <param name="resourceName"></param> /// <returns></returns> public Item GetNewResource(string resourceName, ItemQuality usedItemQuality = null) { //Debug.Log(this.GetType().Name + ".GetNewResource(" + resourceName + ")"); if (!SystemDataFactory.RequestIsEmpty(resourceName)) { string keyName = SystemDataFactory.PrepareStringForMatch(resourceName); Item itemTemplate = systemDataFactory.GetResource <Item>(keyName); if (itemTemplate != null) { Item returnValue = ScriptableObject.Instantiate(itemTemplate) as Item; returnValue.SetupScriptableObjects(systemGameManager); returnValue.InitializeNewItem(usedItemQuality); return(returnValue); } } return(null); }
public TDataType GetResource <TDataType>(string resourceName) where TDataType : ResourceProfile { //Debug.Log(this.GetType().Name + ".GetResource(" + resourceName + ")"); if (!SystemDataFactory.RequestIsEmpty(resourceName)) { string keyName = SystemDataFactory.PrepareStringForMatch(resourceName); /* * foreach (string dictKeyName in factoryData.Keys) { * Debug.Log("count: " + factoryData.Count + "; " + dictKeyName); * } */ if (factoryData.ContainsKey(keyName)) { return(factoryData[keyName] as TDataType); } } return(default(TDataType)); }
public void CheckPetSpawn(IAbilityCaster source, Interactable target, AbilityEffectContext abilityEffectInput) { //Debug.Log(DisplayName + ".PetEffect.CheckPetSpawn()"); CharacterPetManager characterPetManager = null; if ((source as BaseCharacter) is BaseCharacter) { characterPetManager = (source as BaseCharacter).CharacterPetManager; } else { //Debug.Log(DisplayName + ".PetEffect.CheckPetSpawn(): source is not basecharacter"); return; } List <AbilityEffect> castList = new List <AbilityEffect>(); foreach (SummonEffect petEffect in petEffectList) { if (SystemDataFactory.MatchResource(petEffect.DisplayName, DisplayName)) { Debug.LogError(DisplayName + ".PerformAbilityEffects(): circular reference detected. Tried to cast self. CHECK INSPECTOR AND FIX ABILITY EFFECT CONFIGURATION!!!"); } else { //Debug.Log(DisplayName + ".PetEffect.CheckPetSpawn(): adding to cast list"); if (petEffect.UnitProfile != null && characterPetManager.ActiveUnitProfiles.ContainsKey(petEffect.UnitProfile) == false) { //Debug.Log(DisplayName + ".PetEffect.CheckPetSpawn(): adding cast:" + petEffect.DisplayName); castList.Add(petEffect); } } } if (castList.Count > 0) { //Debug.Log(DisplayName + ".PetEffect.CheckPetSpawn(): castlist.count: " + castList.Count); Dictionary <PrefabProfile, GameObject> rawObjectList = PerformAbilityEffects(source, target, abilityEffectInput, castList); } }
public override void SetGameManagerReferences() { base.SetGameManagerReferences(); logManager = systemGameManager.LogManager; systemDataFactory = systemGameManager.SystemDataFactory; }
public override void SetGameManagerReferences() { base.SetGameManagerReferences(); systemDataFactory = systemGameManager.SystemDataFactory; questLog = systemGameManager.QuestLog; }
public override void Configure(SystemGameManager systemGameManager) { base.Configure(systemGameManager); systemDataFactory = systemGameManager.SystemDataFactory; }