Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array<string> unselectedChallenges;
- void PopulateUnselectedChallenges () {
- unselectedChallenges.Clear ();
- if (TwoFer ) unselectedChallenges.Push ("TwoFer" );
- if (VarietyIsTheSpiceOfDeathI ) unselectedChallenges.Push ("VarietyIsTheSpiceOfDeathI" );
- if (QuiteTheExplorer ) unselectedChallenges.Push ("QuiteTheExplorer" );
- if (ThreeZombiesOneBarrel ) unselectedChallenges.Push ("ThreeZombiesOneBarrel" );
- if (CurbStomp ) unselectedChallenges.Push ("CurbStomp" );
- if (QuiteTheCollector ) unselectedChallenges.Push ("QuiteTheCollector" );
- if (WalkThePath ) unselectedChallenges.Push ("WalkThePath" );
- if (BirdsEyeView ) unselectedChallenges.Push ("BirdsEyeView" );
- if (ToBeKnighted ) unselectedChallenges.Push ("ToBeKnighted" );
- if (Chiropractor ) unselectedChallenges.Push ("Chiropractor" );
- if (SearchingHighAndLow ) unselectedChallenges.Push ("SearchingHighAndLow" );
- if (Overkiller ) unselectedChallenges.Push ("Overkiller" );
- if (DeadManStalking ) unselectedChallenges.Push ("DeadManStalking" );
- if (MomentumSwing ) unselectedChallenges.Push ("MomentumSwing" );
- if (CloseEncounters ) unselectedChallenges.Push ("CloseEncounters" );
- if (DoubleTake ) unselectedChallenges.Push ("DoubleTake" );
- if (HideAndSeek ) unselectedChallenges.Push ("HideAndSeek" );
- if (VarietyIsTheSpiceOfDeathII ) unselectedChallenges.Push ("VarietyIsTheSpiceOfDeathII" );
- if (ThreadTheNeedle ) unselectedChallenges.Push ("ThreadTheNeedle" );
- if (AtopTheMountain ) unselectedChallenges.Push ("AtopTheMountain" );
- if (Dominator ) unselectedChallenges.Push ("Dominator" );
- if (APinPopsABalloon ) unselectedChallenges.Push ("APinPopsABalloon" );
- if (TwoMouthsToFeed ) unselectedChallenges.Push ("TwoMouthsToFeed" );
- if (WaitForIt ) unselectedChallenges.Push ("WaitForIt" );
- if (VarietyIsTheSpiceOfDeathIII) unselectedChallenges.Push ("VarietyIsTheSpiceOfDeathIII");
- if (GorePinata ) unselectedChallenges.Push ("GorePinata" );
- if (MyTeethAreSharper ) unselectedChallenges.Push ("MyTeethAreSharper" );
- if (HoldStill ) unselectedChallenges.Push ("HoldStill" );
- if (BigREDACTEDGun ) unselectedChallenges.Push ("BigREDACTEDGun" );
- }
- string SelectNewChallenge () {
- if (unselectedChallenges.Size () < 1)
- return "";
- int idx = random [EOA_ChallengeSelection] (0, unselectedChallenges.Size () - 1);
- string ret = unselectedChallenges [idx];
- unselectedChallenges.Delete (idx, 1);
- return ret;
- }
- int RollNewChallenges () {
- PopulateUnselectedChallenges ();
- int challengesCount = 0;
- for (int i = 0; i < 3; i++) {
- string selectedChallenge = SelectNewChallenge ();
- // If selectedChallenge is an empty string, there's no challenges to be selected.
- if (selectedChallenge ~== "")
- break;
- for (int j = 0; j < MAXPLAYERS; j++) {
- PlayerInfo player = players [j];
- if (player && player.mo && playeringame [j])
- player.mo.GiveInventory (String.Format ("%sChallenge", selectedChallenge), 1);
- }
- challengesCount++
- }
- return challengesCount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement