1: "-- Check to see if a player is holding the Sprite Soda. --"; 2: if (this.location != player) 3: player:tell("You need to be holding the Sprite Bottle to drink it!"); 4: return; 5: endif 6: "-- Check to see if there is and Sprite Soda left to drink in the bottle --"; 7: if (this.remaining == 0) __8_ player:tell("The bottle of Sprite is empty."); ^^9^ return; 10: endif 11: "-- Drink 20% of the original volume --"; 12: this.remaining = this.remaining - 20; 13: if (this.remaining == 0) 14: player:tell("You finished off the last of the Sprite Soda"); 15: player.location:announce(player.name + " finishes off the last of the Sprite Soda"); 16: else _17_ player:tell("You take a cool refreshing thirst-quenching gulp of Sprite"); ^18^ player.location:announce(player.name + " takes a cool refreshing thirst-quenching gulp of Sprite Soda."); 19: endif 20: "-- Get a gulp --" 21: "-- test --" 22: "" -- gulps = {5, 10, 15, 20}; --"; 23: cool = 0; 24: while (!cool) 25: $command_utils:suspend_if_needed(0); 26: gulp = random(length(gulps)); _27_ if (gulps[gulp] <= this:remaining) ^28^ cool = 1; 29: endif ^30^ endwhile ^31^ "-- Drink the gulp --"; ^32^ this.remaining = this.remaining - gulps[gulp]; ^33^ if (this.remaining == 0) ^34^ player:tell("You gulp down the last of the Spride Soda."); ^35^ elseif (gulps[gulp] == 5 || gulps[gulp] == 10) 26: gulp = random(length(gulps)); 27: if (gulps[gulp] <= this:remaining) 28: cool = 1; 29: endif 30: endwhile 31: "-- Drink the gulp --"; 32: this.remaining = this.remaining - gulps[gulp]; 33: if (this.remaining == 0) _34_ player:tell("You gulp down the last of the Spride Soda."); ^35^ elseif (gulps[gulp] == 5 || gulps[gulp] == 10) 36: player:tell("You take a sip of the Sprite Soda."); 37: player.location:announce(player.name + " takes a sip of Sprite Soda"); 38: else 39: player:tell("You take a nice refreshing thirst-quenching gulp of Sprite Soda."); 40: player.location:announce(player.name + " takes a nice refreshing thirst-quenching gulp of Sprite Soda."); 41: endif