**Spawn twenty golden carrips at the ground level of the treehouse.
loop
	addv va00 1
	new: simp 2 3 1 "goldencarrip" 1 18 rand 500 1000
	setv ov99 1
	attr 194
	elas 0
	accg 10
	mvsf rand 2066 3930 1189
untl va00 ge 20

**Seed stuff.
**ov99: Whether the seed is an instant type.
**Tick script.
scrp 2 3 1 9
**Grow.
	etch 2 11 1
		setv va00 1
	next
**But only if you're not touching another plant.
	doif va00 ne 1
		setv va00 posl
		subv va00 21
		setv va01 post
		subv va01 18
		new: simp 2 11 1 "goldencarrip" 15 0 rand 500 1000
		attr 16
		tick rand 600 1200
		mvto va00 va01
	endi
	kill ownr
endm

**Collision script.
**This is just here for the random generation at the start of the world.
scrp 2 3 1 6
	doif ov99 eq 1
		setv va00 posl
		subv va00 21
		setv va01 post
		subv va01 18
		new: simp 2 11 1 "goldencarrip" 15 0 rand 500 1000
		attr 16
		setv ov00 rand -1 9
		mesg writ targ 9
		tick rand 600 1200
		mvto va00 va01
		kill ownr
	endi
endm

**Eat script.
scrp 2 3 1 12
	doif crea from eq 1
		stim writ from 77 0.5
	endi
	snde "chwp"
	kill targ
endm

**Plant stuff.
**ov00: Age of the plant.
**ov01: Whether it's been uprooted.
scrp 2 11 1 9
	tick rand 600 1200
**If it's not uprooted, grow.
	doif ov01 ne 1
		addv ov00 1
		pose ov00
**If it's fully grown, become holdable, become edible, smell like food, and remain in this stage for a long time.
		doif ov00 eq 7
			tick rand 3000 4000
			bhvr 48
			attr 2
			emit 8 0.01
			core 0 5 0 45
**If it's bolted, stop doing all of the things just mentioned.
		elif ov00 eq 8
			bhvr 0
			attr 16
			emit 8 0
		elif ov00 eq 11
**If seeds have formed, produce three to seven seeds and toss them around like a maniac.
			setv va01 posx
			setv va02 posy
			addv va02 10
			inst
			loop
				addv va00 1
				new: simp 2 3 1 "goldencarrip" 1 18 rand 500 1000
				tick rand 600 1200
				attr 194
				bhvr 48
				elas 0
				accg 10
				mvsf va01 va02
				velo rand -100 100 -30
			untl va00 ge rand 3 7
			targ ownr
			pose 8
			tick rand 1200 1800
		elif ov00 eq 12
**If it's dying, die.
			kill ownr
		endi

	else
		kill ownr
	endi
endm

**Get script.
scrp 2 11 1 4
	attr 194
	setv ov01 1
	elas 0
	accg 5
	perm 60
	core 0 46 0 45
endm

**Hit ground script.
scrp 2 11 1 6
	doif pose eq 7
		pose 12
	endi
endm

**Eat script.
scrp 2 11 1 12
	snde "chwp"
	doif crea from eq 1
		stim writ from 79 1
	endi
	addv ov02 1
**Do pose stuff.
	doif ov02 eq 3
		kill targ
	else
		setv va00 12
		addv va00 ov02
		pose va00
	endi
endm

**Detritus scripts.
**ov02: Bites taken.
**Tick script.
scrp 2 20 2 9
*Literally just kill it.
	kill ownr
endm

**Eat script.
scrp 2 20 1 12
	snde "chwp"
**If it's a creature, stim it with ate detritus.
	doif crea from eq 1
		stim writ from 81 1
	endi
	addv ov02 1
**Do pose stuff.
	doif ov02 eq 3
		kill targ
	else
		pose ov02
	endi
endm

**Get script.
scrp 2 20 1 4
	attr 194
	setv ov01 1
	elas 0
	accg 5
	perm 60
	core 0 46 0 45
endm


rscr
enum 2 11 1
	kill targ
next
enum 2 3 1
	kill targ
next
scrx 2 3 1 6