Advertisement
Guest User

oh god why.

a guest
Nov 27th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. for (var i = 0; i < resourcesGained; i++)
  2.                 {
  3.                     var chance = game.Random.Next(1, totalProbability);
  4.                     bool goUp = chance < (totalProbability/2);
  5.                     var r = ((goUp) ? 0 : PossibleResources.Count);
  6.                     var increase = ((goUp) ? 1 : -1);
  7.                     for (; ((goUp)?r<PossibleResources.Count:r>0); r+=increase)
  8.                     {
  9.                         //Do mining logic.
  10.                     }
  11.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement