#GENERAL
*name       = "kidney_slow";

*faction       = "kidney";
*enemy_faction = "good";

*rad        = .85;
*mass       = 12.0;
*elasticity = 1.0;
*drag       = 0.5;
*friction   = 5.5;
*hardness   = 0.3;
*roll       = 1.0;

*model      = "npc_evilkidney_01";
*model_col  = avar("kidney_slow_color");
*model_scale = 1.0;
*bleed_rate = 3.0;
*leak_decal_vec = {"decals/big_blood_01.tga"};
*dam_part_vec = {"blood_01"};

#ATTRIBUTE "ccrange";
#BASE      1.2;
#ATTRIBUTE "ccspeed";
#BASE      mult(add(mult(avar("kidney_slow_level"), 0.005), 1), avar("ccspeed_level"));
#ATTRIBUTE "ccdamage";
#BASE      mult(add(mult(avar("kidney_slow_level"), 0.01), 2), avar("ccdamage_level")); 
#ATTRIBUTE "attract";
#BASE      20.0;
#ATTRIBUTE "leak";
#BASE      0.0;
#ATTRIBUTE "speed";
#BASE      mult(add(20, mult(div(1, sqrt(avar("kidney_slow_level"))), avar("kidney_slow_level"))), avar("speed_level"));
#ATTRIBUTE "health";
#BASE      mult(3.0, avar("kidney_slow_level"), avar("health_level"));
#ATTRIBUTE "res";
#BASE      1.0;
#ATTRIBUTE "rot_speed";
#BASE      100.0;
#ATTRIBUTE "exp";
#BASE      mult(avar("kidney_slow_level"), avar("exp_level"));
#ATTRIBUTE "level";
#BASE      avar("kidney_slow_level");

#ON_DAMAGE
  // Bleed a little.

  sound_play( add("monsters/spit_0", num_to_str(rand(1, 4.99)), ".wav"), this_x(), this_y(), 1 );

#ON_DEATH

  avar("total_kills", add(avar("total_kills"), 1));

#CONTROL "script";
##BEGIN

#SEQUENCE "init";
# var func = nop;
  func = if( leq(rand(0,5), 1), this_item_make, nop );
  var p = sqrt(sqrt(mult(rand(0, 16), div(1000, this_get_attribute("level")))));
  p = if(greater(p, 2), 2, p);
  var item_vec = {"banana_03", "banana_02", "banana_01"};
  func( item_vec[p], 1 );
  func = if( leq(rand(0,1), 1), this_item_make, nop );
  p = sqrt(sqrt(mult(rand(0, 1295), div(100, this_get_attribute("level")))));
  p = if(greater(p, 5), 5, p);
  item_vec = {"coin_06", "coin_05", "coin_04", "coin_03", "coin_02", "coin_01"};
  func( item_vec[p], 1 );
# this_control_jump( 
  "range faction",
  "*faction    = \"good\";
  *min_dist   = 0.0;
  *max_dist   = 0.1;
  *avoid_faction = \"kidney\";
  *avoid_dist = rand(2, 8);
  *predict_dist = 24;
  *predict_weight = .8;
  *aggressive = 1;
  *action     = \"\";
  ",
  1.0
  );
# seq_jump("wait");

#SEQUENCE "wait";
# wait( 10000 );

##END