
include (disc)
include (simple_leaf)

ignore A G E I F + - / & ^ K Leaf;

mycelis_muralis(n)	=> attr (material, 'branches) attr (width, 3) attr (color, '0 1 0) attr (distance, 80) I(20) F A(0), n;
S < A(t)		=> TV attr (material, 'petals) K(0);
V < A(t)		=> TV attr (material, 'petals) K(0);
    A(0)		=> M[&(30) Leaf attr (width, width * 0.7) G]F/(137.5)A(2);
    A(t)		=> A(t-1);
S < M			=> S;
    S > T		=> T;
T < G			=> F&(15)A(2);
V < M			=> S;
    T > V		=> W;
    W			=> V;
    I(0)		=> S;
    I(t)		=> I(t-1);
    K(t)		=> K(t+1);
    Leaf		=> [&(30) attr (material, 'leaves) attr (color, '0.4 1 0) simple_leaf (18, 25)];

ruleset (
	include (simple_petal)
	
	K(n)	: n <= 3	=> [&(90) attr (color, '0.7 0.7 0) disc(n*4+8)];
	K(n)	: n <= 8	=> [ attr (color, '1 1 0) attr (distance, 8+n*8) petal (90-n*10, 5) ];
	K(n)	: n <= 8+5	=> [ attr (color, '0.9 0.7 0) attr (distance, 144-n*8) petal (10, 8+6-n) ];
	K(n)			=> [&(90) attr (color, '0.6 0.6 0) disc(16) ];
)
