From 757392d4d5837d33f16d998de1fa35d2448f8d2a Mon Sep 17 00:00:00 2001 From: YoshiCraft64 <159088071+YoshiCraft64@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:56:28 -0500 Subject: [PATCH] GetPayout update (#14) Update RatingController.cs for an update to GetPayout Updates GetPayout to have a different payout system for each minigame. --- src/Controllers/Common/RatingController.cs | 72 +++++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/src/Controllers/Common/RatingController.cs b/src/Controllers/Common/RatingController.cs index ef18d4d..f589074 100644 --- a/src/Controllers/Common/RatingController.cs +++ b/src/Controllers/Common/RatingController.cs @@ -11,9 +11,75 @@ public class RatingController : Controller [HttpPost] [Produces("application/xml")] [Route("MissionWebService.asmx/GetPayout")] // used by World Of Jumpstart - public IActionResult GetPayout([FromForm] int points, [FromForm] string ModuleName) { - // TODO: better calculations, improve module determination code - // for now, a trusty placeholder + public IActionResult GetPayout([FromForm] int points, [FromForm] string ModuleName) { + switch (ModuleName) + { + case string x when x.StartsWith("MSBejeweled"): + return Ok(points / (350 / 3)); + + case string x when x.StartsWith("MSDodgeNDash"): + return Ok((int)Math.Floor(Math.Pow(1.145, (double)points / 10))); + + case string x when x.StartsWith("MSBuggyRacer"): + return Ok(points / 4.7); + + case string x when x.StartsWith("MSSoundBop"): + return Ok(points * 10); + + case string x when x.StartsWith("MSGhostTownGrab"): + return Ok(points / 20); + + case string x when x.StartsWith("BubbleTrouble"): + return Ok(points / 10); + + case string x when x.StartsWith("HopsJetPack"): + return Ok(points / 25); + + case string x when x.StartsWith("HallowsBubbleMaze"): + return Ok(points / 10); + + case string x when x.StartsWith("MSRoboAGoGo"): + return Ok(points / 20); + + case string x when x.StartsWith("Volleyball"): + return Ok(points / 1.8); + + case string x when x.StartsWith("Football"): + return Ok(points / 3.2); + + case string x when x.StartsWith("Basketball"): + return Ok(points / 1.8); + + case string x when x.StartsWith("FruitSaladChop"): + return Ok(points / 60); + + case string x when x.StartsWith("JSGardenDefense"): + return Ok(points / (350/3)); + + case string x when x.StartsWith("JSSushiChop"): + return Ok(points / 120); + + case string x when x.StartsWith("JSDanceOff"): + return Ok(points / (350/3)); + + case string x when x.StartsWith("MSPnCow"): + return Ok(60); + + case string x when x.StartsWith("MSPnBunny"): + return Ok(60); + + case string x when x.StartsWith("MSPnMonkey"): + return Ok(60); + + case string x when x.StartsWith("MSCnKite"): + return Ok(60); + + case string x when x.StartsWith("MSCnLadyBug"): + return Ok(60); + + case string x when x.StartsWith("MSCnDucky"): + return Ok(60); + } return Ok(points / (350 / 3)); }