I probably need to put some population checks so that we don't end up with SUDDENLY, A MILLION WORMS! come dusk.

The egg timer code:
- Code: Select all
**If you've been hanging around for a bit
doif ov00 ge 5
**go die now
gsub diee
**if it's not afternoon or night time
elif time ne 3 or time ne 4
**go be dormant for a bit
gsub dorm
**if your egg is fresh and it's afternoon or night time
else
**go hatch
gsub hatch
endi
**die subroutine
subr diee
kill ownr
retn
**dormancy subroutine
subr dorm
wait rand 50 300
addv ov00 1
doif ov00 ge 5
gsub diee
endi
retn
**hatch subroutine
subr hatch
**set the place you're going to hatch from
setv va00 posl
setv va01 post
inst
new: simp 2 13 X "albianglowworm" 12 0 rand 1500 5500
attr 198
bhvr 57
elas 4
perm 60
accg 2
aero 2
fric 50
mvsf va00 va01
***movement counter
setv va20 rand 1 2
doif va20 = 1
setv ov00 51
elif va20 = 2
setv ov00 0
tick 1
**the egg should be destroyed now
targ ownr
kill ownr
retn
endm
Just a little stuck on thinking my way through the initial 'blossoming/ripening' of the egg in the patch. One of the features I was hoping to include was to make the eggs super-bouncy (but not perfectly bouncy, they'd stop eventually), but I can't logic my way through getting the egg to only hatch if they're not falling.