//For active buttons, called when we clicked on them in scene. public void useButton(abilityTypes a_type) { switch (a_type) { case abilityTypes.Freeze: player.Frozen = 1; break; case abilityTypes.Dodge: enemy.SkipQuestion(); break; case abilityTypes.StorePower: enemy.abilityDamage(abilities[abilityTypes.StorePower] * 0.05f * player.attackDamage * attacking); break; case abilityTypes.FireStorm: float damage = (player.attackDamage * (0.35f * abilities[abilityTypes.FireStorm])); enemy.abilityDamage(damage); Debug.Log("Fireblast " + damage); break; case abilityTypes.Burn: FindObjectOfType <multipleContainer>().RemoveSingle(); break; case abilityTypes.Hourglass: player.healPlayer(abilities[abilityTypes.Hourglass]); break; default: break; } }
public void ChecKability(int i) { AbilityDescription.SetActive(true); abilityTypes ability = (abilityTypes)abilityList[i]; Name.text = ability.ToString(); DescriptionImage.sprite = iconsList[(abilityList[i] - 1)]; UsesText.text = "Parts = " + abilities.abilities[abilityList[i]]; DescriptionText.text = abilities.displayPower(ability); }
//Begins setting up button. //buttontype is the avility this button will be responsible for. //Charges if how many uses it has. //a_abilities is a reference to the ability manager. internal void SetUpButton(abilityTypes buttonType, int charges, playerAbilities a_abilities) { abilities = a_abilities; thisButton = buttonType; chargesLeft = charges; SetButtonActive(); GetComponent <Image>().sprite = abilities.Icons[((int)thisButton - 1)]; if (buttonType == abilityTypes.Dodge || buttonType == abilityTypes.Freeze) { SetChargingButton(charges); } else { turnsSinceCharged = 0; chargeTimeNeeded = 0; } }
//If type is set to none, everything will be considered default. internal void ResetButton() { thisButton = abilityTypes.None; gameObject.SetActive(false); }
//In the customisation scene, tell players what their equipped abilities will do. public string displayPower(abilityTypes a_type) { string a_string = ""; switch (a_type) { case abilityTypes.None: break; case abilityTypes.Scavenger: a_string += a_type.ToString() + ": Collect more shards per monster part!"; break; case abilityTypes.Dodge: a_string += a_type.ToString() + ": Use when defending to dodge an enemy attack, more parts? More chances to dodge!"; break; case abilityTypes.BarkSkin: a_string += a_type.ToString() + ": Take less damage per monster part!"; break; case abilityTypes.SuperSpeed: a_string += a_type.ToString() + ": Get more time to answer questions with each monster part!"; break; case abilityTypes.SlimeSkin: a_string += a_type.ToString() + ": Return damage when you're hit, more parts? More damage!"; break; case abilityTypes.Freeze: a_string += a_type.ToString() + ": Freeze the timer bar during the attack phase! More parts? More freeze!"; break; case abilityTypes.Burn: a_string += a_type.ToString() + ": Remove one multiple choice answer, one use per monster part!"; break; case abilityTypes.BoulderFist: a_string += a_type.ToString() + ": Your attack and critical attacks are stronger per monster part!"; break; case abilityTypes.FireStorm: a_string += a_type.ToString() + ": Hurl a large firestorm at the enemy monster for big damage! More parts? More damage!"; break; case abilityTypes.Mastery: a_string += a_type.ToString() + ": Get bonus shards when you do a critical attack or a counterattack! More parts? More shards!"; break; case abilityTypes.SandSlice: a_string += a_type.ToString() + ": Your countertattack is stronger per monster part!."; break; case abilityTypes.Hourglass: a_string += a_type.ToString() + ": Heal yourself right away, more parts? More health!"; break; case abilityTypes.StorePower: a_string += a_type.ToString() + ": Store power away with each question you get right then unleash it at the enemy for massive damage! "; break; case abilityTypes.ArmourUp: a_string += a_type.ToString() + ": Start with more health, more parts? More health!"; break; case abilityTypes.DoubleStrike: a_string += a_type.ToString() + ": Get a chance to have a second attack! With more parts your chance is greater!"; break; case abilityTypes.TimeLord: a_string += a_type.ToString() + ": The Ruler of Math! Time stands still and you are all powerful!"; break; default: break; } return(a_string); }