

#############
# PRE-CONFIGURATION
# This config file is meant to be loaded into another config before that
# config is useful; it defines the monsters that may be popped into those
# worlds, defines and loads fonts, and other things the level designers
# don't really want to care about
#

# associate images to symbolic name
image-list start
bluebrick   blbrick.pcx	# basic 16x16 blue floor tile
brownbrick  brbrick.pcx
skeefont    fontaa.pcx
shot1	    shot1.pcx
exit	    exit2x.pcx
person	    perso.pcx
personr	    perso.pcx flipx
decor3	    decor3.pcx
decor3yi    decor3.pcx flipy
enemy1	    enemy1.pcx
bomb1	    bomb1.pcx
ex-rr-1	    ex-rr-1.pcx
ex-ll-1	    ex-rr-1.pcx flipx
ex-uu-1	    ex-rr-1.pcx rotate270
ex-dd-1	    ex-rr-1.pcx rotate180
image-list end

audio-list start
explode	   explode.wav
ugh	   ugh.wav
kickass	   kickass.wav
laser	   laser.wav
audio-list end

font		fpsfont
offset_x	1
offset_y	1
char_offset_x	10
kern_offset_x   9
kern_offset_y   11
image		skeefont
charmap		"! #$%&'[]*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz(|)~"
font		end


sprite		arrow	    # don't need 4/8 arrows.. use states!
name		bomb
option		airborne
option		indestructable
option		impassable
ai		mob_bomb	    # the AI to use
speed		3
width		16
height		16
image_width	16
image_height	16
order		1	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	3 bounce	    # 7 artworks in pcx file
anim_image	bomb1       # use this image for animating this state
anim_offset_x	16
sprite		end


sprite		bullet
name		bullet
option		airborne
option		impassable
ai		mob_arrow	    # the AI to use
speed		10
width		8
height		8
image_width	8
image_height	8
order		2	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	shot1       # use this image for animating this state
sprite		end


sprite		ex-c	    # don't need 4/8 arrows.. use states!
name		explosion
option		airborne
option		indestructable
ai		mob_explosion_cross	    # the AI to use
width		16
height		16
image_width	16
image_height	16
order		2	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-rr-1       # use this image for animating this state
sprite		end



sprite		ex-r1-1	    # don't need 4/8 arrows.. use states!
name		explosion
option		airborne
option		indestructable
ai		mob_killtile	    # the AI to use
width		16
height		16
image_width	16
image_height	16
order		2	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-rr-1       # use this image for animating this state
anim_shift_x	16
sprite		end

sprite		ex-r2-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-rr-1       # use this image for animating this state
anim_shift_x	32
sprite		end

sprite		ex-l1-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-ll-1       # use this image for animating this state
anim_shift_x	16
sprite		end

sprite		ex-l2-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-ll-1       # use this image for animating this state
anim_shift_x	0
sprite		end

sprite		ex-u1-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-uu-1       # use this image for animating this state
anim_shift_y	16
sprite		end

sprite		ex-u2-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	ex-uu-1       # use this image for animating this state
anim_shift_y	0
sprite		end

sprite		ex-d1-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	decor3yi       # use this image for animating this state
anim_shift_y	0
anim_shift_x	144
sprite		end

sprite		ex-d2-1 ex-r1-1
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	decor3yi       # use this image for animating this state
anim_shift_y	0
anim_shift_x	160
sprite		end



sprite		newbomb	    # don't need 4/8 arrows.. use states!
name		extrabomb
option		impassable
option		indestructable
option		carryable
ai		nil	    # the AI to use
width		16
height		16
image_width	16
image_height	16
order		1	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	decor3       # use this image for animating this state
anim_shift_x	192
sprite		end



sprite		morefire	    # don't need 4/8 arrows.. use states!
name		morefire
option		impassable
option		indestructable
option		carryable
ai		nil	    # the AI to use
width		16
height		16
image_width	16
image_height	16
order		1	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	decor3       # use this image for animating this state
anim_shift_x	208
sprite		end



sprite		gofaster	morefire
name		gofaster
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	decor3       # use this image for animating this state
anim_shift_x	224
sprite		end



sprite		gogun	morefire
name		gogun
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	decor3       # use this image for animating this state
anim_shift_x	240
sprite		end



