



@(ScudState scud >=4)

#fire

hint "fired"

_x1 = (getpos scud select 0) + ((sin (getdir scud ))*SCUDDIST)
_y1 = (getpos scud select 1) + ((cos (getdir scud ))*SCUDDIST)
_z=0

~(SCUDDIST/200)

hint "SCUD impact located"




_maxradius =80


_radius=1
_winkel=1

goto "r"


#r
_radius = _radius + 1



	#w

	_winkel = _winkel + (random 5)+5

	_x=_x1 + sin(_winkel)*_radius
	_y=_y1 + cos(_winkel)*_radius

	_killObj = nearestObject [_x, _y, 0]
	;hint format["x: %1 \n y: %2 \n radius: %3 \n winkel: %4 \n maxradius: %5",_x,_y,_radius,_winkel,_maxradius]
	_killObj setdammage 1
		
	;? (_killObj == startobj) : goto "noexplosion"
	
	;? (not(isNull _killObj)) : _killObj setPos [0, 0, 0]
	
	
	
	;?(random 10 >2): goto "noexplosion"	
	
	
	#noexplosion	


	
	#killLoopEnd
	?(_winkel < 360):goto "w"

_w=random 355
_x=_x1 + sin(_w)*_radius
_y=_y1 + cos(_w)*_radius

;impact="shell125" camcreate [_x,_y,0]

~.000005	


	_winkel = -10
	~.0000001

?(_radius<_maxradius):goto "r"



exit
 






















