[Orxonox-commit 7819] r12411 - in code/branches/Presentation_FS19: . data/levels data/levels/includes data/levels/templates data/overlays data/tcl src/modules src/modules/asteroids2D src/modules/pong src/modules/weapons/munitions src/modules/weapons/projectiles src/modules/weapons/weaponmodes
wiesep at orxonox.net
wiesep at orxonox.net
Wed May 22 14:59:08 CEST 2019
Author: wiesep
Date: 2019-05-22 14:59:08 +0200 (Wed, 22 May 2019)
New Revision: 12411
Added:
code/branches/Presentation_FS19/data/levels/includes/OrxoBloxWeapon.oxi
code/branches/Presentation_FS19/data/levels/orxoblox.oxw
code/branches/Presentation_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
code/branches/Presentation_FS19/data/overlays/OrxoBloxHUD.oxo
code/branches/Presentation_FS19/src/modules/OrxoBlox/
code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.cc
code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.h
code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.cc
code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.h
code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.cc
code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.h
Modified:
code/branches/Presentation_FS19/
code/branches/Presentation_FS19/data/levels/Asteroids2D.oxw
code/branches/Presentation_FS19/data/levels/emptyLevel.oxw
code/branches/Presentation_FS19/data/levels/pong.oxw
code/branches/Presentation_FS19/data/levels/templates/spaceshipEscort.oxt
code/branches/Presentation_FS19/data/levels/tetris.oxw
code/branches/Presentation_FS19/data/levels/towerDefense.oxw
code/branches/Presentation_FS19/data/tcl/orxokart_highscores.txt
code/branches/Presentation_FS19/src/modules/CMakeLists.txt
code/branches/Presentation_FS19/src/modules/asteroids2D/Asteroids2DShip.cc
code/branches/Presentation_FS19/src/modules/pong/Pong.cc
code/branches/Presentation_FS19/src/modules/weapons/munitions/CMakeLists.txt
code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.h
Log:
Merged OrxoBlox_FS19
Index: code/branches/Presentation_FS19
===================================================================
--- code/branches/Presentation_FS19 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19 2019-05-22 12:59:08 UTC (rev 12411)
Property changes on: code/branches/Presentation_FS19
___________________________________________________________________
Modified: svn:mergeinfo
## -15,6 +15,7 ##
/code/branches/Highscore_HS16:11226-11355
/code/branches/Masterserver_FS18:11816-12026
/code/branches/MouseAPI_FS19:12205-12406
+/code/branches/OrxoBlox_FS19:12208-12410
/code/branches/OrxoKart_HS18:12037-12193
/code/branches/OrxyRoad_FS18:11823-12029
/code/branches/ParticleEffectsFS15:10309-10612
Modified: code/branches/Presentation_FS19/data/levels/Asteroids2D.oxw
===================================================================
--- code/branches/Presentation_FS19/data/levels/Asteroids2D.oxw 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/levels/Asteroids2D.oxw 2019-05-22 12:59:08 UTC (rev 12411)
@@ -43,7 +43,7 @@
<!-- <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"/> -->
<Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
- <SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass= Asteroids2DShip pawndesign=spaceshipasteroids2d />
+ <SpawnPoint team=0 position="0,0,50" lookat="0,0,0" spawnclass= Asteroids2DShip pawndesign=spaceshipasteroids2d />
<!--<Model mesh="axes.mesh" scale=10 position="0,0,0" /> -->
Modified: code/branches/Presentation_FS19/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/Presentation_FS19/data/levels/emptyLevel.oxw 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/levels/emptyLevel.oxw 2019-05-22 12:59:08 UTC (rev 12411)
@@ -1,6 +1,6 @@
<LevelInfo
- name = "Empty level"
- description = "A level with absolutely nothing in it."
+ name = "Emptylevel"
+ description = "A clone version of the BBTAN game."
tags = "test"
screenshot = "emptylevel.png"
/>
Copied: code/branches/Presentation_FS19/data/levels/includes/OrxoBloxWeapon.oxi (from rev 12410, code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi)
===================================================================
--- code/branches/Presentation_FS19/data/levels/includes/OrxoBloxWeapon.oxi (rev 0)
+++ code/branches/Presentation_FS19/data/levels/includes/OrxoBloxWeapon.oxi 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,24 @@
+ <weaponslots>
+ <WeaponSlot position="0,-5,0" />/>
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ </weaponsets>
+ <weaponpacks>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ </links>
+ <Weapon>
+ <BallGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
+ </Weapon>
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ </WeaponPack>
+ </weaponpacks>
+ <munition>
+ <BallMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=1 replenishamount=1 replenishinterval=4/>
+ </munition>
Copied: code/branches/Presentation_FS19/data/levels/orxoblox.oxw (from rev 12410, code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw)
===================================================================
--- code/branches/Presentation_FS19/data/levels/orxoblox.oxw (rev 0)
+++ code/branches/Presentation_FS19/data/levels/orxoblox.oxw 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,85 @@
+<LevelInfo
+ name = "OrxoBlox"
+ description = "A clone version of the BBTAN game."
+ tags = "minigame"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("OrxoBloxHUD.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipOrxoBlox.oxt")
+ include("templates/spaceshipEscort.oxt")
+?>
+
+<Template name=OrxoBloxball>
+ <OrxoBloxBall
+ defScoreSound = "sounds/PlayerWinScore_cut.ogg"
+ defBatSound = "sounds/Button.ogg"
+ defBoundarySound = "sounds/Button.ogg">
+ <attached>
+ <Model mesh="sphere.mesh" scale=2 />
+ <!--Billboard scale=0.2 colour="1.0, 1.0, 0.5" material="Examples/Flare" /-->
+ <Backlight scale=0.2 colour="1.0, 1.0, 0.5" width=7 length=500 lifetime=0.3 elements=20 trailmaterial="Trail/backlighttrail" material="Examples/Flare" />
+ <Light type=point diffuse="1.0, 1.0, 0.5" specular="1.0, 1.0, 0.5" attenuation="1200, 1.0, 0.0035, 0.00005" />
+ <ParticleSpawner name=hiteffect position="0,0,0" source="Orxonox/sparks2" lifetime=0.01 autostart=0 mainstate=spawn />
+ </attached>
+ <eventlisteners>
+ <EventTarget target=hiteffect />
+ </eventlisteners>
+ </OrxoBloxBall>
+</Template>
+
+
+ <Template name=OrxoBloxwall>
+ <OrxoBloxWall>
+ </OrxoBloxWall>
+ </Template>
+
+
+<Level
+ plugins = "OrxoBlox"
+ gametype = "OrxoBlox"
+>
+
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+
+ <Scene
+ ambientlight = "0.5, 0.5, 0.5"
+ skybox = "Orxonox/skyBoxBasic"
+ >
+
+ <!-- <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"/> -->
+ <Light type=directional position="-100, 10000, -700" direction="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+ <SpawnPoint team=0 position="0,-4.5,49" lookat="-10000,0,0" spawnclass=SpaceShip pawndesign=spaceshipOrxoBlox/>
+
+ <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /--->
+
+ <!--<Model mesh="axes.mesh" scale=10 position="0,0,0" /> -->
+
+
+ <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="90,100" balltemplate=OrxoBloxball ballspeed=200 ballaccfactor=1.0 StoneTemplate=OrxoBloxstone WallTemplate=OrxoBloxwall >
+
+ <attached>
+ <!-- Balken die das Spielfeld begrenzen. -->
+ <Model position="0,0,-49" mesh="cube.mesh" scale3D="45,1,1" />
+ <Model position="46,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
+ <Model position="-46,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
+ </attached>
+ </OrxoBloxCenterpoint>
+
+
+
+ </Scene>
+</Level>
+
Modified: code/branches/Presentation_FS19/data/levels/pong.oxw
===================================================================
--- code/branches/Presentation_FS19/data/levels/pong.oxw 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/levels/pong.oxw 2019-05-22 12:59:08 UTC (rev 12411)
@@ -15,6 +15,7 @@
<Template name=pongbatcameras defaults=0>
<PongBat>
<camerapositions>
+ <!---- Verschidene Kameraeinstellungen festlegen ---->
<CameraPosition position="0,150,0" pitch=-90 absolute=true />
<CameraPosition position="0,50,160" drag=true mouselook=true />
<CameraPosition position="0,40,125" drag=true mouselook=true />
@@ -50,7 +51,6 @@
</PongBall>
</Template>
-
<Level
plugins = "pong"
gametype = "Pong"
Modified: code/branches/Presentation_FS19/data/levels/templates/spaceshipEscort.oxt
===================================================================
--- code/branches/Presentation_FS19/data/levels/templates/spaceshipEscort.oxt 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/levels/templates/spaceshipEscort.oxt 2019-05-22 12:59:08 UTC (rev 12411)
@@ -43,7 +43,7 @@
</engines>
<attached>
<Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
- <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
+ <Model position="50,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
Copied: code/branches/Presentation_FS19/data/levels/templates/spaceshipOrxoBlox.oxt (from rev 12410, code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt)
===================================================================
--- code/branches/Presentation_FS19/data/levels/templates/spaceshipOrxoBlox.oxt (rev 0)
+++ code/branches/Presentation_FS19/data/levels/templates/spaceshipOrxoBlox.oxt 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,105 @@
+<Template name=spaceshipOrxoBlox>
+ <OrxoBloxShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 4
+
+
+ shieldhealth = 20
+ initialshieldhealth = 20
+ maxshieldhealth = 20
+ shieldabsorption = 0.1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
+
+ primaryThrust = 150
+ auxilaryThrust = 30
+ rotationThrust = 100
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 20
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 6
+
+ collisionType = "dynamic"
+ mass = 4200000
+ linearDamping = 0.9
+ angularDamping = 0.9999999
+
+ collisiondamage = 100
+ enablecollisiondamage = true
+
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipOrxoBloxengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipOrxoBloxengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" direction="0,0,0" roll=0 scale=1 mesh="escortShip.mesh" />
+ <Model position="0,0,0" direction="0,0,0" roll=0 scale=1 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
+ </attached>
+ <explosion >
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="Orxonox/explosion2b" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
+<?lua
+ include("../includes/OrxoBloxWeapon.oxi")
+?>
+ </OrxoBloxShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+ <OrxoBloxShip>
+ <camerapositions>
+ <CameraPosition position="0,100,0" pitch=-90 absolute=true drag = false mouselook=true/>
+ <CameraPosition position="0,0,0" drag=true mouselook=true />
+ <CameraPosition position="0,40,125" drag=true mouselook=true />
+ <CameraPosition position="0,30, 90" drag=true mouselook=true />
+ </camerapositions>
+ </OrxoBloxShip>
+</Template>
+
+<Template name=spaceshipOrxoBloxengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2.2
+
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+ >
+
+
+ </MultiStateEngine>
+</Template>
+
+
+<Template name=OrxoBloxstone>
+ <OrxoBloxStones collisionType=dynamic>
+ <attached>
+ <Model position="0,0,0" mesh="CuboidBody.mesh" scale3D="4.5,4.5,4.5" />
+ <Model position="0,0,0" mesh="cube_orange.mesh" scale=4.3 />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="4,4,4" />
+ </collisionShapes>
+ </OrxoBloxStones>
+</Template>
\ No newline at end of file
Modified: code/branches/Presentation_FS19/data/levels/tetris.oxw
===================================================================
--- code/branches/Presentation_FS19/data/levels/tetris.oxw 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/levels/tetris.oxw 2019-05-22 12:59:08 UTC (rev 12411)
@@ -124,68 +124,11 @@
</WaypointController>
</controller>
</SpaceShip>
+
+
+
- <SpaceShip position="-500,-500,-400" lookat="0,0,0">
- <templates>
- <Template link=spaceshippirate />
- </templates>
- <controller>
- <WaypointController team=10>
- <waypoints>
- <Model mesh="cube.mesh" scale=0 position="-1000,-200,0" />
- <Model mesh="cube.mesh" scale=0 position="-700,-150,650" />
- <Model mesh="cube.mesh" scale=0 position="-55,-75,1000" />
- <Model mesh="cube.mesh" scale=0 position="650,100,650" />
- <Model mesh="cube.mesh" scale=0 position="1000,150,0" />
- <Model mesh="cube.mesh" scale=0 position="650,100,-650" />
- <Model mesh="cube.mesh" scale=0 position="-55,0,-1000" />
- <Model mesh="cube.mesh" scale=0 position="-700,-100,-650" />
- </waypoints>
- </WaypointController>
- </controller>
- </SpaceShip>
- <SpaceShip position="-700,200,651" lookat="1,0,0">
- <templates>
- <Template link=spaceshipghost />
- </templates>
- <controller>
- <WaypointController team=10 accuracy=300>
- <waypoints>
- <Model mesh="cube.mesh" scale=0 position="-700,200,650" />
- <Model mesh="cube.mesh" scale=0 position="-55,100,1000" />
- <Model mesh="cube.mesh" scale=0 position="650,0,650" />
- <Model mesh="cube.mesh" scale=0 position="1000,-100,0" />
- <Model mesh="cube.mesh" scale=0 position="650,0,-650" />
- <Model mesh="cube.mesh" scale=0 position="-55,100,-1000" />
- <Model mesh="cube.mesh" scale=0 position="-700,200,-650" />
- <Model mesh="cube.mesh" scale=0 position="-1000,300,0" />
- </waypoints>
- </WaypointController>
- </controller>
- </SpaceShip>
- <SpaceShip position="1000,-75,0" lookat="0,0,0">
- <templates>
- <Template link=spaceshipHtwo />
- </templates>
- <controller>
- <WaypointController team=10>
- <waypoints>
- <Model mesh="cube.mesh" scale=0 position="400,240,400" />
- <Model mesh="cube.mesh" scale=0 position="-55,240,700" />
- <Model mesh="cube.mesh" scale=0 position="-500,240,400" />
- <Model mesh="cube.mesh" scale=0 position="-700,240,0" />
- <Model mesh="cube.mesh" scale=0 position="-500,240,-400" />
- <Model mesh="cube.mesh" scale=0 position="-55,240,-700" />
- <Model mesh="cube.mesh" scale=0 position="400,240,-400" />
- <Model mesh="cube.mesh" scale=0 position="700,240,0" />
- </waypoints>
- </WaypointController>
- </controller>
- </SpaceShip>
-
-
-
</Scene>
</Level>
Modified: code/branches/Presentation_FS19/data/levels/towerDefense.oxw
===================================================================
--- code/branches/Presentation_FS19/data/levels/towerDefense.oxw 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/levels/towerDefense.oxw 2019-05-22 12:59:08 UTC (rev 12411)
@@ -105,13 +105,13 @@
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
</links>
<Weapon>
- <LightningGun mode=0 munitionpershot=0 muzzleoffset="0,0,0" damage=2 shielddamage=4 />
+ <BallGun mode=0 munitionpershot=0 muzzleoffset="0,0,0" damage=0 shielddamage=4 />
</Weapon>
</WeaponPack>
</weaponpacks>
<munition>
- <LightningMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
- </munition>
+ <BallMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ </munition>x
<attached>
<Backlight position="0,0,0" scale=2.0 colour="0.4, 0.0, 1.0" width=10 length=10 lifetime=0.3 elements=20 trailmaterial="Trail/backlighttrail" material="Examples/Flare" loop=1 />
</attached>
Copied: code/branches/Presentation_FS19/data/overlays/OrxoBloxHUD.oxo (from rev 12410, code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo)
===================================================================
--- code/branches/Presentation_FS19/data/overlays/OrxoBloxHUD.oxo (rev 0)
+++ code/branches/Presentation_FS19/data/overlays/OrxoBloxHUD.oxo 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,33 @@
+<Template name="OrxoBloxHUD">
+ <OverlayGroup name="OrxoBloxHUD" scale = "1, 1">
+ <OrxoBloxScore
+ position = "0.9, 0.2"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ />
+
+ <OverlayText
+ position = "0.7, 0.20"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ caption = "Points: "
+ />
+
+
+
+ </OverlayGroup>
+</Template>
+
+
+
+<Template name="spectatorhud">
+ <OverlayGroup name = "spectatorhud" scale = "1, 1">
+ </OverlayGroup>
+</Template>
\ No newline at end of file
Modified: code/branches/Presentation_FS19/data/tcl/orxokart_highscores.txt
===================================================================
--- code/branches/Presentation_FS19/data/tcl/orxokart_highscores.txt 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/data/tcl/orxokart_highscores.txt 2019-05-22 12:59:08 UTC (rev 12411)
@@ -18,3 +18,5 @@
Name: 0:31:46s
Name: 0:25:40s
Name: 1:27:11s
+Name: 0:29:74s
+Name: 0:24:15s
Modified: code/branches/Presentation_FS19/src/modules/CMakeLists.txt
===================================================================
--- code/branches/Presentation_FS19/src/modules/CMakeLists.txt 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/src/modules/CMakeLists.txt 2019-05-22 12:59:08 UTC (rev 12411)
@@ -54,3 +54,4 @@
ADD_SUBDIRECTORY(wagnis)
ADD_SUBDIRECTORY(MouseAPI)
ADD_SUBDIRECTORY(MouseAPIExample)
+ADD_SUBDIRECTORY(OrxoBlox)
Modified: code/branches/Presentation_FS19/src/modules/asteroids2D/Asteroids2DShip.cc
===================================================================
--- code/branches/Presentation_FS19/src/modules/asteroids2D/Asteroids2DShip.cc 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/src/modules/asteroids2D/Asteroids2DShip.cc 2019-05-22 12:59:08 UTC (rev 12411)
@@ -68,7 +68,7 @@
void Asteroids2DShip::tick(float dt)
{
- SUPER(Asteroids2DShip, tick, dt);
+ //SUPER(Asteroids2DShip, tick, dt);
Vector3 pos = this->getPosition();
//ensure that the ship stays in playing field
Modified: code/branches/Presentation_FS19/src/modules/pong/Pong.cc
===================================================================
--- code/branches/Presentation_FS19/src/modules/pong/Pong.cc 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/src/modules/pong/Pong.cc 2019-05-22 12:59:08 UTC (rev 12411)
@@ -126,6 +126,7 @@
*/
void Pong::start()
{
+ orxout() << "Hello" << endl;
if (this->center_ != nullptr) // There needs to be a PongCenterpoint, i.e. the area the game takes place.
{
if (this->ball_ == nullptr) // If there is no ball, create a new ball.
Copied: code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.cc (from rev 12410, code/branches/OrxoBlox_FS19/src/modules/weapons/munitions/BallMunition.cc)
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.cc (rev 0)
+++ code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.cc 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,59 @@
+/*
+ * 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:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file IceMunition.cc
+ @brief Implementation of the IceMunition class.
+*/
+
+#include "BallMunition.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(BallMunition);
+
+ BallMunition::BallMunition(Context* context) : ReplenishingMunition(context)
+ {
+ RegisterObject(BallMunition);
+
+ this->maxMunitionPerMagazine_ = 20;
+ this->maxMagazines_ = 10;
+ this->unassignedMagazines_ = 10;
+
+ this->deployment_ = MunitionDeployment::Separate;
+
+ this->bAllowMunitionRefilling_ = true;
+ this->bAllowMultiMunitionRemovementUnderflow_ = true;
+
+ this->replenishInterval_ = 7.0f;
+ this->replenishAmount_ = 1;
+
+ this->reloadTime_ = 0.6f;
+ }
+}
Copied: code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.h (from rev 12410, code/branches/OrxoBlox_FS19/src/modules/weapons/munitions/BallMunition.h)
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.h (rev 0)
+++ code/branches/Presentation_FS19/src/modules/weapons/munitions/BallMunition.h 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,58 @@
+/*
+ * 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:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file IceMunition.h
+ @brief Definition of the IceMunition class.
+*/
+
+#ifndef _BallMunition_H__
+#define _BallMunition_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/ReplenishingMunition.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ IceMunition.
+ @author
+ Fabien Vultier
+ @ingroup WeaponsMunitions
+ */
+ class _WeaponsExport BallMunition : public ReplenishingMunition
+ {
+ public:
+ BallMunition(Context* context);
+ virtual ~BallMunition() = default;
+ };
+}
+
+#endif /* _SplitMunition_H__ */
Modified: code/branches/Presentation_FS19/src/modules/weapons/munitions/CMakeLists.txt
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/munitions/CMakeLists.txt 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/src/modules/weapons/munitions/CMakeLists.txt 2019-05-22 12:59:08 UTC (rev 12411)
@@ -8,4 +8,5 @@
FlameMunition.cc
SplitMunition.cc
MineMunition.cc
+ BallMunition.cc
)
Copied: code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.cc (from rev 12410, code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc)
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.cc (rev 0)
+++ code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.cc 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,266 @@
+/*
+ * 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:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file ParticleProjectile.h
+ @brief Implementation of the ParticleProjectile class.
+*/
+
+#include "BallProjectile.h"
+#include "gametypes/Gametype.h"
+#include <OrxoBlox/OrxoBloxStones.h>
+
+
+#include <OgreParticleEmitter.h>
+#include "core/CoreIncludes.h"
+#include "tools/ParticleInterface.h"
+#include "Scene.h"
+#include "core/command/Executor.h"
+#include "util/Convert.h"
+#include <bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
+#include <bullet/LinearMath/btVector3.h>
+
+namespace orxonox
+{
+ RegisterClass(BallProjectile);
+
+ BallProjectile::BallProjectile(Context* context) : BillboardProjectile(context)
+ {
+ RegisterObject(BallProjectile);
+ this->textureIndex_ = 1;
+ this->setMass(0.1f);
+ this->maxTextureIndex_ = 8;
+ this->setDestroyAfterCollision(false); //I want the ball to bounce, not to be destroyed
+ this->fieldWidth_ = 46;
+ this->fieldHeight_ = 49;
+ this->orxoblox_ = this->getOrxoBlox();
+ this->setCollisionShapeRadius(2.5);
+
+ //setEffect("Orxonox/sparks2");
+ }
+
+ void BallProjectile::registerVariables()
+ {
+ registerVariable(this->materialBase_);
+ registerVariable( this->speed_ );
+ }
+
+ /**
+ @brief
+ Set the material.
+ @param material
+ The name of the material. Material names with 1 to 8 appended must exist.
+ */
+ void BallProjectile::setMaterial(const std::string& material)
+ {
+ this->materialBase_ = material;
+
+ BillboardProjectile::setMaterial(material + multi_cast<std::string>(this->textureIndex_));
+ }
+
+ /**
+ @brief
+ Change the texture.
+ */
+ void BallProjectile::changeTexture()
+ {
+ this->textureIndex_++;
+ if (this->textureIndex_ > this->maxTextureIndex_)
+ this->textureIndex_ = 1;
+
+ this->setMaterial(this->materialBase_);
+ }
+
+
+
+ void BallProjectile::Bounce(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs) {
+
+ Vector3 velocity = this->getVelocity();
+ Vector3 myPosition = otherObject->getPosition();
+ btVector3 positionOtherObject = contactPoint.getPositionWorldOnA();
+
+ int distance_X = positionOtherObject.getX() - myPosition.x;
+ int distance_Z = positionOtherObject.getZ() - myPosition.z;
+
+ if (distance_X < 0)
+ distance_X = -distance_X;
+
+
+ if (distance_Z < 0)
+ distance_Z = -distance_Z;
+
+ //orxout() << distance_X << endl;
+ //orxout() << distance_Z << endl;
+
+ if (distance_X < distance_Z) {
+ velocity.z = -velocity.z;
+ //orxout() << "z" << endl;
+ }
+ if (distance_Z < distance_X) {
+ velocity.x = -velocity.x;
+ //orxout() << "x" << endl;
+ }
+ else {
+ velocity.x = -velocity.x;
+ velocity.z = -velocity.z;
+ //orxout() << "both" << endl;
+ }
+ this->setVelocity(velocity);
+ //}
+ }
+
+
+ bool BallProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
+ {
+ bool result = BasicProjectile::processCollision(otherObject, contactPoint, cs);
+ if (result == true) {
+ if (otherObject->isA(Class(OrxoBloxStones))) {
+ Bounce(otherObject, contactPoint, cs);
+ (orxonox_cast<OrxoBloxStones*>(otherObject))->gotHit();
+
+ }
+ }
+ return result;
+ }
+
+
+
+ OrxoBlox* BallProjectile::getOrxoBlox()
+ {
+ if (this->getGametype() != nullptr && this->getGametype()->isA(Class(OrxoBlox)))
+ {
+ OrxoBlox* orxobloxGametype = orxonox_cast<OrxoBlox*>(this->getGametype());
+ return orxobloxGametype;
+ }
+ else orxout()<<"There is no Gametype for OrxoBlox! ask Anna"<< endl;
+ return nullptr;
+ }
+
+
+
+ void BallProjectile::tick(float dt)
+ {
+ SUPER(BallProjectile, tick, dt);
+
+ // Get the current position, velocity and acceleration of the ball.
+ bool suicidal = false;
+ Vector3 position = this->getPosition();
+ Vector3 velocity = this->getVelocity();
+ Vector3 acceleration = this->getAcceleration();
+
+ velocity.y = 0;
+ position.y = 0;
+
+ // If the ball has gone over the top or bottom boundary of the playing field (i.e. the ball has hit the top or bottom delimiters).
+ if (position.z > this->fieldHeight_ || position.z < -this->fieldHeight_)
+ {
+
+ velocity.z = -velocity.z;
+ // And its position is set as to not overstep the boundary it has just crossed. Remember z axis is reverted!!!
+ if (position.z > this->fieldHeight_){
+ // Set the ball to be exactly at the boundary.
+ position.z = this-> fieldHeight_;
+ orxoblox_->count();
+ suicidal = true;
+
+ }
+ if (position.z < -this->fieldHeight_){
+ position.z = -this->fieldHeight_;
+
+ }
+
+ this->fireEvent();
+ }
+
+ //Ball hits the right or left wall and should bounce back.
+ // If the ball has crossed the left or right boundary of the playing field.
+ if (position.x > this->fieldWidth_ || position.x < -this->fieldWidth_)
+ {
+ //Ball hits the right Wall
+ if (position.x > this->fieldWidth_)
+ {
+ // Set the ball to be exactly at the boundary.
+ position.x = this->fieldWidth_;
+ // Invert its velocity in x-direction (i.e. it bounces off).
+ velocity.x = -velocity.x;
+ this->fireEvent();
+ }
+
+ //Ball hits the left wall
+ else if (position.x < -this->fieldWidth_)
+ {
+ // Set the ball to be exactly at the boundary.
+ position.x = -this->fieldWidth_;
+ // Invert its velocity in x-direction (i.e. it bounces off).
+ velocity.x = -velocity.x;
+ this->fireEvent();
+ }
+ }
+
+ // Set the position, velocity and acceleration of the ball, if they have changed.
+ if (acceleration != this->getAcceleration())
+ this->setAcceleration(acceleration);
+ if (velocity != this->getVelocity())
+ this->setVelocity(velocity);
+ if (position != this->getPosition())
+ this->setPosition(position);
+ //this->Collides((this->orxoblox_->CheckForCollision(this)));
+ if (suicidal == true) {
+ this->destroy();
+ }
+
+ }
+
+
+
+ void BallProjectile::setSpeed(float speed)
+ {
+ if (speed != this->speed_) // If the speed changes
+ {
+ this->speed_ = speed;
+
+ // Set the speed in the direction of the balls current velocity.
+ Vector3 velocity = this->getVelocity();
+ if (velocity.x != 0)
+ velocity.x = sgn(velocity.x) * this->speed_;
+ else // If the balls current velocity is zero, the speed is set in a random direction.
+ velocity.x = this->speed_ * sgn(rnd(-1,1));
+
+ this->setVelocity(velocity);
+ }
+ }
+
+ void BallProjectile::destroyObject(void)
+ {
+ if(GameMode::isMaster()) {
+ }
+ }
+
+
+
+}
Copied: code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.h (from rev 12410, code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h)
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.h (rev 0)
+++ code/branches/Presentation_FS19/src/modules/weapons/projectiles/BallProjectile.h 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,44 @@
+#ifndef _BallProjectile_H__
+#define _BallProjectile_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weapons/projectiles/BillboardProjectile.h"
+#include "../../OrxoBlox/OrxoBlox.h"
+#include "../../OrxoBlox/OrxoBloxStones.h"
+
+#include "OrxoBlox/OrxoBloxPrereqs.h"
+
+namespace orxonox
+{
+
+ class _WeaponsExport BallProjectile : public BillboardProjectile
+ {
+ public:
+ BallProjectile(Context* context);
+ void Bounce(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs);
+ virtual void setMaterial(const std::string& material) override;
+ virtual void tick(float dt) override;
+ void setSpeed(float speed);
+
+
+ protected:
+ bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs) override;
+
+ private:
+ void destroyObject() override;
+ void registerVariables();
+ void changeTexture();
+ OrxoBlox* getOrxoBlox();
+
+ float speed_; //!< The speed (in x-direction) of the ball.
+ float fieldWidth_; //!< The width of the playing field.
+ float fieldHeight_; //!< The height of the playing field.
+ unsigned int textureIndex_; //!< The current index of the texture. (i.e. the index of the currently displayed texture)
+ unsigned int maxTextureIndex_; //!< The maximal index.
+ std::string materialBase_; //!< The base name of the material.
+ OrxoBlox* orxoblox_;
+ OrxoBloxStones* stone_;
+ };
+}
+
+#endif /* _ParticleProjectile_H__ */
Modified: code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.cc 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.cc 2019-05-22 12:59:08 UTC (rev 12411)
@@ -171,8 +171,9 @@
*/
void BasicProjectile::destroyCheck(void)
{
- if(GameMode::isMaster() && this->bDestroy_)
+ if(GameMode::isMaster() && this->bDestroy_) {
this->destroy();
+ }
}
/**
@@ -181,7 +182,8 @@
*/
void BasicProjectile::destroyObject(void)
{
- if(GameMode::isMaster())
+ if(GameMode::isMaster()) {
this->destroy();
+ }
}
}
Modified: code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.h
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.h 2019-05-22 12:45:31 UTC (rev 12410)
+++ code/branches/Presentation_FS19/src/modules/weapons/projectiles/BasicProjectile.h 2019-05-22 12:59:08 UTC (rev 12411)
@@ -116,7 +116,7 @@
virtual void destroyObject(void);
protected:
- bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs);
+ virtual bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs);
void destroyCheck(void);
inline void setDestroyAfterCollision(bool destroyAfterCollision)
{ destroyAfterCollision_ = destroyAfterCollision; }
Copied: code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.cc (from rev 12410, code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc)
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.cc (rev 0)
+++ code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.cc 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,149 @@
+/*
+ * 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:
+ * Hagen Seifert
+ * Co-authors:
+ * simonmie
+ *
+ */
+
+/**
+ @file HsW01.h
+ @brief Implementation of the HsW01 class.
+*/
+
+#include "BallGun.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"
+#include "weapons/projectiles/BallProjectile.h"
+
+namespace orxonox
+{
+ RegisterClass(BallGun);
+
+ BallGun::BallGun(Context* context) : WeaponMode(context)
+ {
+ RegisterObject(BallGun);
+
+ this->reloadTime_ = 0.25f;
+ this->damage_ = 10000; //default 15
+ this->speed_ = 100;
+ this->delay_ = 100;
+ this->setMunitionName("BallMunition");
+ this->mesh_ = "laserbeam.mesh";
+
+
+ this->delayTimer_.setTimer(this->delay_, false, createExecutor(createFunctor(&BallGun::shot, this)));
+ this->delayTimer_.stopTimer();
+
+ this->setFireSound("sounds/Weapon_HsW01.ogg");
+ this->setReloadSound("sounds/Reload_HsW01.ogg", 0.5);
+
+ hudImageString_ = "Orxonox/WSHUD_WM_HsW01";
+ }
+
+ BallGun::~BallGun()
+ {
+ }
+
+ void BallGun::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(BallGun, XMLPort, xmlelement, mode);
+
+ XMLPortParam(BallGun, "delay", setDelay, getDelay, xmlelement, mode);
+ XMLPortParam(BallGun, "material", setMaterial, getMaterial, xmlelement, mode);
+ XMLPortParam(BallGun, "projectileMesh", setMesh, getMesh, xmlelement, mode);
+ XMLPortParam(BallGun, "sound", setSound, getSound, xmlelement, mode);
+ }
+
+ /**
+ @brief
+ Set the firing delay.
+ @param delay
+ The firing delay in seconds.
+ */
+ void BallGun::setDelay(float delay)
+ {
+ orxout() << "delay" << endl;
+ this->delay_ = delay;
+ this->delayTimer_.setInterval(this->delay_);
+ }
+
+ void BallGun::fire()
+ {
+ this->delayTimer_.startTimer();
+ }
+
+ /**
+ @brief
+ Fires the weapon. Creates a projectile and fires it.
+ */
+ void BallGun::shot()
+ {
+ assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
+ // Create the projectile.
+ Projectile* projectile = new BallProjectile(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(this->getMuzzleOrientation());
+ projectile->setPosition(this->getMuzzlePosition());
+ projectile->setVelocity(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->BallGun::muzzleflash();
+ }
+
+ /**
+ @brief
+ Displays the muzzle flash.
+ */
+ void BallGun::muzzleflash()
+ {
+ MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext());
+ this->getWeapon()->attach(muzzleFlash);
+ muzzleFlash->setPosition(this->getMuzzleOffset());
+ muzzleFlash->setMaterial(this->material_);
+ }
+}
Copied: code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.h (from rev 12410, code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.h)
===================================================================
--- code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.h (rev 0)
+++ code/branches/Presentation_FS19/src/modules/weapons/weaponmodes/BallGun.h 2019-05-22 12:59:08 UTC (rev 12411)
@@ -0,0 +1,126 @@
+/*
+ * 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:
+ * Hagen Seifert
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file HsW01.h
+ @brief Definition of the HsW01 class.
+*/
+
+#ifndef _BallGun_H__
+#define _BallGun_H__
+
+#include "weapons/WeaponsPrereqs.h"
+
+#include "tools/Timer.h"
+#include "weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ Shoots laser beams.
+ @author
+ Hagen Seifert
+ @ingroup WeaponsWeaponModes
+ */
+ class _WeaponsExport BallGun : public WeaponMode
+ {
+ public:
+ BallGun(Context* context);
+ virtual ~BallGun();
+
+ virtual void fire() override;
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+ protected:
+ /**
+ @brief Set the mesh.
+ @param mesh The mesh name.
+ */
+ void setMesh(const std::string& mesh)
+ { this->mesh_ = mesh; }
+
+ /**
+ @brief Get the mesh.
+ @return Returns the mesh name.
+ */
+ const std::string& getMesh() const
+ { return this->mesh_; }
+
+ /**
+ @brief Set the sound.
+ @param sound The Sound name.
+ */
+ void setSound(const std::string& sound)
+ { this->sound_ = sound; }
+
+ /**
+ @brief Get the sound.
+ @return Returns the sound name.
+ */
+ const std::string& getSound() const
+ { return this->sound_; }
+
+ /**
+ @brief Set the material.
+ @param material The material name.
+ */
+ void setMaterial(const std::string& material)
+ { this->material_ = material; }
+ /**
+ @brief Get the material.
+ @return Returns the material name.
+ */
+ const std::string& getMaterial() const
+ { return this->material_; }
+
+ void setDelay(float delay);
+ /**
+ @brief Get the firing delay.
+ @return Returns the firing delay in seconds.
+ */
+ float getDelay() const
+ { return this->delay_; }
+
+ virtual void shot();
+ void muzzleflash();
+
+ std::string material_; //!< The material.
+ std::string mesh_; //!< The mesh.
+ std::string sound_; //!< The sound.
+
+
+
+ float speed_; //!< The speed of the fired projectile.
+ float delay_; //!< The firing delay.
+ Timer delayTimer_; //!< A timer to delay the firing.
+ };
+}
+
+#endif /* _HsW01_H__ */
More information about the Orxonox-commit
mailing list