--- bzmap-map-olympic--main--2.0--patch-128/race_obstacles.py 2005-12-30 22:08:33.000000000 +0200 +++ olympic/race_obstacles.py 2005-12-30 23:19:40.701450424 +0200 @@ -2292,85 +2292,124 @@ self.union.add( b ) class NewYear( RaceObstacle ): - name = "NewYear2005" + name = "NewYear2006" allowRotation = False def __init__( self , context ) : RaceObstacle.__init__( self ) self.union = Union() - u = self.union - #text, only 20 (05 in reverse) + grid = 1. + + # Function to generate a 4x6 letter + def letter( data ): + l = Union() + margin = float(grid) / 10 # Beautiful spaces between blocks + for x in range( 4 ): + for y in range( 6 ): + p1 = Point( x * grid + margin, - ( y * grid + margin ), 0 ) + p2 = Point( x * grid + grid - margin, - ( y * grid + grid - margin) , -0.25 ) + + if data[y][x] : # Usually X comes first, but easier to make lists this way + b = MeshBox( p1, p2 ).withColor(Color(0,0,0)) # Black letters + l.add( b ) + return l + + # Letters + letter_two = [ + [0,1,1,0], + [1,0,0,1], + [0,0,0,1], + [0,0,1,0], + [0,1,0,0], + [1,1,1,1] ] + + letter_zero = [ + [0,1,1,0], + [1,0,0,1], + [1,0,0,1], + [1,0,0,1], + [1,0,0,1], + [0,1,1,0] ] + + letter_six = [ + [0,0,1,0], + [0,1,0,0], + [1,1,1,0], + [1,0,0,1], + [1,0,0,1], + [0,1,1,0] ] + + text = Union() + + p = Point( - grid * 2, grid * 7 * 5, 0 ) + text.add( letter(letter_two).translate( p ) ) + + p = Point( - grid * 2, grid * 7 * 4, 0 ) + text.add( letter(letter_zero).translate( p ) ) + + p = Point( - grid * 2, grid * 7 * 3, 0 ) + text.add( letter(letter_zero).translate( p ) ) + + p = Point( - grid * 2, grid * 7 * 2, 0 ) + text.add( letter(letter_six).translate( p ) ) + + width = grid * 6 + height = grid * 7 * 7 + color = Color(1,1,1) + + tower = Union() + + p1 = Point( - width / 2, 0, - width / 2 ) + p2 = Point( width / 2, height , width / 2 ) + b = MeshBox( p1, p2 ).withColor( color ) + b.addRaw("texture mesh") + tower.add( b ) + + p1 = Point( - width / 2, height, - width / 2 ) + p2 = Point( width / 2, height + width , width / 2 ) + b = MeshPyramid( p1, p2 ).withColor( color ) + b.addRaw("texture mesh") + tower.add( b ) + + tower.add( text.copy().translate( Point( z = - width / 2 + 0.1 ) ).rotate( 0 ) ) + tower.add( text.copy().translate( Point( z = - width / 2 + 0.1 ) ).rotate( 90 ) ) + tower.add( text.copy().translate( Point( z = - width / 2 + 0.1 ) ).rotate( 180 ) ) + tower.add( text.copy().translate( Point( z = - width / 2 + 0.1 ) ).rotate( 270 ) ) + + # Pyramids at bottom + p1 = Point( - width, 0, - width ) + p2 = Point( width, width, width ) + b = MeshPyramid( p1, p2 ).withColor( color ) + b.addRaw("texture mesh") + tower.add( b ) + b.rotate(90) + tower.add( b ) + + self.union.add( tower ) - height = 30 - width = 40 - depth = 1 - xspacing = width / 4 - yspacing = height / 4 - linewidth = 2 - - b = Box( Point( -linewidth , 0 , 0 ) , Point( width , height , depth ) ) - b = UnionBox( [ b ] ) - #2 - b = b - Box( Point( xspacing * 2 , yspacing * 1 , -depth ) , Point( xspacing * 3 + linewidth , yspacing * 1 + linewidth , depth ) ) - b = b - Box( Point( xspacing * 3 , yspacing * 1 , -depth ) , Point( xspacing * 3 + linewidth , yspacing * 2 , depth ) ) - b = b - Box( Point( xspacing * 2 , yspacing * 2 , -depth ) , Point( xspacing * 3 + linewidth , yspacing * 2 + linewidth , depth ) ) - b = b - Box( Point( xspacing * 2 , yspacing * 2 , -depth ) , Point( xspacing * 2 + linewidth , yspacing * 3 , depth ) ) - b = b - Box( Point( xspacing * 2 , yspacing * 3 , -depth ) , Point( xspacing * 3 + linewidth , yspacing * 3 + linewidth , depth ) ) - #0 - b = b - Box( Point( xspacing * 0 , yspacing * 3 , -depth ) , Point( xspacing * 1 + linewidth, yspacing * 3 + linewidth , depth ) ) - b = b - Box( Point( xspacing * 0 , yspacing * 1 , -depth ) , Point( xspacing * 1 + linewidth , yspacing * 1 + linewidth , depth ) ) - b = b - Box( Point( linewidth , yspacing * 1 , -depth ) , Point( linewidth * 2 , yspacing * 3 , depth ) ) - b = b - Box( Point( xspacing * 1 , yspacing * 1 , -depth ) , Point( xspacing * 1 + linewidth , yspacing * 3 , depth ) ) - - b = b + Box( Point( -width - 6 , 0 , width ) , Point( width , 3 , width + 6 ) ) - b = b + Box( Point( -width - 6 , height , width ) , Point( width , height - 3 , width + 6 ) ) - b = b + Box( Point( width , 0 , width ) , Point( width + 6 , height , width + 6 ) ) - - - u.add( b ) - u.add( b.rotate( 90 ) ) - u.add( b.rotate( 90 ) ) - u.add( b.rotate( 90 ) ) - - b = Box( Point( -width , height , -width ) , Point( width , height - 3 , width ) ) - u.add( b ) - - py = Pyramid( Point( -5 , 0 , -5 ) , Point( 5 , 10 , 5 ) ) - u.add( py ) - u.add( py.at( Point( -width , 0 , -width ) ) ) - u.add( py.at( Point( -width , 0 , width ) ) ) - u.add( py.at( Point( width , 0 , -width ) ) ) - u.add( py.at( Point( width , 0 , width ) ) ) - p = Point ( 15 , 1 , 10 ) - weapFreq = 2 - weapType = Flag.HighSpeed - weapType2 = Flag.RapidFire self.weaponWeight = 0 - self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 1 ).rotate( 33 ) ) + + radius = context.trackWidth + + p = Point( - radius, width / 4, 0 ) + + weapType = Flag.HighSpeed + weapFreq = 2 + self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 0.5 ).rotate( 0 ) ) self.weaponWeight += calcWeaponWeight( type = weapType , frequency = weapFreq ) - self.union.add( Weapon( p , type = weapType2 , frequencies = [ weapFreq ] , initialDelay = 0.5 ).rotate( 53 ) ) - self.weaponWeight += calcWeaponWeight( type = weapType2 , frequency = weapFreq ) - p = Point ( 15 , 1 , -20 ) - weapFreq = 3 - self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 2 ).rotate( 36 ) ) + + self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 0.5 ).rotate( 90 ) ) self.weaponWeight += calcWeaponWeight( type = weapType , frequency = weapFreq ) - self.union.add( Weapon( p , type = weapType2 , frequencies = [ weapFreq ] , initialDelay = 1.5 ).rotate( 51 ) ) - self.weaponWeight += calcWeaponWeight( type = weapType2 , frequency = weapFreq ) - p = Point ( -10 , 1 , 15 ) - weapFreq = 2 - self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 3 ).rotate( 27 ) ) + + self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 0.5 ).rotate( 180 ) ) self.weaponWeight += calcWeaponWeight( type = weapType , frequency = weapFreq ) - self.union.add( Weapon( p , type = weapType2 , frequencies = [ weapFreq ] , initialDelay = 2.5 ).rotate( 57 ) ) - self.weaponWeight += calcWeaponWeight( type = weapType2 , frequency = weapFreq ) - p = Point ( -15 , 1 , -10 ) - weapFreq = 3 - self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 2 ).rotate( 35 ) ) + + self.union.add( Weapon( p , type = weapType , frequencies = [ weapFreq ] , initialDelay = 0.5 ).rotate( 270 ) ) self.weaponWeight += calcWeaponWeight( type = weapType , frequency = weapFreq ) - self.union.add( Weapon( p , type = weapType2 , frequencies = [ weapFreq ] , initialDelay = 3.5 ).rotate( 53 ) ) - self.weaponWeight += calcWeaponWeight( type = weapType2 , frequency = weapFreq ) - - self.union.translate( Point( 0 , 5 , 0 ) ) + # Invisible box to ricochet the bullets - More dangerous :E + p1 = Point( - width, height + 5, - width ) + p2 = Point( width, height + 5.25, width ) + self.union.add( MeshBox( p1, p2 ).withColor( Color( 0, 0, 0, 0 ) ) ) -