sprite		player
name		player
ai		player
speed		2	    # player moves twice as often as everything else!
option		impassable
#option		velocity
#option		angles
# render order (1 is first, 3 is last)
order		3
leaving		60
# location of body within sprite
width		16
height		12
offset_y	9
# artwork for sprite
image_width	16
image_height	24
# while standing still
anim_statedef	still
anim_steps	1
anim_offset_x	16
anim_image	person
#
anim_statedef	down
anim_steps	3 bounce
anim_offset_x	16
anim_image	person
#
anim_statedef	up
anim_steps	3 bounce
anim_shift_x	48
anim_offset_x	16
anim_image	person
#
anim_statedef	right
anim_steps	3 bounce
anim_shift_x	96
anim_offset_x	16
anim_image	person
#
anim_statedef	left
anim_steps	3 bounce
anim_shift_x	112
anim_offset_x	16
anim_image	personr
#
anim_statedef	dead
anim_steps	5 once
anim_shift_x	48
anim_offset_x	16
anim_delay	10
anim_image	decor3  # use this image for animating this state
#
sprite		end


sprite		rockopen
name		rockopen
order		2	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		0
option		impassable
# AI details
ai		nil    # the AI to use
ainear		nil  # the AI to use when player is "near"
near		5	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	16
image_height	16
width		16
height		16
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	64
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	decor3  # use this image for animating this state
#
sprite		end


sprite		bluebad
name		bluebad
order		3	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		3
option		impassable
# AI details
ai		mob_wander    # the AI to use
ainear		mob_robotron  # the AI to use when player is "near"
near		2	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	16
image_height	16
width		16
height		16
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	enemy1  # use this image for animating this state
#
anim_statedef	down	    # if engine needs a missing state, first state used
anim_steps	2	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	16	    # artwork is 25px offset from last step
anim_image	enemy1  # use this image for animating this state
#
anim_statedef	up	    # if engine needs a missing state, first state used
anim_steps	2	    # 7 artworks in pcx file
anim_shift_x	32
anim_offset_x	16	    # artwork is 25px offset from last step
anim_image	enemy1  # use this image for animating this state
#
anim_statedef	left	    # if engine needs a missing state, first state used
anim_steps	2	    # 7 artworks in pcx file
anim_shift_x	32
anim_offset_x	16	    # artwork is 25px offset from last step
anim_image	enemy1  # use this image for animating this state
#
anim_statedef	right	    # if engine needs a missing state, first state used
anim_steps	2	    # 7 artworks in pcx file
anim_shift_x	32
anim_offset_x	16	    # artwork is 25px offset from last step
anim_image	enemy1  # use this image for animating this state
#
sprite		end




sprite		bluebad*death
name		mobdeath
order		3	    # spr. order is 1..3 (start at 1, 3 is drawn last)
option		indestructable
ai		mob_animonce
image_width	16
image_height	16
width		16
height		16
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	5 once	    # 7 artworks in pcx file
anim_shift_x	48
anim_offset_x	16
anim_delay	10
anim_image	decor3  # use this image for animating this state
sprite		end




sprite		ex-center
name		explode
order		1	    # spr. order is 1..3 (start at 1, 3 is drawn last)
option		impassable
ai		nil
image_width	16
image_height	16
width		16
height		16
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_shift_y	16
anim_image	decor3  # use this image for animating this state
sprite		end





#############
# CONFIG
# This configuration defines a level or group of related levels; it depends
# on the preconfig config file being loaded; this config only populates the
# world with already defined objects.. those objects should be defined in the
# preconfig if they are generic. If they belong only in this level, perhaps
# they should be defined here..
#

# setup screen
score		player-score

# post intro messages
post-message    "BombZ Level"

# which floor are we starting on in this level?
startmap        Level1

# define the tiles for use on floors in this config
#
tile	   	.
name		floor
image		bluebrick
tile		end

tile	   	,
name		floor2
image		decor3
offset_x	176
tile		end

tile	   	@
name		floorstart
image		bluebrick
option		starthere
tile		end

tile		W
name		rockwall
image		decor3
option		impassable
tile		end

tile		=
name		ice
image		bluebrick
option		slippery
tile		end

# make up a floor based on all those tiles
#

tilemap		Level1
width		20
height		15
row		WWWWWWWWWWWWWWWWWWWW
row		W,,,WW,,W,,W,,,,,,,W
row		W,W,,,,WW,,,,W,,WWWW
row		W,WWWW,WWWW,,W,,,,,W
row		W,W,,,,,,,,,,,,,WWWW
row		W,,,,WWWW,,WWW,,W,,W
row		W,WW,,,W,,,,,,,,W,,W
row		W,W@.WW,,,W,,W,,,,,W
row		W,,..W,,WWW,,,,,W,,W
row		W,,..W,,WWW,,,,,W,,W
row		W,,..W,,WWW,,,,,W,,W
row		W,,..W,,WWW,,,,,W,,W
row		W,,..W,,WWW,,,,,W,,W
row		W,,..W,,WWW,,,,,W,,W
row		WWWWWWWWWWWWWWWWWWWW
tilemap		end

