[Orxonox-commit 5080] r9744 - in code/branches/invaders: data/levels data/levels/includes data/levels/templates src/modules/invader src/modules/weapons/weaponmodes

zifloria at orxonox.net zifloria at orxonox.net
Mon Nov 4 15:58:02 CET 2013


Author: zifloria
Date: 2013-11-04 15:58:01 +0100 (Mon, 04 Nov 2013)
New Revision: 9744

Added:
   code/branches/invaders/data/levels/_temp.oxw
   code/branches/invaders/data/levels/includes/invaderWeapon.oxi
   code/branches/invaders/data/levels/templates/.shipmodels
   code/branches/invaders/src/modules/invader/InvaderWeapon.cc
   code/branches/invaders/src/modules/invader/InvaderWeapon.h
Modified:
   code/branches/invaders/data/levels/templates/spaceshipInvader.oxt
   code/branches/invaders/src/modules/invader/CMakeLists.txt
   code/branches/invaders/src/modules/invader/InvaderPrereqs.h
   code/branches/invaders/src/modules/invader/InvaderShip.cc
   code/branches/invaders/src/modules/invader/InvaderShip.h
   code/branches/invaders/src/modules/weapons/weaponmodes/HsW01.h
Log:
Added everything I modified and a few funky things


Added: code/branches/invaders/data/levels/_temp.oxw
===================================================================
--- code/branches/invaders/data/levels/_temp.oxw	                        (rev 0)
+++ code/branches/invaders/data/levels/_temp.oxw	2013-11-04 14:58:01 UTC (rev 9744)
@@ -0,0 +1,377 @@
+<LevelInfo
+ name = "Surface Race Presentation"
+ description = "just awesome 2.0"
+ screenshot = "surfaceRace.png"
+ tags = "gametype, shipselection"
+ startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser, spaceshiprace"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/spaceshipRace.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipGhost.oxt")
+  include("templates/spaceshipSpacecruiser.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+<Level
+gametype = SpaceRace
+>
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "2.0, 2.0, 2.0"
+    skybox       = "Orxonox/skyBoxClouds"
+    gravity      = "0,-75,0"
+    negativeWorldRange = "-100000, -100000, -100000"
+    positiveWorldRange = " 100000,  100000,  100000"
+    hasPhysics   = true
+  >
+
+    <Template name=PortalDefault>
+        <PortalEndPoint>
+            <attached>
+                <Model mesh="Spacegate.mesh" scale="3"/>
+            </attached>
+        </PortalEndPoint>
+    </Template>
+
+    <PortalEndPoint position="6000,8050,2500" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+    <PortalEndPoint position="6100,8050,-4500" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+    <PortalLink fromID="1" toID="2" />
+    <PortalLink fromID="2" toID="1" />
+
+  <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"/>
+
+
+    <Model position="4200,8050,-1000" scale=10 mesh="debris-pile01.mesh" shadow=true />
+    <Model position="4200,8050,-1000" scale=10 mesh="debris-pile02.mesh" shadow=true />
+    <Model position="4200,8050,-1000" scale=10 mesh="debris-pile03.mesh" shadow=true />
+
+    <MovableEntity position="-700,8090,-300" velocity="80,0,0" rotationaxis="1,0,1" rotationrate=200>
+      <attached>
+        <Model position="0,0,-20" scale=10 mesh="cokebottle.mesh" />
+      </attached>
+    </MovableEntity>
+
+
+<SpaceRaceManager>
+ <checkpoints>
+    <RaceCheckPoint name="checkpoint1" position="0,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+    <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+           <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint3" position="3000,8050,-4000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint4" position="4000,8050,-1000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="3" islast="false" nextcheckpoints="4,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint5" position="4000,8050,0" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint6" position="3000,8050,1000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint7" position="0,8050,2000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint8" position="-4000,8050,3000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="7" islast="false" nextcheckpoints="8,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint9" position="-4000,8050,5000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="8" islast="false" nextcheckpoints="9,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+         <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint10" position="-3000,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint11" position="0,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="120" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint12" position="6000,8050,6000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint13" position="5500,8050,3000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint14" position="6000,8050,-5000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="13" islast="true" >
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+</checkpoints>
+</SpaceRaceManager>
+
+ <SpawnPoint team=0 position="0,8050,0" lookat="0,8000,-8000" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser />
+
+
+    <!-- -----------------------Zylinder---------------------------- -->
+<StaticEntity position="2750,8050,6000" direction="1,0,0" roll="90"  scale="4" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="cylinder.mesh" scale3D="100,100,400" />
+    <!--
+                <Model position="0,80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+        <Model position="0,-80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+        <Model position="80,0,600" mesh="testcube.mesh" scale3D="18,90,-600" />
+        <Model position="-80,0,600" mesh="testcube.mesh" scale3D="18,09,-600" />
+    -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,320,2400"            halfExtents="360,72,2400" />
+        <BoxCollisionShape position="0,-320,2400"      halfExtents="360,72,2400" />
+        <BoxCollisionShape position="320,0,2400"            halfExtents="72,360,2400" />
+        <BoxCollisionShape position="-320,0,2400"     halfExtents="72,360,2400" />
+
+
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+<!-- ------------------Cube between gate 4 and 5----------------- -->
+<StaticEntity position="4465,8050,-500" direction="0,0,0"   scale="1" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+                <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+        -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,0"            halfExtents="450,600,50" />
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+<StaticEntity position="3535,8050,-500" direction="0,0,0"   scale="1" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+                <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+        -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,0"            halfExtents="450,600,50" />
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+
+
+
+    <!-- ------------------Boden----------------- -->
+  <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 friction=0.01>
+     <attached>
+        <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="8000,8000,8000" />
+      </attached>
+      <collisionShapes>
+        <BoxCollisionShape position="0,50,0" halfExtents="8000,8000,8000" />um j?:P"{
+
+      </collisionShapes>
+</StaticEntity>
+
+
+<!-- ---------------------PickUp---------------------- -->
+
+
+   <PickupSpawner pickup=smallspeedpickup position="4000,8050,0" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+   <PickupSpawner pickup=mediumspeedpickup position="5500,8100,2000" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+   <PickupSpawner pickup="mediumshrinkpickup" position="3000,8050,-4000" triggerDistance="40" respawnTime="60"  maxSpawnedItems="5" scale="8" />
+
+
+
+
+ <!-- ---------------asteroid ellipse----------------- -->
+
+ <?lua
+    max = 15
+    for i = 0, max, 1
+    do
+    x=-12000
+    y=10000
+    z=-12000
+
+    ?>
+    <?lua
+    for k = 1, 15, 1
+    do
+    j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(x + math.random() * 20000) ?>,<?lua print(y + math.random() * 5000) ?>,<?lua print(z + math.random() * 20000) ?>"
+      collisionType = "dynamic"
+      linearDamping = "0.5"
+      angularDamping = "0.5"
+      collisiondamage = "100"
+      enablecollisiondamage = "true"
+      scale="<?lua print(j * 5) ?>" >
+      <attached>
+        <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+      <?lua if k == 0 then ?><attached><!-- ---------asteroid fog----- -->
+            <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+          </attached> <?lua end ?>
+        </Model>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+    <?lua
+    end
+    ?>
+    <?lua end ?>
+
+  </Scene>
+</Level>
+
+

Added: code/branches/invaders/data/levels/includes/invaderWeapon.oxi
===================================================================
--- code/branches/invaders/data/levels/includes/invaderWeapon.oxi	                        (rev 0)
+++ code/branches/invaders/data/levels/includes/invaderWeapon.oxi	2013-11-04 14:58:01 UTC (rev 9744)
@@ -0,0 +1,29 @@
+    <weaponslots>
+      <WeaponSlot position="-9.2,2,-13" />
+      <WeaponSlot position=" 9.2,2,-13" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+      <WeaponSet firemode=1 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+          <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+        </links>
+        <Weapon>
+          <InvaderWeapon mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam.mesh" />
+          <!--InvaderWeapon mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" projectileMesh="LaserBeam.mesh" /-->
+        </Weapon>
+        <Weapon>
+          <InvaderWeapon mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam.mesh" />
+          <!--InvaderWeapon mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" projectileMesh="LaserBeam.mesh" /-->
+        </Weapon>
+      </WeaponPack>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+        </links>
+      </WeaponPack>
+    </weapons>

Added: code/branches/invaders/data/levels/templates/.shipmodels
===================================================================
--- code/branches/invaders/data/levels/templates/.shipmodels	                        (rev 0)
+++ code/branches/invaders/data/levels/templates/.shipmodels	2013-11-04 14:58:01 UTC (rev 9744)
@@ -0,0 +1,16 @@
+spaceshipTransporterSL
+spaceshipTurret
+spaceshipGhost
+spaceshipEscort
+spaceshipSwallow
+spaceshipAssff
+spaceshipSpacecruiser
+spaceshipHXY
+spaceshipH2
+spaceshipHXYSL
+spaceshipCollateralDamage
+spaceshipAssff2
+spaceshipPirate
+spaceshipRace
+spaceshipTransporter
+spaceshipInvader

Modified: code/branches/invaders/data/levels/templates/spaceshipInvader.oxt
===================================================================
--- code/branches/invaders/data/levels/templates/spaceshipInvader.oxt	2013-11-04 14:48:00 UTC (rev 9743)
+++ code/branches/invaders/data/levels/templates/spaceshipInvader.oxt	2013-11-04 14:58:01 UTC (rev 9744)
@@ -56,7 +56,7 @@
       <BoxCollisionShape position="0,     0,-12" halfExtents="4  , 4 ,7" />
     </collisionShapes>
 <?lua
-  include("../includes/weaponSettingsEscort.oxi")
+  include("../includes/invaderWeapon.oxi")
 ?>
   </InvaderShip>
 </Template>

Modified: code/branches/invaders/src/modules/invader/CMakeLists.txt
===================================================================
--- code/branches/invaders/src/modules/invader/CMakeLists.txt	2013-11-04 14:48:00 UTC (rev 9743)
+++ code/branches/invaders/src/modules/invader/CMakeLists.txt	2013-11-04 14:58:01 UTC (rev 9744)
@@ -3,6 +3,7 @@
   Invader.cc
   InvaderCenterPoint.cc
   InvaderShip.cc
+  InvaderWeapon.cc
 END_BUILD_UNIT
 )
 
