~ubuntu-branches/ubuntu/intrepid/crossfire-maps-small/intrepid

« back to all changes in this revision

Viewing changes to world/connect.pl

  • Committer: Bazaar Package Importer
  • Author(s): Kari Pahula
  • Date: 2005-10-08 08:32:13 UTC
  • Revision ID: james.westby@ubuntu.com-20051008083213-3bd8kcyrk6e8zanf
Tags: upstream-1.5.0
ImportĀ upstreamĀ versionĀ 1.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl
 
2
 
 
3
# This script will write (to stdout) all the needed exits to connect maps
 
4
# in a tiled fashion.  The variables at the start will need to be set
 
5
# for things to work.
 
6
 
 
7
# Set these as appropriate to the maps it should connect to.  If one is left
 
8
# blank, then exits for that direction will not be created.
 
9
$NORTH="world_c3";
 
10
$NORTHWEST="world_b2";
 
11
$WEST="world_b3";
 
12
$SOUTHWEST="";
 
13
$SOUTH="";
 
14
$SOUTHEAST="";
 
15
$EAST="";
 
16
$NORTHEAST="";
 
17
 
 
18
$WIDTH=42;
 
19
$HEIGHT=34;
 
20
# DELTA What the overlap is - it should always be 5 for smooth transitions
 
21
$DELTA=5;
 
22
 
 
23
 
 
24
# End of configurable options.
 
25
# Quick reminder - hp is the destination x, sp is the destination y
 
26
 
 
27
# Lets do the corners first
 
28
if ($NORTHWEST ne "") {
 
29
        print "arch exit\n";
 
30
        print "slaying $NORTHWEST\n";
 
31
        print "x $DELTA\n";
 
32
        print "y $DELTA\n";
 
33
        print "hp ".($WIDTH-$DELTA-1)."\n";
 
34
        print "sp ".($HEIGHT-$DELTA-1)."\n";
 
35
        print "end\n";
 
36
}
 
37
if ($SOUTHWEST ne "") {
 
38
        print "arch exit\n";
 
39
        print "slaying $SOUTHWEST\n";
 
40
        print "x $DELTA\n";
 
41
        print "y ".($HEIGHT-$DELTA)."\n";
 
42
        print "hp ".($WIDTH-$DELTA-1)."\n";
 
43
        print "sp ".($DELTA+1)."\n";
 
44
        print "end\n";
 
45
}
 
46
if ($SOUTHEAST ne "") {
 
47
        print "arch exit\n";
 
48
        print "slaying $SOUTHEAST\n";
 
49
        print "x ".($WIDTH-$DELTA)."\n";
 
50
        print "y ".($HEIGHT-$DELTA)."\n";
 
51
        print "hp ".($DELTA+1)."\n";
 
52
        print "sp ".($DELTA+1)."\n";
 
53
        print "end\n";
 
54
}
 
55
if ($NORTHEAST ne "") {
 
56
        print "arch exit\n";
 
57
        print "slaying $NORTHEAST\n";
 
58
        print "x ".($WIDTH-$DELTA)."\n";
 
59
        print "y ".$DELTA."\n";
 
60
        print "hp ".($DELTA+1)."\n";
 
61
        print "sp ".($HEIGHT-$DELTA-1)."\n";
 
62
        print "end\n";
 
63
}
 
64
 
 
65
# Now lets do the edges.
 
66
        
 
67
if ($NORTH ne "") {
 
68
        $x=$DELTA+1;
 
69
        while ($x < ($WIDTH-$DELTA-1)) {
 
70
                print "arch exit\n";
 
71
                print "slaying $NORTH\n";
 
72
                print "x ".$x."\n";
 
73
                print "y ".$DELTA."\n";
 
74
                print "hp ".$x."\n";
 
75
                print "sp ".($HEIGHT-$DELTA-1)."\n";
 
76
                print "end\n";
 
77
                $x=$x+1;
 
78
        }
 
79
}
 
80
 
 
81
if ($SOUTH ne "") {
 
82
        $x=$DELTA+1;
 
83
        while ($x < ($WIDTH-$DELTA-1)) {
 
84
                print "arch exit\n";
 
85
                print "slaying $SOUTH\n";
 
86
                print "x ".$x."\n";
 
87
                print "y ".($HEIGHT-$DELTA)."\n";
 
88
                print "hp ".$x."\n";
 
89
                print "sp ".($DELTA+1)."\n";
 
90
                print "end\n";
 
91
                $x=$x+1;
 
92
        }
 
93
}
 
94
 
 
95
 
 
96
if ($WEST ne "") {
 
97
        $y=$DELTA+1;
 
98
        while ($y < ($HEIGHT-$DELTA-1)) {
 
99
                print "arch exit\n";
 
100
                print "slaying $WEST\n";
 
101
                print "x ".$DELTA."\n";
 
102
                print "y ".$y."\n";
 
103
                print "hp ".($WIDTH-$DELTA-1)."\n";
 
104
                print "sp ".$y."\n";
 
105
                print "end\n";
 
106
                $y=$y+1;
 
107
        }
 
108
}
 
109
 
 
110
 
 
111
if ($EAST ne "") {
 
112
        $y=$DELTA+1;
 
113
        while ($y < ($HEIGHT-$DELTA-1)) {
 
114
                print "arch exit\n";
 
115
                print "slaying $EAST\n";
 
116
                print "x ".($WIDHT-$DELTA)."\n";
 
117
                print "y ".$y."\n";
 
118
                print "hp ".($DELTA_1)."\n";
 
119
                print "sp ".$y."\n";
 
120
                print "end\n";
 
121
                $y=$y+1;
 
122
        }
 
123
}
 
124