/* Test script */

#include "specials.acs"
#include "defs.acs"
#include "wvars.acs"

        int secret; // available for all scripts.

script 1 (void) // this scripts handles nr. of ettins and release trap after
                // the last is killed.
{
        int c, d;     

        c = thingcount(T_ETTIN, 0);  // # of ettins with any TID (alive).

        switch (c)
        {
        case 0:                      // no more ettins:
              clearlinespecial( );   // clear trigger
              thing_activate(2);     // activates tid #2 (icegolems)
              print(s: "PREPARE TO DIE, MORTAL - HAHAHA"); 
              delay(const: 3*35);    // wait 3 seconds.
              door_open(8,16);       // door open, tag 8, speed 16.
              break;

        default:
              ambientsound("PickupItem", 127);  // sound
              print(s: "ETTINS LEFT TO KILL: ", d: c); 
              delay(const: 3*35);
              print(s: "RETURN FOR TREASURE AFTER LAST KILL");
        }
}

script 2 (void) // this script releases the the secret.
{
        int c;

        c = thingcount(T_ICEGOLEM, 0); // # of icegolems with any TID (alive).

        switch (c)
        {
        case 0:                        // all golems killed! no secret.
              break;
        default:
              secret = secret + 1;     // makes sure it can be found once only
              switch (secret)
                  {
                  case 1:
                        print(s: "YOU FOUND THE SECRET");
                        delay(const: 3*35);
                        floor_lowerbyvalue(7,6,40); // lower pillar, tag 7, speed 6, 40 units.
                        break;                      
                  default:
                        break;
                  }
        }
}

script 3 (void) // this script changes lighting by the door.
{
     light_changetovalue(6,196);  // changes light for tag 6 to value 196.
     thing_activate(4);           // activates the torches.   
}