@@ -12,5 +13,6 @@
   LINK_LIBRARIES
     orxonox
     overlays
+    weapons
   SOURCE_FILES ${Invader_SRC_FILES}
 )

Modified: code/branches/invaders/src/modules/invader/InvaderPrereqs.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderPrereqs.h	2013-11-04 14:48:00 UTC (rev 9743)
+++ code/branches/invaders/src/modules/invader/InvaderPrereqs.h	2013-11-04 14:58:01 UTC (rev 9744)
@@ -70,6 +70,7 @@
     class Invader;
     class InvaderCenterPoint;
     class InvaderShip;
+    class InvaderWeapon;
 }
 
 #endif /* _InvaderPrereqs_H__ */

Modified: code/branches/invaders/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.cc	2013-11-04 14:48:00 UTC (rev 9743)
+++ code/branches/invaders/src/modules/invader/InvaderShip.cc	2013-11-04 14:58:01 UTC (rev 9744)
@@ -49,12 +49,18 @@
         RegisterObject(InvaderShip);
 
         speed = 500;
+        isFireing = false;
         damping = 10;
+
     }
 
     void InvaderShip::tick(float dt)
     {
-        // If the bat is controlled (but not over the network).
+        // if (camera == NULL)
+        //     camera = this->getCamera();
+        // if (camera != NULL)
+        //     camera->setPosition(Vector3(0, 0, 0) + this->getWorldPosition());
+
         if (this->hasLocalController())
         {
             this->setVelocity(Vector3(1000 + velocity.y, 0, velocity.x)); //
@@ -68,12 +74,16 @@
         if (isFireing)
             ControllableEntity::fire(0);
 
+
+        // camera->setOrientation(Vector3::UNIT_X, Degree(0));
+
+
         SUPER(InvaderShip, tick, dt);
     }
 
     void InvaderShip::moveFrontBack(const Vector2& value)
     {
-        orxout(internal_error) << "move backfront" << value.x << value.y << endl;
+        // orxout(internal_error) << "move backfront" << value.x << value.y << endl;
         //velocity.y = value.y * speed * 10;
         lastTimeFront = 0;
         desiredVelocity.y = value.y * speed * 10;
@@ -81,7 +91,7 @@
 
     void InvaderShip::moveRightLeft(const Vector2& value)
     {
-        orxout(internal_error) << "right left front" << value.x << value.y << endl;
+        // orxout(internal_error) << "right left front" << value.x << value.y << endl;
         lastTimeLeft = 0;
         desiredVelocity.x = value.x * speed;
         // velocity.x = value.x * speed;

Modified: code/branches/invaders/src/modules/invader/InvaderShip.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.h	2013-11-04 14:48:00 UTC (rev 9743)
+++ code/branches/invaders/src/modules/invader/InvaderShip.h	2013-11-04 14:58:01 UTC (rev 9744)
@@ -37,6 +37,7 @@
 #include "invader/InvaderPrereqs.h"
 
 #include "worldentities/pawns/SpaceShip.h"
+#include "graphics/Camera.h"
 
 namespace orxonox
 {
@@ -58,6 +59,7 @@
             virtual void rotatePitch(const Vector2& value){};
             virtual void rotateRoll(const Vector2& value){};
         private:
+            Camera* camera;
             bool isFireing;
             float speed, damping;
             float lastTimeFront, lastTimeLeft;

Added: code/branches/invaders/src/modules/invader/InvaderWeapon.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderWeapon.cc	                        (rev 0)
+++ code/branches/invaders/src/modules/invader/InvaderWeapon.cc	2013-11-04 14:58:01 UTC (rev 9744)
@@ -0,0 +1,88 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      --
+ *
+ */
+
+/**
+    @file InvaderWeapon.h
+    @brief Implementation of the InvaderWeapon class.
+*/
+
+#include "InvaderWeapon.h"
+
+#include "core/CoreIncludes.h"
+// #include "core/XMLPort.h"
+// #include "core/command/Executor.h"
+
+#include "graphics/Model.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/WorldEntity.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "weapons/projectiles/Projectile.h"
+#include "weapons/MuzzleFlash.h"
+
+namespace orxonox
+{
+    RegisterClass(InvaderWeapon);
+
+    InvaderWeapon::InvaderWeapon(Context* context) : HsW01(context)
+    {
+        RegisterObject(InvaderWeapon);
+    }
+
+    InvaderWeapon::~InvaderWeapon(){}
+
+    void InvaderWeapon::shot()
+    {
+        // orxout(internal_error) << "shotttttt" << endl;
+
+        assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
+
+        // Create the projectile.
+        Projectile* projectile = new Projectile(this->getContext());
+        Model* model = new Model(projectile->getContext());
+        model->setMeshSource(mesh_);
+        model->setCastShadows(false);
+        projectile->attach(model);
+        model->setScale(5);
+
+        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+        projectile->setOrientation(Quaternion(sqrt(0.5),0,sqrt(0.5),0)); //this->getMuzzleOrientation()   Quaternion::IDENTITY
+        projectile->setPosition(this->getMuzzlePosition());
+        projectile->setVelocity(Vector3(1, 0, 0) * 2000); //this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_
+
+        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        projectile->setDamage(this->getDamage());
+        projectile->setShieldDamage(this->getShieldDamage());
+        projectile->setHealthDamage(this->getHealthDamage());
+
+        // Display the muzzle flash.
+        this->InvaderWeapon::muzzleflash();
+    }
+}

Added: code/branches/invaders/src/modules/invader/InvaderWeapon.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderWeapon.h	                        (rev 0)
+++ code/branches/invaders/src/modules/invader/InvaderWeapon.h	2013-11-04 14:58:01 UTC (rev 9744)
@@ -0,0 +1,62 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file InvaderWeapon.h
+    @brief Definition of the InvaderWeapon class.
+*/
+
+#ifndef _InvaderWeapon_H__
+#define _InvaderWeapon_H__
+
+#include "weapons/weaponmodes/HsW01.h"
+#include "weapons/WeaponsPrereqs.h"
+
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Shoots laser beams.
+    @author
+        Hagen Seifert
+    @ingroup WeaponsHsW01s
+    */
+    class _InvaderExport InvaderWeapon : public HsW01
+    {
+        public:
+            InvaderWeapon(Context* context);
+            virtual ~InvaderWeapon();
+        protected:
+            virtual void shot();
+    };
+}
+
+#endif /* _InvaderWeapon_H__ */

Modified: code/branches/invaders/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/branches/invaders/src/modules/weapons/weaponmodes/HsW01.h	2013-11-04 14:48:00 UTC (rev 9743)
+++ code/branches/invaders/src/modules/weapons/weaponmodes/HsW01.h	2013-11-04 14:58:01 UTC (rev 9744)
@@ -58,7 +58,7 @@
             virtual void fire();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-        private:
+        protected:
             /**
             @brief Set the mesh.
             @param mesh The mesh name.
@@ -108,7 +108,7 @@
             float getDelay() const
                 { return this->delay_; }
 
-            void shot();
+            virtual void shot();
             void muzzleflash();
 
             std::string material_; //!< The material.




More information about the Orxonox-commit mailing list