// Contract: RedBalloons
// Target function: function buySpamJerky() public payable
7;
		panda= 0xEB8016B75296f6813d6b19214D5242e502bAA77a;
		penguin= 0x9A813eEA1Ff09886822B82C50C69166e0ABA3eA8;
		gold= 0x6C2206803D7b391680115AC58300a7E8A4BF3A86;
		water= 0x3552F79387a2Bf7CF523EB17754557C00fFdeBd4;
		fox= 0x3552F79387a2Bf7CF523EB17754557C00fFdeBd4;
		bat= 0xa21dCf1d1Af5B90Ba595Ac1A75fef02BA0B50783;
		wheat= 0x8CbEbb53B8a055aCdAA8Cf5926A1a49943b6886C;
		skull= 0x1d62238AA18a06dc81825cA3D587F63dE25Ad64E;
		shootingStar= 0xe96E4fAf6471e0c81FD50272B78Cf38ee23B408d;
		deer= 0x7B6f4f87C3a26a9aEf7783376270baff6b862cAB;
		crane= 0xF272bD18A29F2D443Ad0691a92dF33D677caDE05;
		wolf= 0x9277d525296ee2F97B0d0542EC8CB897f13aCA67;
		moon= 0x1aBB66426ee9A3540B1218E1013c3505465074A1;
		bee= 0x4c2F0aD9848cADc43542A0d3Cfca5C6614389529;
		monkey= 0x8C55726D2930f1f9CD852304fA034598FD583363;
		eye= 0xf1858E92c8e85EB4C2a47FccA4f5544669703669;
		golem= 0x852c23ec1dD46119c66E00Ab9177bd3856957462;
		pawPrints= 0xe9f7894459f8dBfE561180C59f1D5296da87F50d;
		goat= 0xA86de0151cC62A93de3EA437Af2ED518720974df;
		lion= 0x001db9B1C90fd9f980771d55b2B9Ac5fD17d76Cc;
		unicorn= 0x96A3fC06Bb4A754e8029e1F302F2c7BB2c75A30d;
		octopus= 0xfd7360c316c997962b2a054cE62502a1cB94E433;
		frog= 0x4c5b1A5c0e3837b76B0f9023360008aF6F6486D5;
		forest= 0xEDf5f8324F3fa8476c2f3b70476ACf2362288E03;
		snake= 0xE297b0fb3aF82D7a57dFd3901a3F31fe077f6dD3;
		spider= 0x8DCA2943C3029A534f0adC0110d9ae03d6A4ba34;
		rose= 0x89d82551aB98Edce5B0f2bd186c9F777aa44dC00;
		sunflower= 0x9855038469cb77E96412e95078bd116247114ace;
		palmTree= 0x54bFd5EcF6a6dF7fE51f4dFAeA603029A168289b;
		dragonFly= 0xA57550bef190c0db3E03922e4aFb156B27e76d95;
		shroom= 0xfb762d7ae46803C91e0db759e417d57Bf2726362;

		redBalloonLocation = panda;

		Haley = msg.sender;
		balloonGiver = Haley;
		genesis = block.timestamp;
		timeLastBalloonPopped = block.timestamp;

		moreShares(Haley, 1e18);//just so we can kick things off without having to wait.
	}

	Token snowman;
	Token jack_o_lantern;
	Token blackSwan;
	Token haleysArrow;
	Token moonHowler;
	Token vampire;
	Token miracleMilk;
	Token beeHive;
	Token surfBoard;
	Token canoe;
	Token boat;
	Token submarine;
	Token apeIn;
	Token teleporter;
	Token thirdEye;
	Token hourglassStarDust;
	Token manyPlace;
	Token chimeraGargoyle;
	Token kyuubi;
	Token ironGiant;
	Token bread;
	Token kraken;
	Token pegasus;
	Token tyrone;
	Token honey;
	Token sniperDrone;
	Token[] cards;

	function newCard(string memory name, string memory symbol, uint8 R, uint8 G, uint8 B, uint C) internal returns(Token){
		Token newToken = new Token(name, symbol);
		address rBT = address(newToken);
		ofBalloons[rBT] = true;
		token_R[rBT] = R;
		token_G[rBT] = G;
		token_B[rBT] = B;
		token_Color[rBT] = C; 
		cards.push(newToken);
		return newToken;
	}