sprite-list     Level1
rockopen	        3,2
rockopen	        2,3
rockopen	        2,4
rockopen	        2,7
rockopen	        2,8
rockopen	        13,4
rockopen	        13,6
rockopen	        13,6
rockopen	        13,9
rockopen	        13,8
rockopen	        4,2
rockopen	        11,4
rockopen	        5,7
rockopen	        10,9
bluebad			6,5
bluebad			2,2
bluebad			8,9
newbomb			2,7
morefire		13,5
gofaster		3,13
gogun			3,12
sprite-list	end

tilemap		Level2
width		20
height		20
option		dark
row		WWWWWWWWWWWWWWWWWWWW
row		W,,,,,,,,,,,,,,,,,,W
row		W,,,,,,,,,,,,,,,,,,W
row		W,,,,,,,,,,,,,,,,,,W
row		W,,W,,,,,,,,,,W,,,,W
row		W,,,W,,,,,,,,W,,,,,W
row		W,,,,W,,,,,,W,,,,,,W
row		W,,,,,W,,,,W,,,,,,,W
row		W,,,,,,W,,W,,,,,,,,W
row		W,,,,,,,,,,,,,,,,,,W
row		W,,,,,,W,,W,,,,,,,,W
row		W,,,,,W,,,,W,,,,,,,W
row		W,,,,W,,,,,,W,,,,,,W
row		W,,,W,,,,,,,,W,,,,,W
row		W,,W,,,,,,,,,,W,,,,W
row		W,,,,,,,,,,,,,,,,,,W
row		W,,,,,,,,,,,,,,,,,,W
row		W,W@.WW,,,W,,W,,,,,W
row		W,,..W,,WWW,,W,,,,,W
row		WWWWWWWWWWWWWWWWWWWW
tilemap		end

sprite-list     Level2
rockopen	        3,2
rockopen	        2,3
rockopen	        2,7
rockopen	        13,6
rockopen	        13,6
rockopen	        13,8
rockopen	        4,2
rockopen	        11,4
rockopen	        5,7
rockopen	        10,9
bluebad			6,5
bluebad			2,2
bluebad			15,9
bluebad			14,14
bluebad			6,16
newbomb			5,7
morefire		13,12
sprite-list	end

tilemap		Level3
width		40
height		20
row		WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row		W===============,======,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W================@=====,,,,,,,,,,,,,,,,W
row		W=========,============,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W======================,,,,,,,,,,,,,,,,W
row		W,========,,===========,,,,,,,,,,,,,,,,W
row		WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
tilemap		end

sprite-list     Level3
bluebad			30,5
bluebad			15,7
bluebad			5,2
bluebad			35,8
sprite-list	end

# initialize
trigger	        *
on-variable-equals _ticks_since_begin 10
action		   variable-set	   _max_bombs_alive 1
trigger		end

# mob kill player
trigger		*
when-collide	bluebad player
action		kill _into
trigger		end

trigger		*
when-dies	player
action		variable-set	   _max_bombs_alive 1
action		variable-set	   _max_bomb_radius 2
action		variable-set	   _player_speed 2
action		post-message	   "You've been caught!" 3
action		post-message	   "Powerups are lost." 3
action		play-sound	kickass
trigger		end

trigger		*
when-dies	arrow
action		play-sound	explode
trigger		end

# mob deaths
trigger		*
when-dies	bluebad
action		variable-add player-score 10
action		play-sound	kickass
trigger		end

trigger		*
when-collide	bullet bluebad
action		kill _into
trigger		end

trigger		*
when-collide	bullet rockopen
action		kill _into
trigger		end

# new bomb
trigger		*
on-pickup-sprite	newbomb
action			post-message	"You find another bomb!" 3
action			variable-set	_max_bombs_alive 2
action			play-sound	laser
trigger		end

# more fire
trigger		*
on-pickup-sprite	morefire
action			post-message	"Your bombs are bigger!" 3
action			variable-set	_max_bomb_radius 3
action			play-sound	laser
trigger		end

# speed
trigger		*
on-pickup-sprite	gofaster
action			post-message	"You're full of caffeine!" 3
action			variable-set	_player_speed 3
action			play-sound	laser
trigger		end

# gun
trigger		*
on-pickup-sprite	gogun
action			post-message	"You're a badass!" 3
action			change-weapon	bullet
action			play-sound	laser
trigger		end

# finish levels
trigger		*
on-floor	Level1
on-no-sprite	Level1 bluebad
action		goto-floor Level2
action		post-message	"Watch out!" 3
trigger		end

trigger		*
on-floor	Level2
on-no-sprite	Level2 bluebad
action		goto-floor Level3
action		post-message	"Slippery!" 3
trigger		end
