print("hume/boss.nut loaded\n");

function rm_ready()
{
rampouch1.goto_node(1);
play_sound("sounds/dartfire.wav");
wait(0.05);
rampouch2.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch3.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch4.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch5.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch6.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch7.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch8.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch9.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch10.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch11.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch12.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch13.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch14.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch15.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch16.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch17.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch18.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch19.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch20.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch21.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch22.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
rampouch23.goto_node(1);
wait(0.05);
play_sound("sounds/dartfire.wav");
}

function rm_fall()
{
rm_ready();
wait(1);
rampouch1.goto_node(0);
play_sound("sounds/fall.wav");
wait(0.5);
play_sound("sounds/fall.wav");
rampouch2.goto_node(0);
wait(0.5);
play_sound("sounds/fall.wav");
rampouch3.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch4.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch5.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch6.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch7.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch8.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch9.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch10.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch11.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch12.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch13.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch14.goto_node(0);
play_sound("sounds/explosion.wav");
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch15.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch16.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch17.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch18.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch19.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch20.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch21.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch22.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/fall.wav");
rampouch23.goto_node(0);
wait(0.5);
play_sound("sounds/explosion.wav");
wait(0.5);
play_sound("sounds/explosion.wav");
wait(0.5);
play_sound("sounds/explosion.wav");
}

function rm_bigfall()
{
rm_ready();
wait(1)
rampouch1.goto_node(0);
rampouch2.goto_node(0);
rampouch3.goto_node(0);
rampouch4.goto_node(0);
rampouch5.goto_node(0);
rampouch6.goto_node(0);
rampouch7.goto_node(0);
rampouch8.goto_node(0);
rampouch9.goto_node(0);
rampouch10.goto_node(0);
rampouch14.goto_node(0);
rampouch15.goto_node(0);
rampouch16.goto_node(0);
rampouch17.goto_node(0);
rampouch18.goto_node(0);
rampouch19.goto_node(0);
rampouch20.goto_node(0);
rampouch21.goto_node(0);
rampouch22.goto_node(0);
rampouch23.goto_node(0);
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
wait(0.5)
rampouch11.goto_node(0);
rampouch12.goto_node(0);
rampouch13.goto_node(0);
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
play_sound("sounds/fall.wav");
wait(1)
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
wait(0.5);
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
play_sound("sounds/explosion.wav");
}

function lu()
{
spikes_lu.goto_node(1);
spikes_lu.goto_node(0);
}

function ru()
{
spikes_ru.goto_node(1);
spikes_ru.goto_node(0);
}

function ld()
{
spikes_ld.goto_node(1);
spikes_ld.goto_node(0);
}

function rd()
{
spikes_rd.goto_node(1);
spikes_rd.goto_node(0);
}

function la()
{
lu();
ld();
}

function ra()
{
ru();
rd();
}

function au()
{
lu();
ru();
}

function ad()
{
rd();
ld();
}

function dark()
{
Tux.deactivate();
wait(0.5);
play_sound("sounds/thunder.wav");
settings.set_ambient_light(settings.get_ambient_red()-0.2,settings.get_ambient_green()-0.4,settings.get_ambient_blue()-0.34);
wait(0.5);
Tux.activate();
}

function boswer()
{
while(settings.get_ambient_green()>0){
 rm_fall()
 la()
 wait(5)
 ra()
 wait(5.5)
 rm_bigfall()
 ad()
 wait(2)
 au()
 wait(8)
 rm_fall()
 rm_bigfall()
 rm_bigfall()
 rm_fall()
 lu()
 ad()
 wait(10)
 dark()}
import("levels/hume/defualt.nut")
sector.Tux.trigger_sequence("fireworks");
unlock_archivement("f");
}
