Hi!

time in
gun_percent=(gun_percent+10*time)%100;


should be time_step // in Lite-C

Ottawa smile