[Orxonox-commit 6377] r11034 - in code/branches/presentationHS15: . data/levels data/levels/templates src/libraries/core/input src/modules/notifications/dispatchers src/modules/towerdefense src/orxonox/weaponsystem src/orxonox/worldentities/pawns
fvultier at orxonox.net
fvultier at orxonox.net
Mon Jan 4 10:13:21 CET 2016
Author: fvultier
Date: 2016-01-04 10:13:21 +0100 (Mon, 04 Jan 2016)
New Revision: 11034
Modified:
code/branches/presentationHS15/
code/branches/presentationHS15/data/levels/notifications.oxw
code/branches/presentationHS15/data/levels/templates/pickupRepresentationTemplates.oxt
code/branches/presentationHS15/src/libraries/core/input/KeyBinder.cc
code/branches/presentationHS15/src/libraries/core/input/KeyBinder.h
code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.cc
code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.h
code/branches/presentationHS15/src/modules/towerdefense/TowerDefenseTower.cc
code/branches/presentationHS15/src/orxonox/weaponsystem/Munition.cc
code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.h
Log:
Merge latest changes from fabienHS15 to presentationHS15.
Property changes on: code/branches/presentationHS15
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/AI_HS15:10640-10832
/code/branches/ParticleEffectsFS15:10309-10612
/code/branches/Racingbot:9388-9513
/code/branches/SciptableControllerFS15:10308-10613
/code/branches/ScriptableController:9999-10075
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/campaignHS15:10639-10973
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/clangenb:10385-10609
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/core7:10328-10623
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/explosionChunksHS15:10641-10961
/code/branches/fabienHS15:10685-10960
/code/branches/formation:8885-8991
/code/branches/formationFS15:10320-10610
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hoverHS15:10633-10959
/code/branches/hud:8883-8986
/code/branches/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/code/branches/multiplayerFS15:10324-10611
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particleEffectsHS15:10644-10962
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/pickupsFS14:10000-10259
/code/branches/planetLevelHS15:10637-10966
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationFS15:10499
/code/branches/presentationFS15merge:10595-10621
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10614
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weaponFS15:10302-10615
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237
+ /code/branches/AI_HS15:10640-10832
/code/branches/ParticleEffectsFS15:10309-10612
/code/branches/Racingbot:9388-9513
/code/branches/SciptableControllerFS15:10308-10613
/code/branches/ScriptableController:9999-10075
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/campaignHS15:10639-10973
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/clangenb:10385-10609
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/core7:10328-10623
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/explosionChunksHS15:10641-10961
/code/branches/fabienHS15:10685-11033
/code/branches/formation:8885-8991
/code/branches/formationFS15:10320-10610
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hoverHS15:10633-10959
/code/branches/hud:8883-8986
/code/branches/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/code/branches/multiplayerFS15:10324-10611
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particleEffectsHS15:10644-10962
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/pickupsFS14:10000-10259
/code/branches/planetLevelHS15:10637-10966
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationFS15:10499
/code/branches/presentationFS15merge:10595-10621
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10614
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weaponFS15:10302-10615
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237
Modified: code/branches/presentationHS15/data/levels/notifications.oxw
===================================================================
--- code/branches/presentationHS15/data/levels/notifications.oxw 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/data/levels/notifications.oxw 2016-01-04 09:13:21 UTC (rev 11034)
@@ -18,14 +18,27 @@
</templates>
<?lua include("includes/notifications.oxi") ?>
+ <NotificationQueueCEGUI
+ name="narrative"
+ targets="simpleNotification,commandNotification"
+ size=3
+ displayTime=3.9
+ position="0.2, 0, 0.1, 0"
+ fontSize="23"
+ fontColor="0.3, 1, 0.2, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.6, 0, 0, 0"
+ />
+
<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" />
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
- <CommandNotification preMessage="Open the PickupInventory by pressing '" postMessage="'." command="OrxonoxOverlay toggleVisibility PickupInventory">
+ <CommandNotification preMessage="Open the PickupInventory by pressing '" postMessage="'." command="OrxonoxOverlay show PickupInventory">
<events>
<trigger>
<DistanceTrigger name=trigger position="0,0,-100" distance=10 target="Pawn" />
@@ -43,11 +56,5 @@
</SimpleNotification>
<Billboard position="0,0,100" colour="1.0,0,1.0" material="Examples/Flare" />
- <?lua
- for i = 1, 10, 1 do
- ?>
- <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
- <?lua end ?>
-
</Scene>
</Level>
Modified: code/branches/presentationHS15/data/levels/templates/pickupRepresentationTemplates.oxt
===================================================================
--- code/branches/presentationHS15/data/levels/templates/pickupRepresentationTemplates.oxt 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/data/levels/templates/pickupRepresentationTemplates.oxt 2016-01-04 09:13:21 UTC (rev 11034)
@@ -325,8 +325,10 @@
<MunitionContainer munitiontype="LightningMunition" munitionamount=16 magazinesamount=0 />
<MunitionContainer munitiontype="SplitMunition" munitionamount=8 magazinesamount=0 />
<MunitionContainer munitiontype="RocketMunition" munitionamount=0 magazinesamount=2 />
+ <MunitionContainer munitiontype="MineMunition" munitionamount=0 magazinesamount=2 />
</munitioncontainers>
- </MunitionPickup></Template>
+ </MunitionPickup>
+</Template>
<Template name=hugemunitionpickupRepresentation>
<PickupRepresentation>
@@ -358,6 +360,7 @@
<MunitionContainer munitiontype="RocketMunition" munitionamount=0 magazinesamount=10 />
<MunitionContainer munitiontype="IceMunition" munitionamount=0 magazinesamount=10 />
<MunitionContainer munitiontype="GravityBombMunition" munitionamount=0 magazinesamount=10 />
+ <MunitionContainer munitiontype="MineMunition" munitionamount=0 magazinesamount=10 />
</munitioncontainers>
</MunitionPickup>
</Template>
Modified: code/branches/presentationHS15/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/branches/presentationHS15/src/libraries/core/input/KeyBinder.cc 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/libraries/core/input/KeyBinder.cc 2016-01-04 09:13:21 UTC (rev 11034)
@@ -358,6 +358,46 @@
/**
@brief
+ Return the first key name for a specific command in a human readable form
+ */
+ const std::string& KeyBinder::getBindingReadable(const std::string& commandName)
+ {
+ const std::string& binding = this->getBinding(commandName);
+
+ SubString substring = SubString(binding, ".");
+ std::string name;
+ std::string group;
+ switch(substring.size())
+ {
+ case 0:
+ return binding;
+ case 1:
+ return binding;
+ case 2:
+ group = substring[0];
+ default:
+ name = substring.subSet(1).join(".");
+ }
+
+ std::stringstream stream;
+ if(group.compare("Keys") == 0)
+ stream << "Key " << name.substr(3);
+ else if(group.compare("MouseButtons") == 0)
+ stream << "Mouse " << name;
+ else if(group.compare("JoyStickButtons") == 0)
+ stream << "Joystick " << name;
+ else if(group.compare("JoyStickAxes") == 0)
+ stream << "Joystick Axis" << name.substr(5, 6) << name.substr(name.find("Axis")+6);
+ else if(group.compare("MouseAxes") == 0)
+ stream << "Mouse " << name.substr(1,3) << " " << name.substr(0, 1) << "-Axis";
+ else
+ return binding;
+
+ return *(new std::string(stream.str()));
+ }
+
+ /**
+ @brief
Get the number of different key bindings of a specific command.
@param commandName
The command.
Modified: code/branches/presentationHS15/src/libraries/core/input/KeyBinder.h
===================================================================
--- code/branches/presentationHS15/src/libraries/core/input/KeyBinder.h 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/libraries/core/input/KeyBinder.h 2016-01-04 09:13:21 UTC (rev 11034)
@@ -67,6 +67,7 @@
bool setBinding(const std::string& binding, const std::string& name, bool bTemporary = false);
const std::string& getBinding(const std::string& commandName); //tolua_export
const std::string& getBinding(const std::string& commandName, unsigned int index); //tolua_export
+ const std::string& getBindingReadable(const std::string& commandName); //tolua_export
unsigned int getNumberOfBindings(const std::string& commandName); //tolua_export
const std::string& getBindingsFilename()
Modified: code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.cc
===================================================================
--- code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.cc 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.cc 2016-01-04 09:13:21 UTC (rev 11034)
@@ -100,52 +100,8 @@
{
std::stringstream stream;
stream << this->getPreMessage();
- stream << this->bindingNiceifyer(KeyBinderManager::getInstance().getCurrent()->getBinding(this->getCommand()));
+ stream << KeyBinderManager::getInstance().getCurrent()->getBindingReadable(this->getCommand());
stream << this->getPostMessage();
return *(new std::string(stream.str()));
}
-
- /**
- @brief
- Transforms the input binding into a human readable form.
- @param binding
- The binding to be transformed
- @return
- Returns a human readable version of the input binding.
- */
- //TODO: Move to KeyBinderManager...
- const std::string& CommandNotification::bindingNiceifyer(const std::string& binding)
- {
- SubString substring = SubString(binding, ".");
- std::string name;
- std::string group;
- switch(substring.size())
- {
- case 0:
- return binding;
- case 1:
- return binding;
- case 2:
- group = substring[0];
- default:
- name = substring.subSet(1).join(".");
- }
-
- std::stringstream stream;
- if(group.compare("Keys") == 0)
- stream << "Key " << name.substr(3);
- else if(group.compare("MouseButtons") == 0)
- stream << "Mouse " << name;
- else if(group.compare("JoyStickButtons") == 0)
- stream << "Joystick " << name;
- else if(group.compare("JoyStickAxes") == 0)
- stream << "Joystick Axis" << name.substr(5, 6) << name.substr(name.find("Axis")+6);
- else if(group.compare("MouseAxes") == 0)
- stream << "Mouse " << name.substr(1,3) << " " << name.substr(0, 1) << "-Axis";
- else
- return binding;
-
- return *(new std::string(stream.str()));
- }
-
-}
+}
\ No newline at end of file
Modified: code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.h
===================================================================
--- code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.h 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/modules/notifications/dispatchers/CommandNotification.h 2016-01-04 09:13:21 UTC (rev 11034)
@@ -121,9 +121,6 @@
*/
void setPostMessage(const std::string& message)
{ this->postMessage_ = message; }
-
- const std::string& bindingNiceifyer(const std::string& binding); //!< Transforms the input binding into a human readable form.
-
};
}
Modified: code/branches/presentationHS15/src/modules/towerdefense/TowerDefenseTower.cc
===================================================================
--- code/branches/presentationHS15/src/modules/towerdefense/TowerDefenseTower.cc 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/modules/towerdefense/TowerDefenseTower.cc 2016-01-04 09:13:21 UTC (rev 11034)
@@ -61,6 +61,7 @@
{
upgrade++;
this->setDamageMultiplier((upgrade+1)*2.0f);
+
//this->setRotationThrust(2*this->getRotationThrust());
//this->addTemplate("towerturret1");
}
Modified: code/branches/presentationHS15/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/branches/presentationHS15/src/orxonox/weaponsystem/Munition.cc 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/orxonox/weaponsystem/Munition.cc 2016-01-04 09:13:21 UTC (rev 11034)
@@ -541,7 +541,7 @@
this->munition_ = 0;
this->bLoaded_ = false;
- if (bUseReloadTime && munition->reloadTime_ > 0 && !munition->deployment_ == MunitionDeployment::Stack)
+ if (bUseReloadTime && munition->reloadTime_ > 0 && munition->deployment_ != MunitionDeployment::Stack)
{
const ExecutorPtr& executor = createExecutor(createFunctor(&Magazine::loaded, this));
executor->setDefaultValues(munition);
Modified: code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc 2016-01-04 09:13:21 UTC (rev 11034)
@@ -33,6 +33,7 @@
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
#include "network/NetworkFunction.h"
#include "infos/PlayerInfo.h"
@@ -61,6 +62,7 @@
RegisterObject(Pawn);
this->bAlive_ = true;
+ this->bVulnerable_ = true;
this->health_ = 0;
this->maxHealth_ = 0;
@@ -135,6 +137,8 @@
XMLPortParam(Pawn, "maxshieldhealth", setMaxShieldHealth, getMaxShieldHealth, xmlelement, mode).defaultValues(100);
XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0);
+ XMLPortParam(Pawn, "vulnerable", setVulnerable, isVulnerable, xmlelement, mode).defaultValues(true);
+
XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(0);
@@ -144,15 +148,22 @@
XMLPortObject(Pawn, WeaponPack, "weaponpacks", addWeaponPackXML, getWeaponPack, xmlelement, mode);
XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode);
+ XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);
XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);
- XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
XMLPortParam(Pawn, "explosionSound", setExplosionSound, getExplosionSound, xmlelement, mode);
XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
}
+ void Pawn::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(Pawn, XMLEventPort, xmlelement, mode);
+
+ XMLPortEventState(Pawn, BaseObject, "vulnerability", setVulnerable, xmlelement, mode);
+ }
+
void Pawn::registerVariables()
{
registerVariable(this->bAlive_, VariableDirection::ToClient);
@@ -245,8 +256,19 @@
this->shieldRechargeWaitCountdown_ -= dt;
}
+ void Pawn::changedVulnerability()
+ {
+
+ }
+
void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
{
+ // A pawn can only get damaged if it is vulnerable
+ if (!isVulnerable())
+ {
+ return;
+ }
+
// Applies multiplier given by the DamageBoost Pickup.
if (originator)
damage *= originator->getDamageMultiplier();
@@ -581,4 +603,4 @@
assert(0);
return BLANKSTRING;
}
-}
+}
\ No newline at end of file
Modified: code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.h 2016-01-04 08:25:33 UTC (rev 11033)
+++ code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.h 2016-01-04 09:13:21 UTC (rev 11034)
@@ -63,6 +63,7 @@
virtual ~Pawn();
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
virtual void tick(float dt);
inline bool isAlive() const
@@ -133,6 +134,20 @@
virtual void decreaseShieldRechargeCountdownTime(float dt);
+ /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */
+ inline void setVulnerable(bool bVulnerable)
+ {
+ if (this->bVulnerable_ != bVulnerable)
+ {
+ this->bVulnerable_ = bVulnerable;
+ this->changedVulnerability();
+ }
+ }
+ /** @brief Returns the state of the pawns vulnerability. @return The state of the vulnerability */
+ inline const bool& isVulnerable() const { return this->bVulnerable_; }
+ /** @brief This function gets called if the vulnerability of the pawn changes. */
+ virtual void changedVulnerability();
+
inline ControllableEntity* getLastHitOriginator() const
{ return this->lastHitOriginator_; }
@@ -218,6 +233,7 @@
virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
bool bAlive_;
+ bool bVulnerable_; ///< If false the pawn may not ged damaged
virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
{ return new std::vector<PickupCarrier*>(); }
More information about the Orxonox-commit
mailing list