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
|
#!/usr/bin/perl
# This script will write (to stdout) all the needed exits to connect maps
# in a tiled fashion. The variables at the start will need to be set
# for things to work.
# Set these as appropriate to the maps it should connect to. If one is left
# blank, then exits for that direction will not be created.
$NORTH="world_c3";
$NORTHWEST="world_b2";
$WEST="world_b3";
$SOUTHWEST="";
$SOUTH="";
$SOUTHEAST="";
$EAST="";
$NORTHEAST="";
$WIDTH=42;
$HEIGHT=34;
# DELTA What the overlap is - it should always be 5 for smooth transitions
$DELTA=5;
# End of configurable options.
# Quick reminder - hp is the destination x, sp is the destination y
# Lets do the corners first
if ($NORTHWEST ne "") {
print "arch exit\n";
print "slaying $NORTHWEST\n";
print "x $DELTA\n";
print "y $DELTA\n";
print "hp ".($WIDTH-$DELTA-1)."\n";
print "sp ".($HEIGHT-$DELTA-1)."\n";
print "end\n";
}
if ($SOUTHWEST ne "") {
print "arch exit\n";
print "slaying $SOUTHWEST\n";
print "x $DELTA\n";
print "y ".($HEIGHT-$DELTA)."\n";
print "hp ".($WIDTH-$DELTA-1)."\n";
print "sp ".($DELTA+1)."\n";
print "end\n";
}
if ($SOUTHEAST ne "") {
print "arch exit\n";
print "slaying $SOUTHEAST\n";
print "x ".($WIDTH-$DELTA)."\n";
print "y ".($HEIGHT-$DELTA)."\n";
print "hp ".($DELTA+1)."\n";
print "sp ".($DELTA+1)."\n";
print "end\n";
}
if ($NORTHEAST ne "") {
print "arch exit\n";
print "slaying $NORTHEAST\n";
print "x ".($WIDTH-$DELTA)."\n";
print "y ".$DELTA."\n";
print "hp ".($DELTA+1)."\n";
print "sp ".($HEIGHT-$DELTA-1)."\n";
print "end\n";
}
# Now lets do the edges.
if ($NORTH ne "") {
$x=$DELTA+1;
while ($x < ($WIDTH-$DELTA-1)) {
print "arch exit\n";
print "slaying $NORTH\n";
print "x ".$x."\n";
print "y ".$DELTA."\n";
print "hp ".$x."\n";
print "sp ".($HEIGHT-$DELTA-1)."\n";
print "end\n";
$x=$x+1;
}
}
if ($SOUTH ne "") {
$x=$DELTA+1;
while ($x < ($WIDTH-$DELTA-1)) {
print "arch exit\n";
print "slaying $SOUTH\n";
print "x ".$x."\n";
print "y ".($HEIGHT-$DELTA)."\n";
print "hp ".$x."\n";
print "sp ".($DELTA+1)."\n";
print "end\n";
$x=$x+1;
}
}
if ($WEST ne "") {
$y=$DELTA+1;
while ($y < ($HEIGHT-$DELTA-1)) {
print "arch exit\n";
print "slaying $WEST\n";
print "x ".$DELTA."\n";
print "y ".$y."\n";
print "hp ".($WIDTH-$DELTA-1)."\n";
print "sp ".$y."\n";
print "end\n";
$y=$y+1;
}
}
if ($EAST ne "") {
$y=$DELTA+1;
while ($y < ($HEIGHT-$DELTA-1)) {
print "arch exit\n";
print "slaying $EAST\n";
print "x ".($WIDHT-$DELTA)."\n";
print "y ".$y."\n";
print "hp ".($DELTA_1)."\n";
print "sp ".$y."\n";
print "end\n";
$y=$y+1;
}
}
|