** Bramboo berry Timer scrp 2 8 8 9 doif ov00 = 0 and ov01 = 0 ** Create petals inst seta va16 ownr * dbg: asrt type va16 <> 0 ** Loop Counter setv va00 0 setv va10 ov30 setv va11 ov31 subv va11 5 ** grab the genetic colours, for the petals setv va41 ov41 setv va42 ov42 setv va43 ov43 setv va44 ov44 setv va45 ov45 ** make the petals inst loop new: simp 2 7 6 "bramboo" 13 123 305 seta ov16 ownr attr 192 accg 0 aero 1 fric 100 elas 50 ** Move slightly to the left subv va10 10 doif game "Bramboo_Genetic_RotnSwap" = 1 tint va41 va42 va43 va44 va45 else tint va41 va42 va43 128 128 endi doif tmvt va10 va11 = 1 mvto va10 va11 ** Store the Bramboo in ov99 seta ov16 va16 * dbg: asrt type ov16 <> 0 velo 0 0 show 0 setv ov00 0 else kill targ endi ** . addv va00 1 untl va00 = 2 targ ownr setv ov01 1 endi doif fall = 0 and ov70 = 0 and ov00 = 1 setv ov70 1 accg 3 endi ** If plucked / dropped, age. doif ov00 = 1 addv ov01 1 endi ** If old enough, rot down to goo. ** Then check the local environment. ** If there aren't too many other Bramboo around, then grow into a Bramboo plant all of your own! ** I have lowered the time for the bramboo to regrow.. doif ov01 > 3 doif ov99 = 0 ** can't be picked up by the hand, can't be seen by a creature... doif carr = null attr 209 else setv ov88 1 endi * dbg: outs "bramboo - NOT good to grow!!" setv name "goodtogrow" 0 frat rand 20 30 anim [0 1 2 3 4] over endi ** Set attributes if no longer held. doif ov88 = 1 and carr = null attr 209 endi ** Check local environment call 1001 0 0 ** If you're "good to grow" then go right ahead! doif name "goodtogrow" = 1 * dbg: outs "bramboo = good to grow" ** Genetic Stuff setv va40 ov40 setv va41 ov41 setv va42 ov42 setv va43 ov43 setv va44 ov44 setv va45 ov45 setv va46 ov46 setv va47 ov47 setv va48 ov48 setv va49 ov49 setv va50 ov50 ** Firstly, potentially mutate the genetic height. doif va40 = 2 ** If it is at 2 then potentially increase it. setv va99 rand 1 2 doif va99 = 1 addv va40 1 endi ** if it is 3 or above, but less than 40 then it could either increase or decrease. elif va40 >= 3 and va40 < 40 setv va99 rand 1 6 doif va99 < 4 subv va40 1 elif va99 = 6 addv va40 1 endi ** If it is at 40, then potentially decrease it. elif va40 = 40 setv va99 rand 1 2 doif va99 = 1 subv va40 rand 1 3 endi endi * ================= * Pigment Mutations * ================= * * Basically I make up a fake pigment (va5x) and see if it is higher * or lower than the genetic pigment (va4x). If the fake pigment is higher * then the genetic pigment will increase, if it is lower then it will decrease. * GENETIC Petal Red - Mutation doif va41 > 255 setv va41 255 elif va41 < 0 setv va41 0 endi setv va51 rand 100 255 doif va51 < va41 subv va41 rand 5 15 elif va51 > va41 addv va41 rand 5 15 endi * GENETIC Petal Green - Mutation doif va42 > 255 setv va42 255 elif va42 < 0 setv va42 0 endi setv va52 rand 100 255 doif va52 < va42 subv va42 rand 5 15 elif va52 > va42 addv va42 rand 5 15 endi * GENETIC Petal Blue - Mutation doif va43 > 255 setv va43 255 elif va43 < 0 setv va43 0 endi setv va53 rand 100 255 doif va53 < va43 subv va43 rand 5 15 elif va53 > va43 addv va43 rand 5 15 endi * GENETIC Petal Rotation - Mutation doif va44 > 255 setv va44 255 elif va44 < 0 setv va44 0 endi setv va54 rand 0 255 doif va54 < va44 subv va44 rand 5 15 elif va54 > va44 addv va44 rand 5 15 endi * GENETIC Petal Swap - Mutation doif va45 > 255 setv va45 255 elif va45 < 0 setv va45 0 endi setv va55 rand 0 255 doif va55 < va45 subv va45 rand 5 15 elif va55 > va45 addv va45 rand 5 15 endi * GENETIC Fruit Red - Mutation doif va46 > 255 setv va46 255 elif va46 < 0 setv va46 0 endi setv va56 rand 100 255 doif va56 < va46 subv va46 rand 5 15 elif va56 > va46 addv va46 rand 5 15 endi * GENETIC Fruit Green - Mutation doif va47 > 255 setv va47 255 elif va47 < 0 setv va47 0 endi setv va57 rand 100 255 doif va57 < va47 subv va47 rand 5 15 elif va57 > va47 addv va47 rand 5 15 endi * GENETIC Fruit Blue - Mutation doif va48 > 255 setv va48 255 elif va48 < 0 setv va48 0 endi setv va58 rand 100 255 doif va58 < va48 subv va48 rand 5 15 elif va58 > va48 addv va48 rand 5 15 endi * GENETIC Fruit Rotation - Mutation doif va49 > 255 setv va49 255 elif va49 < 0 setv va49 0 endi setv va59 rand 0 255 doif va59 < va49 subv va49 rand 5 15 elif va59 > va49 addv va49 rand 5 15 endi * GENETIC Fruit Swap - Mutation doif va50 > 255 setv va50 255 elif va50 < 0 setv va50 0 endi setv va60 rand 0 255 doif va60 < va50 subv va50 rand 5 15 elif va60 > va50 addv va50 rand 5 15 endi ** Save the Map Position setv va00 posl setv va01 post ** Create a new Bramboo Cane! inst ** Initial Bramboo new: comp 2 4 13 "bramboo" 0 0 304 attr 192 accg 5 perm 64 aero 1 fric 100 elas 10 ** +----------------+ ** | Genetic Stuff | ** +----------------+ ** Save GENETIC HEIGHT as ov08 setv ov08 va40 ** Save GENETIC HEIGHT as ov40 (ov40 is the GENETIC HEIGHT ov) setv ov40 ov08 ** Store the GENETIC Colourings setv ov41 va41 setv ov42 va42 setv ov43 va43 setv ov44 va44 setv ov45 va45 setv ov46 va46 setv ov47 va47 setv ov48 va48 setv ov49 va49 setv ov50 va50 ** name "sections" counts how many sections have been made setv name "sections" 0 ** ov70 stores the Y co-ordinate for new sections (don't think this is used, but could be handy later) setv ov70 0 doif tmvt va00 va01 = 1 mvto va00 va01 else mvsf va00 va01 endi setv ov90 1 tick 50 kill ownr endi endi endm