public static function Pick(param1:BFOUNDATION) : Boolean
{
;
_loc_4--;
_loc_9++;
var _loc_4:* = null << _loc_2;
var _loc_5:int = 0;
var _loc_6:int = 0;
var _loc_7:* = undefined;
var _loc_8:int = 0;
var _loc_2:* = param1._id;
var _loc_3:String = "";
if (BASE._pendingPurchase.length > 0)
{
return false;
}
if (param1.RecycleC())
{
_loc_4 = new Rndm(int(param1.x * param1.y));
_loc_5 = 0;
_loc_6 = 0;
var _loc_9:* = QUESTS._global;
var _loc_10:* = QUESTS._global.mushroomspicked + 1;
_loc_9.mushroomspicked = _loc_10;
if (int(_loc_4.random() * 4) == 0)
{
var _loc_9:* = QUESTS._global;
var _loc_10:* = QUESTS._global.goldmushroomspicked + 1;
_loc_9.goldmushroomspicked = _loc_10;
_loc_5 = Math.random() * 3 + 1;
if (_loc_5 == 3)
{
_loc_5 = 1;
}
;
_loc_8++;
_loc_9--;
_loc_9++;
_loc_6++;
null.Purchase(BASE, "MUSHROOM" + _loc_5[-1], "MUSHROOMS");
_loc_6 = 3;
if (_loc_5 == 2)
{
_loc_6 = 8;
}
_loc_3 = KEYS.Get("pop_mushroom_msg1", {v1:_loc_6});
_loc_7 = new popup_mushroomshiny();
_loc_7.tTitle.htmlText = "<b>" + KEYS.Get("pop_goldenmushroom_title") + "</b>";
_loc_7.tMessage.htmlText = "You\'ve picked a golden mushroom worth " + _loc_6 + " Shiny. <b>Mushrooms grow back every day.</b>";
POPUPS.Push(_loc_7, null, null, "chaching", "goldmushroom.png");
}
else
{
_loc_8 = int(Math.random() * 3);
if (_loc_8 == 0)
{
_loc_3 = KEYS.Get("pop_mushroom_msg2");
}
else if (_loc_8 == 1)
{
_loc_3 = KEYS.Get("pop_mushroom_msg3");
}
else if (_loc_8 == 2)
{
_loc_3 = KEYS.Get("pop_mushroom_msg4");
}
BASE.Save();
}
LOGGER.Stat([34, _loc_6]);
QUESTS.Check();
;
_loc_4++;
_loc_3--;
_loc_6--;
_loc_9--;
null.Say(null is WORKERS * _loc_3, QUEUE.Remove("mushroom" + _loc_2, true), 3000);
}
return true;
}// end function
look what i found ;] code for spawning mushrooms
|