










inst
reps 10
	new: simp 2 16 3 "jaws" 53 0 1000
	attr 195
	bhvr 48
	elas 50
	accg 0
	aero 0
	loop
		setv ov10 rand -1 1
	untl ov10 ne 0
	perm 60

	tick rand 8 15
	setv ov01 0
	setv ov02 500
	setv ov05 0
	setv ov07 0
	setv ov30 0
	setv ov36 24
	setv ov72 150
	setv ov92 rand 1 100

	mvto 2600 2200

repe
reps 10
	new: simp 2 16 3 "jaws" 53 0 1000
	attr 195
	bhvr 48
	elas 50
	accg 0
	aero 0
	loop
		setv ov10 rand -1 1
	untl ov10 ne 0
	perm 60

	setv ov01 0
	setv ov02 500
	setv ov07 0
	setv ov05 0
	setv ov30 0
	setv ov61 50
	setv ov72 150
	setv ov92 rand 1 100
	setv va00 rand 250 900
	setv va01 2250
	doif tmvt va00 va01 eq 1
		mvto va00 va01
		tick rand 8 15
	else
		kill targ
	endi
repe





scrp 2 16 3 9
	addv ov01 1
	subv ov02 1
	doif ov07 eq 1
		doif ov01 ge 500
			inst
			doif ov05 eq 0
				setv ov30 53
				setv ov72 200
				setv ov05 1
				setv ov01 0

			elif ov05 ge 1
				setv va00 posl
				setv va01 post
				setv va02 ov02
				setv va92 ov92
				setv va10 ov10
				new: simp 2 16 3 "jaws" 53 0 1000
				attr 195
				bhvr 48
				elas 50
				accg 0
				aero 0
				perm 60
				setv ov01 0
				setv ov02 va02
				setv ov05 0
				setv ov07 0
				setv ov10 va10
				setv ov30 0
				setv ov61 50
				setv ov72 150
				setv ov92 va92
				doif tmvt va00 va01 eq 1
					mvto va00 va01
					tick rand 8 15
				else
					kill targ
					kill ownr
				endi
				kill ownr
				slow
			endi
		endi
	endi
	doif ov02 le 0 or ov01 ge 600
		velo 0 0
		base ov30
		anim [48 49 50 51 52]


		over
		inst
		doif room targ <> -1
			altr room targ 4 0.1
			altr room targ 3 0.1
		endi
		kill ownr
		slow
	endi

	doif rtyp room targ ne 8 and rtyp room targ ne 9
		addv ov99 1
		accg 4
		aero 10
		setv vely 3

		wait 10
		doif rtyp room targ ne 8 and rtyp room targ ne 9
			sndc "fish"
			accg 4
			aero 10
			base ov30
			anim [48 49 50 51 255]
			loop
				wait 1
			untl fall eq 0

			velo rand -5 5 rand -10 -5
			doif ov99 ge 20
				stpc
				anim []
				wait 30
				kill ownr
			endi
			stop
		endi
	else
		setv ov99 0
		accg 0
		aero 0
	endi
	doif ov07 ne 1
		doif ov05 lt 8 and ov01 ge 250
			doif carr eq null
				inst
				setv va20 0

				esee 2 16 3
					addv va20 1
				next

				esee 2 18 22
					addv va20 5
				next
				targ ownr
				doif va20 lt 28

					setv va00 posl
					setv va01 post
					new: simp 2 18 22 "jaws" 4 53 10
					attr 192
					elas 0
					fric 100
					pose 3
					doif tmvt va00 va01 ne 1
						kill targ
						stop
					endi
					mvto va00 va01
					tick 600
					targ ownr
					addv ov05 1
					setv ov01 0
				else
					addv ov05 1
					setv ov01 0
				endi
				slow
			endi
		endi
	endi

	doif obst 0 lt 40 and ov10 lt 0
		base ov30
		anim [16 17 18 19 20 21 22 23]
		over
		negv ov10
	endi
	doif obst 1 lt 40 and ov10 gt 0
		base ov30
		anim [24 25 26 27 28 29 30 31]
		over
		negv ov10
	endi


	doif ov10 lt 0
		setv velx rand -3 -2
		base ov30
		anim [0 1 2 3 4 5 6 7 255]
	else

		setv velx rand 2 3
		base ov30
		anim [8 9 10 11 12 13 14 15 255]
	endi


	setv vely rand -1 1


	doif carr eq null
		doif ov02 lt 100 or rand 0 5 eq 0
			inst
			etch 4 0 0
				doif carr ne null
					stop
				endi
				setv va01 attr
				andv va01 829
				attr va01
				stpt
				tick 0
				velo 0 0

				seta va99 targ
				gsub feed
			next

			etch 2 13 0
				doif carr ne null
					stop
				endi
				doif spcs ne 5 and spcs ne 5811 and spcs ne 5818
					setv va01 attr
					andv va01 829
					attr va01
					stpt
					tick 0
					velo 0 0

					seta va99 targ
					gsub feed
				endi
			next

			etch 2 14 0
				doif carr ne null
					stop
				endi
				setv va01 attr
				andv va01 829
				attr va01
				stpt
				tick 0
				velo 0 0

				seta va99 targ
				gsub feed
			next

			etch 2 15 0
				doif carr ne null
					stop
				endi
				doif spcs ne 8 and spcs ne 5815 or ov92 eq mv92
					setv va01 attr
					andv va01 829
					attr va01
					stpt
					tick 0
					velo 0 0

					seta va99 targ
					gsub feed
				endi
			next

			etch 2 16 0
				doif carr ne null
					stop
				endi
				doif spcs ne 3 and spcs ne 5815 and spcs ne 5813 and spcs ne 5818
					setv va01 attr
					andv va01 829
					attr va01
					stpt
					tick 0
					velo 0 0

					seta va99 targ
					gsub feed
				endi
			next

			subr feed
				setv va00 posx
				mesg wrt+ ownr 1000 va00 va99 rand 1 5
				stop
			retn

		endi
	endi
