public void BeginSoloChallenge(UserBase user, int deadLiftWeight) { if (user.CanDoDeadLift(deadLiftWeight) == true) { string finalMessage = "You Just Deadlifted " + deadLiftWeight + "LBS! "; int cashReward = 0; int xpReward = 0; if (user.userStats.soloChallengeDeadliftRecord >= deadLiftWeight) // we have already deadlifted this weight { cashReward = deadLiftWeight; finalMessage += "Since you didnt beat a previous record, you earned $" + cashReward + " but no xp"; } else if (user.userStats.soloChallengeDeadliftRecord < deadLiftWeight) //this is a new record! { cashReward = deadLiftWeight * 10; xpReward = user.userStats.level * 500; finalMessage += "You Beat Your Record! You get $" + cashReward + " and " + xpReward + " XP"; } user.userStats.SetNewSoloChallengeDeadliftRecord(deadLiftWeight); user.userAssets.ModifyCash(cashReward); user.userStats.ModifyXP(xpReward); OneButtonPopup temp= PopupManager.CreatePopup<OneButtonPopup>() as OneButtonPopup; temp.titleText.Text = "Finished Challenge"; temp.messageText.Text = finalMessage; } else { OneButtonPopup temp= PopupManager.CreatePopup<OneButtonPopup>() as OneButtonPopup; temp.titleText.Text = "FAIL!"; temp.messageText.Text = "You Need To Gain More Strength To Lift " + deadLiftWeight + " Keep Excercising!"; } }