File: ziehlen.ld

package info (click to toggle)
cuyo 2.0.0brl1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 15,624 kB
  • sloc: cpp: 11,728; ml: 5,515; sh: 1,179; makefile: 757; yacc: 558; awk: 355; lex: 244; perl: 193
file content (142 lines) | stat: -rw-r--r-- 3,573 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#
#   Copyright 2005,2006,2010 by Mark Weyer
#   Maintenance modifications 2006,2008,2011 by the cuyo developers
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

Ziehlen={
  name = "Target practice"
  author = "Mark Weyer"
  pics = gruen
  greypic = rot
  emptypic = nichts
  startpic = gras
  startdist[1] = "EEEEEEEEEE"
  toptime[1] = 30
  toptime[1,hard] = 15
  numexplode[1] = 100
  startdist[2] = ".........AB.........","EEEEEEEEEE"
  toptime[2] = 36
  toptime[2,hard] = 18
  numexplode[2] = 200
  randomfallpos = 1
  loch_y = 6
  loch_breite = 7                # loch-x-Angaben alle in halben Blops
  loch_breite[hard] = 5
  loch_x_min = <4-loch_breite>
  loch_x_max = 16

  <<
    var loch_x=(loch_x_max+loch_x_min)/2, verbinder, verloren;

    semiglobal = {
      if 1:4 -> switch {
        (loch_x-loch_x_min+2*(loch_x_max-loch_x_min))
            : 5*(loch_x_max-loch_x_min)
          -> loch_x-=1;
          -> loch_x+=1;
      };
      if loch_x<loch_x_min -> loch_x=loch_x_min;
      if loch_x>loch_x_max -> loch_x=loch_x_max;

      if (!(loc_x@@0*2 == loch_x..loch_x+loch_breite-2)
            || !(loc_x@@1*2 == loch_x..loch_x+loch_breite-2))
          && ((loc_y@@0==loch_y) || (loc_y@@1==loch_y)) -> {
        kind@@0 = rot;
        kind@@1 = rot;
      };
    };
  >>

  gruen = {
    pics = lZiehlen.xpm

    <<
      gruen.init = {
        if loc_y>=loch_y -> {  # Bin ich etwa erst unter dem Loch entstanden?
          kind=rot;
          kind@1=rot;     # Achtung! Historisch verbrgt:
                          # Die erste Verwendung relativer Adressierung
                          # bei fallenden Blops
          falling_speed@@ = 64;
          falling_fast_speed@@ = 64;
          verloren=1;
          weight=0;
        };
      };

      gruen = {
        if verbinder>0 -> {
          if verbinder==1 -> {
            B;
            weight=size@(-9,0;>)-weight@(-9,0;>)+2;
          };
          if verbinder==2 -> {
            C;
            weight=size@(9,0;<)-weight@(9,0;<)+2;
          };
        };
        *;
        if (!falling) && (loc_y<=loch_y) -> kind@(0,0)=rot;
      };
    >>

  }

  rot = {
    pics = lZiehlen.xpm

    <<
      rot = {
        D*;
        if !falling && !verloren -> kind@(0,0)=nothing;
      };
    >>

  }

  gras = {
    pics = lZiehlen.xpm

    <<
      gras.init = {
        if version==0 -> {kind=gruen; verbinder=1;};
        if version==1 -> {kind=gruen; verbinder=2;};
      };
    >>
  }

  nichts = {
    pics = lZiehlen.xpm

    <<
      nichts = {
        if loc_y==loch_y -> {
          loch_x = 2*loc_x-loch_x@@;;
          switch {
            ! (loch_x == -2..loch_breite) -> I*;
            loch_x == 0..loch_breite-2 -> ;
            loch_x==-2 -> G*;
            loch_x==-1 -> J*;
            loch_x==loch_breite-1 -> H*;
            loch_x==loch_breite -> F*;
          };
        };
      };
    >>
  }

}