/// <summary> /// Return the player's stat of a given QuestConnectionRequirement. Ex: player has 50 luck /// </summary> /// <param name="q">QuestConnectionRequirement to be evaluated</param> /// <param name="buffs">The player's stats</param> /// <returns></returns> private static float GetValueFromType(QuestConnectionRequirement q, BuffBox buffs) { float playerValue = 0; // get correct ability type requirement if (q.RequirementType == (int)QuestStatics.RequirementType.Discipline) { playerValue = buffs.Discipline(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Perception) { playerValue = buffs.Perception(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Charisma) { playerValue = buffs.Charisma(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Fortitude) { playerValue = buffs.Fortitude(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Agility) { playerValue = buffs.Agility(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Allure) { playerValue = buffs.Allure(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Magicka) { playerValue = buffs.Magicka(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Succour) { playerValue = buffs.Succour(); } else if (q.RequirementType == (int)QuestStatics.RequirementType.Luck) { playerValue = buffs.Luck(); } return(playerValue); }
public string AddSelfRestoreEnergy(BuffBox buffs) { var actualAmount = 10 + (float)Math.Floor(buffs.Allure() / 10); if (this.SelfRestoreEnergy == null) { this.SelfRestoreEnergy = SelfRestoreEnergy.Create(this, actualAmount); } else { this.SelfRestoreEnergy.AddAmount(actualAmount); } this.CleansesMeditatesThisRound++; this.ActionPoints -= (decimal)PvPStatics.SelfRestoreAPCost; this.Mana -= (decimal)PvPStatics.SelfRestoreManaCost; this.LastActionTimestamp = DateTime.UtcNow; if (this.SelfRestoreEnergy.Amount < PvPStatics.SelfRestoreTFnergyRequirement) { var output = $"You rest and attempt to restore yourself to your base form. [+{(int)actualAmount}, {(int)this.SelfRestoreEnergy.Amount}/{PvPStatics.SelfRestoreTFnergyRequirement}]. Keep trying and you'll find yourself in a familiar form in no time..."; this.AddLog(output, false); return(output); } else { this.SelfRestoreEnergy.Reset(); this.FormSource = this.OriginalFormSource; this.Gender = this.OriginalFormSource.Gender; this.FirstName = this.OriginalFirstName ?? this.FirstName; this.LastName = this.OriginalLastName ?? this.LastName; var output = "<span class='meditate'>With this final cast, you manage to restore yourself back to your base form as a <b>" + OriginalFormSource.FriendlyName + "</b>!<span>"; this.AddLog(output, false); return(output); } }