1#
2#   Copyright <=2004,2014 by Immanuel Halupczok
3#   Modified 2005,2006 by Immanuel Halupczok
4#   Modified 2006 by Mark Weyer
5#   Maintenance modifications 2006,2011 by the cuyo developers
6#
7#   This program is free software; you can redistribute it and/or modify
8#   it under the terms of the GNU General Public License as published by
9#   the Free Software Foundation; either version 2 of the License, or
10#   (at your option) any later version.
11#
12#   This program is distributed in the hope that it will be useful,
13#   but WITHOUT ANY WARRANTY; without even the implied warranty of
14#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15#   GNU General Public License for more details.
16#
17#   You should have received a copy of the GNU General Public License
18#   along with this program; if not, write to the Free Software
19#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20#
21# The above notices apply to this file and to:
22#   i3Dreieck.xpm.gz, i3Grau.xpm.gz, i3Plus.xpm.gz, i3Stern.xpm.gz
23#   i3Gitter.xpm.gz, i3Kreis.xpm.gz, i3Quadrat.xpm.gz,
24#   i3Bunt.xcf, i3Grau.xcf
25#
26
27DreiD={
28  name="3D"
29  author="Immi"
30  description="Well, just a little bit 3D."
31  neighbours=<neighbours_3D>
32  greypic=Box
33  startpic=Gitter
34  pics=Quadrat,Dreieck,Kreis,Stern,Plus
35  numexplode=7
36  numexplode[easy]=5
37  startdist[1]="AA......AA",
38               "AA......AA",
39               "AA......AA",
40               "AA......AA",
41               "AA......AA",
42               "AAAAAAAAAA"
43  startdist="AA......AA",
44            "AA......AA",
45            "AA......AA",
46            "AA......AA",
47            "AAAAAAAAAA"
48  bgcolor=30,30,30
49  textcolor=50,50,50
50  #chaingrass=1
51  #chaingrass[easy]=0
52  randomgreys[1]=40
53  randomgreys[2]=120
54
55  <<
56
57
58
59  var basis, oo, uu, ll, rr, hi;
60
61  var fall_richtung; # Wie rum ist das Fall (relativ zu mir):
62    # 0 = ich bin links, 1 = ich bin oben; etc.
63
64  Objekt_init = { if loc_x == 4 -> fall_richtung = 0 else fall_richtung = 2; };
65
66  Objekt_turn = { fall_richtung = (fall_richtung + 1) % 4; };
67
68  Objekt={
69    hi = loc_x % 2;
70    if falling -> { # Fallend
71      if turn == 0 && !hi && fall_richtung == 0 -> {
72        V*; W*@(1);
73      } else if hi && turn==0 && fall_richtung == 2 -> {
74        Z*; Y@(1)*;
75      } else if hi -> a* else -> U*;
76      #out1 = fall_richtung;
77    } else {
78      if hi -> basis = 5 else basis = 1;
79      oo = kind@(0,-1) == kind;
80      uu = kind@(0,1) == kind;
81      ll = kind@(-2,0) == kind;
82      rr = kind@(2,0) == kind;
83
84      pos=basis+2*ll    +9*oo    ; [qu=Q_TL] *;
85      pos-=1;                      [qu=Q_TR_BR] if hi -> @(-1,-.5)* else *@(-1,-.5);
86      pos=basis+2*(1-rr)+9*oo    ; [qu=Q_TR] *;
87      pos+=1;                      [qu=Q_TL_BL] if hi -> @(1,-.5)* else *@(1,-.5);
88      pos=basis+2*ll    +9*(1-uu); [qu=Q_BL] *;
89      pos-=1;                      [qu=Q_BR_TR] if hi -> @(-1,.5)* else *@(-1,.5);
90      pos=basis+2*(1-rr)+9*(1-uu); [qu=Q_BR] *;
91      pos+=1;                      [qu=Q_BL_TL] if hi -> @(1,.5)* else *@(1,.5);
92
93      if hi && kind@(-1,.5) == kind -> {
94        [qu=Q_BL] X*;
95        if kind == Gitter -> [qu=Q_BR_TR] W@(-1,.5)*;
96      };
97    }; # Nicht fallend
98
99  }; # Objekt
100
101  >>
102
103
104  Box={
105    pics=i3Grau.xpm
106    <<
107    Box={
108      if informational -> A*
109      else if loc_x % 2 -> {
110        [qu=Q_TR_BR] C@(-1,-.5)*;
111        [qu=Q_BR_TR] C@(-1,.5)*;
112        [qu=Q_TR_BR] H@(-1,.5)*;
113        D*;
114        I@(0,1)*;
115        [qu=Q_TL_BL] E@(1,-.5)*;
116        [qu=Q_BL_TL] E@(1,.5)*;
117        [qu=Q_TL_BL] J@(1,.5)*;
118      } else {
119        [qu=Q_TR_BR] F*@(-1,-.5);
120        [qu=Q_BR_TR] F*@(-1,.5);
121        B*@(0,-1);
122        G*;
123        [qu=Q_BL_TL] C*@(1,-.5);
124        [qu=Q_TL_BL] H*@(1,-.5);
125        [qu=Q_BL_TL] H*@(1,.5);
126      };
127    };
128    >>
129  }
130
131  Gitter={
132    pics=i3Gitter.xpm
133    << Gitter=Objekt; >>
134  }
135
136  Quadrat={
137    pics=i3Quadrat.xpm
138    << Quadrat=Objekt; Quadrat.init=Objekt_init; Quadrat.turn=Objekt_turn; >>
139  }
140
141  Kreis={
142    pics=i3Kreis.xpm
143    << Kreis=Objekt; Kreis.init=Objekt_init; Kreis.turn=Objekt_turn; >>
144  }
145
146  Dreieck={
147    pics=i3Dreieck.xpm
148    << Dreieck=Objekt; Dreieck.init=Objekt_init; Dreieck.turn=Objekt_turn; >>
149  }
150
151  Stern={
152    pics=i3Stern.xpm
153    << Stern=Objekt; Stern.init=Objekt_init; Stern.turn=Objekt_turn; >>
154  }
155
156  Plus={
157    pics=i3Plus.xpm
158    << Plus=Objekt; Plus.init=Objekt_init; Plus.turn=Objekt_turn; >>
159  }
160
161}
162