endm


scrp 2 16 3 1000

	inst



	setv va00 _p1_
	subv va00 130

	doif gmap posx posy eq 3

		setv va79 2135
	else
		setv va79 post
		subv va79 50
	endi

	new: simp 1 1 24 "pirbubbs" 21 0 8000

	mvto va00 va79
	mesg wrt+ targ 0 _p2_ 0 0

	targ ownr
	setv va00 posx
	setv va01 posy
	addv va01 10
	rnge 500

	esee 2 16 3
		mesg wrt+ targ 1001 va00 va01 0

	next

	mesg wrt+ ownr 1001 posx posy 0
endm


scrp 2 16 3 1001

	doif ov99 eq 0
		setv va99 50
		setv va00 _p1_
		setv va01 _p2_

		addv ov02 ov72
		loop

			doif posx gt va00 and ov10 gt 0
				negv ov10
				setv velx rand -12 -8
				base ov30
				anim [32 33 34 35 36 37 38 39 255]
			elif posx gt va00 and ov10 lt 0
				setv velx rand -12 -8
				base ov30
				anim [32 33 34 35 36 37 38 39 255]
			elif posx lt va00 and ov10 lt 0
				negv ov10
				setv velx rand 8 12
				base ov30
				anim [40 41 42 43 44 45 46 47 255]
			elif posx lt va00 and ov10 gt 0
				setv velx rand 8 12
				base ov30
				anim [40 41 42 43 44 45 46 47 255]

			endi


			doif posy gt va01
				setv vely -1
			elif posy lt va01
				setv vely 1
			endi

			subv va99 1
		untl va99 le 0

		setv ov99 20


	endi
	unlk
endm


