/// <summary> /// Adds ability of specific type and target with level 0 and no boost options. /// </summary> /// <param name="target">The resource/species the ability is applied to.</param> public void addAbility(string target, abilityType type) { Ability toAdd = new Ability(); toAdd.target = target; toAdd.type = type; toAdd.level = 0; abilities[target] = toAdd; }
/// <summary> /// Shooting Method /// </summary> protected void Ability(abilityType ability, int abilityIndex) { GameObject abilityObject; switch (ability) { case abilityType.blobs: // Instantiate the blob //Debug.Log("Dropping a doozy"); abilityObject = Instantiate(allyAbilityPrefabs[abilityIndex], transform.position, transform.rotation); // Add it to a list of blobs/Abilities allyAbilityObjects.Add(abilityObject); // Increase the number of ability objects abilityCount[abilityIndex]++; // Call the special initialization abilityObject.GetComponent <BlobScript>().BlobStart(gameObject); break; case abilityType.babies: //Debug.Log("Giving Birth!"); if (!(abilityRestrictionNumber[abilityIndex] == abilityCount[abilityIndex])) { abilityObject = Instantiate(allyAbilityPrefabs[abilityIndex], transform.position, transform.rotation); abilityObject.GetComponent <EnemyManager>().Parent = gameObject; abilityObject.GetComponent <EnemyManager>().ParentAbilityNum = abilityIndex; // Add it to a list of babies allyAbilityObjects.Add(abilityObject); // Increase the number of ability objects abilityCount[abilityIndex]++; } break; } }