<LevelInfo
 name = "Presentation XI"
 description = "1st Presentation level for Orxonox Convention XI"
 tags = "presentation"
 screenshot = "presentationxi.png"
/>

<?lua
  include("stats.oxo")
  include("HUDTemplates3.oxo")
?>

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

<Level
 gametype = "TeamDeathmatch"
>
  <templates>
    <Template link=lodtemplate_default />
  </templates>
  <?lua include("includes/notifications.oxi") ?>

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

    <?lua
      include("includes/pickups.oxi")
    ?>

    <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" />
    <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipswallow />

    <Billboard position="12.5, -30, -500" material="Banners/Pickups" scale="0.5"/>
    <Billboard position="500, -30, -500" material="Banners/Drone" scale="0.5"/>
    <EventDispatcher>
      <targets>
        <EventTarget target=pirate />
      </targets>
      <events>
        <activity>
          <DistanceTrigger position="500, -50, -500" distance=20 target="SpaceShip" stayactive=true />
        </activity>
      </events>
    </EventDispatcher>

    <Billboard position="1000, -30, -500" material="Banners/Formation" scale="0.5"/>
    <Billboard position="1000, -50, -500" material="Examples/Flare" scale="0.5"/>
    <EventDispatcher>
      <targets>
        <EventTarget target=formation />
      </targets>
      <events>
        <activity>
          <DistanceTrigger position="1000, -50, -500" distance=20 target="SpaceShip" stayactive=true />
        </activity>
      </events>
    </EventDispatcher>

    <SpaceShip position="500,0,-1500">
        <templates>
          <Template link=spaceshippirate />
        </templates>
        <controller>
          <AIController team=1 active=false name=pirate formationFlight=false passive=false />
        </controller>
    </SpaceShip>


    <?lua
      for i = 1, 10, 1 do
        ?>
      <SpaceShip position="<?lua print(5000 + math.random() * 4000 - 2000) ?>,<?lua print(0 + math.random() * 2000 - 1000) ?>,<?lua print(math.random() * 2000 - 1000) ?>">
        <templates>
          <Template link=spaceshippirate />
        </templates>
        <controller>
          <AIController formationFlight=true passive=true team=0 name=formation active=false />
        </controller>
      </SpaceShip>
    <?lua end ?>


    <?lua
      for i = 1, 10, 1 do
        ?>
      <SpaceShip position="<?lua print(5000 + math.random() * 4000 - 2000) ?>,<?lua print(0 + math.random() * 2000 - 1000) ?>,<?lua print(math.random() * 2000 - 1000) ?>">
        <templates>
          <Template link=spaceshipassff />
        </templates>
        <controller>
          <AIController formationFlight=true passive=true team=1 name=formation active=false/>
        </controller>
      </SpaceShip>
    <?lua end ?>

    <PickupSpawner pickup=dronepickup position="500,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />

    <!-- Shield pickups -->

    <PickupSpawner pickup=hugeshieldpickup position="-25,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />

    <!-- Health pickups -->

    <PickupSpawner pickup=hugehealthpickup position="0,-75,-500" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />

    <!-- Speed pickups -->

    <PickupSpawner pickup=hugespeedpickup position="25,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
    <PickupSpawner pickup=smalljumppickup position="50,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />

    <!-- Invisible pickups -->

    <PickupSpawner pickup=hugeinvisiblepickup position="0,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />

    <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
    <PickupRepresentation
      name = "MediumHealth"
      pickupName = "Medium Health Pack"
      pickupDescription = "Once used adds a medium amout of health to the ship."
      spawnerTemplate = "mediumhealthpickupRepresentation"
      inventoryRepresentation = "MediumHealth"
    />

    <Template name=onusehealthpickup baseclass=HealthPickup>
      <HealthPickup representation="MediumHealth" health=50 activationType=onUse durationType=once />
    </Template>

    <PickupSpawner pickup=onusehealthpickup position="25,-75,-500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />

  </Scene>
</Level>