<!--  -->


<LevelInfo
 name = "Presentation HS 2011"
 description = "New Features: Asteroid field/belt generator; Formationflight; HUD (Enemyhealthbar, displaying Names)"
 tags = "presentation"
/>

<?lua
  include("stats.oxo")
  include("HUDTemplates3.oxo")
  include("templates/lodInformation.oxt")
?>

<?lua
  include("templates/spaceshipAssff.oxt")
  include("templates/spaceshipPirate.oxt")
  include("templates/spaceshipSwallow.oxt")
  include("templates/spaceshipTransporter.oxt")
?>

<Level
 gametype = "Mission"
>                      <!--ALTERNATIVE: TeamGametype-->
  <templates>
    <Template link=lodtemplate_default />
  </templates>
  <?lua include("includes/notifications.oxi") ?>

  <NotificationQueueCEGUI
    name="narrative"
    targets="simpleNotification"
    size=3
    displayTime=3.9
    position="0.2, 0, 0.1, 0"
    fontSize="23"
    fontColor="0.3, 1, 0.2, 0.8"
    alignment="CentreAligned"
    displaySize="0.6, 0, 0, 0"
    />

  <Scene
    ambientlight = "0.8, 0.8, 0.8"
    skybox       = "Orxonox/skyBoxMoreNebula"
  >

  <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>

  <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipswallow/>

  <!-- TRIGGERS -->
    <DistanceTrigger name="FormationInit" position="800,700,600"  target="Pawn" distance=60 stayActive="true" delay=0.1 />
    <DistanceTrigger name="LetsGo"        position="200,-200,1000" target="Pawn" distance=180 stayActive="true" delay=0.1 />
      <BlinkingBillboard colour="1,1,0.05"position="200,-200,1000" frequency=0.6 amplitude=3 material="Flares/lensflare" >
      </BlinkingBillboard>




    <Script code="formationcontroller formationflight true" onLoad="false">
        <events>
            <trigger>
                <EventListener event=FormationInit />
            </trigger>
        </events>
    </Script> <!-- !!! activates formation behaviour !!! -->

    <Script code="artificialcontroller setbotlevel 0.1" onLoad="false">
        <events>
            <trigger>
                <EventListener event=FormationInit />
            </trigger>
        </events>
    </Script> <!-- make bots "friendly", doesn't work yet :-( -->

    <SimpleNotification message="Let's go!">
        <events>
            <trigger>
                <EventListener event="LetsGo" />
            </trigger>
        </events>
    </SimpleNotification>




<!-- ADDING FORMATION: 5 Swallows -->
<?lua for i=0,4,1 do
?>
    <SpaceShip position="<?lua print(400+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
        <!--events>
            <visibility>
                <EventListener event="ondock" />
            </visibility>
        </events-->
        <templates>
            <Template link=spaceshipswallow /> <!--spaceshipTransporter spaceshippirate-->
        </templates>
        <controller>
            <AIController team=0>
                <events>
                    <activity>
                        <EventListener event="LetsGo" />
                     </activity>
                </events>
            </AIController>
        </controller>
    </SpaceShip>
<?lua end ?>

<?lua for i=0,2,1 do
?>


<!-- ENEMY TRANSPORTER -->
    <SpaceShip position="<?lua print(-400+i*200) ?>,3000,-2000" lookat="-1300,-600,900" visible="true">
        <!--events>
            <visibility>
                <EventListener event="LetsGo" />
            </visibility>
        </events-->
        <templates>
            <Template link=spaceshipTransporter />
        </templates>
        <controller>
            <AIController team=1>
                <events>
                    <activity>
                        <EventListener event="LetsGo" />
                     </activity>
                </events>
            </AIController>
        </controller>
    </SpaceShip>
<?lua end ?>

<!-- @Triggers: "hintX" <->  delayed LetsGo -->
    <EventTrigger name="hint1" activations="1" stayactive="true" delay=4.2>
      <events>
        <trigger>
          <EventListener event="LetsGo" />
        </trigger>
      </events>
    </EventTrigger>
    <EventTrigger name="hint2" activations="1" stayactive="true" delay=8.4>
      <events>
        <trigger>
          <EventListener event="LetsGo" />
        </trigger>
      </events>
    </EventTrigger>
    <EventTrigger name="hint3" activations="1" stayactive="true" delay=12.6>
      <events>
        <trigger>
          <EventListener event="LetsGo" />
        </trigger>
      </events>
    </EventTrigger>
    <EventTrigger name="hint4" activations="1" stayactive="true" delay=16.8>
      <events>
        <trigger>
          <EventListener event="LetsGo" />
        </trigger>
      </events>
    </EventTrigger>
    <EventTrigger name="hint5" activations="1" stayactive="true" delay=21>
      <events>
        <trigger>
          <EventListener event="LetsGo" />
        </trigger>
      </events>
    </EventTrigger>
    <EventTrigger name="hint6" activations="1" stayactive="true" delay=25.2>
      <events>
        <trigger>
          <EventListener event="LetsGo" />
        </trigger>
      </events>
    </EventTrigger>



    <SimpleNotification message="Make bots follow you: Press (1)"  broadcast="true">
        <events>
            <trigger>
                <EventListener event=hint1 />
            </trigger>
        </events>
    </SimpleNotification>

    <SimpleNotification message="Toggle group behaviour: Press (1)"  broadcast="true">
        <events>
            <trigger>
                <EventListener event=hint2 />
            </trigger>
        </events>
    </SimpleNotification>

    <SimpleNotification message="Tell the bots to defend you: Press (2)"  broadcast="true">
        <events>
            <trigger>
                <EventListener event=hint3 />
            </trigger>
        </events>
    </SimpleNotification>

    <SimpleNotification message="Make them attack opponents: Press (2) again"  broadcast="true">
        <events>
            <trigger>
                <EventListener event=hint4 />
            </trigger>
        </events>
    </SimpleNotification>

    <SimpleNotification message="Let the bots behave 'normal': Press (2) again"  broadcast="true">
        <events>
            <trigger>
                <EventListener event=hint5 />
            </trigger>
        </events>
    </SimpleNotification>

    <SimpleNotification message="Have a look at the console to verify this."  broadcast="true">
        <events>
            <trigger>
                <EventListener event=hint6 />
            </trigger>
        </events>
    </SimpleNotification>

<!-- Generate asteroid field and asteroid belt -->
<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) -->
    <?lua
        dofile("includes/asteroidField.lua")
        asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1)

    ?>




  </Scene>
</Level>