Welcome to the Creatures Wiki! Log in and join the community.
Editing Full Lifecycle Plant script
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 50: | Line 50: | ||
==Fruit timer script== | ==Fruit timer script== | ||
− | Fruit timer script - first checks there aren't too many fruits nearby, then checks if the fruit is in water, then tests the environment for light, heat and nutrients (and then if there are enough, the plant grows, using the [[:File:Sharmflower.c16|sharmflower.c16]] file) but if there aren't enough, the fruit goes dormant and eventually is | + | Fruit timer script - first checks there aren't too many fruits nearby, then checks if the fruit is in water, then tests the environment for light, heat and nutrients (and then if there are enough, the plant grows, using the [[:File:Sharmflower.c16|sharmflower.c16]] file) but if there aren't enough, the fruit goes dormant and eventually is killed. |
Line 67: | Line 67: | ||
[[unlk]] | [[unlk]] | ||
* if not being carried or falling | * if not being carried or falling | ||
− | doif | + | doif fall eq 0 and carr eq null |
− | doif | + | doif rtyp room targ eq 8 or rtyp room targ eq 9 |
kill ownr | kill ownr | ||
endi | endi | ||
* check environment to test whether can sprout | * check environment to test whether can sprout | ||
− | + | gsub envi | |
* if don't survive envi test, go dormant | * if don't survive envi test, go dormant | ||
− | + | gsub dorm | |
endi | endi | ||
**environment test - grow if successful | **environment test - grow if successful | ||
− | + | subr envi | |
* light check | * light check | ||
− | doif | + | doif prop room targ 1 le ov80 |
setv va00 1 | setv va00 1 | ||
endi | endi | ||
* heat check | * heat check | ||
− | doif prop | + | doif prop room targ 2 le ov82 |
setv va01 1 | setv va01 1 | ||
endi | endi | ||
* nutrient check | * nutrient check | ||
− | doif prop room | + | doif prop room targ 4 ge ov87 |
setv va02 1 | setv va02 1 | ||
endi | endi | ||
Line 94: | Line 94: | ||
* can I grow? | * can I grow? | ||
doif va00 eq 1 and va01 eq 1 and va02 eq 1 | doif va00 eq 1 and va01 eq 1 and va02 eq 1 | ||
− | + | gsub grow | |
endi | endi | ||
− | + | retn | |
**growing into plant routine | **growing into plant routine | ||
− | + | subr grow | |
− | + | setv va00 posl | |
− | setv va01 | + | setv va01 post |
− | + | new: simp 2 4 1000 "sharmflower" 9 0 140 | |
− | + | attr 199 | |
− | + | bhvr 43 | |
− | + | elas 0 | |
*OV00 - Plant state (0=growing, 1=fruiting, 2=dying, 3=picked) | *OV00 - Plant state (0=growing, 1=fruiting, 2=dying, 3=picked) | ||
setv ov00 0 | setv ov00 0 | ||
Line 120: | Line 120: | ||
**dormancy routine | **dormancy routine | ||
− | + | subr dorm | |
doif pose lt 4 | doif pose lt 4 | ||
* make it invisible | * make it invisible | ||
Line 138: | Line 138: | ||
endi | endi | ||
endi | endi | ||
− | + | retn | |
endm | endm | ||