/*
██████╗░░█████╗░░██████╗██╗░█████╗░░██████╗
██╔══██╗██╔══██╗██╔════╝██║██╔══██╗██╔════╝
██████╦╝███████║╚█████╗░██║██║░░╚═╝╚█████╗░
██╔══██╗██╔══██║░╚═══██╗██║██║░░██╗░╚═══██╗
██████╦╝██║░░██║██████╔╝██║╚█████╔╝██████╔╝
╚═════╝░╚═╝░░╚═╝╚═════╝░╚═╝░╚════╝░╚═════╝░
*/


	function floatingCastle() public view returns(address _floatingCastle){
		(,,,,,,_floatingCastle,) = lamp.XY(address0);
	}
	function isCaravan(address kingdom) public view returns(bool IS){
		(,,,,,,,IS) = lamp.XY(kingdom);
	}

/*
░██████╗░███████╗████████╗  ██╗░░██╗██╗░░░██╗
██╔════╝░██╔════╝╚══██╔══╝  ╚██╗██╔╝╚██╗░██╔╝
██║░░██╗░█████╗░░░░░██║░░░  ░╚███╔╝░░╚████╔╝░
██║░░╚██╗██╔══╝░░░░░██║░░░  ░██╔██╗░░░╚██╔╝░░
╚██████╔╝███████╗░░░██║░░░  ██╔╝╚██╗░░░██║░░░
░╚═════╝░╚══════╝░░░╚═╝░░░  ╚═╝░░╚═╝░░░╚═╝░░░
*/

	function getXY(address kingdom) public view returns(uint X, uint Y){
		(X,Y,,,,,,) = lamp.XY(kingdom);
	}


/*
██████╗░██████╗░░█████╗░██╗░░██╗██╗███╗░░░███╗██╗████████╗██╗░░░██╗
██╔══██╗██╔══██╗██╔══██╗╚██╗██╔╝██║████╗░████║██║╚══██╔══╝╚██╗░██╔╝
██████╔╝██████╔╝██║░░██║░╚███╔╝░██║██╔████╔██║██║░░░██║░░░░╚████╔╝░
██╔═══╝░██╔══██╗██║░░██║░██╔██╗░██║██║╚██╔╝██║██║░░░██║░░░░░╚██╔╝░░
██║░░░░░██║░░██║╚█████╔╝██╔╝╚██╗██║██║░╚═╝░██║██║░░░██║░░░░░░██║░░░
╚═╝░░░░░╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝╚═╝╚═╝░░░░░╚═╝╚═╝░░░╚═╝░░░░░░╚═╝░░░*/
	function proximity(address one, address two, bool _4_8) public view returns(bool){
		(uint x1, uint y1) = getXY(one);
		(uint x2, uint y2) = getXY(two);
		
		uint distance = (x1<x2?(x2-x1):(x1-x2)) + (y1<y2?(y2-y1):(y1-y2));
		address _floatingCastle = floatingCastle();
		return ( (distance == 1) || ( _4_8 && (distance == 2 && x1 != x2 && y1 !=y2) )  ) && one != _floatingCastle && two != _floatingCastle;
	}

	/*
	Freeze Spam
	for Shares on PiZZa dividends that come from whatever valid kingdom the balloon is floating over
	balloon giver gets 5%
	dev gets 5%
	

	Give a fraction of spam to those who buy Rations
	The % of new eth compared to input eth. (yes, it becomes increasingly difficult to get 100% of spam.)


	the buyer that causes the kingdom to become the floating kingdom pops the balloon.
	or the buyer that buys while the kingdom with the balloon is floating
	*/