scrp 1 1 24 1
	sndl "pir2"
	inst
	esee 4 1 0
		chem 117 0.5
	next
	slow
	targ ownr
	anim [0 0 1 1 2 2 3 3 4 4 5 5]
	over

	anim [6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 255]
	setv va00 posx
	setv va01 posy

	wait 50
	inst

	setv va80 2
	targ _p1_
	doif targ ne null
		setv va02 bhvr
		doif va02 eq 16 or va02 gt 16 and va02 lt 32 or va02 ge 48
			setv va03 1
		endi
		doif fmly eq 4

			setv va80 10
		elif gnus eq 15 or gnus eq 16
			setv va80 5
		endi
	endi
	reps va80
		new: simp 2 10 30 "bone" 12 0 100
		attr 199
		bhvr 48
		elas 20
		accg 1
		doif tmvt va00 va01 eq 1
			mvto va00 va01
			setv velx rand -7 7
			setv vely rand -10 0
			anim [0 1 2 3 4 5 6 7 8 9 10 11 255]
			tick 10
		else
			kill targ
		endi
	repe
	targ ownr

	targ _p1_
	doif targ ne null
		doif fmly eq 4
			dead


			lock
			slow
			wait 1
			inst
		endi

		doif targ ne null
			doif va03 eq 1
				mesg writ targ 12
				doif targ ne null
					kill targ
				endi
			elif va03 ne 1
				kill targ
			endi
		endi
	endi
	slow

	targ ownr
	wait 50
	anim [5 4 3 2 1 0]
	over
	fade
	snde "burp"
	kill ownr
endm


scrp 2 10 30 6
	doif wall eq down
		pose rand 0 2
	endi
	tick rand 300 600
endm

scrp 2 10 30 9
	doif ov00 eq 1
		doif room targ <> -1 and carr = null
			altr room targ 3 0.01
			altr room targ 4 0.1
			kill ownr
		endi
	endi

	doif ov00 eq 0
		doif fall eq 0
			setv ov00 1
			tick rand 300 600
			pose rand 0 2
		endi
	endi
endm
scrp 2 10 30 12
	stim writ from 81 1
	kill ownr
endm
scrp 2 18 22 9
	doif pose gt 0
		setv va00 pose
		subv va00 1
		pose va00
	else
		setv va00 posl
		setv va01 post
		subv va01 20
		subv va00 16

		inst
		reps rand 3 5
			new: simp 2 16 3 "jaws2" 107 0 1000
			attr 195
			bhvr 48
			elas 50
			accg 0
			setv ov10 rand 0 1
			doif ov10 eq 0
				setv ov10 -1
			endi
			perm 60
			setv va99 0
			setv va98 0
			loop
				doif tmvt va00 va01 ne 1
					addv va00 1
					addv va99 1
				else
					setv va99 32
					setv va98 1
				endi
			untl va99 ge 32

			doif va98 eq 0
				kill targ
			else

				tick rand 8 15
				setv ov01 0
				setv ov02 150
				setv ov05 0
				setv ov07 1
				setv ov30 0
				setv ov72 250
				setv ov92 rand 1 100
				setv ov61 50
				mvto va00 va01
			endi
		repe
		kill ownr
	endi
endm

scrp 2 16 3 4
	setv ov99 1
endm

scrp 2 16 3 5
	setv ov99 0
endm
scrp 2 16 3 12
	stim writ from 80 1
	inst
	setv va00 posl
	setv va01 post
	reps 5
		new: simp 2 10 30 "bone" 12 0 100
		attr 199
		bhvr 48
		elas 20
		accg 1
		doif tmvt va00 va01 eq 1
			mvto va00 va01
			setv velx rand -7 7
			setv vely rand -10 0
			anim [0 1 2 3 4 5 6 7 8 9 10 11 255]
			tick 10
		else
			kill targ
		endi
	repe
	slow
	kill ownr
endm



rscr
enum 2 16 3
	kill targ
next
enum 1 1 24
	kill targ
next
enum 2 18 22
	kill targ
next
enum 2 10 30
	kill targ
next

scrx 1 1 24 1
scrx 2 16 3 9
scrx 2 16 3 5
scrx 2 16 3 4
scrx 2 16 3 12
scrx 2 16 3 1000
scrx 2 16 3 1001
scrx 2 10 30 6
scrx 2 10 30 9
scrx 2 10 30 12
scrx 2 18 22 9