Pastebin

Paste #1072: fdgfdg

< previous paste - next paste>

Pasted by fgfdg

Download View as text

function ClientRender()    
	if ( ICpayload == true ) then
		currentTime = getTickCount ()
		timeDifference = currentTime - loggedTime
				
		--Checkpoint marker A, ion cannon "beam"
		if ( timeDifference >= 100 ) and ( stopBeamGrow == false ) then 
        	IC_beamSize = IC_beamSize + 1
        	setMarkerSize ( ICBeam, IC_beamSize )
        	setMarkerSize ( ICBeam2, IC_beamSize )
        	setMarkerSize ( ICBeam3, IC_beamSize )
            if ( IC_beamSize == 6 ) then
            	ICShotFlare = true
            end
            local loops = loops + 1
            if ( loops == 18 ) then
            	stopBeamGrow = true
            end            
		end

		--Checkpoint marker B, used to preserve the "beam" as cp marker a disappears when changing size
		if ( timeDifference >= 150 ) and ( stopBeamGrowB == false ) then --20 loops 150ms intervals
        	IC_beamSize = IC_beamSize + 1 
        	setMarkerSize ( ICBeam, IC_beamSize )
        	setMarkerSize ( ICBeam2, IC_beamSize )
        	setMarkerSize ( ICBeam3, IC_beamSize )
            if ( IC_beamSize == 6 ) then
            	ICShotFlare = true
            elseif ( IC_beamSize == 6 ) then
           		stopBeamGrowB == true  
            end
		end

		--Corona "flare". Grows after cp marker B grows a little
		if ( timeDifference >= 30 ) and ( ICShotFlare == true ) then --150 loops 30ms intervals
			IC_beamFlareSize = IC_beamFlareSize + 1
			setMarkerSize ( ICBeamFlare, IC_beamFlareSize )
		end		
		
		--Explosions
		if ( timeDifference >= 170 ) and ( stopExplosions == false ) then --18 loops 170ms intervals
			local r = IC_beamSize --min/max blast radius: 1.5-28
		    angleUp = math.random(0, 35999)/100 --random angle between 0 and 359.99
			explosionXCoord = r*math.cos(angleUp) + ICBeaconX --circle trig math
			explosionYCoord = r*math.sin(angleUp) + ICBeaconY --circle trig math
			createExplosion ( explosionXCoord, explosionYCoord, ICBeaconZ, 7 )
			loggedTime = getTickCount ()
			IC_loops = IC_loops + 1
			if IC_loops == 16 then
				IC_flaresize = 20
				IC_flaresize2 = 20
				--setTimer ( ICFlareFade, 50, 155 )	--5, timer changed 
			elseif IC_loops == 18 then
				IC_loops = 0 ------reset stuff
		    	IC_beamSize = 5 ------reset stuff  
		    	stopExplosions = true
	        	destroyElement ( ICBeam )
        		destroyElement ( ICSecondaryBeam ) 
	        	destroyElement ( ICBeam2 )
        		destroyElement ( ICSecondaryBeam2 )
	        	destroyElement ( ICBeam3 )
        		destroyElement ( ICSecondaryBeam3 )
			end			
		end
	end	
end
addEventHandler ( "onClientRender", getRootElement(), ClientRender )

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.