/*
░██████╗████████╗░█████╗░░█████╗░██╗░░██╗  ██████╗░░█████╗░██╗░░░░░██╗░░░░░░█████╗░░█████╗░███╗░░██╗
██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║░██╔╝  ██╔══██╗██╔══██╗██║░░░░░██║░░░░░██╔══██╗██╔══██╗████╗░██║
╚█████╗░░░░██║░░░██║░░██║██║░░╚═╝█████═╝░  ██████╦╝███████║██║░░░░░██║░░░░░██║░░██║██║░░██║██╔██╗██║
░╚═══██╗░░░██║░░░██║░░██║██║░░██╗██╔═██╗░  ██╔══██╗██╔══██║██║░░░░░██║░░░░░██║░░██║██║░░██║██║╚████║
██████╔╝░░░██║░░░╚█████╔╝╚█████╔╝██║░╚██╗  ██████╦╝██║░░██║███████╗███████╗╚█████╔╝╚█████╔╝██║░╚███║
╚═════╝░░░░╚═╝░░░░╚════╝░░╚════╝░╚═╝░░╚═╝  ╚═════╝░╚═╝░░╚═╝╚══════╝╚══════╝░╚════╝░░╚════╝░╚═╝░░╚══╝*/
	mapping( uint => mapping(address=>uint) ) stockedBalloons;
	mapping( uint => address ) recordSetter;
	function stockBalloonToken(uint amount) public{
		
		address sender = msg.sender;
		require( 0<amount && PiZZa.balanceOf(sender) >= 10e18 );
		balloonToken.transferFrom(sender, THIS, amount);
		stockedBalloons[redBalloonsLeftOnTheWall][sender] += amount;
		uint newCount = stockedBalloons[redBalloonsLeftOnTheWall][sender];
		
		moreShares(sender, amount*9/10);
		moreShares(/*for the current balloon giver*/balloonGiver, amount/20);
		moreShares(/* operational */ Haley, amount/20);

		if( stockedBalloons[redBalloonsLeftOnTheWall][ recordSetter[redBalloonsLeftOnTheWall] ] < newCount ){
			recordSetter[redBalloonsLeftOnTheWall] = sender;
		}
	}

/*
██████╗░███████╗██╗░░░░░███████╗░█████╗░░██████╗███████╗  ██████╗░░█████╗░██╗░░░░░██╗░░░░░░█████╗░░█████╗░███╗░░██╗
██╔══██╗██╔════╝██║░░░░░██╔════╝██╔══██╗██╔════╝██╔════╝  ██╔══██╗██╔══██╗██║░░░░░██║░░░░░██╔══██╗██╔══██╗████╗░██║
██████╔╝█████╗░░██║░░░░░█████╗░░███████║╚█████╗░█████╗░░  ██████╦╝███████║██║░░░░░██║░░░░░██║░░██║██║░░██║██╔██╗██║
██╔══██╗██╔══╝░░██║░░░░░██╔══╝░░██╔══██║░╚═══██╗██╔══╝░░  ██╔══██╗██╔══██║██║░░░░░██║░░░░░██║░░██║██║░░██║██║╚████║
██║░░██║███████╗███████╗███████╗██║░░██║██████╔╝███████╗  ██████╦╝██║░░██║███████╗███████╗╚█████╔╝╚█████╔╝██║░╚███║
╚═╝░░╚═╝╚══════╝╚══════╝╚══════╝╚═╝░░╚═╝╚═════╝░╚══════╝  ╚═════╝░╚═╝░░╚═╝╚══════╝╚══════╝░╚════╝░░╚════╝░╚═╝░░╚══╝*/
	function releaseBalloon() public{
		
		address sender = msg.sender;
		address theNewGuy = recordSetter[redBalloonsLeftOnTheWall];
		require(
			( timeLastBalloonPopped+86400 < block.timestamp || sender == theNewGuy )
			&& theNewGuy != address0//we need to keep this so that the balloonGiver is not null. giving money to null address
			&& redBalloonsLeftOnTheWall > 0
			&& panda != floatingCastle()
			&& !redBalloonOnTheLoose
		);
		balloonGiver = theNewGuy;
		redBalloonsLeftOnTheWall -= 1;
		redBalloonLocation = panda;
		redBalloonOnTheLoose = true;
	}