#CHAR_OVER "player";

#ACTION

var func = nop;
func = if( avar("made_templates"), nop, char_make );
func( "johns/pusher",       -150, -150, "pusher_template",  1 );
func( "johns/shooter",      -160, -150, "shooter_template", 1 );
func( "johns/roller",       -170, -150, "roller_template",  1 );
func( "johns/simple",       -180, -150, "simple_template",  1 );
func( "johns/simple_dumb",  -190, -150, "simpled_template", 1 );
avar( "made_templates", 1 );

avar( "monster_spawn_count", 0 );
time_set( 1 );
var str = "
  var use_x = 0;
  var x = 0;
  var y = 0;
  use_x = less( rand(0,1), 0.5 );
  x = if( use_x, rand(5,95), if( less(rand(0,1),0.5),5,95 ) );
  y = if( use_x, if( less(rand(0,1),0.5),5,95 ), rand(5,95) );
  var monster_vec = { \"pusher_template\", \"roller_template\", \"simple_template\", \"simpled_template\" };
  char_clone( monster_vec[sqrt(rand(0,15.99))], x, y );
  avar( \"monster_spawn_count\", add(avar(\"monster_spawn_count\"),1) );
  timer_set( \"monster_spawn_tmr\", div( 50, add(20.0,sqrt(avar(\"monster_spawn_count\"))) ) );
";
timer_make( "monster_spawn_tmr", 0.5, str );
