public void BuildAllRequirementPanelsFromData(AbilityInfoSheet sheet, AbilityDataSO data) { Debug.Log("AbilityInfoSheetController.BuildAllRequirementPanelsFromData() called..."); BuildTalentRequirementPanelFromData(sheet, data); BuildWeaponRequirementPanelFromData(sheet, data); }
private void BuildWeaponRequirementPanelFromData(AbilityInfoSheet sheet, AbilityDataSO data) { Debug.Log("AbilityInfoSheetController.BuildWeaponRequirementPanelFromData() called..."); // Disable panel view on refresh sheet.weaponRequirementParent.SetActive(false); string weaponTypeString = ""; bool activated = false; if (data.requiresMeleeWeapon) { activated = true; weaponTypeString = "Melee Weapon"; } else if (data.requiresRangedWeapon) { activated = true; weaponTypeString = "Ranged Weapon"; } else if (data.requiresShield) { activated = true; weaponTypeString = "Shield"; } if (activated) { // Enable panel view sheet.weaponRequirementParent.SetActive(true); // Set text value sheet.weaponRequirmentText.text = "Requires: " + weaponTypeString; } }
// Initialization + Setup #region public void SetupBaseProperties(AbilityDataSO abilityFromLibrary) { myAbilityData = abilityFromLibrary; // only for defenders. enemies don't have ability button gameobjects if (abilityImage) { abilityImage.sprite = abilityFromLibrary.sprite; } // Set base properties abilityName = abilityFromLibrary.abilityName; abilityDescription = abilityFromLibrary.description; abilityBaseCooldownTime = abilityFromLibrary.baseCooldownTime; abilityEnergyCost = abilityFromLibrary.energyCost; abilityRange = abilityFromLibrary.range; abilityPrimaryValue = abilityFromLibrary.primaryValue; abilitySecondaryValue = abilityFromLibrary.secondaryValue; abilityDamageType = abilityFromLibrary.damageType; abilityType = abilityFromLibrary.abilityType; weaponDamagePercentage = abilityFromLibrary.weaponDamagePercentage; requiresMeleeWeapon = abilityFromLibrary.requiresMeleeWeapon; requiresRangedWeapon = abilityFromLibrary.requiresRangedWeapon; requiresShield = abilityFromLibrary.requiresShield; // Set up info panel for defenders if (myLivingEntity != null && myLivingEntity.defender) { AbilityInfoSheetController.Instance.BuildSheetFromData(abilityInfoSheet, abilityFromLibrary, AbilityInfoSheet.PivotDirection.Upwards); } }
private void BuildTalentRequirementPanelFromData(AbilityInfoSheet sheet, AbilityDataSO data) { Debug.Log("AbilityInfoSheetController.BuildTalentRequirementPanelFromData() called..."); // Disable panel view on refresh sheet.talentRequirmentParent.SetActive(false); string talentTypeString = ""; string tierString = ""; bool activated = false; if (data.abilitySchool != AbilityDataSO.AbilitySchool.None) { activated = true; // convert talent type enum to string talentTypeString = data.abilitySchool.ToString(); tierString = data.tier.ToString(); } if (activated) { // Enable panel view sheet.talentRequirmentParent.SetActive(true); // Set text value sheet.talentRequirmentText.text = "Requires: " + talentTypeString + " " + tierString; } }
// Initialization + Setup #region public void BuildFromData(AbilityDataSO data) { myData = data; // reset button scale buttonScale = 1; ResetScale(); ribbonNameText.text = data.abilityName; AbilityInfoSheetController.Instance.BuildSheetFromData(abilityInfoSheet, data, AbilityInfoSheet.PivotDirection.Downwards); // Randomize and set gold cost if (data.tier == 1) { goldCost = Random.Range(4, 7); } else if (data.tier == 2) { goldCost = Random.Range(7, 10); } else if (data.tier == 3) { goldCost = Random.Range(10, 13); } goldCostText.text = goldCost.ToString(); // Enable Views EnableSlotView(); SetBookImage(); }
// Create card Overlays #region public Action CreateAbilityCardRewardEffect(AbilityDataSO abilityData) { Action action = new Action(); StartCoroutine(CreateAbilityCardRewardEffectCoroutine(abilityData, action)); return(action); }
// Conditional Checks #region public bool IsTomeDropActionValid(AbilityDataSO data, CharacterData character) { Debug.Log("InventoryController.IsTomeDropActionValid() called, checking validity of placing " + data.abilityName + " tome on " + character.myName + "'s drop slot..."); bool boolReturned = true; // check if character has already learnt the ability if (character.DoesCharacterAlreadyKnowAbility(data)) { InvalidActionManager.Instance.ShowNewErrorMessage("Character already knows " + data.abilityName); Debug.Log("Tome drop action invalid: " + character.myName + " already knows " + data.abilityName); boolReturned = false; } // check that character meets tier requirments else if (!character.DoesCharacterMeetAbilityTierRequirment(data)) { Debug.Log("Tome drop action invalid: " + character.myName + " does not meet ability tier requirmens of " + data.abilityName); InvalidActionManager.Instance.ShowNewErrorMessage("Character does not meet the talent requirments of " + data.abilityName); boolReturned = false; } // return evaluation return(boolReturned); }
// Initialization + Setup #region public void BuildFromAbilityData(AbilityDataSO data) { myData = data; AbilityInfoSheetController.Instance.BuildSheetFromData(abilityInfoSheet, data, AbilityInfoSheet.PivotDirection.Downwards); SetBookImage(); }
public void InitializeSetup(AbilityDataSO abilityData) { nameText.text = abilityData.abilityName; apCostText.text = abilityData.abilityAPCost.ToString(); rangeText.text = abilityData.abilityRange.ToString(); coolDownText.text = abilityData.abilityBaseCooldownTime.ToString(); descriptionText.text = abilityData.abilityDescription; myImage.sprite = abilityData.abilityImage; }
public void SetUpAbilityTabAsAbility(AbilityDataSO data) { isAbility = true; isPassive = false; myAbilityData = data; myPassiveData = null; abilityImage.sprite = data.sprite; AbilityInfoSheetController.Instance.BuildSheetFromData(abilityInfoSheet, data, AbilityInfoSheet.PivotDirection.Upwards); }
public void SetUpAbilityTabAsPassive(StatusIconDataSO data, int stacks) { isPassive = true; isAbility = false; myAbilityData = null; myPassiveData = data; passiveStacks = stacks; passiveImage.sprite = data.statusSprite; PassiveInfoSheetController.Instance.BuildSheetFromData(passiveInfoSheet, data, stacks, PassiveInfoSheet.PivotDirection.Upwards); }
public void BuildTalentInfoPanelFromAbilityData(Talent talent) { // Get data AbilityDataSO data = AbilityLibrary.Instance.GetAbilityByName(talent.talentName); // Set button image talent.talentImage.sprite = data.sprite; // build text and images assets AbilityInfoSheetController.Instance.BuildSheetFromData(talent.abilityInfoSheet, data, AbilityInfoSheet.PivotDirection.Upwards); TextLogic.SetAbilityDescriptionText(data, talent.abilityInfoSheet.descriptionText); }
public void BuildAllTextValueViewsFromData(AbilityInfoSheet sheet, AbilityDataSO data) { Debug.Log("AbilityInfoSheetController.BuildAllTextValueViewsFromData() called..."); // Set up text files sheet.nameText.text = data.abilityName; sheet.cooldownText.text = data.baseCooldownTime.ToString(); sheet.rangeText.text = data.range.ToString(); sheet.energyCostText.text = data.energyCost.ToString(); TextLogic.SetAbilityDescriptionText(data, sheet.descriptionText); sheet.abilityImage.sprite = data.sprite; }
// Initialization + Setup #region public void BuildSheetFromData(AbilityInfoSheet sheet, AbilityDataSO data, AbilityInfoSheet.PivotDirection pivotDirection) { Debug.Log("AbilityInfoSheetController.BuildSheetFromData() called..."); sheet.myData = data; //SetPivotDirection(sheet, pivotDirection); BuildAllTextValueViewsFromData(sheet, data); BuildAbilityTypeIconViewsFromData(sheet, data); BuildAllRequirementPanelsFromData(sheet, data); RefreshAllLayoutGroups(sheet); }
// Logic public void InitializeSetup(TalentTree talentTree, AbilityDataSO data, int treePosition) { myTalentTree = talentTree; myCharacterData = talentTree.myCharacterData; talentTreePosition = treePosition; talentName = data.abilityName; talentNameText.text = data.abilityName; talentDescriptionText.text = data.abilityDescription; talentAPText.text = data.abilityAPCost.ToString(); talentRangeText.text = data.abilityRange.ToString(); talentCDText.text = data.abilityBaseCooldownTime.ToString(); talentImage.sprite = data.abilityImage; }
public void ApplyTalentAbilityToCharacter(CharacterData character, Talent talent) { Debug.Log("TalentController.ApplyTalentAbilityToCharacter() called..."); AbilityDataSO data = talent.myAbilityData; if (data == null) { Debug.Log("ApplyTalentAbilityToCharacter.ApplyTalentAbilityToCharacter() revieved null talent argument, searching for clone in Ability Library instead."); data = AbilityLibrary.Instance.GetAbilityByName(talent.talentName); } // Modify character data character.HandleLearnAbility(data); }
public AbilityDataSO GetRandomValidAbilityTomeAbility() { Debug.Log("AbilityLibrary.GetRandomValidAbilityTomeAbility() called..."); List <AbilityDataSO> validAbilities = new List <AbilityDataSO>(); AbilityDataSO dataReturned = null; foreach (AbilityDataSO data in AllAbilities) { if (data.abilitySchool != AbilityDataSO.AbilitySchool.None) { validAbilities.Add(data); } } dataReturned = validAbilities[Random.Range(0, validAbilities.Count)]; Debug.Log("AbilityLibrary.GetRandomValidAbilityTomeAbility() returning " + dataReturned.abilityName); return(dataReturned); }
/* * public void PopulateAbilityLibrary() * { * CreateMoveData(); * CreateStrikeData(); * CreateBlockData(); * CreateChargeData(); * CreateInspireData(); * CreateGuardData(); * CreateMeteorData(); * CreateTelekinesisData(); * CreateFrostBoltData(); * CreateFireBallData(); * CreateShootData(); * CreateRapidFireData(); * CreateImpalingBoltData(); * CreateForestMedicineData(); * CreateWhirlwindData(); * CreateSummonUndeadData(); * CreateChaosBoltData(); * CreateCrushingBlowData(); * CreateEnvigorateData(); * CreateHolyFireData(); * CreateVoidBombData(); * CreateNightmareData(); * CreateTwinStrikeData(); * CreateDashData(); * CreatePreparationData(); * CreateSnipeData(); * CreateHealingLightData(); * CreateRockTossData(); * CreateSiphonLifeData(); * CreateTeleportData(); * CreateSliceAndDiceData(); * CreatePoisonDartData(); * CreateChemicalReactionData(); * CreateBloodLustData(); * CreateGetDownData(); * CreateDoomData(); * CreateSmashData(); * CreateLightningShieldData(); * CreateElectricalDischargeData(); * CreateChainLightningData(); * CreatePrimalBlastData(); * CreatePrimalRageData(); * CreatePhaseShiftData(); * CreateSanctityData(); * CreateBlessData(); * } * * * * public void CreateInspireData() * { * Ability inspire = gameObject.AddComponent<Ability>(); * //Ability move = new Ability(); * * inspire.abilityImage = inspireImage; * inspire.abilityName = inspireName; * inspire.abilityDescription = inspireDescription; * inspire.abilityBaseCooldownTime = inspireCooldownTime; * inspire.abilityAPCost = inspireAPCost; * inspire.abilityRange = inspireRange; * inspire.abilityPrimaryValue = inspirePrimaryValue; * inspire.abilitySecondaryValue = inspireSecondaryValue; * * AllAbilities.Add(inspire); * } * * public void CreateMoveData() * { * Ability move = gameObject.AddComponent<Ability>(); * //Ability move = new Ability(); * * move.abilityImage = moveImage; * move.abilityName = moveName; * move.abilityDescription = moveDescription; * move.abilityBaseCooldownTime = moveCooldownTime; * move.abilityAPCost = moveAPCost; * move.abilityRange = moveRange; * move.abilityPrimaryValue = movePrimaryValue; * move.abilitySecondaryValue = moveSecondaryValue; * * AllAbilities.Add(move); * } * * public void CreateStrikeData() * { * //Ability strike = new Ability(); * Ability strike = gameObject.AddComponent<Ability>(); * * strike.abilityImage = strikeImage; * strike.abilityName = strikeName; * strike.abilityDescription = strikeDescription; * strike.abilityBaseCooldownTime = strikeCooldownTime; * strike.abilityAPCost = strikeAPCost; * strike.abilityRange = strikeRange; * strike.abilityPrimaryValue = strikePrimaryValue; * strike.abilitySecondaryValue = strikeSecondaryValue; * * AllAbilities.Add(strike); * } * * public void CreateBlockData() * { * * Ability block = gameObject.AddComponent<Ability>(); * * block.abilityImage = blockImage; * block.abilityName = blockName; * block.abilityDescription = blockDescription; * block.abilityBaseCooldownTime = blockCooldownTime; * block.abilityAPCost = blockAPCost; * block.abilityRange = blockRange; * block.abilityPrimaryValue = blockPrimaryValue; * block.abilitySecondaryValue = blockSecondaryValue; * * AllAbilities.Add(block); * } * * public void CreateChargeData() * { * //Ability charge = new Ability(); * Ability charge = gameObject.AddComponent<Ability>(); * * charge.abilityImage = chargeImage; * charge.abilityName = chargeName; * charge.abilityDescription = chargeDescription; * charge.abilityBaseCooldownTime = chargeCooldownTime; * charge.abilityAPCost = chargeAPCost; * charge.abilityRange = chargeRange; * charge.abilityPrimaryValue = chargePrimaryValue; * charge.abilitySecondaryValue = chargeSecondaryValue; * * AllAbilities.Add(charge); * } * * public void CreateGuardData() * { * //Ability strike = new Ability(); * Ability guard = gameObject.AddComponent<Ability>(); * * guard.abilityImage = guardImage; * guard.abilityName = guardName; * guard.abilityDescription = guardDescription; * guard.abilityBaseCooldownTime = guardCooldownTime; * guard.abilityAPCost = guardAPCost; * guard.abilityRange = guardRange; * guard.abilityPrimaryValue = guardPrimaryValue; * guard.abilitySecondaryValue = guardSecondaryValue; * * AllAbilities.Add(guard); * } * * public void CreateMeteorData() * { * //Ability strike = new Ability(); * Ability meteor = gameObject.AddComponent<Ability>(); * * * meteor.abilityName = meteorName; * meteor.abilityDescription = meteorDescription; * meteor.abilityBaseCooldownTime = meteorCooldownTime; * meteor.abilityAPCost = meteorAPCost; * meteor.abilityRange = meteorRange; * meteor.abilityPrimaryValue = meteorPrimaryValue; * meteor.abilitySecondaryValue = meteorSecondaryValue; * meteor.abilityImage = meteorImage; * * AllAbilities.Add(meteor); * } * * public void CreateTelekinesisData() * { * Ability telekinesis = gameObject.AddComponent<Ability>(); * //Ability move = new Ability(); * * telekinesis.abilityImage = telekinesisImage; * telekinesis.abilityName = telekinesisName; * telekinesis.abilityDescription = telekinesisDescription; * telekinesis.abilityBaseCooldownTime = telekinesisCooldownTime; * telekinesis.abilityAPCost = telekinesisAPCost; * telekinesis.abilityRange = telekinesisRange; * telekinesis.abilityPrimaryValue = telekinesisPrimaryValue; * telekinesis.abilitySecondaryValue = telekinesisSecondaryValue; * * AllAbilities.Add(telekinesis); * } * * public void CreateFrostBoltData() * { * Ability frostbolt = gameObject.AddComponent<Ability>(); * * frostbolt.abilityName = frostboltName; * frostbolt.abilityDescription = frostboltDescription; * frostbolt.abilityBaseCooldownTime = frostboltCooldownTime; * frostbolt.abilityAPCost = frostboltAPCost; * frostbolt.abilityRange = frostboltRange; * frostbolt.abilityPrimaryValue = frostboltPrimaryValue; * frostbolt.abilitySecondaryValue = frostboltSecondaryValue; * frostbolt.abilityImage = frostboltImage; * * AllAbilities.Add(frostbolt); * } * * public void CreateFireBallData() * { * Ability fireball = gameObject.AddComponent<Ability>(); * * fireball.abilityName = fireballName; * fireball.abilityDescription = fireballDescription; * fireball.abilityBaseCooldownTime = fireballCooldownTime; * fireball.abilityAPCost = fireballAPCost; * fireball.abilityRange = fireballRange; * fireball.abilityPrimaryValue = fireballPrimaryValue; * fireball.abilitySecondaryValue = fireballSecondaryValue; * fireball.abilityImage = fireballImage; * * AllAbilities.Add(fireball); * } * * public void CreateShootData() * { * Ability shoot = gameObject.AddComponent<Ability>(); * * shoot.abilityName = shootName; * shoot.abilityDescription = shootDescription; * shoot.abilityBaseCooldownTime = shootCooldownTime; * shoot.abilityAPCost = shootAPCost; * shoot.abilityRange = shootRange; * shoot.abilityPrimaryValue = shootPrimaryValue; * shoot.abilitySecondaryValue = shootSecondaryValue; * shoot.abilityImage = shootImage; * * AllAbilities.Add(shoot); * } * * public void CreateRapidFireData() * { * Ability rapidFire = gameObject.AddComponent<Ability>(); * * rapidFire.abilityName = rapidFireName; * rapidFire.abilityDescription = rapidFireDescription; * rapidFire.abilityBaseCooldownTime = rapidFireCooldownTime; * rapidFire.abilityAPCost = rapidFireAPCost; * rapidFire.abilityRange = rapidFireRange; * rapidFire.abilityPrimaryValue = rapidFirePrimaryValue; * rapidFire.abilitySecondaryValue = rapidFireSecondaryValue; * rapidFire.abilityImage = rapidFireImage; * * AllAbilities.Add(rapidFire); * } * * public void CreateImpalingBoltData() * { * Ability impalingBolt = gameObject.AddComponent<Ability>(); * * impalingBolt.abilityName = impalingBoltName; * impalingBolt.abilityDescription = impalingBoltDescription; * impalingBolt.abilityBaseCooldownTime = impalingBoltCooldownTime; * impalingBolt.abilityAPCost = impalingBoltAPCost; * impalingBolt.abilityRange = impalingBoltRange; * impalingBolt.abilityPrimaryValue = impalingBoltPrimaryValue; * impalingBolt.abilitySecondaryValue = impalingBoltSecondaryValue; * impalingBolt.abilityImage = impalingBoltImage; * * AllAbilities.Add(impalingBolt); * } * * public void CreateForestMedicineData() * { * Ability forestMedicine = gameObject.AddComponent<Ability>(); * * forestMedicine.abilityName = forestMedicineName; * forestMedicine.abilityDescription = forestMedicineDescription; * forestMedicine.abilityBaseCooldownTime = forestMedicineCooldownTime; * forestMedicine.abilityAPCost = forestMedicineAPCost; * forestMedicine.abilityRange = forestMedicineRange; * forestMedicine.abilityPrimaryValue = forestMedicinePrimaryValue; * forestMedicine.abilitySecondaryValue = forestMedicineSecondaryValue; * forestMedicine.abilityImage = forestMedicineImage; * * AllAbilities.Add(forestMedicine); * } * * public void CreateWhirlwindData() * { * Ability whirlwind = gameObject.AddComponent<Ability>(); * * whirlwind.abilityName = whirlwindName; * whirlwind.abilityDescription = whirlwindDescription; * whirlwind.abilityBaseCooldownTime = whirlwindCooldownTime; * whirlwind.abilityAPCost = whirlwindAPCost; * whirlwind.abilityRange = whirlwindRange; * whirlwind.abilityPrimaryValue = whirlwindPrimaryValue; * whirlwind.abilitySecondaryValue = whirlwindSecondaryValue; * whirlwind.abilityImage = whirlwindImage; * * AllAbilities.Add(whirlwind); * } * * public void CreateSummonUndeadData() * { * Ability summonUndead = gameObject.AddComponent<Ability>(); * * summonUndead.abilityName = summonUndeadName; * summonUndead.abilityDescription = summonUndeadDescription; * summonUndead.abilityBaseCooldownTime = summonUndeadCooldownTime; * summonUndead.abilityAPCost = summonUndeadAPCost; * summonUndead.abilityRange = summonUndeadRange; * summonUndead.abilityPrimaryValue = summonUndeadPrimaryValue; * summonUndead.abilitySecondaryValue = summonUndeadSecondaryValue; * summonUndead.abilityImage = summonUndeadImage; * * AllAbilities.Add(summonUndead); * } * * public void CreateChaosBoltData() * { * Ability chaosBolt = gameObject.AddComponent<Ability>(); * * chaosBolt.abilityName = chaosBoltName; * chaosBolt.abilityDescription = chaosBoltDescription; * chaosBolt.abilityBaseCooldownTime = chaosBoltCooldownTime; * chaosBolt.abilityAPCost = chaosBoltAPCost; * chaosBolt.abilityRange = chaosBoltRange; * chaosBolt.abilityPrimaryValue = chaosBoltPrimaryValue; * chaosBolt.abilitySecondaryValue = chaosBoltSecondaryValue; * chaosBolt.abilityImage = chaosBoltImage; * * AllAbilities.Add(chaosBolt); * } * * public void CreateCrushingBlowData() * { * Ability crushingBlow = gameObject.AddComponent<Ability>(); * * crushingBlow.abilityName = crushingBlowName; * crushingBlow.abilityDescription = crushingBlowDescription; * crushingBlow.abilityBaseCooldownTime = crushingBlowCooldownTime; * crushingBlow.abilityAPCost = crushingBlowAPCost; * crushingBlow.abilityRange = crushingBlowRange; * crushingBlow.abilityPrimaryValue = crushingBlowPrimaryValue; * crushingBlow.abilitySecondaryValue = crushingBlowSecondaryValue; * crushingBlow.abilityImage = crushingBlowImage; * * AllAbilities.Add(crushingBlow); * } * * public void CreateEnvigorateData() * { * Ability envigorate = gameObject.AddComponent<Ability>(); * * envigorate.abilityName = invigorateName; * envigorate.abilityDescription = invigorateDescription; * envigorate.abilityBaseCooldownTime = invigorateCooldownTime; * envigorate.abilityAPCost = invigorateAPCost; * envigorate.abilityRange = invigorateRange; * envigorate.abilityPrimaryValue = invigoratePrimaryValue; * envigorate.abilitySecondaryValue = invigorateSecondaryValue; * envigorate.abilityImage = invigorateImage; * * AllAbilities.Add(envigorate); * } * * public void CreateHolyFireData() * { * Ability holyFire = gameObject.AddComponent<Ability>(); * * holyFire.abilityName = holyFireName; * holyFire.abilityDescription = holyFireDescription; * holyFire.abilityBaseCooldownTime = holyFireCooldownTime; * holyFire.abilityAPCost = holyFireAPCost; * holyFire.abilityRange = holyFireRange; * holyFire.abilityPrimaryValue = holyFirePrimaryValue; * holyFire.abilitySecondaryValue = holyFireSecondaryValue; * holyFire.abilityImage = holyFireImage; * * AllAbilities.Add(holyFire); * } * public void CreateVoidBombData() * { * Ability voidBomb = gameObject.AddComponent<Ability>(); * * voidBomb.abilityName = voidBombName; * voidBomb.abilityDescription = voidBombDescription; * voidBomb.abilityBaseCooldownTime = voidBombCooldownTime; * voidBomb.abilityAPCost = voidBombAPCost; * voidBomb.abilityRange = voidBombRange; * voidBomb.abilityPrimaryValue = voidBombPrimaryValue; * voidBomb.abilitySecondaryValue = voidBombSecondaryValue; * voidBomb.abilityImage = voidBombImage; * * AllAbilities.Add(voidBomb); * } * public void CreateNightmareData() * { * Ability nightmare = gameObject.AddComponent<Ability>(); * * nightmare.abilityName = nightmareName; * nightmare.abilityDescription = nightmareDescription; * nightmare.abilityBaseCooldownTime = nightmareCooldownTime; * nightmare.abilityAPCost = nightmareAPCost; * nightmare.abilityRange = nightmareRange; * nightmare.abilityPrimaryValue = nightmarePrimaryValue; * nightmare.abilitySecondaryValue = nightmareSecondaryValue; * nightmare.abilityImage = nightmareImage; * * AllAbilities.Add(nightmare); * } * * public void CreateTwinStrikeData() * { * Ability twinStrike = gameObject.AddComponent<Ability>(); * * twinStrike.abilityName = twinStrikeName; * twinStrike.abilityDescription = twinStrikeDescription; * twinStrike.abilityBaseCooldownTime = twinStrikeCooldownTime; * twinStrike.abilityAPCost = twinStrikeAPCost; * twinStrike.abilityRange = twinStrikeRange; * twinStrike.abilityPrimaryValue = twinStrikePrimaryValue; * twinStrike.abilitySecondaryValue = twinStrikeSecondaryValue; * twinStrike.abilityImage = twinStrikeImage; * * AllAbilities.Add(twinStrike); * } * * public void CreateDashData() * { * Ability dash = gameObject.AddComponent<Ability>(); * * dash.abilityName = dashName; * dash.abilityDescription = dashDescription; * dash.abilityBaseCooldownTime = dashCooldownTime; * dash.abilityAPCost = dashAPCost; * dash.abilityRange = dashRange; * dash.abilityPrimaryValue = dashPrimaryValue; * dash.abilitySecondaryValue = dashSecondaryValue; * dash.abilityImage = dashImage; * * AllAbilities.Add(dash); * } * * public void CreatePreparationData() * { * Ability preparation = gameObject.AddComponent<Ability>(); * * preparation.abilityName = preparationName; * preparation.abilityDescription = preparationDescription; * preparation.abilityBaseCooldownTime = preparationCooldownTime; * preparation.abilityAPCost = preparationAPCost; * preparation.abilityRange = preparationRange; * preparation.abilityPrimaryValue = preparationPrimaryValue; * preparation.abilitySecondaryValue = preparationSecondaryValue; * preparation.abilityImage = preparationImage; * * AllAbilities.Add(preparation); * } * public void CreateSnipeData() * { * Ability snipe = gameObject.AddComponent<Ability>(); * * snipe.abilityName = snipeName; * snipe.abilityDescription = snipeDescription; * snipe.abilityBaseCooldownTime = snipeCooldownTime; * snipe.abilityAPCost = snipeAPCost; * snipe.abilityRange = snipeRange; * snipe.abilityPrimaryValue = snipePrimaryValue; * snipe.abilitySecondaryValue = snipeSecondaryValue; * snipe.abilityImage = snipeImage; * * AllAbilities.Add(snipe); * } * * public void CreateHealingLightData() * { * Ability healingLight = gameObject.AddComponent<Ability>(); * * healingLight.abilityName = healingLightName; * healingLight.abilityDescription = healingLightDescription; * healingLight.abilityBaseCooldownTime = healingLightCooldownTime; * healingLight.abilityAPCost = healingLightAPCost; * healingLight.abilityRange = healingLightRange; * healingLight.abilityPrimaryValue = healingLightPrimaryValue; * healingLight.abilitySecondaryValue = healingLightSecondaryValue; * healingLight.abilityImage = healingLightImage; * * AllAbilities.Add(healingLight); * } * public void CreateRockTossData() * { * Ability rockToss = gameObject.AddComponent<Ability>(); * * rockToss.abilityName = rockTossName; * rockToss.abilityDescription = rockTossDescription; * rockToss.abilityBaseCooldownTime = rockTossCooldownTime; * rockToss.abilityAPCost = rockTossAPCost; * rockToss.abilityRange = rockTossRange; * rockToss.abilityPrimaryValue = rockTossPrimaryValue; * rockToss.abilitySecondaryValue = rockTossSecondaryValue; * rockToss.abilityImage = rockTossImage; * * AllAbilities.Add(rockToss); * } * public void CreateSiphonLifeData() * { * Ability siphonLife = gameObject.AddComponent<Ability>(); * * siphonLife.abilityName = siphonLifeName; * siphonLife.abilityDescription = siphonLifeDescription; * siphonLife.abilityBaseCooldownTime = siphonLifeCooldownTime; * siphonLife.abilityAPCost = siphonLifeAPCost; * siphonLife.abilityRange = siphonLifeRange; * siphonLife.abilityPrimaryValue = siphonLifePrimaryValue; * siphonLife.abilitySecondaryValue = siphonLifeSecondaryValue; * siphonLife.abilityImage = siphonLifeImage; * * AllAbilities.Add(siphonLife); * } * public void CreateTeleportData() * { * Ability teleport = gameObject.AddComponent<Ability>(); * * teleport.abilityName = teleportName; * teleport.abilityDescription = teleportDescription; * teleport.abilityBaseCooldownTime = teleportCooldownTime; * teleport.abilityAPCost = teleportAPCost; * teleport.abilityRange = teleportRange; * teleport.abilityPrimaryValue = teleportPrimaryValue; * teleport.abilitySecondaryValue = teleportSecondaryValue; * teleport.abilityImage = teleportImage; * * AllAbilities.Add(teleport); * } * * public void CreateSliceAndDiceData() * { * Ability sliceAndDice = gameObject.AddComponent<Ability>(); * * sliceAndDice.abilityName = sliceAndDiceName; * sliceAndDice.abilityDescription = sliceAndDiceDescription; * sliceAndDice.abilityBaseCooldownTime = sliceAndDiceCooldownTime; * sliceAndDice.abilityAPCost = sliceAndDiceAPCost; * sliceAndDice.abilityRange = sliceAndDiceRange; * sliceAndDice.abilityPrimaryValue = sliceAndDicePrimaryValue; * sliceAndDice.abilitySecondaryValue = sliceAndDiceSecondaryValue; * sliceAndDice.abilityImage = sliceAndDiceImage; * * AllAbilities.Add(sliceAndDice); * } * * public void CreatePoisonDartData() * { * Ability poisonDart = gameObject.AddComponent<Ability>(); * * poisonDart.abilityName = poisonDartName; * poisonDart.abilityDescription = poisonDartDescription; * poisonDart.abilityBaseCooldownTime = poisonDartCooldownTime; * poisonDart.abilityAPCost = poisonDartAPCost; * poisonDart.abilityRange = poisonDartRange; * poisonDart.abilityPrimaryValue = poisonDartPrimaryValue; * poisonDart.abilitySecondaryValue = poisonDartSecondaryValue; * poisonDart.abilityImage = poisonDartImage; * * AllAbilities.Add(poisonDart); * } * * public void CreateChemicalReactionData() * { * Ability chemicalReaction = gameObject.AddComponent<Ability>(); * * chemicalReaction.abilityName = chemicalReactionName; * chemicalReaction.abilityDescription = chemicalReactionDescription; * chemicalReaction.abilityBaseCooldownTime = chemicalReactionCooldownTime; * chemicalReaction.abilityAPCost = chemicalReactionAPCost; * chemicalReaction.abilityRange = chemicalReactionRange; * chemicalReaction.abilityPrimaryValue = chemicalReactionPrimaryValue; * chemicalReaction.abilitySecondaryValue = chemicalReactionSecondaryValue; * chemicalReaction.abilityImage = chemicalReactionImage; * * AllAbilities.Add(chemicalReaction); * } * public void CreateBloodLustData() * { * Ability bloodLust = gameObject.AddComponent<Ability>(); * * bloodLust.abilityName = bloodLustName; * bloodLust.abilityDescription = bloodLustDescription; * bloodLust.abilityBaseCooldownTime = bloodLustCooldownTime; * bloodLust.abilityAPCost = bloodLustAPCost; * bloodLust.abilityRange = bloodLustRange; * bloodLust.abilityPrimaryValue = bloodLustPrimaryValue; * bloodLust.abilitySecondaryValue = bloodLustSecondaryValue; * bloodLust.abilityImage = bloodLustImage; * * AllAbilities.Add(bloodLust); * } * * public void CreateGetDownData() * { * Ability getDown = gameObject.AddComponent<Ability>(); * * getDown.abilityName = getDownName; * getDown.abilityDescription = getDownDescription; * getDown.abilityBaseCooldownTime = getDownCooldownTime; * getDown.abilityAPCost = getDownAPCost; * getDown.abilityRange = getDownRange; * getDown.abilityPrimaryValue = getDownPrimaryValue; * getDown.abilitySecondaryValue = getDownSecondaryValue; * getDown.abilityImage = getDownImage; * * AllAbilities.Add(getDown); * } * * public void CreateDoomData() * { * Ability doom = gameObject.AddComponent<Ability>(); * * doom.abilityName = doomName; * doom.abilityDescription = doomDescription; * doom.abilityBaseCooldownTime = doomCooldownTime; * doom.abilityAPCost = doomAPCost; * doom.abilityRange = doomRange; * doom.abilityPrimaryValue = doomPrimaryValue; * doom.abilitySecondaryValue = doomSecondaryValue; * doom.abilityImage = doomImage; * * AllAbilities.Add(doom); * } * * public void CreateSmashData() * { * Ability smash = gameObject.AddComponent<Ability>(); * * smash.abilityName = smashName; * smash.abilityDescription = smashDescription; * smash.abilityBaseCooldownTime = smashCooldownTime; * smash.abilityAPCost = smashAPCost; * smash.abilityRange = smashRange; * smash.abilityPrimaryValue = smashPrimaryValue; * smash.abilitySecondaryValue = smashSecondaryValue; * smash.abilityImage = smashImage; * * AllAbilities.Add(smash); * } * * public void CreateLightningShieldData() * { * Ability lightningShield = gameObject.AddComponent<Ability>(); * * lightningShield.abilityName = lightningShieldName; * lightningShield.abilityDescription = lightningShieldDescription; * lightningShield.abilityBaseCooldownTime = lightningShieldCooldownTime; * lightningShield.abilityAPCost = lightningShieldAPCost; * lightningShield.abilityRange = lightningShieldRange; * lightningShield.abilityPrimaryValue = lightningShieldPrimaryValue; * lightningShield.abilitySecondaryValue = lightningShieldSecondaryValue; * lightningShield.abilityImage = lightningShieldImage; * * AllAbilities.Add(lightningShield); * } * * public void CreateElectricalDischargeData() * { * Ability electricalDischarge = gameObject.AddComponent<Ability>(); * * electricalDischarge.abilityName = electricalDischargeName; * electricalDischarge.abilityDescription = electricalDischargeDescription; * electricalDischarge.abilityBaseCooldownTime = electricalDischargeCooldownTime; * electricalDischarge.abilityAPCost = electricalDischargeAPCost; * electricalDischarge.abilityRange = electricalDischargeRange; * electricalDischarge.abilityPrimaryValue = electricalDischargePrimaryValue; * electricalDischarge.abilitySecondaryValue = electricalDischargeSecondaryValue; * electricalDischarge.abilityImage = electricalDischargeImage; * * AllAbilities.Add(electricalDischarge); * } * public void CreateChainLightningData() * { * Ability chainLightning = gameObject.AddComponent<Ability>(); * * chainLightning.abilityName = chainLightningName; * chainLightning.abilityDescription = chainLightningDescription; * chainLightning.abilityBaseCooldownTime = chainLightningCooldownTime; * chainLightning.abilityAPCost = chainLightningAPCost; * chainLightning.abilityRange = chainLightningRange; * chainLightning.abilityPrimaryValue = chainLightningPrimaryValue; * chainLightning.abilitySecondaryValue = chainLightningSecondaryValue; * chainLightning.abilityImage = chainLightningImage; * * AllAbilities.Add(chainLightning); * } * public void CreatePrimalRageData() * { * Ability primalRage = gameObject.AddComponent<Ability>(); * * primalRage.abilityName = primalRageName; * primalRage.abilityDescription = primalRageDescription; * primalRage.abilityBaseCooldownTime = primalRageCooldownTime; * primalRage.abilityAPCost = primalRageAPCost; * primalRage.abilityRange = primalRageRange; * primalRage.abilityPrimaryValue = primalRagePrimaryValue; * primalRage.abilitySecondaryValue = primalRageSecondaryValue; * primalRage.abilityImage = primalRageImage; * * AllAbilities.Add(primalRage); * } * public void CreatePrimalBlastData() * { * Ability primalBlast = gameObject.AddComponent<Ability>(); * * primalBlast.abilityName = primalBlastName; * primalBlast.abilityDescription = primalBlastDescription; * primalBlast.abilityBaseCooldownTime = primalBlastCooldownTime; * primalBlast.abilityAPCost = primalBlastAPCost; * primalBlast.abilityRange = primalBlastRange; * primalBlast.abilityPrimaryValue = primalBlastPrimaryValue; * primalBlast.abilitySecondaryValue = primalBlastSecondaryValue; * primalBlast.abilityImage = primalBlastImage; * * AllAbilities.Add(primalBlast); * } * public void CreatePhaseShiftData() * { * Ability phaseShift = gameObject.AddComponent<Ability>(); * * phaseShift.abilityName = phaseShiftName; * phaseShift.abilityDescription = phaseShiftDescription; * phaseShift.abilityBaseCooldownTime = phaseShiftCooldownTime; * phaseShift.abilityAPCost = phaseShiftAPCost; * phaseShift.abilityRange = phaseShiftRange; * phaseShift.abilityPrimaryValue = phaseShiftPrimaryValue; * phaseShift.abilitySecondaryValue = phaseShiftSecondaryValue; * phaseShift.abilityImage = phaseShiftImage; * * AllAbilities.Add(phaseShift); * } * public void CreateSanctityData() * { * Ability sanctity = gameObject.AddComponent<Ability>(); * * sanctity.abilityName = sanctityName; * sanctity.abilityDescription = sanctityDescription; * sanctity.abilityBaseCooldownTime = sanctityCooldownTime; * sanctity.abilityAPCost = sanctityAPCost; * sanctity.abilityRange = sanctityRange; * sanctity.abilityPrimaryValue = sanctityPrimaryValue; * sanctity.abilitySecondaryValue = sanctitySecondaryValue; * sanctity.abilityImage = sanctityImage; * * AllAbilities.Add(sanctity); * } * public void CreateBlessData() * { * Ability bless = gameObject.AddComponent<Ability>(); * * bless.abilityName = blessName; * bless.abilityDescription = blessDescription; * bless.abilityBaseCooldownTime = blessCooldownTime; * bless.abilityAPCost = blessAPCost; * bless.abilityRange = blessRange; * bless.abilityPrimaryValue = blessPrimaryValue; * bless.abilitySecondaryValue = blessSecondaryValue; * bless.abilityImage = blessImage; * * AllAbilities.Add(bless); * } */ public AbilityDataSO GetAbilityByName(string name) { AbilityDataSO abilityReturned = null; foreach (AbilityDataSO ability in AllAbilities) { if (ability.abilityName == name) { abilityReturned = ability; } } if (abilityReturned == null) { Debug.Log("AbilityLibrary.GetAbilityByName() couldn't find a matching ability, returning null..."); } return(abilityReturned); }
// Ability Tome Logic #region public void AddAbilityTomeToInventory(AbilityDataSO abilityData, bool showOverlayCardEffect = false) { // Create game object GameObject newAbilityTomeGO = Instantiate(PrefabHolder.Instance.AbilityTomeInventoryCard, itemsParent.transform); AbilityTomeInventoryCard abilityTome = newAbilityTomeGO.GetComponent <AbilityTomeInventoryCard>(); // Enable char roster sparkle UIManager.Instance.SetCharacterRosterButtonParticleViewState(true); // play screen overlay VFX if (showOverlayCardEffect) { CardRewardScreenManager.Instance.CreateAbilityCardRewardEffect(abilityData); } // Place in inventory PlaceAbilityTomeOnInventorySlot(abilityTome, GetNextAvailableSlot()); // Initialize tome abilityTome.BuildFromAbilityData(abilityData); }
public void BuildAbilityTypeIconViewsFromData(AbilityInfoSheet sheet, AbilityDataSO data) { Debug.Log("AbilityInfoSheetController.BuildAbilityTypeIconViewsFromData() called..."); sheet.meleeAttackIconParent.SetActive(false); sheet.rangedAttackIconParent.SetActive(false); sheet.skillIconParent.SetActive(false); if (data.abilityType == AbilityDataSO.AbilityType.MeleeAttack) { sheet.meleeAttackIconParent.SetActive(true); } else if (data.abilityType == AbilityDataSO.AbilityType.RangedAttack) { sheet.rangedAttackIconParent.SetActive(true); } else if (data.abilityType == AbilityDataSO.AbilityType.Skill) { sheet.skillIconParent.SetActive(true); } }
// Ability Data Search Methods #region public AbilityDataSO GetAbilityByName(string _name) { Debug.Log("AbilityLibrary.GetAbilityByName() called, searching with provided string: " + _name); AbilityDataSO abilityReturned = null; foreach (AbilityDataSO ability in AllAbilities) { if (ability.abilityName == _name) { abilityReturned = ability; break; } } if (abilityReturned == null) { Debug.Log("AbilityLibrary.GetAbilityByName() couldn't find an ability called '" + _name + "', returning null..."); } return(abilityReturned); }
public void SetupBaseProperties(AbilityDataSO abilityFromLibrary) { myAbilityData = abilityFromLibrary; abilityImage = abilityFromLibrary.abilityImage; Image image = GetComponent <Image>(); // only for defenders. enemies don't have ability button gameobjects, so GetComponent<Image> will cause a null ref on enemies. if (image) { GetComponent <Image>().sprite = abilityImage; } abilityName = abilityFromLibrary.abilityName; abilityDescription = abilityFromLibrary.abilityDescription; abilityBaseCooldownTime = abilityFromLibrary.abilityBaseCooldownTime; abilityAPCost = abilityFromLibrary.abilityAPCost; abilityRange = abilityFromLibrary.abilityRange; abilityPrimaryValue = abilityFromLibrary.abilityPrimaryValue; abilitySecondaryValue = abilityFromLibrary.abilitySecondaryValue; abilityAttackType = abilityFromLibrary.abilityAttackType; abilityDamageType = abilityFromLibrary.abilityDamageType; usesMeleeWeapon = abilityFromLibrary.usesMeleeWeapon; usesRangedWeapon = abilityFromLibrary.usesRangedWeapon; // Set up info panel for defenders if (myLivingEntity.GetComponent <Defender>()) { cdText.text = abilityFromLibrary.abilityBaseCooldownTime.ToString(); rangeText.text = abilityFromLibrary.abilityRange.ToString(); apCostText.text = abilityFromLibrary.abilityAPCost.ToString(); nameText.text = abilityFromLibrary.abilityName.ToString(); descriptionText.text = abilityFromLibrary.abilityDescription.ToString(); } }
// Setup #region public void InitializeSetup(AbilityDataSO data) { abilityImage.sprite = data.sprite; myData = data; BuildInfoPanelFromData(myData); }
private IEnumerator CreateAbilityCardRewardEffectCoroutine(AbilityDataSO abilityData, Action action) { // Create Card object GameObject newAbilityCardGO = Instantiate(abilityCardEffectPrefab, cardParent); AbilityCardRewardOverlay newAbilityCard = newAbilityCardGO.GetComponent <AbilityCardRewardOverlay>(); // Set up card properties BuildAbilityCardRewardOverlayFromData(abilityData, newAbilityCard); // Scale down card SetParentScale(newAbilityCard.abilityCardScaleParent, new Vector3(0.005f, 0.005f, 0.005f)); // Insert Delay, break up multiple simoltaenous reveals yield return(new WaitForSeconds(CalculateCardRevealDelay())); // Get next available slot position CardRewardScreenSlot mySlot = GetNextAvailableSlotPosition(); // dont proceed unless a slot is available if (mySlot == null) { action.actionResolved = true; yield break; } // Move to starting slot position newAbilityCard.masterLocationParent.position = mySlot.parentTransform.position; // Start scaling card back to normal size Action scaleEffect = ScaleUpCard(newAbilityCard.abilityCardScaleParent, 1); yield return(new WaitUntil(() => scaleEffect.actionResolved == true)); // Brief pause, so player can read the card yield return(new WaitForSeconds(1)); // Free up slot mySlot.occupied = false; // Start scaling card back down ScaleDownCard(newAbilityCard.abilityCardScaleParent, 0.01f); // Start card rotation towards destination RotateCardZAxis(newAbilityCard.abilityCardScaleParent, -45); // Enable Sparkle Effect newAbilityCard.sparkleParticleEffectParent.SetActive(true); // Move character panel button position Action moveEffect = MoveCardToDestination(newAbilityCard.masterLocationParent, charRosterButtonEndPosition.position); yield return(new WaitUntil(() => moveEffect.actionResolved == true)); // Create mini explosion on char roster button GameObject newPE = Instantiate(lootExplosionEffectPrefab, cardParent); newPE.transform.position = charRosterButtonEndPosition.position; // Destroy item card Destroy(newAbilityCardGO); // Resolve action.actionResolved = true; }
public void BuildInfoPanelFromData(AbilityDataSO data) { // build text and images assets AbilityInfoSheetController.Instance.BuildSheetFromData(abilityInfoSheet, data, AbilityInfoSheet.PivotDirection.Upwards); }
public void BuildAbilityCardRewardOverlayFromData(AbilityDataSO data, AbilityCardRewardOverlay card) { AbilityInfoSheetController.Instance.BuildSheetFromData(card.abilityCard, data, AbilityInfoSheet.PivotDirection.Downwards); }
public void UpdateCharacterAbilitiesFromWeapons(CharacterData character) { Debug.Log("InventoryController.UpdateCharacterAbilitiesFromWeapons() called..."); List <AbilityDataSO> abilitiesToLearn = new List <AbilityDataSO>(); ItemDataSO mainHandWeapon = character.mainHandWeapon; ItemDataSO offHandWeapon = character.offHandWeapon; AbilityDataSO strike = AbilityLibrary.Instance.GetAbilityByName("Strike"); AbilityDataSO defend = AbilityLibrary.Instance.GetAbilityByName("Defend"); AbilityDataSO shoot = AbilityLibrary.Instance.GetAbilityByName("Shoot"); AbilityDataSO twinStrike = AbilityLibrary.Instance.GetAbilityByName("Twin Strike"); // Unlearn previous weapon related abilities first if (character.DoesCharacterAlreadyKnowAbility(strike)) { character.HandleUnlearnAbility(strike); } if (character.DoesCharacterAlreadyKnowAbility(shoot)) { character.HandleUnlearnAbility(shoot); } if (character.DoesCharacterAlreadyKnowAbility(defend)) { character.HandleUnlearnAbility(defend); } if (character.DoesCharacterAlreadyKnowAbility(twinStrike)) { character.HandleUnlearnAbility(twinStrike); } // Twin Strike if (mainHandWeapon.itemType == ItemDataSO.ItemType.MeleeOneHand && offHandWeapon != null && offHandWeapon.itemType == ItemDataSO.ItemType.MeleeOneHand) { Debug.Log(character.myName + " learning Twin Strike from weapon loadout"); abilitiesToLearn.Add(twinStrike); } // Strike and Defend else if (mainHandWeapon.itemType == ItemDataSO.ItemType.MeleeOneHand && offHandWeapon != null && offHandWeapon.itemType == ItemDataSO.ItemType.Shield) { Debug.Log(character.myName + " learning Strike and Defend from weapon loadout"); abilitiesToLearn.Add(strike); abilitiesToLearn.Add(defend); } // Strike else if (mainHandWeapon.itemType == ItemDataSO.ItemType.MeleeOneHand || mainHandWeapon.itemType == ItemDataSO.ItemType.MeleeTwoHand) { Debug.Log(character.myName + " learning Strike from weapon loadout"); abilitiesToLearn.Add(strike); } // Shoot else if (mainHandWeapon.itemType == ItemDataSO.ItemType.RangedTwoHand) { Debug.Log(character.myName + " learning Shoot from weapon loadout"); abilitiesToLearn.Add(shoot); } // Learn abilities foreach (AbilityDataSO ability in abilitiesToLearn) { character.HandleLearnAbility(ability); } }
public void AddAbilityToolTipToView(AbilityDataSO ability) { GameObject newAbilityTabGO = Instantiate(PrefabHolder.Instance.abilityTabPrefab, abilityTabParent.transform); newAbilityTabGO.GetComponent <AbilityTab>().InitializeSetup(ability); }