inst
reps 20
	new: simp 2 3 5815 "pondscumweed" 1 0 rand 100 4500
	attr 195
	bhvr 48
	accg 0.5
	elas 0
	fric 20
	perm 15
	aero 2
	setv ov72 rand 20 40
	setv ov80 0.5
	setv ov82 1
	setv ov87 0
	tick rand 300 600
	setv va00 rand 250 900
	setv va01 2250
	doif tmvt va00 va01 eq 1
		mvto va00 va01
		velo rand -5 5 0
	else
		kill targ
	endi
repe
reps 20
	new: simp 2 3 5815 "pondscumweed" 1 0 rand 100 4500
	attr 195
	bhvr 48
	accg 0.5
	elas 0
	fric 20
	perm 15
	aero 2
	setv ov72 rand 20 40
	setv ov80 0.5
	setv ov82 1
	setv ov87 0
	tick rand 300 600
	setv va00 rand 2450 2800
	setv va01 2150
	doif tmvt va00 va01 eq 1
		mvto va00 va01
		velo rand -5 5 0
	else
		kill targ
	endi
repe
scrp 2 3 5815 9
	lock
	rnge 1000
	setv va66 0
	esee 2 5 5815
		addv va66 1
	next
	targ ownr
	doif va66 gt 100
		kill ownr
	endi
	unlk
	doif fall eq 0 and carr eq null
		doif rtyp room targ eq 9
			kill ownr
		endi
		gsub envi
		gsub dorm
	endi
	subr envi
		doif prop room targ 1 le ov80 and prop room targ 1 ge 0.002
			setv va00 1
		else
			setv va00 0
		endi
		doif prop room targ 2 le ov82 and prop room targ 2 ge 0.01
			setv va01 1
		else
			setv va01 0
		endi
		doif prop room targ 4 ge ov87
			setv va02 1
		else
			setv va02 0
		endi
		doif rtyp room targ eq 8
			setv va03 1
		else
			setv va03 0
		endi
		doif va00 eq 1 and va01 eq 1 and va02 eq 1 and va03 eq 1
			gsub grow
		endi
	retn
	subr grow
		setv va00 posl
		setv va01 post
		new: simp 2 5 5815 "pondscumweed" 4 1 rand 100 4500
		attr 192
		bhvr 16
		perm rand 15 25
		accg 0
		aero 3
		elas 0
		fric 5
		subv va00 36
		subv va01 28
		setv ov00 0
		setv ov01 0
		setv ov02 30
		doif tmvt va00 va01 eq 1
			mvto va00 va01
		else
			kill targ
			kill ownr
		endi
		tick 4
		kill ownr

	retn
	subr dorm
		subv ov72 1
		doif ov72 le 0
			doif room targ ne -1 and carr eq null
				altr room targ 3 0.05
				altr room targ 4 0.1
				kill ownr
			else
				kill ownr
			endi
		endi
	retn
endm
scrp 2 5 5815 9
	doif ov00 eq 0
		lock
		rnge 1000
		setv va66 0
		esee 2 5 5815
			addv va66 1
		next
		doif va66 gt 80
			kill ownr
		endi
		unlk
		setv ov00 1
	endi
	doif ov00 eq 1 or ov00 eq 2
		gsub float
	endi
	doif ov00 eq 2
		gsub drift
	endi
	doif ov02 le 0
		kill ownr
	endi
	subr float
		setv va50 post
		setv va51 posb
		addv va50 5
		subv va51 20
		doif rtyp grap posx va50 ne 8 and rtyp grap posx va50 ne 9
			doif rtyp grap posx va51 eq 8 or rtyp grap posx va51 eq 9
				accg 0
				setv ov00 2
			elif rtyp grap posx va51 ne 8 and rtyp grap posx va51 ne 9
				setv ov00 1
				accg 0.01
				subv ov02 1
			endi
		elif rtyp grap posx va50 eq 8 or rtyp grap posx va50 eq 9
			setv ov00 1
			accg -0.01
		endi

	retn
	subr drift
		addv ov01 1
		doif ov01 eq 10
			setv va50 rand 1 4
			setv va51 rand 1 4
			divv va51 2
			addv ov99 1
			setv ov01 0
		endi
		doif va50 eq 1
			addv velx va51
		elif va50 eq 2
			subv velx va51
		elif va50 eq 3 or va50 eq 4
			addv velx 0
		endi

		doif ov99 ge 15
			doif pose lt 3
				setv va00 pose
				addv va00 1
				pose va00
				setv ov99 0
			endi
		else
			gsub mature
		endi
	retn
	subr mature
		doif ov99 ge 999
			setv va00 posl
			setv va01 post
			reps rand 5 10
				new: simp 2 3 5815 "pondscumweed" 1 0 rand 100 4000
				attr 195
				bhvr 48
				accg 0.5
				elas 0
				fric 20
				perm 15
				aero 2
				setv ov72 rand 10 20
				setv ov80 0.5
				setv ov82 1
				setv ov87 0
				tick rand 300 600
				doif tmvt va00 va01 eq 1
					mvto va00 va01
					velo rand -10 10 0
				else
					kill targ
				endi
			repe
			reps 8
				new: simp 2 5 5815 "pondscumweed" 4 1 rand 100 4500
				attr 192
				bhvr 16
				perm rand 15 25
				accg 0
				aero 3
				elas 0
				fric 5
				setv ov00 0
				setv ov01 0
				setv ov02 30
				addv va00 rand -10 10
				doif tmvt va00 va01 eq 1
					mvto va00 va01
				elif tmvt va00 va01 ne 1
					kill targ
				endi
				tick 8
			repe
			kill ownr

		endi
	retn
endm
scrp 2 3 5815 12
	stim writ from 77 0.1
	kill ownr
endm
scrp 2 5 5815 12
	inst
	targ from
	chem 5 0.4
	chem 12 0.2
	chem 26 0.05
	chem 150 -0.4
	chem 149 -0.2
	targ ownr
	doif pose eq 3
		setv va02 6
	elif pose eq 2
		setv va02 4
	elif pose eq 1
		setv va02 2
	endi
	doif pose ge 1
		setv va00 posl
		setv va01 post
		reps va02
			new: simp 2 5 5815 "pondscumweed" 4 1 rand 100 4500
			attr 192
			bhvr 16
			perm rand 15 25
			accg 0
			aero 3
			elas 0
			fric 5
			setv ov00 0
			setv ov01 0
			setv ov02 30
			addv va00 rand -10 10
			doif tmvt va00 va01 eq 1
				mvto va00 va01
			elif tmvt va00 va01 ne 1
				kill targ
				kill ownr
			endi
			tick 8
		repe
		kill ownr
	elif pose lt 1
		kill ownr
	endi
	slow
endm
rscr
enum 2 3 5815
	kill targ
next
enum 2 5 5815
	kill targ
next
scrx 2 3 5815 9
scrx 2 3 5815 12
scrx 2 5 5815 9
scrx 2 5 5815 12