[Orxonox-commit 6395] r11052 - in code/trunk: . data/defaultConfig data/gui/layouts data/gui/scripts data/levels data/levels/includes data/levels/templates data/overlays data/particle src/libraries/core src/libraries/core/command src/libraries/core/commandline src/libraries/core/input src/libraries/core/singleton src/libraries/network src/libraries/tools src/libraries/util src/modules src/modules/docking src/modules/dodgerace src/modules/invader src/modules/notifications/dispatchers src/modules/objects src/modules/overlays src/modules/overlays/hud src/modules/pickup src/modules/pickup/items src/modules/towerdefense src/modules/weapons src/modules/weapons/munitions src/modules/weapons/projectiles src/modules/weapons/weaponmodes src/orxonox src/orxonox/controllers src/orxonox/gametypes src/orxonox/infos src/orxonox/items src/orxonox/overlays src/orxonox/weaponsystem src/orxonox/worldentities src/orxonox/worldentities/pawns test/core/class test/util
landauf at orxonox.net
landauf at orxonox.net
Sat Jan 9 18:26:20 CET 2016
Author: landauf
Date: 2016-01-09 18:26:20 +0100 (Sat, 09 Jan 2016)
New Revision: 11052
Added:
code/trunk/data/levels/AITest.oxw
code/trunk/data/levels/Hover.oxw
code/trunk/data/levels/expeditionSector.oxw
code/trunk/data/levels/includes/weaponSettingsEscortMine.oxi
code/trunk/data/levels/includes/weaponSettingsHover.oxi
code/trunk/data/levels/mineLevel.oxw
code/trunk/data/levels/planetLevelHS15.oxw
code/trunk/data/levels/shuttleAttack.oxw
code/trunk/data/levels/shuttleRetaliation.oxw
code/trunk/data/levels/templates/spaceshipEscortMine.oxt
code/trunk/data/levels/templates/spaceshipHover.oxt
code/trunk/data/levels/templates/spaceshipShuttle.oxt
code/trunk/data/overlays/HoverHUD.oxo
code/trunk/data/particle/MineExpl.particle
code/trunk/data/particle/MineExpl1.particle
code/trunk/data/particle/MineExpl2.particle
code/trunk/data/particle/engine.particle
code/trunk/data/particle/ice.particle
code/trunk/data/particle/mineparticle.particle
code/trunk/data/particle/psygun.particle
code/trunk/src/modules/hover/
code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc
code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h
code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc
code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h
code/trunk/src/modules/overlays/hud/HUDShieldBar.cc
code/trunk/src/modules/overlays/hud/HUDShieldBar.h
code/trunk/src/modules/overlays/hud/HUDWeapon.cc
code/trunk/src/modules/overlays/hud/HUDWeapon.h
code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc
code/trunk/src/modules/overlays/hud/HUDWeaponMode.h
code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc
code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h
code/trunk/src/modules/pickup/items/BoostPickup.cc
code/trunk/src/modules/pickup/items/BoostPickup.h
code/trunk/src/modules/pickup/items/MunitionContainer.cc
code/trunk/src/modules/pickup/items/MunitionContainer.h
code/trunk/src/modules/pickup/items/MunitionPickup.cc
code/trunk/src/modules/pickup/items/MunitionPickup.h
code/trunk/src/modules/weapons/munitions/LightningMunition.cc
code/trunk/src/modules/weapons/munitions/LightningMunition.h
code/trunk/src/modules/weapons/munitions/MineMunition.cc
code/trunk/src/modules/weapons/munitions/MineMunition.h
code/trunk/src/modules/weapons/projectiles/MineProjectile.cc
code/trunk/src/modules/weapons/projectiles/MineProjectile.h
code/trunk/src/modules/weapons/weaponmodes/MineGun.cc
code/trunk/src/modules/weapons/weaponmodes/MineGun.h
code/trunk/src/orxonox/controllers/ActionpointController.cc
code/trunk/src/orxonox/controllers/ActionpointController.h
code/trunk/src/orxonox/controllers/CommonController.cc
code/trunk/src/orxonox/controllers/CommonController.h
code/trunk/src/orxonox/controllers/DivisionController.cc
code/trunk/src/orxonox/controllers/DivisionController.h
code/trunk/src/orxonox/controllers/FightingController.cc
code/trunk/src/orxonox/controllers/FightingController.h
code/trunk/src/orxonox/controllers/FlyingController.cc
code/trunk/src/orxonox/controllers/FlyingController.h
code/trunk/src/orxonox/controllers/MasterController.cc
code/trunk/src/orxonox/controllers/MasterController.h
code/trunk/src/orxonox/controllers/SectionController.cc
code/trunk/src/orxonox/controllers/SectionController.h
code/trunk/src/orxonox/controllers/WingmanController.cc
code/trunk/src/orxonox/controllers/WingmanController.h
code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.cc
code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h
code/trunk/src/orxonox/worldentities/Actionpoint.cc
code/trunk/src/orxonox/worldentities/Actionpoint.h
code/trunk/src/orxonox/worldentities/ExplosionPart.cc
code/trunk/src/orxonox/worldentities/ExplosionPart.h
Removed:
code/trunk/data/levels/includes/towerWeaponSettings.oxi
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h
code/trunk/src/orxonox/worldentities/BigExplosion.cc
code/trunk/src/orxonox/worldentities/BigExplosion.h
Modified:
code/trunk/
code/trunk/data/defaultConfig/orxonox.ini
code/trunk/data/gui/layouts/CampaignMenu.layout
code/trunk/data/gui/layouts/InGameMenu.layout
code/trunk/data/gui/scripts/CampaignMenu.lua
code/trunk/data/gui/scripts/InGameMenu.lua
code/trunk/data/gui/scripts/SheetManager.lua
code/trunk/data/levels/FPS_Level_HS14.oxw
code/trunk/data/levels/HeavyCruiser.oxw
code/trunk/data/levels/emptyLevel.oxw
code/trunk/data/levels/iJohnVane_TriptoArea51.oxw
code/trunk/data/levels/iiiJohnVane_EscapeTheBastards.oxw
code/trunk/data/levels/includes/invaderWeapon.oxi
code/trunk/data/levels/includes/invaderWeaponEnemy.oxi
code/trunk/data/levels/includes/pickups.oxi
code/trunk/data/levels/includes/weaponSettingsAssff.oxi
code/trunk/data/levels/includes/weaponSettingsAssff2.oxi
code/trunk/data/levels/includes/weaponSettingsCollateral.oxi
code/trunk/data/levels/includes/weaponSettingsEscort.oxi
code/trunk/data/levels/includes/weaponSettingsFPS.oxi
code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi
code/trunk/data/levels/includes/weaponSettingsFS15.oxi
code/trunk/data/levels/includes/weaponSettingsGhost.oxi
code/trunk/data/levels/includes/weaponSettingsH2.oxi
code/trunk/data/levels/includes/weaponSettingsHXY.oxi
code/trunk/data/levels/includes/weaponSettingsHeartAttack.oxi
code/trunk/data/levels/includes/weaponSettingsHeavyCruiser.oxi
code/trunk/data/levels/includes/weaponSettingsHeavyCruiserBody.oxi
code/trunk/data/levels/includes/weaponSettingsImmTest.oxi
code/trunk/data/levels/includes/weaponSettingsPirate.oxi
code/trunk/data/levels/includes/weaponSettingsRing.oxi
code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
code/trunk/data/levels/includes/weaponSettingsSwallow.oxi
code/trunk/data/levels/includes/weaponSettingsTransporter.oxi
code/trunk/data/levels/includes/weaponSettingsTurret.oxi
code/trunk/data/levels/includes/weaponSettingsTurret1.oxi
code/trunk/data/levels/includes/weaponSettingsbigship.oxi
code/trunk/data/levels/kecks.oxw
code/trunk/data/levels/missionOne.oxw
code/trunk/data/levels/notifications.oxw
code/trunk/data/levels/pickups.oxw
code/trunk/data/levels/presentationHS13.oxw
code/trunk/data/levels/shieldTest.oxw
code/trunk/data/levels/templates/FPS.oxt
code/trunk/data/levels/templates/FPS_HS14.oxt
code/trunk/data/levels/templates/HeavyCruiser.oxt
code/trunk/data/levels/templates/HeavyCruiserBody.oxt
code/trunk/data/levels/templates/ModularSpaceShipTest.oxt
code/trunk/data/levels/templates/bigship.oxt
code/trunk/data/levels/templates/enemyInvader.oxt
code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt
code/trunk/data/levels/templates/spaceshipAssff.oxt
code/trunk/data/levels/templates/spaceshipAssff2.oxt
code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt
code/trunk/data/levels/templates/spaceshipDodgeRace.oxt
code/trunk/data/levels/templates/spaceshipEscort.oxt
code/trunk/data/levels/templates/spaceshipGhost.oxt
code/trunk/data/levels/templates/spaceshipH2.oxt
code/trunk/data/levels/templates/spaceshipHXY.oxt
code/trunk/data/levels/templates/spaceshipHXYSL.oxt
code/trunk/data/levels/templates/spaceshipHeartAttack.oxt
code/trunk/data/levels/templates/spaceshipInvader.oxt
code/trunk/data/levels/templates/spaceshipPirate.oxt
code/trunk/data/levels/templates/spaceshipRace.oxt
code/trunk/data/levels/templates/spaceshipRing.oxt
code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
code/trunk/data/levels/templates/spaceshipSwallow.oxt
code/trunk/data/levels/templates/spaceshipTransporter.oxt
code/trunk/data/levels/templates/spaceshipTransporterSL.oxt
code/trunk/data/levels/templates/spaceshipTurret.oxt
code/trunk/data/levels/templates/towerdefensetower.oxt
code/trunk/data/levels/towerDefense.oxw
code/trunk/data/overlays/HUDTemplates3.oxo
code/trunk/data/overlays/InvaderHUD.oxo
code/trunk/data/overlays/jumpHUD.oxo
code/trunk/data/particle/engineglow.particle
code/trunk/data/particle/rocketfire.particle
code/trunk/src/libraries/core/CoreConfig.cc
code/trunk/src/libraries/core/CoreConfig.h
code/trunk/src/libraries/core/GUIManager.cc
code/trunk/src/libraries/core/GUIManager.h
code/trunk/src/libraries/core/GameConfig.cc
code/trunk/src/libraries/core/GameConfig.h
code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.h
code/trunk/src/libraries/core/command/ConsoleCommandIncludes.cc
code/trunk/src/libraries/core/command/ConsoleCommandManager.cc
code/trunk/src/libraries/core/commandline/CMakeLists.txt
code/trunk/src/libraries/core/input/KeyBinder.cc
code/trunk/src/libraries/core/input/KeyBinder.h
code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.cc
code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h
code/trunk/src/libraries/network/NetworkFunctionIncludes.cc
code/trunk/src/libraries/network/NetworkFunctionIncludes.h
code/trunk/src/libraries/network/NetworkFunctionManager.cc
code/trunk/src/libraries/network/NetworkFunctionManager.h
code/trunk/src/libraries/tools/ParticleInterface.cc
code/trunk/src/libraries/tools/ParticleInterface.h
code/trunk/src/libraries/util/Math.cc
code/trunk/src/libraries/util/Math.h
code/trunk/src/modules/CMakeLists.txt
code/trunk/src/modules/docking/DockingController.cc
code/trunk/src/modules/dodgerace/DodgeRace.cc
code/trunk/src/modules/dodgerace/DodgeRace.h
code/trunk/src/modules/invader/Invader.cc
code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc
code/trunk/src/modules/notifications/dispatchers/CommandNotification.h
code/trunk/src/modules/objects/Turret.h
code/trunk/src/modules/overlays/OverlaysPrereqs.h
code/trunk/src/modules/overlays/hud/CMakeLists.txt
code/trunk/src/modules/overlays/hud/HUDBar.cc
code/trunk/src/modules/overlays/hud/HUDBar.h
code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
code/trunk/src/modules/overlays/hud/HUDHealthBar.cc
code/trunk/src/modules/overlays/hud/HUDHealthBar.h
code/trunk/src/modules/overlays/hud/HUDRadar.cc
code/trunk/src/modules/pickup/PickupPrereqs.h
code/trunk/src/modules/pickup/PickupRepresentation.cc
code/trunk/src/modules/pickup/items/CMakeLists.txt
code/trunk/src/modules/pickup/items/DronePickup.h
code/trunk/src/modules/towerdefense/TowerDefenseField.cc
code/trunk/src/modules/towerdefense/TowerDefenseField.h
code/trunk/src/modules/towerdefense/TowerDefenseSelecter.cc
code/trunk/src/modules/towerdefense/TowerDefenseTower.cc
code/trunk/src/modules/weapons/IceGunFreezer.cc
code/trunk/src/modules/weapons/IceGunFreezer.h
code/trunk/src/modules/weapons/WeaponsPrereqs.h
code/trunk/src/modules/weapons/munitions/CMakeLists.txt
code/trunk/src/modules/weapons/munitions/FusionMunition.cc
code/trunk/src/modules/weapons/munitions/FusionMunition.h
code/trunk/src/modules/weapons/munitions/GravityBombMunition.cc
code/trunk/src/modules/weapons/munitions/GravityBombMunition.h
code/trunk/src/modules/weapons/munitions/IceMunition.cc
code/trunk/src/modules/weapons/munitions/IceMunition.h
code/trunk/src/modules/weapons/munitions/LaserMunition.cc
code/trunk/src/modules/weapons/munitions/LaserMunition.h
code/trunk/src/modules/weapons/munitions/RocketMunition.cc
code/trunk/src/modules/weapons/munitions/RocketMunition.h
code/trunk/src/modules/weapons/munitions/SplitMunition.cc
code/trunk/src/modules/weapons/munitions/SplitMunition.h
code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
code/trunk/src/modules/weapons/projectiles/CMakeLists.txt
code/trunk/src/modules/weapons/projectiles/GravityBombField.cc
code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc
code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h
code/trunk/src/modules/weapons/projectiles/Projectile.h
code/trunk/src/modules/weapons/projectiles/Rocket.cc
code/trunk/src/modules/weapons/projectiles/Rocket.h
code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.cc
code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.h
code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.cc
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
code/trunk/src/modules/weapons/weaponmodes/IceGun.cc
code/trunk/src/modules/weapons/weaponmodes/IceGun.h
code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
code/trunk/src/modules/weapons/weaponmodes/RocketFire.h
code/trunk/src/modules/weapons/weaponmodes/RocketFireOld.cc
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc
code/trunk/src/modules/weapons/weaponmodes/SplitGun.h
code/trunk/src/orxonox/OrxonoxPrereqs.h
code/trunk/src/orxonox/controllers/ArtificialController.cc
code/trunk/src/orxonox/controllers/CMakeLists.txt
code/trunk/src/orxonox/controllers/FormationController.cc
code/trunk/src/orxonox/controllers/HumanController.cc
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
code/trunk/src/orxonox/gametypes/Dynamicmatch.h
code/trunk/src/orxonox/infos/PlayerInfo.cc
code/trunk/src/orxonox/items/ShipPart.cc
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
code/trunk/src/orxonox/overlays/OverlayGroup.cc
code/trunk/src/orxonox/weaponsystem/CMakeLists.txt
code/trunk/src/orxonox/weaponsystem/Munition.cc
code/trunk/src/orxonox/weaponsystem/Munition.h
code/trunk/src/orxonox/weaponsystem/Weapon.cc
code/trunk/src/orxonox/weaponsystem/Weapon.h
code/trunk/src/orxonox/weaponsystem/WeaponMode.cc
code/trunk/src/orxonox/weaponsystem/WeaponMode.h
code/trunk/src/orxonox/weaponsystem/WeaponPack.cc
code/trunk/src/orxonox/weaponsystem/WeaponPack.h
code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc
code/trunk/src/orxonox/weaponsystem/WeaponSystem.h
code/trunk/src/orxonox/worldentities/CMakeLists.txt
code/trunk/src/orxonox/worldentities/MobileEntity.h
code/trunk/src/orxonox/worldentities/SpawnPoint.h
code/trunk/src/orxonox/worldentities/StaticEntity.h
code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc
code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc
code/trunk/test/util/MathTest.cc
Log:
merged branch presentationHS15 back to trunk
Property changes on: code/trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /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/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/cpp11_v2:10995
/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/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/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/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/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/soundEffects:9382-11020
/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/cpp11_v2:10995
/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/presentationHS15:10959-11051
/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/soundEffects:9382-11020
/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/trunk/data/defaultConfig/orxonox.ini
===================================================================
--- code/trunk/data/defaultConfig/orxonox.ini 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/defaultConfig/orxonox.ini 2016-01-09 17:26:20 UTC (rev 11052)
@@ -3,3 +3,8 @@
campaignMissions_[1] = "fightInOurBack.oxw"
campaignMissions_[2] = "pirateAttack.oxw"
campaignMissions_[3] = "iJohnVane_TriptoArea51.oxw"
+campaignMissions_[4] = "iiJohnVane_Area51UnderFire.oxw"
+campaignMissions_[5] = "iiiJohnVane_EscapeTheBastards.oxw"
+campaignMissions_[6] = "expeditionSector.oxw"
+campaignMissions_[7] = "shuttleAttack.oxw"
+campaignMissions_[8] = "shuttleRetaliation.oxw"
Modified: code/trunk/data/gui/layouts/CampaignMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/CampaignMenu.layout 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/gui/layouts/CampaignMenu.layout 2016-01-09 17:26:20 UTC (rev 11052)
@@ -7,41 +7,83 @@
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1.0,0},{1.0,0}}" />
<Property Name="BackgroundEnabled" Value="False" />
- <Window Type="MenuWidgets/Button" Name="orxonox/MissionOneButton" >
- <Property Name="Text" Value="Mission 1" />
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission1Button" >
+ <Property Name="Text" Value="Mission One" />
<Property Name="Visible" Value="False"/>
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.2875,0},{0.6,0},{0.3375,0}}" />
- <Event Name="Clicked" Function="CampaignMenu.MissionOneButton_clicked"/>
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.1,0},{0.65,0},{0.15,0}}" />
+ <Event Name="Clicked" Function="CampaignMenu.Mission1Button_clicked"/>
</Window>
- <Window Type="MenuWidgets/Button" Name="orxonox/MissionTwoButton" >
- <Property Name="Text" Value="Mission 2" />
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission2Button" >
+ <Property Name="Text" Value="Fight in our Back" />
<Property Name="Visible" Value="False"/>
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.3625,0},{0.6,0},{0.4125,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.18,0},{0.65,0},{0.23,0}}" />
<Property Name="Disabled" Value="True" />
- <Event Name="Clicked" Function="CampaignMenu.MissionTwoButton_clicked"/>
+ <Event Name="Clicked" Function="CampaignMenu.Mission2Button_clicked"/>
</Window>
- <Window Type="MenuWidgets/Button" Name="orxonox/MissionThreeButton" >
- <Property Name="Text" Value="Mission 3" />
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission3Button" >
+ <Property Name="Text" Value="Pirate Attack" />
<Property Name="Visible" Value="False"/>
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4375,0},{0.6,0},{0.4875,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.26,0},{0.65,0},{0.31,0}}" />
<Property Name="Disabled" Value="True" />
- <Event Name="Clicked" Function="CampaignMenu.MissionThreeButton_clicked"/>
+ <Event Name="Clicked" Function="CampaignMenu.Mission3Button_clicked"/>
</Window>
- <Window Type="MenuWidgets/Button" Name="orxonox/MissionFourButton" >
- <Property Name="Text" Value="Mission 4" />
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission4Button" >
+ <Property Name="Text" Value="Trip to Area 51" />
<Property Name="Visible" Value="False"/>
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.5125,0},{0.6,0},{0.5625,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.34,0},{0.65,0},{0.39,0}}" />
<Property Name="Disabled" Value="True" />
- <Event Name="Clicked" Function="CampaignMenu.MissionFourButton_clicked"/>
+ <Event Name="Clicked" Function="CampaignMenu.Mission4Button_clicked"/>
</Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission5Button" >
+ <Property Name="Text" Value="Area 51 under Fire" />
+ <Property Name="Visible" Value="False"/>
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.42,0},{0.65,0},{0.47,0}}" />
+ <Property Name="Disabled" Value="True" />
+ <Event Name="Clicked" Function="CampaignMenu.Mission5Button_clicked"/>
+ </Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission6Button" >
+ <Property Name="Text" Value="Escape the Bastards" />
+ <Property Name="Visible" Value="False"/>
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.50,0},{0.65,0},{0.55,0}}" />
+ <Property Name="Disabled" Value="True" />
+ <Event Name="Clicked" Function="CampaignMenu.Mission6Button_clicked"/>
+ </Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission7Button" >
+ <Property Name="Text" Value="Expedition to Sector 5C" />
+ <Property Name="Visible" Value="False"/>
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.58,0},{0.65,0},{0.63,0}}" />
+ <Property Name="Disabled" Value="True" />
+ <Event Name="Clicked" Function="CampaignMenu.Mission7Button_clicked"/>
+ </Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission8Button" >
+ <Property Name="Text" Value="Shuttle under Attack" />
+ <Property Name="Visible" Value="False"/>
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.66,0},{0.65,0},{0.71,0}}" />
+ <Property Name="Disabled" Value="True" />
+ <Event Name="Clicked" Function="CampaignMenu.Mission8Button_clicked"/>
+ </Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/Mission9Button" >
+ <Property Name="Text" Value="Retaliation" />
+ <Property Name="Visible" Value="False"/>
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.74,0},{0.65,0},{0.79,0}}" />
+ <Property Name="Disabled" Value="True" />
+ <Event Name="Clicked" Function="CampaignMenu.Mission9Button_clicked"/>
+ </Window>
+
+
<Window Type="MenuWidgets/Button" Name="orxonox/CampaignMenuBackButton" >
<Property Name="Text" Value="Back" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.8,0},{0.6,0},{0.85,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.85,0},{0.65,0},{0.9,0}}" />
<Event Name="Clicked" Function="CampaignMenu.CampaignMenuBackButton_clicked"/>
</Window>
<Window Type="MenuWidgets/StaticText" Name="orxonox/CampaignMenuCongratulation" >
Modified: code/trunk/data/gui/layouts/InGameMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/InGameMenu.layout 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/gui/layouts/InGameMenu.layout 2016-01-09 17:26:20 UTC (rev 11052)
@@ -8,28 +8,35 @@
<Window Type="MenuWidgets/Button" Name="orxonox/InGameMenu_ReturnButton" >
<Property Name="Text" Value="Return to Game" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.3625,0},{0.6,0},{0.4125,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.2875,0},{0.6,0},{0.3375,0}}" />
<Property Name="Alpha" Value="0.9" />
<Event Name="Clicked" Function="InGameMenu.button_return_clicked"/>
</Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/InGameMenu_ReloadLevelButton" >
+ <Property Name="Text" Value="Reload level" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.3625,0},{0.6,0},{0.4125,0}}" />
+ <Property Name="Alpha" Value="0.9" />
+ <Event Name="Clicked" Function="InGameMenu.button_reloadLevel_clicked"/>
+ </Window>
<Window Type="MenuWidgets/Button" Name="orxonox/InGameMenu_MainMenuButton" >
<Property Name="Text" Value="Main Menu" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4625,0},{0.6,0},{0.5125,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4375,0},{0.6,0},{0.4875,0}}" />
<Property Name="Alpha" Value="0.9" />
<Event Name="Clicked" Function="InGameMenu.button_mainmenu_clicked"/>
</Window>
<Window Type="MenuWidgets/Button" Name="orxonox/InGameMenu_SettingsButton" >
<Property Name="Text" Value="Settings" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.5625,0},{0.6,0},{0.6125,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.5125,0},{0.6,0},{0.5625,0}}" />
<Property Name="Alpha" Value="0.9" />
<Event Name="Clicked" Function="InGameMenu.button_settings_clicked"/>
</Window>
<Window Type="MenuWidgets/Button" Name="orxonox/InGameMenu_QuitButton" >
<Property Name="Text" Value="Quit" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.6625,0},{0.6,0},{0.7125,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.5875,0},{0.6,0},{0.6375,0}}" />
<Property Name="Alpha" Value="0.9" />
<Event Name="Clicked" Function="InGameMenu.button_quit_clicked"/>
</Window>
Modified: code/trunk/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/CampaignMenu.lua 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/gui/scripts/CampaignMenu.lua 2016-01-09 17:26:20 UTC (rev 11052)
@@ -7,11 +7,17 @@
end
function P.updateButtons()
- P.updateButton(0, winMgr:getWindow("orxonox/MissionOneButton"))
- P.updateButton(1, winMgr:getWindow("orxonox/MissionTwoButton"))
- P.updateButton(2, winMgr:getWindow("orxonox/MissionThreeButton"))
- P.updateButton(3, winMgr:getWindow("orxonox/MissionFourButton"))
+ P.updateButton(0, winMgr:getWindow("orxonox/Mission1Button"))
+ P.updateButton(1, winMgr:getWindow("orxonox/Mission2Button"))
+ P.updateButton(2, winMgr:getWindow("orxonox/Mission3Button"))
+ P.updateButton(3, winMgr:getWindow("orxonox/Mission4Button"))
+ P.updateButton(4, winMgr:getWindow("orxonox/Mission5Button"))
+ P.updateButton(5, winMgr:getWindow("orxonox/Mission6Button"))
+ P.updateButton(6, winMgr:getWindow("orxonox/Mission7Button"))
+ P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button"))
+ P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button"))
+
if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then
local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")
label:setProperty("Visible","True")
@@ -53,22 +59,42 @@
return -1
end
-function P.MissionOneButton_clicked(e)
+function P.Mission1Button_clicked(e)
P.loadLevel(P.FindLevel(0))
end
-function P.MissionTwoButton_clicked(e)
+function P.Mission2Button_clicked(e)
P.loadLevel(P.FindLevel(1))
end
-function P.MissionThreeButton_clicked(e)
+function P.Mission3Button_clicked(e)
P.loadLevel(P.FindLevel(2))
end
-function P.MissionFourButton_clicked(e)
+function P.Mission4Button_clicked(e)
P.loadLevel(P.FindLevel(3))
end
+function P.Mission5Button_clicked(e)
+ P.loadLevel(P.FindLevel(4))
+end
+
+function P.Mission6Button_clicked(e)
+ P.loadLevel(P.FindLevel(5))
+end
+
+function P.Mission7Button_clicked(e)
+ P.loadLevel(P.FindLevel(6))
+end
+
+function P.Mission8Button_clicked(e)
+ P.loadLevel(P.FindLevel(7))
+end
+
+function P.Mission9Button_clicked(e)
+ P.loadLevel(P.FindLevel(8))
+end
+
function P.loadLevel(level)
orxonox.execute("startGame " .. level:getXMLFilename())
hideAllMenuSheets()
Modified: code/trunk/data/gui/scripts/InGameMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/InGameMenu.lua 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/gui/scripts/InGameMenu.lua 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,23 +6,28 @@
function P.onLoad()
P.multiplayerMode = "startClient"
- --button are arranged in a 4x1 matrix, the left lower item is nil
+ --button are arranged in a 5x1 matrix, the left lower item is nil
P:setButton(1, 1, {
["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"),
["callback"] = P.button_return_clicked
})
P:setButton(2, 1, {
+ ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReloadLevelButton"),
+ ["callback"] = P.button_reloadLevel_clicked
+ })
+
+ P:setButton(3, 1, {
["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"),
["callback"] = P.button_mainmenu_clicked
})
- P:setButton(3, 1, {
+ P:setButton(4, 1, {
["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"),
["callback"] = P.button_settings_clicked
})
- P:setButton(4, 1, {
+ P:setButton(5, 1, {
["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"),
["callback"] = P.button_quit_clicked
})
@@ -53,6 +58,11 @@
showMenuSheet("SettingsMenu", true)
end
+function P.button_reloadLevel_clicked(e)
+ hideMenuSheet("InGameMenu")
+ orxonox.execute("reloadLevel")
+end
+
function P.button_return_clicked(e)
hideMenuSheet("InGameMenu")
end
Modified: code/trunk/data/gui/scripts/SheetManager.lua
===================================================================
--- code/trunk/data/gui/scripts/SheetManager.lua 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/gui/scripts/SheetManager.lua 2016-01-09 17:26:20 UTC (rev 11052)
@@ -25,6 +25,15 @@
end
end
+function getLoadedSheets()
+ local names = ""
+ for name, sheet in pairs(loadedSheets) do
+ names = names .. name
+ names = names .. ","
+ end
+ return names
+end
+
-- Loads the GUI with the specified name
-- The name corresponds to the filename of the *.lua and *.layout files
-- but without the extension
Copied: code/trunk/data/levels/AITest.oxw (from rev 11051, code/branches/presentationHS15/data/levels/AITest.oxw)
===================================================================
--- code/trunk/data/levels/AITest.oxw (rev 0)
+++ code/trunk/data/levels/AITest.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,351 @@
+<LevelInfo
+ name = "New AI testing level"
+ description = "A level with two opposing new AI teams"
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipRing.oxt")
+ include("templates/spaceshipSwallow.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+
+<Level>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+ <?lua
+ include("includes/pickups.oxi")
+ ?>
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+ <TeamSpawnPoint team=0 position="2000, 2000, 2000" lookat="1,1,-1" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+ <Pawn position = "100000, 100000, 100000">
+ <controller>
+ <MasterController>
+ </MasterController>
+ </controller>
+ </Pawn>
+<!--
+ <PickupSpawner pickup=largedamageboostpickup position="0,0,0" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=crazyhealthpickup position="0,0,0" triggerDistance="50" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=hugeshieldpickup position="4000,4500, 4500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+<PickupSpawner pickup=smalljumppickup position="6500,6500, 6000" triggerDistance="20" respawnTime="10" maxSpawnedItems="99" />
+<PickupSpawner pickup=largedamageboostpickup position="9500,9500, 9500" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=largedamageboostpickup position="13000,13000,13000" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ -->
+<!-- HERE STARTS DEMO FOR THE "WAYPOINTS" -->
+ <!--
+ <SpaceShip position="-1500, -1500, -1500" lookat="0,0,0" team=0 name="ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=1 formationMode="finger4">
+ <actionpoints>
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-600" />
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-1000" />
+ <Model mesh="cube.mesh" scale=8 position="400,2000,-1000" />
+ <Model mesh="cube.mesh" scale=8 position="400,2000,-600" />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+ -->
+ <!-- those two are same -->
+
+ <!--
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-600" />
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-1000" />
+ <Model mesh="cube.mesh" scale=8 position="400,2000,-1000" />
+ <Model mesh="cube.mesh" scale=8 position="400,2000,-600" />
+ <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="finger4">
+ <actionpoints>
+ <Actionpoint position=" 0,2000,-600" action="FLY" loopStart=true/>
+ <Actionpoint position=" 0,2000,-1000" action="FLY" />
+ <Actionpoint position="400,2000,-1000" action="FLY" />
+ <Actionpoint position="400,2000,-600" action="FLY" loopEnd=true />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip> -->
+
+<!-- HERE ENDS DEMO FOR THE "WAYPOINTS" -->
+
+<!-- HERE STARTS DEMO FOR THE ACTIONPOINTS.
+P.S. Never set protectMe in the first actionpoint: if human didn't spawn, that actionpoint will be skipped -->
+ <!--
+ <Model mesh="cube.mesh" scale=8 position="0,0,0" />
+
+ <SpaceShip position="-2000, 1500, -1000" lookat="0,0,0" team=0 name="ss2">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="finger4">
+ <actionpoints>
+ <Actionpoint position="0,0,0" action="FLY" />
+ <Actionpoint position="-1000,750,-500" action="ATTACK" attack="attack" />
+ <Actionpoint position="-1000,750,-500" action="PROTECt" protectMe=true />
+ <Actionpoint position="-1000,750,-500" action="PROTECt" protect="protect" />
+ <Actionpoint position="-1000,750,-500" action="FIGHTALL" />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-2000, 1900, -1000" lookat="0,0,0" team=0>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <SectionController team=0>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-2000, 2100, -1000" lookat="0,0,0" team=0>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-2000, 2400, -1000" lookat="0,0,0" team=0>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="0, 0, 0" lookat="0,0,0" team=2 name="ss4">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ </SpaceShip>
+ <SpaceShip position="3000, 1000, 2000" lookat="0,0,0" team=2 name="attack">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ </SpaceShip>
+ <SpaceShip position="-500, -300, -300" lookat="0,0,0" team=0 name="protect">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ </SpaceShip>
+ -->
+
+<!-- HERE ENDS DEMO FOR THE ACTIONPOINTS -->
+<!-- HERE STARTS DEMO FOR FIGHTING -->
+
+
+ <SpaceShip position="-4000, 1500, -1000" lookat="0,0,0" team=0 name="d1sd1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="WALL">
+
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-4000, 1900, -1000" lookat="0,0,0" team=0 name="d1ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <SectionController team=0>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-4000, 2100, -1000" lookat="0,0,0" team=0 name="d1sw1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-4000, 2400, -1000" lookat="0,0,0" team=0 name="d1sw2">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip position="2000, -1500, 1000" lookat="0,0,0" team=1 name="d2sd1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=1 formationMode="DIAMOND">
+
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="2000, -1900, 1000" lookat="0,0,0" team=1 name="d2ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <SectionController team=1>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="2000, -2100, 1000" lookat="0,0,0" team=1 name="d2sw1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=1>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="2000, -2400, 1000" lookat="0,0,0" team=1 name="d2sw2">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=1>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+<!-- HERE ENDS DEMO FOR FIGHTING -->
+<!-- HERE STARTS DEMO FOR FORMATIONS -->
+ <!--
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000, 0" />
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-2000" />
+ <Model mesh="cube.mesh" scale=8 position="2000,2000,-2000" />
+ <Model mesh="cube.mesh" scale=8 position="2000,2000, 0" />
+
+ <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="diamond" spread=100>
+ <actionpoints>
+ <Actionpoint position=" 0,2000, 0" action="FLY" loopStart=true/>
+ <Actionpoint position=" 0,2000,-2000" action="FLY" />
+ <Actionpoint position="2000,2000,-2000" action="FLY" />
+ <Actionpoint position="2000,2000, 0" action="FLY" loopEnd=true />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip position="-2000, 1900, -1000" lookat="0,0,0" team=0>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <SectionController team=0>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-2000, 2100, -1000" lookat="0,0,0" team=0>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="-2000, 2400, -1000" lookat="0,0,0" team=0>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ -->
+<!-- HERE ENDS DEMO FOR FORMATIONS -->
+ <!-- 1 division is roughly equal to 6 AIControllers--!>
+<!--
+ <SpaceShip position="2000, -1500, 1000" lookat="0,0,0" team=1 >
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=1 formationMode="WALL">
+
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="2000, -1900, 1000" lookat="0,0,0" team=1>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <SectionController team=1>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="2000, -2100, 1000" lookat="0,0,0" team=1>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=1>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+ <SpaceShip position="2000, -2400, 1000" lookat="0,0,0" team=1>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WingmanController team=1>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+ <?lua
+ for i = 0, 5, 1 do
+ ?>
+ <SpaceShip position="<?lua print(7000) ?>,<?lua print(i*500) ?>,<?lua print(0) ?>" team=2>
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <AIController team=2 />
+ </controller>
+ </SpaceShip>
+ <?lua end ?> -->
+
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/FPS_Level_HS14.oxw
===================================================================
--- code/trunk/data/levels/FPS_Level_HS14.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/FPS_Level_HS14.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -66,8 +66,8 @@
initialshieldhealth = "50"
maxshieldhealth = "50"
shieldabsorption = "0.8"
- reloadrate = "100"
- reloadwaittime = "0.1"
+ shieldrechargerate = "100"
+ shieldrechargewaittime = "0.1"
name = "Tanis1"
radarname = "Light Destroyer" >
<attached>
@@ -196,8 +196,8 @@
initialshieldhealth = "200"
maxshieldhealth = "200"
shieldabsorption = "0.8"
- reloadrate = "1"
- reloadwaittime = "1"
+ shieldrechargerate = "1"
+ shieldrechargewaittime = "1"
name = "Tanis0"
radarname = "Tanis big ship" >
</SpaceShip>
@@ -215,8 +215,8 @@
initialshieldhealth = "50"
maxshieldhealth = "50"
shieldabsorption = "0.8"
- reloadrate = "1"
- reloadwaittime = "1"
+ shieldrechargerate = "1"
+ shieldrechargewaittime = "1"
name = "Tanis0"
radarname = "Pirate1" >
@@ -238,8 +238,8 @@
initialshieldhealth = "50"
maxshieldhealth = "50"
shieldabsorption = "0.8"
- reloadrate = "1"
- reloadwaittime = "1"
+ shieldrechargerate = "1"
+ shieldrechargewaittime = "1"
name = "Tanis0"
radarname = "Pirate2" >
Modified: code/trunk/data/levels/HeavyCruiser.oxw
===================================================================
--- code/trunk/data/levels/HeavyCruiser.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/HeavyCruiser.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -552,6 +552,27 @@
All Pawns can easily be included into a level using the lua file "HeavyCruiserParts" -->
<Pawn team=1 health=1000 initialhealth=1000 maxhealth=1000 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=10000 name=HeavyCruiser_body radarname = "HeavyCruiser" >
+ <explosion>
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 />
+
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 delay=0.3 />
+
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 delay=0.6 />
+
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 delay=0.9 />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_body.mesh" scale="40" />
@@ -718,6 +739,12 @@
<Pawn team=1 health=300 initialhealth=300 maxhealth=300 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_sidearmL radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="-140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="-140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="-140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
+
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_sidearmL.mesh" scale="40" />
</attached>
@@ -757,6 +784,13 @@
</Pawn>
<Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_sidearmLfront radarname = "HIDDEN" >
+
+ <explosion>
+ <ExplosionPart offset="-141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="-141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="-141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
+
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_sidearmLfront.mesh" scale="40" />
</attached>
@@ -771,6 +805,11 @@
</Pawn>
<Pawn team=1 health=300 initialhealth=300 maxhealth=300 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_sidearmR radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_sidearmR.mesh" scale="40" />
</attached>
@@ -810,6 +849,11 @@
</Pawn>
<Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=sidearmRfront radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_sidearmRfront.mesh" scale="40" />
</attached>
@@ -824,6 +868,11 @@
</Pawn>
<Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_frontL radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="-80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="-80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="-80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_frontL.mesh" scale="40" />
</attached>
@@ -835,6 +884,11 @@
</Pawn>
<Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_frontR radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_frontR.mesh" scale="40" />
</attached>
@@ -846,6 +900,11 @@
</Pawn>
<Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_partL radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="-94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="-94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="-94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_partL.mesh" scale="40" />
</attached>
@@ -857,6 +916,11 @@
</Pawn>
<Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_partR radarname = "HIDDEN" >
+ <explosion>
+ <ExplosionPart offset="94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart offset="94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart offset="94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ </explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_partR.mesh" scale="40" />
</attached>
Copied: code/trunk/data/levels/Hover.oxw (from rev 11051, code/branches/presentationHS15/data/levels/Hover.oxw)
===================================================================
--- code/trunk/data/levels/Hover.oxw (rev 0)
+++ code/trunk/data/levels/Hover.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,85 @@
+<LevelInfo
+ name = "Hover level"
+ description = "Level for Minigame Hover"
+ tags = "minigame"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipHover.oxt")
+ include("overlays/HoverHUD.oxo")
+?>
+
+<?lua
+MAZE_NUM_CELLS = 10
+MAZE_CELL_SIZE = 100
+MAZE_CELL_HEIGHT = 30
+MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
+?>
+
+<Level
+plugins = hover
+gametype = Hover
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ gravity = "0, -200, 0"
+ >
+
+ <StaticEntity position="0,0,0" collisionType="static">
+ <attached>
+ <HoverOrigin
+ numCells="<?lua print(MAZE_NUM_CELLS)?>"
+ cellSize="<?lua print(MAZE_CELL_SIZE)?>"
+ cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
+ />
+ <Model
+ position="<?lua print(MAZE_SIZE/2)?>,-16,<?lua print(MAZE_SIZE/2)?>"
+ scale3D="<?lua print(MAZE_SIZE/2)?>,16,<?lua print(MAZE_SIZE/2)?>"
+ mesh="CubeGround.mesh"
+ />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape
+ position="<?lua print(MAZE_SIZE/2)?>,<?lua print(MAZE_CELL_HEIGHT+1)?>,<?lua print(MAZE_SIZE/2)?>"
+ halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
+ />
+ <BoxCollisionShape
+ position="<?lua print(MAZE_SIZE/2)?>,-1,<?lua print(MAZE_SIZE/2)?>"
+ halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
+ />
+ </collisionShapes>
+ </StaticEntity>
+
+ <Light
+ type=directional
+ position="-50,500,-50"
+ direction="0.577, -0.577, 0.577"
+ diffuse="1.0, 0.9, 0.9, 1.0"
+ specular="1.0, 0.9, 0.9, 1.0"
+ />
+
+ <SpawnPoint
+ team=0
+ position="50,20,50"
+ lookat="100,20,100"
+ spawnclass=HoverShip
+ pawndesign=spaceshiphover
+ />
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/emptyLevel.oxw
===================================================================
--- code/trunk/data/levels/emptyLevel.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/emptyLevel.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -12,11 +12,7 @@
?>
<?lua
- include("templates/spaceshipAssff2.oxt")
- include("templates/spaceshipPirate.oxt")
include("templates/spaceshipEscort.oxt")
- include("templates/spaceshipRing.oxt")
- include("templates/spaceshipSwallow.oxt")
?>
<Level>
Copied: code/trunk/data/levels/expeditionSector.oxw (from rev 11051, code/branches/presentationHS15/data/levels/expeditionSector.oxw)
===================================================================
--- code/trunk/data/levels/expeditionSector.oxw (rev 0)
+++ code/trunk/data/levels/expeditionSector.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,858 @@
+<LevelInfo
+ name = "Expedition to Sector 5C"
+ description = "Commander, our scientists are reporting strange binary radio signals from a yet unexplored and thought to be uninhabited region, sector 5C. Explore the sector and get to the bottom of these messages!"
+ tags = "mission"
+ screenshot = "expeditionSector.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipShuttle.oxt")
+ include("templates/FPS.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+ <templates>
+ <Template link="lodtemplate_default" />
+ </templates>
+
+ <?lua include("includes/notifications.oxi") ?>
+
+ <NotificationQueueCEGUI
+ name="narrative"
+ targets="simpleNotification"
+ size=3
+ displayTime=3.9
+ position="0.15, 0, 0.1, 0"
+ fontSize="15"
+ fontColor="0.3, 1, 0.2, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.7, 0, 0, 0"
+ />
+
+ <!-- GLOBAL LUA VARIABLES -->
+ <?lua
+
+ --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+ cCenter = {0, 0, 0}
+ cSpawn = {-50, 0, 0}
+ cSector = {-15000, -5500, -9000}
+ cSectorEntry = {-4710, -5500, -2826}
+ cPathToEntry = {{0, -2000, 0}}
+ cBeacon = {-6500, -5500, -4400}
+
+ radSector = 12000
+
+ cStationA = {1400, 400, -800}
+ cNewShip = {1000, 250, -350}
+
+ cPlanet1 = {20000, 0, 29000}
+ cPlanet2 = {-22000, 0, -29000}
+
+ cEnemyBasePlanet = {-20000, -5500, -8000}
+
+ cEnemyBaseStation1 = {-12500, -4500, -3500}
+
+ cField1 = {-5000, -4000, -3000}
+ cField2 = {4000, 2000, 4500}
+
+ --[[ Function to print Coordinates. Quotes not included! ]]--
+ function printC(coord)
+ print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+ end
+
+ --[[ Function to add Coordinates.]]--
+ function addC(coord1, coord2)
+ return {coord1[1]+coord2[1], coord1[2]+coord2[2], coord1[3]+coord2[3]}
+ end
+ ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/skyBoxMoreNebula"
+ hasPhysics = true
+ >
+
+ <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+ <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+ <Light type=directional position="<?lua printC(cCenter) ?>" 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"/>
+
+ <!--QUEST DEFINITIONS-->
+
+ <GlobalQuest id="quest1">
+ <QuestDescription title="Get the scout ship" description="We received some extraterrestial binary radio signals from Sector 5C! We'd like you to get to the outer base in sector 4A and get a scout ship to explore the sector!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest2" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest2">
+ <QuestDescription title="Explore the sector" description="Now then, Commander, fly over there to check out if life can be found in what we believed it to be an inhabitated region in space. We have marked 5B with red lights so you can easily find it." failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <subquests>
+ <GlobalQuest id="quest2.1">
+ <QuestDescription title="> Get to the Field Source" description="We percieve a large magnetic field source at a certain spot in the sector. You should check it out! We have marked it with a blue light." failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest2.2" />
+ </complete-effects>
+ </GlobalQuest>
+ <GlobalQuest id="quest2.2">
+ <QuestDescription title="> Fight your way out" description="Oh no... this cannot be happening! We discovered an alien race, and it does not seem to be interested in peace. In fact, they seem to be planning an attack! You must get out of the hot zone. Fight if necessary!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest3" />
+ </complete-effects>
+ </GlobalQuest>
+ </subquests>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest3">
+ <QuestDescription title="Get back to 4A" description="You made it out in one piece. Now report to base 4A to warn the others!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ </GlobalQuest>
+
+ <!--EVENTS AND TRIGGERS
+ Usable events and triggers:
+ spawntrigger
+ dockA
+ reachedSector
+ reachedEnemyStation
+ fightEnd
+ backToA
+
+ BASE-STORY-LINE:
+ We receive a message from commander (SimpleNotification -> SpawnTrigger) about alien radio activity in a nearby sector and are asked to change our spaceship
+ QUEST1: Dock to Station and get better Spaceship
+ TRIGGER: Docked to Station
+ EVENT: Change Spaceship and Sector 5C becomes visilbe
+
+ We are asked to go to the sector and explore it
+ QUEST2.1: Go to Sector 5C and see what you can find there
+ TRIGGER: Distance Trigger at enemy spacestation, with a rather large radius
+ EVENT: The 25 Enemies and there SpaceStation become visible, the planet should stay invisible; the patroling enemies on your way back become visible as well.
+
+ On your way back you discover the patroling enemy spaceships, they attack you, but you must survive and report to your commander about an possible upcoming attack from the aliens
+ QUEST2.2: Destroy the patroling spaceships, spare no one
+ TRIGGER: -------- The patroling spaceships should triggered bythemselves?
+ EVENT: After destroying all 5 enemy ships, you can return to your base and safety, the Distancetrigger for next quest is activated
+ FAIL: You fail if you die here
+
+ After destroying the enemy ships, you make it bake to your station in time to report about the hord of enemies you saw and start preparing for the upcoming fight!
+ QUEST3: Go back to spacestation
+ TRIGGER: Distancetrigger i suppose?
+ EVENT: You win this level, and the main level is unlocked.
+ -->
+
+ <EventMultiTrigger name="spawntrigger">
+ <events>
+ <trigger>
+ <EventListener event="playerSpawn" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <!-- HACK: just waited out 3sec for animation. Cannot link an event to the COMPLETION of a dock. How is this not possible?? -->
+ <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
+ <events>
+ <trigger>
+ <EventListener event="dockA" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger name="reachedSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true />
+
+ <DistanceTrigger name="reachedEnemyStation" position="<?lua printC(cEnemyBaseStation1) ?>" distance="5000" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true />
+
+ <!-- Recursive helper function for the fightEnd event -->
+ <?lua
+ function enemyTriggerRecursor(i)
+ if i > 0 then
+ return [[
+ <EventTrigger name=killedEnemy]] .. i .. [[ activations=1 stayactive=true delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event=enemy />
+ </trigger>
+ </events>
+ ]] .. enemyTriggerRecursor(i-1) .. [[
+ </EventTrigger>
+ ]]
+ else return ""
+ end
+ end
+ ?>
+ <!-- Actual Event for the enemies. -->
+ <?lua print(enemyTriggerRecursor(5)) ?>
+ <EventMultiTrigger name="fightEnd" delay=0.1 stayactive=true>
+ <events>
+ <trigger>
+ <EventListener event="killedEnemy5" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger active=false name="closeToPatrol" position="<?lua printC(cStationA) ?>" distance="6000" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true >
+ <events>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <DistanceTrigger active=false name="backToA" position="<?lua printC(cStationA) ?>" distance="600" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true >
+ <events>
+ <activity>
+ <EventListener event="fightEnd" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <Script code="Mission endMission true" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event="backToA" />
+ </trigger>
+ </events>
+ </Script>
+
+ <DistanceTrigger invert=true active=false name="hasDied" position="<?lua printC(cSector) ?>" distance="100000" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true >
+ <events>
+ <activity>
+ <EventListener event="reachedSector" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <Script code="Mission endMission fail" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event="hasDied" />
+ </trigger>
+ </events>
+ </Script>
+
+ <!--QUEST EFFECT BEACONS -->
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="quest1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="spawntrigger" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockedA" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="quest2.1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="reachedSector" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest2.1" />
+ <AddQuest questId="quest2.2" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="reachedEnemyStation" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest2.2" />
+ <CompleteQuest questId="quest2" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="fightEnd" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <!--NOTIFICATIONS -->
+
+ <SimpleNotification broadcast="true" message="Welcome, Commander.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="We've picked up strange radio Signals from Sector 5B!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=8 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Please dock to the outer base and get into the scout ship!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=12 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="We have marked the sector in red Lights. Enter it!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=0 >
+ <events>
+ <trigger>
+ <EventListener event="dockedA" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Huh? Something's emanating a strong field... We marked it in blue.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=0 >
+ <events>
+ <trigger>
+ <EventListener event="reachedSector" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Woah! What the hell? We made alien contact!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=0 >
+ <events>
+ <trigger>
+ <EventListener event="reachedEnemyStation" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="It looks like they are getting ready to attack someone...">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="reachedEnemyStation" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="It must be us! Commander, get back to the base and report!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=8 >
+ <events>
+ <trigger>
+ <EventListener event="reachedEnemyStation" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Oh no! A patrol! When did it get here?!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=0 >
+ <events>
+ <trigger>
+ <EventListener event="closeToPatrol" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Phew, that was close. Now get back here!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=0 >
+ <events>
+ <trigger>
+ <EventListener event="fightEnd" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <!--STATIONS -->
+
+ <Template name="station">
+ <Pawn mass=10000000 collisionType=dynamic friction=0.01>
+ <attached>
+ <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
+ <DistanceTriggerBeacon name="NPC" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+ <BoxCollisionShape position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+ <BoxCollisionShape position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+ <BoxCollisionShape position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+ <BoxCollisionShape position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+ <BoxCollisionShape position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+ <BoxCollisionShape position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+ <BoxCollisionShape position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+ <BoxCollisionShape position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+ <BoxCollisionShape position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+ <BoxCollisionShape position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+ </collisionShapes>
+ </Pawn>
+ </Template>
+
+ <Pawn name="statA" team=0 radarname="Outer Base - Sector 4B" position="<?lua printC(cStationA) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
+ <templates>
+ <Template link="station" />
+ </templates>
+ <attached>
+ <DockingTarget name="dockTargetA" />
+ <Dock position="0,0,0" active=true>
+ <animations>
+ <MoveToDockingTarget target="dockTargetA" />
+ </animations>
+ <effects>
+ <DockToShip target="newSpaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockA" />
+ </execute>
+ </events>
+ <attached>
+ <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
+ <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+ </attached>
+ </Dock>
+ </attached>
+ </Pawn>
+
+ <!-- EnemyStation -->
+
+ <!-- Marking Billboard -->
+ <Billboard visible=false position="<?lua printC(cEnemyBaseStation1) ?>" amplitude=30 scale=2 material="Flares/lensflare" colour="0,0,1">
+ <events>
+ <visibility>
+ <EventListener event="reachedSector" />
+ </visibility>
+ </events>
+ </Billboard>
+
+
+ <Pawn name="statB" team=1 radarname="EnemyBase" position="<?lua printC(cEnemyBaseStation1) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
+ <templates>
+ <Template link="station" />
+ </templates>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ </Pawn>
+
+ <!-- New SpaceShip as destination of dock A-->
+ <SpaceShip
+ template = "spaceshipassff"
+ team = "0"
+ position = "<?lua printC(cNewShip) ?>"
+ lookat = "<?lua printC(cSector) ?>"
+ health = "1500"
+ initialhealth = "1500"
+ maxhealth = "1500"
+ shieldhealth = "80"
+ initialshieldhealth = "80"
+ maxshieldhealth = "120"
+ shieldabsorption = "0.8"
+ reloadrate = "1"
+ reloadwaittime = "1"
+ name = "newSpaceShip"
+ radarname = "ScoutShip" >
+ <attached>
+ <DockingTarget name="newSpaceShip" />
+ <DistanceTriggerBeacon name="newSpaceShip" />
+ </attached>
+ </SpaceShip>
+
+ <!--ELEMENTS -->
+
+ <?lua
+ for i = 1, 64, 1
+ do
+ rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
+ cBillNow = addC(cSector,rBillboard)
+ ?>
+ <Billboard position="<?lua printC(cBillNow) ?>" scale=10 material="Flares/lensflare" colour="1,0.2,0.2" visible=false>
+ <events>
+ <visibility>
+ <EventListener event="dockedA" />
+ </visibility>
+ </events>
+ </Billboard>
+ <?lua end ?>
+
+ <!-- Asteroids you have to fly through to get to the EnemyBase -->
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
+ ?>
+
+ <!-- Other Asteroid-Fields -->
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
+ ?>
+
+ <!-- Planets -->
+
+ <Planet
+ position="<?lua printC(cPlanet1) ?>"
+ scale="3000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/muunilinst.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage=2
+ enablecollisiondamage=true
+ visible=true
+ active=ture
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="3000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+ ?>
+
+ <Planet
+ position="<?lua printC(cPlanet2) ?>"
+ scale="2000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/ganymede.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage=2
+ enablecollisiondamage=true
+ visible=true
+ active=true
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="2000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+ ?>
+
+ <!-- EnemyPlanet(s) -->
+
+ <Planet
+ position="<?lua printC(cEnemyBasePlanet) ?>"
+ scale="5000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/jupiter.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage=2
+ enablecollisiondamage=true
+ visible=false
+ active=false
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="5000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ xi = 5
+ zi = 5
+ for k = 1, xi, 1
+ do
+ ?>
+ <?lua
+ for j = 1, zi, 1
+ do
+ x = -2500+k*100
+ z = -4400+j*100
+ ?>
+ <SpaceShip visible=false active=false name="enemyStalled" radarname="Attacker" position="-11000,<?lua print(z)?>,<?lua print(x)?>" lookat="0,0,0" team=1>
+ <templates>
+ <Template link="spaceshippirate" />
+ </templates>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ </events>
+ </SpaceShip>
+ <?lua end ?>
+ <?lua end ?>
+
+ <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-2700,-800,-800" lookat="0,0,0" team=1>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <controller>
+ <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+ <events>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <waypoints>
+ <StaticEntity position="-3400,-1200,-200" />
+ <StaticEntity position="-1600,-1000,-200" />
+ <StaticEntity position="-1700,-1400,-940" />
+ <StaticEntity position="-2100,-1200,-1250" />
+ <StaticEntity position="-2700,-800,-800" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-3400,-1200,-200" lookat="0,0,0" team=1>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+ <events>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <waypoints>
+ <StaticEntity position="-1600,-1000,-200" />
+ <StaticEntity position="-1700,-1400,-940" />
+ <StaticEntity position="-2100,-1200,-1250" />
+ <StaticEntity position="-2700,-800,-800" />
+ <StaticEntity position="-3400,-1200,-200" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-1600,-1000,-200" lookat="0,0,0" team=1>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+ <events>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <waypoints>
+ <StaticEntity position="-1700,-1400,-940" />
+ <StaticEntity position="-2100,-1200,-1250" />
+ <StaticEntity position="-2700,-800,-800" />
+ <StaticEntity position="-3400,-1200,-200" />
+ <StaticEntity position="-1600,-1000,-200" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-1700,-1400,-940" lookat="0,0,0" team=1>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+ <events>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <waypoints>
+ <StaticEntity position="-2100,-1200,-1250" />
+ <StaticEntity position="-2700,-800,-800" />
+ <StaticEntity position="-3400,-1200,-200" />
+ <StaticEntity position="-1600,-1000,-200" />
+ <StaticEntity position="-1700,-1400,-940" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-2100,-1200,-1250" lookat="0,0,0" team=1>
+ <events>
+ <visibility>
+ <EventListener event="reachedEnemyStation" />
+ </visibility>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+ <events>
+ <activity>
+ <EventListener event="reachedEnemyStation" />
+ </activity>
+ </events>
+ <waypoints>
+ <StaticEntity position="-2700,-800,-800" />
+ <StaticEntity position="-3400,-1200,-200" />
+ <StaticEntity position="-1600,-1000,-200" />
+ <StaticEntity position="-1700,-1400,-940" />
+ <StaticEntity position="-2100,-1200,-1250" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+ </Scene>
+</Level>
Modified: code/trunk/data/levels/iJohnVane_TriptoArea51.oxw
===================================================================
--- code/trunk/data/levels/iJohnVane_TriptoArea51.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/iJohnVane_TriptoArea51.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -168,8 +168,8 @@
initialshieldhealth = "80"
maxshieldhealth = "120"
shieldabsorption = "0.8"
- reloadrate = "1"
- reloadwaittime = "1"
+ shieldrechargerate = "1"
+ shieldrechargewaittime = "1"
name = "cruiser"
radarname = "Spacecruiser" >
<attached>
Modified: code/trunk/data/levels/iiiJohnVane_EscapeTheBastards.oxw
===================================================================
--- code/trunk/data/levels/iiiJohnVane_EscapeTheBastards.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/iiiJohnVane_EscapeTheBastards.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -287,6 +287,11 @@
<WaypointController team=1>
</WaypointController>
</controller>
+ <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" />
+ </explosion>
</Pawn>
<Billboard position="0,0,-1540" amplitude=1 material="Flares/lensflare" colour="0,0.8,0.1">
Modified: code/trunk/data/levels/includes/invaderWeapon.oxi
===================================================================
--- code/trunk/data/levels/includes/invaderWeapon.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/invaderWeapon.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,7 +6,7 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -24,4 +24,7 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=0 />
</links>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=0.5/>
+ </munition>
Modified: code/trunk/data/levels/includes/invaderWeaponEnemy.oxi
===================================================================
--- code/trunk/data/levels/includes/invaderWeaponEnemy.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/invaderWeaponEnemy.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,7 +6,7 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -24,4 +24,7 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=0 />
</links>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=0.5/>
+ </munition>
Modified: code/trunk/data/levels/includes/pickups.oxi
===================================================================
--- code/trunk/data/levels/includes/pickups.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/pickups.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -77,6 +77,22 @@
inventoryRepresentation = "dropPickup"
/>
+<PickupRepresentation
+ name = "destroy"
+ pickupName = "Destroy Pickup"
+ pickupDescription = "Destroy all pickups you have."
+ spawnerTemplate = "destroypickupRepresentation"
+ inventoryRepresentation = "detroyPickup"
+/>
+
+<PickupRepresentation
+ name = "destroycarrier"
+ pickupName = "Destroy Carrier Pickup"
+ pickupDescription = "destroys you."
+ spawnerTemplate = "destroycarrierpickupRepresentation"
+ inventoryRepresentation = "destroyCarrierPickup"
+/>
+
<!-- Speed pickups -->
<PickupRepresentation
@@ -137,6 +153,32 @@
inventoryRepresentation = "HugeInvisible"
/>
+<!-- Munition pickups -->
+
+<PickupRepresentation
+ name = "smallmunitionpickup"
+ pickupName = "Small munition"
+ pickupDescription = "Gives a small amount of munition."
+ spawnerTemplate = "smallmunitionpickupRepresentation"
+ inventoryRepresentation = "SmallMunition"
+/>
+
+<PickupRepresentation
+ name = "mediummunitionpickup"
+ pickupName = "Medium munition"
+ pickupDescription = "Gives a medium amount of munition."
+ spawnerTemplate = "mediummunitionpickupRepresentation"
+ inventoryRepresentation = "MediumMunition"
+/>
+
+<PickupRepresentation
+ name = "hugemunitionpickup"
+ pickupName = "Huge munition"
+ pickupDescription = "Gives a huge amount of munition."
+ spawnerTemplate = "hugemunitionpickupRepresentation"
+ inventoryRepresentation = "HugeMunition"
+/>
+
<!-- Pickup Collection pickups -->
<PickupRepresentation
@@ -174,11 +216,11 @@
/>
<PickupRepresentation
- name = "largedamageboostpickup"
- pickupName = "Large DamageBoost Pickup"
+ name = "hugedamageboostpickup"
+ pickupName = "Huge DamageBoost Pickup"
pickupDescription = "Multiplies the ship damage with 7."
- spawnerTemplate = "largedamageboostpickupRepresentation"
- inventoryRepresentation = "LargeDamageBoost"
+ spawnerTemplate = "hugedamageboostpickupRepresentation"
+ inventoryRepresentation = "HugeDamageBoost"
/>
<!-- Shrink Pickup -->
@@ -206,3 +248,29 @@
spawnerTemplate = "hugeshrinkpickupRepresentation"
inventoryRepresentation = "HugeShrink"
/>
+
+<!-- Boost Pickup -->
+
+<PickupRepresentation
+ name = "smallboostpickup"
+ pickupName = "Small Boost"
+ pickupDescription = "Restores the boost by a bit"
+ spawnerTemplate = "smallboostpickupRepresentation"
+ inventoryRepresentation = "SmallBoost"
+/>
+
+<PickupRepresentation
+ name = "mediumboostpickup"
+ pickupName = "Medium Boost"
+ pickupDescription = "Restores the boost"
+ spawnerTemplate = "mediumboostpickupRepresentation"
+ inventoryRepresentation = "MediumBoost"
+/>
+
+<PickupRepresentation
+ name = "hugeboostpickup"
+ pickupName = "Huge Boost"
+ pickupDescription = "Restores the boost considerably"
+ spawnerTemplate = "hugeboostpickupRepresentation"
+ inventoryRepresentation = "HugeBoost"
+/>
Deleted: code/trunk/data/levels/includes/towerWeaponSettings.oxi
===================================================================
--- code/trunk/data/levels/includes/towerWeaponSettings.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/towerWeaponSettings.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,55 +0,0 @@
- <weaponslots>
- <WeaponSlot position="-15.0,-1.5,0" />
- <WeaponSlot position=" 15.0,-1.5,0" />
- <WeaponSlot position=" 0, 0,0" />
- </weaponslots>
- <weaponsets>
- <WeaponSet firemode=0 />
- <WeaponSet firemode=1 />
- <WeaponSet firemode=2 />
- <WeaponSet firemode=3 />
- </weaponsets>
- <weapons>
- <WeaponPack>
- <links>
- <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
- <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
- <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
- <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
- </links>
- <Weapon>
- <attached>
- <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,200" scale=1/>
- <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,200" scale=1 />
- <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale=10 />
- </attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.005 damage=31.4159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=314.159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
- <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
- </Weapon>
-
- <Weapon>
- <attached>
- <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
- <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
- <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
- </attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
- <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
- </Weapon>
- <Weapon>
- <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
- </Weapon>
-
- </WeaponPack>
- <WeaponPack>
- <links>
- <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
- </links>
- <!--Weapon>
- <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
- </Weapon-->
- </WeaponPack>
- </weapons>
\ No newline at end of file
Modified: code/trunk/data/levels/includes/weaponSettingsAssff.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsAssff.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsAssff.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -9,7 +9,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -23,8 +23,8 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -33,13 +33,18 @@
<Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=8 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=2 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsAssff2.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsAssff2.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsAssff2.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -8,8 +8,8 @@
<WeaponSet firemode=1 />
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
- </weaponsets>
- <weapons>
+ </weaponsets>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -22,8 +22,8 @@
<Model mesh="stunweapon.mesh" pitch="180" roll="0" yaw="0" position="-1.9,-.5,1" scale=".5" />
<BlinkingBillboard position="-1.9, -.5, -5.5" material="PE/lensflare" colour="0.128, 0.28, 1" amplitude=0.25 frequency=16 quadratic=0 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 healthamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 healthamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" />
<LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" shielddamage=23 />
</Weapon>
<Weapon>
@@ -31,13 +31,18 @@
<Model mesh="stunweapon.mesh" pitch="180" roll="0" yaw="0" position="1.9,-.5,1" scale=".5"/>
<BlinkingBillboard position="1.9, -.5, -5.5" material="PE/lensflare" colour="0.128, 0.28, 1" amplitude=0.25 frequency=16 quadratic=0 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6,1.3,-2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1,1.6,-2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6,1.3,-2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1,1.6,-2.0" />
<LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" shielddamage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=50 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=100 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=100 fuel=10 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsCollateral.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsCollateral.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsCollateral.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -9,7 +9,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -24,9 +24,9 @@
<!--Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" /--> <!-- THING BETWEEN -->
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="90" yaw="-90" position="-1.5, 1, -0.3" scale=0.6 /> <!-- MACHINE GUN -->
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
- <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -35,13 +35,18 @@
<!--Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" /-->
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="90" yaw="-90" position="1.8, 1, -0.3" scale=0.6 /> <!-- MACHINE GUN -->
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsEscort.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsEscort.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsEscort.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,19 +6,17 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam2.mesh" />
- <!--HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" projectileMesh="LaserBeam2.mesh" /-->
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam2.mesh" />
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" />
- <!--HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" projectileMesh="LaserBeam2.mesh" /-->
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -26,4 +24,7 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=0 />
</links>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ </munition>
Copied: code/trunk/data/levels/includes/weaponSettingsEscortMine.oxi (from rev 11051, code/branches/presentationHS15/data/levels/includes/weaponSettingsEscortMine.oxi)
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsEscortMine.oxi (rev 0)
+++ code/trunk/data/levels/includes/weaponSettingsEscortMine.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,34 @@
+ <weaponslots>
+ <WeaponSlot position="-9.2,2,-13" />
+ <WeaponSlot position=" 9.2,2,-13" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ </weaponsets>
+ <weaponpacks>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ </links>
+ <Weapon>
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam2.mesh" />
+ <MineGun mode=0 munitionpershot=1 delay=0.125 damage=50 shielddamage=15 healthdamage=10 muzzleoffset=" 0.1, 1.4,-10" maxtimeuntilexplosion=25 timeuntilactivation=2.5/>
+ </Weapon>
+ <Weapon>
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" />
+ <IceGun mode=0 munitionpershot=1 delay=0.125 damage=9.3 muzzleoffset=" 0.1, 1.4,-3" freezefactor=0.5 freezetime=2.0 />
+ </Weapon>
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ </WeaponPack>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ <MineMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsFPS.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsFPS.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsFPS.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -10,7 +10,7 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack firemode=0>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -48,4 +48,8 @@
unlimitedMunition=true
/-->
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=5 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=2 maxmagazines=2 munitionpermagazine=8 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -10,7 +10,7 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack firemode=0>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -48,4 +48,8 @@
unlimitedMunition=true
/-->
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=5 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=2 maxmagazines=2 munitionpermagazine=8 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsFS15.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsFS15.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsFS15.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -11,7 +11,7 @@
<WeaponSet firemode=3 />
<WeaponSet firemode=4 />
</weaponsets>
-<weapons>
+<weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -37,7 +37,7 @@
<LaserFire mode=1 munitionpershot=0 muzzleoffset="-2.2,6,16" damage=30 shielddamage=20 />
<GravityBombFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
<RocketFireOld mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
- <RocketFire mode=4 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=4 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -48,4 +48,10 @@
<EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
</Weapon-->
</WeaponPack>
-</weapons>
\ No newline at end of file
+</weaponpacks>
+<munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ <GravityBombMunition initialmagazines=3 maxmagazines=3 munitionpermagazine=1 />
+</munition>
\ No newline at end of file
Modified: code/trunk/data/levels/includes/weaponSettingsGhost.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsGhost.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsGhost.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -10,7 +10,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=2 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -18,20 +18,25 @@
<DefaultWeaponmodeLink firemode=2 weaponmode=2 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 healthdamage=3.14159 delay=0 material="Flares/point_lensflare" />
- <HsW01 mode=0 munitionpershot=0 healthdamage=3.14159 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=1 healthdamage=3.14159 delay=0 material="Flares/point_lensflare" />
+ <HsW01 mode=0 munitionpershot=1 healthdamage=3.14159 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=30 shielddamage=10 />
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 damage=3.14159 delay=0 material="Flares/point_lensflare" />
- <HsW01 mode=0 munitionpershot=0 damage=3.14159 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=1 damage=3.14159 delay=0 material="Flares/point_lensflare" />
+ <HsW01 mode=0 munitionpershot=1 damage=3.14159 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=30 shielddamage=10 />
</Weapon>
<Weapon>
- <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=50 />
+ <SimpleRocketFire mode=2 munitionpershot=1 muzzleoffset="0,0,0" damage=50 />
</Weapon>
<Weapon>
- <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=50 delay=0.1 />
+ <SimpleRocketFire mode=2 munitionpershot=1 muzzleoffset="0,0,0" damage=50 delay=0.1 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsH2.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsH2.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsH2.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -7,7 +7,7 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -17,16 +17,16 @@
<Model mesh="hs-w01.mesh" roll="180" position="0.0, 0.5, 0.0" scale=2 />
<Model mesh="hs-w01s.mesh" roll="180" position="0.1, 0.0, 0.0" scale=2 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9,-4" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9,-4" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9,-4" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9,-4" />
</Weapon>
<Weapon>
<attached>
<Model mesh="hs-w01.mesh" roll="180" position=" 0.0, 0.5, 0.0" scale=2 />
<Model mesh="hs-w01s.mesh" roll="180" position="-0.1, 0.0, 0.0" scale=2 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9, -4.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9, -4.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9, -4.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9, -4.0" />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -41,5 +41,8 @@
<LightningGun mode=0 muzzleoffset="0,0,0" />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=10 maxmagazines=10 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsHXY.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsHXY.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsHXY.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,7 +6,7 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -23,4 +23,8 @@
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=10 maxmagazines=10 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsHeartAttack.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsHeartAttack.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsHeartAttack.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -10,7 +10,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -19,32 +19,30 @@
<DefaultWeaponmodeLink firemode=3 weaponmode=3 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -11.4, 0, -5" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -11.4, 0, -5" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 11.4, 0, -5" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 11.4, 0, -5" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -11.4, 0, -5" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -11.4, 0, -5" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 11.4, 0, -5" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 11.4, 0, -5" />
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -15, 1.6, -2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -15, 1.6, -2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 15, 1.6, -2" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 15, 1.6, -2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -15, 1.6, -2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" -15, 1.6, -2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 15, 1.6, -2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 15, 1.6, -2" />
</Weapon>
<Weapon>
- <LaserFire mode=1 munitionpershot=0 muzzleoffset="2.2,6,16" damage=30 shielddamage=20 />
- <LaserFire mode=1 munitionpershot=0 muzzleoffset="-2.2,6,16" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <LaserFire mode=1 munitionpershot=1 muzzleoffset="2.2,6,16" damage=30 shielddamage=20 />
+ <LaserFire mode=1 munitionpershot=1 muzzleoffset="-2.2,6,16" damage=30 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
<GravityBombFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
</Weapon>
<Weapon>
</Weapon>
</WeaponPack>
- <WeaponPack>
- <links>
- <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
- </links>
- <!--Weapon>
- <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
- </Weapon-->
- </WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=20 maxmagazines=20 munitionpermagazine=10 replenishamount=1 replenishinterval=6.0/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=1 />
+ <GravityBombMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsHeavyCruiser.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsHeavyCruiser.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsHeavyCruiser.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -9,7 +9,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -23,8 +23,8 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -33,21 +33,18 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,-10" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,-10.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
</Weapon>
</WeaponPack>
- <WeaponPack>
- <links>
- <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
- </links>
- <!--Weapon>
- <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
- </Weapon-->
- </WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=12 maxmagazines=12 munitionpermagazine=10 replenishamount=1 replenishinterval=5.0/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsHeavyCruiserBody.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsHeavyCruiserBody.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsHeavyCruiserBody.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -9,7 +9,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -20,20 +20,20 @@
<Weapon>
<attached>
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
<attached>
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -44,4 +44,9 @@
<EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
</Weapon-->
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=12 maxmagazines=12 munitionpermagazine=10 replenishamount=1 replenishinterval=7.0/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Copied: code/trunk/data/levels/includes/weaponSettingsHover.oxi (from rev 11051, code/branches/presentationHS15/data/levels/includes/weaponSettingsHover.oxi)
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsHover.oxi (rev 0)
+++ code/trunk/data/levels/includes/weaponSettingsHover.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,30 @@
+<weaponslots>
+ <WeaponSlot position="-3,2,-3" />
+ <WeaponSlot position=" 3,2,-3" />
+</weaponslots>
+<weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+</weaponsets>
+<weaponpacks>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ </links>
+ <Weapon>
+ <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam2.mesh" />
+ </Weapon>
+ <Weapon>
+ <IceGun mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" />
+ </Weapon>
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ </WeaponPack>
+</weaponpacks>
+<munition>
+ <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+</munition>
Modified: code/trunk/data/levels/includes/weaponSettingsImmTest.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsImmTest.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsImmTest.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -9,7 +9,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -43,7 +43,7 @@
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" shielddamage=50 />
- <RocketFire mode=3 muzzleoffset="0,0,0" healthdamage=80 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" healthdamage=80 shielddamage=20 fuel=10 />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -54,4 +54,9 @@
<EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
</Weapon-->
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=12 maxmagazines=12 munitionpermagazine=10 replenishamount=1 replenishinterval=7.0/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsPirate.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsPirate.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsPirate.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,19 +6,22 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=2.5 material="Flares/point_lensflare" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=2.5 material="Flares/point_lensflare" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=2.5 material="Flares/point_lensflare" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=2.5 material="Flares/point_lensflare" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=12 maxmagazines=12 munitionpermagazine=10 replenishamount=1 replenishinterval=7.0/>
+ </munition>
\ No newline at end of file
Modified: code/trunk/data/levels/includes/weaponSettingsRing.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsRing.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsRing.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,26 +1,35 @@
-<weaponslots>
- <WeaponSlot position="11,0,-7" />
- <WeaponSlot position="0,0,-7" />
- <WeaponSlot position="-11,0,-7" />
-</weaponslots>
-<weaponsets>
- <WeaponSet firemode=0 />
- <WeaponSet firemode=1 />
-</weaponsets>
-<weapons>
- <WeaponPack>
- <links>
- <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
- <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
- </links>
- <Weapon>
- <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset="11,0,-3" freezefactor=0.5 freezetime=2.0 />
- </Weapon>
- <Weapon>
- <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset=" -11,0,-3" freezefactor=0.5 freezetime=2.0 />
- </Weapon>
- <Weapon>
- <GravityBombFire mode=1 munitionpershot=0 delay=0.125 damage=3 muzzleoffset="0,0,-7"/>
- </Weapon>
- </WeaponPack>
-</weapons>
+ <weaponslots>
+ <WeaponSlot position="11,0,-7" />
+ <WeaponSlot position="-11,0,-7" />
+ <WeaponSlot position="0,0,-7" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ <WeaponSet firemode=2 />
+ </weaponsets>
+ <weaponpacks>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+ </links>
+ <Weapon>
+ <LaserFire mode=0 munitionpershot=1 damage=10 shielddamage=5 />
+ <IceGun mode=1 munitionpershot=1 delay=0.125 damage=9.3 muzzleoffset="11,0,-3" freezefactor=0.5 freezetime=2.0 />
+ </Weapon>
+ <Weapon>
+ <LaserFire mode=0 munitionpershot=1 damage=10 shielddamage=5 />
+ <IceGun mode=1 munitionpershot=1 delay=0.125 damage=9.3 muzzleoffset=" -11,0,-3" freezefactor=0.5 freezetime=2.0 />
+ </Weapon>
+ <Weapon>
+ <GravityBombFire mode=2 munitionpershot=1 delay=0.125 damage=3 muzzleoffset="0,0,-7"/>
+ </Weapon>
+ </WeaponPack>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=12 maxmagazines=12 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <GravityBombMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=1 />
+ <IceMunition initialmagazines=16 maxmagazines=16 munitionpermagazine=1 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -13,7 +13,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -27,8 +27,8 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -37,13 +37,13 @@
<Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
</Weapon>
<Weapon>
<attached>
@@ -51,8 +51,8 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -61,8 +61,8 @@
<Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
@@ -71,8 +71,8 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -81,9 +81,14 @@
<Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=20 maxmagazines=20 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
\ No newline at end of file
Modified: code/trunk/data/levels/includes/weaponSettingsSwallow.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsSwallow.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsSwallow.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,22 +1,29 @@
<weaponslots>
<WeaponSlot position=" 8,1.66,-17.5" />
<WeaponSlot position="-8,1.66,-17.5" />
+ <WeaponSlot position="0,1.66,-17.5" />
</weaponslots>
<weaponsets>
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <SplitGun mode=0 munitionpershot=0 damage=6.0 muzzleoffset="0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 />
+ <SplitGun mode=0 munitionpershot=1 damage=6.0 muzzleoffset="0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 />
+ <LaserFire mode=1 munitionpershot=1 damage=10.0 muzzleoffset="0.5,0.6,1.7" />
</Weapon>
<Weapon>
- <SplitGun mode=0 munitionpershot=0 damage=6.0 muzzleoffset="-0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 />
- </Weapon>
+ <SplitGun mode=0 munitionpershot=1 damage=6.0 muzzleoffset="-0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 />
+ <LaserFire mode=1 munitionpershot=1 damage=10.0 muzzleoffset="-0.5,0.6,1.7" />
+ </Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=20 maxmagazines=20 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <SplitMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsTransporter.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTransporter.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsTransporter.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,21 +6,25 @@
<WeaponSet firemode=0 />
<WeaponSet firemode=1 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=20 maxmagazines=20 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsTurret.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTurret.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsTurret.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -4,7 +4,7 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -19,4 +19,7 @@
<HsW01 mode=0 munitionpershot=0 delay=0 damage=1 material="Flares/point_lensflare" muzzleoffset="-1.7, -1.7,-30" />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ </munition>
Modified: code/trunk/data/levels/includes/weaponSettingsTurret1.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTurret1.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsTurret1.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -4,7 +4,7 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -19,4 +19,7 @@
<HsW01 mode=0 munitionpershot=0 delay=0 damage=20 material="Flares/point_lensflare" muzzleoffset="-1.7, -1.7,-30" />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ </munition>
\ No newline at end of file
Modified: code/trunk/data/levels/includes/weaponSettingsbigship.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsbigship.oxi 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/includes/weaponSettingsbigship.oxi 2016-01-09 17:26:20 UTC (rev 11052)
@@ -9,7 +9,7 @@
<WeaponSet firemode=2 />
<WeaponSet firemode=3 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -20,21 +20,21 @@
<Weapon>
<attached>
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
<attached>
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
<SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
- <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 fuel=10 />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -45,4 +45,9 @@
<EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
</Weapon-->
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=12 maxmagazines=12 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/>
+ <LightningMunition initialmagazines=4 maxmagazines=4 munitionpermagazine=8 />
+ <RocketMunition initialmagazines=5 maxmagazines=5 munitionpermagazine=1 />
+ </munition>
\ No newline at end of file
Modified: code/trunk/data/levels/kecks.oxw
===================================================================
--- code/trunk/data/levels/kecks.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/kecks.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -347,7 +347,7 @@
<!-- Boxen um Flotte zu befreien -->
- <Pawn health=20 position="0, 112900, 0" direction="0,-1,0" name="boxDestroyed" collisionType=dynamic mass=100000 radarname = "Gravitation Box" >
+ <Pawn health=20 position="0, 112900, 0" direction="0,-1,0" name="boxDestroyed" collisionType=dynamic mass=100000 radarname = "Gravitation Box" explosionchunks=0 >
<attached>
<Model position="0,0,0" scale="10" mesh="CuboidBody.mesh" />
</attached>
@@ -358,6 +358,11 @@
<WaypointController team=1>
</WaypointController>
</controller>
+ <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" />
+ </explosion>
</Pawn>
Copied: code/trunk/data/levels/mineLevel.oxw (from rev 11051, code/branches/presentationHS15/data/levels/mineLevel.oxw)
===================================================================
--- code/trunk/data/levels/mineLevel.oxw (rev 0)
+++ code/trunk/data/levels/mineLevel.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,64 @@
+ <LevelInfo
+ name = "Mine level"
+ description = "A test level with the new mine weapon."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipEscortMine.oxt")
+ include("templates/spaceshipHover.oxt")
+?>
+
+<Level>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+
+ <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=spaceshipescortmine />
+
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
+ <Pawn team=1 health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/missionOne.oxw
===================================================================
--- code/trunk/data/levels/missionOne.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/missionOne.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -525,6 +525,11 @@
<WaypointController team=1>
</WaypointController>
</controller>
+ <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" />
+ </explosion>
</Pawn>
<Pawn health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 3">
@@ -543,6 +548,11 @@
<WaypointController team=1>
</WaypointController>
</controller>
+ <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" />
+ </explosion>
</Pawn>
<Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 2">
@@ -561,6 +571,11 @@
<collisionShapes>
<BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
</collisionShapes>
+ <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" />
+ </explosion>
</Pawn>
<Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 1">
@@ -579,6 +594,11 @@
<WaypointController team=1>
</WaypointController>
</controller>
+ <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" />
+ </explosion>
</Pawn>
<!-- @Triggers: boxtrigger1 <-> one box destroyed
@@ -1079,8 +1099,8 @@
initialshieldhealth = "80"
maxshieldhealth = "120"
shieldabsorption = "0.8"
- reloadrate = "1"
- reloadwaittime = "1"
+ shieldrechargerate = "1"
+ shieldrechargewaittime = "1"
name = "cruiser"
radarname = "Spacecruiser" >
<attached>
@@ -1658,12 +1678,12 @@
</SimpleNotification>
<!-- @Triggers: HACK. The attacktrigger6 Event is created, but does not trigger the Script.
-(WTF?) TODO: looks like a BUG
+(WTF?) TODO: looks like a BUG
Thus a distanceTrigger is created, that gets enabled, when the inner trigger gets activated.
Due to the large radius it is likely that it actually gets triggered.
-->
- <DistanceTrigger name="testDistanceTrigger" position="0,0,0" distance=10000 target="SpaceShip" stayActive="true" delay=37.0>
+ <DistanceTrigger name="testDistanceTrigger" position="0,0,0" distance=10000 target="Pawn" stayActive="true" delay=37.0>
<EventTrigger name="testEventTrigger" activations="1" stayactive="true" delay=0.1>
<events>
<trigger>
Modified: code/trunk/data/levels/notifications.oxw
===================================================================
--- code/trunk/data/levels/notifications.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/notifications.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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/trunk/data/levels/pickups.oxw
===================================================================
--- code/trunk/data/levels/pickups.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/pickups.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -35,6 +35,30 @@
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
<SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+ <!-- Boost pickup -->
+
+ <PickupSpawner pickup=smallboostpickup position="-25,-125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediumboostpickup position="0,-125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=hugeboostpickup position="25,-125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+
+ <!-- DamageBoost pickup -->
+
+ <PickupSpawner pickup=smalldamageboostpickup position="-25,-100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediumdamageboostpickup position="0,-100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=hugedamageboostpickup position="25,-100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+
+ <!-- Munition pickups -->
+
+ <PickupSpawner pickup=smallmunitionpickup position="-25,-75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=mediummunitionpickup position="0,-75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+ <PickupSpawner pickup=hugemunitionpickup position="25,-75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+
+ <!-- Shrink pickup -->
+
+ <PickupSpawner pickup=smallshrinkpickup position="-25,-50,-125" triggerDistance="20" respawnTime="60" maxSpawnedItems="5" />
+ <PickupSpawner pickup=mediumshrinkpickup position="0,-50,-125" triggerDistance="20" respawnTime="60" maxSpawnedItems="5" />
+ <PickupSpawner pickup=hugeshrinkpickup position="25,-50,-125" triggerDistance="20" respawnTime="60" maxSpawnedItems="5" />
+
<!-- Shield pickups -->
<PickupSpawner pickup=smallshieldpickup position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
@@ -62,23 +86,7 @@
<PickupSpawner pickup=hugeinvisiblepickup position="25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
<!-- Meta pickups -->
-
- <Template name=usemetapickup baseclass=MetaPickup>
- <MetaPickup representation="use" metaType="use" />
- </Template>
- <Template name=dropmetapickup baseclass=MetaPickup>
- <MetaPickup representation="drop" metaType="drop" />
- </Template>
-
- <Template name=destroymetapickup baseclass=MetaPickup>
- <MetaPickup metaType="destroy" />
- </Template>
-
- <Template name=destroycarriermetapickup baseclass=MetaPickup>
- <MetaPickup metaType="destroyCarrier" />
- </Template>
-
<PickupSpawner pickup=usemetapickup position="-25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
<PickupSpawner pickup=dropmetapickup position="0,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
<PickupSpawner pickup=destroymetapickup position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
@@ -90,34 +98,24 @@
<!-- Drone pickup -->
- <PickupSpawner pickup=dronepickup position="-50,50,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ <PickupSpawner pickup=dronepickup position="-25,100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
- <!-- DamageBoost pickup -->
-
- <PickupSpawner pickup=smalldamageboostpickup position="-50,75,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
- <PickupSpawner pickup=mediumdamageboostpickup position="-50,100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
- <PickupSpawner pickup=largedamageboostpickup position="-50,125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
-
<!-- Other pickups -->
<!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
<PickupRepresentation
- name = "MediumHealth"
- pickupName = "Medium Health Pack"
- pickupDescription = "Once used adds a medium amout of health to the ship."
+ name = "ContinousHealth"
+ pickupName = "Continous Health Pack"
+ pickupDescription = "While useing adds a medium amout of health to the ship."
spawnerTemplate = "mediumhealthpickupRepresentation"
inventoryRepresentation = "MediumHealth"
/>
<Template name=continuoushealthpickup baseclass=HealthPickup>
- <HealthPickup representation="MediumHealth" health=500 activationType=immediate healthRate=10 durationType=continuous />
+ <HealthPickup representation="ContinousHealth" health=500 activationType=immediate healthRate=10 durationType=continuous />
</Template>
<PickupSpawner pickup=continuoushealthpickup position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
-
- <PickupSpawner pickup="smallshrinkpickup" position="-25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
- <PickupSpawner pickup="mediumshrinkpickup" position="0,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
- <PickupSpawner pickup="hugeshrinkpickup" position="25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
<!-- @Objects: 4 boxes (uncontrolled pawns) -->
<Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
@@ -176,14 +174,5 @@
</collisionShapes>
</Pawn>
- <!--StaticEntity position="0,-200,0" direction="0,-1,0" collisionType=static mass=500 friction=0.01 >
- <attached>
- <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="10,10,10" />
- </collisionShapes>
- </StaticEntity-->
-
</Scene>
</Level>
Copied: code/trunk/data/levels/planetLevelHS15.oxw (from rev 11051, code/branches/presentationHS15/data/levels/planetLevelHS15.oxw)
===================================================================
--- code/trunk/data/levels/planetLevelHS15.oxw (rev 0)
+++ code/trunk/data/levels/planetLevelHS15.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,119 @@
+<LevelInfo
+ name = "Planet and City level"
+ description = "Fly into the planet. Get teleported into a city"
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipRing.oxt")
+ include("templates/spaceshipSwallow.oxt")
+?>
+
+
+<!-- Global variable definition -->
+<?lua
+PLANET_DISTANCE = 1000000
+PLANET_SCALE = 20000
+SKYBOX_SCALE = 100000
+X = 20
+Y = 20
+CELL_SIZE = 600
+?>
+
+<!-- city generator -->
+<?lua
+function randomHouses(x,y,cellSize)
+ returnString = ""
+ for currentX = 1, x, 1 do
+ for currentY = 1, y, 1 do
+ houseNr = math.floor(math.random()*7 + 1)
+ orientation = math.floor(math.random()*4)*90
+ houses = {"Glasstower1","ETH","Hausc1","PrimeTower","Hausc2","101","hausc3"}
+ scales = {100,100,100,100,100,100,100}
+ collisionShapes = {--[[Glasstower1]]"<BoxCollisionShape position=\"0,405,0\" halfExtents=\"90,405,90\" /><BoxCollisionShape position=\"0,855,0\" halfExtents=\"110, 45, 110\" /><BoxCollisionShape position=\"0,957,0\" halfExtents=\"5, 70, 5\" /> ",--[[ETH]]"<BoxCollisionShape position=\"-46.16,22.423,3.439\" halfExtents=\"89.5,30.4,151.5\" /><BoxCollisionShape position=\"105.607996,22.905,-137.980005\" halfExtents=\"31.40,23.55,39.25\" /><BoxCollisionShape position=\"105.607996,22.905,137.078003\" halfExtents=\"31.40,23.55,39.25\" /><BoxCollisionShape position=\"65.356,22.905,118.208997\" halfExtents=\"31.40,23.55,20.40\" /><BoxCollisionShape position=\"65.356,22.905,-121.712\" halfExtents=\"31.40,23.55,20.40\" /><SphereCollisionShape position=\"44.985001,60.196997,0.352 \" radius=\"31.65\" />",--[[Hausc1]]"<BoxCollisionShape position=\"0,71.43,0\" halfExtents=\"142.86, 71.43, 142.86\" /><BoxCollisionShape position=\"-71.43,285.72,-71.43\" halfExtents=\"71.43, 142.86, 71.43\" /><BoxCollisionShape position=\"71.43,428.58,0\" halfExtents=\"71.43, 285.72, 142.86\" /><BoxCollisionShape position=\"71.43,857.16,-71.43\" halfExtents=\"71.43, 142.86, 71.43\" /><BoxCollisionShape position=\"-35.715,214.29,35.715\" halfExtents=\"35.715, 71.43, 35.715\" /><BoxCollisionShape position=\"-35.715,500.01,-107.145\" halfExtents=\"35.715, 71.43, 35.715\" /><BoxCollisionShape position=\"107.145,785.73,35.715\" halfExtents=\"35.715, 71.43, 35.715\" />",--[[PrimeTower]]"<BoxCollisionShape position=\"-16.1,278.6,053.\" halfExtents=\"063,296,063\" yaw=\"-16.5\" /> <BoxCollisionShape position=\"007.1,278.6,027.3\" halfExtents=\"065,296,065\" yaw=\"-28\" /><BoxCollisionShape position=\"012.8,278.6,-63.3\" halfExtents=\"076,296,076\" yaw=\"4\" /> <BoxCollisionShape position=\"023.18,278.6,-135.4\" halfExtents=\"067.7,296,067.7\" yaw=\"-36\" />",--[[Hausc2]]"<BoxCollisionShape position=\"0,349.999,-166.667\" halfExtents=\"83.333, 349.999, 83.333\" /><BoxCollisionShape position=\"0,349.999,166.667\" halfExtents=\"83.333, 349.999, 83.333\" /><BoxCollisionShape position=\"41.666,291.666,0\" halfExtents=\"41.666, 58.333, 83.333\" /><BoxCollisionShape position=\"-41.666,524.999,0\" halfExtents=\"41.666, 58.333, 83.333\" /> ",--[[101]]"<BoxCollisionShape position=\"0,565.7,0\" halfExtents=\"76,565.7,76\" /><BoxCollisionShape position=\"-2.8,1210,1\" halfExtents=\"39,82,39\" />",--[[hausc3]]"<BoxCollisionShape position=\"0,300,-208.33\" halfExtents=\"250,0,65.1\" pitch=\"-50.194\" /><BoxCollisionShape position=\"0,300,-125\" halfExtents=\"250,0,65.1\" pitch=\"50.194\" /><BoxCollisionShape position=\"125,275,0\" halfExtents=\"48.59,0,250\" roll=\"30.964\" /><BoxCollisionShape position=\"208.33,275,0\" halfExtents=\"48.59,0,250\" roll=\"-30.964\" /><BoxCollisionShape position=\"166.67,125,0\" halfExtents=\"83.33,125,250\" /><BoxCollisionShape position=\"-83.33,125,-166.67\" halfExtents=\"166.66,125,83.33\" />"}
+ if (currentX > 0 and currentX < x and currentY > 1 --[[and currentY ~= y]]) then
+ returnString = returnString .. "<StaticEntity collisionType=\"static\" position=\"" .. (currentX*cellSize) .. "," .. (currentY*cellSize - (cellSize/2)) .. ",0\" direction=\"0,1,0\" pitch=\"0\" roll=\"0\" yaw=\"" .. orientation .. "\"> <attached> <Model position=\"0,0,0\" mesh=\"" .. houses[houseNr] .. ".mesh\" scale=\"" .. scales[houseNr] .. "\"/></attached><collisionShapes>" .. collisionShapes[houseNr] .. "</collisionShapes></StaticEntity>\n\n"
+ end
+ returnString = returnString .. "<StaticEntity collisionType=\"static\" position=\"" .. (currentX*cellSize - cellSize/2) .. "," .. (currentY*cellSize) .. ",0\" direction=\"0,1,0\" pitch=\"0\" roll=\"0\" yaw=\"0\"> <attached> <Model position=\"0,0,0\" mesh=\"CityGroundLamps.mesh\" scale=\"" .. cellSize .. "\"/><Model position=\"0,0,0\" mesh=\"CityGround.mesh\" scale=\"" .. cellSize .. "\"/></attached><collisionShapes><BoxCollisionShape position=\"0,0,0\" halfExtents=\"500,0,500\"/><BoxCollisionShape position=\"48.5,50.88,192\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"48.5,50.88,-192\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"48.5,50.88,-54\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"48.5,50.88,54\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"-48.5,50.88,192\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"-48.5,50.88,-192\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"-48.5,50.88,-54\" halfExtents=\"5,50.88,5\"/><BoxCollisionShape position=\"-48.5,50.88,54\" halfExtents=\"5,50.88,5\"/></collisionShapes></StaticEntity>\n\n"
+ end
+ end
+ return returnString
+end
+
+?>
+
+<Level>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+
+ <?lua include("includes/notifications.oxi") ?>
+
+
+ <Scene
+ ambientlight = "0.45, 0.4, 0.35"
+ skybox = "Orxonox/Starbox"
+ >
+
+
+ <Planet
+ position="<?lua print(PLANET_DISTANCE)?>,0,0"
+ scale="<?lua print(PLANET_SCALE)?>"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5.9e21"
+ mesh="planets/earth.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="0,1,0"
+ rotationrate="0.2"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage= 2
+ enablecollisiondamage= false
+ />
+
+ <DistanceTrigger name="SkyboxVisible" position="0,0,0" target="Pawn" distance="100000" stayActive="true" delay=0 />
+
+ <?lua print(randomHouses(X,Y,CELL_SIZE)) ?>
+
+ <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=0 friction=0.01 yaw=90 pitch=180 roll=90 >
+ <attached>
+ <Model position="0,0,0" mesh="skyboxHoenggerberg.mesh" scale3D="<?lua print(SKYBOX_SCALE)?>,<?lua print(SKYBOX_SCALE)?>,<?lua print(SKYBOX_SCALE)?>" lodLevel="0">
+ <events>
+ <visibility>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="SkyboxVisible"/>
+ </trigger>
+ </events>
+ </EventTrigger>
+ </visibility>
+ </events>
+ </Model>
+ </attached>
+ </StaticEntity>
+
+ <Light type="directional" position="-90,50,60" lookat="0,0,0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+ <SpawnPoint team=0 position="<?lua print(PLANET_DISTANCE - PLANET_SCALE - 2000)?>,0,0" lookat="<?lua print(PLANET_DISTANCE) ?>,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort orientation="-0.4,-0.6,0.6,0.4" />
+
+ <PortalEndPoint position="<?lua print(X*CELL_SIZE/2) ?>,<?lua print(Y*CELL_SIZE/2) ?>,500" id="3" distance="40" target="Pawn"/>
+ <PortalEndPoint position="<?lua print(PLANET_DISTANCE) ?>,0,0" id="2" distance="<?lua print(PLANET_SCALE)?>" target="Pawn"/>
+ <PortalEndPoint position="<?lua print(PLANET_DISTANCE + PLANET_SCALE + 6000) ?>,0,0" id="1" distance="40" target="Pawn"/>
+
+ <PortalLink fromID="2" toID="3" />
+ <PortalLink fromID="3" toID="1" />
+ </Scene>
+</Level>
Modified: code/trunk/data/levels/presentationHS13.oxw
===================================================================
--- code/trunk/data/levels/presentationHS13.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/presentationHS13.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -161,8 +161,8 @@
initialshieldhealth = "80"
maxshieldhealth = "120"
shieldabsorption = "0.8"
- reloadrate = "1"
- reloadwaittime = "1"
+ shieldrechargerate = "1"
+ shieldrechargewaittime = "1"
name = "Tanis1"
radarname = "Tanis Cruiser" >
<attached>
Modified: code/trunk/data/levels/shieldTest.oxw
===================================================================
--- code/trunk/data/levels/shieldTest.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/shieldTest.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -42,8 +42,8 @@
shieldabsorption= 1
- reloadrate= "10"
- reloadwaittime= 1
+ shieldrechargerate = "10"
+ shieldrechargewaittime = 1
>
<attached>
Copied: code/trunk/data/levels/shuttleAttack.oxw (from rev 11051, code/branches/presentationHS15/data/levels/shuttleAttack.oxw)
===================================================================
--- code/trunk/data/levels/shuttleAttack.oxw (rev 0)
+++ code/trunk/data/levels/shuttleAttack.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,1171 @@
+<!--TODO: Shuttle and Stations -->
+<LevelInfo
+ name = "Shuttle under Attack"
+ description = "The newly discovered hostile alien species is attacking one of our outset stations, Andromeda! There is no protecting it; you have to escort the escape shuttle to a safer location."
+ tags = "mission"
+ screenshot = "shuttleProtect.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipShuttle.oxt")
+ include("templates/FPS.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+ <templates>
+ <Template link="lodtemplate_default" />
+ </templates>
+
+ <?lua include("includes/notifications.oxi") ?>
+
+ <NotificationQueueCEGUI
+ name="narrative"
+ targets="simpleNotification"
+ size=3
+ displayTime=3.9
+ position="0.15, 0, 0.1, 0"
+ fontSize="15"
+ fontColor="0.3, 1, 0.2, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.7, 0, 0, 0"
+ />
+
+ <!-- GLOBAL LUA VARIABLES -->
+ <?lua
+ waves = 3
+ enemiesInit = 5
+ enemiesIncrease = 2
+ allies = 3
+
+ --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+ cCenter = {0, 0, 0}
+ cSpawn = {-50, 0, 0}
+ cUnit = {-2000, 0, 3000}
+ cA = {-3000, 0, 5000}
+ cB = {-3000, 0, -5000}
+ cC = {-2300, 0, 0}
+ dStation = {1, 0, 0}
+ cNewShip = {-2100, 0, 4100}
+ cFPSGround = {-2300, 800, 0}
+ cFPS = {-2300, 1000, 0}
+ cField1 = {400, 0, 2500}
+ cField2 = {400, 0, -2500}
+ cPlanet1 = {8000, -2000, 15000}
+ cPlanet2 = {-20000, 4000, -1000}
+ rAllies = {3000, -2000} --[[ To be addressed directly, hence r. Do not permute! ]]--
+
+ --[[ Function to print Coordinates. Quotes not included! ]]--
+ function printC(coord)
+ print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+ end
+ ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/skyBoxMoreNebula"
+ hasPhysics = true
+ >
+
+ <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cA) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+ <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+ <Light type=directional position="<?lua printC(cCenter) ?>" 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"/>
+
+ <!--QUEST DEFINITIONS-->
+
+ <GlobalQuest id="quest1">
+ <QuestDescription title="Reach Andromeda Station!" description="You need to get in contact with your base! Word is enemies are preparing to attack our people and goods! Be quick!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest2" />
+ <AddQuest questId="quest2.1" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest2">
+ <QuestDescription title="Prepare to fight the Enemy" description="You need to be prepared, mentally and physically! So gather all your strength and forces to destroy those space pirates!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <subquests>
+ <GlobalQuest id="quest2.1">
+ <QuestDescription title="> Get a better Spaceship" description="Take over the faster, stronger, more secure and overall better spaceship!" failMessage="" completeMessage="" />
+ <complete-effects>
+ <AddQuest questId="quest2.2" />
+ </complete-effects>
+ </GlobalQuest>
+ <GlobalQuest id="quest2.2">
+ <QuestDescription title="> Meet your Unit" description="Your unit will help you, where ever you go. To victory or to death, they will be loyal to you!" failMessage="" completeMessage="" />
+ </GlobalQuest>
+ </subquests>
+ <complete-effects>
+ <AddQuest questId="quest3" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest3">
+ <QuestDescription title="Fight the first Wave" description="Five enemies are approaching you! There main target is the shuttle though, so destroy them - before the destroy the escape shuttle with the valuebals goods (and of course the people aboard)!" failMessage="Oh no! You have to be better, they destroyed the shuttle!" completeMessage="Good Job!" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest4" />
+ <AddQuest questId="quest4.1" />
+ <AddQuest questId="quest4.2" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest4">
+ <QuestDescription title="Prepare for the next Wave" description="This was just a scouting troop from the enemies, they know now how many there are from us and will send a bigger troop next time! Prepare yourself..." failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <subquests>
+ <GlobalQuest id="quest4.1">
+ <QuestDescription title="> Get to the Defense Station" description="Fly to the defense station, we will guard your spaceship while you will fight them with the Cannon Suit." failMessage="" completeMessage="" />
+ </GlobalQuest>
+ <GlobalQuest id="quest4.2">
+ <QuestDescription title="> Get into the Cannon Suit!" description="Dock to the defense station, you will be able to contol the Cannon Suit on top of the station, perfect for fighting off a hord of enemies!" failMessage="" completeMessage="" />
+ </GlobalQuest>
+ </subquests>
+ <complete-effects>
+ <AddQuest questId="quest5" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest5">
+ <QuestDescription title="Fight the Hord!" description="Destroy the next wave!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest6" />
+ <AddQuest questId="quest6.1" />
+ <AddQuest questId="quest6.2" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest6">
+ <QuestDescription title="Get back for the Showdown" description="Undock from the defense station and get into your Spaceship!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <subquests>
+ <GlobalQuest id="quest6.1">
+ <QuestDescription title="> Collect the local Pickups" description="There is a box with pickups close to the station, you can collect them if you want to, but it is advised to do so. They will support your task in destroying the enemies and make your life easier." failMessage="" completeMessage="" />
+ </GlobalQuest>
+ <GlobalQuest id="quest6.2">
+ <QuestDescription title="> Get back to the Shuttle" description="Fly to the Shuttle!" failMessage="" completeMessage="" />
+ </GlobalQuest>
+ </subquests>
+ <complete-effects>
+ <AddQuest questId="quest7" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest7">
+ <QuestDescription title="Fight the final Wave" description="Good gracious, another hord of pirate ships!" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <subquests>
+ </subquests>
+ </GlobalQuest>
+
+ <!--EVENTS AND TRIGGERS
+ Usable events and triggers:
+ _spawntrigger
+ _reachedA
+ _dock<A|B|C>
+ _docked<A> WIP; see below
+ -joinedUnit
+ _wave<k>
+ _killedEnemy<k>.<i>
+ _waveClear<k>
+ -->
+
+
+
+ <EventMultiTrigger name="spawntrigger" activations=1>
+ <events>
+ <trigger>
+ <EventListener event="playerSpawn" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger name="reachedA" position="<?lua printC(cA) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
+
+ <!-- HACK: just waited out 3sec for animation. Cannot link an event to the COMPLETION of a dock. How is this not possible?? -->
+ <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
+ <events>
+ <trigger>
+ <EventListener event="dockA" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger name="joinedUnit" active=false position="<?lua printC(cUnit) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+ <events>
+ <activity>
+ <EventListener event="dockedA" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <EventMultiTrigger name="wave1" activations="1" delay=4>
+ <events>
+ <trigger>
+ <EventListener event="joinedUnit" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <!-- Recursive helper function for the end-of-wave events. F*ck the event system, seriously. -->
+ <?lua
+ function enemyTriggerRecursor(i, k)
+ if i > 0 then
+ return [[
+ <EventTrigger name=killedEnemy]] .. k .. [[.]] .. i .. [[ activations=1 stayactive=true delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event=attackers]] .. k .. [[ />
+ </trigger>
+ </events>
+ ]] .. enemyTriggerRecursor(i-1, k) .. [[
+ </EventTrigger>
+ ]]
+ else return ""
+ end
+ end
+ ?>
+ <!-- Actual recursive Event(s) for the respective waves. -->
+ <?lua
+ enemies = enemiesInit
+ for k = 1, waves, 1
+ do
+ print(enemyTriggerRecursor(enemies,k))
+ ?>
+ <EventMultiTrigger name="waveClear<?lua print(k) ?>" delay=4.0>
+ <events>
+ <trigger>
+ <EventListener event="killedEnemy<?lua print(k .. [[.]] .. enemies) ?>" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+ <?lua enemies = enemies + enemiesIncrease ?>
+ <?lua end ?>
+
+ <!-- This controls the ally AI controller so it is only active when active enemies are around! -->
+ <EventDispatcher name="allyControllerDispatcher">
+ <targets>
+ <EventTarget target="allyController" />
+ </targets>
+ <events>
+ <activity>
+ <?lua
+ for k = 1, waves, 1 do
+ ?>
+ <Trigger mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="wave<?lua print(k) ?>" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="waveClear<?lua print(k) ?>" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ <?lua end ?>
+ </activity>
+ </events>
+ </EventDispatcher>
+
+ <DistanceTrigger active=false name="reachedC" position="<?lua printC(cC) ?>" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+ <events>
+ <activity>
+ <EventListener event="waveClear1" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <EventMultiTrigger name="dockedC" activations="1" stayactive="true" delay=3>
+ <events>
+ <trigger>
+ <EventListener event="dockC" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventMultiTrigger name="wave2" activations="1" delay=8>
+ <events>
+ <trigger>
+ <EventListener event="dockedC" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventMultiTrigger name="readyAfterWave2" activations="1" delay=2 stayactive=true>
+ <events>
+ <trigger>
+ <Trigger mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="undockC" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="waveClear2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <!-- See the DistanceTrigger attached to the shuttle here! !-->
+
+ <EventMultiTrigger name="wave3" activations="1" delay=12>
+ <events>
+ <trigger>
+ <EventListener event="reachedShuttle" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger active=false name="reachedB" position="<?lua printC(cB) ?>" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+ <events>
+ <activity>
+ <EventListener event="waveClear3" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <Script code="Mission endMission true" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event="reachedB" />
+ </trigger>
+ </events>
+ </Script>
+
+ <EventMultiTrigger name="missionFailed" activations="1" stayactive=true>
+ <events>
+ <trigger>
+ <EventListener event="transporter" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventMultiTrigger name="failMissionHelper" delay=4 stayactive=true>
+ <events>
+ <trigger>
+ <EventListener event="missionFailed" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger active=false name="failMission" position="<?lua printC(cA) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+ <events>
+ <activity>
+ <EventListener event="failMissionHelper" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <!--HACK: Ultimately settled on docking A to fail the mission... that makes a whole lot of sense. -->
+
+ <Script code="Mission endMission fail" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event="failMission" />
+ </trigger>
+ </events>
+ </Script>
+
+ <!--QUEST EFFECT BEACONS -->
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="quest1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="spawntrigger" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="reachedA" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest2.1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockedA" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest2.2" />
+ <CompleteQuest questId="quest2" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="joinedUnit" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest3" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="waveClear1" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest4.1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="reachedC" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest4.2" />
+ <CompleteQuest questId="quest4" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockedC" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest5" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="waveClear2" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest6.1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="gotPickups" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest6.2" />
+ <CompleteQuest questId="quest6" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="reachedShuttle" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest7" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="waveClear3" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <!--NOTIFICATIONS -->
+
+ <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Andromeda Station.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Our enemy is set to attack us very soon.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=8 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Please study your mission briefing!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=12 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Welcome to Andromeda, Commander.">
+ <events>
+ <trigger>
+ <EventListener event="reachedA" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="We've prepared a reinforced Ship for you.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="reachedA" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Now join our defense Team.">
+ <events>
+ <trigger>
+ <EventListener event="dockedA" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Howdy Commander! Ready to kick some alien ass?">
+ <events>
+ <trigger>
+ <EventListener event="joinedUnit" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <!-- HACK: Somehow only fires a second time if the (notification,event) pairs are separate! WTF -->
+ <?lua
+ for k = 1, waves, 1 do
+ ?>
+ <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!">
+ <events>
+ <trigger>
+ <EventListener event="wave<?lua print(k) ?>" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+ <?lua end ?>
+
+ <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
+ <events>
+ <trigger>
+ <EventListener event="attackers1" />
+ <EventListener event="attackers2" />
+ <EventListener event="attackers3" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Phew, that was close! Well done, Commmander.">
+ <events>
+ <trigger>
+ <EventListener event="waveClear1" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="But it's not over yet! Get to the defense station and dock!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="waveClear1" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="This is our powerful reinforced cannon suit.">
+ <events>
+ <trigger>
+ <EventListener event="dockedC" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="It should deal with those pesky invaders!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="dockedC" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Brilliant work, Commander! now undock again.">
+ <events>
+ <trigger>
+ <EventListener event="waveClear2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Here's some supplies for you. Shoot that crate!">
+ <events>
+ <trigger>
+ <EventListener event="readyAfterWave2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Our Intelligence reports one more wave...">
+ <events>
+ <trigger>
+ <EventListener event="reachedShuttle" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Ready to be a hero, Commander?">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="reachedShuttle" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Congrats, Commander! You saved our skin.">
+ <events>
+ <trigger>
+ <EventListener event="waveClear3" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Get over to the safe base to take a break.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="waveClear3" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="It's over... we failed. Retreat to Andromeda!">
+ <events>
+ <trigger>
+ <EventListener event="missionFailed" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <!--STATIONS -->
+
+ <!-- (Temporary) Template for stations. Used to define common features of all Stations. -->
+ <Template name="station">
+ <Pawn mass=10000000 collisionType=dynamic friction=0.01>
+ <attached>
+ <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
+ <DistanceTriggerBeacon name="NPC" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+ <BoxCollisionShape position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+ <BoxCollisionShape position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+ <BoxCollisionShape position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+ <BoxCollisionShape position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+ <BoxCollisionShape position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+ <BoxCollisionShape position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+ <BoxCollisionShape position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+ <BoxCollisionShape position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+ <BoxCollisionShape position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+ <BoxCollisionShape position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+ </collisionShapes>
+ </Pawn>
+ </Template>
+
+ <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 -->
+ <Pawn name="statA" team=0 radarname="Andromeda Station" position="<?lua printC(cA) ?>" direction="<?lua printC(dStation) ?>" yaw=-50 initialhealth=10000 maxhealth=10000>
+ <templates>
+ <Template link="station" />
+ </templates>
+ <attached>
+ <DockingTarget name="dockTargetA" />
+ <Dock position="0,0,0" active=true>
+ <animations>
+ <MoveToDockingTarget target="dockTargetA" />
+ </animations>
+ <effects>
+ <DockToShip target="newSpaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockA" />
+ </execute>
+ </events>
+ <attached>
+ <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
+ <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+ </attached>
+ </Dock>
+ </attached>
+ </Pawn>
+
+ <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 -->
+ <Pawn name="statB" team=0 radarname="Safe Base" position="<?lua printC(cB) ?>" direction="<?lua printC(dStation) ?>" yaw=210 initialhealth=10000 maxhealth=10000>
+ <templates>
+ <Template link="station" />
+ </templates>
+ <attached>
+ <DockingTarget name="dockTargetB" />
+ <Dock position="0,0,0" active=false>
+ <animations>
+ <MoveToDockingTarget target="dockTargetB" />
+ </animations>
+ <effects>
+ <DockToShip target="newSpaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockB" />
+ </execute>
+ </events>
+ <attached>
+ <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockB" />
+ <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+ </attached>
+ </Dock>
+ </attached>
+ </Pawn>
+
+ <!-- C -->
+ <Pawn name="statC" team=0 radarname="Defense Station" position="<?lua printC(cC) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
+ <templates>
+ <Template link="station" />
+ </templates>
+ <attached>
+ <DockingTarget name="dockTargetC" />
+ <Dock position="0,0,0">
+ <animations>
+ <MoveToDockingTarget target="dockTargetC" />
+ </animations>
+ <effects>
+ <DockToShip target="fpsMode" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockC" />
+ </execute>
+ </events>
+ <attached>
+ <!--HACK: We use another dock to undock back to the ship since undocking is not implemented... -->
+ <Dock position="0,0,0" active=true>
+ <effects>
+ <DockToShip target="newSpaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="undockC" />
+ </execute>
+ </events>
+ </Dock>
+ <DistanceTrigger active=false position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockC">
+ <events>
+ <activity>
+ <EventListener event="reachedC" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+ <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+ </attached>
+ </Dock>
+ </attached>
+ </Pawn>
+
+ <!-- New SpaceShip as destination of dock A-->
+ <SpaceShip
+ template = "spaceshipassff"
+ team = "0"
+ position = "<?lua printC(cNewShip) ?>"
+ lookat = "<?lua print(rAllies[2] .. ',' .. [[0]] .. ',' .. rAllies[1]) ?>"
+ health = "400"
+ initialhealth = "400"
+ maxhealth = "1500"
+ shieldhealth = "80"
+ initialshieldhealth = "80"
+ maxshieldhealth = "120"
+ shieldabsorption = "0.8"
+ reloadrate = "1"
+ reloadwaittime = "1"
+ name = "newSpaceShip"
+ radarname = "Defender" >
+ <attached>
+ <DockingTarget name="newSpaceShip" />
+ <DistanceTriggerBeacon name="newSpaceShip" />
+ </attached>
+ </SpaceShip>
+
+ <!-- FPS Player as destination of dock C -->
+ <FpsPlayer team=0 template = "fps" radarname = "Cannon Suit" position = "<?lua printC(cFPS) ?>" lookat="<?lua printC(cCenter) ?>">
+ <attached>
+ <DockingTarget name="fpsMode" />
+ <DistanceTriggerBeacon name="fpsPlayer" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="1,1,1"/>
+ </collisionShapes>
+ </FpsPlayer>
+
+ <!-- Floor for FPS Player -->
+ <StaticEntity position="<?lua printC(cFPSGround) ?>" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="80,5,80" />
+ <Billboard position="320,50,320" material="Flares/ringflare2" colour="0.2,0.4,0.8" />
+ <DistanceTrigger position="320,50,320" distance="50" target="Pawn" beaconMode="identify" targetname="fpsPlayer" name="undockC" stayactive=true />
+ <ForceField active=false position="0,0,0" mode="homogen" diameter="600" forcedirection = "0,-500,0" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="400,25,400" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <!--ELEMENTS -->
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 2000, 250, 0)
+ ?>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 2000, 250, 0)
+ ?>
+
+ <Planet
+ position="<?lua printC(cPlanet1) ?>"
+ scale="2000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/muunilinst.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="2000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
+ ?>
+
+ <Planet
+ position="<?lua printC(cPlanet2) ?>"
+ scale="3000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/planet3.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="3000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+ ?>
+
+ <Pawn team=0 health=30 position="<?lua print((cC[1]+600) .. ',' .. cC[2] .. ',' .. (cC[3]-600)) ?>" direction="0,-1,0" collisionType=dynamic mass=1000 radarname="Supplies" name="gotPickups">
+ <events>
+ <visibility>
+ <EventListener event="readyAfterWave2" />
+ </visibility>
+ <activity>
+ <EventListener event="readyAfterWave2" />
+ </activity>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="10,10,10" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </Pawn>
+
+ <?lua
+ include("includes/pickups.oxi")
+ ?>
+
+ <PickupSpawner pickup=hugeshieldpickup position="<?lua print((cC[1]+585) .. ',' .. cC[2] .. ',' .. (cC[3]-585)) ?>" triggerDistance="15" maxSpawnedItems="1">
+ <events>
+ <visibility>
+ <EventListener event="readyAfterWave2" />
+ </visibility>
+ <activity>
+ <EventListener event="readyAfterWave2" />
+ </activity>
+ </events>
+ </PickupSpawner>
+
+ <PickupSpawner pickup=crazyhealthpickup position="<?lua print((cC[1]+615) .. ',' .. cC[2] .. ',' .. (cC[3]-615)) ?>" triggerDistance="15" maxSpawnedItems="1">
+ <events>
+ <visibility>
+ <EventListener event="readyAfterWave2" />
+ </visibility>
+ <activity>
+ <EventListener event="readyAfterWave2" />
+ </activity>
+ </events>
+ </PickupSpawner>
+
+ <PickupSpawner pickup=hugespeedpickup position="<?lua print((cC[1]+585) .. ',' .. cC[2] .. ',' .. (cC[3]-615)) ?>" triggerDistance="15" maxSpawnedItems="1" >
+ <events>
+ <visibility>
+ <EventListener event="readyAfterWave2" />
+ </visibility>
+ <activity>
+ <EventListener event="readyAfterWave2" />
+ </activity>
+ </events>
+ </PickupSpawner>
+
+ <!-- Allies -->
+ <?lua
+ for i = 1, allies, 1
+ do
+ x = rAllies[1] + math.cos(2*math.pi/allies*(i+1))*100
+ y = rAllies[2] + math.sin(2*math.pi/allies*(i+1))*100
+ ?>
+ <SpaceShip visible=false active=false name="allies<?lua print(k)?>" radarname="Ally" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*100) ?>,<?lua print(x)?>" lookat="0,0,0" team=0>
+ <templates>
+ <Template link="spaceshipassff" />
+ </templates>
+ <events>
+ <visibility>
+ <EventListener event="dockedA" />
+ </visibility>
+ <activity>
+ <EventListener event="dockedA" />
+ </activity>
+ </events>
+ <attached>
+ <DistanceTriggerBeacon name="NPC" />
+ </attached>
+ <controller>
+ <!-- also see allyControllerDispatcher -->
+ <AIController name="allyController" accuracy=100 team=0 active=false />
+ </controller>
+ </SpaceShip>
+ <?lua end ?>
+
+ <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
+ <?lua
+ enemies = enemiesInit
+ for k = 1, waves, 1
+ do
+ ?>
+ <?lua
+ for i = 1, enemies, 1
+ do
+ x = math.cos(math.pi/(2*enemies - 2)*(i+k))*1500
+ y = math.sin(math.pi/(2*enemies - 2)*(i+k))*1500
+ ?>
+ <SpaceShip visible=false active=false name="attackers<?lua print(k)?>" radarname="Attacker" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*250) ?>,<?lua print(x)?>" lookat="0,0,0" team=1>
+ <templates>
+ <Template link="spaceshippirate" />
+ </templates>
+ <events>
+ <visibility>
+ <EventListener event="wave<?lua print(k)?>" />
+ </visibility>
+ <activity>
+ <EventListener event="wave<?lua print(k)?>" />
+ </activity>
+ </events>
+ <attached>
+ <DistanceTriggerBeacon name="NPC" />
+ </attached>
+ <controller>
+ <WaypointPatrolController name="attackController" accuracy=100 alertnessradius=100 team=1 active=false>
+ <waypoints>
+ <Attacher target="transporter" deletewithparent=false />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="wave<?lua print(k)?>" />
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+ <?lua end ?>
+ <?lua
+ enemies = enemies + enemiesIncrease
+ end ?>
+
+ <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
+ <SpaceShip position="<?lua printC(cA) ?>" lookat="<?lua printC(cB) ?>" team=0 name="transporter" radarname="Shuttle" >
+ <templates>
+ <Template link="spaceshipShuttle" />
+ </templates>
+ <attached>
+ <DistanceTriggerBeacon name="NPC" />
+ <DistanceTriggerBeacon name="transporter" />
+ <DistanceTrigger active=false name="reachedShuttle" position="0,0,0" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true initialhealth=1000 maxhealth=1000>
+ <events>
+ <activity>
+ <EventListener event="readyAfterWave2" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+ </attached>
+ <controller>
+ <WaypointController accuracy=10 team=0>
+ <waypoints>
+ <!-- A to B -->
+ <?lua
+ max = 5
+ for i = 1, max, 1
+ do
+ x = math.cos(math.pi*(i+1)/8)*5000
+ y = -math.sin(math.pi*(i+1)/8)*700-3000
+ ?>
+ <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+ <?lua end ?>
+
+ <!-- Return Point -->
+ <Billboard position="<?lua printC(cB) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+
+ <!-- B to A -->
+ <?lua
+ max = 5
+ for i = 1, max, 1
+ do
+ x = math.cos(math.pi*(max+2-i)/8)*5000
+ y = -math.sin(math.pi*(max+2-i)/8)*700-3000
+ ?>
+ <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+ <?lua end ?>
+
+ <!-- Start Point -->
+ <Billboard position="<?lua printC(cA) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+ </Scene>
+</Level>
Copied: code/trunk/data/levels/shuttleRetaliation.oxw (from rev 11051, code/branches/presentationHS15/data/levels/shuttleRetaliation.oxw)
===================================================================
--- code/trunk/data/levels/shuttleRetaliation.oxw (rev 0)
+++ code/trunk/data/levels/shuttleRetaliation.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,1181 @@
+<LevelInfo
+ name = "Retaliation"
+ description = "This attack cannot be met with no consequences! Commander, we order you to get back to sector 5C and erradicate the alien menace at once!"
+ tags = "mission"
+ screenshot = "retailiation.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipShuttle.oxt")
+ include("templates/FPS.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+ <templates>
+ <Template link="lodtemplate_default" />
+ </templates>
+
+ <?lua include("includes/notifications.oxi") ?>
+
+ <NotificationQueueCEGUI
+ name="narrative"
+ targets="simpleNotification"
+ size=3
+ displayTime=3.9
+ position="0.15, 0, 0.1, 0"
+ fontSize="15"
+ fontColor="0.3, 1, 0.2, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.7, 0, 0, 0"
+ />
+
+ <!-- GLOBAL LUA VARIABLES -->
+ <?lua
+
+ enemies = 2
+ allies = 2
+
+ radSector = 12000
+
+ --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+ cCenter = {0, 0, 0}
+ cSpawn = {1500, -2000, 900}
+ cSector = {-15000, -5500, -9000}
+ cSectorEntry = {-4710, -5500, -2826}
+ cPathToEntry = {{0, -2000, 0}}
+ cBeacon = {-6500, -5500, -4400}
+ cAllyWait = cBeacon
+
+ cAlly = cSpawn
+ cEnemy = {-9600, -5500, -6000}
+
+ rSection= {0, -200, 0}
+ rWingman1 = {0, -100, 100}
+ rWingman2 = {0, -100, -100}
+
+ cPlanet1 = {20000, 0, 29000}
+ cPlanet2 = {-22000, 0, -29000}
+
+ cEnemyBasePlanet = {-20000, -8000, -10000}
+
+ cField1 = {-5000, -4000, -3000}
+ cField2 = {4000, 2000, 4500}
+
+
+ --[[ Function to print Coordinates. Quotes not included! ]]--
+ function printC(coord)
+ print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+ end
+
+ --[[ Function to add Coordinates.]]--
+ function addC(coord1, coord2)
+ return {coord1[1]+coord2[1], coord1[2]+coord2[2], coord1[3]+coord2[3]}
+ end
+ ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/skyBoxMoreNebula"
+ hasPhysics = true
+ >
+
+ <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+ <Light type=directional position="<?lua printC(cSpawn) ?>" 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"/>
+
+ <!--SPAWNING-->
+
+ <Template name=commander>
+ <SpaceShip
+ template = "spaceshipassff"
+ team = "0"
+ health = "800"
+ initialhealth = "800"
+ maxhealth = "1500"
+ shieldhealth = "80"
+ initialshieldhealth = "80"
+ maxshieldhealth = "120"
+ shieldabsorption = "0.8"
+ reloadrate = "1"
+ reloadwaittime = "1"
+ name = "commander"
+ radarname = "Commander"
+ >
+ <attached>
+ <DistanceTriggerBeacon name="Commander" />
+ </attached>
+ </SpaceShip>
+ </Template>
+
+ <Template name=ally>
+ <SpaceShip
+ template = "spaceshipassff"
+ team = "0"
+ radarname = "Ally"
+ lookat = "<?lua printC(cPathToEntry[1]) ?>"
+ >
+ <attached>
+ <DistanceTriggerBeacon name="Ally" />
+ </attached>
+ </SpaceShip>
+ </Template>
+
+ <Template name=enemy>
+ <SpaceShip
+ template = "spaceshippirate"
+ team = "1"
+ radarname = "Invader"
+ lookat = "<?lua printC(cBeacon) ?>"
+ active = false
+ visible = false
+ >
+ <attached>
+ <DistanceTriggerBeacon name="Enemy" />
+ </attached>
+ </SpaceShip>
+ </Template>
+
+ <TeamSpawnPoint active=false name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cPathToEntry[1]) ?>" spawnclass=SpaceShip pawndesign=commander>
+ <events>
+ <activity>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="reachedSector" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </activity>
+ </events>
+ </TeamSpawnPoint>
+
+ <TeamSpawnPoint active=false name="altSpawn" team=0 position="<?lua printC(cBeacon) ?>" lookat="<?lua printC(cSector) ?>" spawnclass=SpaceShip pawndesign=commander>
+ <events>
+ <activity>
+ <EventListener event="reachedSector" />
+ </activity>
+ </events>
+ </TeamSpawnPoint>
+
+ <!--QUEST DEFINITIONS-->
+
+ <GlobalQuest id="quest1">
+ <QuestDescription title="Enter Sector 5C" description="It is time to retaliate against the aggressors. Get back to Sector 5C to kill every last one of them! We have you covered with <?lua print(allies) ?> of our finest Divisions. They will guide, help and protect you if necessary." failMessage="" completeMessage="" />
+ <hints>
+ <QuestHint id="quest1hint1">
+ <QuestDescription title="Markings" description="We have marked the bounds of Sector 5C in red lights, you can follow the green trail to get there." />
+ </QuestHint>
+ </hints>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest2">
+ <QuestDescription title="Find them" description="It seems they have hidden themselves, that is, their whole civilization, in fear of retaliation. Our scientists presume some cloaking technology to be in use. Look out for a way to make the aggressors visible!" failMessage="" completeMessage="" />
+ <hints>
+ <QuestHint id="quest2hint1">
+ <QuestDescription title="The detector beacon" description="Our scientists claim cloaking is generally toggled by a visible Switch called a detector beacon. Try to find a bright light in your Area and approach it!" />
+ </QuestHint>
+ </hints>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest3">
+ <QuestDescription title="Fight their army" description="You have successfully uncovered their civilization and home planet, and it is much worse than we thought... they came prepared! You have to fight their army to fulfill your mission." failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <complete-effects>
+ <AddQuest questId="quest4" />
+ <AddQuest questId="quest4.1" />
+ <AddQuest questId="quest4.2" />
+ <AddQuestHint hintId="quest4.1hint1" />
+ <AddQuestHint hintId="quest4.2hint1" />
+ </complete-effects>
+ </GlobalQuest>
+
+ <GlobalQuest id="quest4">
+ <QuestDescription title="Do the right thing" description="The aggressors have surrendered and seem to have had good reasons for their actions. Yet they did not talk to us beforehand and tried to kill us. What will you do?" failMessage="" completeMessage="" />
+ <hints>
+ </hints>
+ <subquests>
+ <GlobalQuest id="quest4.1">
+ <QuestDescription title="> Destroy their civilisation" description="Even if they had reasons, they are still murderers and can not be trusted anymore. This whole thing might even be a setup... We need to kill them and destroy their planet!" failMessage="" completeMessage="" />
+ <hints>
+ <QuestHint id="quest4.1hint1">
+ <QuestDescription title="Choosing" description="To make this choice, kill the remaining enemy ships. The divisions will follow your decision." />
+ </QuestHint>
+ </hints>
+ </GlobalQuest>
+ <GlobalQuest id="quest4.2">
+ <QuestDescription title="> Spare them and leave" description="Military tension arising from a missunderstanding is no valid reasoning for a genocide. Nothing is. We should leave and talk this out later." failMessage="" completeMessage="" />
+ <hints>
+ <QuestHint id="quest4.2hint1">
+ <QuestDescription title="Choosing" description="To make this choice, fly out of the sector. The divisions will follow your decision." />
+ </QuestHint>
+ </hints>
+ </GlobalQuest>
+ </subquests>
+ </GlobalQuest>
+
+ <!--EVENTS AND TRIGGERS
+ Usable events and triggers:
+ spawntrigger
+ -->
+
+ <EventMultiTrigger name="spawntrigger" activations=1>
+ <events>
+ <trigger>
+ <EventListener event="playerSpawn" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventMultiTrigger name="spawned" stayactive=true activations=1>
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger name="reachedSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true />
+
+ <EventMultiTrigger name="addQuest2">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=10 >
+ <events>
+ <trigger>
+ <EventListener event="reachedSector" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger name="alliesReachedWait" position="<?lua printC(cAllyWait) ?>" distance="1000" target="SpaceShip" beaconMode="identify" targetname="Ally" stayactive=true />
+
+ <!-- So the allies stall when they reached their position for negociation and don´t fire away... -->
+
+ <EventDispatcher name="allyControllerDispatcher">
+ <targets>
+ <EventTarget target="allyController" />
+ </targets>
+ <events>
+ <activity>
+ <Trigger mode=or>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="alliesReachedWait" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="noMercy" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <Trigger mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="fightBegun" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="oneUnitLeft" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </Trigger>
+ </activity>
+ </events>
+ </EventDispatcher>
+
+ <EventMultiTrigger name="hintBeacon">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=70 >
+ <events>
+ <trigger>
+ <EventListener event="reachedSector" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <DistanceTrigger name="cloakBeacon" position="<?lua printC(cBeacon) ?>" distance=100 target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true />
+
+ <EventMultiTrigger name="fightBegun" stayactive=true>
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=12>
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventDispatcher name="enemyControllerDispatcher">
+ <targets>
+ <EventTarget target="enemyController" />
+ </targets>
+ <events>
+ <activity>
+ <Trigger mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="fightBegun" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="oneUnitLeft" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </EventDispatcher>
+
+ <EventMultiTrigger name="noMercy" stayactive=true>
+ <events>
+ <trigger>
+ <EventListener event="allUnitsDown" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventMultiTrigger name="enemyPlanetMulti">
+ <events>
+ <trigger>
+ <EventListener event="enemyPlanet" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <!-- Recursive helper function for the event at the "end" of a Unit.-->
+ <?lua
+ function enemyTriggerRecursor(i, k)
+ if i > 0 then
+ return [[
+ <EventTrigger name=killedEnemy]] .. ((k-1)*4+i) .. [[ activations=1 stayactive=true delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event=enemy]] .. k .. [[ />
+ </trigger>
+ </events>
+ ]] .. enemyTriggerRecursor(i-1, k) .. [[
+ </EventTrigger>
+ ]]
+ else return ""
+ end
+ end
+ ?>
+ <!-- Actual recursive Event(s) for the respective Units. (packs of 4 Enemies that is!) -->
+ <?lua
+ for k = 1, enemies, 1
+ do
+ print(enemyTriggerRecursor(4,k))
+ ?>
+ <EventMultiTrigger name="unit<?lua print(k) ?>Down" delay=0.1 stayactive=true>
+ <events>
+ <trigger>
+ <EventListener event="killedEnemy<?lua print(k*4) ?>" />
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+ <?lua end ?>
+
+ <EventMultiTrigger name="oneUnitLeft" stayactive=true>
+ <events>
+ <trigger>
+ <Trigger mode=or>
+ <?lua
+ for k = 1, enemies, 1
+ do
+ ?>
+ <Trigger mode=and>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="unit<?lua print(k) ?>Down" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <?lua
+ for i = 1, enemies, 1
+ do
+ if not (i == k) then
+ ?>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="unit<?lua print(i) ?>Down" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <?lua end end ?>
+ </Trigger>
+ <?lua end ?>
+ </Trigger>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <EventMultiTrigger name="allUnitsDown" stayactive=true>
+ <events>
+ <trigger>
+ <Trigger mode=and>
+ <?lua
+ for k = 1, enemies, 1
+ do
+ ?>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="unit<?lua print(k) ?>Down" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <?lua end ?>
+ </Trigger>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
+
+ <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
+
+ <DistanceTrigger active=false invert=true name="almostLeft" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector-200) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true>
+ <events>
+ <activity>
+ <Trigger mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="oneUnitLeft" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="enemyPlanetMulti" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <DistanceTrigger active=false invert=true name="leftSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true>
+ <events>
+ <activity>
+ <EventListener event="oneUnitLeft" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <Script code="Mission endMission true" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event="leftSector" />
+ </trigger>
+ </events>
+ </Script>
+
+ <!--QUEST EFFECT BEACONS -->
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="quest1" />
+ <AddQuestHint HintId="quest1hint1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="spawntrigger" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest1" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="reachedSector" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="quest2" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="addQuest2" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuestHint hintId="quest2hint1
+ " />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="hintBeacon" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest2" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="cloakBeacon" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="quest3" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="fightBegun" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest3" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="oneUnitLeft" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <!--TODO: Include planet destruction and quitting -->
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="quest4" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="enemyAllGone" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+
+ <!--NOTIFICATIONS -->
+
+ <SimpleNotification broadcast="true" message="Welcome, Commander. It is time to retaliate!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Get to section 5C and erradicate the aggressors!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=8 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="That seems extreme. Is there no way around it?">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=12 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Stick to your objective, Commander. This is war.">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=16 >
+ <events>
+ <trigger>
+ <EventListener event="spawntrigger" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Huh?! The sector is empty! where are they hiding?">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=2 >
+ <events>
+ <trigger>
+ <EventListener event="reachedSector" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="They must be cloaking themselves! But we'll figure it out...">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=6 >
+ <events>
+ <trigger>
+ <EventListener event="reachedSector" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Got it! Look out for a bright light and touch it!">
+ <events>
+ <trigger>
+ <EventListener event="addQuest2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Divisions are standing by, Sir.">
+ <events>
+ <trigger>
+ <EventListener event="alliesReachedWait" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Woah! what the hell! they boobytrapped us!">
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Greetings, Humans. Are you here to resign to your menace and make amends?">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Menace? What is he on about, General?">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=8 >
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="None of your concern, Commander. Launch the attack!">
+ <events>
+ <trigger>
+ <EventTrigger stayactive="true" delay=12 >
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Unit 1 down!">
+ <events>
+ <trigger>
+ <EventListener event="unit1Down" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Unit 2 down!">
+ <events>
+ <trigger>
+ <EventListener event="unit2Down" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Unit 3 down!">
+ <events>
+ <trigger>
+ <EventListener event="unit3Down" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Unit 4 down!">
+ <events>
+ <trigger>
+ <EventListener event="unit4Down" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Please! No More! We surrender!">
+ <events>
+ <trigger>
+ <EventListener event="oneUnitLeft" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Roger that, Commander. We destroy their planet.">
+ <events>
+ <trigger>
+ <EventListener event="allUnitsDown" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="Well done, Commander! Now exfiltrate the sector!">
+ <events>
+ <trigger>
+ <EventListener event="enemyPlanetMulti" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification broadcast="true" message="This will have dire consequences, Commander!">
+ <events>
+ <trigger>
+ <EventListener event="almostLeft" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <!--ELEMENTS -->
+
+ <!-- Billboard Path to Sector 5C. Height changes in an atan shape -->
+
+ <?lua
+ for i = 1, 11, 1
+ do
+ heightNow = cPathToEntry[1][2] - (cPathToEntry[1][2]-cSectorEntry[2])*(math.atan(-1.6+0.3*i) + 1)/2
+ cBillNow = {(cSectorEntry[1]-cPathToEntry[1][1])*i/12, heightNow, (cSectorEntry[3]-cPathToEntry[1][3])*i/12}
+ cPathToEntry[i+1] = cBillNow
+ ?>
+ <Billboard position="<?lua printC(cBillNow) ?>" scale=2 material="Flares/ringflare" colour="0.2,0.9,0.2"/>
+ <?lua
+ end
+ cPathToEntry[13] = cSectorEntry
+ ?>
+
+ <Billboard position="<?lua printC(cSectorEntry) ?>" scale=5 material="Flares/ringflare" colour="0.2,0.9,0.2"/>
+
+ <!-- Circular Billboard Ring around Sector 5C -->
+
+ <?lua
+ for i = 1, 64, 1
+ do
+ rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
+ cBillNow = addC(cSector,rBillboard)
+ ?>
+ <Billboard position="<?lua printC(cBillNow) ?>" scale=10 material="Flares/lensflare" colour="1,0.2,0.2"/>
+ <?lua end ?>
+
+ <!-- Cloaking Beacon -->
+
+ <BlinkingBillboard visible=false active=false scale=2 position="<?lua printC(cBeacon) ?>" material="Flares/lensflare" frequency=1 amplitude=3 colour="0.4,0.4,1">
+ <events>
+ <activity>
+ <EventListener event="addQuest2" />
+ </activity>
+ <visibility>
+ <EventListener event="addQuest2" />
+ </visibility>
+ </events>
+ </BlinkingBillboard>
+
+ <!-- Asteroids you have to fly through to get to the EnemyBase -->
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
+ ?>
+
+ <!-- Other Asteroid-Fields -->
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
+ ?>
+
+ <!-- Planets -->
+
+ <Planet
+ position="<?lua printC(cPlanet1) ?>"
+ scale="3000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/muunilinst.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ visible=true
+ active=true
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="3000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+ ?>
+
+ <Planet
+ position="<?lua printC(cPlanet2) ?>"
+ scale="2000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/ganymede.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ visible=true
+ active=true
+ >
+ <attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="2000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+ ?>
+
+ <!-- EnemyPlanet -->
+
+ <Planet
+ position="<?lua printC(cEnemyBasePlanet) ?>"
+ scale="5000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="5000000"
+ pitch="0"
+ mesh="planets/jupiter.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ visible=false
+ active=false
+ >
+ <attached>
+ <ForceField position="0,0,0" rotationaxis="0.1,1,0.1"mode="sphere" diameter="10000" velocity="-500" />
+ </attached>
+ <events>
+ <activity>
+ <Trigger name="enemyPlanetVisible" mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="enemyPlanetMulti" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ <visibility>
+ <Trigger name="enemyPlanetVisible" mode=and>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="cloakBeacon" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="enemyPlanetMulti" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </visibility>
+ </events>
+ <collisionShapes>
+ <SphereCollisionShape position="0,0,0" radius=5000/>
+ </collisionShapes>
+ </Planet>
+
+ <!-- Pawn that represents the planet during destruction -->
+
+ <Pawn team=1 visible=false active=false scale=5000 health=500 name="enemyPlanet" position="<?lua printC(cEnemyBasePlanet) ?>" collisionType=dynamic mass=5000000 radarname="Enemy home planet">
+ <events>
+ <activity>
+ <EventListener event="allUnitsDown" />
+ </activity>
+ <visibility>
+ <EventListener event="allUnitsDown" />
+ </visibility>
+ </events>
+ <collisionShapes>
+ <SphereCollisionShape position="0,0,0" radius=5005/>
+ </collisionShapes>
+ </Pawn>
+ <!--SHIPS -->
+ <!-- one Controller to rule them all -->
+ <Pawn position = "100000, 100000, 100000">
+ <controller>
+ <MasterController>
+ </MasterController>
+ </controller>
+ </Pawn>
+ <!--Allied units-->
+
+ <?lua
+ for i = 1, allies, 1
+ do
+ rUnit = {-math.sin(math.pi*((i-1/2)/allies))*125, math.pow(-1,i)*80, math.cos(math.pi*((i-1/2)/allies))*800}
+ cAllyNow = addC(cAlly,rUnit)
+ ?>
+
+ <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(cAllyNow) ?>" name="ally<?lua print(i) ?>.D">
+ <templates>
+ <Template link=ally />
+ </templates>
+ <controller>
+ <DivisionController name="allyController" team=0 formationMode="diamond" spread=100>
+ <actionpoints>
+ <?lua
+ for i = 1, 13, 1
+ do
+ ?>
+ <Actionpoint position="<?lua printC(addC(cPathToEntry[i], rUnit)) ?>" action="fly"/>
+ <?lua end ?>
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rSection)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.S">
+ <templates>
+ <Template link=ally />
+ </templates>
+ <controller>
+ <SectionController name="allyController" team=0>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman1)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W1">
+ <templates>
+ <Template link=ally />
+ </templates>
+ <controller>
+ <WingmanController name="allyController" team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman2)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W2">
+ <templates>
+ <Template link=ally />
+ </templates>
+ <controller>
+ <WingmanController name="allyController" team=0>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+ <?lua end ?>
+
+ <!-- Enemy Units -->
+
+ <?lua
+ for k = 1, enemies, 1
+ do
+ rUnit = {125 -math.sin(math.pi*((k-1/2)/enemies))*200, math.pow(-1,k)*300, math.cos(math.pi*((k-1/2)/enemies))*1000}
+ cEnemyNow = addC(cEnemy,rUnit)
+ ?>
+
+ <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(cEnemyNow) ?>" name="enemy<?lua print(k) ?>">
+ <templates>
+ <Template link=enemy />
+ </templates>
+ <events>
+ <activity>
+ <EventListener event="cloakBeacon" />
+ </activity>
+ <visibility>
+ <EventListener event="cloakBeacon" />
+ </visibility>
+ </events>
+ <controller>
+ <DivisionController name="enemyController" active=false team=1 formationMode="diamond" spread=100>
+ <actionpoints>
+ <Actionpoint position="<?lua printC(cEnemyNow) ?>" action="fightall" />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rSection)) ?>" name="enemy<?lua print(k) ?>">
+ <templates>
+ <Template link=enemy />
+ </templates>
+ <events>
+ <activity>
+ <EventListener event="cloakBeacon" />
+ </activity>
+ <visibility>
+ <EventListener event="cloakBeacon" />
+ </visibility>
+ </events>
+ <controller>
+ <SectionController name="enemyController" active=false team=1>
+ </SectionController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman1)) ?>" lookat="0,0,0" name="enemy<?lua print(k) ?>">
+ <templates>
+ <Template link=enemy />
+ </templates>
+ <events>
+ <activity>
+ <EventListener event="cloakBeacon" />
+ </activity>
+ <visibility>
+ <EventListener event="cloakBeacon" />
+ </visibility>
+ </events>
+ <controller>
+ <WingmanController name="enemyController" active=false team=1>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman2)) ?>" name="enemy<?lua print(k) ?>">
+ <templates>
+ <Template link=enemy />
+ </templates>
+ <events>
+ <activity>
+ <EventListener event="cloakBeacon" />
+ </activity>
+ <visibility>
+ <EventListener event="cloakBeacon" />
+ </visibility>
+ </events>
+ <controller>
+ <WingmanController name="enemyController" active=false team=1>
+ </WingmanController>
+ </controller>
+ </SpaceShip>
+
+ <?lua end ?>
+
+ </Scene>
+</Level>
Modified: code/trunk/data/levels/templates/FPS.oxt
===================================================================
--- code/trunk/data/levels/templates/FPS.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/FPS.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -23,6 +23,11 @@
<collisionShapes> <!-- old values: position="0,-20,0" halfExtents="15,25,15" -->
<BoxCollisionShape position="0,-25,0" halfExtents="15,20,15" />
</collisionShapes>
+ <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" />
+ </explosion>
<camerapositions>
<CameraPosition position="-1,1,2.2" drag=false mouselook=true />
Modified: code/trunk/data/levels/templates/FPS_HS14.oxt
===================================================================
--- code/trunk/data/levels/templates/FPS_HS14.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/FPS_HS14.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -28,6 +28,11 @@
<camerapositions>
<CameraPosition position="-1,1,2.2" drag=false mouselook=true />
</camerapositions>
+ <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" />
+ </explosion>
<?lua
include("../includes/weaponSettingsFPS_HS14.oxi")
Modified: code/trunk/data/levels/templates/HeavyCruiser.oxt
===================================================================
--- code/trunk/data/levels/templates/HeavyCruiser.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/HeavyCruiser.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -18,8 +18,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 300
auxilaryThrust = 30
@@ -382,6 +382,11 @@
<BoxCollisionShape position="-11,18,58" halfExtents="10,10,10" info="HOOK, frontL"/>
<BoxCollisionShape position="11,18,58" halfExtents="10,10,10" info="HOOK, frontR"/> -->
</collisionShapes>
+ <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" />
+ </explosion>
<?lua
include("../includes/weaponSettingsHeavyCruiser.oxi")
?>
Modified: code/trunk/data/levels/templates/HeavyCruiserBody.oxt
===================================================================
--- code/trunk/data/levels/templates/HeavyCruiserBody.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/HeavyCruiserBody.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -16,8 +16,8 @@
initialshieldhealth = 300
maxshieldhealth = 500
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 300
auxilaryThrust = 30
@@ -209,6 +209,11 @@
<BoxCollisionShape position="-11,18,58" halfExtents="10,10,10" info="frontL, HOOK"/>
<BoxCollisionShape position="11,18,58" halfExtents="10,10,10" info="frontR, HOOK"/> -->
</collisionShapes>
+ <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" />
+ </explosion>
<?lua
include("../includes/weaponSettingsHeavyCruiserBody.oxi")
?>
Modified: code/trunk/data/levels/templates/ModularSpaceShipTest.oxt
===================================================================
--- code/trunk/data/levels/templates/ModularSpaceShipTest.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/ModularSpaceShipTest.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
@@ -115,6 +115,12 @@
<collisionShapes>
<BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
</collisionShapes>
+
+ <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" />
+ </explosion>
<?lua
include("../includes/weaponSettingsAssff.oxi")
?>
Modified: code/trunk/data/levels/templates/bigship.oxt
===================================================================
--- code/trunk/data/levels/templates/bigship.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/bigship.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 30
auxilaryThrust = 30
@@ -82,6 +82,18 @@
<BoxCollisionShape position="0,0,-18" halfExtents="6, 2, 18" />
</collisionShapes>
+
+ <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/weaponSettingsbigship.oxi")
?>
Modified: code/trunk/data/levels/templates/enemyInvader.oxt
===================================================================
--- code/trunk/data/levels/templates/enemyInvader.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/enemyInvader.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 10
maxshieldhealth = 10
shieldabsorption = 0.9
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 150
auxilaryThrust = 30
@@ -54,6 +54,17 @@
<BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
<BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
</collisionShapes>
+ <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/invaderWeapon.oxi")
?>
@@ -76,8 +87,8 @@
initialshieldhealth = 20
maxshieldhealth = 20
shieldabsorption = 0.9
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 150
auxilaryThrust = 30
Modified: code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt
===================================================================
--- code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,3 +1,80 @@
+<!-- Boost pickups: -->
+
+<Template name=smallboostpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.0,1.0,0.8" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.0,1.0,0.8" material="Flash" scale=0.3 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=smallboostpickup baseclass=BoostPickup>
+ <BoostPickup
+ representation = "smallboostpickup"
+ boostrefill = 0.5
+ activationType = "immediate"
+ durationType = "once"
+ />
+</Template>
+
+<Template name=mediumboostpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.0,1.0,0.8" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.0,1.0,0.8" material="Flash" scale=0.5 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=mediumboostpickup baseclass=BoostPickup>
+ <BoostPickup
+ representation = "mediumboostpickup"
+ boostrefill = 0.75
+ activationType = "immediate"
+ durationType = "once"
+ />
+</Template>
+
+<Template name=hugeboostpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.0,1.0,0.8" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.0,1.0,0.8" material="Flash" scale=0.7 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=hugeboostpickup baseclass=BoostPickup>
+ <BoostPickup
+ representation = "hugeboostpickup"
+ boostrefill = 1.0
+ activationType = "immediate"
+ durationType = "once"
+ />
+</Template>
+
<!-- Shield pickups: -->
<Template name=smallshieldpickupRepresentation>
@@ -188,6 +265,106 @@
/>
</Template>
+<!-- Munition pickups: -->
+
+<Template name=smallmunitionpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.59,0.30,0.16" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.47,0.24,0.13" material="Munition" scale=0.3 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=smallmunitionpickup baseclass=MunitionPickup>
+ <MunitionPickup
+ representation = "smallmunitionpickup"
+ activationType = "immediate"
+ durationType = "once"
+ >
+ <munitioncontainers>
+ <MunitionContainer munitiontype="LaserMunition" munitionamount=16 magazinesamount=0 />
+ <MunitionContainer munitiontype="FusionMunition" munitionamount=8 magazinesamount=0 />
+ <MunitionContainer munitiontype="LightningMunition" munitionamount=8 magazinesamount=0 />
+ </munitioncontainers>
+ </MunitionPickup>
+</Template>
+
+<Template name=mediummunitionpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.59,0.30,0.16" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.47,0.24,0.13" material="Munition" scale=0.5 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=mediummunitionpickup baseclass=MunitionPickup>
+ <MunitionPickup
+ representation = "mediummunitionpickup"
+ activationType = "immediate"
+ durationType = "once"
+ >
+ <munitioncontainers>
+ <MunitionContainer munitiontype="LaserMunition" munitionamount=32 magazinesamount=0 />
+ <MunitionContainer munitiontype="FusionMunition" munitionamount=16 magazinesamount=0 />
+ <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>
+
+<Template name=hugemunitionpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.59,0.30,0.16" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.47,0.24,0.13" material="Munition" scale=0.7 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=hugemunitionpickup baseclass=MunitionPickup>
+ <MunitionPickup
+ representation = "hugemunitionpickup"
+ activationType = "immediate"
+ durationType = "once"
+ >
+ <munitioncontainers>
+ <MunitionContainer munitiontype="LaserMunition" munitionamount=64 magazinesamount=0 />
+ <MunitionContainer munitiontype="FusionMunition" munitionamount=32 magazinesamount=0 />
+ <MunitionContainer munitiontype="LightningMunition" munitionamount=32 magazinesamount=0 />
+ <MunitionContainer munitiontype="SplitMunition" munitionamount=16 magazinesamount=0 />
+ <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>
+
<!-- Meta pickups: -->
<Template name=usepickupRepresentation>
@@ -195,9 +372,9 @@
<spawner-representation>
<StaticEntity>
<attached>
- <Billboard position="0,0,0" colour="0.60,0.97,0.23" material="Sphere2" scale=0.1>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Sphere2" scale=0.1>
<attached>
- <Billboard position="0,0,0" colour="0.40,0.81,0.10" material="Arrow" scale=0.65 />
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="ArrowUp" scale=0.65 />
</attached>
</Billboard>
</attached>
@@ -206,14 +383,18 @@
</PickupRepresentation>
</Template>
+<Template name=usemetapickup baseclass=MetaPickup>
+ <MetaPickup representation="use" metaType="use" />
+</Template>
+
<Template name=droppickupRepresentation>
<PickupRepresentation>
<spawner-representation>
<StaticEntity>
<attached>
- <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Sphere2" scale=0.1>
<attached>
- <Billboard position="0,0,0" colour="0.95,0.20,0.10" material="Arrow" scale=0.65 />
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="ArrowDown" scale=0.65 />
</attached>
</Billboard>
</attached>
@@ -222,6 +403,50 @@
</PickupRepresentation>
</Template>
+<Template name=dropmetapickup baseclass=MetaPickup>
+ <MetaPickup representation="drop" metaType="drop" />
+</Template>
+
+<Template name=destroypickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Splash" scale=0.65 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=destroymetapickup baseclass=MetaPickup>
+ <MetaPickup representation="destroy" metaType="destroy" />
+</Template>
+
+<Template name=destroycarrierpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Sphere2" scale=0.1>
+ <attached>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Asterisk" scale=0.65 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=destroycarriermetapickup baseclass=MetaPickup>
+ <MetaPickup representation="destroycarrier" metaType="destroyCarrier" />
+</Template>
+
<!-- DamageBoost pickups -->
<Template name=smalldamageboostpickupRepresentation>
@@ -231,7 +456,7 @@
<attached>
<Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
<attached>
- <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageSmall" scale=0.7 />
+ <Billboard position="0,0,0" colour="0.70,0.10,0.10" material="Damage" scale=0.3 />
</attached>
</Billboard>
</attached>
@@ -257,7 +482,7 @@
<attached>
<Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
<attached>
- <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageMedium" scale=0.7 />
+ <Billboard position="0,0,0" colour="0.70,0.10,0.10" material="Damage" scale=0.5 />
</attached>
</Billboard>
</attached>
@@ -276,14 +501,14 @@
/>
</Template>
-<Template name=largedamageboostpickupRepresentation>
+<Template name=hugedamageboostpickupRepresentation>
<PickupRepresentation>
<spawner-representation>
<StaticEntity>
<attached>
<Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
<attached>
- <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageLarge" scale=0.7 />
+ <Billboard position="0,0,0" colour="0.70,0.10,0.10" material="Damage" scale=0.7 />
</attached>
</Billboard>
</attached>
@@ -292,9 +517,9 @@
</PickupRepresentation>
</Template>
-<Template name=largedamageboostpickup baseclass=DamageBoostPickup>
+<Template name=hugedamageboostpickup baseclass=DamageBoostPickup>
<DamageBoostPickup
- representation = "largedamageboostpickup"
+ representation = "hugedamageboostpickup"
duration = 10.0
damageMultiplier = 7.0
activationType = "immediate"
@@ -497,7 +722,7 @@
<attached>
<Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Sphere2" scale=0.1>
<attached>
- <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.4 />
+ <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.35 />
</attached>
</Billboard>
</attached>
@@ -523,7 +748,7 @@
<attached>
<Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Sphere2" scale=0.1>
<attached>
- <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.7 />
+ <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.55 />
</attached>
</Billboard>
</attached>
@@ -549,7 +774,7 @@
<attached>
<Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Sphere2" scale=0.1>
<attached>
- <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=1.0 />
+ <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.75 />
</attached>
</Billboard>
</attached>
@@ -608,15 +833,15 @@
<Model scale="1" mesh="drone.mesh"/>
</attached>
<collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="1, 1, 1" />
+ <SphereCollisionShape position="0,0,0" radius=5 />
</collisionShapes>
<weaponslots>
- <WeaponSlot position=" 0, 0,0" />
+ <WeaponSlot position="0,0,0" />
</weaponslots>
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -630,7 +855,10 @@
<HsW01 mode=0 munitionpershot=0 delay=0 damage=1.5708 material="Flares/point_lensflare" muzzleoffset="-0.9, 1.1,-4" />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=2 maxmagazines=2 munitionpermagazine=10 replenishamount=1 replenishinterval=0.5/>
+ </munition>
</Drone>
</Template>
Modified: code/trunk/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipAssff.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipAssff.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -4,7 +4,6 @@
camerapositiontemplate = spaceshipassffcameras
spawnparticlesource = "Orxonox/fairytwirl"
spawnparticleduration = 3
- explosionchunks = 6
health = 100
maxhealth = 200
@@ -14,8 +13,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
@@ -56,6 +55,16 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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 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/weaponSettingsAssff.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipAssff2.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipAssff2.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipAssff2.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 130
maxshieldhealth = 150
shieldabsorption = 0.95
- reloadrate = 5
- reloadwaittime = 0.5
+ shieldrechargerate = 5
+ shieldrechargewaittime = 0.5
primaryThrust = 100
auxilaryThrust = 30
@@ -36,6 +36,8 @@
mass = 100
linearDamping = 0.7
angularDamping = 0.9999999
+
+ explosionSound = "sounds/Explosion2.ogg"
>
<engines>
<MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine2 />
@@ -54,6 +56,17 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsAssff2.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -15,8 +15,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
@@ -62,8 +62,20 @@
</collisionShapes>
+ <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/weaponSettingsCollateral.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipDodgeRace.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipDodgeRace.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipDodgeRace.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 20
maxshieldhealth = 20
shieldabsorption = 0.1
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 150
auxilaryThrust = 30
@@ -59,6 +59,17 @@
<BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
<BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
</collisionShapes>
+ <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/invaderWeapon.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipEscort.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipEscort.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipEscort.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -4,7 +4,7 @@
camerapositiontemplate = spaceshipescortcameras
spawnparticlesource = "Orxonox/fairytwirl"
spawnparticleduration = 3
- explosionchunks = 4
+ explosionchunks = 10
health = 80
maxhealth = 200
@@ -14,8 +14,8 @@
initialshieldhealth = 35
maxshieldhealth = 60
shieldabsorption = 0.9
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 150
auxilaryThrust = 30
@@ -55,6 +55,18 @@
<BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
<BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
</collisionShapes>
+ <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 mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
<?lua
include("../includes/weaponSettingsEscort.oxi")
?>
@@ -91,6 +103,9 @@
>
<EffectContainer condition="idle">
<WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=150 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=15 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
</EffectContainer>
<EffectContainer condition="not idle">
<FadingBillboard mainstate=activity active=false scale=0.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
@@ -100,9 +115,10 @@
</EffectContainer>
<EffectContainer condition="normal or boost">
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=5 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
</EffectContainer>
+
<EffectContainer condition="boost">
<Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
<Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
Copied: code/trunk/data/levels/templates/spaceshipEscortMine.oxt (from rev 11051, code/branches/presentationHS15/data/levels/templates/spaceshipEscortMine.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipEscortMine.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipEscortMine.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,127 @@
+<Template name=spaceshipescortmine>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 10
+
+ health = 80
+ maxhealth = 200
+ initialhealth = 80
+
+ shieldhealth = 35
+ initialshieldhealth = 35
+ maxshieldhealth = 60
+ shieldabsorption = 0.9
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
+
+ primaryThrust = 150
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 20
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 6
+
+ collisionType = "dynamic"
+ mass = 80
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
+ </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 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>
+ <collisionShapes>
+ <BoxCollisionShape position="0 ,0 , 3" halfExtents="10, 4,8" />
+ <BoxCollisionShape position="12.6 ,-2, 3" halfExtents="2.8,2.8,11"/>
+ <BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
+ <BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
+ </collisionShapes>
+ <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 mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
+<?lua
+ include("../includes/weaponSettingsEscortMine.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,15, 60" drag=true mouselook=true />
+ <CameraPosition position="0,20, 90" drag=true mouselook=true />
+ <CameraPosition position="0,30,120" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipescortengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2.2
+
+ speedfront = 200
+ speedback = 70
+ speedleftright = 70
+ speedupdown = 70
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 700
+ accelerationbrake = 700
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="idle">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=150 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=15 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=5 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ </EffectContainer>
+
+ </MultiStateEngine>
+</Template>
Modified: code/trunk/data/levels/templates/spaceshipGhost.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipGhost.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipGhost.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 100
maxshieldhealth = 150
shieldabsorption = 0.9
- reloadrate = 3
- reloadwaittime = 0.0
+ shieldrechargerate = 3
+ shieldrechargewaittime = 0.0
primaryThrust = 600
auxilaryThrust = 30
@@ -51,6 +51,17 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsGhost.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipH2.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipH2.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipH2.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -40,7 +40,18 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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>
+
</SpaceShip>
</Template>
Modified: code/trunk/data/levels/templates/spaceshipHXY.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipHXY.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipHXY.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -34,7 +34,18 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsHXY.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipHXYSL.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipHXYSL.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipHXYSL.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -33,7 +33,18 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsHXY.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipHeartAttack.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipHeartAttack.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipHeartAttack.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 50
maxshieldhealth = 800
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 40
auxilaryThrust = 30
@@ -62,6 +62,17 @@
<BoxCollisionShape position="5,5,4.3" halfExtents="1.4, 1.5, 1.4" />
<BoxCollisionShape position="-5,5,4.3" halfExtents="1.4, 1.5, 1.4" />
</collisionShapes>
+ <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/weaponSettingsHeartAttack.oxi")
?>
Copied: code/trunk/data/levels/templates/spaceshipHover.oxt (from rev 11051, code/branches/presentationHS15/data/levels/templates/spaceshipHover.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipHover.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipHover.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,109 @@
+<Template name=spaceshiphover>
+ <SpaceShip
+ hudtemplate = spaceshiphoverhud
+ camerapositiontemplate = spaceshiphovercameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 100
+ maxhealth = 200
+ initialhealth = 100
+
+ shieldhealth = 25
+ initialshieldhealth = 25
+ maxshieldhealth = 40
+ shieldabsorption = 0.6
+ reloadrate = 2
+ reloadwaittime = 0.5
+
+ primaryThrust = 200
+ auxilaryThrust = 30
+ rotationThrust = 25
+
+ jumpBoost = 90
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 10
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ collisionType = "dynamic"
+ mass = 100
+ linearDamping = 0.2
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 0, 0, 0" template=spaceshiphoverengine />
+ </engines>
+ <attached>
+ <Model position="0,0,-20" mesh="hovership_body.mesh" scale="5" yaw=180/>
+ <Model position="0,0,-20" mesh="hovership_engine.mesh" scale="5" yaw=180/>
+ <Model position="0,0,-20" mesh="hovership_gun.mesh" scale="5" yaw=180/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,-2 ,7" halfExtents="7, 4 ,30" />
+ </collisionShapes>
+ <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" scale=2 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+
+ <ExplosionPart mesh="explosionparts/pirate_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/pirate_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/pirate_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/pirate_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
+
+<?lua
+ include("../includes/weaponSettingsHover.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshiphovercameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,8, 5" drag=true mouselook=true />
+ <CameraPosition position="0,8,5" yaw="180" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshiphoverengine baseclass=Engine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 90
+ speedback = 40
+ speedleftright = 40
+ speedupdown = 40
+
+ accelerationfront = 500
+ accelerationbrake = 500
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.02 position=" 1.3, 0, 15" colour="1.0, 0.65, 0.2, 1.0" material="Examples/FlareZwei" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.02 position=" 0, 0, 15" colour="1.0, 0.65, 0.2, 1.0" material="Examples/FlareZwei" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.02 position="-1.3, 0, 15" colour="1.0, 0.65, 0.2, 1.0" material="Examples/FlareZwei" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.8 name=bltest position=" 0, 0, 40" colour="1.0, 0.65, 0.2, 1.0" width=10 length=800 lifetime=1 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.8 name=bltest position=" 0, 0, 40" colour="1.0, 0.65, 0.2, 1.0" width=10 length=1600 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="brake">
+ <FadingBillboard mainstate=activity active=false scale=0.5 position=" 0, 0, 40" colour="0.8, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+
+ </EffectContainer>
+ </MultiStateEngine>
+</Template>
Modified: code/trunk/data/levels/templates/spaceshipInvader.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipInvader.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipInvader.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 35
maxshieldhealth = 60
shieldabsorption = 0.9
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 150
auxilaryThrust = 30
@@ -58,6 +58,17 @@
<BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
<BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
</collisionShapes>
+ <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/invaderWeapon.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipPirate.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipPirate.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 25
maxshieldhealth = 40
shieldabsorption = 0.6
- reloadrate = 2
- reloadwaittime = 0.5
+ shieldrechargerate = 2
+ shieldrechargewaittime = 0.5
primaryThrust = 100
auxilaryThrust = 30
@@ -52,7 +52,17 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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" scale=2 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+ <ExplosionPart mesh="explosionparts/pirate_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/pirate_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/pirate_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/pirate_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
+
<?lua
include("../includes/weaponSettingsPirate.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipRace.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipRace.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipRace.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
@@ -56,6 +56,17 @@
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsAssff.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipRing.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipRing.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipRing.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 35
maxshieldhealth = 60
shieldabsorption = 0.9
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 150
auxilaryThrust = 30
@@ -52,6 +52,17 @@
<BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
<BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
</collisionShapes>
+ <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/weaponSettingsRing.oxi")
?>
Copied: code/trunk/data/levels/templates/spaceshipShuttle.oxt (from rev 11051, code/branches/presentationHS15/data/levels/templates/spaceshipShuttle.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipShuttle.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipShuttle.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,101 @@
+<Template name=spaceshipShuttle>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipTransportercameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 2000
+ maxhealth = 2500
+ initialhealth = 2000
+
+ primaryThrust = 120;
+ auxilaryThrust = 20;
+ rotationThrust = 30;
+
+ collisionType = "dynamic"
+ mass = 1000
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 0, 0, 0" template=spaceshipTransporterengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=180 pitch=0 roll=0 scale=10 mesh="Transporterspaceship.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position=" 0, 0, 20" halfExtents=" 37, 25, 80" />
+ <BoxCollisionShape position=" 0, 21, 20" halfExtents=" 37, 21, 80" />
+ <BoxCollisionShape position=" 0, 40, 110" halfExtents=" 20, 10, 40" />
+ <BoxCollisionShape position=" 0, 45, 170" halfExtents=" 33, 25, 20" />
+ <BoxCollisionShape position=" -60, 33, 0" halfExtents=" 24, 16, 120" />
+ <BoxCollisionShape position=" 60, 33, 0" halfExtents=" 24, 16, 120" />
+ <BoxCollisionShape position=" 0, 10, -90" halfExtents=" 30, 25, 30" />
+ <BoxCollisionShape position=" 0, -3, -145" halfExtents=" 20, 20, 30" />
+ </collisionShapes>
+
+<?lua
+ include("../includes/weaponSettingsTransporter.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipTransportercameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,90,350" drag=true mouselook=true />
+ <CameraPosition position="0,125, 400" drag=true mouselook=true />
+ <CameraPosition position="0,200,550" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipTransporterengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 120
+ speedback = 20
+ speedleftright = 20
+ speedupdown = 20
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 40
+ accelerationbrake = 30
+ accelerationback = 20
+ accelerationleftright = 20
+ accelerationupdown = 20
+ >
+ <EffectContainer condition="idle">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=2 name=bltest position=" -80, 33, 100" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=2 name=bltest position=" 80, 33, 100" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=2 name=bltest position=" -75, 25, -57" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=2 name=bltest position=" 75, 25, -57" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=3 name=bltest position=" -80, 33, 100" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=3 name=bltest position=" 80, 33, 100" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=3 name=bltest position=" -75, 25, -57" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=3 name=bltest position=" 75, 25, -57" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ </EffectContainer>
+ <EffectContainer condition="brake">
+ <FadingBillboard mainstate=activity active=false scale=2 position=" -75, 33, 40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=2 position=" 75, 33, 40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=1 position=" -68, 25, -115" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=1 position=" 68, 25, -115" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ </MultiStateEngine>
+</Template>
Modified: code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 75
maxshieldhealth = 90
shieldabsorption = 0.9
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 90
auxilaryThrust = 30
@@ -65,6 +65,17 @@
<BoxCollisionShape position="0,4,-59" halfExtents="18,1,16" pitch=-30/>
</collisionShapes>
+ <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/weaponSettingsSpacecruiser.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipSwallow.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipSwallow.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipSwallow.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 60
maxshieldhealth = 80
shieldabsorption = 0.75
- reloadrate = 1.5
- reloadwaittime = 0.2
+ shieldrechargerate = 1.5
+ shieldrechargewaittime = 0.2
primaryThrust = 600;
auxilaryThrust = 30;
@@ -48,6 +48,17 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsSwallow.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipTransporter.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipTransporter.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipTransporter.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -33,7 +33,18 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsTransporter.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipTransporterSL.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipTransporterSL.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipTransporterSL.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -33,7 +33,18 @@
<BoxCollisionShape position="0,0.1,-11" halfExtents="2.2, 1.8, 6" />
<BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" />
</collisionShapes>
+ <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/weaponSettingsTransporter.oxi")
?>
Modified: code/trunk/data/levels/templates/spaceshipTurret.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipTurret.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/spaceshipTurret.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -14,8 +14,8 @@
initialshieldhealth = 30
maxshieldhealth = 50
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
@@ -43,6 +43,17 @@
<collisionShapes>
<SphereCollisionShape radius="10" position = "0,0,0"/>
</collisionShapes>
+ <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/weaponSettingsTurret.oxi")
?>
Modified: code/trunk/data/levels/templates/towerdefensetower.oxt
===================================================================
--- code/trunk/data/levels/templates/towerdefensetower.oxt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/templates/towerdefensetower.oxt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -3,8 +3,8 @@
explosionchunks = 6
- reloadrate=10
- reloadwaittime=5
+ shieldrechargerate=10
+ shieldrechargewaittime=5
collisionType="none"
pitch="0"
yaw="0"
Modified: code/trunk/data/levels/towerDefense.oxw
===================================================================
--- code/trunk/data/levels/towerDefense.oxw 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/levels/towerDefense.oxw 2016-01-09 17:26:20 UTC (rev 11052)
@@ -38,8 +38,8 @@
<Template name=tower1template>
<TowerDefenseTower
explosionchunks=6
- reloadrate=10
- reloadwaittime=5
+ shieldrechargerate=10
+ shieldrechargewaittime=5
collisionType="none"
pitch="0"
yaw="0"
@@ -59,7 +59,7 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -68,15 +68,18 @@
<HsW01 mode=0 munitionpershot=0 muzzleoffset="0,0,0" damage=2 shielddamage=1 material="Flares/point_lensflare" delay=0/>
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LaserMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10 replenishamount=1 replenishinterval=0.3/>
+ </munition>
</TowerDefenseTower>
</Template>
<Template name=tower2template>
<TowerDefenseTower
explosionchunks=6
- reloadrate=10
- reloadwaittime=5
+ shieldrechargerate=10
+ shieldrechargewaittime=5
collisionType="none"
pitch="0"
yaw="0"
@@ -96,7 +99,7 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -105,7 +108,10 @@
<LightningGun mode=0 munitionpershot=0 muzzleoffset="0,0,0" damage=2 shielddamage=4 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <LightningMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ </munition>
<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>
@@ -115,8 +121,8 @@
<Template name=tower3template>
<TowerDefenseTower
explosionchunks=6
- reloadrate=10
- reloadwaittime=5
+ shieldrechargerate=10
+ shieldrechargewaittime=5
collisionType="none"
pitch="0"
yaw="0"
@@ -136,7 +142,7 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -145,15 +151,18 @@
<SplitGun mode=0 munitionpershot=0 damage=9.3 muzzleoffset=" 1.6, 1.3, -2.0" splittime=0.2 numberofsplits=2 numberofchilds=5 spread=0.1 damagereduction=3.0 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <SplitMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ </munition>
</TowerDefenseTower>
</Template>
<Template name=tower4template>
<TowerDefenseTower
explosionchunks=6
- reloadrate=10
- reloadwaittime=5
+ shieldrechargerate=10
+ shieldrechargewaittime=5
collisionType="none"
pitch="0"
yaw="0"
@@ -173,16 +182,19 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
</links>
<Weapon>
- <RocketFire mode=0 munitionpershot=0 muzzleoffset="0,0,0" damage=2 shielddamage=4 />
+ <RocketFire mode=0 munitionpershot=0 muzzleoffset="0,0,0" damage=2 shielddamage=4 fuel=10/>
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <RocketMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ </munition>
<attached>
<ParticleSpawner position="0,0,0" source="Orxonox/sparks" lifetime=3.0 autostart=1 loop=1 />
</attached>
@@ -192,8 +204,8 @@
<Template name=tower5template>
<TowerDefenseTower
explosionchunks=6
- reloadrate=10
- reloadwaittime=5
+ shieldrechargerate=10
+ shieldrechargewaittime=5
collisionType="none"
pitch="0"
yaw="0"
@@ -213,7 +225,7 @@
<weaponsets>
<WeaponSet firemode=0 />
</weaponsets>
- <weapons>
+ <weaponpacks>
<WeaponPack>
<links>
<DefaultWeaponmodeLink firemode=0 weaponmode=0 />
@@ -222,7 +234,10 @@
<IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset=" 0,0,0" freezefactor=0.5 freezetime=2.0 />
</Weapon>
</WeaponPack>
- </weapons>
+ </weaponpacks>
+ <munition>
+ <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ </munition>
</TowerDefenseTower>
</Template>
@@ -242,8 +257,8 @@
initialshieldhealth = 15
maxshieldhealth = 15
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 1000
auxilaryThrust = 30
@@ -307,8 +322,8 @@
initialshieldhealth = 0
maxshieldhealth = 0
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
@@ -380,8 +395,8 @@
initialshieldhealth = 5
maxshieldhealth = 5
shieldabsorption = 0.8
- reloadrate = 1
- reloadwaittime = 1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
primaryThrust = 100
auxilaryThrust = 30
Modified: code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/trunk/data/overlays/HUDTemplates3.oxo 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/overlays/HUDTemplates3.oxo 2016-01-09 17:26:20 UTC (rev 11052)
@@ -26,6 +26,24 @@
</OverlayGroup>
</Template>
+<Template name="rockethud">
+ <OverlayGroup name = "rockethud" scale = "1, 1">
+ <HUDRocketFuelBar
+ name = "RocketFuelBar1"
+ background = "Orxonox/BarBackground"
+ size = "0.40, 0.04"
+ position = "0.0 , 1.0 "
+ pickpoint = "0, 1"
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconFuel"
+ >
+ <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+ <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+ <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+ </HUDRocketFuelBar>
+ </OverlayGroup>
+</Template>
+
<Template name="spaceshiphud">
<OverlayGroup name = "spaceshiphud" scale = "1, 1">
<Map />
@@ -33,31 +51,46 @@
<HUDHealthBar
name = "HealthBar1"
background = "Orxonox/HealthBarBackground"
- size = "0.35, 0.0875"
- position = "0.0 , 0.9 "
+ size = "0.40, 0.08"
+ position = "0.0 , 0.85 "
pickpoint = "0, 1"
bartexture = "healthbar_bar.png"
textfont = "VeraMono"
textusebarcolour = true
- textsize = 0.039
- textoffset = "0.315, 0.05"
+ textscale = 0.4
+ textoffset = "0.325, -0.825"
textpickpoint = "0, 0"
textalign = "right"
- correctaspect = false
- textcorrectaspect = false
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconHealth"
>
<BarColour position = 0.0 colour = "0.7,0.2,0.2" />
<BarColour position = 0.5 colour = "0.7,0.7,0.2" />
<BarColour position = 1.0 colour = "0.2,0.7,0.2" />
</HUDHealthBar>
+ <HUDShieldBar
+ name = "ShieldBar1"
+ background = "Orxonox/BarBackground"
+ size = "0.40, 0.04"
+ position = "0.0 , 0.9 "
+ pickpoint = "0, 1"
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconShield"
+ >
+ <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+ <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+ <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+ </HUDShieldBar>
+
<HUDSpeedBar
name = "SpeedBar1"
background = "Orxonox/BarBackground"
- size = "0.35, 0.05"
+ size = "0.40, 0.04"
position = "0.0 , 0.95 "
pickpoint = "0, 1"
- correctaspect = false
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconSpeed"
>
<BarColour position = 0.0 colour = "0.7,0.5,0.2" />
<BarColour position = 0.5 colour = "0.2,0.7,0.2" />
@@ -66,11 +99,12 @@
<HUDBoostBar
name = "BoostBar1"
- backgroundtex = "bar1.png"
- size = "0.35, 0.05"
+ background = "Orxonox/BarBackground"
+ size = "0.40, 0.04"
position = "0.0 , 1.0 "
pickpoint = "0, 1"
- correctaspect = false
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconBoost"
>
<BarColour position = 0.0 colour = "0.7,0.2,0.2" />
<BarColour position = 0.5 colour = "0.7,0.7,0.2" />
@@ -80,24 +114,38 @@
<HUDEnemyHealthBar
name = "EnemyHealthBar"
background = "Orxonox/HealthBarBackground"
- size = "0.35, 0.0875"
- position = "1 ,0.1"
- pickpoint = "1, 1"
+ size = "0.4, 0.08"
+ position = "1 ,0"
+ pickpoint = "1, 0"
bartexture = "healthbar_bar.png"
textfont = "VeraMono"
textusebarcolour = true
- textsize = 0.039
- textoffset = "0.315, 0.05"
+ textscale = 0.4
+ textoffset = "-0.675, 0.175"
textpickpoint = "0, 0"
textalign = "right"
- correctaspect = false
- textcorrectaspect = false
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconHealth"
>
<BarColour position = 0.0 colour = "0.7,0.2,0.2" />
<BarColour position = 0.5 colour = "0.7,0.7,0.2" />
<BarColour position = 1.0 colour = "0.2,0.7,0.2" />
</HUDEnemyHealthBar>
+ <HUDEnemyShieldBar
+ name = "EnemyShieldBar1"
+ background = "Orxonox/BarBackground"
+ size = "0.40, 0.04"
+ position = "1.0 , 0.1 "
+ pickpoint = "1, 0"
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconShield"
+ >
+ <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+ <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+ <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+ </HUDEnemyShieldBar>
+
<HUDNavigation
name = "Navigation"
correctaspect = true
@@ -126,6 +174,15 @@
maximumDotSize3D = 0.06
mapAngle3D = 0.6435011
/>
+
+ <HUDWeaponSystem
+ name = "WeaponSystem"
+ correctaspect = true
+ position = "0.01, 0.01"
+ pickpoint = "0, 0"
+ visible = "true"
+ weaponModeHUDSize = "0.09, 0.03"
+ />
<HUDTimer
name = "Timer"
Copied: code/trunk/data/overlays/HoverHUD.oxo (from rev 11051, code/branches/presentationHS15/data/overlays/HoverHUD.oxo)
===================================================================
--- code/trunk/data/overlays/HoverHUD.oxo (rev 0)
+++ code/trunk/data/overlays/HoverHUD.oxo 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,46 @@
+<Template name="HoverHUD">
+ <OverlayGroup name="HoverHUD" scale = "1, 1">
+ </OverlayGroup>
+</Template>
+
+
+<Template name="spaceshiphoverhud">
+ <OverlayGroup name = "spaceshiphoverhud" scale = "1, 1">
+ <TimeHUD
+ name = "TimerHUD"
+ position = "0.95, 0.02"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "right"
+ />
+
+ <FlagHUD
+ name = "FlagHUD"
+ position = "0.05, 0.02"
+ size = "0.18, 0.05"
+ />
+
+ <HUDHealthBar
+ name = "HealthBar1"
+ background = "Orxonox/HealthBarBackground"
+ size = "0.35, 0.0875"
+ position = "0.0 , 0.97"
+ pickpoint = "0, 1"
+ bartexture = "healthbar_bar.png"
+ textfont = "VeraMono"
+ textusebarcolour = true
+ textscale = 0.4
+ textoffset = "0.325, -0.825"
+ textpickpoint = "0, 0"
+ textalign = "right"
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconHealth"
+ >
+ <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+ <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+ <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+ </HUDHealthBar>
+ </OverlayGroup>
+</Template>
Modified: code/trunk/data/overlays/InvaderHUD.oxo
===================================================================
--- code/trunk/data/overlays/InvaderHUD.oxo 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/overlays/InvaderHUD.oxo 2016-01-09 17:26:20 UTC (rev 11052)
@@ -98,12 +98,12 @@
bartexture = "healthbar_bar.png"
textfont = "VeraMono"
textusebarcolour = true
- textsize = 0.039
- textoffset = "0.315, 0.05"
+ textscale = 0.4
+ textoffset = "0.325, -0.825"
textpickpoint = "0, 0"
textalign = "right"
- correctaspect = false
- textcorrectaspect = false
+ correctaspect = true
+ iconmaterial = "Orxonox/BarIconHealth"
>
<BarColour position = 0.0 colour = "0.7,0.2,0.2" />
<BarColour position = 0.5 colour = "0.7,0.7,0.2" />
Modified: code/trunk/data/overlays/jumpHUD.oxo
===================================================================
--- code/trunk/data/overlays/jumpHUD.oxo 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/overlays/jumpHUD.oxo 2016-01-09 17:26:20 UTC (rev 11052)
@@ -36,23 +36,7 @@
showScore = false
showFuel = false
showMessages = true
- />
+ />
- <HUDBar
- name = "SpeedBar1"
- background = "Orxonox/BarBackground"
- size = "0.35, 0.05"
- position = "0.0 , 1.0 "
- pickpoint = "0, 1"
- correctaspect = false
-
- initialvalue = 50
-
- >
- <BarColour position = 0.0 colour = "0.7,0.5,0.2" />
- <BarColour position = 0.5 colour = "0.2,0.7,0.2" />
- <BarColour position = 1.0 colour = "0.7,0.2,0.2" />
- </HUDBar>
-
</OverlayGroup>
</Template>
Copied: code/trunk/data/particle/MineExpl.particle (from rev 11051, code/branches/presentationHS15/data/particle/MineExpl.particle)
===================================================================
--- code/trunk/data/particle/MineExpl.particle (rev 0)
+++ code/trunk/data/particle/MineExpl.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,95 @@
+particle_system Orxonox/MineExpl
+{
+ material PE/lensflare
+ particle_width 65.0
+ particle_height 40.0
+ quota 500
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type oriented_self
+ billboard_origin center
+ billboard_rotation_type vertex
+ point_rendering false
+ accurate_facing false
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction -1.0 0.0 0.0
+ angle 55
+ emission_rate 1250
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 1
+ time_to_live_max 2
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay_min 10
+ repeat_delay_max 10
+ colour_range_start 0 0.333333 1 1
+ colour_range_end 0 0.333333 1 1
+ }
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction 1.0 0.0 0.0
+ angle 55
+ emission_rate 200
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 2
+ time_to_live_max 2.5
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay_min 10
+ repeat_delay_max 10
+ colour_range_start 0 0.333333 1 1
+ colour_range_end 0 0.333333 1 1
+ }
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 -1.0
+ angle 55
+ emission_rate 1250
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 2
+ time_to_live_max 2.5
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay_min 10
+ repeat_delay_max 10
+ colour_range_start 0 0.333333 1 1
+ colour_range_end 0 0.333333 1 1
+ }
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 55
+ emission_rate 1250
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 2
+ time_to_live_max 2.5
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay_min 10
+ repeat_delay_max 10
+ colour_range_start 0 0.333333 1 1
+ colour_range_end 0 0.333333 1 1
+ }
+
+
+ affector Scaler
+ {
+ rate -2
+ }
+}
Copied: code/trunk/data/particle/MineExpl1.particle (from rev 11051, code/branches/presentationHS15/data/particle/MineExpl1.particle)
===================================================================
--- code/trunk/data/particle/MineExpl1.particle (rev 0)
+++ code/trunk/data/particle/MineExpl1.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,47 @@
+particle_system Orxonox/MineExpl1
+{
+ material PE/lensflare
+ particle_width 35.0
+ particle_height 35.0
+ quota 500
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type oriented_self
+ billboard_origin center
+ billboard_rotation_type vertex
+ point_rendering false
+ accurate_facing false
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 1.0 0.0
+ angle 30
+ emission_rate 2000
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 3
+ time_to_live_max 4
+ duration_min 2.0
+ duration_max 2.5
+ repeat_delay 10
+ repeat_delay_min 10
+ repeat_delay_max 10
+ colour_range_start 0 0.333333 1 1
+ colour_range_end 0 0.333333 1 1
+ }
+
+ affector DirectionRandomiser
+ {
+ randomness 5
+ scope 1
+ keep_velocity true
+ }
+ affector Scaler
+ {
+ rate -2
+ }
+}
Copied: code/trunk/data/particle/MineExpl2.particle (from rev 11051, code/branches/presentationHS15/data/particle/MineExpl2.particle)
===================================================================
--- code/trunk/data/particle/MineExpl2.particle (rev 0)
+++ code/trunk/data/particle/MineExpl2.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,47 @@
+particle_system Orxonox/MineExpl2
+{
+ material PE/lensflare
+ particle_width 35.0
+ particle_height 35.0
+ quota 500
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type oriented_self
+ billboard_origin center
+ billboard_rotation_type vertex
+ point_rendering false
+ accurate_facing false
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 -1.0 0.0
+ angle 30
+ emission_rate 2000
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 2
+ time_to_live_max 2.5
+ duration_min 0.5
+ duration_max 1.5
+ repeat_delay 10
+ repeat_delay_min 10
+ repeat_delay_max 10
+ colour_range_start 0 0.333333 1 1
+ colour_range_end 0 0.333333 1 1
+ }
+
+ affector DirectionRandomiser
+ {
+ randomness 5
+ scope 1
+ keep_velocity true
+ }
+ affector Scaler
+ {
+ rate -2
+ }
+}
Copied: code/trunk/data/particle/engine.particle (from rev 11051, code/branches/presentationHS15/data/particle/engine.particle)
===================================================================
--- code/trunk/data/particle/engine.particle (rev 0)
+++ code/trunk/data/particle/engine.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,70 @@
+particle_system Orxonox/engine
+{
+ material PE/glowEffect
+ particle_width 10.0
+ particle_height 10.0
+ quota 2000
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin center
+ billboard_rotation_type texcoord
+ point_rendering false
+ accurate_facing false
+
+
+
+ emitter Ring
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 0.5
+ height 0.5
+ depth 0
+ inner_width 0.99
+ inner_height 0.99
+ emission_rate 250
+ velocity_min 50
+ velocity_max 55
+ time_to_live_min 0.075
+ time_to_live_max 0.09
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0.333333 0 1
+ colour_range_end 1 0.333333 0 1
+ }
+
+ emitter Ring
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 0.5
+ height 0.5
+ depth 0
+ inner_width 0.1
+ inner_height 0.25
+ emission_rate 250
+ velocity_min 50
+ velocity_max 55
+ time_to_live_min 0.1
+ time_to_live_max 0.125
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0 0 1
+ colour_range_end 1 0 0 1
+ }
+
+ affector Scaler
+ {
+ rate -40
+ }
+}
Modified: code/trunk/data/particle/engineglow.particle
===================================================================
--- code/trunk/data/particle/engineglow.particle 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/particle/engineglow.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,40 +1,114 @@
-
particle_system Orxonox/engineglow
{
- quota 200
- material PE/bigFlame
- particle_width 12
- particle_height 12
- cull_each false
- renderer billboard
- billboard_type point
+ material PE/glowEffect
+ particle_width 100.0
+ particle_height 100.0
+ quota 2000
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin center
+ billboard_rotation_type texcoord
+ point_rendering false
+ accurate_facing false
- emitter HollowEllipsoid
+ emitter Ring
{
- angle 0
- colour 0.46875 0.8125 0.93359375 1
- colour_range_start .6640625 .91796875 .92578125 1
- colour_range_end .08203125 .7578125 .98046875 1
- direction 0 1 0
- emission_rate 45
- position 0 0 0
- velocity 5
- velocity_min 4
- velocity_max 6
- time_to_live 0.5
- time_to_live_min 0.2
- time_to_live_max 0.9
- duration 0
- duration_min 0
- duration_max 0
- repeat_delay 0
- repeat_delay_min 0
- repeat_delay_max 0
- width 4
- height 2.5
- depth 1.3
- inner_width 0.5
- inner_height 0.3
- inner_depth 0.2
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 150
+ height 150
+ depth 1
+ inner_width 0.99
+ inner_height 0.99
+ emission_rate 30
+ velocity_min 20
+ velocity_max 20
+ time_to_live_min 5
+ time_to_live_max 5
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 0.666667 1 0 1
+ colour_range_end 0 1 0 1
}
+
+ emitter Ring
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 130
+ height 130
+ depth 0
+ inner_width 0.99
+ inner_height 0.99
+ emission_rate 10
+ velocity_min 200
+ velocity_max 200
+ time_to_live_min 0.75
+ time_to_live_max 0.75
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 1 0 1
+ colour_range_end 1 1 0.498039 1
+ }
+
+ emitter Ring
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 80
+ height 80
+ depth 0
+ inner_width 0.99
+ inner_height 0.99
+ emission_rate 57.89
+ velocity_min 250
+ velocity_max 250
+ time_to_live_min 1
+ time_to_live_max 1
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0.333333 0 1
+ colour_range_end 1 0.333333 0 1
+ }
+
+ emitter Ring
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 50
+ height 50
+ depth 0
+ inner_width 0.01
+ inner_height 0.5
+ emission_rate 37.89
+ velocity_min 300
+ velocity_max 300
+ time_to_live_min 1.5
+ time_to_live_max 1.5
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0 0 1
+ colour_range_end 1 0 0 1
+ }
+
+ affector Scaler
+ {
+ rate -20
+ }
}
Copied: code/trunk/data/particle/ice.particle (from rev 11051, code/branches/presentationHS15/data/particle/ice.particle)
===================================================================
--- code/trunk/data/particle/ice.particle (rev 0)
+++ code/trunk/data/particle/ice.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,59 @@
+particle_system Orxonox/ice
+{
+ material PE/iceCrystal
+ particle_width 5
+ particle_height 5
+ quota 7000
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin center
+ billboard_rotation_type texcoord
+ point_rendering false
+ accurate_facing false
+
+ emitter Box
+ {
+ position 0.0 0.0 0.0
+ direction 1.0 1.0 1.0
+ angle 45
+ width 20
+ height 20
+ depth 20
+ emission_rate 200
+ velocity_min 1
+ velocity_max 1
+ time_to_live_min 3
+ time_to_live_max 6
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 1 1 1
+ colour_range_end 0.9 1 1 1
+ }
+
+ affector LinearForce
+ {
+ force_vector 0.0 -0.5 1.0
+ force_application add
+ }
+
+ affector DirectionRandomiser
+ {
+ randomness 50
+ scope 100
+ keep_velocity true
+ }
+
+ affector Rotator
+ {
+ rotation_speed_range_start 43.26
+ rotation_speed_range_end 0
+ rotation_range_start 0
+ rotation_range_end 0
+ }
+}
Copied: code/trunk/data/particle/mineparticle.particle (from rev 11051, code/branches/presentationHS15/data/particle/mineparticle.particle)
===================================================================
--- code/trunk/data/particle/mineparticle.particle (rev 0)
+++ code/trunk/data/particle/mineparticle.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,53 @@
+particle_system Orxonox/mineparticle
+{
+ material PE/lensflare
+ particle_width 5.0
+ particle_height 5.0
+ quota 2000
+ cull_each true
+ sorted true
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin bottom_right
+ billboard_rotation_type vertex
+ point_rendering false
+ accurate_facing false
+
+ emitter HollowEllipsoid
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 20
+ height 20
+ depth 20
+ inner_width 0.99
+ inner_height 0.99
+ inner_depth 0.99
+ emission_rate 20.12
+ velocity_min 1
+ velocity_max 1
+ time_to_live_min 5
+ time_to_live_max 5
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0 0 1
+ colour_range_end 1 0 0 1
+ }
+
+ affector Scaler
+ {
+ rate -2
+ }
+ affector Rotator
+ {
+ rotation_speed_range_start 100
+ rotation_speed_range_end 500
+ rotation_range_start 0
+ rotation_range_end 180
+ }
+}
Copied: code/trunk/data/particle/psygun.particle (from rev 11051, code/branches/presentationHS15/data/particle/psygun.particle)
===================================================================
--- code/trunk/data/particle/psygun.particle (rev 0)
+++ code/trunk/data/particle/psygun.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,62 @@
+particle_system Orxonox/psygun
+{
+ material PE/glowEffect
+ particle_width 200.0
+ particle_height 200.0
+ quota 300
+ cull_each false
+ sorted false
+ local_space false
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin top_right
+ billboard_rotation_type vertex
+ point_rendering false
+ accurate_facing true
+
+ emitter Point
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 1.0 0.0
+ angle 154.8
+ emission_rate 400
+ velocity_min 100
+ velocity_max 300
+ time_to_live_min 0
+ time_to_live_max 3.38
+ duration_min 1
+ duration_max 1
+ repeat_delay_min 0.11
+ repeat_delay_max 2.81
+ colour_range_start 0.666667 0 0.498039 1
+ colour_range_end 1 0 0.498039 1
+ }
+
+ affector LinearForce
+ {
+ force_vector 0.0 12.32 0.0
+ force_application add
+ }
+
+ affector Rotator
+ {
+ rotation_speed_range_start 100
+ rotation_speed_range_end 500
+ rotation_range_start 0
+ rotation_range_end 180
+ }
+
+ affector Scaler
+ {
+ rate -98.82
+ }
+
+ affector ColourFader
+ {
+ red -0.93
+ green -1
+ blue 1
+ alpha -1
+ }
+}
Modified: code/trunk/data/particle/rocketfire.particle
===================================================================
--- code/trunk/data/particle/rocketfire.particle 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/data/particle/rocketfire.particle 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,50 +1,63 @@
particle_system Orxonox/rocketfire
{
- quota 300
- material PE/explosion
- particle_width 15
- particle_height 5
- cull_each false
- renderer billboard
- sorted false
- local_space false
- iteration_interval 0
- nonvisible_update_timeout 0
- billboard_type point
- billboard_origin center
- billboard_rotation_type texcoord
- common_up_vector 0 1 0
- point_rendering false
- accurate_facing false
+ material PE/glowEffect
+ particle_width 2
+ particle_height 2
+ quota 10000
+ cull_each true
+ sorted true
+ local_space true
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin center
+ billboard_rotation_type texcoord
+ point_rendering false
+ accurate_facing false
emitter Ellipsoid
{
- angle 2
- colour 1 0.682759 1 1
- colour_range_start 1 0.682759 1 1
- colour_range_end 1 0.682759 1 1
- direction 0 0 1
- emission_rate 1200
- position 0 0 3
- velocity 10
- velocity_min 10
- velocity_max 48
- time_to_live 0.1
- time_to_live_min 0.1
- time_to_live_max 0.2
- duration 0
- duration_min 0
- duration_max 0
- repeat_delay 0
- repeat_delay_min 0
- repeat_delay_max 0
- width 1.5
- height 1.5
- depth 10
+ position 0.05 0.0 2.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 0
+ height 0
+ depth 0
+ emission_rate 1200
+ velocity_min 10
+ velocity_max 20
+ time_to_live_min 0.1
+ time_to_live_max 0.1
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0.333333 0 1
+ colour_range_end 1 0 0 1
}
+ emitter Ellipsoid
+ {
+ position 0.05 0.0 2.0
+ direction 0.0 0.0 1.0
+ angle 0
+ width 0
+ height 0
+ depth 0
+ emission_rate 100
+ velocity_min 5
+ velocity_max 10
+ time_to_live_min 0.1
+ time_to_live_max 0.1
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 0.2 0.5 0.65
+ colour_range_end 0.25 0.55 0.7
+ }
affector Scaler
{
- rate -20
+ rate -8
}
}
Modified: code/trunk/src/libraries/core/CoreConfig.cc
===================================================================
--- code/trunk/src/libraries/core/CoreConfig.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/CoreConfig.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,154 +1,154 @@
-/*
- * 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:
- * ...
- *
- */
-
-#include "CoreConfig.h"
-
-#include "util/output/LogWriter.h"
-#include "util/output/OutputManager.h"
-#include "core/CoreIncludes.h"
-#include "core/config/ConfigValueIncludes.h"
-#include "core/Language.h"
-#include "core/ApplicationPaths.h"
-
-namespace orxonox
-{
- RegisterClassNoArgs(CoreConfig);
-
- CoreConfig::CoreConfig()
- : bDevMode_(false)
- , bStartIOConsole_(true)
- , lastLevelTimestamp_(0)
- , ogreConfigTimestamp_(0)
- {
- RegisterObject(CoreConfig);
- this->setConfigValues();
- }
-
- //! Function to collect the SetConfigValue-macro calls.
- void CoreConfig::setConfigValues()
- {
- SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableMaxLevel_,
- OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
- OutputManager::getInstance().getLogWriter()->getConfigurableMaxLevelName(),
- OutputManager::getInstance().getLogWriter()->configurableMaxLevel_)
- .description("The maximum level of output shown in the log file")
- .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableLevel);
- SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableAdditionalContextsMaxLevel_,
- OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
- OutputManager::getInstance().getLogWriter()->getConfigurableAdditionalContextsMaxLevelName(),
- OutputManager::getInstance().getLogWriter()->configurableAdditionalContextsMaxLevel_)
- .description("The maximum level of output shown in the log file for additional contexts")
- .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableAdditionalContextsLevel);
- SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableAdditionalContexts_,
- OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
- OutputManager::getInstance().getLogWriter()->getConfigurableAdditionalContextsName(),
- OutputManager::getInstance().getLogWriter()->configurableAdditionalContexts_)
- .description("Additional output contexts shown in the log file")
- .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableAdditionalContexts);
-
- SetConfigValue(bDevMode_, ApplicationPaths::buildDirectoryRun())
- .description("Developer mode. If not set, hides some things from the user to not confuse him.")
- .callback(this, &CoreConfig::devModeChanged);
- SetConfigValue(language_, Language::getInstance().defaultLanguage_)
- .description("The language of the in game text")
- .callback(this, &CoreConfig::languageChanged);
- SetConfigValue(bInitRandomNumberGenerator_, true)
- .description("If true, all random actions are different each time you start the game")
- .callback(this, &CoreConfig::initRandomNumberGenerator);
- SetConfigValue(bStartIOConsole_, true)
- .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)");
- SetConfigValue(lastLevelTimestamp_, 0)
- .description("Timestamp when the last level was started.");
- SetConfigValue(ogreConfigTimestamp_, 0)
- .description("Timestamp when the ogre config file was changed.");
- }
-
- /** Callback function for changes in the dev mode that affect debug levels.
- The function behaves according to these rules:
- - 'normal' mode is defined based on where the program was launched: if
- the launch path was the build directory, development mode \c on is
- normal, otherwise normal means development mode \c off.
- - Debug levels should not be hard configured (\c config instead of
- \c tconfig) in non 'normal' mode to avoid strange behaviour.
- - Changing the development mode from 'normal' to the other state will
- immediately change the debug levels to predefined values which can be
- reconfigured with \c tconfig.
- @note
- The debug levels for the IOConsole and the InGameConsole can be found
- in the Shell class. The same rules apply.
- */
- void CoreConfig::devModeChanged()
- {
- // Inform listeners
- ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
- for (; it != ObjectList<DevModeListener>::end(); ++it)
- it->devModeChanged(bDevMode_);
- }
-
- //! Callback function if the language has changed.
- void CoreConfig::languageChanged()
- {
- // Read the translation file after the language was configured
- bool success = Language::getInstance().readTranslatedLanguageFile(this->language_);
- if (!success)
- {
- // Set the language in the config-file back to the default.
- ResetConfigValue(language_);
- orxout(internal_info, context::language) << "Reset language to " << this->language_ << '.' << endl;
- }
- }
-
- void CoreConfig::initRandomNumberGenerator()
- {
- static bool bInitialized = false;
- if (!bInitialized && this->bInitRandomNumberGenerator_)
- {
- srand(static_cast<unsigned int>(time(0)));
- rand();
- bInitialized = true;
- }
- }
-
- void CoreConfig::updateLastLevelTimestamp()
- {
- ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL)));
- }
-
- void CoreConfig::updateOgreConfigTimestamp()
- {
- ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL)));
- }
-
-
- RegisterAbstractClass(DevModeListener).inheritsFrom<Listable>();
-
- DevModeListener::DevModeListener()
- {
- RegisterObject(DevModeListener);
- }
-}
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "CoreConfig.h"
+
+#include "util/output/LogWriter.h"
+#include "util/output/OutputManager.h"
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/Language.h"
+#include "core/ApplicationPaths.h"
+
+namespace orxonox
+{
+ RegisterClassNoArgs(CoreConfig);
+
+ CoreConfig::CoreConfig()
+ : bDevMode_(false)
+ , bStartIOConsole_(true)
+ , lastLevelTimestamp_(0)
+ , ogreConfigTimestamp_(0)
+ {
+ RegisterObject(CoreConfig);
+ this->setConfigValues();
+ }
+
+ //! Function to collect the SetConfigValue-macro calls.
+ void CoreConfig::setConfigValues()
+ {
+ SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableMaxLevel_,
+ OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
+ OutputManager::getInstance().getLogWriter()->getConfigurableMaxLevelName(),
+ OutputManager::getInstance().getLogWriter()->configurableMaxLevel_)
+ .description("The maximum level of output shown in the log file")
+ .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableLevel);
+ SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableAdditionalContextsMaxLevel_,
+ OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
+ OutputManager::getInstance().getLogWriter()->getConfigurableAdditionalContextsMaxLevelName(),
+ OutputManager::getInstance().getLogWriter()->configurableAdditionalContextsMaxLevel_)
+ .description("The maximum level of output shown in the log file for additional contexts")
+ .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableAdditionalContextsLevel);
+ SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableAdditionalContexts_,
+ OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
+ OutputManager::getInstance().getLogWriter()->getConfigurableAdditionalContextsName(),
+ OutputManager::getInstance().getLogWriter()->configurableAdditionalContexts_)
+ .description("Additional output contexts shown in the log file")
+ .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableAdditionalContexts);
+
+ SetConfigValue(bDevMode_, ApplicationPaths::buildDirectoryRun())
+ .description("Developer mode. If not set, hides some things from the user to not confuse him.")
+ .callback(this, &CoreConfig::devModeChanged);
+ SetConfigValue(language_, Language::getInstance().defaultLanguage_)
+ .description("The language of the in game text")
+ .callback(this, &CoreConfig::languageChanged);
+ SetConfigValue(bInitRandomNumberGenerator_, true)
+ .description("If true, all random actions are different each time you start the game")
+ .callback(this, &CoreConfig::initRandomNumberGenerator);
+ SetConfigValue(bStartIOConsole_, true)
+ .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)");
+ SetConfigValue(lastLevelTimestamp_, 0)
+ .description("Timestamp when the last level was started.");
+ SetConfigValue(ogreConfigTimestamp_, 0)
+ .description("Timestamp when the ogre config file was changed.");
+ }
+
+ /** Callback function for changes in the dev mode that affect debug levels.
+ The function behaves according to these rules:
+ - 'normal' mode is defined based on where the program was launched: if
+ the launch path was the build directory, development mode \c on is
+ normal, otherwise normal means development mode \c off.
+ - Debug levels should not be hard configured (\c config instead of
+ \c tconfig) in non 'normal' mode to avoid strange behaviour.
+ - Changing the development mode from 'normal' to the other state will
+ immediately change the debug levels to predefined values which can be
+ reconfigured with \c tconfig.
+ @note
+ The debug levels for the IOConsole and the InGameConsole can be found
+ in the Shell class. The same rules apply.
+ */
+ void CoreConfig::devModeChanged()
+ {
+ // Inform listeners
+ ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
+ for (; it != ObjectList<DevModeListener>::end(); ++it)
+ it->devModeChanged(bDevMode_);
+ }
+
+ //! Callback function if the language has changed.
+ void CoreConfig::languageChanged()
+ {
+ // Read the translation file after the language was configured
+ bool success = Language::getInstance().readTranslatedLanguageFile(this->language_);
+ if (!success)
+ {
+ // Set the language in the config-file back to the default.
+ ResetConfigValue(language_);
+ orxout(internal_info, context::language) << "Reset language to " << this->language_ << '.' << endl;
+ }
+ }
+
+ void CoreConfig::initRandomNumberGenerator()
+ {
+ static bool bInitialized = false;
+ if (!bInitialized && this->bInitRandomNumberGenerator_)
+ {
+ srand(static_cast<unsigned int>(time(0)));
+ rand();
+ bInitialized = true;
+ }
+ }
+
+ void CoreConfig::updateLastLevelTimestamp()
+ {
+ ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL)));
+ }
+
+ void CoreConfig::updateOgreConfigTimestamp()
+ {
+ ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL)));
+ }
+
+
+ RegisterAbstractClass(DevModeListener).inheritsFrom<Listable>();
+
+ DevModeListener::DevModeListener()
+ {
+ RegisterObject(DevModeListener);
+ }
+}
Property changes on: code/trunk/src/libraries/core/CoreConfig.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/CoreConfig.h
===================================================================
--- code/trunk/src/libraries/core/CoreConfig.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/CoreConfig.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,83 +1,83 @@
-/*
- * 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:
- * ...
- *
- */
-
-#ifndef _CoreConfig_H__
-#define _CoreConfig_H__
-
-#include "core/CorePrereqs.h"
-
-#include "core/config/Configurable.h"
-
-namespace orxonox
-{
- class _CoreExport CoreConfig : virtual public Configurable
- {
- public:
- CoreConfig();
-
- void setConfigValues();
-
- //! Developers bit. If returns false, some options are not available as to not confuse the normal user.
- inline bool inDevMode(void) const
- { return this->bDevMode_; }
-
- inline bool getStartIOConsole() const
- { return this->bStartIOConsole_; }
-
- void updateLastLevelTimestamp();
- inline long long getLastLevelTimestamp() const
- { return this->lastLevelTimestamp_; }
-
- void updateOgreConfigTimestamp();
- inline long long getOgreConfigTimestamp() const
- { return this->ogreConfigTimestamp_; }
-
- private:
- void devModeChanged();
- void languageChanged();
- void initRandomNumberGenerator();
-
- bool bDevMode_; //!< Developers bit. If set to false, some options are not available as to not confuse the normal user.
- std::string language_; //!< The language
- bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
- bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole
- long long lastLevelTimestamp_; ///< Timestamp when the last level was started
- long long ogreConfigTimestamp_; ///< Timestamp wehen the ogre config level was modified
- };
-
- //! Informs about changes in the Development Mode.
- class DevModeListener : virtual public Listable
- {
- public:
- DevModeListener();
- virtual ~DevModeListener() {}
- virtual void devModeChanged(bool value) = 0;
- };
-}
-
-#endif /* _CoreConfig_H__ */
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef _CoreConfig_H__
+#define _CoreConfig_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/config/Configurable.h"
+
+namespace orxonox
+{
+ class _CoreExport CoreConfig : virtual public Configurable
+ {
+ public:
+ CoreConfig();
+
+ void setConfigValues();
+
+ //! Developers bit. If returns false, some options are not available as to not confuse the normal user.
+ inline bool inDevMode(void) const
+ { return this->bDevMode_; }
+
+ inline bool getStartIOConsole() const
+ { return this->bStartIOConsole_; }
+
+ void updateLastLevelTimestamp();
+ inline long long getLastLevelTimestamp() const
+ { return this->lastLevelTimestamp_; }
+
+ void updateOgreConfigTimestamp();
+ inline long long getOgreConfigTimestamp() const
+ { return this->ogreConfigTimestamp_; }
+
+ private:
+ void devModeChanged();
+ void languageChanged();
+ void initRandomNumberGenerator();
+
+ bool bDevMode_; //!< Developers bit. If set to false, some options are not available as to not confuse the normal user.
+ std::string language_; //!< The language
+ bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
+ bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole
+ long long lastLevelTimestamp_; ///< Timestamp when the last level was started
+ long long ogreConfigTimestamp_; ///< Timestamp wehen the ogre config level was modified
+ };
+
+ //! Informs about changes in the Development Mode.
+ class DevModeListener : virtual public Listable
+ {
+ public:
+ DevModeListener();
+ virtual ~DevModeListener() {}
+ virtual void devModeChanged(bool value) = 0;
+ };
+}
+
+#endif /* _CoreConfig_H__ */
Property changes on: code/trunk/src/libraries/core/CoreConfig.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/GUIManager.cc
===================================================================
--- code/trunk/src/libraries/core/GUIManager.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/GUIManager.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -35,6 +35,10 @@
#include <OgreRenderQueue.h>
#include <OgreRenderWindow.h>
+extern "C" {
+#include <lua.h>
+}
+
#if CEGUI_VERSION >= 0x000800
# include <CEGUI/DefaultLogger.h>
# include <CEGUI/Exceptions.h>
@@ -250,10 +254,29 @@
GUIManager* GUIManager::singletonPtr_s = 0;
/*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; //Alternative: Orxonox (not fully complete yet, see the graphics menu)
- SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
- SetConsoleCommand("hideGUI", &GUIManager::hideGUI);
- SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false);
+ namespace autocompletion
+ {
+ /**
+ @brief Returns the names of all currently existing OverlayGroups.
+ */
+ ARGUMENT_COMPLETION_FUNCTION_DECLARATION(guinames)();
+ ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION(guinames)()
+ {
+ ArgumentCompletionList names;
+ const std::vector<std::string> guis = GUIManager::getInstance().getLoadedGUIs();
+ for (size_t i = 0; i < guis.size(); ++i)
+ names.push_back(ArgumentCompletionListElement(guis[i], getLowercase(guis[i])));
+ return names;
+ }
+ }
+ SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false)
+ .argumentCompleter(0, autocompletion::guinames());
+ SetConsoleCommand("hideGUI", &GUIManager::hideGUI)
+ .argumentCompleter(0, autocompletion::guinames());
+ SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false)
+ .argumentCompleter(0, autocompletion::guinames());
+
RegisterAbstractClass(GUIManager).inheritsFrom<WindowEventListener>();
/**
@@ -490,6 +513,28 @@
this->luaState_->doString(str, rootFileInfo_);
}
+ std::vector<std::string> GUIManager::getLoadedGUIs()
+ {
+ // TODO: is there a better way to read back a return value from lua? i.e. by using LuaState?
+ lua_State* L = this->luaState_->getInternalLuaState();
+
+ // push function
+ lua_getglobal(L, "getLoadedSheets");
+
+ // do the call (0 arguments, 1 result)
+ if (lua_pcall(L, 0, 1, 0) != 0)
+ orxout(internal_error) << "error running function: " << lua_tostring(L, -1) << endl;
+
+ // retrieve result
+ if (!lua_isstring(L, -1))
+ orxout(internal_error) << "function must return a string" << endl;
+ std::string value = lua_tostring(L, -1);
+ lua_pop(L, 1);
+
+ SubString tokens(value, ",");
+ return tokens.getAllStrings();
+ }
+
/** Loads a GUI sheet by Lua script
@param name
The name of the GUI (like the script name, but without the extension)
Modified: code/trunk/src/libraries/core/GUIManager.h
===================================================================
--- code/trunk/src/libraries/core/GUIManager.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/GUIManager.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -106,6 +106,8 @@
void preUpdate(const Clock& time);
+ std::vector<std::string> getLoadedGUIs();
+
void loadGUI(const std::string& name);
static void showGUI(const std::string& name, bool bHidePrevious = false, bool bNoInput = false);
void showGUIExtra(const std::string& name, const std::string& ptr, bool bHidePrevious = false, bool bNoInput = false);
Modified: code/trunk/src/libraries/core/GameConfig.cc
===================================================================
--- code/trunk/src/libraries/core/GameConfig.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/GameConfig.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,53 +1,53 @@
-/*
- * 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:
- * ...
- *
- */
-
-#include "GameConfig.h"
-#include "core/CoreIncludes.h"
-#include "core/config/ConfigValueIncludes.h"
-
-namespace orxonox
-{
- RegisterClassNoArgs(GameConfig);
-
- GameConfig::GameConfig()
- {
- RegisterObject(GameConfig);
- this->setConfigValues();
- }
-
- void GameConfig::setConfigValues()
- {
- SetConfigValue(statisticsRefreshCycle_, 250000)
- .description("Sets the time in microseconds interval at which average fps, etc. get updated.");
- SetConfigValue(statisticsAvgLength_, 1000000)
- .description("Sets the time in microseconds interval at which average fps, etc. gets calculated.");
-
- SetConfigValueExternal(fpsLimit_, "GraphicsSettings", "fpsLimit", 50)
- .description("Sets the desired frame rate (0 for no limit).");
- }
-}
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "GameConfig.h"
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+
+namespace orxonox
+{
+ RegisterClassNoArgs(GameConfig);
+
+ GameConfig::GameConfig()
+ {
+ RegisterObject(GameConfig);
+ this->setConfigValues();
+ }
+
+ void GameConfig::setConfigValues()
+ {
+ SetConfigValue(statisticsRefreshCycle_, 250000)
+ .description("Sets the time in microseconds interval at which average fps, etc. get updated.");
+ SetConfigValue(statisticsAvgLength_, 1000000)
+ .description("Sets the time in microseconds interval at which average fps, etc. gets calculated.");
+
+ SetConfigValueExternal(fpsLimit_, "GraphicsSettings", "fpsLimit", 50)
+ .description("Sets the desired frame rate (0 for no limit).");
+ }
+}
Property changes on: code/trunk/src/libraries/core/GameConfig.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/GameConfig.h
===================================================================
--- code/trunk/src/libraries/core/GameConfig.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/GameConfig.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,60 +1,60 @@
-/*
- * 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:
- * ...
- *
- */
-
-#ifndef _GameConfig_H__
-#define _GameConfig_H__
-
-#include "core/CorePrereqs.h"
-
-#include "core/config/Configurable.h"
-
-namespace orxonox
-{
- class _CoreExport GameConfig : virtual public Configurable
- {
- public:
- GameConfig();
-
- void setConfigValues();
-
- inline unsigned int getStatisticsRefreshCycle() const
- { return this->statisticsRefreshCycle_; }
- inline unsigned int getStatisticsAvgLength() const
- { return this->statisticsAvgLength_; }
- inline unsigned int getFpsLimit() const
- { return this->fpsLimit_; }
-
- private:
- // config values
- unsigned int statisticsRefreshCycle_;
- unsigned int statisticsAvgLength_;
- unsigned int fpsLimit_;
- };
-}
-
-#endif /* _GameConfig_H__ */
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef _GameConfig_H__
+#define _GameConfig_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/config/Configurable.h"
+
+namespace orxonox
+{
+ class _CoreExport GameConfig : virtual public Configurable
+ {
+ public:
+ GameConfig();
+
+ void setConfigValues();
+
+ inline unsigned int getStatisticsRefreshCycle() const
+ { return this->statisticsRefreshCycle_; }
+ inline unsigned int getStatisticsAvgLength() const
+ { return this->statisticsAvgLength_; }
+ inline unsigned int getFpsLimit() const
+ { return this->fpsLimit_; }
+
+ private:
+ // config values
+ unsigned int statisticsRefreshCycle_;
+ unsigned int statisticsAvgLength_;
+ unsigned int fpsLimit_;
+ };
+}
+
+#endif /* _GameConfig_H__ */
Property changes on: code/trunk/src/libraries/core/GameConfig.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.h
===================================================================
--- code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -160,8 +160,8 @@
which wraps the defined function. This can be accessed by calling autocompletion::functionname();
*/
#define ARGUMENT_COMPLETION_FUNCTION_DECLARATION(functionname) \
- _CoreExport ArgumentCompleter* functionname(); \
- _CoreExport ArgumentCompletionList acf_##functionname
+ ArgumentCompleter* functionname(); \
+ ArgumentCompletionList acf_##functionname
/**
@brief Used to implement an argument completion function.
@@ -195,16 +195,16 @@
{
namespace autocompletion
{
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(fallback)();
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(groupsandcommands)(const std::string& fragment);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(subcommands)(const std::string& fragment, const std::string& group);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(command)(const std::string& fragment);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(hiddencommand)(const std::string& fragment);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(files)(const std::string& fragment);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingssections)();
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsentries)(const std::string& fragment, const std::string& section);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsvalue)(const std::string& fragment, const std::string& entry, const std::string& section);
- ARGUMENT_COMPLETION_FUNCTION_DECLARATION(tclthreads)();
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(fallback)();
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(groupsandcommands)(const std::string& fragment);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(subcommands)(const std::string& fragment, const std::string& group);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(command)(const std::string& fragment);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(hiddencommand)(const std::string& fragment);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(files)(const std::string& fragment);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingssections)();
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsentries)(const std::string& fragment, const std::string& section);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsvalue)(const std::string& fragment, const std::string& entry, const std::string& section);
+ _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(tclthreads)();
}
}
Modified: code/trunk/src/libraries/core/command/ConsoleCommandIncludes.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommandIncludes.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/command/ConsoleCommandIncludes.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,44 +1,44 @@
-/*
- * 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:
- * ...
- *
- */
-
-#include "ConsoleCommandIncludes.h"
-
-#include "ConsoleCommandManager.h"
-
-namespace orxonox
-{
- void StaticallyInitializedConsoleCommand::load()
- {
- ConsoleCommandManager::getInstance().registerCommand(this->command_);
- }
-
- void StaticallyInitializedConsoleCommand::unload()
- {
- ConsoleCommandManager::getInstance().unregisterCommand(this->command_);
- }
-}
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "ConsoleCommandIncludes.h"
+
+#include "ConsoleCommandManager.h"
+
+namespace orxonox
+{
+ void StaticallyInitializedConsoleCommand::load()
+ {
+ ConsoleCommandManager::getInstance().registerCommand(this->command_);
+ }
+
+ void StaticallyInitializedConsoleCommand::unload()
+ {
+ ConsoleCommandManager::getInstance().unregisterCommand(this->command_);
+ }
+}
Property changes on: code/trunk/src/libraries/core/command/ConsoleCommandIncludes.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/command/ConsoleCommandManager.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommandManager.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/command/ConsoleCommandManager.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,189 +1,189 @@
-/*
- * 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
- @brief Implementation of the ConsoleCommand class.
-*/
-
-#include "ConsoleCommandManager.h"
-
-#include "ConsoleCommand.h"
-#include "util/StringUtils.h"
-
-namespace orxonox
-{
- ConsoleCommandManager* ConsoleCommandManager::singletonPtr_s = 0;
-
- /**
- @brief Returns the command with given group an name.
- @param group The group of the requested command
- @param name The group of the requested command
- @param bPrintError If true, an error is printed if the command doesn't exist
- */
- ConsoleCommand* ConsoleCommandManager::getCommand(const std::string& group, const std::string& name, bool bPrintError)
- {
- // find the group
- std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = this->commandMap_.find(group);
- if (it_group != this->commandMap_.end())
- {
- // find the name
- std::map<std::string, ConsoleCommand*>::const_iterator it_name = it_group->second.find(name);
- if (it_name != it_group->second.end())
- {
- // return the pointer
- return it_name->second;
- }
- }
- if (bPrintError)
- {
- if (group == "")
- orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
- else
- orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
- }
- return 0;
- }
-
- /**
- @brief Returns the command with given group an name in lowercase.
- @param group The group of the requested command in lowercase
- @param name The group of the requested command in lowercase
- @param bPrintError If true, an error is printed if the command doesn't exist
- */
- ConsoleCommand* ConsoleCommandManager::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
- {
- std::string groupLC = getLowercase(group);
- std::string nameLC = getLowercase(name);
-
- // find the group
- std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = this->commandMapLC_.find(groupLC);
- if (it_group != this->commandMapLC_.end())
- {
- // find the name
- std::map<std::string, ConsoleCommand*>::const_iterator it_name = it_group->second.find(nameLC);
- if (it_name != it_group->second.end())
- {
- // return the pointer
- return it_name->second;
- }
- }
- if (bPrintError)
- {
- if (group == "")
- orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
- else
- orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
- }
- return 0;
- }
-
- /**
- @brief Registers a new command with the groups and names that are defined by ConsoleCommand::getNames().
- */
- void ConsoleCommandManager::registerCommand(ConsoleCommand* command)
- {
- for (size_t i = 0; i < command->getNames().size(); ++i)
- {
- const ConsoleCommand::CommandName& name = command->getNames()[i];
- this->registerCommand(name.group_, name.name_, command);
- }
- }
-
- /**
- @brief Registers a new command with given group an name by adding it to the command map.
- */
- void ConsoleCommandManager::registerCommand(const std::string& group, const std::string& name, ConsoleCommand* command)
- {
- if (name == "")
- return;
-
- // check if a command with this name already exists
- if (this->getCommand(group, name) != 0)
- {
- if (group == "")
- orxout(internal_warning, context::commands) << "A console command with shortcut \"" << name << "\" already exists." << endl;
- else
- orxout(internal_warning, context::commands) << "A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << endl;
- }
- else
- {
- // add the command to the map
- this->commandMap_[group][name] = command;
- this->commandMapLC_[getLowercase(group)][getLowercase(name)] = command;
- }
- }
-
- /**
- @brief Removes the command from the command map.
- */
- void ConsoleCommandManager::unregisterCommand(ConsoleCommand* command)
- {
- // iterate through all groups
- for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::iterator it_group = this->commandMap_.begin(); it_group != this->commandMap_.end(); )
- {
- // iterate through all commands of each group
- for (std::map<std::string, ConsoleCommand*>::iterator it_name = it_group->second.begin(); it_name != it_group->second.end(); )
- {
- // erase the command
- if (it_name->second == command)
- it_group->second.erase(it_name++);
- else
- ++it_name;
- }
-
- // erase the group if it is empty now
- if (it_group->second.empty())
- this->commandMap_.erase(it_group++);
- else
- ++it_group;
- }
-
- // now the same for the lowercase-map:
-
- // iterate through all groups
- for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::iterator it_group = this->commandMapLC_.begin(); it_group != this->commandMapLC_.end(); )
- {
- // iterate through all commands of each group
- for (std::map<std::string, ConsoleCommand*>::iterator it_name = it_group->second.begin(); it_name != it_group->second.end(); )
- {
- // erase the command
- if (it_name->second == command)
- it_group->second.erase(it_name++);
- else
- ++it_name;
- }
-
- // erase the group if it is empty now
- if (it_group->second.empty())
- this->commandMapLC_.erase(it_group++);
- else
- ++it_group;
- }
- }
-}
+/*
+ * 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
+ @brief Implementation of the ConsoleCommand class.
+*/
+
+#include "ConsoleCommandManager.h"
+
+#include "ConsoleCommand.h"
+#include "util/StringUtils.h"
+
+namespace orxonox
+{
+ ConsoleCommandManager* ConsoleCommandManager::singletonPtr_s = 0;
+
+ /**
+ @brief Returns the command with given group an name.
+ @param group The group of the requested command
+ @param name The group of the requested command
+ @param bPrintError If true, an error is printed if the command doesn't exist
+ */
+ ConsoleCommand* ConsoleCommandManager::getCommand(const std::string& group, const std::string& name, bool bPrintError)
+ {
+ // find the group
+ std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = this->commandMap_.find(group);
+ if (it_group != this->commandMap_.end())
+ {
+ // find the name
+ std::map<std::string, ConsoleCommand*>::const_iterator it_name = it_group->second.find(name);
+ if (it_name != it_group->second.end())
+ {
+ // return the pointer
+ return it_name->second;
+ }
+ }
+ if (bPrintError)
+ {
+ if (group == "")
+ orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
+ else
+ orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
+ }
+ return 0;
+ }
+
+ /**
+ @brief Returns the command with given group an name in lowercase.
+ @param group The group of the requested command in lowercase
+ @param name The group of the requested command in lowercase
+ @param bPrintError If true, an error is printed if the command doesn't exist
+ */
+ ConsoleCommand* ConsoleCommandManager::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
+ {
+ std::string groupLC = getLowercase(group);
+ std::string nameLC = getLowercase(name);
+
+ // find the group
+ std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = this->commandMapLC_.find(groupLC);
+ if (it_group != this->commandMapLC_.end())
+ {
+ // find the name
+ std::map<std::string, ConsoleCommand*>::const_iterator it_name = it_group->second.find(nameLC);
+ if (it_name != it_group->second.end())
+ {
+ // return the pointer
+ return it_name->second;
+ }
+ }
+ if (bPrintError)
+ {
+ if (group == "")
+ orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
+ else
+ orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
+ }
+ return 0;
+ }
+
+ /**
+ @brief Registers a new command with the groups and names that are defined by ConsoleCommand::getNames().
+ */
+ void ConsoleCommandManager::registerCommand(ConsoleCommand* command)
+ {
+ for (size_t i = 0; i < command->getNames().size(); ++i)
+ {
+ const ConsoleCommand::CommandName& name = command->getNames()[i];
+ this->registerCommand(name.group_, name.name_, command);
+ }
+ }
+
+ /**
+ @brief Registers a new command with given group an name by adding it to the command map.
+ */
+ void ConsoleCommandManager::registerCommand(const std::string& group, const std::string& name, ConsoleCommand* command)
+ {
+ if (name == "")
+ return;
+
+ // check if a command with this name already exists
+ if (this->getCommand(group, name) != 0)
+ {
+ if (group == "")
+ orxout(internal_warning, context::commands) << "A console command with shortcut \"" << name << "\" already exists." << endl;
+ else
+ orxout(internal_warning, context::commands) << "A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << endl;
+ }
+ else
+ {
+ // add the command to the map
+ this->commandMap_[group][name] = command;
+ this->commandMapLC_[getLowercase(group)][getLowercase(name)] = command;
+ }
+ }
+
+ /**
+ @brief Removes the command from the command map.
+ */
+ void ConsoleCommandManager::unregisterCommand(ConsoleCommand* command)
+ {
+ // iterate through all groups
+ for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::iterator it_group = this->commandMap_.begin(); it_group != this->commandMap_.end(); )
+ {
+ // iterate through all commands of each group
+ for (std::map<std::string, ConsoleCommand*>::iterator it_name = it_group->second.begin(); it_name != it_group->second.end(); )
+ {
+ // erase the command
+ if (it_name->second == command)
+ it_group->second.erase(it_name++);
+ else
+ ++it_name;
+ }
+
+ // erase the group if it is empty now
+ if (it_group->second.empty())
+ this->commandMap_.erase(it_group++);
+ else
+ ++it_group;
+ }
+
+ // now the same for the lowercase-map:
+
+ // iterate through all groups
+ for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::iterator it_group = this->commandMapLC_.begin(); it_group != this->commandMapLC_.end(); )
+ {
+ // iterate through all commands of each group
+ for (std::map<std::string, ConsoleCommand*>::iterator it_name = it_group->second.begin(); it_name != it_group->second.end(); )
+ {
+ // erase the command
+ if (it_name->second == command)
+ it_group->second.erase(it_name++);
+ else
+ ++it_name;
+ }
+
+ // erase the group if it is empty now
+ if (it_group->second.empty())
+ this->commandMapLC_.erase(it_group++);
+ else
+ ++it_group;
+ }
+ }
+}
Property changes on: code/trunk/src/libraries/core/command/ConsoleCommandManager.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/commandline/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/core/commandline/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/commandline/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(CORE_SRC_FILES
- CommandLineParser.cc
-)
+ADD_SOURCE_FILES(CORE_SRC_FILES
+ CommandLineParser.cc
+)
Property changes on: code/trunk/src/libraries/core/commandline/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinder.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/input/KeyBinder.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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/trunk/src/libraries/core/input/KeyBinder.h
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinder.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/input/KeyBinder.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.cc
===================================================================
--- code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,42 +1,42 @@
-/*
- * 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:
- * ...
- *
- */
-
-#include "ScopedSingletonIncludes.h"
-
-namespace orxonox
-{
- void StaticallyInitializedScopedSingletonWrapper::load()
- {
- ScopeManager::getInstance().addListener(this->wrapper_, this->scope_);
- }
-
- void StaticallyInitializedScopedSingletonWrapper::unload()
- {
- ScopeManager::getInstance().removeListener(this->wrapper_, this->scope_);
- }
-}
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "ScopedSingletonIncludes.h"
+
+namespace orxonox
+{
+ void StaticallyInitializedScopedSingletonWrapper::load()
+ {
+ ScopeManager::getInstance().addListener(this->wrapper_, this->scope_);
+ }
+
+ void StaticallyInitializedScopedSingletonWrapper::unload()
+ {
+ ScopeManager::getInstance().removeListener(this->wrapper_, this->scope_);
+ }
+}
Property changes on: code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h
===================================================================
--- code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,103 +1,103 @@
-/*
- * 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:
- * Reto Grieder
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file
- @ingroup SingletonScope
- @brief Definition of the ManageScopedSingleton macro.
-*/
-
-#ifndef __ScopedSingletonIncludes_H__
-#define __ScopedSingletonIncludes_H__
-
-#include "core/CorePrereqs.h"
-
-#include "ScopedSingletonWrapper.h"
-#include "core/module/StaticallyInitializedInstance.h"
-
-/**
- @brief Creates an orxonox::ScopedSingletonWrapper for an orxonox::Singleton and registers it with orxonox::ScopeManager.
- @param className The name of the singleton class
- @param scope The scope in which the singleton should exist
- @param allowedToFail If true, the singleton is allowed to fail and thus a try-catch block is used when creating the singleton.
-
- If this macro is called for a singleton, it is wrapped in a ScopedSingletonWrapper and registered with ScopeManager
- and will thus be created if its scope becomes active and destroyed if is deactivated.
-
-
- Usually a singleton gets created automatically when it is first used, but it will never
- be destroyed (unless the singleton explicitly deletes itself). To allow controlled
- construction and destruction, the singleton can be put within a virtual scope. This is
- done by registering the singleton class with orxonox::ScopeManager. To
- do so, the ManageScopedSingleton() macro has to be called:
-
- @code
- ManageScopedSingleton(TestSingleton, ScopeID::Graphics, false); // muste be called in a source (*.cc) file
- @endcode
-
- @b Important: If you call ManageScopedSingleton(), you don't have to initialize singletonPtr_s anymore,
- because that's already done by the macro.
-
- Now the singleton TestSingleton gets automatically created if the scope Graphics becomes
- active and also gets destroyed if the scope is deactivated.
-
- Note that not all singletons must register with a scope, but it's recommended.
-
-*/
-#define ManageScopedSingleton(className, scope, allowedToFail) \
- className* className::singletonPtr_s = NULL; \
- static ScopedSingletonWrapper& className##ScopedSingletonWrapper \
- = (new orxonox::SI_SSW(new ClassScopedSingletonWrapper<className, allowedToFail>(#className), scope))->getWrapper()
-
-namespace orxonox
-{
- class _CoreExport StaticallyInitializedScopedSingletonWrapper : public StaticallyInitializedInstance
- {
- public:
- StaticallyInitializedScopedSingletonWrapper(ScopedSingletonWrapper* wrapper, ScopeID::Value scope)
- : StaticallyInitializedInstance(StaticInitialization::SCOPED_SINGLETON_WRAPPER)
- , wrapper_(wrapper)
- , scope_(scope)
- {}
- ~StaticallyInitializedScopedSingletonWrapper() { delete wrapper_; }
-
- virtual void load();
- virtual void unload();
-
- inline ScopedSingletonWrapper& getWrapper()
- { return *this->wrapper_; }
-
- private:
- ScopedSingletonWrapper* wrapper_;
- ScopeID::Value scope_;
- };
-
- typedef StaticallyInitializedScopedSingletonWrapper SI_SSW;
-}
-
-#endif /* __ScopedSingletonIncludes_H__ */
+/*
+ * 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:
+ * Reto Grieder
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file
+ @ingroup SingletonScope
+ @brief Definition of the ManageScopedSingleton macro.
+*/
+
+#ifndef __ScopedSingletonIncludes_H__
+#define __ScopedSingletonIncludes_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ScopedSingletonWrapper.h"
+#include "core/module/StaticallyInitializedInstance.h"
+
+/**
+ @brief Creates an orxonox::ScopedSingletonWrapper for an orxonox::Singleton and registers it with orxonox::ScopeManager.
+ @param className The name of the singleton class
+ @param scope The scope in which the singleton should exist
+ @param allowedToFail If true, the singleton is allowed to fail and thus a try-catch block is used when creating the singleton.
+
+ If this macro is called for a singleton, it is wrapped in a ScopedSingletonWrapper and registered with ScopeManager
+ and will thus be created if its scope becomes active and destroyed if is deactivated.
+
+
+ Usually a singleton gets created automatically when it is first used, but it will never
+ be destroyed (unless the singleton explicitly deletes itself). To allow controlled
+ construction and destruction, the singleton can be put within a virtual scope. This is
+ done by registering the singleton class with orxonox::ScopeManager. To
+ do so, the ManageScopedSingleton() macro has to be called:
+
+ @code
+ ManageScopedSingleton(TestSingleton, ScopeID::Graphics, false); // muste be called in a source (*.cc) file
+ @endcode
+
+ @b Important: If you call ManageScopedSingleton(), you don't have to initialize singletonPtr_s anymore,
+ because that's already done by the macro.
+
+ Now the singleton TestSingleton gets automatically created if the scope Graphics becomes
+ active and also gets destroyed if the scope is deactivated.
+
+ Note that not all singletons must register with a scope, but it's recommended.
+
+*/
+#define ManageScopedSingleton(className, scope, allowedToFail) \
+ className* className::singletonPtr_s = NULL; \
+ static ScopedSingletonWrapper& className##ScopedSingletonWrapper \
+ = (new orxonox::SI_SSW(new ClassScopedSingletonWrapper<className, allowedToFail>(#className), scope))->getWrapper()
+
+namespace orxonox
+{
+ class _CoreExport StaticallyInitializedScopedSingletonWrapper : public StaticallyInitializedInstance
+ {
+ public:
+ StaticallyInitializedScopedSingletonWrapper(ScopedSingletonWrapper* wrapper, ScopeID::Value scope)
+ : StaticallyInitializedInstance(StaticInitialization::SCOPED_SINGLETON_WRAPPER)
+ , wrapper_(wrapper)
+ , scope_(scope)
+ {}
+ ~StaticallyInitializedScopedSingletonWrapper() { delete wrapper_; }
+
+ virtual void load();
+ virtual void unload();
+
+ inline ScopedSingletonWrapper& getWrapper()
+ { return *this->wrapper_; }
+
+ private:
+ ScopedSingletonWrapper* wrapper_;
+ ScopeID::Value scope_;
+ };
+
+ typedef StaticallyInitializedScopedSingletonWrapper SI_SSW;
+}
+
+#endif /* __ScopedSingletonIncludes_H__ */
Property changes on: code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/network/NetworkFunctionIncludes.cc
===================================================================
--- code/trunk/src/libraries/network/NetworkFunctionIncludes.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/network/NetworkFunctionIncludes.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,53 +1,53 @@
-/*
- * 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:
- * Oliver Scheuss
- * Co-authors:
- * Fabian 'x3n' Landau
- *
- */
-
-#include "NetworkFunctionIncludes.h"
-#include "NetworkFunctionManager.h"
-
-#include "core/module/StaticInitializationHandlerIncludes.h"
-#include "NetworkStaticInitializationHandler.h"
-
-namespace orxonox
-{
- RegisterStaticInitializationHandler(NetworkStaticInitializationHandler);
-
- void StaticallyInitializedNetworkFunction::load()
- {
- NetworkFunctionManager::getInstance().registerFunction(this->function_);
- }
-
- void StaticallyInitializedNetworkFunction::unload()
- {
- NetworkFunctionManager::getInstance().unregisterFunction(this->function_);
- }
-
- uint32_t getNetworkIdForPointer(const NetworkFunctionPointer& pointer)
- {
- return NetworkFunctionManager::getInstance().getFunctionByFunctionPointer(pointer)->getNetworkID();
- }
-}
+/*
+ * 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:
+ * Oliver Scheuss
+ * Co-authors:
+ * Fabian 'x3n' Landau
+ *
+ */
+
+#include "NetworkFunctionIncludes.h"
+#include "NetworkFunctionManager.h"
+
+#include "core/module/StaticInitializationHandlerIncludes.h"
+#include "NetworkStaticInitializationHandler.h"
+
+namespace orxonox
+{
+ RegisterStaticInitializationHandler(NetworkStaticInitializationHandler);
+
+ void StaticallyInitializedNetworkFunction::load()
+ {
+ NetworkFunctionManager::getInstance().registerFunction(this->function_);
+ }
+
+ void StaticallyInitializedNetworkFunction::unload()
+ {
+ NetworkFunctionManager::getInstance().unregisterFunction(this->function_);
+ }
+
+ uint32_t getNetworkIdForPointer(const NetworkFunctionPointer& pointer)
+ {
+ return NetworkFunctionManager::getInstance().getFunctionByFunctionPointer(pointer)->getNetworkID();
+ }
+}
Property changes on: code/trunk/src/libraries/network/NetworkFunctionIncludes.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/network/NetworkFunctionIncludes.h
===================================================================
--- code/trunk/src/libraries/network/NetworkFunctionIncludes.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/network/NetworkFunctionIncludes.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,119 +1,119 @@
-/*
- * 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:
- * Oliver Scheuss
- * Co-authors:
- * Fabian 'x3n' Landau
- *
- */
-
-#ifndef _NetworkFunctionIncludes_H__
-#define _NetworkFunctionIncludes_H__
-
-#include "NetworkPrereqs.h"
-
-#include <boost/preprocessor/cat.hpp>
-#include <boost/static_assert.hpp>
-
-#include "NetworkFunction.h"
-#include "core/module/StaticallyInitializedInstance.h"
-
-#define registerStaticNetworkFunction( functionPointer ) \
- static orxonox::NetworkFunctionBase& BOOST_PP_CAT( NETWORK_FUNCTION_, __UNIQUE_NUMBER__ ) \
- = (new orxonox::SI_NF(orxonox::registerStaticNetworkFunctionFct( functionPointer, #functionPointer )))->getFunction()
-
-#define registerMemberNetworkFunction( class, function ) \
- static orxonox::NetworkFunctionBase& BOOST_PP_CAT( NETWORK_FUNCTION_##class, __UNIQUE_NUMBER__ ) \
- = (new orxonox::SI_NF(orxonox::registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function)))->getFunction()
-
-namespace orxonox
-{
- class _NetworkExport StaticallyInitializedNetworkFunction : public StaticallyInitializedInstance
- {
- public:
- StaticallyInitializedNetworkFunction(NetworkFunctionBase* function)
- : StaticallyInitializedInstance(StaticInitialization::NETWORK_FUNCTION)
- , function_(function)
- {}
- ~StaticallyInitializedNetworkFunction() { delete function_; }
-
- virtual void load();
- virtual void unload();
-
- inline NetworkFunctionBase& getFunction()
- { return *this->function_; }
-
- private:
- NetworkFunctionBase* function_;
- };
-
- typedef StaticallyInitializedNetworkFunction SI_NF;
-
- template<class PT>
- inline NetworkFunctionBase* registerStaticNetworkFunctionFct(PT ptr, const std::string& name)
- {
- BOOST_STATIC_ASSERT(sizeof(PT) <= sizeof(NetworkFunctionPointer)); // if this fails your compiler uses bigger pointers for static functions than defined above
- NetworkFunctionPointer destptr;
- copyPtr(ptr, destptr);
- return new NetworkFunctionStatic(createFunctor(ptr), name, destptr);
- }
-
- template<class T, class PT>
- inline NetworkFunctionBase* registerMemberNetworkFunctionFct(PT ptr, const std::string& name)
- {
- BOOST_STATIC_ASSERT(sizeof(PT) <= sizeof(NetworkFunctionPointer)); // if this fails your compiler uses bigger pointers for a specific kind of member functions than defined above
- NetworkFunctionPointer destptr;
- copyPtr(ptr, destptr);
- return new NetworkMemberFunction<T>(createFunctor(ptr), name, destptr);
- }
-
- _NetworkExport uint32_t getNetworkIdForPointer(const NetworkFunctionPointer& pointer);
-
- // call it with functionPointer, clientID, args
- template<class PT>
- void callStaticNetworkFunction(PT ptr, uint32_t clientID, const MultiType& mt1 = MultiType::Null, const MultiType& mt2 = MultiType::Null, const MultiType& mt3 = MultiType::Null, const MultiType& mt4 = MultiType::Null, const MultiType& mt5 = MultiType::Null)
- {
- NetworkFunctionPointer destptr;
- copyPtr(ptr, destptr);
- FunctionCallManager::addCall(getNetworkIdForPointer(destptr), OBJECTID_UNKNOWN, clientID, mt1, mt2, mt3, mt4, mt5);
- }
-
- // call it with class::function, objectID, clientID, args
- template<class PT>
- void callMemberNetworkFunction(PT ptr, uint32_t objectID, uint32_t clientID, const MultiType& mt1 = MultiType::Null, const MultiType& mt2 = MultiType::Null, const MultiType& mt3 = MultiType::Null, const MultiType& mt4 = MultiType::Null, const MultiType& mt5 = MultiType::Null)
- {
- NetworkFunctionPointer destptr;
- copyPtr(ptr, destptr);
- FunctionCallManager::addCall(getNetworkIdForPointer(destptr), objectID, clientID, mt1, mt2, mt3, mt4, mt5);
- }
-
- template<class PT>
- inline void copyPtr(PT ptr, NetworkFunctionPointer& destptr)
- {
- if (sizeof(NetworkFunctionPointer) - sizeof(PT) > 0)
- memset((uint8_t*)&destptr + sizeof(PT), 0, sizeof(NetworkFunctionPointer) - sizeof(PT));
- PT p2 = ptr;
- memcpy(&destptr, &p2, sizeof(PT));
- }
-}
-
-#endif /* _NetworkFunctionIncludes_H__ */
+/*
+ * 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:
+ * Oliver Scheuss
+ * Co-authors:
+ * Fabian 'x3n' Landau
+ *
+ */
+
+#ifndef _NetworkFunctionIncludes_H__
+#define _NetworkFunctionIncludes_H__
+
+#include "NetworkPrereqs.h"
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/static_assert.hpp>
+
+#include "NetworkFunction.h"
+#include "core/module/StaticallyInitializedInstance.h"
+
+#define registerStaticNetworkFunction( functionPointer ) \
+ static orxonox::NetworkFunctionBase& BOOST_PP_CAT( NETWORK_FUNCTION_, __UNIQUE_NUMBER__ ) \
+ = (new orxonox::SI_NF(orxonox::registerStaticNetworkFunctionFct( functionPointer, #functionPointer )))->getFunction()
+
+#define registerMemberNetworkFunction( class, function ) \
+ static orxonox::NetworkFunctionBase& BOOST_PP_CAT( NETWORK_FUNCTION_##class, __UNIQUE_NUMBER__ ) \
+ = (new orxonox::SI_NF(orxonox::registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function)))->getFunction()
+
+namespace orxonox
+{
+ class _NetworkExport StaticallyInitializedNetworkFunction : public StaticallyInitializedInstance
+ {
+ public:
+ StaticallyInitializedNetworkFunction(NetworkFunctionBase* function)
+ : StaticallyInitializedInstance(StaticInitialization::NETWORK_FUNCTION)
+ , function_(function)
+ {}
+ ~StaticallyInitializedNetworkFunction() { delete function_; }
+
+ virtual void load();
+ virtual void unload();
+
+ inline NetworkFunctionBase& getFunction()
+ { return *this->function_; }
+
+ private:
+ NetworkFunctionBase* function_;
+ };
+
+ typedef StaticallyInitializedNetworkFunction SI_NF;
+
+ template<class PT>
+ inline NetworkFunctionBase* registerStaticNetworkFunctionFct(PT ptr, const std::string& name)
+ {
+ BOOST_STATIC_ASSERT(sizeof(PT) <= sizeof(NetworkFunctionPointer)); // if this fails your compiler uses bigger pointers for static functions than defined above
+ NetworkFunctionPointer destptr;
+ copyPtr(ptr, destptr);
+ return new NetworkFunctionStatic(createFunctor(ptr), name, destptr);
+ }
+
+ template<class T, class PT>
+ inline NetworkFunctionBase* registerMemberNetworkFunctionFct(PT ptr, const std::string& name)
+ {
+ BOOST_STATIC_ASSERT(sizeof(PT) <= sizeof(NetworkFunctionPointer)); // if this fails your compiler uses bigger pointers for a specific kind of member functions than defined above
+ NetworkFunctionPointer destptr;
+ copyPtr(ptr, destptr);
+ return new NetworkMemberFunction<T>(createFunctor(ptr), name, destptr);
+ }
+
+ _NetworkExport uint32_t getNetworkIdForPointer(const NetworkFunctionPointer& pointer);
+
+ // call it with functionPointer, clientID, args
+ template<class PT>
+ void callStaticNetworkFunction(PT ptr, uint32_t clientID, const MultiType& mt1 = MultiType::Null, const MultiType& mt2 = MultiType::Null, const MultiType& mt3 = MultiType::Null, const MultiType& mt4 = MultiType::Null, const MultiType& mt5 = MultiType::Null)
+ {
+ NetworkFunctionPointer destptr;
+ copyPtr(ptr, destptr);
+ FunctionCallManager::addCall(getNetworkIdForPointer(destptr), OBJECTID_UNKNOWN, clientID, mt1, mt2, mt3, mt4, mt5);
+ }
+
+ // call it with class::function, objectID, clientID, args
+ template<class PT>
+ void callMemberNetworkFunction(PT ptr, uint32_t objectID, uint32_t clientID, const MultiType& mt1 = MultiType::Null, const MultiType& mt2 = MultiType::Null, const MultiType& mt3 = MultiType::Null, const MultiType& mt4 = MultiType::Null, const MultiType& mt5 = MultiType::Null)
+ {
+ NetworkFunctionPointer destptr;
+ copyPtr(ptr, destptr);
+ FunctionCallManager::addCall(getNetworkIdForPointer(destptr), objectID, clientID, mt1, mt2, mt3, mt4, mt5);
+ }
+
+ template<class PT>
+ inline void copyPtr(PT ptr, NetworkFunctionPointer& destptr)
+ {
+ if (sizeof(NetworkFunctionPointer) - sizeof(PT) > 0)
+ memset((uint8_t*)&destptr + sizeof(PT), 0, sizeof(NetworkFunctionPointer) - sizeof(PT));
+ PT p2 = ptr;
+ memcpy(&destptr, &p2, sizeof(PT));
+ }
+}
+
+#endif /* _NetworkFunctionIncludes_H__ */
Property changes on: code/trunk/src/libraries/network/NetworkFunctionIncludes.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/network/NetworkFunctionManager.cc
===================================================================
--- code/trunk/src/libraries/network/NetworkFunctionManager.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/network/NetworkFunctionManager.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,83 +1,83 @@
-/*
- * 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:
- * ...
- *
- */
-
-#include "NetworkFunctionManager.h"
-#include "NetworkFunction.h"
-
-namespace orxonox
-{
- NetworkFunctionManager* NetworkFunctionManager::singletonPtr_s = 0;
-
- void NetworkFunctionManager::registerFunction(NetworkFunctionBase* function)
- {
- this->functions_.insert(function);
- this->nameMap_[function->getName()] = function;
- this->idMap_[function->getNetworkID()] = function;
- this->functorMap_[function->getPointer()] = function;
- }
-
- void NetworkFunctionManager::unregisterFunction(NetworkFunctionBase* function)
- {
- this->functions_.erase(function);
- this->nameMap_.erase(function->getName());
- this->idMap_.erase(function->getNetworkID());
- this->functorMap_.erase(function->getPointer());
- }
-
- NetworkFunctionBase* NetworkFunctionManager::getFunctionByName(const std::string& name)
- {
- std::map<std::string, NetworkFunctionBase*>::iterator it = nameMap_.find(name);
- assert(it != nameMap_.end());
- return it->second;
- }
-
- NetworkFunctionBase* NetworkFunctionManager::getFunctionByFunctionPointer(const NetworkFunctionPointer& p)
- {
- std::map<NetworkFunctionPointer, NetworkFunctionBase*>::iterator it = functorMap_.find(p);
- assert(it != functorMap_.end());
- return it->second;
- }
-
- NetworkFunctionBase* NetworkFunctionManager::getFunctionByNetworkId(uint32_t id)
- {
- std::map<uint32_t, NetworkFunctionBase*>::iterator it = idMap_.find(id);
- assert(it != idMap_.end());
- if(it != idMap_.end())
- return it->second;
- else
- return NULL;
- }
-
- /**
- @brief Cleans the NetworkID map (needed on clients for correct initialization)
- */
- void NetworkFunctionManager::clearNetworkIDs()
- {
- this->idMap_.clear();
- }
-}
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "NetworkFunctionManager.h"
+#include "NetworkFunction.h"
+
+namespace orxonox
+{
+ NetworkFunctionManager* NetworkFunctionManager::singletonPtr_s = 0;
+
+ void NetworkFunctionManager::registerFunction(NetworkFunctionBase* function)
+ {
+ this->functions_.insert(function);
+ this->nameMap_[function->getName()] = function;
+ this->idMap_[function->getNetworkID()] = function;
+ this->functorMap_[function->getPointer()] = function;
+ }
+
+ void NetworkFunctionManager::unregisterFunction(NetworkFunctionBase* function)
+ {
+ this->functions_.erase(function);
+ this->nameMap_.erase(function->getName());
+ this->idMap_.erase(function->getNetworkID());
+ this->functorMap_.erase(function->getPointer());
+ }
+
+ NetworkFunctionBase* NetworkFunctionManager::getFunctionByName(const std::string& name)
+ {
+ std::map<std::string, NetworkFunctionBase*>::iterator it = nameMap_.find(name);
+ assert(it != nameMap_.end());
+ return it->second;
+ }
+
+ NetworkFunctionBase* NetworkFunctionManager::getFunctionByFunctionPointer(const NetworkFunctionPointer& p)
+ {
+ std::map<NetworkFunctionPointer, NetworkFunctionBase*>::iterator it = functorMap_.find(p);
+ assert(it != functorMap_.end());
+ return it->second;
+ }
+
+ NetworkFunctionBase* NetworkFunctionManager::getFunctionByNetworkId(uint32_t id)
+ {
+ std::map<uint32_t, NetworkFunctionBase*>::iterator it = idMap_.find(id);
+ assert(it != idMap_.end());
+ if(it != idMap_.end())
+ return it->second;
+ else
+ return NULL;
+ }
+
+ /**
+ @brief Cleans the NetworkID map (needed on clients for correct initialization)
+ */
+ void NetworkFunctionManager::clearNetworkIDs()
+ {
+ this->idMap_.clear();
+ }
+}
Property changes on: code/trunk/src/libraries/network/NetworkFunctionManager.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/network/NetworkFunctionManager.h
===================================================================
--- code/trunk/src/libraries/network/NetworkFunctionManager.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/network/NetworkFunctionManager.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,70 +1,70 @@
-/*
- * 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:
- * ...
- *
- */
-
-#ifndef __NetworkFunctionManager_H__
-#define __NetworkFunctionManager_H__
-
-#include "NetworkPrereqs.h"
-
-#include <cassert>
-#include <map>
-#include <set>
-
-#include "util/Singleton.h"
-#include "NetworkFunction.h"
-
-namespace orxonox
-{
- class _NetworkExport NetworkFunctionManager : public Singleton<NetworkFunctionManager>
- {
- friend class Singleton<NetworkFunctionManager>;
-
- public:
- void registerFunction(NetworkFunctionBase* function);
- void unregisterFunction(NetworkFunctionBase* function);
-
- inline const std::set<NetworkFunctionBase*>& getAllFunctions()
- { return functions_; }
-
- NetworkFunctionBase* getFunctionByName(const std::string& name);
- NetworkFunctionBase* getFunctionByFunctionPointer(const NetworkFunctionPointer& p);
- NetworkFunctionBase* getFunctionByNetworkId(uint32_t id);
-
- void clearNetworkIDs();
-
- private:
- std::set<NetworkFunctionBase*> functions_;
- std::map<std::string, NetworkFunctionBase*> nameMap_;
- std::map<NetworkFunctionPointer, NetworkFunctionBase*> functorMap_;
- std::map<uint32_t, NetworkFunctionBase*> idMap_;
-
- static NetworkFunctionManager* singletonPtr_s;
- };
-}
-
-#endif /* __NetworkFunctionManager_H__ */
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef __NetworkFunctionManager_H__
+#define __NetworkFunctionManager_H__
+
+#include "NetworkPrereqs.h"
+
+#include <cassert>
+#include <map>
+#include <set>
+
+#include "util/Singleton.h"
+#include "NetworkFunction.h"
+
+namespace orxonox
+{
+ class _NetworkExport NetworkFunctionManager : public Singleton<NetworkFunctionManager>
+ {
+ friend class Singleton<NetworkFunctionManager>;
+
+ public:
+ void registerFunction(NetworkFunctionBase* function);
+ void unregisterFunction(NetworkFunctionBase* function);
+
+ inline const std::set<NetworkFunctionBase*>& getAllFunctions()
+ { return functions_; }
+
+ NetworkFunctionBase* getFunctionByName(const std::string& name);
+ NetworkFunctionBase* getFunctionByFunctionPointer(const NetworkFunctionPointer& p);
+ NetworkFunctionBase* getFunctionByNetworkId(uint32_t id);
+
+ void clearNetworkIDs();
+
+ private:
+ std::set<NetworkFunctionBase*> functions_;
+ std::map<std::string, NetworkFunctionBase*> nameMap_;
+ std::map<NetworkFunctionPointer, NetworkFunctionBase*> functorMap_;
+ std::map<uint32_t, NetworkFunctionBase*> idMap_;
+
+ static NetworkFunctionManager* singletonPtr_s;
+ };
+}
+
+#endif /* __NetworkFunctionManager_H__ */
Property changes on: code/trunk/src/libraries/network/NetworkFunctionManager.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/libraries/tools/ParticleInterface.cc
===================================================================
--- code/trunk/src/libraries/tools/ParticleInterface.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/tools/ParticleInterface.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -232,4 +232,9 @@
if (this->particleSystem_)
this->particleSystem_->setKeepParticlesInLocalSpace(keep);
}
+
+ void ParticleInterface::setDimensions(float scale)
+ {
+ this->particleSystem_->setDefaultDimensions(scale * this->particleSystem_->getDefaultWidth(), scale * this->particleSystem_->getDefaultHeight());
+ }
}
Modified: code/trunk/src/libraries/tools/ParticleInterface.h
===================================================================
--- code/trunk/src/libraries/tools/ParticleInterface.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/tools/ParticleInterface.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -74,6 +74,8 @@
void setDetailLevel(unsigned int level);
+ void setDimensions(float scale);
+
protected:
virtual void changedTimeFactor(float factor_new, float factor_old);
Modified: code/trunk/src/libraries/util/Math.cc
===================================================================
--- code/trunk/src/libraries/util/Math.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/util/Math.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -160,7 +160,7 @@
- If the other object is only a bit at my right, the function still returns <tt>Vector2(0.01, 0)</tt>.
- If the other object is exactly above me, the function returns <tt>Vector2(0, 0.5)</tt>.
*/
- orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
+ orxonox::Vector2 get2DViewCoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
{
orxonox::Vector3 distance = otherposition - myposition;
Modified: code/trunk/src/libraries/util/Math.h
===================================================================
--- code/trunk/src/libraries/util/Math.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/libraries/util/Math.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -90,7 +90,7 @@
_UtilExport float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition);
_UtilExport orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
- _UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
+ _UtilExport orxonox::Vector2 get2DViewCoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
_UtilExport orxonox::Vector2 get3DProjection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle, const float detectionlimit);
_UtilExport bool isObjectHigherThanShipOnMap(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle);
_UtilExport int determineMap3DZOrder(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float detectionlimit);
Modified: code/trunk/src/modules/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -42,3 +42,4 @@
ADD_SUBDIRECTORY(jump)
ADD_SUBDIRECTORY(mini4dgame)
ADD_SUBDIRECTORY(dodgerace)
+ADD_SUBDIRECTORY(hover)
Modified: code/trunk/src/modules/docking/DockingController.cc
===================================================================
--- code/trunk/src/modules/docking/DockingController.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/docking/DockingController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -60,7 +60,7 @@
return;
float distance = (this->dock_->getWorldPosition() - entity->getPosition()).length();
- Vector2 coord = get2DViewcoordinates( // I don't understand this too
+ Vector2 coord = get2DViewCoordinates( // I don't understand this too
entity->getPosition(),
entity->getOrientation() * WorldEntity::FRONT,
entity->getOrientation() * WorldEntity::UP,
Modified: code/trunk/src/modules/dodgerace/DodgeRace.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRace.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/dodgerace/DodgeRace.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -70,10 +70,14 @@
{
for (int i = 0; i < 7; i++)
{
- BigExplosion* chunk = new BigExplosion(this->center_->getContext());
- chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
- chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
- chunk->setScale(20);
+ WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
+ chunk5->setPosition(Vector3(600, 0, 100.f * i - 300));
+ chunk5->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk5->setScale(10);
+ chunk5->setEffect1("Orxonox/explosion2b");
+ chunk5->setEffect2("Orxonox/smoke6");
+ chunk5->Explode();
+
}
}
addPoints(multiplier * 42);
Modified: code/trunk/src/modules/dodgerace/DodgeRace.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRace.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/dodgerace/DodgeRace.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -55,7 +55,6 @@
#include "infos/PlayerInfo.h"
#include "core/command/ConsoleCommand.h"
-#include "worldentities/BigExplosion.h"
#include "gametypes/Deathmatch.h"
#include "tools/Timer.h"
Modified: code/trunk/src/modules/invader/Invader.cc
===================================================================
--- code/trunk/src/modules/invader/Invader.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/invader/Invader.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -50,7 +50,7 @@
#include "InvaderEnemyShooter.h"
#include "core/command/ConsoleCommand.h"
-#include "worldentities/BigExplosion.h"
+#include "worldentities/ExplosionPart.h"
namespace orxonox
{
@@ -81,10 +81,17 @@
{
for (int i = 0; i < 7; i++)
{
- BigExplosion* chunk = new BigExplosion(this->center_->getContext());
- chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
- chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
- chunk->setScale(20);
+
+ WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
+ chunk5->setPosition(this->center_->getPosition());
+ chunk5->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk5->setScale(10);
+ chunk5->setEffect1("Orxonox/explosion2b");
+ chunk5->setEffect2("Orxonox/smoke6");
+ chunk5->setMinSpeed(0);
+ chunk5->setMaxSpeed(0);
+ chunk5->Explode();
+
}
}
addPoints(multiplier * 42);
Modified: code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc
===================================================================
--- code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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/trunk/src/modules/notifications/dispatchers/CommandNotification.h
===================================================================
--- code/trunk/src/modules/notifications/dispatchers/CommandNotification.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/notifications/dispatchers/CommandNotification.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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/trunk/src/modules/objects/Turret.h
===================================================================
--- code/trunk/src/modules/objects/Turret.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/objects/Turret.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -102,10 +102,10 @@
{ return this->maxYaw_; }
inline void setRotationThrust(float rotationthrust)
- { this->rotationThrust_ = rotationthrust; }
+ { this->rotationThrust_ = rotationthrust; }
inline float getRotationThrust()
- { return this->rotationThrust_; }
+ { return this->rotationThrust_; }
protected:
Vector3 startDir_; //!< The initial facing direction, in local coordinates.
Modified: code/trunk/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/modules/overlays/OverlaysPrereqs.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/OverlaysPrereqs.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -89,7 +89,14 @@
class HUDNavigation;
class HUDRadar;
class HUDSpeedBar;
+ class HUDShieldBar;
class HUDBoostBar;
+ class HUDRocketFuelBar;
+ class HUDEnemyHealthBar;
+ class HUDEnemyShieldBar;
+ class HUDWeaponSystem;
+ class HUDWeapon;
+ class HUDWeaponMode;
class HUDTimer;
class HUDAimAssistant;
class KillMessage;
Modified: code/trunk/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/hud/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -4,9 +4,15 @@
HUDRadar.cc
HUDSpeedBar.cc
HUDBoostBar.cc
+ HUDShieldBar.cc
HUDHealthBar.cc
+ HUDRocketFuelBar.cc
HUDTimer.cc
HUDEnemyHealthBar.cc
+ HUDEnemyShieldBar.cc
+ HUDWeaponMode.cc
+ HUDWeapon.cc
+ HUDWeaponSystem.cc
ChatOverlay.cc
AnnounceMessage.cc
KillMessage.cc
Modified: code/trunk/src/modules/overlays/hud/HUDBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDBar.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/HUDBar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -46,11 +46,10 @@
{
RegisterClass(BarColour);
- BarColour::BarColour(Context* context)
- : BaseObject(context)
+ BarColour::BarColour(Context* context) : BaseObject(context)
{
RegisterObject(BarColour);
-
+
this->setColour(ColourValue(1.0, 1.0, 1.0, 1.0));
this->setPosition(0.0);
}
@@ -68,8 +67,7 @@
RegisterClass(HUDBar);
- HUDBar::HUDBar(Context* context)
- : OrxonoxOverlay(context), right2Left_(false), autoColour_(false)
+ HUDBar::HUDBar(Context* context) : OrxonoxOverlay(context), right2Left_(false), autoColour_(false)
{
RegisterObject(HUDBar);
@@ -87,6 +85,10 @@
.createOverlayElement("Panel", "HUDBar_bar_" + getUniqueNumberString()));
this->bar_->setMaterialName(materialname);
+ this->bar_->setPosition(0.0f,0.0f);
+ this->bar_->setDimensions(1.0f,1.0f);
+
+ this->bUseIcon_ = false;
this->value_ = 1.0f; // initialize with 1.0f to trigger a change when calling setValue(0.0f) on the line below
this->setAutoColour(true);
this->setValue(0.0f); // <--
@@ -94,6 +96,11 @@
this->currentColour_ = ColourValue::White;
this->background_->addChild(bar_);
+
+ this->icon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDBar_icon_" + getUniqueNumberString()));
+ this->icon_->setPosition(0.06f,0.0f);
+ this->icon_->setDimensions(0.1f,1.0f);
+ this->background_->addChild(this->icon_);
}
HUDBar::~HUDBar()
@@ -114,6 +121,7 @@
XMLPortParam(HUDBar, "righttoleft", setRightToLeft, getRightToLeft, xmlelement, mode);
XMLPortParam(HUDBar, "autocolour", setAutoColour, getAutoColour, xmlelement, mode);
XMLPortParam(HUDBar, "bartexture", setBarTexture, getBarTexture, xmlelement, mode);
+ XMLPortParam(HUDBar, "iconmaterial", setIconMaterial, getIconMaterial, xmlelement, mode);
XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlelement, mode);
}
@@ -160,19 +168,39 @@
}
}
+ float height = this->bar_->getHeight();
+ float top = this->bar_->getTop();
+
// set value
if (this->right2Left_)
{
// backward case
- this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), 0.0f);
- this->bar_->setDimensions(0.88f * this->value_, 1.0f);
+ if (this->bUseIcon_)
+ {
+ this->bar_->setPosition(0.16f + 0.78f * (1 - this->value_), top);
+ this->bar_->setDimensions(0.78f * this->value_, height);
+ }
+ else
+ {
+ this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), top);
+ this->bar_->setDimensions(0.88f * this->value_, height);
+ }
}
else
{
// default case
- this->bar_->setPosition(0.06f, 0.0f);
- this->bar_->setDimensions(0.88f * this->value_, 1.0f);
+ if (this->bUseIcon_)
+ {
+ this->bar_->setPosition(0.16f, top);
+ this->bar_->setDimensions(0.78f * this->value_, height);
+ }
+ else
+ {
+ this->bar_->setPosition(0.06f, top);
+ this->bar_->setDimensions(0.88f * this->value_, height);
+ }
}
+
if (this->value_ != 0)
this->bar_->setTiling(this->value_, 1.0);
}
@@ -207,4 +235,16 @@
{
return this->textureUnitState_->getTextureName();
}
+
+ void HUDBar::setIconMaterial(const std::string& iconMaterial)
+ {
+ this->bUseIcon_ = true;
+ this->icon_->setMaterialName(iconMaterial);
+ valueChanged();
+ }
+
+ const std::string& HUDBar::getIconMaterial() const
+ {
+ return this->icon_->getMaterialName();
+ }
}
Modified: code/trunk/src/modules/overlays/hud/HUDBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDBar.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/HUDBar.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -36,6 +36,7 @@
#include <map>
#include <vector>
+#include <OgrePanelOverlayElement.h>
#include "util/Math.h"
#include "util/OgreForwardRefs.h"
@@ -50,7 +51,7 @@
BarColour(Context* context);
virtual ~BarColour() { }
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
void setColour(const ColourValue& colour) { this->colour_ = colour; }
const ColourValue& getColour() const { return this->colour_; }
@@ -114,12 +115,19 @@
void setBarTexture(const std::string& texture);
const std::string& getBarTexture() const;
+ void setIconMaterial(const std::string& iconMaterial);
+ const std::string& getIconMaterial() const;
+
inline const ColourValue& getCurrentBarColour() const
{ return this->currentColour_; }
+ inline void setIconPosition(Vector2 position)
+ { this->icon_->setPosition(position.x, position.y); }
+ inline void setIconDimensions(Vector2 dimensions)
+ { this->icon_->setDimensions(dimensions.x, dimensions.y); }
+
protected:
virtual void valueChanged();
-
private:
void addColour(BarColour* colour);
BarColour* getColour(unsigned int index);
@@ -128,9 +136,11 @@
bool autoColour_; //!< whether bar changes colour automatically
float value_; //!< progress of bar
ColourValue currentColour_;
+ bool bUseIcon_;
Ogre::PanelOverlayElement* bar_;
Ogre::TextureUnitState* textureUnitState_;
+ Ogre::PanelOverlayElement* icon_;
std::map<float, ColourValue> colours_;
std::vector<BarColour*> barColours_;
Modified: code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDBoostBar.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/HUDBoostBar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -58,7 +58,7 @@
{
if (this->owner_->isBoostCoolingDown())
{
- this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
+ //this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
if (this->flashDt_ <= 0.0f)
{
this->flashDt_ = this->flashInterval_;
@@ -71,7 +71,7 @@
{
this->flashDt_ = 0.0f;
this->show();
- this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
+ //this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
}
float value = this->owner_->getBoostPower() / this->owner_->getInitialBoostPower();
Copied: code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDEnemyShieldBar.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,89 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "HUDEnemyShieldBar.h"
+
+#include "core/config/ConfigValueIncludes.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+ RegisterClass(HUDEnemyShieldBar);
+
+ HUDEnemyShieldBar::HUDEnemyShieldBar(Context* context) : HUDShieldBar(context)
+ {
+ RegisterObject(HUDEnemyShieldBar);
+
+ this->setConfigValues();
+ this->owner_ = NULL;
+ }
+
+ HUDEnemyShieldBar::~HUDEnemyShieldBar()
+ {
+ }
+
+ void HUDEnemyShieldBar::setConfigValues()
+ {
+ SetConfigValue(useEnemyBar_, true);
+ }
+
+ void HUDEnemyShieldBar::tick(float dt)
+ {
+ this->updateTarget();
+
+ SUPER(HUDEnemyShieldBar, tick, dt);
+ }
+
+ void HUDEnemyShieldBar::updateTarget()
+ {
+ Pawn* pawn = NULL;
+ if (this->owner_ && this->useEnemyBar_)
+ {
+ // Get the owner's current target (target is usually a Model)
+ WorldEntity* target = this->owner_->getTarget();
+ // Find the Pawn that belongs to this target (if any)
+ while (target && !target->isA(Class(Pawn)))
+ target = target->getParent();
+ pawn = orxonox_cast<Pawn*>(target);
+ // Don't show the EnemyShieldBar if the pawn is invisible
+ if (pawn && !pawn->isVisible())
+ pawn = NULL;
+ }
+ // Set the pawn as owner of the EnemyShieldBar
+ this->setShieldBarOwner(pawn);
+ this->setVisible(pawn != NULL);
+ }
+
+ void HUDEnemyShieldBar::changedOwner()
+ {
+ SUPER(HUDEnemyShieldBar, changedOwner);
+
+ this->owner_ = orxonox_cast<ControllableEntity*>(this->getOwner());
+ this->updateTarget();
+ }
+}
Copied: code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDEnemyShieldBar.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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:
+ * ...
+ *
+ */
+
+#ifndef _HUDEnemyShieldBar_H__
+#define _HUDEnemyShieldBar_H__
+
+#include "HUDShieldBar.h"
+
+namespace orxonox
+{
+ /**
+ @brief
+ This class displays the shield status of the target enemy of it's owner.
+ */
+ class _OverlaysExport HUDEnemyShieldBar : public HUDShieldBar
+ {
+ public:
+ HUDEnemyShieldBar(Context* context);
+ virtual ~HUDEnemyShieldBar();
+
+ void setConfigValues();
+ virtual void tick(float dt);
+
+ void changedOwner();
+
+ private:
+ void updateTarget();
+
+ ControllableEntity* owner_;
+ bool useEnemyBar_;
+ };
+}
+#endif /* _HUDEnemyShieldBar_H__ */
Modified: code/trunk/src/modules/overlays/hud/HUDHealthBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDHealthBar.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/HUDHealthBar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -44,12 +44,20 @@
this->owner_ = 0;
this->bUseBarColour_ = false;
+ this->textOffset_ = Vector2(0.0f, 0.0f);
+ this->textScale_ = 1.0f;
+ this->setIconPosition(Vector2(0.05f,0.5f));
+ this->setIconDimensions(Vector2(0.1f,0.5f));
+
this->textoverlay_ = new OverlayText(this->getContext());
assert(this->textoverlay_.get());
this->textoverlay_->setCaption("");
+ this->textoverlay_->setAspectCorrection(false);
+
+ positionText();
}
HUDHealthBar::~HUDHealthBar()
@@ -57,7 +65,7 @@
if (this->isInitialized())
{
this->textoverlay_->destroy();
- this->textoverlay_ = 0;
+ this->textoverlay_ = NULL;
}
}
@@ -69,12 +77,11 @@
XMLPortParam(HUDHealthBar, "textfont", setTextFont, getTextFont, xmlelement, mode).defaultValues("Monofur");
XMLPortParam(HUDHealthBar, "textusebarcolour", setTextUseBarColour, getTextUseBarColour, xmlelement, mode).defaultValues(false);
XMLPortParam(HUDHealthBar, "textcolour", setTextColour, getTextColour, xmlelement, mode).defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0));
- XMLPortParam(HUDHealthBar, "textsize", setTextSize, getTextSize, xmlelement, mode).defaultValues(1.0f);
XMLPortParam(HUDHealthBar, "textalign", setTextAlignmentString, getTextAlignmentString, xmlelement, mode).defaultValues("left");
XMLPortParam(HUDHealthBar, "textoffset", setTextOffset, getTextOffset, xmlelement, mode).defaultValues(Vector2::ZERO);
+ XMLPortParam(HUDHealthBar, "textscale", setTextScale, getTextScale, xmlelement, mode).defaultValues(1.0f);
XMLPortParam(HUDHealthBar, "textpickpoint", setTextPickPoint, getTextPickPoint, xmlelement, mode).defaultValues(Vector2::ZERO);
XMLPortParam(HUDHealthBar, "textrotation", setTextRotation, getTextRotation, xmlelement, mode).defaultValues(0.0f);
- XMLPortParam(HUDHealthBar, "textcorrectaspect", setTextAspectCorrection, getTextAspectCorrection, xmlelement, mode).defaultValues(true);
XMLPortParam(HUDHealthBar, "textspacewidth", setTextSpaceWidth, getTextSpaceWidth, xmlelement, mode).defaultValues(true);
}
@@ -138,4 +145,22 @@
if (!bUseBarColour)
this->textoverlay_->setColour(this->textColour_);
}
+
+ void HUDHealthBar::positionText()
+ {
+ this->textoverlay_->setPosition(this->getPosition() + this->textOffset_*this->getActualSize());
+ this->textoverlay_->setTextSize(this->getActualSize().y*this->textScale_);
+ }
+
+ void HUDHealthBar::positionChanged()
+ {
+ HUDBar::positionChanged();
+ positionText();
+ }
+
+ void HUDHealthBar::sizeChanged()
+ {
+ HUDBar::sizeChanged();
+ positionText();
+ }
}
Modified: code/trunk/src/modules/overlays/hud/HUDHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDHealthBar.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/HUDHealthBar.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -74,31 +74,30 @@
std::string getTextAlignmentString() const
{ return this->textoverlay_->getAlignmentString(); }
- inline void setTextSize(float size)
- { this->textoverlay_->setTextSize(size); }
- inline float getTextSize() const
- { return this->textoverlay_->getTextSize(); }
-
inline void setTextVisible(bool bVisible)
{ this->textoverlay_->setVisible(bVisible); }
inline bool getTextVisible() const
{ return this->textoverlay_->isVisible(); }
+ inline void setTextScale(float scale)
+ { this->textScale_ = scale;
+ positionText();
+ }
+ inline float getTextScale() const
+ { return this->textScale_; }
+
inline void setTextPickPoint(const Vector2& pickpoint)
{ this->textoverlay_->setPickPoint(pickpoint); }
inline Vector2 getTextPickPoint() const
{ return this->textoverlay_->getPickPoint(); }
inline void setTextOffset(const Vector2& position)
- { this->textoverlay_->setPosition(this->getPosition() + (position - this->getPickPoint()) * this->getSize()); }
+ { this->textOffset_ = position;
+ this->positionText();
+ }
inline Vector2 getTextOffset() const
- { return (this->textoverlay_->getPosition() - this->getPosition()) / this->getSize() + this->getPickPoint(); }
+ { return this->textOffset_; }
- inline void setTextAspectCorrection(bool correct)
- { this->textoverlay_->setAspectCorrection(correct); }
- inline bool getTextAspectCorrection() const
- { return this->textoverlay_->getAspectCorrection(); }
-
inline void setTextRotation(const Degree& angle)
{ this->textoverlay_->setRotation(angle); }
inline const Degree& getTextRotation() const
@@ -111,12 +110,17 @@
inline void setHealthBarOwner(Pawn* owner)
{ this->owner_ = owner; }
-
+ protected:
+ virtual void positionChanged();
+ virtual void sizeChanged();
private:
+ virtual void positionText();
WeakPtr<Pawn> owner_;
StrongPtr<OverlayText> textoverlay_;
bool bUseBarColour_;
ColourValue textColour_;
+ Vector2 textOffset_;
+ float textScale_;
};
}
#endif /* _HUDHealthBar_H__ */
Modified: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -239,7 +239,7 @@
it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
}
else
- coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
+ coord = get2DViewCoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
Copied: code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDRocketFuelBar.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,73 @@
+/*
+ * 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 2src/libraries/core/class/Identifier.h
+ * 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:
+ * ...
+ *
+ */
+
+#include "HUDRocketFuelBar.h"
+
+#include "core/CoreIncludes.h"
+#include "weapons/projectiles/Rocket.h"
+
+namespace orxonox
+{
+ RegisterClass(HUDRocketFuelBar);
+
+ HUDRocketFuelBar::HUDRocketFuelBar(Context* context) : HUDBar(context)
+ {
+ RegisterObject(HUDRocketFuelBar);
+
+ this->owner_ = NULL;
+ }
+
+ HUDRocketFuelBar::~HUDRocketFuelBar()
+ {
+ }
+
+ void HUDRocketFuelBar::tick(float dt)
+ {
+ SUPER(HUDRocketFuelBar, tick, dt);
+
+ if (this->owner_)
+ {
+ float maxFuel = this->owner_->getMaxFuel();
+ if (maxFuel > 0.0)
+ {
+ this->setValue(this->owner_->getFuel()/maxFuel);
+ }
+ else
+ {
+ this->setValue(0.0);
+ }
+ }
+ }
+
+ void HUDRocketFuelBar::changedOwner()
+ {
+ SUPER(HUDRocketFuelBar, changedOwner);
+
+ this->owner_ = orxonox_cast<Rocket*>(this->getOwner());
+ }
+}
Copied: code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDRocketFuelBar.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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 HUDRocketFuelBar.h
+ @brief Definition of the HUDRocketFuelBar class. This HUDBar displays the the amount of fuel that a rocket has.
+*/
+
+#ifndef _HUDRocketFuelBar_H__
+#define _HUDRocketFuelBar_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "weapons/projectiles/Rocket.h"
+#include "HUDBar.h"
+
+namespace orxonox
+{
+ class _OverlaysExport HUDRocketFuelBar : public HUDBar, public Tickable
+ {
+ public:
+ HUDRocketFuelBar(Context* context);
+ virtual ~HUDRocketFuelBar();
+
+ virtual void tick(float dt);
+ virtual void changedOwner();
+
+ private:
+ Rocket* owner_;
+ };
+}
+#endif /* _HUDRocketFuelBar_H__ */
Copied: code/trunk/src/modules/overlays/hud/HUDShieldBar.cc (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDShieldBar.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDShieldBar.cc (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDShieldBar.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,81 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "HUDShieldBar.h"
+
+#include "core/CoreIncludes.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+ RegisterClass(HUDShieldBar);
+
+ HUDShieldBar::HUDShieldBar(Context* context)
+ : HUDBar(context)
+ {
+ RegisterObject(HUDShieldBar);
+
+ this->owner_ = NULL;
+ }
+
+ HUDShieldBar::~HUDShieldBar()
+ {
+ }
+
+ void HUDShieldBar::tick(float dt)
+ {
+ SUPER(HUDShieldBar, tick, dt);
+
+ if (this->owner_)
+ {
+ float maxShieldHealth = this->owner_->getMaxShieldHealth();
+ float shieldHealth = this->owner_->getShieldHealth();
+
+ if (maxShieldHealth > 0.0f)
+ {
+ this->setValue(shieldHealth/maxShieldHealth);
+ }
+ else
+ {
+ this->setValue(0.0f);
+ }
+ }
+ else
+ {
+ this->setValue(0.0f);
+ }
+ }
+
+ void HUDShieldBar::changedOwner()
+ {
+ SUPER(HUDShieldBar, changedOwner);
+
+ this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+ }
+}
+
Copied: code/trunk/src/modules/overlays/hud/HUDShieldBar.h (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDShieldBar.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDShieldBar.h (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDShieldBar.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,60 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef _HUDShieldBar_H__
+#define _HUDShieldBar_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "HUDBar.h"
+
+namespace orxonox
+{
+ /**
+ @brief
+ The HUDShieldBar displays the the status of the shield of its owner (a @ref Pawn).
+ The length of the bar is given by the ratio of the shield health and the maximal shield health of the @ref Pawn.
+ */
+
+ class _OverlaysExport HUDShieldBar : public HUDBar, public Tickable
+ {
+ public:
+ HUDShieldBar(Context* context);
+ virtual ~HUDShieldBar();
+
+ virtual void tick(float dt);
+ virtual void changedOwner();
+
+ inline void setShieldBarOwner(Pawn* owner)
+ { this->owner_ = owner; }
+ private:
+ Pawn* owner_;
+ };
+}
+#endif /* _HUDShieldBar_H__ */
Copied: code/trunk/src/modules/overlays/hud/HUDWeapon.cc (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDWeapon.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeapon.cc (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDWeapon.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,224 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "HUDWeapon.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+#include "core/class/Super.h"
+
+namespace orxonox
+{
+ RegisterClass(HUDWeapon);
+
+ HUDWeapon::HUDWeapon(Context* context) : OrxonoxOverlay(context)
+ {
+ RegisterObject(HUDWeapon);
+
+ weaponModeHUDActualSize_ = Vector2(0.0f,0.0f);
+
+ weaponModes_ = NULL;
+ weaponIndex_ = 0;
+ hudWeaponModes_.clear();
+
+ overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeapon" + getUniqueNumberString()));
+ overlayElement_->setMaterialName("Orxonox/WSHUD_Weapon");
+ overlayElement_->setPosition(0.0f,0.0f);
+ overlayElement_->setDimensions(1.0f,1.0f);
+ this->background_->addChild(overlayElement_);
+ }
+
+ HUDWeapon::~HUDWeapon()
+ {
+ if (this->isInitialized())
+ {
+ destroyHUDChilds();
+ }
+ }
+
+ void HUDWeapon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(HUDWeapon, XMLPort, xmlelement, mode);
+
+ /*XMLPortParam(HUDWeapons, "sensitivity", setRadarSensitivity, getRadarSensitivity, xmlelement, mode);
+ XMLPortParam(HUDWeapons, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance, xmlelement, mode);*/
+ }
+
+ void HUDWeapon::tick(float dt)
+ {
+ SUPER(HUDWeapon, tick, dt);
+
+ if (!weapon_)
+ {
+ // TODO: destroy this HUD id the Weapon does no more exist. (Wehen the weak pointer is NULL)
+ }
+ }
+
+ void HUDWeapon::positionChanged()
+ {
+ OrxonoxOverlay::positionChanged();
+
+ positionHUDChilds();
+ }
+
+ void HUDWeapon::sizeChanged()
+ {
+ OrxonoxOverlay::sizeChanged();
+
+ positionHUDChilds();
+ }
+
+ void HUDWeapon::changedOwner()
+ {
+ SUPER(HUDWeapon, changedOwner);
+
+ this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+
+ updateWeaponModeList();
+ }
+
+ void HUDWeapon::changedOverlayGroup()
+ {
+ SUPER(HUDWeapon, changedOverlayGroup);
+ }
+
+ void HUDWeapon::changedVisibility()
+ {
+ SUPER(HUDWeapon, changedVisibility);
+
+ bool visible = this->isVisible();
+
+ for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
+ {
+ (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
+ (*it)->setVisible(visible);
+ }
+ }
+
+ void HUDWeapon::changedName()
+ {
+ SUPER(HUDWeapon, changedName);
+ }
+
+ void HUDWeapon::setWeapon(Weapon* weapon)
+ {
+ weapon_ = weapon;
+
+ if (!weapon_)
+ {
+ return;
+ }
+
+ updateWeaponModeList();
+ }
+
+ void HUDWeapon::updateWeaponModeList()
+ {
+ if (owner_ == NULL || weapon_ == NULL)
+ {
+ return;
+ }
+
+ destroyHUDChilds();
+
+ weaponModes_ = weapon_->getAllWeaponmodes();
+
+ updateSize();
+ createHUDChilds();
+ positionHUDChilds();
+ }
+
+ void HUDWeapon::createHUDChilds()
+ {
+ if (weaponModes_ == NULL)
+ {
+ return;
+ }
+
+ int positionIndex = 0;
+
+ for (std::multimap<unsigned int, WeaponMode*>::iterator it = weaponModes_->begin(); it != weaponModes_->end(); ++it)
+ {
+ HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
+ hudWeaponMode->setOwner(owner_);
+ hudWeaponMode->setOverlayGroup(this->getOverlayGroup());
+ hudWeaponMode->setVisible(this->isVisible());
+ hudWeaponMode->setWeaponMode(it->second);
+ hudWeaponMode->setWeaponIndex(this->weaponIndex_);
+ hudWeaponMode->setAspectCorrection(false);
+ hudWeaponMode->setPickPoint(Vector2(0.0f,0.0f));
+
+ hudWeaponModes_.push_back(hudWeaponMode);
+
+ ++ positionIndex;
+ }
+ }
+
+ void HUDWeapon::positionHUDChilds()
+ {
+ int positionIndex = 0;
+
+ for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
+ {
+ (*it)->setPositionOffset(this->positionOffset_);
+ (*it)->setWeaponModeIndex(positionIndex);
+ (*it)->setWeaponIndex(this->weaponIndex_);
+ (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
+
+ ++ positionIndex;
+ }
+ }
+
+ void HUDWeapon::destroyHUDChilds()
+ {
+ for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
+ {
+ (*it)->destroy();
+ }
+
+ hudWeaponModes_.clear();
+ }
+
+ void HUDWeapon::updateSize()
+ {
+ if (weaponModes_ != NULL)
+ {
+ this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weaponModes_->size()));
+ updatePosition();
+ }
+ }
+
+ void HUDWeapon::updatePosition()
+ {
+ if (weaponModes_ != NULL)
+ {
+ this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_);
+ }
+ }
+}
Copied: code/trunk/src/modules/overlays/hud/HUDWeapon.h (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDWeapon.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeapon.h (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDWeapon.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,107 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef _HUDWeapon_H__
+#define _HUDWeapon_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h>
+
+#include "overlays/OrxonoxOverlay.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponMode.h"
+#include "HUDWeaponMode.h"
+
+namespace orxonox
+{
+ class _OverlaysExport HUDWeapon : public OrxonoxOverlay, public Tickable
+ {
+ public:
+ HUDWeapon(Context* context);
+ virtual ~HUDWeapon();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void tick(float dt);
+ virtual void changedOwner();
+ virtual void changedOverlayGroup();
+ virtual void changedVisibility();
+ virtual void changedName();
+ virtual void positionChanged();
+ virtual void sizeChanged();
+
+ virtual void setWeapon(Weapon* weapon);
+
+ inline void setWeaponModeHUDActualSize(Vector2 vector)
+ { weaponModeHUDActualSize_ = vector;
+ this->updateSize();
+ }
+ inline Vector2 getWeaponModeHUDActualSize() const
+ { return weaponModeHUDActualSize_; }
+ inline void setPositionOffset(Vector2 positionOffset)
+ {
+ this->positionOffset_ = positionOffset;
+ this->updatePosition();
+ }
+ inline void setWeaponIndex(int index)
+ {
+ weaponIndex_ = index;
+ this->updatePosition();
+ }
+
+ private:
+ virtual void createHUDChilds();
+ virtual void positionHUDChilds();
+ virtual void destroyHUDChilds();
+ virtual void updateWeaponModeList();
+ virtual void updateSize();
+ virtual void updatePosition();
+
+ WeakPtr<Pawn> owner_;
+ WeakPtr<Weapon> weapon_;
+
+ std::multimap<unsigned int, WeaponMode*>* weaponModes_;
+ std::vector<WeakPtr<HUDWeaponMode> > hudWeaponModes_;
+
+ Ogre::PanelOverlayElement* overlayElement_;
+
+ Vector2 weaponModeHUDActualSize_;
+ Vector2 positionOffset_;
+ int weaponIndex_;
+ };
+}
+
+#endif /* _HUDWeapon_H__ */
Copied: code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponMode.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,289 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "HUDWeaponMode.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+#include "core/class/Super.h"
+
+namespace orxonox
+{
+ RegisterClass(HUDWeaponMode);
+
+ HUDWeaponMode::HUDWeaponMode(Context* context) : OrxonoxOverlay(context)
+ {
+ RegisterObject(HUDWeaponMode);
+
+ weaponIndex_ = 0;
+ weaponModeIndex_ = 0;
+
+ overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+ overlayElementIcon_->setPosition(0.0f,0.0f);
+ overlayElementIcon_->setDimensions(1.0f,1.0f);
+ this->background_->addChild(overlayElementIcon_);
+
+ overlayElementReplenish_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+ overlayElementReplenish_->setPosition(0.0f,0.0f);
+ overlayElementReplenish_->setDimensions(1.0f,1.0f);
+ this->background_->addChild(overlayElementReplenish_);
+
+ overlayElementMunition_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+ overlayElementMunition_->setPosition(0.0f,0.0f);
+ overlayElementMunition_->setDimensions(1.0f,1.0f);
+ this->background_->addChild(overlayElementMunition_);
+
+ overlayElementState_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+ overlayElementState_->setPosition(0.0f,0.0f);
+ overlayElementState_->setDimensions(1.0f,1.0f);
+ this->background_->addChild(overlayElementState_);
+
+ overlayElementIcon_->show();
+ overlayElementReplenish_->show();
+ overlayElementMunition_->show();
+ overlayElementState_->show();
+
+ // Create two text overlays
+ this->textOverlayLeft_ = new OverlayText(this->getContext());
+ assert(this->textOverlayLeft_.get());
+ this->textOverlayLeft_->setCaption("?");
+ textOverlayLeft_->setPickPoint(Vector2(0.0f,0.0f));
+ textOverlayLeft_->setVisible(true);
+ textOverlayLeft_->setAlignment(OverlayText::Center);
+ textOverlayLeft_->setTextSize(0.02f);
+ textOverlayLeft_->setColour(ColourValue(0.21,0.70,0.21,1.0));
+ textOverlayLeft_->setAspectCorrection(false);
+ textOverlayLeft_->setZOrder(600);
+
+ this->textOverlayRight_ = new OverlayText(this->getContext());
+ assert(this->textOverlayRight_.get());
+ this->textOverlayRight_->setCaption("?");
+ textOverlayRight_->setPickPoint(Vector2(0.0f,0.0f));
+ textOverlayRight_->setVisible(true);
+ textOverlayRight_->setAlignment(OverlayText::Center);
+ textOverlayRight_->setTextSize(0.02f);
+ textOverlayRight_->setColour(ColourValue(0.21,0.70,0.21,1.0));
+ textOverlayRight_->setAspectCorrection(false);
+ textOverlayRight_->setZOrder(600);
+
+ materialNameState_ = "";
+
+ overlayElementReplenish_->setMaterialName("Orxonox/WSHUD_Replenish");
+ }
+
+ HUDWeaponMode::~HUDWeaponMode()
+ {
+ if (this->isInitialized())
+ {
+ this->textOverlayLeft_->destroy();
+ this->textOverlayRight_->destroy();
+ }
+ }
+
+ void HUDWeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(HUDWeaponMode, XMLPort, xmlelement, mode);
+ }
+
+ void HUDWeaponMode::tick(float dt)
+ {
+ SUPER(HUDWeaponMode, tick, dt);
+
+ if (this->owner_ && this->weaponMode_)
+ {
+ std::string lastMaterialNameState = materialNameState_;
+
+ if (weaponMode_->getReloading())
+ {
+ materialNameState_ = "Orxonox/WSHUD_Reloading";
+ }
+ else
+ {
+ materialNameState_ = "Orxonox/WSHUD_Ready";
+ }
+
+ Munition* munition = this->weaponMode_->getMunition();
+
+ if (munition != NULL)
+ {
+ MunitionDeployment::Value deployment = munition->getMunitionDeployment();
+
+ if (deployment == MunitionDeployment::Share)
+ {
+ this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunitionInCurrentMagazine(weaponMode_)));
+ this->textOverlayRight_->setCaption(multi_cast<std::string>(munition->getNumMagazines()));
+ }
+ else if (deployment == MunitionDeployment::Stack)
+ {
+ this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunition(weaponMode_)));
+ this->textOverlayRight_->setCaption("");
+ }
+ else if (deployment == MunitionDeployment::Separate)
+ {
+ this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunitionInCurrentMagazine(weaponMode_)));
+ this->textOverlayRight_->setCaption(multi_cast<std::string>(munition->getNumMagazines()));
+ }
+
+ if (munition->getNumMunition(weaponMode_) == 0)
+ {
+ materialNameState_ = "Orxonox/WSHUD_Empty";
+ }
+
+ if (munition->isA(Class(ReplenishingMunition)))
+ {
+ ReplenishingMunition* replenishingMunition = dynamic_cast<ReplenishingMunition*>(munition);
+
+ if (replenishingMunition->canAddMagazines(1))
+ {
+ float progress = 1.0f - replenishingMunition->getProgress();
+ overlayElementReplenish_->setDimensions(1.0f,progress);
+ }
+ else
+ {
+ overlayElementReplenish_->setDimensions(1.0f,1.0f);
+ }
+ }
+ }
+
+ if (materialNameState_ != lastMaterialNameState)
+ {
+ overlayElementState_->setMaterialName(materialNameState_);
+ }
+ }
+ }
+
+ void HUDWeaponMode::positionChanged()
+ {
+ OrxonoxOverlay::positionChanged();
+
+ positionHUDChilds();
+ }
+
+ void HUDWeaponMode::sizeChanged()
+ {
+ OrxonoxOverlay::sizeChanged();
+
+ positionHUDChilds();
+ }
+
+ void HUDWeaponMode::changedOwner()
+ {
+ SUPER(HUDWeaponMode, changedOwner);
+
+ this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+
+ materialNameState_ = ""; // Needed to set the material in the tick after a change of the owner.
+ }
+
+ void HUDWeaponMode::changedOverlayGroup()
+ {
+ SUPER(HUDWeaponMode, changedOverlayGroup);
+
+ this->getOverlayGroup()->addElement(this->textOverlayLeft_.get());
+ this->getOverlayGroup()->addElement(this->textOverlayRight_.get());
+ }
+
+ void HUDWeaponMode::changedVisibility()
+ {
+ SUPER(HUDWeaponMode, changedVisibility);
+
+ bool visible = this->isVisible();
+
+ this->textOverlayLeft_->setVisible(visible);
+ this->textOverlayRight_->setVisible(visible);
+ }
+
+ void HUDWeaponMode::changedName()
+ {
+ SUPER(HUDWeaponMode, changedName);
+
+ //this->textOverlay_->setName(this->getName() + "text");
+ }
+
+ void HUDWeaponMode::setWeaponMode(WeaponMode* weaponMode)
+ {
+ weaponMode_ = weaponMode;
+
+ if (!weaponMode_)
+ {
+ return;
+ }
+
+ std::string materialName = weaponMode_->getHUDImageString();
+
+ overlayElementIcon_->setMaterialName(materialName);
+
+ Munition* munition = this->weaponMode_->getMunition();
+
+ if (munition != NULL)
+ {
+ MunitionDeployment::Value deployment = munition->getMunitionDeployment();
+
+ if (deployment == MunitionDeployment::Share)
+ {
+ overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionShare");
+ }
+ else if (deployment == MunitionDeployment::Stack)
+ {
+ overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionStack");
+ }
+ else if (deployment == MunitionDeployment::Separate)
+ {
+ overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionSeparate");
+ }
+ }
+ }
+
+ void HUDWeaponMode::positionHUDChilds()
+ {
+ Vector2 size = Vector2(getSize().x*45.0f/150.0f, getSize().y);
+ Vector2 offset1 = Vector2(getSize().x*82.5f/150.0f, 0.0f);
+ Vector2 offset2 = Vector2(getSize().x*127.5f/150.0f, 0.0f);
+
+ textOverlayLeft_->setPosition(getPosition() + offset1);
+ textOverlayRight_->setPosition(getPosition() + offset2);
+
+ textOverlayLeft_->setSize(size);
+ textOverlayRight_->setSize(size);
+
+ textOverlayLeft_->setTextSize(getSize().y);
+ textOverlayRight_->setTextSize(getSize().y);
+ }
+
+ void HUDWeaponMode::updateSize()
+ {
+ this->setSize(weaponModeHUDActualSize_);
+ updatePosition();
+ }
+
+ void HUDWeaponMode::updatePosition()
+ {
+ this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,weaponModeHUDActualSize_.y*weaponModeIndex_) + this->positionOffset_);
+ }
+}
Copied: code/trunk/src/modules/overlays/hud/HUDWeaponMode.h (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponMode.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponMode.h (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponMode.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,115 @@
+
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef _HUDWeaponMode_H__
+#define _HUDWeaponMode_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h>
+
+#include "overlays/OrxonoxOverlay.h"
+#include "overlays/OverlayText.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+#include "weaponsystem/ReplenishingMunition.h"
+#include "weaponsystem/WeaponMode.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+ class _OverlaysExport HUDWeaponMode : public OrxonoxOverlay, public Tickable
+ {
+ public:
+ HUDWeaponMode(Context* context);
+ virtual ~HUDWeaponMode();
+
+ virtual void tick(float dt);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedOwner();
+ virtual void changedOverlayGroup();
+ virtual void changedVisibility();
+ virtual void changedName();
+ virtual void positionChanged();
+ virtual void sizeChanged();
+
+ virtual void setWeaponMode(WeaponMode* weaponMode);
+
+ inline void setWeaponModeHUDActualSize(Vector2 vector)
+ { weaponModeHUDActualSize_ = vector;
+ this->updateSize();
+ }
+ inline Vector2 getWeaponModeHUDActualSize() const
+ { return weaponModeHUDActualSize_; }
+ inline void setWeaponIndex(int index)
+ { weaponIndex_ = index;
+ this->updatePosition();
+ }
+ inline void setWeaponModeIndex(int index)
+ { weaponModeIndex_ = index;
+ this->updatePosition();
+ }
+ inline void setPositionOffset(Vector2 positionOffset)
+ {
+ this->positionOffset_ = positionOffset;
+ this->updatePosition();
+ }
+
+ private:
+ virtual void updateSize();
+ virtual void updatePosition();
+ virtual void positionHUDChilds();
+
+ WeakPtr<Pawn> owner_;
+ WeakPtr<WeaponMode> weaponMode_;
+
+ Ogre::PanelOverlayElement* overlayElementIcon_;
+ Ogre::PanelOverlayElement* overlayElementReplenish_;
+ Ogre::PanelOverlayElement* overlayElementMunition_;
+ Ogre::PanelOverlayElement* overlayElementState_;
+
+ std::string materialNameState_;
+
+ StrongPtr<OverlayText> textOverlayLeft_;
+ StrongPtr<OverlayText> textOverlayRight_;
+
+ Vector2 weaponModeHUDActualSize_;
+ Vector2 positionOffset_;
+ int weaponIndex_;
+ int weaponModeIndex_;
+ };
+}
+
+#endif /* _HUDWeaponMode_H__ */
Copied: code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponSystem.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,188 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#include "HUDWeaponSystem.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/Weapon.h"
+#include "util/Convert.h"
+#include "core/class/Super.h"
+
+namespace orxonox
+{
+ RegisterClass(HUDWeaponSystem);
+
+ HUDWeaponSystem::HUDWeaponSystem(Context* context) : OrxonoxOverlay(context)
+ {
+ RegisterObject(HUDWeaponSystem);
+
+ weaponModeHUDSize_ = Vector2(0.0f,0.0f);
+ weaponModeHUDActualSize_ = Vector2(0.0f,0.0f);
+
+ weapons_.clear();
+ hudWeapons_.clear();
+ }
+
+ HUDWeaponSystem::~HUDWeaponSystem()
+ {
+ if (this->isInitialized())
+ {
+ destroyHUDChilds();
+ }
+ }
+
+ void HUDWeaponSystem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(HUDWeaponSystem, XMLPort, xmlelement, mode);
+
+ XMLPortParam(HUDWeaponSystem, "weaponModeHUDSize", setWeaponModeHUDSize, getWeaponModeHUDSize, xmlelement, mode);
+ }
+
+ void HUDWeaponSystem::positionChanged()
+ {
+ OrxonoxOverlay::positionChanged();
+
+ positionHUDChilds();
+ }
+
+ void HUDWeaponSystem::sizeChanged()
+ {
+ OrxonoxOverlay::sizeChanged();
+
+ weaponModeHUDActualSize_ = this->getActualSize();
+
+ positionHUDChilds();
+ }
+
+ void HUDWeaponSystem::changedOwner()
+ {
+ SUPER(HUDWeaponSystem, changedOwner);
+
+ this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+
+ updateWeaponList();
+ }
+
+ void HUDWeaponSystem::changedOverlayGroup()
+ {
+ SUPER(HUDWeaponSystem, changedOverlayGroup);
+ }
+
+ void HUDWeaponSystem::changedVisibility()
+ {
+ SUPER(HUDWeaponSystem, changedVisibility);
+
+ bool visible = this->isVisible();
+
+ for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
+ {
+ (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
+ (*it)->setVisible(visible);
+ }
+ }
+
+ void HUDWeaponSystem::changedName()
+ {
+ SUPER(HUDWeaponSystem, changedName);
+ }
+
+ void HUDWeaponSystem::updateWeaponList()
+ {
+ if (owner_ == NULL)
+ {
+ return;
+ }
+
+ weapons_.clear();
+
+ destroyHUDChilds();
+
+ std::vector<WeaponPack*>* weaponPacks = owner_->getAllWeaponPacks();
+
+ for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks->begin(); itPacks != weaponPacks->end(); ++itPacks)
+ {
+ std::vector<Weapon*>* weapons = (*itPacks)->getAllWeapons();
+
+ for (std::vector<Weapon*>::const_iterator itWeapons = weapons->begin(); itWeapons != weapons->end(); ++itWeapons)
+ {
+ this->weapons_.push_back(*itWeapons);
+ }
+ }
+
+ createHUDChilds();
+ positionHUDChilds();
+ }
+
+ void HUDWeaponSystem::createHUDChilds()
+ {
+ int positionIndex = 0;
+
+ for (std::vector<WeakPtr<Weapon> >::iterator it = weapons_.begin(); it != weapons_.end(); ++it)
+ {
+ HUDWeapon* hudWeapon = new HUDWeapon(this->getContext());
+ hudWeapon->setOwner(owner_);
+ hudWeapon->setOverlayGroup(this->getOverlayGroup());
+ hudWeapon->setVisible(this->isVisible());
+ hudWeapon->setWeapon(*it);
+ hudWeapon->setAspectCorrection(false);
+ hudWeapon->setPickPoint(Vector2(0.0f,0.0f));
+
+ hudWeapons_.push_back(hudWeapon);
+
+ ++ positionIndex;
+ }
+ }
+
+ void HUDWeaponSystem::positionHUDChilds()
+ {
+ int positionIndex = 0;
+ Vector2 offset = this->getPosition();
+
+ for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
+ {
+ (*it)->setPositionOffset(offset);
+ (*it)->setWeaponIndex(positionIndex);
+ (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
+
+ ++ positionIndex;
+ }
+ }
+
+ void HUDWeaponSystem::destroyHUDChilds()
+ {
+ for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
+ {
+ (*it)->destroy();
+ }
+
+ hudWeapons_.clear();
+ }
+}
Copied: code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h (from rev 11051, code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponSystem.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,81 @@
+/*
+ * 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:
+ * ...
+ *
+ */
+
+#ifndef _HUDWeaponSystem_H__
+#define _HUDWeaponSystem_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include "overlays/OrxonoxOverlay.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+#include "HUDWeapon.h"
+
+namespace orxonox
+{
+ class _OverlaysExport HUDWeaponSystem : public OrxonoxOverlay
+ {
+ public:
+ HUDWeaponSystem(Context* context);
+ virtual ~HUDWeaponSystem();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedOwner();
+ virtual void changedOverlayGroup();
+ virtual void changedVisibility();
+ virtual void changedName();
+ virtual void positionChanged();
+ virtual void sizeChanged();
+ protected:
+ inline void setWeaponModeHUDSize(Vector2 vector)
+ { weaponModeHUDSize_ = vector;
+ this->setSize(weaponModeHUDSize_);
+ }
+ inline Vector2 getWeaponModeHUDSize() const
+ { return weaponModeHUDSize_; }
+ private:
+ virtual void updateWeaponList();
+ virtual void createHUDChilds();
+ virtual void positionHUDChilds();
+ virtual void destroyHUDChilds();
+
+ WeakPtr<Pawn> owner_;
+
+ std::vector<WeakPtr<Weapon> > weapons_;
+ std::vector<WeakPtr<HUDWeapon> > hudWeapons_;
+
+ Vector2 weaponModeHUDSize_;
+ Vector2 weaponModeHUDActualSize_;
+ };
+}
+
+#endif /* _HUDWeaponSystem_H__ */
Modified: code/trunk/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/trunk/src/modules/pickup/PickupPrereqs.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/pickup/PickupPrereqs.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -84,6 +84,8 @@
class ShieldPickup;
class ShrinkPickup;
class DamageBoostPickup;
+ class MunitionPickup;
+ class MunitionContainer;
}
#endif /* _PickupPrereqs_H__ */
Modified: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -186,7 +186,7 @@
sphere->setScale(0.1f);
Billboard* icon = new Billboard(spawner->getContext());
icon->setColour(ColourValue(0.89f, 0.79f, 0.08f));
- icon->setMaterial("asterisk");
+ icon->setMaterial("Unknown");
icon->setScale(0.5);
sphere->attach(icon);
representation->attach(sphere);
Copied: code/trunk/src/modules/pickup/items/BoostPickup.cc (from rev 11051, code/branches/presentationHS15/src/modules/pickup/items/BoostPickup.cc)
===================================================================
--- code/trunk/src/modules/pickup/items/BoostPickup.cc (rev 0)
+++ code/trunk/src/modules/pickup/items/BoostPickup.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,147 @@
+/*
+ * 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 BoostPickup.cc
+ @brief Implementation of the BoostPickup class.
+*/
+
+#include "BoostPickup.h"
+
+#include <sstream>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+ RegisterClass(BoostPickup);
+
+ /**
+ @brief
+ Constructor. Registers the object and initializes the member variables.
+ */
+ BoostPickup::BoostPickup(Context* context) : Pickup(context)
+ {
+ RegisterObject(BoostPickup);
+
+ this->initialize();
+ }
+
+ /**
+ @brief
+ Destructor.
+ */
+ BoostPickup::~BoostPickup()
+ {
+ }
+
+ /**
+ @brief
+ Initializes the member variables.
+ */
+ void BoostPickup::initialize(void)
+ {
+ this->boostRefill_ = 0.0f;
+ //Defines who is allowed to pick up the pickup.
+ this->addTarget(ClassIdentifier<SpaceShip>::getIdentifier());
+ }
+
+ /**
+ @brief
+ Method for creating a BoostPickup object through XML.
+ */
+ void BoostPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+ {
+ SUPER(BoostPickup, XMLPort, xmlelement, mode);
+
+ XMLPortParam(BoostPickup, "boostrefill", setBoostRefill, getBoostRefill, xmlelement, mode);
+ }
+
+ /**
+ @brief
+ Set the boost refill of this pickup.
+ */
+ void BoostPickup::setBoostRefill(float boostRefill)
+ {
+ if(boostRefill >= 0.0f && boostRefill <= 1.0f)
+ {
+ this->boostRefill_ = boostRefill;
+ }
+ }
+
+ /**
+ @brief
+ Is called when the pickup has transisted from used to unused or the other way around.
+ */
+ void BoostPickup::changedUsed(void)
+ {
+ SUPER(BoostPickup, changedUsed);
+
+ SpaceShip* ship = this->carrierToSpaceShipHelper();
+ if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
+ this->Pickupable::destroy();
+
+ // If the pickup has transited to used.
+ if(this->isUsed())
+ {
+ float gainedBoostPower = ship->getInitialBoostPower() * boostRefill_;
+ ship->gainBoostPower(gainedBoostPower);
+
+ // This will destroy the pickp
+ this->setUsed(false);
+ }
+ else
+ {
+ this->Pickupable::destroy();
+ }
+ }
+
+ /**
+ @brief
+ Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
+ @return
+ A pointer to the SpaceShip, or NULL if the conversion failed.
+ */
+ SpaceShip* BoostPickup::carrierToSpaceShipHelper(void)
+ {
+ PickupCarrier* carrier = this->getCarrier();
+ SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
+
+ if(ship == NULL)
+ {
+ orxout(internal_error, context::pickups) << "Invalid PickupCarrier in BoostPickup." << endl;
+ }
+
+ return ship;
+ }
+
+
+}
+
Copied: code/trunk/src/modules/pickup/items/BoostPickup.h (from rev 11051, code/branches/presentationHS15/src/modules/pickup/items/BoostPickup.h)
===================================================================
--- code/trunk/src/modules/pickup/items/BoostPickup.h (rev 0)
+++ code/trunk/src/modules/pickup/items/BoostPickup.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,72 @@
+/*
+ * 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 BoostPickup.h
+ @brief Declaration of the BoostPickup class.
+ @ingroup PickupItems
+*/
+
+#ifndef _BoostPickup_H__
+#define _BoostPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+
+#include "pickup/Pickup.h"
+
+namespace orxonox
+{
+
+ class _PickupExport BoostPickup : public Pickup
+ {
+ public:
+
+ BoostPickup(Context* context); //!< Constructor.
+ virtual ~BoostPickup(); //!< Destructor.
+
+ virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a BoostPickup object through XML.
+
+ virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+ inline float getBoostRefill()
+ { return this->boostRefill_; }
+
+ protected:
+ void setBoostRefill(float boostRefill); //!< Sets the boost refill according to the XML.
+
+ private:
+ void initialize(void); //!< Initializes the member variables.
+ Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+ SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
+
+ float boostRefill_; //!< The amount of boost refilled by the user of the pickup. 1.0 means full refill, 0.5 means half refill.
+ };
+}
+
+#endif /* _BoostPickup_H__ */
Modified: code/trunk/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/items/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/pickup/items/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -7,4 +7,7 @@
ShieldPickup.cc
ShrinkPickup.cc
DamageBoostPickup.cc
+ BoostPickup.cc
+ MunitionPickup.cc
+ MunitionContainer.cc
)
Modified: code/trunk/src/modules/pickup/items/DronePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/pickup/items/DronePickup.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -42,7 +42,8 @@
#include "pickup/Pickup.h"
#include "tools/interfaces/Tickable.h"
-namespace orxonox {
+namespace orxonox
+{
/**
@brief
@@ -79,9 +80,6 @@
void initialize(void); //!< Initializes the member variables.
std::string droneTemplate_; //!< The name of the template, based upon which the Drone is created.
Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
-
-
-
};
}
Copied: code/trunk/src/modules/pickup/items/MunitionContainer.cc (from rev 11051, code/branches/presentationHS15/src/modules/pickup/items/MunitionContainer.cc)
===================================================================
--- code/trunk/src/modules/pickup/items/MunitionContainer.cc (rev 0)
+++ code/trunk/src/modules/pickup/items/MunitionContainer.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,117 @@
+/*
+ * 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 MunitionContainer.cc
+ @brief Implementation of the MunitionContainer class. This class is only used by the MunitionPickup class to defines how much munition of what type the pickup contains.
+*/
+
+#include "MunitionContainer.h"
+
+#include <sstream>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+ RegisterClass(MunitionContainer);
+
+ /**
+ @brief
+ Constructor. Registers the object and initializes the member variables.
+ */
+ MunitionContainer::MunitionContainer(Context* context) : BaseObject(context)
+ {
+ RegisterObject(MunitionContainer);
+
+ this->munitionName_ = "";
+ this->munitionAmount_ = 1;
+ this->magazinesAmount_ = 1;
+ }
+
+ /**
+ @brief
+ Destructor.
+ */
+ MunitionContainer::~MunitionContainer()
+ {
+ }
+
+ /**
+ @brief
+ Method for creating a MunitionContainer object through XML.
+ */
+ void MunitionContainer::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+ {
+ SUPER(MunitionContainer, XMLPort, xmlelement, mode);
+
+ XMLPortParam(MunitionContainer, "munitiontype", setMunitionName, getMunitionName, xmlelement, mode).defaultValues("LaserMunition");
+ XMLPortParam(MunitionContainer, "munitionamount", setMunitionAmount, getMunitionAmount, xmlelement, mode).defaultValues(1);
+ XMLPortParam(MunitionContainer, "magazinesamount", setMagazinesAmount, getMagazinesAmount, xmlelement, mode).defaultValues(0);
+ }
+
+ void MunitionContainer::setMunitionName(const std::string& munitionName)
+ {
+ Identifier* identifier = ClassByString(munitionName);
+ if (identifier)
+ {
+ this->munitionName_ = munitionName;
+ this->munitionType_ = identifier;
+ }
+ else
+ {
+ this->munitionName_ = "";
+ orxout(internal_warning) << "Invalid munition class defined in MunitionContainer." << endl;
+ }
+ }
+
+ void MunitionContainer::setMunitionAmount(int munitionAmount)
+ {
+ if (munitionAmount > 0)
+ {
+ munitionAmount_ = munitionAmount;
+ }
+ else
+ {
+ munitionAmount_ = 0;
+ }
+ }
+
+ void MunitionContainer::setMagazinesAmount(int magazinesAmount)
+ {
+ if (magazinesAmount > 0)
+ {
+ magazinesAmount_ = magazinesAmount;
+ }
+ else
+ {
+ magazinesAmount_ = 0;
+ }
+ }
+}
+
Copied: code/trunk/src/modules/pickup/items/MunitionContainer.h (from rev 11051, code/branches/presentationHS15/src/modules/pickup/items/MunitionContainer.h)
===================================================================
--- code/trunk/src/modules/pickup/items/MunitionContainer.h (rev 0)
+++ code/trunk/src/modules/pickup/items/MunitionContainer.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,80 @@
+/*
+ * 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 MunitionContainer.h
+ @brief Declaration of the MunitionContainer class.
+ @ingroup PickupItems
+*/
+
+#ifndef _MunitionContainer_H__
+#define _MunitionContainer_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+
+#include "pickup/Pickup.h"
+#include "core/class/SubclassIdentifier.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+ class _PickupExport MunitionContainer : public BaseObject
+ {
+ public:
+
+ MunitionContainer(Context* context);
+ virtual ~MunitionContainer();
+
+ virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode);
+
+ inline const std::string& getMunitionName() const
+ { return this->munitionName_; }
+ inline int getMunitionAmount() const
+ { return this->munitionAmount_; }
+ inline int getMagazinesAmount() const
+ { return this->magazinesAmount_; }
+ inline SubclassIdentifier<Munition> getMunitionType() const
+ { return munitionType_; }
+
+ protected:
+ void setMunitionName(const std::string& munitionName);
+ void setMunitionAmount(int munitionAmount);
+ void setMagazinesAmount(int magazinesAmount_);
+
+ private:
+ SubclassIdentifier<Munition> munitionType_; //!< Indentifier of the munition type.
+ std::string munitionName_; //!< String containing the class name of the munition type (e.g. "LaserMunition")
+ int munitionAmount_; //!< The amount of singe bullets added
+ int magazinesAmount_; //!< The amount of full magazines added
+
+ };
+}
+
+#endif // _MunitionContainer_H__
Copied: code/trunk/src/modules/pickup/items/MunitionPickup.cc (from rev 11051, code/branches/presentationHS15/src/modules/pickup/items/MunitionPickup.cc)
===================================================================
--- code/trunk/src/modules/pickup/items/MunitionPickup.cc (rev 0)
+++ code/trunk/src/modules/pickup/items/MunitionPickup.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,156 @@
+/*
+ * 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 MunitionPickup.cc
+ @brief Implementation of the MunitionPickup class.
+*/
+
+#include "MunitionPickup.h"
+
+#include <sstream>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+ RegisterClass(MunitionPickup);
+
+ /**
+ @brief
+ Constructor. Registers the object and initializes the member variables.
+ */
+ MunitionPickup::MunitionPickup(Context* context) : Pickup(context)
+ {
+ RegisterObject(MunitionPickup);
+
+ this->initialize();
+ }
+
+ /**
+ @brief
+ Destructor.
+ */
+ MunitionPickup::~MunitionPickup()
+ {
+ }
+
+ /**
+ @brief
+ Initializes the member variables.
+ */
+ void MunitionPickup::initialize(void)
+ {
+ //Defines who is allowed to pick up the pickup.
+ this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
+ }
+
+ /**
+ @brief
+ Method for creating a MunitionPickup object through XML.
+ */
+ void MunitionPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+ {
+ SUPER(MunitionPickup, XMLPort, xmlelement, mode);
+
+ XMLPortObject(MunitionPickup, MunitionContainer, "munitioncontainers", addMunitionContainer, getMunitionContainer, xmlelement, mode);
+ }
+
+ void MunitionPickup::addMunitionContainer(MunitionContainer* munitionContainer)
+ {
+ OrxAssert(munitionContainer != NULL, "The munitionContainer cannot be NULL.");
+ this->munitionContainers_.push_back(munitionContainer);
+ }
+
+ MunitionContainer* MunitionPickup::getMunitionContainer(unsigned int index)
+ {
+ if(this->munitionContainers_.size() >= index)
+ return NULL;
+ else
+ return this->munitionContainers_[index];
+ }
+
+ /**
+ @brief
+ Is called when the pickup has transisted from used to unused or the other way around.
+ */
+ void MunitionPickup::changedUsed(void)
+ {
+ SUPER(MunitionPickup, changedUsed);
+
+ Pawn* pawn = this->carrierToPawnHelper();
+
+ if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
+ this->Pickupable::destroy();
+
+ // If the pickup has transited to used.
+ if(this->isUsed())
+ {
+ for(std::vector<MunitionContainer*>::iterator it = this->munitionContainers_.begin(); it != this->munitionContainers_.end(); ++it)
+ {
+ //Get pointer to the appropriate munition
+ SubclassIdentifier<Munition> identifier = (*it)->getMunitionType();
+ Munition* munition = pawn->getMunition(&identifier);
+ if (munition)
+ {
+ // Add munition and magzines
+ munition->addMunition((*it)->getMunitionAmount());
+ munition->addMagazines((*it)->getMagazinesAmount());
+ }
+ (*it)->destroy();
+ }
+ // This will destroy the pickp
+ this->setUsed(false);
+ }
+ else
+ {
+ this->Pickupable::destroy();
+ }
+ }
+
+ /**
+ @brief
+ Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+ @return
+ A pointer to the Pawn, or NULL if the conversion failed.
+ */
+ Pawn* MunitionPickup::carrierToPawnHelper(void)
+ {
+ PickupCarrier* carrier = this->getCarrier();
+ Pawn* pawn = orxonox_cast<Pawn*>(carrier);
+
+ if(pawn == NULL)
+ {
+ orxout(internal_error, context::pickups) << "Invalid PickupCarrier in MunitionPickup." << endl;
+ }
+ return pawn;
+ }
+}
+
Copied: code/trunk/src/modules/pickup/items/MunitionPickup.h (from rev 11051, code/branches/presentationHS15/src/modules/pickup/items/MunitionPickup.h)
===================================================================
--- code/trunk/src/modules/pickup/items/MunitionPickup.h (rev 0)
+++ code/trunk/src/modules/pickup/items/MunitionPickup.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,77 @@
+/*
+ * 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 MunitionPickup.h
+ @brief Declaration of the MunitionPickup class.
+ @ingroup PickupItems
+*/
+
+#ifndef _MunitionPickup_H__
+#define _MunitionPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+#include <vector>
+
+#include "pickup/Pickup.h"
+#include "pickup/items/MunitionContainer.h"
+#include "core/class/SubclassIdentifier.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+ /**
+ @brief
+ The MunitionPickup gives munition to the user (a @ref Pawn).
+ */
+ class _PickupExport MunitionPickup : public Pickup
+ {
+ public:
+
+ MunitionPickup(Context* context); //!< Constructor.
+ virtual ~MunitionPickup(); //!< Destructor.
+
+ virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MunitionPickup object through XML.
+
+ virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+
+ virtual void addMunitionContainer(MunitionContainer* munitionContainer);
+ MunitionContainer* getMunitionContainer(unsigned int index);
+
+ private:
+ void initialize(void); //!< Initializes the member variables.
+ Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+
+ std::vector<MunitionContainer*> munitionContainers_;
+
+ };
+}
+
+#endif // _MunitionPickup_H__
Property changes on: code/trunk/src/modules/towerdefense/TowerDefenseField.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/towerdefense/TowerDefenseField.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/towerdefense/TowerDefenseSelecter.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseSelecter.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/towerdefense/TowerDefenseSelecter.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -87,7 +87,7 @@
if (moveDownPressed_ == true)
{
moveDownPressed_ = false;
- selectedPos_->Set(selecterPosX, selecterPosY - 1);
+ selectedPos_->Set(selecterPosX, selecterPosY - 1);
updatePosition();
}
if (moveLeftPressed_ == true)
@@ -99,7 +99,7 @@
if (moveRightPressed_ == true)
{
moveRightPressed_ = false;
- selectedPos_->Set(selecterPosX + 1, selecterPosY);
+ selectedPos_->Set(selecterPosX + 1, selecterPosY);
updatePosition();
}
if (boostPressed_ == true)
Modified: code/trunk/src/modules/towerdefense/TowerDefenseTower.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseTower.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/towerdefense/TowerDefenseTower.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -60,14 +60,9 @@
if(upgrade < 5)
{
upgrade++;
- float reloadrate = getReloadRate();
- float reloadwaittime = getReloadWaitTime();
this->setDamageMultiplier((upgrade+1)*2.0f);
+
//this->setRotationThrust(2*this->getRotationThrust());
- reloadrate = 0.5f*reloadrate;
- reloadwaittime = 0.5f*reloadwaittime;
- setReloadRate(reloadrate);
- setReloadWaitTime(reloadwaittime);
//this->addTemplate("towerturret1");
}
else
Property changes on: code/trunk/src/modules/weapons/IceGunFreezer.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/weapons/IceGunFreezer.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/trunk/src/modules/weapons/WeaponsPrereqs.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/WeaponsPrereqs.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -68,19 +68,26 @@
namespace orxonox
{
class MuzzleFlash;
+ class IceGunFreezer;
+ class RocketController;
// munitions
class FusionMunition;
class LaserMunition;
- class ReplenishingMunition;
class RocketMunition;
class GravityBombMuntion;
+ class IceMunition;
+ class LightningMunition;
+ class SplitMunition;
// projectiles
class BillboardProjectile;
class LightningGunProjectile;
class ParticleProjectile;
+ class IceProjectile;
+ class SplitProjectile;
class Projectile;
+ class BasicProjectile;
class Rocket;
class RocketOld;
class SimpleRocket;
@@ -90,8 +97,11 @@
class EnergyDrink;
class FusionFire;
class HsW01;
+ class IceGun;
+ class SplitGun;
class LaserFire;
class LightningGun;
+ class MineGun;
class RocketFire;
class RocketFireOld;
class SimpleRocketFire;
Modified: code/trunk/src/modules/weapons/munitions/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/munitions/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,9 +1,10 @@
ADD_SOURCE_FILES(WEAPONS_SRC_FILES
- ReplenishingMunition.cc
LaserMunition.cc
+ LightningMunition.cc
FusionMunition.cc
RocketMunition.cc
GravityBombMunition.cc
IceMunition.cc
SplitMunition.cc
+ MineMunition.cc
)
Modified: code/trunk/src/modules/weapons/munitions/FusionMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/FusionMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/FusionMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -27,12 +27,13 @@
*/
/**
- @file FusionMunition.h
+ @file FusionMunition.cc
@brief Implementation of the FusionMunition class.
*/
#include "FusionMunition.h"
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -44,13 +45,20 @@
this->maxMunitionPerMagazine_ = 10;
this->maxMagazines_ = 10;
- this->magazines_ = 10;
+ this->unassignedMagazines_ = 10;
- this->bUseSeparateMagazines_ = true;
- this->bStackMunition_ = false;
+ this->deployment_ = MunitionDeployment::Separate;
+
this->reloadTime_ = 1.0f;
this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = true;
+
+ this->reloadTime_ = 0.5f;
}
+
+ void FusionMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(FusionMunition, XMLPort, xmlelement, mode);
+ }
}
Modified: code/trunk/src/modules/weapons/munitions/FusionMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/FusionMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/FusionMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -52,6 +52,7 @@
public:
FusionMunition(Context* context);
virtual ~FusionMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
}
Modified: code/trunk/src/modules/weapons/munitions/GravityBombMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/GravityBombMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/GravityBombMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -6,6 +6,7 @@
*/
#include "GravityBombMunition.h"
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -16,15 +17,20 @@
RegisterObject(GravityBombMunition);
this->maxMunitionPerMagazine_ = 1;
this->maxMagazines_ = 30;
- this->magazines_ = 15;
+ this->unassignedMagazines_ = 15;
- this->bUseSeparateMagazines_ = false;
- this->bStackMunition_ = true;
+ this->deployment_ = MunitionDeployment::Stack;
this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = false;
+
+ this->reloadTime_ = 0.0f;
}
+ void GravityBombMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(GravityBombMunition, XMLPort, xmlelement, mode);
+ }
}
Modified: code/trunk/src/modules/weapons/munitions/GravityBombMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/GravityBombMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/GravityBombMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -27,6 +27,7 @@
public:
GravityBombMunition(Context* context);
virtual ~GravityBombMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
}
Modified: code/trunk/src/modules/weapons/munitions/IceMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/IceMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/IceMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -27,12 +27,13 @@
*/
/**
- @file IceMunition.h
+ @file IceMunition.cc
@brief Implementation of the IceMunition class.
*/
#include "IceMunition.h"
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -44,12 +45,18 @@
this->maxMunitionPerMagazine_ = 1;
this->maxMagazines_ = 50;
- this->magazines_ = 25;
+ this->unassignedMagazines_ = 25;
- this->bUseSeparateMagazines_ = false;
- this->bStackMunition_ = true;
+ this->deployment_ = MunitionDeployment::Stack;
- this->bAllowMunitionRefilling_ = false;
+ this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = false;
+
+ this->reloadTime_ = 0.5f;
}
+
+ void IceMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(IceMunition, XMLPort, xmlelement, mode);
+ }
}
Property changes on: code/trunk/src/modules/weapons/munitions/IceMunition.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/munitions/IceMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/IceMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/IceMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -52,6 +52,7 @@
public:
IceMunition(Context* context);
virtual ~IceMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
}
Property changes on: code/trunk/src/modules/weapons/munitions/IceMunition.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/munitions/LaserMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/LaserMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/LaserMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -27,12 +27,13 @@
*/
/**
- @file LaserMunition.h
+ @file LaserMunition.cc
@brief Implementation of the LaserMunition class.
*/
#include "LaserMunition.h"
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -43,16 +44,22 @@
RegisterObject(LaserMunition);
this->maxMunitionPerMagazine_ = 20;
- this->maxMagazines_ = 1;
- this->magazines_ = 1;
+ this->maxMagazines_ = 10;
+ this->unassignedMagazines_ = 10;
- this->bUseSeparateMagazines_ = false;
- this->bStackMunition_ = true;
+ this->deployment_ = MunitionDeployment::Separate;
this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = true;
- this->replenishInterval_ = 0.5f;
- this->replenishMunitionAmount_ = 1;
+ this->replenishInterval_ = 7.0f;
+ this->replenishAmount_ = 1;
+
+ this->reloadTime_ = 0.5f;
}
+
+ void LaserMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(LaserMunition, XMLPort, xmlelement, mode);
+ }
}
Modified: code/trunk/src/modules/weapons/munitions/LaserMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/LaserMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/LaserMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -35,7 +35,7 @@
#define _LaserMunition_H__
#include "weapons/WeaponsPrereqs.h"
-#include "ReplenishingMunition.h"
+#include "weaponsystem/ReplenishingMunition.h"
namespace orxonox
{
@@ -52,6 +52,7 @@
public:
LaserMunition(Context* context);
virtual ~LaserMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
}
Copied: code/trunk/src/modules/weapons/munitions/LightningMunition.cc (from rev 11051, code/branches/presentationHS15/src/modules/weapons/munitions/LightningMunition.cc)
===================================================================
--- code/trunk/src/modules/weapons/munitions/LightningMunition.cc (rev 0)
+++ code/trunk/src/modules/weapons/munitions/LightningMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file LightningMunition.cc
+ @brief Implementation of the LightningMunition class.
+*/
+
+#include "LightningMunition.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+ RegisterClass(LightningMunition);
+
+ LightningMunition::LightningMunition(Context* context) : Munition(context)
+ {
+ RegisterObject(LightningMunition);
+
+ this->maxMunitionPerMagazine_ = 20;
+ this->maxMagazines_ = 1;
+ this->unassignedMagazines_ = 1;
+
+ this->deployment_ = MunitionDeployment::Share;
+
+ this->bAllowMunitionRefilling_ = true;
+ this->bAllowMultiMunitionRemovementUnderflow_ = true;
+
+ this->reloadTime_ = 0.5f;
+ }
+
+ void LightningMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(LightningMunition, XMLPort, xmlelement, mode);
+ }
+}
Copied: code/trunk/src/modules/weapons/munitions/LightningMunition.h (from rev 11051, code/branches/presentationHS15/src/modules/weapons/munitions/LightningMunition.h)
===================================================================
--- code/trunk/src/modules/weapons/munitions/LightningMunition.h (rev 0)
+++ code/trunk/src/modules/weapons/munitions/LightningMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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 LightningMunition.h
+ @brief Definition of the LightningMunition class.
+*/
+
+#ifndef _LightningMunition_H__
+#define _LightningMunition_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ LightningMunition.
+ @author
+ Fabien Vultier
+ @ingroup WeaponsMunitions
+ */
+ class _WeaponsExport LightningMunition : public Munition
+ {
+ public:
+ LightningMunition(Context* context);
+ virtual ~LightningMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ };
+}
+
+#endif /* _LightningMunition_H__ */
Copied: code/trunk/src/modules/weapons/munitions/MineMunition.cc (from rev 11051, code/branches/presentationHS15/src/modules/weapons/munitions/MineMunition.cc)
===================================================================
--- code/trunk/src/modules/weapons/munitions/MineMunition.cc (rev 0)
+++ code/trunk/src/modules/weapons/munitions/MineMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,61 @@
+/*
+ * 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 MineMunition.h
+ @brief Implementation of the MineMunition class.
+*/
+
+#include "MineMunition.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(MineMunition);
+
+ MineMunition::MineMunition(Context* context) : Munition(context)
+ {
+ RegisterObject(MineMunition);
+
+ this->maxMunitionPerMagazine_ = 1;
+ this->maxMagazines_ = 100;
+ this->unassignedMagazines_ = 25;
+
+ this->deployment_ = MunitionDeployment::Stack;
+
+ this->bAllowMunitionRefilling_ = true;
+ this->bAllowMultiMunitionRemovementUnderflow_ = false;
+
+ this->reloadTime_ = 0.5f;
+ }
+
+ void MineMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(MineMunition, XMLPort, xmlelement, mode);
+ }
+}
\ No newline at end of file
Copied: code/trunk/src/modules/weapons/munitions/MineMunition.h (from rev 11051, code/branches/presentationHS15/src/modules/weapons/munitions/MineMunition.h)
===================================================================
--- code/trunk/src/modules/weapons/munitions/MineMunition.h (rev 0)
+++ code/trunk/src/modules/weapons/munitions/MineMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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 MineMunition.h
+ @brief Definition of the MineMunition class.
+*/
+
+#ifndef _MineMunition_H__
+#define _MineMunition_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ MineMunition.
+ @author
+ Fabien Vultier
+ @ingroup WeaponsMunitions
+ */
+ class _WeaponsExport MineMunition : public Munition
+ {
+ public:
+ MineMunition(Context* context);
+ virtual ~MineMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ };
+}
+
+#endif /* _MineMunition_H__ */
Deleted: code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,75 +0,0 @@
-/*
- * 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 ReplenishingMunition.h
- @brief Implementation of the ReplenishingMunition class.
-*/
-
-#include "ReplenishingMunition.h"
-
-#include "core/CoreIncludes.h"
-#include "core/command/Executor.h"
-
-namespace orxonox
-{
- RegisterClass(ReplenishingMunition);
-
- ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context)
- {
- RegisterObject(ReplenishingMunition);
-
- this->replenishInterval_ = 1.0f;
- this->replenishMunitionAmount_ = 1;
-
- // Use the timer to initialize itself after the first tick (because the real values for
- // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
- // inheriting class, which comes after this constructor)
- this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this)));
- }
-
- void ReplenishingMunition::initializeTimer()
- {
- // Initialize the timer
- this->replenishingTimer_.setTimer(this->replenishInterval_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this)));
- }
-
- void ReplenishingMunition::replenish()
- {
- // Make a temporary copy of bAllowMunitionRefilling_, because this might be disallowed in every
- // case except the internal munition replenishing
- bool temp = this->bAllowMunitionRefilling_;
- this->bAllowMunitionRefilling_ = true;
-
- // Replenish munition
- this->addMunition(this->replenishMunitionAmount_);
-
- // Write back the temporary value
- this->bAllowMunitionRefilling_ = temp;
- }
-}
Deleted: code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,70 +0,0 @@
-/*
- * 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 ReplenishingMunition.h
- @brief Definition of the ReplenishingMunition class.
-*/
-
-#ifndef _ReplenishingMunition_H__
-#define _ReplenishingMunition_H__
-
-#include "weapons/WeaponsPrereqs.h"
-
-#include "tools/Timer.h"
-#include "weaponsystem/Munition.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- Munition that is replenished by a certain amount each time interval.
- @author
- Fabian 'x3n' Landau
- @ingroup WeaponsMunitions
- */
- class _WeaponsExport ReplenishingMunition : public Munition
- {
- public:
- ReplenishingMunition(Context* context);
- virtual ~ReplenishingMunition() {}
-
- protected:
- float replenishInterval_; //!< The interval in which the munition is replenished.
- unsigned int replenishMunitionAmount_; //!< The amount by which it is replenished.
-
- private:
- void replenish();
- void initializeTimer();
-
- Timer replenishingTimer_; //!< Timer to do the replenishing.
- };
-}
-
-#endif /* _ReplenishingMunition_H__ */
Modified: code/trunk/src/modules/weapons/munitions/RocketMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/RocketMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/RocketMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -27,12 +27,13 @@
*/
/**
- @file RocketMunition.h
+ @file RocketMunition.cc
@brief Implementation of the RocketMunition class.
*/
#include "RocketMunition.h"
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -44,12 +45,18 @@
this->maxMunitionPerMagazine_ = 1;
this->maxMagazines_ = 30;
- this->magazines_ = 10;
+ this->unassignedMagazines_ = 10;
- this->bUseSeparateMagazines_ = false;
- this->bStackMunition_ = true;
+ this->deployment_ = MunitionDeployment::Stack;
- this->bAllowMunitionRefilling_ = false;
+ this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = false;
+
+ this->reloadTime_ = 0.5f;
}
+
+ void RocketMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(RocketMunition, XMLPort, xmlelement, mode);
+ }
}
Modified: code/trunk/src/modules/weapons/munitions/RocketMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/RocketMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/RocketMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -52,6 +52,7 @@
public:
RocketMunition(Context* context);
virtual ~RocketMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
}
Modified: code/trunk/src/modules/weapons/munitions/SplitMunition.cc
===================================================================
--- code/trunk/src/modules/weapons/munitions/SplitMunition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/SplitMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -27,12 +27,13 @@
*/
/**
- @file SplitMunition.h
+ @file SplitMunition.cc
@brief Implementation of the SplitMunition class.
*/
#include "SplitMunition.h"
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -42,14 +43,20 @@
{
RegisterObject(SplitMunition);
- this->maxMunitionPerMagazine_ = 1;
- this->maxMagazines_ = 100;
- this->magazines_ = 25;
+ this->maxMunitionPerMagazine_ = 5;
+ this->maxMagazines_ = 10;
+ this->unassignedMagazines_ = 5;
- this->bUseSeparateMagazines_ = false;
- this->bStackMunition_ = true;
+ this->deployment_ = MunitionDeployment::Share;
this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = false;
+
+ this->reloadTime_ = 0.5f;
}
+
+ void SplitMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SplitMunition, XMLPort, xmlelement, mode);
+ }
}
Property changes on: code/trunk/src/modules/weapons/munitions/SplitMunition.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/munitions/SplitMunition.h
===================================================================
--- code/trunk/src/modules/weapons/munitions/SplitMunition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/munitions/SplitMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -52,6 +52,7 @@
public:
SplitMunition(Context* context);
virtual ~SplitMunition() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
}
Property changes on: code/trunk/src/modules/weapons/munitions/SplitMunition.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -67,7 +67,7 @@
/**
@brief
The function called when a projectile hits another thing.
- Calls the hit-function, starts the reload countdown, displays visual hit effects defined in Pawn.
+ Calls the hit-function, starts the shield recharge countdown, displays visual hit effects defined in Pawn.
Needs to be called in the collidesAgainst() function by every Class directly inheriting from BasicProjectile.
@param otherObject
A pointer to the object the Projectile has collided against.
@@ -96,7 +96,7 @@
if (victim)
{
victim->hit(this->getShooter(), contactPoint, cs, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
- victim->startReloadCountdown();
+ victim->startShieldRechargeCountdown();
}
// Visual effects for being hit, depending on whether the shield is hit or not
Modified: code/trunk/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/projectiles/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -11,4 +11,5 @@
SimpleRocket.cc
GravityBomb.cc
GravityBombField.cc
+ MineProjectile.cc
)
Modified: code/trunk/src/modules/weapons/projectiles/GravityBombField.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/GravityBombField.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/GravityBombField.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -163,7 +163,6 @@
if (lifetime_ <= -4)
{
- orxout(debug_output) << "Timeout. Destroying field." << endl;
this->destroy();
}
}
Modified: code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -33,13 +33,22 @@
#include "IceGunProjectile.h"
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+
#include "core/CoreIncludes.h"
#include "graphics/Model.h"
+#include "graphics/ParticleSpawner.h"
+#include "Scene.h"
+#include "core/command/Executor.h"
+#include "tools/ParticleInterface.h"
namespace orxonox
{
RegisterClass(IceGunProjectile);
+ const float IceGunProjectile::particleDestructionDelay_ = 15.0f;
+
IceGunProjectile::IceGunProjectile(Context* context) : Projectile(context)
{
RegisterObject(IceGunProjectile);
@@ -54,8 +63,30 @@
model->setScale(15.0);
this->attach(model);
model->setPosition(Vector3(0,0,0));
+
+ // Add effect.
+ spawner_ = new ParticleSpawner(this->getContext());
+ this->attach(spawner_);
+ spawner_->setOrientation(this->getOrientation());
+ spawner_->setSource("Orxonox/ice");
+ spawner_->setDeleteWithParent(false);
+ spawner_->setDestroydelay(particleDestructionDelay_);
}
+ IceGunProjectile::~IceGunProjectile()
+ {
+ if (this->isInitialized())
+ {
+ const Vector3& pos = spawner_->getWorldPosition();
+ const Quaternion& rot = spawner_->getWorldOrientation();
+ this->detach(spawner_);
+ spawner_->setPosition(pos);
+ spawner_->setOrientation(rot);
+ this->getScene()->getRootSceneNode()->addChild(const_cast<Ogre::SceneNode*>(spawner_->getNode()));
+ this->spawner_->stop(true);
+ }
+ }
+
/**
@brief
Sets the freeze time variable to the passed value.
Property changes on: code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -55,14 +55,16 @@
{
public:
IceGunProjectile(Context* context);
- virtual ~IceGunProjectile() {}
+ virtual ~IceGunProjectile();
virtual void setFreezeTime(float freezeTime);
virtual void setFreezeFactor(float freezeFactor);
protected:
virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
- private:
+ static const float particleDestructionDelay_;
+ private:
+ ParticleSpawner* spawner_;
float freezeTime_; //The duration of the freezing effect on a target
float freezeFactor_; //The strength of the freezing effect
};
Property changes on: code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h
___________________________________________________________________
Added: svn:eol-style
+ native
Copied: code/trunk/src/modules/weapons/projectiles/MineProjectile.cc (from rev 11051, code/branches/presentationHS15/src/modules/weapons/projectiles/MineProjectile.cc)
===================================================================
--- code/trunk/src/modules/weapons/projectiles/MineProjectile.cc (rev 0)
+++ code/trunk/src/modules/weapons/projectiles/MineProjectile.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,281 @@
+/*
+ * 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:
+ * Jannis Holzer
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file MineProjectile.h
+ @brief Implementation of the MineProjectile class.
+*/
+
+#include "MineProjectile.h"
+
+#include "core/CoreIncludes.h"
+#include "graphics/Model.h"
+#include "core/command/Executor.h"
+#include "graphics/ParticleSpawner.h"
+#include "worldentities/pawns/Pawn.h"
+#include "core/EventIncludes.h"
+#include "sound/WorldSound.h"
+
+namespace orxonox
+{
+ RegisterClass(MineProjectile);
+
+ const float MineProjectile::collisionShapeRadius_ = 15.0f;
+ const float MineProjectile::damageRadius_ = 200.0f;
+ const float MineProjectile::triggerRadius_ = 100.0f;
+
+ MineProjectile::MineProjectile(Context* context) : MovableEntity(context), BasicProjectile()
+ {
+ RegisterObject(MineProjectile);
+
+ this->bAllowExplosion_ = false;
+ this->maxTimeUntilExplosion_ = 10.0f;
+ this->timeUntilActivation_ = 1.0f;
+
+ //Create movable entities
+ rings1_ = new MovableEntity(this->getContext());
+ this->attach(rings1_);
+ rings1_->setPosition(Vector3(0.0,0.0,0.0));
+ rings1_->setAngularVelocity(Vector3(0.0,5.0,0.0));
+
+ rings2_ = new MovableEntity(this->getContext());
+ this->attach(rings2_);
+ rings2_->setPosition(Vector3(0.0,0.0,0.0));
+ rings2_->setAngularVelocity(Vector3(0.0,0.0,5.0));
+
+ core_ = new MovableEntity(this->getContext());
+ this->attach(core_);
+ core_->setPosition(Vector3(0.0,0.0,0.0));
+ core_->setAngularVelocity(Vector3(2.5,2.5,0.0));
+
+ //Create Models
+ //Core
+ modelCore_ = new Model(this->getContext());
+ modelCore_->setMeshSource("Mine_Core.mesh");
+ modelCore_->setScale(15.0);
+ core_->attach(modelCore_);
+ modelCore_->setPosition(Vector3(0,0,0));
+
+ //Ring 1
+ modelRing1_ = new Model(this->getContext());
+ modelRing1_->setMeshSource("Mine_Ring.mesh");
+ modelRing1_->setScale(15.0);
+ rings1_->attach(modelRing1_);
+ modelRing1_->setPosition(Vector3(0,0,0));
+ modelRing1_->yaw(Degree(0));
+ //Ring 2
+ modelRing2_ = new Model(this->getContext());
+ modelRing2_->setMeshSource("Mine_Ring.mesh");
+ modelRing2_->setScale(15.0);
+ rings1_->attach(modelRing2_);
+ modelRing2_->setPosition(Vector3(0,0,0));
+ modelRing2_->yaw(Degree(180));
+ //Ring 3
+ modelRing3_ = new Model(this->getContext());
+ modelRing3_->setMeshSource("Mine_Ring.mesh");
+ modelRing3_->setScale(15.0);
+ rings2_->attach(modelRing3_);
+ modelRing3_->setPosition(Vector3(0,0,0));
+ modelRing3_->yaw(Degree(90));
+ //Ring 4
+ modelRing4_ = new Model(this->getContext());
+ modelRing4_->setMeshSource("Mine_Ring.mesh");
+ modelRing4_->setScale(15.0);
+ rings2_->attach(modelRing4_);
+ modelRing4_->setPosition(Vector3(0,0,0));
+ modelRing4_->yaw(Degree(270));
+
+ emitter_ = NULL;
+
+ if (GameMode::isMaster())
+ {
+ this->setMass(10.0f);
+ this->setLinearDamping(0.5f);
+ this->setAngularDamping(0.1f);
+ this->enableCollisionCallback();
+ this->setCollisionResponse(true);
+ this->setCollisionType(Dynamic);
+
+ // Create a sphere collision shape and attach it to the projectile.
+ collisionShape_ = new SphereCollisionShape(this->getContext());
+ collisionShape_->setRadius(collisionShapeRadius_);
+ this->attachCollisionShape(collisionShape_);
+ collisionShape_->setPosition(Vector3(0,0,0));
+
+ // Create a distance trigger and attach it to the projectile.
+ distanceTrigger_ = new DistanceTrigger(this->getContext());
+ this->attach(distanceTrigger_);
+ distanceTrigger_->setPosition(Vector3(0,0,0));
+ distanceTrigger_->setDistance(triggerRadius_);
+ distanceTrigger_->addTarget("Pawn");
+ distanceTrigger_->setStayActive(false);
+
+ this->addEventSource(distanceTrigger_, "explode");
+ }
+ }
+
+ MineProjectile::~MineProjectile()
+ {
+ if (this->isInitialized())
+ {
+ modelCore_->destroy();
+ modelRing1_->destroy();
+ modelRing2_->destroy();
+ modelRing3_->destroy();
+ modelRing4_->destroy();
+
+ if (distanceTrigger_)
+ {
+ distanceTrigger_->destroy();
+ }
+ if (emitter_)
+ {
+ emitter_->destroy();
+ }
+ }
+ }
+
+ /**
+ @brief
+ XMLPort for MineProjectile.
+ */
+ void MineProjectile::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(MineProjectile, XMLEventPort, xmlelement, mode);
+ XMLPortEventState(MineProjectile, BaseObject, "explode", explode, xmlelement, mode);
+ }
+
+ /**
+ @brief
+ Max Time; after this time runs out,the Mine explodes.
+ */
+ void MineProjectile::setMaxTimeUntilExplosion(float maxTimeUntilExplosion)
+ {
+ if (maxTimeUntilExplosion >= 0)
+ {
+ this->maxTimeUntilExplosion_ = maxTimeUntilExplosion;
+ if (GameMode::isMaster())
+ {
+ this->explodeTimer_.setTimer(this->maxTimeUntilExplosion_, false, createExecutor(createFunctor(&MineProjectile::explode, this)));
+ }
+ }
+ else
+ {
+ this->maxTimeUntilExplosion_ = 0;
+ }
+ }
+
+ /**
+ @brief
+ The mine can only explode when the activation time has run out.
+ */
+ void MineProjectile::setTimeUntilActivation(float timeUntilActivation)
+ {
+ timeUntilActivation_ = timeUntilActivation;
+
+ if (GameMode::isMaster())
+ {
+ this->activationTimer_.setTimer(this->timeUntilActivation_, false, createExecutor(createFunctor(&MineProjectile::allowExplosion, this)));
+ }
+ }
+
+ /**
+ @brief
+ Mine explodes, deals damage to pawn within range and destroys itself.
+ */
+ void MineProjectile::explode()
+ {
+ if (bAllowExplosion_)
+ {
+ if (GameMode::isMaster())
+ {
+ // Damage all pawns within the damage radius
+ for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+ {
+ Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
+ if(distanceVector.length()< damageRadius_)
+ {
+ it->hit(this->getShooter(), it->getWorldPosition(), NULL, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
+ }
+ }
+ }
+
+ this->destructionEffect();
+ this->destroyLater();
+ }
+ }
+
+ /**
+ @brief
+ Mine is ready to explode.
+ */
+ void MineProjectile::allowExplosion()
+ {
+ // Allow explosion
+ bAllowExplosion_ = true;
+ // Add particle effect
+ emitter_ = new ParticleEmitter(this->getContext());
+ this->attach(emitter_);
+ emitter_->setOrientation(this->getOrientation());
+ emitter_->setSource("Orxonox/mineparticle");
+ }
+
+ void MineProjectile::destructionEffect()
+ {
+ ParticleSpawner *effect1, *effect2, *effect3;
+
+ effect1 = new ParticleSpawner(this->getContext());
+ effect2 = new ParticleSpawner(this->getContext());
+ effect3 = new ParticleSpawner(this->getContext());
+
+ effect1->setPosition(this->getPosition());
+ effect1->setOrientation(this->getOrientation());
+ effect1->setDestroyAfterLife(true);
+ effect1->setSource("Orxonox/MineExpl");
+ effect1->setLifetime(2.5f);
+
+ effect2->setPosition(this->getPosition());
+ effect2->setOrientation(this->getOrientation());
+ effect2->setDestroyAfterLife(true);
+ effect2->setSource("Orxonox/MineExpl1");
+ effect2->setLifetime(2.5f);
+
+ effect3->setPosition(this->getPosition());
+ effect3->setOrientation(this->getOrientation());
+ effect3->setDestroyAfterLife(true);
+ effect3->setSource("Orxonox/MineExpl2");
+ effect3->setLifetime(2.5f);
+
+ // Explosion sound effect.
+ WeakPtr<WorldSound> explosionSound_ = new WorldSound(getContext());
+ explosionSound_->setSource("sounds/minesound.ogg");
+ explosionSound_->setVolume(1.0);
+ explosionSound_->play();
+ }
+}
Copied: code/trunk/src/modules/weapons/projectiles/MineProjectile.h (from rev 11051, code/branches/presentationHS15/src/modules/weapons/projectiles/MineProjectile.h)
===================================================================
--- code/trunk/src/modules/weapons/projectiles/MineProjectile.h (rev 0)
+++ code/trunk/src/modules/weapons/projectiles/MineProjectile.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,92 @@
+/*
+ * 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:
+ * Jannis Holzer
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file MineProjectile.h
+ @brief Definition of the MineProjectile class.
+*/
+
+#ifndef _MineProjectile_H__
+#define _MineProjectile_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "tools/Timer.h"
+#include "worldentities/MovableEntity.h"
+#include "objects/collisionshapes/SphereCollisionShape.h"
+#include "objects/triggers/DistanceTrigger.h"
+#include "BasicProjectile.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ TODO
+ @ingroup WeaponsProjectiles
+ */
+ class _WeaponsExport MineProjectile : public MovableEntity, public BasicProjectile
+ {
+ public:
+ MineProjectile(Context* context);
+ virtual ~MineProjectile();
+
+ virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+
+ virtual void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
+ virtual void setTimeUntilActivation(float timeUntilActivation);
+ protected:
+ static const float triggerRadius_;
+ static const float damageRadius_;
+ static const float collisionShapeRadius_;
+ private:
+ bool bAllowExplosion_; // The mine can only explode if it is active
+ float maxTimeUntilExplosion_;
+ float timeUntilActivation_;
+ Timer activationTimer_;
+ Timer explodeTimer_;
+ Model* modelCore_;
+ Model* modelRing1_;
+ Model* modelRing2_;
+ Model* modelRing3_;
+ Model* modelRing4_;
+ MovableEntity* rings1_;
+ MovableEntity* rings2_;
+ MovableEntity* core_;
+ ParticleEmitter* emitter_;
+
+ WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
+ WeakPtr<DistanceTrigger> distanceTrigger_;
+
+ virtual void destructionEffect();
+ virtual void allowExplosion();
+ virtual void explode();
+ };
+}
+
+#endif /* _MineProjectile_H__ */
Modified: code/trunk/src/modules/weapons/projectiles/Projectile.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Projectile.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/Projectile.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -68,11 +68,11 @@
protected:
virtual void setCollisionShapeRadius(float radius);
+ float lifetime_; //!< The time the projectile exists.
private:
- float lifetime_; //!< The time the projectile exists.
Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
- WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
+ WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
};
}
Modified: code/trunk/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -65,7 +65,7 @@
RegisterObject(Rocket);// Register the Rocket class to the core
this->localAngularVelocity_ = 0;
- this->lifetime_ = 100.0f;
+ this->lifetime_ = 20.0f;
if (GameMode::isMaster())
{
@@ -75,7 +75,7 @@
// Create rocket model
Model* model = new Model(this->getContext());
model->setMeshSource("rocket.mesh");
- model->scale(0.7f);
+ model->scale(1.0f);
this->attach(model);
// Add effects.
@@ -99,8 +99,6 @@
collisionShape->setHeight(500);
this->attachCollisionShape(collisionShape);
- this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
-
// Add sound
this->defSndWpnEngine_ = new WorldSound(this->getContext());
this->defSndWpnEngine_->setLooping(true);
@@ -113,6 +111,8 @@
this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
this->defSndWpnLaunch_->setVolume(1.0f);
this->attach(defSndWpnLaunch_);
+
+ this->setHudTemplate("rockethud");
}
else
{
@@ -319,4 +319,14 @@
this->localAngularVelocity_.z += value.x;
}
+ float Rocket::getFuel() const
+ {
+ return this->destroyTimer_.getRemainingTime();
+ }
+
+ void Rocket::setMaxFuel(float fuel)
+ {
+ this->lifetime_ = fuel;
+ this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
+ }
}
Modified: code/trunk/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -117,6 +117,17 @@
virtual void fired(unsigned int firemode);
+ /**
+ @brief Set the maximum lifetime of the rocket.
+ */
+ virtual void setMaxFuel(float fuel);
+ /**
+ @brief Get the maximum lifetime of the rocket.
+ */
+ inline float getMaxFuel() const
+ { return lifetime_; }
+ virtual float getFuel() const;
+
private:
Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
Modified: code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -75,7 +75,7 @@
// Create rocket model.
Model* model = new Model(this->getContext());
model->setMeshSource("rocket.mesh");
- model->scale(0.7f);
+ model->scale(1.0f);
this->attach(model);
// Add effects.
Property changes on: code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -10,4 +10,5 @@
RocketFireOld.cc
SimpleRocketFire.cc
GravityBombFire.cc
+ MineGun.cc
)
Modified: code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -62,6 +62,8 @@
this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
this->delayTimer_.stopTimer();
+
+ hudImageString_ = "Orxonox/WSHUD_WM_EnergyDrink";
}
void EnergyDrink::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -57,6 +57,8 @@
this->speed_ = 750.0f;
this->setMunitionName("FusionMunition");
+
+ hudImageString_ = "Orxonox/WSHUD_WM_FusionFire";
}
/**
Modified: code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -30,6 +30,8 @@
this->setMunitionName("GravityBombMunition");
this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8); ///< sets sound of the bomb as it is fired.
+
+ hudImageString_ = "Orxonox/WSHUD_WM_GravityBombFire";
}
GravityBombFire::~GravityBombFire(){};
Modified: code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -68,6 +68,8 @@
this->delayTimer_.stopTimer();
this->setDefaultSound(this->sound_);
+
+ hudImageString_ = "Orxonox/WSHUD_WM_HsW01";
}
HsW01::~HsW01()
Modified: code/trunk/src/modules/weapons/weaponmodes/IceGun.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/IceGun.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/IceGun.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -58,8 +58,10 @@
this->setFreezeTime(3.0);
this->setFreezeFactor(0.5);
- this->setMunitionName("LaserMunition");
+ this->setMunitionName("IceMunition");
this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
+
+ hudImageString_ = "Orxonox/WSHUD_WM_IceGun";
}
IceGun::~IceGun()
Property changes on: code/trunk/src/modules/weapons/weaponmodes/IceGun.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/weapons/weaponmodes/IceGun.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -55,6 +55,8 @@
this->speed_ = 750.0f;
this->setMunitionName("LaserMunition");
+
+ hudImageString_ = "Orxonox/WSHUD_WM_LaserFire";
}
/**
Modified: code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -53,8 +53,10 @@
this->damage_ = 0.0f;
this->speed_ = 750.0f;
- this->setMunitionName("LaserMunition");
+ this->setMunitionName("LightningMunition");
this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
+
+ hudImageString_ = "Orxonox/WSHUD_WM_LightningGun";
}
LightningGun::~LightningGun()
Copied: code/trunk/src/modules/weapons/weaponmodes/MineGun.cc (from rev 11051, code/branches/presentationHS15/src/modules/weapons/weaponmodes/MineGun.cc)
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/MineGun.cc (rev 0)
+++ code/trunk/src/modules/weapons/weaponmodes/MineGun.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,101 @@
+/*
+ * 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 MineGun.cc
+ @brief Implementation of the MineGun class.
+*/
+
+#include "MineGun.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "weapons/projectiles/MineProjectile.h"
+
+namespace orxonox
+{
+ RegisterClass(MineGun);
+
+ MineGun::MineGun(Context* context) : WeaponMode(context)
+ {
+ RegisterObject(MineGun);
+
+ this->speed_ = 1000.0f;
+ this->reloadTime_ = 1.0f;
+ this->damage_ = 0.0f;
+ this->maxTimeUntilExplosion_ = 0.0f;
+
+ this->setMunitionName("MineMunition");
+ this->setDefaultSound("sounds/mineactivate.ogg");
+
+ hudImageString_ = "Orxonox/WSHUD_WM_MineGun";
+ }
+
+ MineGun::~MineGun()
+ {
+ }
+
+ /**
+ @brief
+ XMLPort for the MineGun.
+ */
+ void MineGun::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(MineGun, XMLPort, xmlelement, mode);
+
+ XMLPortParam(MineGun, "maxtimeuntilexplosion", setMaxTimeUntilExplosion, getMaxTimeUntilExplosion, xmlelement, mode).defaultValues(10.0f);
+ XMLPortParam(MineGun, "timeuntilactivation", setTimeUntilActivation, getTimeUntilActivation, xmlelement, mode).defaultValues(3.0f);
+ }
+
+ /**
+ @brief
+ Fires the weapon. Creates a projectile and fires it.
+ */
+ void MineGun::fire()
+ {
+ MineProjectile* projectile = new MineProjectile(this->getContext());
+
+ this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+ projectile->setOrientation(this->getMuzzleOrientation());
+ projectile->setPosition(this->getMuzzlePosition());
+ projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+
+ projectile->setMaxTimeUntilExplosion(getMaxTimeUntilExplosion());
+ projectile->setTimeUntilActivation(getTimeUntilActivation());
+
+ projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+ projectile->setDamage(this->getDamage());
+ projectile->setShieldDamage(this->getShieldDamage());
+ projectile->setHealthDamage(this->getHealthDamage());
+ }
+}
Copied: code/trunk/src/modules/weapons/weaponmodes/MineGun.h (from rev 11051, code/branches/presentationHS15/src/modules/weapons/weaponmodes/MineGun.h)
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/MineGun.h (rev 0)
+++ code/trunk/src/modules/weapons/weaponmodes/MineGun.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,80 @@
+/*
+ * 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
+ * Jannis Holzer
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file MineGun.h
+ @brief
+
+ Mine is a weapon that explodes if a spaceship goes bellow the mines trigger radius. The mine deals damage too all
+ spaceships within the damageradius.
+
+ The activation time regulates when the mine is live and ready to explode.
+ The mine destroys itself after it exceeds a certain life time.
+*/
+
+#ifndef _MineGun_H__
+#define _MineGun_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ A Weapon that drops mines to space.
+ @ingroup WeaponsWeaponModes
+ */
+ class _WeaponsExport MineGun : public WeaponMode
+ {
+ public:
+ MineGun(Context* context);
+ virtual ~MineGun();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void fire();
+
+ inline float getMaxTimeUntilExplosion() const
+ { return this->maxTimeUntilExplosion_; }
+ inline float getTimeUntilActivation() const
+ { return this->timeUntilActivation_; }
+ protected:
+ inline void setMaxTimeUntilExplosion(float maxTimeUntilExplosion)
+ { this->maxTimeUntilExplosion_ = maxTimeUntilExplosion; }
+ inline void setTimeUntilActivation(float timeUntilActivation)
+ { this->timeUntilActivation_ = timeUntilActivation; }
+ private:
+ float speed_; //The speed of the fired projectile.
+ float maxTimeUntilExplosion_;
+ float timeUntilActivation_;
+ };
+}
+
+#endif /* _MineGun_H__ */
Modified: code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -40,7 +40,7 @@
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSystem.h"
#include "worldentities/pawns/Pawn.h"
-
+#include "core/XMLPort.h"
#include "weapons/projectiles/Rocket.h"
namespace orxonox
@@ -55,9 +55,12 @@
this->bParallelReload_ = false;
this->damage_ = 0.0f;
this->speed_ = 500.0f;
+ this->fuel_ = 10.0f;
this->setMunitionName("RocketMunition");
// The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
+
+ hudImageString_ = "Orxonox/WSHUD_WM_RocketFire";
}
RocketFire::~RocketFire()
@@ -66,6 +69,17 @@
/**
@brief
+ XMLPort for the RocketFire. You can define the maximum lifetime of the rockets
+ */
+ void RocketFire::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(RocketFire, XMLPort, xmlelement, mode);
+
+ XMLPortParam(RocketFire, "fuel", setFuel, getFuel, xmlelement, mode);
+ }
+
+ /**
+ @brief
Fires the weapon. Creates the Rocket and fires it.
*/
void RocketFire::fire()
@@ -76,11 +90,12 @@
rocket->setOrientation(this->getMuzzleOrientation());
rocket->setPosition(this->getMuzzlePosition());
rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
- rocket->scale(2);
+ rocket->scale(1.0f);
rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
rocket->setDamage(this->getDamage());
rocket->setShieldDamage(this->getShieldDamage());
rocket->setHealthDamage(this->getHealthDamage());
+ rocket->setMaxFuel(this->fuel_);
}
}
Modified: code/trunk/src/modules/weapons/weaponmodes/RocketFire.h
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/RocketFire.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/RocketFire.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -53,10 +53,17 @@
RocketFire(Context* context);
virtual ~RocketFire();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
virtual void fire();
+ inline void setFuel(float fuel)
+ { this->fuel_ = fuel; }
+ inline float getFuel() const
+ { return this->fuel_; }
private:
float speed_; //!< The speed of the Rocket.
+ float fuel_; //!< The maximum lifetime of the rocket
};
}
Modified: code/trunk/src/modules/weapons/weaponmodes/RocketFireOld.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/RocketFireOld.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/RocketFireOld.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -58,6 +58,8 @@
this->setMunitionName("RocketMunition");
// The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
+
+ hudImageString_ = "Orxonox/WSHUD_WM_SimpleRocketFire";
}
RocketFireOld::~RocketFireOld()
Modified: code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -63,6 +63,8 @@
this->setMunitionName("RocketMunition");
this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4f);
// The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
+
+ hudImageString_ = "Orxonox/WSHUD_WM_SimpleRocketFire";
}
SimpleRocketFire::~SimpleRocketFire()
@@ -82,12 +84,14 @@
rocket->setPosition(this->getMuzzlePosition());
rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+ rocket->scale(1.0f);
rocket->setDamage(this->damage_);
rocket->setShieldDamage(this->getShieldDamage());
rocket->setHealthDamage(this->getHealthDamage());
WorldEntity* pawn = static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
- if (pawn) controller->setTarget(pawn);
+ if (pawn)
+ controller->setTarget(pawn);
}
}
Modified: code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -34,7 +34,7 @@
#include "SplitGun.h"
#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
+#include "core/XMLPort.h"
#include "weaponsystem/Weapon.h"
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSystem.h"
@@ -61,6 +61,8 @@
this->setMunitionName("SplitMunition");
this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
+
+ hudImageString_ = "Orxonox/WSHUD_WM_SplitGun";
}
SplitGun::~SplitGun()
Property changes on: code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: code/trunk/src/modules/weapons/weaponmodes/SplitGun.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -166,6 +166,7 @@
// weaponsystem
class DefaultWeaponmodeLink;
class Munition;
+ class ReplenishingMunition;
class Weapon;
class WeaponMode;
class WeaponPack;
@@ -174,7 +175,6 @@
class WeaponSystem;
// worldentities
- class BigExplosion;
class CameraPosition;
class ControllableEntity;
class Drone;
Copied: code/trunk/src/orxonox/controllers/ActionpointController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/ActionpointController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/ActionpointController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/ActionpointController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,762 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "ActionpointController.h"
+
+#include "core/XMLPort.h"
+#include <algorithm>
+#include "worldentities/Actionpoint.h"
+namespace orxonox
+{
+
+ RegisterClass(ActionpointController);
+
+ ActionpointController::ActionpointController(Context* context) : FightingController(context)
+ {
+ this->ticks_ = 0;
+ this->bPatrolling_ = false;
+ this->bInLoop_ = false;
+ this->bLoop_ = false;
+ this->bEndLoop_ = false;
+ loopActionpoints_.clear();
+ parsedActionpoints_.clear();
+ actionpoints_.clear();
+ this->bTakenOver_ = false;
+ this->action_ = Action::NONE;
+ this->squaredaccuracy_ = 2500;
+ this->bStartedDodging_ = false;
+ this->bDefaultPatrol_ = true;
+ this->bDefaultFightAll_ = true;
+ RegisterObject(ActionpointController);
+
+ }
+ void ActionpointController::XMLPort( Element& xmlelement, XMLPort::Mode mode )
+ {
+ SUPER( ActionpointController, XMLPort, xmlelement, mode );
+
+ XMLPortObject(ActionpointController, WorldEntity, "actionpoints", addActionpoint, getActionpoint, xmlelement, mode);
+ XMLPortParam(ActionpointController, "defaultFightAll", setDefaultFightAll, getDefaultFightAll, xmlelement, mode).defaultValues(true);
+ XMLPortParam(ActionpointController, "defaultPatrol", setDefaultPatrol, getDefaultPatrol, xmlelement, mode).defaultValues(true);
+ }
+
+ ActionpointController::~ActionpointController()
+ {
+ loopActionpoints_.clear();
+ parsedActionpoints_.clear();
+ actionpoints_.clear();
+
+ }
+ void ActionpointController::tick(float dt)
+ {
+ if (!this || !this->getControllableEntity() || !this->isActive())
+ return;
+
+ //count ticks, ticks_ is unsigned, so overflow is not a problem
+ ++this->ticks_;
+ if (this->ticks_ == 1)
+ {
+ //those vectors are in reversed order after being set by XML.
+ std::reverse(parsedActionpoints_.begin(), parsedActionpoints_.end());
+ std::reverse(actionpoints_.begin(), actionpoints_.end());
+ }
+
+ if (!this || !this->getControllableEntity())
+ return;
+ //fly
+ if (this->bHasTargetPosition_)
+ {
+ this->moveToTargetPosition(dt);
+ }//or just rotate
+ else if (this->bLookAtTarget_)
+ {
+ this->lookAtTarget(dt);
+ }
+
+
+ if (!this || !this->getControllableEntity())
+ return;
+ //don't fire rocket each tick
+ if (timeout_ <= 0)
+ {
+ this->bFiredRocket_ = false;
+ }
+ else if (this->bFiredRocket_)
+ {
+ --this->timeout_;
+ }
+
+ if (!this || !this->getControllableEntity())
+ return;
+ //sometimes dodge, sometimes attack
+ if (this->ticks_ % 80 <= 10)
+ {
+ this->bDodge_ = false;
+ }
+ else
+ {
+ this->bDodge_ = true;
+ }
+
+ if (!this || !this->getControllableEntity())
+ return;
+ //fire if you can
+ if (this->bShooting_)
+ {
+ this->doFire();
+ }
+ SUPER(ActionpointController, tick, dt);
+ }
+
+ /**
+ @brief
+ action() manages the state machine.
+ */
+
+ void ActionpointController::action()
+ {
+ if (!this || !this->getControllableEntity() || !this->isActive())
+ return;
+
+ //deltaHp is used to know if this got attacked
+ this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp;
+ this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth();
+
+ //look out for enemies
+ if (this->bDefaultPatrol_ || (this->action_ != Action::FLY && this->action_ != Action::NONE))
+ {
+ this->startAttackingEnemiesThatAreClose();
+ }
+ if (!this || !this->getControllableEntity())
+ return;
+
+ //No action -> pop one from stack
+ if (this->action_ == Action::NONE || this->bTakenOver_)
+ {
+ //if default behaviour is fighting all, push it onto the stack
+ if (this->parsedActionpoints_.empty() && this->loopActionpoints_.empty() && this->bDefaultFightAll_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ Point p = { Action::FIGHTALL, "", Vector3::ZERO, false };
+ this->parsedActionpoints_.push_back (p);
+ }
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->bTakenOver_ = false;
+ }
+ if (!this || !this->getControllableEntity())
+ return;
+
+ //Action fightall -> fight till nobody alive
+ if (this->action_ == Action::FIGHTALL)
+ {
+
+ if (!this->hasTarget())
+ {
+ ControllableEntity* newTarget = this->closestTarget();
+ if (newTarget)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->setAction (Action::FIGHTALL, newTarget);
+ }
+ else
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+
+ }
+ }
+ }
+ //Action fight -> fight as long as enemies in range
+ else if (this->action_ == Action::FIGHT)
+ {
+ if (!this->hasTarget() )
+ {
+ //----find a target----
+ ControllableEntity* newTarget = this->closestTarget();
+ if (!this || !this->getControllableEntity())
+ return;
+ if (newTarget &&
+ CommonController::distance (this->getControllableEntity(), newTarget) < this->attackRange_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->setAction (Action::FIGHT, newTarget);
+ }
+ else
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ }
+ else if (this->hasTarget())
+ {
+ //----fly in formation if far enough----
+ Vector3 diffVector = this->positionOfTarget_ - this->getControllableEntity()->getWorldPosition();
+
+ if (diffVector.length() > this->attackRange_)
+ {
+ ControllableEntity* newTarget = this->closestTarget();
+ if (!this || !this->getControllableEntity())
+ return;
+ if (newTarget &&
+ CommonController::distance (this->getControllableEntity(), newTarget) < this->attackRange_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->setAction (Action::FIGHT, newTarget);
+ }
+ else
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ }
+ }
+ }
+ else if (this->action_ == Action::FLY)
+ {
+ if (this->squaredDistanceToTarget() <= this->squaredaccuracy_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ }
+ else if (this->action_ == Action::PROTECT)
+ {
+ if (!this->getProtect())
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ if (!this || !this->getControllableEntity())
+ return;
+ this->stayNearProtect();
+ }
+ else if (this->action_ == Action::ATTACK)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ if (!this->hasTarget())
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ }
+ }
+ /**
+ @brief
+ if action is protect, this follows protect_ and fights enemies that are close
+ */
+ void ActionpointController::setProtect (ControllableEntity* protect)
+ {
+ this->protect_ = protect;
+ }
+ ControllableEntity* ActionpointController::getProtect ()
+ {
+ return this->protect_;
+ }
+ //XML method
+ void ActionpointController::addActionpoint(WorldEntity* actionpoint)
+ {
+ std::string actionName;
+ Vector3 position;
+ std::string targetName;
+ bool inLoop = false;
+ Point p;
+ if (actionpoint->getIdentifier()->getName() == "Actionpoint")
+ {
+ Actionpoint* ap = orxonox_cast<Actionpoint*> (actionpoint);
+ actionName = ap->getActionXML();
+ targetName = ap->getName();
+ position = ap->getWorldPosition();
+
+ if (this->bEndLoop_)
+ {
+ this->bInLoop_ = false;
+ }
+ if (!this->bInLoop_ && ap->getLoopStart())
+ {
+ this->bInLoop_ = true;
+ }
+ if (this->bInLoop_ && ap->getLoopEnd())
+ {
+ this->bEndLoop_ = true;
+ }
+ inLoop = this->bInLoop_;
+
+ Action::Value value;
+
+ if ( actionName == "FIGHT" )
+ { value = Action::FIGHT; }
+ else if ( actionName == "FLY" )
+ { value = Action::FLY; }
+ else if ( actionName == "PROTECT" )
+ { value = Action::PROTECT; }
+ else if ( actionName == "NONE" )
+ { value = Action::NONE; }
+ else if ( actionName == "FIGHTALL" )
+ { value = Action::FIGHTALL; }
+ else if ( actionName == "ATTACK" )
+ { value = Action::ATTACK; }
+ else
+ ThrowException( ParseError, std::string( "Attempting to set an unknown Action: '" )+ actionName + "'." );
+ p.action = value; p.name = targetName; p.position = position; p.inLoop = inLoop;
+ }
+ else
+ {
+ inLoop = true;
+ p.action = Action::FLY; p.name = ""; p.position = actionpoint->getWorldPosition(); p.inLoop = inLoop;
+ }
+ parsedActionpoints_.push_back(p);
+ this->actionpoints_.push_back(actionpoint);
+ }
+ //XML method
+ WorldEntity* ActionpointController::getActionpoint(unsigned int index) const
+ {
+ if (index < this->actionpoints_.size())
+ return this->actionpoints_[index];
+ else
+ return 0;
+ }
+ //XML method
+ Action::Value ActionpointController::getAction ()
+ {
+ return this->action_;
+ }
+ //XML method
+ std::string ActionpointController::getActionName()
+ {
+ switch ( this->action_ )
+ {
+ case Action::FIGHT:
+ { return "FIGHT"; }
+ case Action::FLY:
+ { return "FLY"; }
+ case Action::PROTECT:
+ { return "PROTECT"; }
+ case Action::NONE:
+ { return "NONE"; }
+ case Action::FIGHTALL:
+ { return "FIGHTALL"; }
+ case Action::ATTACK:
+ { return "ATTACK"; }
+ default:
+ return "NONE";
+ break;
+ }
+ }
+ //XML method
+ void ActionpointController::setAction (Action::Value action)
+ {
+ this->action_ = action;
+ }
+ //set action and target/protect
+ void ActionpointController::setAction (Action::Value action, ControllableEntity* target)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->action_ = action;
+ if (action == Action::FIGHT || action == Action::FIGHTALL || action == Action::ATTACK)
+ {
+ if (target)
+ this->setTarget (target);
+ }
+ else if (action == Action::PROTECT)
+ {
+ if (target)
+ this->setProtect (target);
+ }
+ }
+ //set action and target position
+ void ActionpointController::setAction (Action::Value action, const Vector3& target)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->action_ = action;
+ if (action == Action::FLY)
+ {
+ this->setTargetPosition (target);
+ }
+ }
+ //set action and target position and orientation
+ void ActionpointController::setAction (Action::Value action, const Vector3& target, const Quaternion& orient )
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->action_ = action;
+ if (action == Action::FLY)
+ {
+ this->setTargetPosition (target);
+ this->setTargetOrientation (orient);
+ }
+ }
+
+ //------------------------------------------------------------------------------
+ //------------------------------Actionpoint methods-----------------------------
+ //------------------------------------------------------------------------------
+
+ //POST: this starts doing what was asked by the last element of parsedActionpoints_,
+ //if last element was failed to be parsed, next element will be executed.
+ void ActionpointController::executeActionpoint()
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ Point p;
+ if (this->bLoop_ && !loopActionpoints_.empty())
+ {
+ p = loopActionpoints_.back();
+ }
+ else if (this->bLoop_)
+ {
+ this->bLoop_ = false;
+ return;
+ }
+ else if (!this->bLoop_ && !parsedActionpoints_.empty())
+ {
+ p = parsedActionpoints_.back();
+ }
+ else
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ this->setTarget(0);
+ this->setTargetPosition(this->getControllableEntity()->getWorldPosition());
+ this->action_ = Action::NONE;
+ return;
+ }
+ if (!this || !this->getControllableEntity())
+ return;
+ if (!this->bLoop_ && this->parsedActionpoints_.back().inLoop)
+ {
+ //MOVES all points that are in loop to a loop vector
+ this->fillLoop();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->bLoop_ = true;
+ executeActionpoint();
+ return;
+ }
+ if (!this || !this->getControllableEntity())
+ return;
+ this->setAction (p.action);
+ if (!this || !this->getControllableEntity())
+ return;
+
+ switch (this->action_)
+ {
+ case Action::FIGHT:
+ {
+ std::string targetName = p.name;
+ if (targetName == "")
+ break;
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ if (CommonController::getName(*itP) == targetName)
+ {
+ this->setTarget (static_cast<ControllableEntity*>(*itP));
+ }
+ }
+ break;
+ }
+ case Action::FLY:
+ {
+ this->setTargetPosition( p.position );
+ if (!this || !this->getControllableEntity())
+ return;
+ if (this->squaredDistanceToTarget() <= this->squaredaccuracy_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ break;
+ }
+ case Action::PROTECT:
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ std::string protectName = p.name;
+ if (protectName == "reservedKeyword:human")
+ {
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ if (orxonox_cast<ControllableEntity*>(*itP) && ((*itP)->getController()) && ((*itP)->getController()->getIdentifier()->getName() == "NewHumanController"))
+ {
+ this->setProtect (static_cast<ControllableEntity*>(*itP));
+ }
+ }
+ }
+ else
+ {
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ if (CommonController::getName(*itP) == protectName)
+ {
+ this->setProtect (static_cast<ControllableEntity*>(*itP));
+ }
+ }
+ }
+ if (!this->getProtect())
+ {
+ this->nextActionpoint();
+ this->executeActionpoint();
+ }
+ break;
+ }
+ case Action::NONE:
+ {
+ break;
+ }
+ case Action::FIGHTALL:
+ {
+ break;
+ }
+ case Action::ATTACK:
+ {
+ std::string targetName = p.name;
+
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ if (CommonController::getName(*itP) == targetName)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->setTarget (static_cast<ControllableEntity*>(*itP));
+ }
+ }
+ if (!this->hasTarget())
+ {
+ this->nextActionpoint();
+ if (!this || !this->getControllableEntity())
+ return;
+ this->executeActionpoint();
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ //calculate where in world coordinates this ship has to be, so that it keeps distance to protect_, and fly there
+ void ActionpointController::stayNearProtect()
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ Vector3 targetRelativePosition(0, 300, 300);
+ if (!this->getProtect())
+ {
+ this->nextActionpoint();
+ return;
+ }
+ Vector3 targetAbsolutePosition = ((this->getProtect()->getWorldPosition()) +
+ (this->getProtect()->getWorldOrientation()* (targetRelativePosition)));
+ this->setTargetPosition(targetAbsolutePosition);
+ if (!this->getProtect())
+ {
+ this->nextActionpoint();
+ return;
+ }
+ this->setTargetOrientation(this->getProtect()->getWorldOrientation());
+ }
+ //remove current point from the stack
+ void ActionpointController::nextActionpoint()
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ if (this->bLoop_)
+ {
+ if (this->bPatrolling_)
+ {
+ this->loopActionpoints_.pop_back();
+ this->bPatrolling_ = false;
+ }
+ else if (!this->loopActionpoints_.empty())
+ {
+ this->moveBackToTop();
+ }
+ }
+ else
+ {
+ if (!this->parsedActionpoints_.empty())
+ {
+ this->parsedActionpoints_.pop_back();
+ }
+ }
+ this->setAction(Action::NONE);
+ this->bHasTargetPosition_ = false;
+ }
+ //if looping, instead of erasing point, move it to the top (back is what gets executed, so it's kinda reversed stack)
+ void ActionpointController::moveBackToTop()
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ Point temp = loopActionpoints_.back();
+ loopActionpoints_.pop_back();
+ std::reverse (loopActionpoints_.begin(), loopActionpoints_.end());
+ loopActionpoints_.push_back(temp);
+ std::reverse (loopActionpoints_.begin(), loopActionpoints_.end());
+ }
+ //POST: moves all consecutive points that are in loop to the loop stack
+ void ActionpointController::fillLoop()
+ {
+ loopActionpoints_.clear();
+ fillLoopReversed();
+ std::reverse (loopActionpoints_.begin(), loopActionpoints_.end());
+ }
+ void ActionpointController::fillLoopReversed()
+ {
+ if (parsedActionpoints_.back().inLoop)
+ {
+ loopActionpoints_.push_back(parsedActionpoints_.back());
+ parsedActionpoints_.pop_back();
+ }
+ if (parsedActionpoints_.back().inLoop)
+ {
+ fillLoopReversed();
+ }
+ }
+ //copy other ship's stacks so that if it dies, this can finish that ship's actions
+ void ActionpointController::takeActionpoints (const std::vector<Point>& vector, const std::vector<Point>& loop, bool b)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->parsedActionpoints_ = vector;
+ if (!this || !this->getControllableEntity())
+ return;
+ this->loopActionpoints_ = loop;
+ this->bLoop_ = b;
+ this->bTakenOver_ = true;
+ }
+ //attack closest target
+ void ActionpointController::setClosestTarget()
+ {
+ this->setTarget (static_cast<ControllableEntity*>( closestTarget() ) );
+ }
+ //find closest target
+ Pawn* ActionpointController::closestTarget()
+ {
+ if (!this || !this->getControllableEntity())
+ return 0;
+
+ Pawn* closestTarget = 0;
+ float minDistance = std::numeric_limits<float>::infinity();
+ Gametype* gt = this->getGametype();
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ if (!this || !this->getControllableEntity())
+ return 0;
+ if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(*itP), gt) )
+ continue;
+
+ float distance = CommonController::distance (*itP, this->getControllableEntity());
+ if (distance < minDistance)
+ {
+ closestTarget = *itP;
+ minDistance = distance;
+ }
+ }
+ if (closestTarget)
+ {
+ return closestTarget;
+ }
+ return 0;
+ }
+ //push action FIGHT to the stack and set target to the closest enemy
+ void ActionpointController::startAttackingEnemiesThatAreClose()
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ if (!this->target_ || (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_))
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ Pawn* newTarget = this->closestTarget();
+ if ( newTarget &&
+ CommonController::distance (this->getControllableEntity(), static_cast<ControllableEntity*>(newTarget))
+ <= this->attackRange_ )
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ this->setTarget(newTarget);
+ if (this->bLoop_ && !this->bPatrolling_)
+ {
+ Point p = { Action::FIGHT, "", Vector3::ZERO, true };
+ this->loopActionpoints_.push_back(p);
+ }
+ else if (!this->bPatrolling_)
+ {
+ Point p = { Action::FIGHT, "", Vector3::ZERO, false };
+ this->parsedActionpoints_.push_back(p);
+ }
+ this->bPatrolling_ = true;
+ this->executeActionpoint();
+ }
+ }
+ }
+}
Copied: code/trunk/src/orxonox/controllers/ActionpointController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/ActionpointController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/ActionpointController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/ActionpointController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,261 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _ActionpointController_H__
+#define _ActionpointController_H__
+
+#include "controllers/FightingController.h"
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+#include "../modules/pickup/PickupSpawner.h"
+#include <map>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace orxonox
+{
+ /**
+ @brief
+ ActionpointController is a state machine with states:
+ 1) NONE
+ 2) FLY: fly towards a point
+ 3) FIGHT: fight enemies that are in attackRange_ (see FightingController)
+ 4) PROTECT: follow this->protect_
+ 5) FIGHTALL: fight all enemies on the map
+ 6) ATTACK: fight a specific spaceship
+ This controller always executes an action that is in the back of the vector being used.
+ After current this->action_ is completed, next action becomes the top action (one that will
+ be returned by someVector.back()), and current action either will be removed (if not looping),
+ or moved to the top (if looping).
+
+ Every second action(), which is once in two seconds, this searches the area for enemies that are in attack range, if finds anyone,
+ pushes Action::FIGHT to the stack. That makes spaceship fight enemies inside of a sphere, and when all enemies in range are dead,
+ Action::FIGHT is removed from the stack, and spaceship resumes doing whatever action was being executed before.
+
+ In XML one has to attack Actionpoints in order to achieve any complex behaviour, but in Controller all actionpoints are effectively
+ being stored in an array of type Point::Value.
+ @note
+ ActionpointController will not work, if there is no MasterController in the level!
+ All the demos are in a file called AITest.oxw. In the menu look for New AI Testing Level.
+ */
+ namespace Action
+ {
+ enum Value
+ {
+ NONE, FLY, FIGHT, PROTECT, FIGHTALL, ATTACK
+ };
+
+ }
+
+ struct Point {
+ Action::Value action;
+ std::string name;
+ Vector3 position;
+ bool inLoop;
+ } ;
+ namespace PickupType
+ {
+ enum Value
+ {
+ NONE, DAMAGE, HEALTH, SPEED, PORTAL
+ };
+ }
+
+ class _OrxonoxExport ActionpointController : public FightingController, public Tickable
+ {
+ public:
+
+ ActionpointController(Context* context);
+ virtual ~ActionpointController();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ /**
+ @brief
+ tick is called every tick by Game (?).
+ In tick ship flies and fires.
+ */
+ virtual void tick(float dt);
+ /**
+ @brief
+ XML method, example XML usage:
+ <SpaceShip position="-2000, 1500, -1000" lookat="0,0,0" team=0 name="ss2">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="finger4">
+ <actionpoints>
+ <Actionpoint position="0,0,0" action="FLY" />
+ <Actionpoint position="-1000,750,-500" action="ATTACK" attack="attack" />
+ <Actionpoint position="-1000,750,-500" action="PROTECt" protectMe=true />
+ <Actionpoint position="-1000,750,-500" action="PROTECt" protect="protect" />
+ <Actionpoint position="-1000,750,-500" action="FIGHTALL" />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ Full description:
+ Adds an Actionpoint to this->actionpoints_. Actionpoint can take arguments like action="attack" attack="name".
+ For documentation on Actionpoint XML arguments, check out Actionpoint.h class
+ If any WorldEntity that is not Actionpoint or its child being sent to actionpoints through XML,
+ action would be assumed to be Action::FLY and target position to be position of the entity. Also, if not Actionpoint
+ is passed, it is assumed to be in a loop. How it works is: in <actionpoints> first all Actionpoints between
+ first Actionpoint with loopStart=true and first following Actionpoint with loopEnd=true are included in a single loop.
+ If they are adjacent (in the input array) with WorldEntity, then WorldEntity is also in a loop.
+ All the Worldentities are assumed to be in loop.
+
+ Loop example:
+ <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="wall">
+ <actionpoints>
+ <Actionpoint position=" 0,2000,-600" action="FLY" loopStart=true/>
+ <Actionpoint position=" 0,2000,-1000" action="FLY" />
+ <Actionpoint position="400,2000,-1000" action="FLY" />
+ <Actionpoint position="400,2000,-600" action="FLY" loopEnd=true />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ other loop example:
+ <SpaceShip position="-1500, -1500, -1500" lookat="0,0,0" team=0 name="ss1">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="diamond">
+ <actionpoints>
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-600" />
+ <Model mesh="cube.mesh" scale=8 position=" 0,2000,-1000" />
+ <Model mesh="cube.mesh" scale=8 position="400,2000,-1000" />
+ <Model mesh="cube.mesh" scale=8 position="400,2000,-600" />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ @note
+ Don't use several loops, and don't use WorldEntities as input to <actionpoints> as I didn't test it well, but you
+ can try if feeling lucky.
+ */
+ void addActionpoint(WorldEntity* actionpoint);
+ WorldEntity* getActionpoint(unsigned int index) const;
+ void setDefaultFightAll(bool value)
+ { this->bDefaultFightAll_ = value; }
+ bool getDefaultFightAll ()
+ { return this->bDefaultFightAll_; }
+ void setDefaultPatrol(bool value)
+ { this->bDefaultPatrol_ = value; }
+ bool getDefaultPatrol ()
+ { return this->bDefaultPatrol_; }
+
+
+ virtual void stayNearProtect();
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour. Only gets called by MasterController
+ virtual void takeActionpoints (const std::vector<Point>& vector, const std::vector<Point>& loop, bool b);
+
+ virtual Action::Value getAction ();
+ virtual std::string getActionName();
+
+ void setAction (Action::Value action);
+ void setAction (Action::Value action, ControllableEntity* target);
+ void setAction (Action::Value action, const Vector3& target);
+ void setAction (Action::Value action, const Vector3& target, const Quaternion& orient );
+
+ virtual bool setWingman(ActionpointController* wingman)
+ { return false; }
+ virtual bool hasWingman()
+ { return true; }
+ virtual bool setFollower(ActionpointController* myFollower)
+ { return false; }
+ virtual bool hasFollower()
+ { return true; }
+
+
+ protected:
+ void startAttackingEnemiesThatAreClose();
+ WeakPtr<ActionpointController> myWingman_;
+ WeakPtr<ActionpointController> myFollower_;
+ WeakPtr<ActionpointController> myDivisionLeader_;
+ //----[Actionpoint information]----
+ Action::Value action_;
+ std::string protectName_;
+ std::string targetName_;
+ std::vector<WeakPtr<WorldEntity> > actionpoints_;
+ float squaredaccuracy_;
+ std::vector<Point > parsedActionpoints_;//<! actionpoints as they are stored here after being parsed from XML
+ std::vector<Point > loopActionpoints_; //<! actionpoints that are to be looped
+ bool bInLoop_; //<! variable for addActionpoint method
+ bool bLoop_; //<! is state machine looping?
+ bool bEndLoop_; //<! variable for addActionpoint method
+ bool bTakenOver_; //<! are actionpoints taken over from the leader when he died? if yes, top actionpoint
+ //<! is to be executed for the state machine to start working
+ //----[/Actionpoint information]----
+ void setProtect (ControllableEntity* protect);
+ ControllableEntity* getProtect ();
+ WeakPtr<ControllableEntity> protect_; //<! entity that is to be protected if this->action_ == Action::PROTECT
+ void fillLoop(); //<! moves actionpoints that are should be in loop from parsedActionpoints_ to loopActionpoints_
+ void fillLoopReversed();
+ void moveBackToTop(); //<! analog of removing back actionpoint for loopActionpoints_: instead of removing it,
+ //<! move it to the top, so that it will be executed later on.
+ void setClosestTarget();
+ Pawn* closestTarget();
+ //----[Actionpoint methods]----
+ /**
+ @brief
+ Sets this->target_, this->targetPosition_, this->protect_ and this->action_ depending
+ on the current actionpoint in the vector parsedActionpoints_ if not looping or
+ loopActionpoints_ if looping.
+ @note
+ */
+ void executeActionpoint();
+ /**
+ @brief
+ If this->bLoop_, move back action to top (back is the current one, top is the last),
+ otherwise remove back actionpoint.
+ @note
+ actionpoints_ is only used for XML, real state stacks are parsedActionpoints_ and loopActionpoints_
+ */
+ void nextActionpoint();
+ //----[Actionpoint methods]----
+
+ bool bDefaultFightAll_; //<! if true, when no action set, this will fight all
+
+ bool bPatrolling_; //<! true if current action_ is FIGHT because this found enemies that are close, need this to correctly go back to looping if was looping
+ bool bDefaultPatrol_; //<! if true, this will look out for enemies that are close if this is just flying or doing nothing
+ unsigned int ticks_; //<! local tick counter
+ };
+}
+
+#endif /* _ActionpointController_H__ */
Modified: code/trunk/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/controllers/ArtificialController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -93,9 +93,9 @@
if (!this->target_ || !this->getControllableEntity())
return;
- static const float hardcoded_projectile_speed = 750;
+ static const float HARDCODED_PROJECTILE_SPEED = 750;
- this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), hardcoded_projectile_speed, this->target_->getWorldPosition(), this->target_->getVelocity());
+ this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), HARDCODED_PROJECTILE_SPEED, this->target_->getWorldPosition(), this->target_->getVelocity());
this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
Modified: code/trunk/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/controllers/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/controllers/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -10,4 +10,12 @@
DroneController.cc
FormationController.cc
ControllerDirector.cc
+ DivisionController.cc
+ WingmanController.cc
+ SectionController.cc
+ CommonController.cc
+ ActionpointController.cc
+ FlyingController.cc
+ FightingController.cc
+ MasterController.cc
)
Copied: code/trunk/src/orxonox/controllers/CommonController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/CommonController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/CommonController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/CommonController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,216 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+#include "controllers/CommonController.h"
+
+//here starts stuff for sameTeam function copied from FormationController
+#include "gametypes/TeamDeathmatch.h"
+#include "gametypes/Gametype.h"
+#include "controllers/DroneController.h"
+#include "gametypes/Dynamicmatch.h"
+
+#include "worldentities/pawns/TeamBaseMatchBase.h"
+
+namespace orxonox
+{
+ const float CommonController::HARDCODED_PROJECTILE_SPEED = 750;
+
+ RegisterClass(CommonController);
+ CommonController::CommonController(Context* context): Controller(context)
+ {
+ RegisterObject(CommonController);
+ }
+ CommonController::~CommonController()
+ {
+ //no member variables - nothing to destroy
+ }
+ /**
+ @brief
+ PRE: a < b.
+ returns random float between a and b.
+ */
+ float CommonController::randomInRange(float a, float b)
+ {
+ return a + rnd(1.0f) * (b - a);
+ }
+ /**
+ @brief
+ returns distance between two entities, if either is zero pointer, returns infinity
+ */
+ float CommonController::distance (const ControllableEntity* entity1, const ControllableEntity* entity2)
+ {
+ if (!entity1 || !entity2)
+ return std::numeric_limits<float>::infinity();
+ return (entity1->getPosition() - entity2->getPosition()).length();
+ }
+ /**
+ @brief
+ bad function from FormationController that returns true if both entities have same team
+ */
+ bool CommonController::sameTeam (ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+ {
+
+ if (!entity1 || !entity2)
+ return false;
+ if (entity1 == entity2)
+ return true;
+
+ int team1 = entity1->getTeam();
+ int team2 = entity2->getTeam();
+
+ Controller* controller = 0;
+ if (entity1->getController())
+ controller = entity1->getController();
+ else
+ controller = entity1->getXMLController();
+ if (controller)
+ {
+ if (controller->getIdentifier()->getName() == "MasterController")
+ return true;
+ CommonController* ac = orxonox_cast<CommonController*>(controller);
+ if (ac)
+ team1 = ac->getTeam();
+ }
+
+ if (entity2->getController())
+ controller = entity2->getController();
+ else
+ controller = entity2->getXMLController();
+ if (controller)
+ {
+ if (controller->getIdentifier()->getName() == "MasterController")
+ return true;
+ CommonController* ac = orxonox_cast<CommonController*>(controller);
+ if (ac)
+ team2 = ac->getTeam();
+ }
+
+ TeamGametype* tdm = orxonox_cast<TeamGametype*>(gametype);
+ if (tdm)
+ {
+ if (entity1->getPlayer())
+ team1 = tdm->getTeam(entity1->getPlayer());
+
+ if (entity2->getPlayer())
+ team2 = tdm->getTeam(entity2->getPlayer());
+ }
+
+ TeamBaseMatchBase* base = 0;
+ base = orxonox_cast<TeamBaseMatchBase*>(entity1);
+ if (base)
+ {
+ switch (base->getState())
+ {
+ case BaseState::ControlTeam1:
+ team1 = 0;
+ break;
+ case BaseState::ControlTeam2:
+ team1 = 1;
+ break;
+ case BaseState::Uncontrolled:
+ default:
+ team1 = -1;
+ }
+ }
+ base = orxonox_cast<TeamBaseMatchBase*>(entity2);
+ if (base)
+ {
+ switch (base->getState())
+ {
+ case BaseState::ControlTeam1:
+ team2 = 0;
+ break;
+ case BaseState::ControlTeam2:
+ team2 = 1;
+ break;
+ case BaseState::Uncontrolled:
+ default:
+ team2 = -1;
+ }
+ }
+
+ DroneController* droneController = 0;
+ droneController = orxonox_cast<DroneController*>(entity1->getController());
+ if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity2)
+ return true;
+ droneController = orxonox_cast<DroneController*>(entity2->getController());
+ if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity1)
+ return true;
+ DroneController* droneController1 = orxonox_cast<DroneController*>(entity1->getController());
+ DroneController* droneController2 = orxonox_cast<DroneController*>(entity2->getController());
+ if (droneController1 && droneController2 && droneController1->getOwner() == droneController2->getOwner())
+ return true;
+
+ Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);
+ if (dynamic)
+ {
+ if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;}
+
+ if (entity1->getPlayer())
+ team1 = dynamic->getParty(entity1->getPlayer());
+
+ if (entity2->getPlayer())
+ team2 = dynamic->getParty(entity2->getPlayer());
+
+ if (team1 ==-1 ||team2 ==-1) {return false;}
+ else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;}
+ else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;}
+ else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;}
+ else return true;
+ }
+
+ return (team1 == team2 && team1 != -1);
+ }
+ /**
+ @brief
+ returns true if entityThatLooks does look at entityBeingLookeAt with a tolerance of angle.
+ */
+ bool CommonController::isLooking(const ControllableEntity* entityThatLooks, const ControllableEntity* entityBeingLookedAt, float angle)
+ {
+ if (!entityThatLooks || !entityBeingLookedAt)
+ return false;
+ return (getAngle(entityThatLooks ->getPosition() ,
+ entityThatLooks->getOrientation() * WorldEntity::FRONT,
+ entityBeingLookedAt->getWorldPosition()) < angle);
+ }
+ /**
+ @brief
+ returns a name of a Pawn entity, if no name set, returns string representing address of the Pawn.
+ */
+ std::string CommonController::getName(const Pawn* entity)
+ {
+ std::string name = entity->getName();
+ if (name == "")
+ {
+ const void * address = static_cast<const void*>(entity);
+ std::stringstream ss;
+ ss << address;
+ name = ss.str();
+ }
+ return name;
+ }
+}
Copied: code/trunk/src/orxonox/controllers/CommonController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/CommonController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/CommonController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/CommonController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _CommonController_H__
+#define _CommonController_H__
+
+
+#include "controllers/Controller.h" //that's what I inherit from
+
+#include <limits> //I use limits pretty much in every class, so might as well include it in the parent class
+
+#include "worldentities/ControllableEntity.h" //same for ControllableEntity
+#include "worldentities/pawns/Pawn.h" //and Pawn
+
+
+namespace orxonox
+{
+ class _OrxonoxExport CommonController : public Controller
+ {
+
+ public:
+ static const float HARDCODED_PROJECTILE_SPEED; //<! FightingController uses it to predict enemy position
+
+ CommonController(Context* context);
+ virtual ~CommonController();
+ static float randomInRange(float a, float b); //<! returns random number from a to b
+ static float distance(const ControllableEntity* entity1, const ControllableEntity* entity2); //<! returns distance between arguments
+ static bool sameTeam (ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gt);
+ static bool isLooking(const ControllableEntity* entityThatLooks, const ControllableEntity* entityBeingLookedAt, float angle) ;
+ static std::string getName(const Pawn* entity) ;
+ };
+}
+
+#endif /* _CommonController_H__ */
Copied: code/trunk/src/orxonox/controllers/DivisionController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/DivisionController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/DivisionController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/DivisionController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,148 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "DivisionController.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+
+ RegisterClass(DivisionController);
+
+ //Leaders share the fact that they have Wingmans
+ DivisionController::DivisionController(Context* context) : ActionpointController(context)
+ {
+ RegisterObject(DivisionController);
+ this->setFormationMode(FormationMode::DIAMOND);
+ this->target_ = 0;
+ this->myFollower_ = 0;
+ this->myWingman_ = 0;
+ }
+
+ DivisionController::~DivisionController()
+ {
+ for (size_t i = 0; i < this->actionpoints_.size(); ++i)
+ {
+ if(this->actionpoints_[i])
+ this->actionpoints_[i]->destroy();
+ }
+ this->parsedActionpoints_.clear();
+ this->actionpoints_.clear();
+ }
+
+ void DivisionController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(DivisionController, XMLPort, xmlelement, mode);
+
+ }
+ void DivisionController::tick(float dt)
+ {
+ if (!this->isActive())
+ return;
+
+ SUPER(DivisionController, tick, dt);
+
+ }
+ void DivisionController::action()
+ {
+ if (!this || !this->getControllableEntity() || !this->isActive())
+ return;
+
+ ActionpointController::action();
+ if (!this || !this->getControllableEntity())
+ return;
+ if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty()))
+ {
+ //when this dies, its follower will execute all its actionpoints, if follower dies before this, wingman will do this
+ if (this->myFollower_)
+ {
+ this->myFollower_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+ }
+ else if (this->myWingman_)
+ {
+ this->myWingman_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+ }
+ }
+
+
+ }
+ //I wanted to do it different here, but at this point I think nothing will change if I delete that method
+ void DivisionController::stayNearProtect()
+ {
+ ActionpointController::stayNearProtect();
+ }
+
+ bool DivisionController::setWingman(ActionpointController* newWingman)
+ {
+ if (!this->myWingman_)
+ {
+ this->myWingman_ = newWingman;
+ if (!this->hasFollower())
+ newWingman->takeActionpoints (this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ bool DivisionController::setFollower(ActionpointController* newFollower)
+ {
+ if (!this->myFollower_)
+ {
+ this->myFollower_ = newFollower;
+ if (this->hasWingman())
+ {
+ this->myWingman_->takeActionpoints (std::vector<Point>(), std::vector<Point>(), false);
+ }
+
+ newFollower->takeActionpoints (this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ bool DivisionController::hasWingman()
+ {
+ if (this->myWingman_)
+ return true;
+ else
+ return false;
+ }
+ bool DivisionController::hasFollower()
+ {
+ if (this->myFollower_)
+ return true;
+
+ return false;
+ }
+
+}
Copied: code/trunk/src/orxonox/controllers/DivisionController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/DivisionController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/DivisionController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/DivisionController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,79 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _DivisionController_H__
+#define _DivisionController_H__
+
+#include "controllers/ActionpointController.h"
+
+
+
+namespace orxonox
+{
+ /**
+ @note
+ ActionpointController will not work, if there is no MasterController in the level!
+ All the demos are in a file called AITest.oxw. In the menu look for New AI Testing Level.
+ */
+ class _OrxonoxExport DivisionController : public ActionpointController
+ {
+ public:
+ //----[language demanded functions]----
+ DivisionController(Context* context);
+
+ virtual ~DivisionController();
+ //----[/language demanded functions]----
+
+ //----[orxonox demanded functions]----
+ virtual void tick(float dt);
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ //----[orxonox demanded functions]----
+
+ //----[own functions]----
+ virtual bool setFollower(ActionpointController* newFollower);
+ virtual bool setWingman(ActionpointController* newWingman);
+ virtual bool hasWingman();
+ virtual bool hasFollower();
+
+ //----[/own functions]----
+ virtual void stayNearProtect();
+
+ protected:
+ //----action must only be managed by this----
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour.
+
+ private:
+ //----private variables-----
+ Timer actionTimer_; //<! Regularly calls action().
+
+
+ };
+}
+
+#endif /* _DivisionController_H__ */
Copied: code/trunk/src/orxonox/controllers/FightingController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/FightingController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/FightingController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/FightingController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,372 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * Fabian 'x3n' Landau, Dominik Solenicki
+ *
+ */
+#include "controllers/FightingController.h"
+#include "core/XMLPort.h"
+#include "util/Math.h"
+
+
+#include "worldentities/pawns/SpaceShip.h"
+
+#include "weaponsystem/WeaponMode.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponSlot.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+
+ RegisterClass (FightingController);
+
+ FightingController::FightingController( Context* context ): FlyingController( context )
+ {
+ this->attackRange_ = 2500;
+ this->stopLookingAtTarget();
+ this->bSetupWorked = false;
+ this->timeout_ = 0;
+ RegisterObject( FightingController );
+ }
+ FightingController::~FightingController()
+ {
+
+ }
+ void FightingController::XMLPort( Element& xmlelement, XMLPort::Mode mode )
+ {
+ SUPER( FightingController, XMLPort, xmlelement, mode );
+ }
+ void FightingController::lookAtTarget(float dt)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+ ControllableEntity* entity = this->getControllableEntity();
+ if ( !entity )
+ return;
+ Vector2 coord = get2DViewCoordinates
+ ( entity->getPosition() ,
+ entity->getOrientation() * WorldEntity::FRONT,
+ entity->getOrientation() * WorldEntity::UP,
+ positionOfTarget_ );
+
+ //rotates should be in range [-1,+1], clamp cuts off all that is not
+ float rotateX = -clamp( coord.x * 10, -1.0f, 1.0f );
+ float rotateY = clamp( coord.y * 10, -1.0f, 1.0f );
+
+ //Yaw and Pitch are enough to start facing the target
+ this->getControllableEntity() ->rotateYaw( ROTATEFACTOR * rotateX * dt );
+ this->getControllableEntity() ->rotatePitch( ROTATEFACTOR * rotateY * dt );
+ }
+ void FightingController::stopLookingAtTarget()
+ {
+ this->bLookAtTarget_ = false;
+ }
+ void FightingController::startLookingAtTarget()
+ {
+ this->bLookAtTarget_ = true;
+ }
+ bool FightingController::hasTarget() const
+ {
+ if ( this->target_ )
+ return true;
+ return false;
+ }
+
+ void FightingController::setTarget( ControllableEntity* target )
+ {
+ this->target_ = target;
+ if ( this->target_ )
+ {
+ this->setPositionOfTarget( target_->getWorldPosition() );
+ }
+ }
+ void FightingController::setPositionOfTarget( const Vector3& target )
+ {
+ this->positionOfTarget_ = target;
+ this->bHasPositionOfTarget_ = true;
+ }
+ void FightingController::setOrientationOfTarget( const Quaternion& orient )
+ {
+ this->orientationOfTarget_=orient;
+ this->bHasOrientationOfTarget_=true;
+ }
+
+ void FightingController::maneuver()
+ {
+ if ( !this->target_ || !this->getControllableEntity())
+ return;
+
+
+ Vector3 thisPosition = this->getControllableEntity()->getWorldPosition();
+ this->setPositionOfTarget(this->target_->getWorldPosition());
+ //this->setOrientationOfTarget(this->target_->getOrientation());
+ Vector3 diffVector = this->positionOfTarget_ - thisPosition;
+ float diffLength = diffVector.length();
+ Vector3 diffUnit = diffVector/diffLength;
+
+ if (!this || !this->getControllableEntity())
+ return;
+
+ //too far? well, come closer then
+ if (diffLength > this->attackRange_)
+ {
+ this->spread_ = 400;
+ this->formationMode_ = FormationMode::DIAMOND;
+ this->bKeepFormation_ = true;
+
+ this->setTargetPosition(this->positionOfTarget_ - diffUnit * 100.0f);
+ }
+ else
+ {
+ bool bTargetIsLookingAtThis = CommonController::isLooking (this->target_, this->getControllableEntity(), math::pi/20.0f)
+ || this->deltaHp < 0;
+ this->bKeepFormation_ = false;
+
+ if (!this || !this->getControllableEntity())
+ return;
+ if (!this->bDodge_)
+ {
+ this->bStartedDodging_ = false;
+
+ this->setTargetPosition(this->positionOfTarget_ - diffUnit * 50.0f);
+ return;
+ }
+ else if (bTargetIsLookingAtThis || diffLength < 700.0f)
+ {
+ if (!this->bStartedDodging_)
+ {
+ this->bStartedDodging_ = true;
+ dodge(thisPosition, diffLength, diffUnit);
+ }
+ }
+ else
+ {
+ if (diffLength < 1000)
+ {
+ this->stopMoving();
+ this->startLookingAtTarget();
+
+ }
+ else
+ {
+ this->setTargetPosition(this->positionOfTarget_ - diffUnit * 300.0f);
+ }
+ }
+ }
+ }
+
+ void FightingController::dodge(const Vector3& thisPosition, float diffLength, Vector3& diffUnit)
+ {
+ //d.x*x + d.y*y + d.z*z == 0
+ //z = 1/d.z * (-d.y*y - d.x * x)
+ float x = CommonController::randomInRange (300, 800) * (CommonController::randomInRange(0,1) <= 0.5 ? 1 : -1);
+ float y = CommonController::randomInRange (300, 800) * (CommonController::randomInRange(0,1) <= 0.5 ? 1 : -1);
+ float z = diffUnit.z == 0 ? 0 : (1/diffUnit.z) * (-x * diffUnit.x - y * diffUnit.y);
+ if (diffLength < 150.0f)
+ {
+ this->setTargetPosition(this->positionOfTarget_ + Vector3(z,x,y));
+ }
+ else
+ {
+ this->setTargetPosition(thisPosition + Vector3(x,y,z) + (this->deltaHp < 0 ? -diffUnit * 450.0f :
+ (diffLength < 700.0f ? -diffUnit*700.0f : diffUnit * 50.0f)));
+
+ }
+ this->boostControl();
+
+ }
+ bool FightingController::canFire()
+ {
+ //no target? why fire?
+ if (!this->target_ || !this->getControllableEntity())
+ return false;
+ Vector3 newPositionOfTarget = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),
+ HARDCODED_PROJECTILE_SPEED, this->target_->getWorldPosition(),
+ this->target_->getVelocity());
+ if (!this->target_ || !this->getControllableEntity())
+ return false;
+ //Vector3.isNaN() is what I used on my machine and it worked...
+ if (!(std::isnan(newPositionOfTarget.x) || std::isnan(newPositionOfTarget.y) || std::isnan(newPositionOfTarget.z)))
+ {
+ this->setPositionOfTarget(newPositionOfTarget);
+ }
+
+ return squaredDistanceToTarget() < this->attackRange_*this->attackRange_ && this->isLookingAtTarget(math::pi / 20.0f);
+ }
+
+
+ float FightingController::squaredDistanceToTarget() const
+ {
+ if (!this || !this->getControllableEntity())
+ return 0;
+ if (!this->target_ || !this->getControllableEntity())
+ return (this->getControllableEntity()->getPosition().squaredDistance(this->targetPosition_));
+ else
+ return (this->getControllableEntity()->getPosition().squaredDistance(this->positionOfTarget_));
+ }
+ bool FightingController::isLookingAtTarget( float angle ) const
+ {
+ if ( !this->getControllableEntity() || !this->target_ )
+ return false;
+ return CommonController::isLooking(this->getControllableEntity(), this->getTarget(), angle);
+ }
+ void FightingController::setClosestTarget()
+ {
+ this->setTarget (static_cast<ControllableEntity*>( closestTarget() ) );
+ }
+
+ Pawn* FightingController::closestTarget() const
+ {
+ if (!this || !this->getControllableEntity())
+ return 0;
+
+ Pawn* closestTarget = 0;
+ float minDistance = std::numeric_limits<float>::infinity();
+ Gametype* gt = this->getGametype();
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(*itP), gt) )
+ continue;
+
+ float distance = CommonController::distance (*itP, this->getControllableEntity());
+ if (distance < minDistance)
+ {
+ closestTarget = *itP;
+ minDistance = distance;
+ }
+ }
+ if (closestTarget)
+ {
+ return closestTarget;
+ }
+ return 0;
+ }
+ //I checked it out, rockets DO NOT cause any problems! this->getControllableEntity() is always a SpaceShip
+ void FightingController::doFire()
+ {
+ if (!this->bSetupWorked)
+ {
+ this->setupWeapons();
+ }
+ if (!this->target_ || !this->getControllableEntity())
+ {
+ return;
+ }
+
+ Pawn* pawn = orxonox_cast<Pawn*> (this->getControllableEntity());
+ if (pawn)
+ pawn->setAimPosition (this->positionOfTarget_);
+
+ int firemode;
+ float distance = CommonController::distance (this->getControllableEntity(), this->target_);
+
+
+
+ if (distance < 1500)
+ {
+ if (this->rocketsLeft_ > 0 && !this->bFiredRocket_)
+ {
+ firemode = getFiremode ("RocketFire");
+ }
+ else
+ {
+ if (distance > 800)
+ firemode = getFiremode ("HsW01");
+ else
+ firemode = getFiremode ("LightningGun");
+ }
+
+ }
+
+
+ else if (distance < 2000)
+ {
+ firemode = getFiremode ("HsW01");
+ }
+ else
+ {
+ firemode = getFiremode ("LightningGun");
+ }
+ if (firemode < 0)
+ {
+ //assuming there is always some weapon with index 0
+ firemode = 0;
+ }
+ if (firemode == getFiremode("RocketFire"))
+ {
+ this->timeout_ = 5;
+ this->rocketsLeft_--;
+ this->bFiredRocket_ = true;
+ }
+ if (firemode == getFiremode("SimpleRocketFire"))
+ {
+ this->rocketsLeft_--;
+ }
+
+ this->getControllableEntity()->fire(firemode);
+
+ }
+ void FightingController::setupWeapons() //TODO: Make this function generic!! (at the moment is is based on conventions)
+ {
+ this->bSetupWorked = false;
+ if(this->getControllableEntity())
+ {
+ Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
+ if(pawn && pawn->isA(Class(SpaceShip))) //fix for First Person Mode: check for SpaceShip
+ {
+ this->weaponModes_.clear(); // reset previous weapon information
+ WeaponSlot* wSlot = 0;
+ for(int l=0; (wSlot = pawn->getWeaponSlot(l)) ; l++)
+ {
+ WeaponMode* wMode = 0;
+ for(int i=0; (wMode = wSlot->getWeapon()->getWeaponmode(i)) ; i++)
+ {
+ std::string wName = wMode->getIdentifier()->getName();
+ // SubclassIdentifier<Munition> munition = ClassByString(wName);
+ if (wName == "RocketFire")
+ this->rocketsLeft_ = 10;
+ if(this->getFiremode(wName) == -1) //only add a weapon, if it is "new"
+ weaponModes_[wName] = wMode->getMode();
+ }
+ }
+ if(weaponModes_.size())//at least one weapon detected
+ this->bSetupWorked = true;
+ }
+ }
+
+ }
+
+ int FightingController::getFiremode(std::string name)
+ {
+ for (std::map< std::string, int >::iterator it = this->weaponModes_.begin(); it != this->weaponModes_.end(); ++it)
+ {
+ if (it->first == name)
+ return it->second;
+ }
+ return -1;
+ }
+}
Copied: code/trunk/src/orxonox/controllers/FightingController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/FightingController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/FightingController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/FightingController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,106 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * Fabian 'x3n' Landau, Dominik Solenicki
+ *
+ */
+
+#ifndef _FightingController_H__
+#define _FightingController_H__
+
+
+#include "controllers/FlyingController.h"
+
+namespace orxonox
+{
+ /**
+ @brief
+ FightingController stores all the fighting methods and member variables of AI.
+ Main methods here are maneuver() and dodge().
+
+ @note
+ ActionpointController will not work, if there is no MasterController in the level!
+ */
+ class _OrxonoxExport FightingController : public FlyingController
+ {
+
+ public:
+ FightingController(Context* context);
+ virtual ~FightingController();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ float squaredDistanceToTarget() const;
+ bool isLookingAtTarget(float angle) const;
+ bool hasTarget() const;
+ ControllableEntity* getTarget() const
+ { return this->target_; }
+ bool bKeepFormation_; //even if action_ == FIGHT, you might still want to keep formation if far enough form the target
+ virtual void maneuver(); //<! sets this->targetPosition_, which is a Vector3 of where this ship flies. Decision is made based on
+ //<! the distance to enemy, if being attacked, dodge() is called, otherwise ship just flies towards this->target_.
+ bool bShooting_; //<! if true, ship shoots each tick
+ bool canFire(); //<! check if target_ is in radius and if this is looking at target_
+ protected:
+ void setTarget(ControllableEntity* target); //set a target to shoot at
+
+ void setPositionOfTarget(const Vector3& target); //good to know where target is
+ void setOrientationOfTarget(const Quaternion& orient); //I don't really use that
+ void stopLookingAtTarget(); //<! target dead -> you need to be able to fly
+ void startLookingAtTarget(); //<! if close to target, no need to fly, just rotate yourself
+ void lookAtTarget(float dt); //<! rotate yourself towards target
+
+ void dodge(const Vector3& thisPosition, float diffLength, Vector3& diffUnit); //<! choose a random Vector3 perpendicular to the difference vector between
+ //<! this and target_ plus or minus some amount in difference vector direction,
+ //<! depending on whether it is better to close up or survive.
+ void dodgeTowards (Vector3& position); //fly towards position and awoid being hit
+ void doFire(); //<! choose weapon, set aim at target_ and fire
+ WeakPtr<ControllableEntity> target_;
+ void setClosestTarget();
+
+ bool bHasPositionOfTarget_;
+ Vector3 positionOfTarget_;
+ bool bHasOrientationOfTarget_;
+ Quaternion orientationOfTarget_;
+ Pawn* closestTarget() const;
+
+ bool bDodge_;
+ int attackRange_;
+ bool bLookAtTarget_;
+ float deltaHp;
+ float previousHp;
+ bool bStartedDodging_;
+ //WEAPONSYSTEM DATA
+ int rocketsLeft_;
+ int timeout_;
+ bool bFiredRocket_;
+ std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode - managed by setupWeapons()
+ //std::vector<int> projectiles_; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons()
+ void setupWeapons(); //<! Defines which weapons are available for a bot. Is recalled whenever a bot was killed.
+ bool bSetupWorked; //<! If false, setupWeapons() is called.
+ int getFiremode(std::string name);
+
+ };
+}
+
+#endif /* _FightingController_H__ */
Copied: code/trunk/src/orxonox/controllers/FlyingController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/FlyingController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/FlyingController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/FlyingController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,289 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+
+ * Co-authors:
+ * ...
+ *
+ */
+#include <OgreMatrix3.h> //for Quaternion manipulations
+
+#include "util/Math.h"
+#include "core/XMLPort.h"
+#include "controllers/FlyingController.h"
+
+#include "worldentities/pawns/SpaceShip.h" //for boosting
+
+namespace orxonox
+{
+ const float FlyingController::SPEED = 0.9f/0.02f;
+ const float FlyingController::ROTATEFACTOR = 0.6f/0.02f;
+
+ RegisterClass (FlyingController);
+
+ FlyingController::FlyingController(Context* context): CommonController(context)
+ {
+ RegisterObject(FlyingController);
+ this->rotationProgress_ = 0;
+ this->spread_ = 200;
+ this->tolerance_ = 80;
+ this->bCopyOrientation_ = true;
+ }
+ FlyingController::~FlyingController()
+ {
+ }
+
+ void FlyingController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ XMLPortParam(FlyingController, "spread", setSpread, getSpread, xmlelement, mode);
+ XMLPortParam(FlyingController, "formationMode", setFormationModeXML, getFormationModeXML, xmlelement, mode);
+ SUPER(FlyingController, XMLPort, xmlelement, mode);
+ }
+
+ void FlyingController::setFormationModeXML(std::string val)
+ {
+ const std::string valUpper = getUppercase(val);
+ FormationMode::Value value;
+
+ if (valUpper == "WALL")
+ value = FormationMode::WALL;
+ else if (valUpper == "FINGER4")
+ value = FormationMode::FINGER4;
+ else if (valUpper == "DIAMOND")
+ value = FormationMode::DIAMOND;
+ else
+ ThrowException(ParseError, std::string("Attempting to set an unknown FormationMode: '")+ val + "'.");
+ this->setFormationMode(value);
+ }
+ std::string FlyingController::getFormationModeXML() const
+ {
+ switch (this->formationMode_)
+ {
+ case FormationMode::WALL:
+ { return "WALL"; }
+ case FormationMode::FINGER4:
+ { return "FINGER4"; }
+ case FormationMode::DIAMOND:
+ { return "DIAMOND"; }
+ default:
+ return "DIAMOND";
+ }
+ }
+ void FlyingController::stopMoving()
+ {
+ this->bHasTargetPosition_ = false;
+ }
+ /**
+ @brief
+ if distance to targetPosition is smaller than this->tolerance_, no moving should be made, otherwise
+ find amount of yaw and pitch that have to be applied, so that ship looks at targetPosition, then
+ ship is moved forward towards targetPosition. Also target orientation is being applied.
+ */
+ void FlyingController::moveToPosition(const Vector3& targetPosition, float dt)
+ {
+ if (!this->getControllableEntity())
+ return;
+ ControllableEntity* entity = this->getControllableEntity();
+
+ float distance = (targetPosition - entity->getPosition()).length();
+
+ if (distance >= this->tolerance_)
+ {
+ //function that calculates how much yaw and pitch are to be applied
+ Vector2 coord = get2DViewCoordinates
+ (entity->getPosition() ,
+ entity->getOrientation() * WorldEntity::FRONT,
+ entity->getOrientation() * WorldEntity::UP,
+ targetPosition);
+ //limit yaw and pitch by [-1,1]
+ float rotateX = -clamp(coord.x * 10, -1.0f, 1.0f);
+ float rotateY = clamp(coord.y * 10, -1.0f, 1.0f);
+
+ if (!entity)
+ return;
+
+ //apply yaw and pitch
+ entity->rotateYaw(ROTATEFACTOR * rotateX * dt);
+ entity->rotatePitch(ROTATEFACTOR * rotateY * dt);
+
+ if (!entity)
+ return;
+
+ //only move either if ship looks at target with a certain tolerance, or if ship is far enough for it to be ok to move in a curve.
+ if (distance > this->tolerance_*1.5f || (rotateX > -0.03 && rotateX < 0.03 && rotateY > -0.03 && rotateY < 0.03))
+ entity->moveFrontBack(SPEED * dt);
+ //roll
+ copyTargetOrientation(dt);
+ }
+ else
+ {
+ bHasTargetPosition_ = false;
+ }
+ }
+ /**
+ @brief
+ fly towards a preset targetPosition_
+ */
+ void FlyingController::moveToTargetPosition(float dt)
+ {
+ this->moveToPosition (this->targetPosition_, dt);
+ }
+ /**
+ @brief
+ roll ship so that it has same roll as orient
+ */
+ void FlyingController::copyOrientation(const Quaternion& orient, float dt)
+ {
+ //copied from
+ //http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Quaternion+and+Rotation+Primer&structure=Tutorials#Q._How_can_I_make_my_objects_rotate_smoothly_You_mentioned_slerp_etc_
+ //how can I make my objects rotate smoothly?
+ if (!this->getControllableEntity())
+ return;
+ Quaternion myOrient = this->getControllableEntity()->getOrientation();
+ this->rotationProgress_ += dt;
+
+ if (this->rotationProgress_ > 1)
+ {
+ this->rotationProgress_ = 0;
+ this->bHasTargetOrientation_ = false;
+ }
+ else
+ {
+ Quaternion deltaOrientation = Quaternion::Slerp(rotationProgress_, myOrient, orient, true);
+
+ Matrix3 deltaMatrix, myMatrix;
+
+ deltaOrientation.ToRotationMatrix(deltaMatrix);
+ myOrient.ToRotationMatrix (myMatrix);
+
+ Radian yawDelta, pitchDelta, rollDelta, yawMy, pitchMy, rollMy;
+ deltaMatrix.ToEulerAnglesYXZ(yawDelta, pitchDelta, rollDelta);
+ myMatrix.ToEulerAnglesYXZ (yawMy, pitchMy, rollMy);
+
+ if (!this->getControllableEntity())
+ return;
+ this->getControllableEntity()->rotateRoll ((rollDelta.valueRadians() - rollMy.valueRadians())*ROTATEFACTOR*dt);
+ }
+ }
+ /**
+ @brief
+ roll ship so that it has same roll as a preset targetOrientation_
+ */
+ void FlyingController::copyTargetOrientation(float dt)
+ {
+ if (bHasTargetOrientation_)
+ {
+ this->copyOrientation(targetOrientation_, dt);
+ }
+ }
+ /**
+ @brief
+ set Vector to fly to
+ */
+ void FlyingController::setTargetPosition(const Vector3& target)
+ {
+ this->targetPosition_ = target;
+ this->bHasTargetPosition_ = true;
+ }
+ /**
+ @brief
+ set orientation to apply
+ */
+ void FlyingController::setTargetOrientation(const Quaternion& orient)
+ {
+ this->targetOrientation_=orient;
+ this->bHasTargetOrientation_=true;
+ }
+ /**
+ @brief
+ set orientation to apply
+ */
+ void FlyingController::setTargetOrientation(ControllableEntity* target)
+ {
+ if (target)
+ this->setTargetOrientation(target->getOrientation());
+ }
+ /**
+ @brief
+ boost if you can
+ */
+ void FlyingController::boostControl()
+ {
+ if (!this->getControllableEntity())
+ return;
+ SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity());
+ if(ship == NULL) return;
+ if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower()) //upper limit ->boost
+ {
+ this->getControllableEntity()->boost(true);
+ }
+ else if(ship->getBoostPower()*4.0f < ship->getInitialBoostPower()) //lower limit ->do not boost
+ {
+ this->getControllableEntity()->boost(false);
+ }
+ }
+ /**
+ @brief
+ keep this ship in a formation with its division
+ */
+ void FlyingController::keepFormation(const ControllableEntity* leaderEntity, Vector3& targetRelativePosition)
+ {
+ if (!this->getControllableEntity())
+ return;
+ ControllableEntity* myEntity = this->getControllableEntity();
+ Vector3 myPosition = myEntity->getWorldPosition();
+
+ if (!leaderEntity)
+ {
+ return;
+ }
+ Quaternion orient = leaderEntity->getWorldOrientation();
+ Vector3 leaderPosition = leaderEntity->getWorldPosition();
+
+ if (!leaderEntity)
+ {
+ return;
+ }
+ //calculate where in world coordinates this ship should fly
+ Vector3 targetAbsolutePosition =
+ (leaderPosition + (orient*WorldEntity::FRONT) * (leaderEntity->getVelocity().length()/5)
+ + (orient* (targetRelativePosition)));
+ //let ship finish rotating. also don't call copyOrientation too often as it is a slow function. Don't know how to do it different
+ if (this->bCopyOrientation_)
+ this->setTargetOrientation (orient);
+ //set a position to fly to
+ this->setTargetPosition (targetAbsolutePosition);
+
+ //boost if too far
+ if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
+ {
+ this->boostControl();
+ }
+ else
+ {
+ if (!this->getControllableEntity())
+ return;
+ this->getControllableEntity()->boost(false);
+ }
+ }
+}
Copied: code/trunk/src/orxonox/controllers/FlyingController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/FlyingController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/FlyingController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/FlyingController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,105 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * Dominik Solenicki
+ *
+ */
+
+#ifndef _FlyingController_H__
+#define _FlyingController_H__
+
+
+#include "controllers/CommonController.h"
+
+namespace orxonox
+{
+ /**
+ @brief
+ FlyingController stores all the flying methods and member variables of AI.
+ */
+
+ //Formation mode for the divisions
+ namespace FormationMode
+ {
+ enum Value
+ {
+ FINGER4, DIAMOND, WALL
+ };
+ }
+
+ class _OrxonoxExport FlyingController : public CommonController
+ {
+
+ public:
+ static const float SPEED; //<! ship's speed
+ static const float ROTATEFACTOR; //<! ship's rotation factor
+
+ FlyingController(Context* context);
+ virtual ~FlyingController();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ void setSpread (int spread) //<! spread is a multiplier for formation flight, should be bigger than 100
+ { this->spread_ = spread; }
+ int getSpread () const
+ { return this->spread_; }
+
+ void setFormationModeXML(std::string val);
+ std::string getFormationModeXML() const;
+
+ void setFormationMode(FormationMode::Value val)
+ { this->formationMode_ = val; }
+ FormationMode::Value getFormationMode() const
+ { return this->formationMode_; }
+ bool bCopyOrientation_; //<! set to true by default, MasterController sets it in its tick(),
+ //<! if true, this will set its leader orientation as target orientation in action()
+ protected:
+ void stopMoving(); //<! don't call moveToTargetPosition() in tick, call lookAtTarget() from FightingController instead
+
+ void moveToPosition(const Vector3& target, float dt); //<! move towards a vector
+ void moveToTargetPosition(float dt); //<! move to the preset position. Don't mix with positionOfTarget!
+
+ void copyOrientation(const Quaternion& orient, float dt); //<! roll to have same roll as orient
+ void copyTargetOrientation(float dt); //<! roll to have a preset orient
+
+ void setTargetPosition(const Vector3& target); //<! preset a Vector to fly to
+ void setTargetOrientation(const Quaternion& orient); //<! preset a desired orientation
+ void setTargetOrientation(ControllableEntity* target); //<! preset a desired orientation
+ virtual void boostControl(); //<! boost if you can
+ void keepFormation (const ControllableEntity* leaderEntity,
+ Vector3& targetRelativePosition); //<! preset targetPosition, so that
+ //<! this stays in a certain position relative to leader
+
+ FormationMode::Value formationMode_;
+
+ float rotationProgress_; //<! for slerping
+ bool bHasTargetPosition_;
+ Vector3 targetPosition_; //<! vector to fly to
+ bool bHasTargetOrientation_;
+ Quaternion targetOrientation_; //<! orientation to take
+ int spread_; //<! spread is a multiplier for formation flight, should be bigger than 100
+ int tolerance_; //<! if this ship is tolerance_ away from targetPosition_, ship decides that it finished moving
+ };
+}
+
+#endif /* _FlyingController_H__ */
Modified: code/trunk/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/controllers/FormationController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -276,7 +276,7 @@
// return;
}
- Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+ Vector2 coord = get2DViewCoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
float distance = (target - this->getControllableEntity()->getPosition()).length();
float rotateX = clamp(coord.x * 10, -1.0f, 1.0f);
float rotateY = clamp(coord.y * 10, -1.0f, 1.0f);
@@ -969,6 +969,8 @@
controller = entity1->getXMLController();
if (controller)
{
+ if (controller->getIdentifier()->getName() == "MasterController")
+ return true;
FormationController* ac = orxonox_cast<FormationController*>(controller);
if (ac)
team1 = ac->getTeam();
@@ -980,6 +982,8 @@
controller = entity2->getXMLController();
if (controller)
{
+ if (controller->getIdentifier()->getName() == "MasterController")
+ return true;
FormationController* ac = orxonox_cast<FormationController*>(controller);
if (ac)
team2 = ac->getTeam();
@@ -1068,7 +1072,7 @@
if (!this->getControllableEntity())
return;
- Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+ Vector2 coord = get2DViewCoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
float distance = (target - this->getControllableEntity()->getPosition()).length();
if (this->target_ || distance > minDistance)
Modified: code/trunk/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/controllers/HumanController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -198,7 +198,7 @@
/**
@brief
Starts the boosting mode.
- Resets the boosting timeout and ells the ControllableEntity to boost (or not boost anymore).
+ Resets the boosting timeout and tells the ControllableEntity to boost (or not boost anymore).
*/
void HumanController::startBoosting(void)
{
Copied: code/trunk/src/orxonox/controllers/MasterController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/MasterController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/MasterController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/MasterController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,129 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "MasterController.h"
+#include "controllers/ActionpointController.h"
+namespace orxonox
+{
+
+ RegisterClass(MasterController);
+
+ //Leaders share the fact that they have Wingmans
+ MasterController::MasterController(Context* context) : Controller(context)
+ {
+ RegisterObject(MasterController);
+ this->controllers_.clear();
+ this->numberOfTicksPassedSinceLastActionCall_ = 0;
+ this->indexOfCurrentController_ = 0;
+ this->ticks_ = 0;
+ }
+
+ MasterController::~MasterController()
+ {
+ this->controllers_.clear();
+ }
+ /*HACK*/
+ //the whole idea is a hack
+ void MasterController::tick(float dt)
+ {
+ if (!this->isActive())
+ return;
+ ++this->ticks_;
+ if (this->ticks_ == 1)
+ {
+ //fill the vector in the first tick
+ for (ObjectList<ActionpointController>::iterator it = ObjectList<ActionpointController>::begin(); it; ++it)
+ {
+ //----0ptr?----
+ if (!it)
+ continue;
+ this->controllers_.push_back(*it);
+ }
+ }
+ else
+ {
+ if (this->controllers_.empty())
+ return;
+
+ //iterate over vecotr with the index, keep index in boundaries
+ if (this->indexOfCurrentController_ >= this->controllers_.size())
+ {
+ this->indexOfCurrentController_ = 0;
+ }
+ //each 9 ticks index is incremented
+ if (this->numberOfTicksPassedSinceLastActionCall_ >= 9)
+ {
+ this->numberOfTicksPassedSinceLastActionCall_ = 0;
+ }
+
+ if (this->numberOfTicksPassedSinceLastActionCall_ > 0)
+ {
+ if (this->numberOfTicksPassedSinceLastActionCall_ == 3)
+ {
+ //check if 0ptr
+ if (!this->controllers_.at(this->indexOfCurrentController_))
+ {
+ this->controllers_.erase(this->controllers_.begin() + this->indexOfCurrentController_);
+ return;
+ }
+ //call maneuver for current index
+ this->controllers_.at(this->indexOfCurrentController_)->maneuver();
+ }
+ else if (this->numberOfTicksPassedSinceLastActionCall_ == 6)
+ {
+ //check if 0ptr
+ if (!this->controllers_.at(this->indexOfCurrentController_))
+ {
+ this->controllers_.erase(this->controllers_.begin() + this->indexOfCurrentController_);
+ return;
+ }
+ //call canFire for current index
+ this->controllers_.at(this->indexOfCurrentController_)->bShooting_ = this->controllers_.at(this->indexOfCurrentController_)->canFire();
+ }
+ ++this->numberOfTicksPassedSinceLastActionCall_;
+ }
+ else
+ {
+ //check if 0ptr
+ if (!this->controllers_.at(this->indexOfCurrentController_))
+ {
+ this->controllers_.erase(this->controllers_.begin() + this->indexOfCurrentController_);
+ return;
+ }
+ //call action for current index
+ this->controllers_.at(this->indexOfCurrentController_)->action();
+
+ //bCopyOrientation makes ship oscillate like crazy if set to true all the time.s
+ this->controllers_.at(this->indexOfCurrentController_)->bCopyOrientation_ = this->ticks_ % 3 == 0;
+
+ ++this->numberOfTicksPassedSinceLastActionCall_;
+ ++this->indexOfCurrentController_;
+ }
+ }
+ }
+}
Copied: code/trunk/src/orxonox/controllers/MasterController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/MasterController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/MasterController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/MasterController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,78 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _MasterController_H__
+#define _MasterController_H__
+
+#include "controllers/Controller.h"
+#include "controllers/ActionpointController.h"
+#include "tools/interfaces/Tickable.h"
+
+
+
+namespace orxonox
+{
+ /**
+ @brief
+ calles action(), maneuver() and canFire() methods of all the ActionpointControllers in level.
+ Only one instance of MasterController is to be placed in level.
+ If no MasterController is initialized, none of ActionpointControllers will work.
+ Example:
+ <Pawn position = "100000, 100000, 100000">
+ <controller>
+ <MasterController>
+ </MasterController>
+ </controller>
+ </Pawn>
+ */
+ class _OrxonoxExport MasterController : public Controller, public Tickable
+ {
+ public:
+ //----[language demanded functions]----
+ MasterController(Context* context);
+
+ virtual ~MasterController();
+ //----[/language demanded functions]----
+
+ //----[orxonox demanded functions]----
+ virtual void tick(float dt);
+
+ //----[orxonox demanded functions]----
+
+ protected:
+
+ private:
+ std::vector<WeakPtr<ActionpointController> > controllers_; //<! vector of controllers, which action(), canFire() and maneuver() methods are to be called
+ size_t indexOfCurrentController_; //<! index of current controller
+ unsigned int numberOfTicksPassedSinceLastActionCall_;
+ unsigned int ticks_; //<! local tick counter
+
+ };
+}
+
+#endif /* _MasterController_H__ */
Copied: code/trunk/src/orxonox/controllers/SectionController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/SectionController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/SectionController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/SectionController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,285 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "SectionController.h"
+
+namespace orxonox
+{
+
+ RegisterClass(SectionController);
+
+ //Leaders share the fact that they have Wingmans
+ SectionController::SectionController(Context* context) : ActionpointController(context)
+ {
+ RegisterObject(SectionController);
+ this->setFormationMode(FormationMode::FINGER4);
+
+ this->myWingman_ = 0;
+ this->myDivisionLeader_ = 0;
+ this->bFirstAction_ = true;
+
+ }
+
+ SectionController::~SectionController()
+ {
+ for (size_t i = 0; i < this->actionpoints_.size(); ++i)
+ {
+ if(this->actionpoints_[i])
+ this->actionpoints_[i]->destroy();
+ }
+ this->parsedActionpoints_.clear();
+ this->actionpoints_.clear();
+ }
+ void SectionController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SectionController, XMLPort, xmlelement, mode);
+ }
+
+ //----in tick, move (or look) and shoot----
+ void SectionController::tick(float dt)
+ {
+ if (!this->isActive())
+ return;
+
+ SUPER(SectionController, tick, dt);
+
+ }
+
+ void SectionController::action()
+ {
+ if (!this || !this->getControllableEntity() || !this->isActive())
+ return;
+
+ //----If no leader, find one----
+ if (!myDivisionLeader_)
+ {
+ ActionpointController* newDivisionLeader = findNewDivisionLeader();
+ if (!this || !this->getControllableEntity())
+ return;
+
+ this->myDivisionLeader_ = newDivisionLeader;
+ }
+ //----If have leader----
+ else
+ {
+ }
+ if (!myDivisionLeader_)
+ {
+ ActionpointController::action();
+ if (!this || !this->getControllableEntity())
+ return;
+ if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty()))
+ {
+ if (this->myWingman_)
+ {
+ this->myWingman_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+ }
+ }
+ }
+ else if (myDivisionLeader_)
+ {
+ if (this->myDivisionLeader_->bKeepFormation_ || !(this->myDivisionLeader_->getAction() == Action::FIGHT
+ || this->myDivisionLeader_->getAction() == Action::FIGHTALL
+ || this->myDivisionLeader_->getAction() == Action::ATTACK))
+ {
+ this->keepFormation();
+ }
+ else if (!this->myDivisionLeader_->bKeepFormation_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ if (!this->hasTarget())
+ {
+ this->chooseTarget();
+ }
+
+ }
+ }
+
+ }
+
+
+ //PRE: myDivisionLeader_ != 0 && myDivisionLeader_->action_ == Action::FIGHT
+ //POST: this->target_ is set unless division leader doesn't have one
+ void SectionController::chooseTarget()
+ {
+ //----If division leader fights, cover him by fighting emenies close to his target----
+ Action::Value action = this->myDivisionLeader_->getAction();
+
+ if (action == Action::FIGHT || action == Action::FIGHTALL || action == Action::ATTACK)
+ {
+ Pawn* target;
+ //----if he has a target----
+ if (this->myDivisionLeader_->hasTarget())
+ {
+ //----try to find a new target if division leader has wingman (doing fine) and no good target already set----
+ if ( this->myDivisionLeader_->hasWingman() &&
+ !( this->hasTarget() && this->getTarget() != this->myDivisionLeader_->getTarget() ) )
+ {
+ bool foundTarget = false;
+ //----new target should be close to division's target----
+ Vector3 divisionTargetPosition = this->myDivisionLeader_->getTarget()->getWorldPosition();
+ Gametype* gt = this->getGametype();
+ for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+ {
+ //----is enemy?----
+ if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(*itP), gt) )
+ continue;
+ //----in range?----
+ if (((*itP)->getWorldPosition() - divisionTargetPosition).length() < 3000 &&
+ (*itP) != this->myDivisionLeader_->getTarget())
+ {
+ foundTarget = true;
+ target = (*itP);
+ break;
+ }
+ }
+ //----no target? then attack same target as division leader----
+ if (!foundTarget)
+ {
+ target = orxonox_cast<Pawn*>(this->myDivisionLeader_->getTarget());
+ }
+ }
+ //----if division leader doesn't have a wingman, support his fire----
+ else
+ {
+ target = orxonox_cast<Pawn*>(this->myDivisionLeader_->getTarget());
+ }
+ }
+ //----If he fights but doesn't have a target, wait for him to get one----
+ else
+ {
+
+ }
+ this->setTarget (orxonox_cast<ControllableEntity*>(target));
+ }
+ else
+ {
+ }
+ }
+ Vector3 SectionController::getFormationPosition ()
+ {
+ this->setFormationMode( this->myDivisionLeader_->getFormationMode() );
+ this->spread_ = this->myDivisionLeader_->getSpread();
+ Vector3* targetRelativePosition;
+ switch (this->formationMode_){
+ case FormationMode::WALL:
+ {
+ targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 0);
+ break;
+ }
+ case FormationMode::FINGER4:
+ {
+ targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 1.0f*this->spread_);
+ break;
+ }
+
+ case FormationMode::DIAMOND:
+ {
+ targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 1.0f*this->spread_);
+ break;
+ }
+ }
+ Vector3 result = *targetRelativePosition;
+ delete targetRelativePosition;
+ return result;
+ }
+
+ void SectionController::keepFormation()
+ {
+ this->bKeepFormation_ = true;
+ ControllableEntity* leaderEntity = this->myDivisionLeader_->getControllableEntity();
+ Vector3 targetRelativePosition = this->getFormationPosition();
+ if (!leaderEntity)
+ return;
+ FlyingController::keepFormation(leaderEntity, targetRelativePosition);
+ }
+
+ ActionpointController* SectionController::findNewDivisionLeader()
+ {
+
+ if (!this->getControllableEntity())
+ return 0;
+
+ ActionpointController* closestLeader = 0;
+ float minDistance = std::numeric_limits<float>::infinity();
+ //go through all pawns
+ for (ObjectList<ActionpointController>::iterator it = ObjectList<ActionpointController>::begin(); it; ++it)
+ {
+ //0ptr or not DivisionController?
+ if (!(it) || !((it)->getIdentifier()->getName() == "DivisionController") || !(it->getControllableEntity()))
+ continue;
+ //same team?
+ if ((this->getControllableEntity()->getTeam() != (it)->getControllableEntity()->getTeam()))
+ continue;
+
+ //is equal to this?
+ if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity())
+ continue;
+
+ float distance = CommonController::distance (it->getControllableEntity(), this->getControllableEntity());
+
+ if (distance < minDistance && !(it->hasFollower()))
+ {
+ closestLeader = *it;
+ minDistance = distance;
+ }
+
+ }
+ if (closestLeader)
+ {
+ if (closestLeader->setFollower(this))
+ return closestLeader;
+ }
+ return 0;
+ }
+
+ bool SectionController::setWingman(ActionpointController* newWingman)
+ {
+
+ if (!this->myWingman_)
+ {
+ this->myWingman_ = newWingman;
+ newWingman->takeActionpoints (this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ bool SectionController::hasWingman()
+ {
+ if (this->myWingman_)
+ return true;
+ else
+ return false;
+ }
+}
Copied: code/trunk/src/orxonox/controllers/SectionController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/SectionController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/SectionController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/SectionController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,79 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _SectionController_H__
+#define _SectionController_H__
+
+#include "controllers/ActionpointController.h"
+
+
+namespace orxonox
+{
+ /**
+ @note
+ ActionpointController will not work, if there is no MasterController in the level!
+ All the demos are in a file called AITest.oxw. In the menu look for New AI Testing Level.
+ */
+ class _OrxonoxExport SectionController : public ActionpointController
+ {
+ public:
+ //----[language demanded functions]----
+ SectionController(Context* context);
+
+ virtual ~SectionController();
+ //----[/language demanded functions]----
+
+ //----[orxonox demanded functions]----
+ virtual void tick(float dt);
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ //----[/orxonox demanded functions]----
+
+ //----[own functions]----
+ ActionpointController* findNewDivisionLeader();
+
+ virtual bool setWingman(ActionpointController* newWingman);
+ virtual bool hasWingman();
+ virtual bool hasFollower()
+ { return false; }
+ void chooseTarget();
+ //----[/own functions]----
+
+ protected:
+ //----action must only be managed by this----
+ virtual void action(); //<! action() is called in regular intervals by MasterController managing the bot's behaviour.
+ Vector3 getFormationPosition ();
+ void keepFormation();
+ private:
+ //----private variables-----
+ bool bFirstAction_;
+
+ };
+}
+
+#endif /* _SectionController_H__ */
Copied: code/trunk/src/orxonox/controllers/WingmanController.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/WingmanController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/WingmanController.cc (rev 0)
+++ code/trunk/src/orxonox/controllers/WingmanController.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,227 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "WingmanController.h"
+
+
+namespace orxonox
+{
+
+ RegisterClass(WingmanController);
+
+ //ActionpointController contains all common functionality of AI Controllers
+ WingmanController::WingmanController(Context* context) : ActionpointController(context)
+ {
+ RegisterObject(WingmanController);
+ this->myLeader_ = 0;
+ this->bFirstAction_ = true;
+
+ }
+
+ WingmanController::~WingmanController()
+ {
+ for (size_t i = 0; i < this->actionpoints_.size(); ++i)
+ {
+ if(this->actionpoints_[i])
+ this->actionpoints_[i]->destroy();
+ }
+ this->parsedActionpoints_.clear();
+ this->actionpoints_.clear();
+ }
+
+ void WingmanController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(WingmanController, XMLPort, xmlelement, mode);
+ }
+
+ //----in tick, move (or look) and shoot----
+ void WingmanController::tick(float dt)
+ {
+ if (!this->isActive())
+ return;
+
+ SUPER(WingmanController, tick, dt);
+
+ }
+
+ //----action for hard calculations----
+ void WingmanController::action()
+ {
+ if (!this || !this->getControllableEntity() || !this->isActive())
+ return;
+ //----If no leader, find one----
+ if (!this->myLeader_)
+ {
+ ActionpointController* newLeader = (findNewLeader());
+ if (!this || !this->getControllableEntity())
+ return;
+
+ this->myLeader_ = newLeader;
+ if (this->myLeader_)
+ {
+
+ }
+ }
+ //----If have leader, he will deal with logic----
+ else
+ {
+
+ }
+ if (!this->myLeader_)
+ {
+ ActionpointController::action();
+ }
+ else if (this->myLeader_)
+ {
+ if (this->myLeader_->bKeepFormation_ || !(this->myLeader_->getAction() == Action::FIGHT
+ || this->myLeader_->getAction() == Action::FIGHTALL
+ || this->myLeader_->getAction() == Action::ATTACK))
+ {
+ this->keepFormation();
+ }
+ else if (!this->myLeader_->bKeepFormation_)
+ {
+ if (!this || !this->getControllableEntity())
+ return;
+
+ if (!this->hasTarget())
+ {
+ this->setTarget(this->myLeader_->getTarget());
+ }
+
+ }
+ }
+ }
+
+
+ Vector3 WingmanController::getFormationPosition ()
+ {
+
+
+ this->setFormationMode( this->myLeader_->getFormationMode() );
+ Vector3* targetRelativePosition;
+ this->spread_ = this->myLeader_->getSpread();
+ if (this->myLeader_->getIdentifier()->getName() == "DivisionController")
+ {
+ switch (this->formationMode_){
+ case FormationMode::WALL:
+ {
+ targetRelativePosition = new Vector3 (2.0f*this->spread_, 0, 0 - 1.0f*this->tolerance_);
+ break;
+ }
+ case FormationMode::FINGER4:
+ {
+ targetRelativePosition = new Vector3 (2.0f*this->spread_, 0, this->spread_ - 1.0f*this->tolerance_);
+ break;
+ }
+ case FormationMode::DIAMOND:
+ {
+ targetRelativePosition = new Vector3 (2.0f*this->spread_, 0, this->spread_ - 1.0f*this->tolerance_);
+ break;
+ }
+ }
+ }
+ else
+ {
+ switch (this->formationMode_){
+ case FormationMode::WALL:
+ {
+ targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 0 - 1.0f*this->tolerance_);
+ break;
+ }
+ case FormationMode::FINGER4:
+ {
+ targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, this->spread_ - 1.0f*this->tolerance_);
+ break;
+ }
+ case FormationMode::DIAMOND:
+ {
+ targetRelativePosition = new Vector3 (2.0f*this->spread_, -1.0f*this->spread_, 0 - 1.0f*this->tolerance_);
+ break;
+ }
+ }
+ }
+ Vector3 result = *targetRelativePosition;
+ delete targetRelativePosition;
+ return result;
+ }
+ void WingmanController::keepFormation()
+ {
+ this->bKeepFormation_ = true;
+ ControllableEntity* leaderEntity = this->myLeader_->getControllableEntity();
+ Vector3 targetRelativePosition = this->getFormationPosition();
+ if (!leaderEntity)
+ return;
+ FlyingController::keepFormation (leaderEntity, targetRelativePosition);
+ }
+ //----POST: closest leader that is ready to take a new wingman is returned----
+ ActionpointController* WingmanController::findNewLeader()
+ {
+
+ if (!this->getControllableEntity())
+ return 0;
+
+ //----vars for finding the closest leader----
+ ActionpointController* closestLeader = 0;
+ float minDistance = std::numeric_limits<float>::infinity();
+ Gametype* gt = this->getGametype();
+
+ for (ObjectList<ActionpointController>::iterator it = ObjectList<ActionpointController>::begin(); it; ++it)
+ {
+ //----0ptr or not a leader or dead?----
+ if (!it ||
+ (it->getIdentifier()->getName() != "SectionController" && it->getIdentifier()->getName() != "DivisionController") ||
+ !(it->getControllableEntity()))
+ continue;
+
+ //----same team?----
+ if ( !CommonController::sameTeam (this->getControllableEntity(), (it)->getControllableEntity(), gt) )
+ continue;
+
+ //----check distance----
+ float distance = CommonController::distance (it->getControllableEntity(), this->getControllableEntity());
+ if (distance < minDistance && !(it->hasWingman()))
+ {
+ closestLeader = *it;
+ minDistance = distance;
+ }
+ }
+ if (closestLeader)
+ {
+ //----Racing conditions----
+ /*TODO: racing condition check is wrong and redundant, as there is no multithreading here, ticks get called one after another,
+ so it can be simplified to a check of whether leader got a wingman*/
+ if (closestLeader->setWingman(orxonox_cast<ActionpointController*>(this)))
+ {
+ return closestLeader;
+ }
+ }
+ return 0;
+ }
+
+}
Copied: code/trunk/src/orxonox/controllers/WingmanController.h (from rev 11051, code/branches/presentationHS15/src/orxonox/controllers/WingmanController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/WingmanController.h (rev 0)
+++ code/trunk/src/orxonox/controllers/WingmanController.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,81 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _WingmanController_H__
+#define _WingmanController_H__
+
+
+#include "controllers/ActionpointController.h"
+
+
+namespace orxonox
+{
+ /**
+ @note
+ ActionpointController will not work, if there is no MasterController in the level!
+ All the demos are in a file called AITest.oxw. In the menu look for New AI Testing Level.
+ */
+ class _OrxonoxExport WingmanController : public ActionpointController
+ {
+ public:
+ //----[language demanded functions]----
+ WingmanController(Context* context);
+
+ virtual ~WingmanController();
+ //----[/language demanded functions]----
+
+ //----[orxonox demanded functions]----
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ virtual void tick(float dt);
+ virtual bool hasWingman()
+ { return false; }
+ virtual bool hasFollower()
+ { return false; }
+ //----[/orxonox demanded functions]----
+
+ //----[own functions]----
+ ActionpointController* findNewLeader();
+ //----[/own functions]----
+
+ protected:
+ //----action must only be managed by this----
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour.
+ Vector3 getFormationPosition ();
+ void keepFormation();
+
+ private:
+ //----private variables-----
+ WeakPtr<ActionpointController> myLeader_;
+ bool bFirstAction_;
+
+
+ };
+}
+
+#endif /* _WingmanController_H__ */
Modified: code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -85,6 +85,12 @@
this->setHUDTemplate("DynamicmatchHUD");
}
+ Dynamicmatch::~Dynamicmatch()
+ {
+ for (std::set<Timer*>::iterator it = this->piggyTimers_.begin(); it != this->piggyTimers_.end(); ++it)
+ delete (*it);
+ }
+
void Dynamicmatch::setConfigValues()
{
SetConfigValue(gameTime_, 180);
@@ -311,8 +317,10 @@
{
spaceship->addSpeedFactor(5);
ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
- executor->setDefaultValue(0, spaceship);
- new Timer(10, false, executor, true);
+ Timer* timer = new Timer(10, false, executor);
+ executor->setDefaultValue(0, spaceship); // TODO: use WeakPtr because spaceship can be destroyed in the meantime
+ executor->setDefaultValue(1, timer);
+ this->piggyTimers_.insert(timer);
}
}
@@ -589,12 +597,15 @@
return this->playerParty_[player];
}
- void Dynamicmatch::resetSpeedFactor(SpaceShip* spaceship)// helper function
+ void Dynamicmatch::resetSpeedFactor(SpaceShip* spaceship, Timer* timer)// helper function
{
if (spaceship)
{
spaceship->addSpeedFactor(1.0f/5.0f);
}
+
+ this->piggyTimers_.erase(timer);
+ delete timer;
}
bool Dynamicmatch::playerChangedName(PlayerInfo* player) //standardfunction
Modified: code/trunk/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -32,6 +32,7 @@
#include "OrxonoxPrereqs.h"
#include <map>
+#include <set>
#include <vector>
#include "tools/Timer.h"
@@ -44,7 +45,7 @@
{
public:
Dynamicmatch(Context* context);
- virtual ~Dynamicmatch() {}
+ virtual ~Dynamicmatch();
bool notEnoughPigs;
bool notEnoughKillers;
@@ -76,7 +77,7 @@
virtual void furtherInstructions();*/
virtual void rewardPig();
void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost.
- void resetSpeedFactor(SpaceShip* spaceship);
+ void resetSpeedFactor(SpaceShip* spaceship, Timer* timer);
void tick (float dt);// used to end the game
SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
@@ -87,6 +88,7 @@
std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here
std::vector<ColourValue> partyColours_; //aus TeamDeathmatch
+ std::set<Timer*> piggyTimers_;
unsigned int numberOf[3]; //array to count number of chasers, pigs, killers
float pointsPerTime;
float gameTime_; // from UnderAttack
Modified: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -201,6 +201,10 @@
this->controller_->setControllableEntity(entity);
this->changedControllableEntity();
+
+ // HACK-ish
+ if(this->isHumanPlayer())
+ entity->createHud();
}
void PlayerInfo::stopControl()
@@ -252,6 +256,8 @@
if( !entity || this->previousControllableEntity_.size() == 0 )
return;
+ entity->destroyHud(); // HACK-ish
+
this->controllableEntity_->setController(0);
if(this->isHumanPlayer()) // TODO: Multiplayer?
this->controllableEntity_->destroyHud(); // HACK-ish
Modified: code/trunk/src/orxonox/items/ShipPart.cc
===================================================================
--- code/trunk/src/orxonox/items/ShipPart.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/items/ShipPart.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -40,7 +40,6 @@
#include "gametypes/Gametype.h"
#include "worldentities/StaticEntity.h"
#include "items/PartDestructionEvent.h"
-#include "worldentities/BigExplosion.h"
#include "chat/ChatManager.h"
@@ -104,10 +103,10 @@
void ShipPart::explode()
{
- BigExplosion* chunk = new BigExplosion(this->getContext());
- chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
- //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
- chunk->setVelocity(this->parent_->getVelocity());
+ // BigExplosion* chunk = new BigExplosion(this->getContext());
+ // chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
+ // //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
+ // chunk->setVelocity(this->parent_->getVelocity());
// this->explosionSound_->setPosition(this->parent_->getPosition());
// this->explosionSound_->play();
Modified: code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -449,4 +449,12 @@
Ogre::TextureUnitState* tempTx = ptr->getTechnique(0)->getPass(0)->getTextureUnitState(0);
tempTx->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour);
}
+
+ void OrxonoxOverlay::setZOrder(unsigned short order)
+ {
+ if (this->overlay_)
+ {
+ this->overlay_->setZOrder(order);
+ }
+ }
}
Modified: code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -64,7 +64,7 @@
- Standard Ogre::PanelOverlayElement for a background image (class doesn't have to be derived
only for displaying a picture).
- Reacts to changes of the window aspect
- - Last but not least: On demand you can tell the overlay to automatically resale to correct for
+ - Last but not least: On demand you can tell the overlay to automatically rescale to correct for
aspect distortion. E.g. if you play 1024x768 you wouldn't want a round object to be oval.
Remark: This can (due to the Ogre::Overlay transformation order) only work for angle that are
multiples of 90 degrees. But it's only a small drawback.
@@ -185,6 +185,7 @@
{ return this->group_; }
virtual void changedOverlayGroup()
{ this->changedVisibility(); }
+ virtual void setZOrder(unsigned short order);
protected:
virtual void angleChanged();
Modified: code/trunk/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayGroup.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/overlays/OverlayGroup.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -41,13 +41,28 @@
namespace orxonox
{
+ namespace autocompletion
+ {
+ /**
+ @brief Returns the names of all currently existing OverlayGroups.
+ */
+ ARGUMENT_COMPLETION_FUNCTION_DECLARATION(overlaygroupnames)();
+ ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION(overlaygroupnames)()
+ {
+ ArgumentCompletionList names;
+ for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+ names.push_back(ArgumentCompletionListElement(it->getName(), getLowercase(it->getName())));
+ return names;
+ }
+ }
+
+ SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility).argumentCompleter(0, autocompletion::overlaygroupnames());
+ SetConsoleCommand("OverlayGroup", "show", &OverlayGroup::show ).argumentCompleter(0, autocompletion::overlaygroupnames());
+ SetConsoleCommand("OverlayGroup", "scaleGroup", &OverlayGroup::scaleGroup ).argumentCompleter(0, autocompletion::overlaygroupnames());
+ SetConsoleCommand("OverlayGroup", "scrollGroup", &OverlayGroup::scrollGroup ).argumentCompleter(0, autocompletion::overlaygroupnames());
+
RegisterClass(OverlayGroup);
- SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility);
- SetConsoleCommand("OverlayGroup", "show", &OverlayGroup::show);
- SetConsoleCommand("OverlayGroup", "scaleGroup", &OverlayGroup::scaleGroup);
- SetConsoleCommand("OverlayGroup", "scrollGroup", &OverlayGroup::scrollGroup);
-
OverlayGroup::OverlayGroup(Context* context)
: BaseObject(context)
{
Modified: code/trunk/src/orxonox/weaponsystem/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/weaponsystem/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,5 +1,6 @@
ADD_SOURCE_FILES(ORXONOX_SRC_FILES
Munition.cc
+ ReplenishingMunition.cc
Weapon.cc
WeaponMode.cc
WeaponPack.cc
Modified: code/trunk/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Munition.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/Munition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -23,7 +23,7 @@
* Martin Polak
* Fabian 'x3n' Landau
* Co-authors:
- * ...
+ * Fabien Vultier
*
*/
@@ -31,6 +31,7 @@
#include "core/CoreIncludes.h"
#include "core/command/Executor.h"
+#include "core/XMLPort.h"
namespace orxonox
{
@@ -42,40 +43,50 @@
this->maxMunitionPerMagazine_ = 10;
this->maxMagazines_ = 10;
- this->magazines_ = 10;
+ this->unassignedMagazines_ = 10;
- this->bUseSeparateMagazines_ = false;
- this->bStackMunition_ = true;
+ this->deployment_ = MunitionDeployment::Stack;
this->bAllowMunitionRefilling_ = true;
this->bAllowMultiMunitionRemovementUnderflow_ = true;
- this->reloadTime_ = 0;
+ this->reloadTime_ = 0.5f;
+
+ this->lastFilledWeaponMode_ = NULL;
}
Munition::~Munition()
{
- for (std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+ for (std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
delete it->second;
}
+ void Munition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(Munition, XMLPort, xmlelement, mode);
+
+ XMLPortParam(Munition, "initialmagazines", setNumMagazines, getNumMagazines, xmlelement, mode);
+ XMLPortParam(Munition, "maxmagazines", setMaxMagazines, getMaxMagazines, xmlelement, mode);
+ XMLPortParam(Munition, "munitionpermagazine", setMaxMunitionPerMagazine, getMaxMunitionPerMagazine, xmlelement, mode);
+ }
+
Munition::Magazine* Munition::getMagazine(WeaponMode* user) const
{
- if (this->bUseSeparateMagazines_)
+ if (deployment_ == MunitionDeployment::Separate)
{
// For separated magazines we definitively need a given user
if (!user)
return 0;
// Use the map to get the magazine assigned to the given user
- std::map<WeaponMode*, Magazine*>::const_iterator it = this->currentMagazines_.find(user);
- if (it != this->currentMagazines_.end())
+ std::map<WeaponMode*, Magazine*>::const_iterator it = this->assignedMagazines_.find(user);
+ if (it != this->assignedMagazines_.end())
return it->second;
}
else
{
// We don't use separate magazines for each user, so just take the first magazine
- if (this->currentMagazines_.size() > 0)
- return this->currentMagazines_.begin()->second;
+ if (this->assignedMagazines_.size() > 0)
+ return this->assignedMagazines_.begin()->second;
}
return 0;
@@ -86,9 +97,9 @@
Magazine* magazine = this->getMagazine(user);
if (magazine)
{
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
// With stacked munition every magazine contributes to the total amount
- return this->maxMunitionPerMagazine_ * this->magazines_ + magazine->munition_;
+ return this->maxMunitionPerMagazine_ * this->unassignedMagazines_ + magazine->munition_;
else
// Wihtout stacked munition we just consider the current magazine
return magazine->munition_;
@@ -108,20 +119,25 @@
unsigned int Munition::getNumMagazines() const
{
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
{
// If we stack munition and the current magazine is still full, it counts too
Magazine* magazine = this->getMagazine(0);
if (magazine && magazine->munition_ == this->maxMunitionPerMagazine_)
- return this->magazines_ + 1;
+ return this->unassignedMagazines_ + 1;
}
- return this->magazines_;
+ return this->unassignedMagazines_;
}
+ void Munition::setNumMagazines(unsigned int numMagazines)
+ {
+ this->unassignedMagazines_ = numMagazines;
+ }
+
unsigned int Munition::getMaxMunition() const
{
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
return this->maxMunitionPerMagazine_ * this->maxMagazines_;
else
return this->maxMunitionPerMagazine_;
@@ -134,19 +150,28 @@
{
unsigned int munition = magazine->munition_;
- // If we stack munition, we con't care about the current magazine - we just need enough munition in total
- if (this->bStackMunition_)
- munition += this->maxMunitionPerMagazine_ * this->magazines_;
+ // If we stack munition, we don't care about the current magazine - we just need enough munition in total
+ if (deployment_ == MunitionDeployment::Stack)
+ {
+ munition += this->maxMunitionPerMagazine_ * this->unassignedMagazines_;
+ }
if (munition == 0)
+ {
// Absolutely no munition - no chance to take munition
return false;
+ }
else if (this->bAllowMultiMunitionRemovementUnderflow_)
+ {
// We're not empty AND we allow underflow, so this will always work
return true;
+ }
else
+ {
// We don't allow underflow, so we have to check the amount
return (munition >= amount);
+ }
+
}
return false;
}
@@ -168,13 +193,13 @@
else
{
// Not enough munition
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
{
// We stack munition, so just take what we can and then load the next magazine
amount -= magazine->munition_;
magazine->munition_ = 0;
- if (this->reload(0))
+ if (this->reload(NULL))
// Successfully reloaded, continue recursively
return this->takeMunition(amount, 0);
else
@@ -198,7 +223,7 @@
bool Munition::canReload() const
{
// As long as we have enough magazines (and don't stack munition) we can reload
- return (this->magazines_ > 0 && !this->bStackMunition_);
+ return (this->unassignedMagazines_ > 0 && deployment_ != MunitionDeployment::Stack);
}
bool Munition::needReload(WeaponMode* user) const
@@ -206,7 +231,7 @@
Magazine* magazine = this->getMagazine(user);
if (magazine)
{
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
// With stacked munition, we never have to reload
return false;
else
@@ -226,28 +251,34 @@
return false;
// Check if we actually can reload
- if (this->magazines_ == 0)
+ if (this->unassignedMagazines_ == 0)
return false;
// If we use separate magazines for each user, we definitively need a user given
- if (this->bUseSeparateMagazines_ && !user)
+ if (deployment_ == MunitionDeployment::Separate && !user)
return false;
// If we don't use separate magazines, set user to 0
- if (!this->bUseSeparateMagazines_)
- user = 0;
+ if (deployment_ != MunitionDeployment::Separate)
+ {
+ user = NULL;
+ }
// Remove the current magazine for the given user
- std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.find(user);
- if (it != this->currentMagazines_.end())
+ std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.find(user);
+ if (it != this->assignedMagazines_.end())
{
+ if (it->first == lastFilledWeaponMode_)
+ {
+ lastFilledWeaponMode_ = NULL;
+ }
delete it->second;
- this->currentMagazines_.erase(it);
+ this->assignedMagazines_.erase(it);
}
// Load a new magazine
- this->currentMagazines_[user] = new Magazine(this, bUseReloadTime);
- this->magazines_--;
+ this->assignedMagazines_[user] = new Magazine(this, bUseReloadTime);
+ this->unassignedMagazines_--;
return true;
}
@@ -259,7 +290,7 @@
if (!this->bAllowMunitionRefilling_)
return false;
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
{
// If we stack munition, we can always add munition until we reach the limit
return (this->getNumMunition(0) < this->getMaxMunition());
@@ -267,7 +298,7 @@
else
{
// Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
- for (std::map<WeaponMode*, Magazine*>::const_iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+ for (std::map<WeaponMode*, Magazine*>::const_iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
if (it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
return true;
}
@@ -280,10 +311,10 @@
if (!this->canAddMunition(amount))
return false;
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
{
// Stacking munition means, if a magazine gets full, the munition adds to a new magazine
- Magazine* magazine = this->getMagazine(0);
+ Magazine* magazine = this->getMagazine(NULL);
if (magazine)
{
// Add the whole amount
@@ -293,13 +324,13 @@
while (magazine->munition_ > this->maxMunitionPerMagazine_)
{
magazine->munition_ -= this->maxMunitionPerMagazine_;
- this->magazines_++;
+ this->unassignedMagazines_++;
}
- // If we reached the limit, reduze both magazines and munition to the maximum
- if (this->magazines_ >= this->maxMagazines_)
+ // If we reached the limit, reduce both magazines and munition to the maximum
+ if (this->unassignedMagazines_ >= this->maxMagazines_)
{
- this->magazines_ = this->maxMagazines_ - 1;
+ this->unassignedMagazines_ = this->maxMagazines_;
magazine->munition_ = this->maxMunitionPerMagazine_;
}
@@ -311,24 +342,48 @@
}
else
{
+ std::map<WeaponMode*, Magazine*>::iterator it;
+
+ // If the pointer to the weapon mode whose magazine got munition added to is NULL, then set the iterator to the beginning of the map
+ // Otherwise set it to the next weapon mode
+ if (lastFilledWeaponMode_ == NULL)
+ {
+ it = this->assignedMagazines_.begin();
+ }
+ else
+ {
+ it = this->assignedMagazines_.find(lastFilledWeaponMode_);
+ ++ it;
+ }
+
// Share the munition equally to the current magazines
+ bool firstLoop = true;
while (amount > 0)
{
bool change = false;
- for (std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+ while (it != this->assignedMagazines_.end())
{
// Add munition if the magazine isn't full (but only to loaded magazines)
if (amount > 0 && it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
{
it->second->munition_++;
amount--;
+ lastFilledWeaponMode_ = it->first;
change = true;
}
+
+ ++it;
}
// If there was no change in a loop, all magazines are full (or locked due to loading)
- if (!change)
+ // Because the first loop does not start at the beginning of the map we have to treat is separately
+ if (!change && !firstLoop)
+ {
break;
+ }
+
+ it = this->assignedMagazines_.begin();
+ firstLoop = false;
}
return true;
@@ -339,36 +394,40 @@
{
// TODO: 'amount' is not used
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
// If we stack munition, we can always add new magazines because they contribute directly to the munition
return (this->getNumMunition(0) < this->getMaxMunition());
else
// If we don't stack munition, we're more limited
- return ((this->currentMagazines_.size() + this->magazines_) < this->maxMagazines_);
+ return ((this->assignedMagazines_.size() + this->unassignedMagazines_) < this->maxMagazines_);
}
- bool Munition::addMagazines(unsigned int amount)
+ unsigned int Munition::addMagazines(unsigned int amount)
{
+ unsigned int addedMagazines = 0;
+
if (!this->canAddMagazines(amount))
- return false;
+ return 0;
// Calculate how many magazines are needed
- int needed_magazines = this->maxMagazines_ - this->magazines_ - this->currentMagazines_.size();
+ int needed_magazines = this->maxMagazines_ - this->unassignedMagazines_ - this->assignedMagazines_.size();
// If zero or less magazines are needed, we definitively don't need more magazines (unless we stack munition - then a magazine contributes directly to the munition)
- if (needed_magazines <= 0 && !this->bStackMunition_)
- return false;
+ if (needed_magazines <= 0 && deployment_ != MunitionDeployment::Stack)
+ return 0;
if (amount <= static_cast<unsigned int>(needed_magazines))
{
// We need more magazines than we get, so just add them
- this->magazines_ += amount;
+ this->unassignedMagazines_ += amount;
+ addedMagazines = amount;
}
else
{
// We get more magazines than we need, so just add the needed amount
- this->magazines_ += needed_magazines;
- if (this->bStackMunition_)
+ this->unassignedMagazines_ += needed_magazines;
+ addedMagazines = needed_magazines;
+ if (deployment_ == MunitionDeployment::Stack)
{
// We stack munition, so the additional amount contributes directly to the munition of the current magazine
Magazine* magazine = this->getMagazine(0);
@@ -377,19 +436,33 @@
}
}
- return true;
+ // Reload as many empty magazines as possible
+ // Double loop and break is needed because the reload function changes the assigned magazines. This may confuse the iterator.
+ for (unsigned int i = 0; i < addedMagazines; ++i)
+ {
+ for (std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
+ {
+ if (needReload(it->first))
+ {
+ reload(it->first);
+ break;
+ }
+ }
+ }
+
+ return addedMagazines;
}
bool Munition::canRemoveMagazines(unsigned int amount) const
{
- if (this->bStackMunition_)
+ if (deployment_ == MunitionDeployment::Stack)
{
- if (this->magazines_ >= amount)
+ if (this->unassignedMagazines_ >= amount)
{
// We have enough magazines
return true;
}
- else if (this->magazines_ == amount - 1)
+ else if (this->unassignedMagazines_ == amount - 1)
{
// We lack one magazine, check if the current magazine is still full, if yes we're fine
Magazine* magazine = this->getMagazine(0);
@@ -405,7 +478,7 @@
else
{
// In case we're not stacking munition, just check the number of magazines
- return (this->magazines_ >= amount);
+ return (this->unassignedMagazines_ >= amount);
}
return false;
@@ -416,15 +489,15 @@
if (!this->canRemoveMagazines(amount))
return false;
- if (this->magazines_ >= amount)
+ if (this->unassignedMagazines_ >= amount)
{
// We have enough magazines, just remove the amount
- this->magazines_ -= amount;
+ this->unassignedMagazines_ -= amount;
}
- else if (this->bStackMunition_)
+ else if (deployment_ == MunitionDeployment::Stack)
{
// We don't have enough magazines, but we're stacking munition, so additionally remove the bullets from the current magazine
- this->magazines_ = 0;
+ this->unassignedMagazines_ = 0;
Magazine* magazine = this->getMagazine(0);
if (magazine)
magazine->munition_ = 0;
@@ -436,19 +509,23 @@
bool Munition::dropMagazine(WeaponMode* user)
{
// If we use separate magazines, we need a user
- if (this->bUseSeparateMagazines_ && !user)
+ if (deployment_ == MunitionDeployment::Separate && !user)
return false;
// If we don't use separate magazines, set user to 0
- if (!this->bUseSeparateMagazines_)
- user = 0;
+ if (deployment_ != MunitionDeployment::Separate)
+ user = NULL;
// Remove the current magazine for the given user
- std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.find(user);
- if (it != this->currentMagazines_.end())
+ std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.find(user);
+ if (it != this->assignedMagazines_.end())
{
+ if (it->first == lastFilledWeaponMode_)
+ {
+ lastFilledWeaponMode_ = NULL;
+ }
delete it->second;
- this->currentMagazines_.erase(it);
+ this->assignedMagazines_.erase(it);
return true;
}
@@ -464,7 +541,7 @@
this->munition_ = 0;
this->bLoaded_ = false;
- if (bUseReloadTime && munition->reloadTime_ > 0 && !munition->bStackMunition_)
+ if (bUseReloadTime && munition->reloadTime_ > 0 && munition->deployment_ != MunitionDeployment::Stack)
{
const ExecutorPtr& executor = createExecutor(createFunctor(&Magazine::loaded, this));
executor->setDefaultValues(munition);
@@ -480,4 +557,4 @@
this->bLoaded_ = true;
this->munition_ = munition->maxMunitionPerMagazine_;
}
-}
+}
\ No newline at end of file
Modified: code/trunk/src/orxonox/weaponsystem/Munition.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Munition.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/Munition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -23,7 +23,7 @@
* Martin Polak
* Fabian 'x3n' Landau
* Co-authors:
- * ...
+ * Fabien Vultier
*
*/
@@ -38,8 +38,18 @@
namespace orxonox
{
+ namespace MunitionDeployment
+ {
+ enum Value
+ {
+ Separate, // Every comsuming weapon mode has its own magazine. It is possible that one weapon mode is out of ammo while another still has some.
+ Share, // All comsuming weapon modes take their munition from the same magazine. If this magazine is empty a new one is loaded.
+ Stack // There is only one magazine where all the munition is stored. Use this deployment mode for heavy weapons loke rockets, bombs, ...
+ };
+ }
+
class _OrxonoxExport Munition : public BaseObject
- {
+ {
struct Magazine
{
public:
@@ -58,6 +68,8 @@
Munition(Context* context);
virtual ~Munition();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
unsigned int getNumMunition(WeaponMode* user) const;
unsigned int getNumMunitionInCurrentMagazine(WeaponMode* user) const;
unsigned int getNumMagazines() const;
@@ -67,7 +79,10 @@
{ return this->maxMagazines_; }
inline unsigned int getMaxMunitionPerMagazine() const
{ return this->maxMunitionPerMagazine_; }
+ inline MunitionDeployment::Value getMunitionDeployment() const
+ { return deployment_; }
+
bool canTakeMunition(unsigned int amount, WeaponMode* user) const;
bool takeMunition(unsigned int amount, WeaponMode* user);
@@ -81,7 +96,12 @@
bool addMunition(unsigned int amount);
bool canAddMagazines(unsigned int amount) const;
- bool addMagazines(unsigned int amount);
+ /**
+ @brief Try to add magazines.
+ @param amount The amount of magazines tried to add.
+ @return The amount of magazines sucessfully added.
+ */
+ unsigned int addMagazines(unsigned int amount);
bool canRemoveMagazines(unsigned int amount) const;
bool removeMagazines(unsigned int amount);
@@ -91,18 +111,24 @@
protected:
unsigned int maxMunitionPerMagazine_;
unsigned int maxMagazines_;
- unsigned int magazines_;
- std::map<WeaponMode*, Magazine*> currentMagazines_;
+ unsigned int unassignedMagazines_; // Number of magazines that are not assigned to a weapon mode. These are alway treated as full.
+ std::map<WeaponMode*, Magazine*> assignedMagazines_; // Maps weapon modes to magazines that are currently used.
- bool bUseSeparateMagazines_;
- bool bStackMunition_;
+ MunitionDeployment::Value deployment_; // Defines the behaviour how munition and magazines are distributed to the consuming weapon modes.
+
bool bAllowMunitionRefilling_;
bool bAllowMultiMunitionRemovementUnderflow_;
- float reloadTime_;
+ float reloadTime_; // The time needed to replace a magazine by a new one.
+ WeaponMode* lastFilledWeaponMode_; // Pointer to the weapon mode that got the last munition during the last call of addMunition.
private:
Magazine* getMagazine(WeaponMode* user) const;
+ inline void setMaxMagazines(unsigned int maxMagazines)
+ { this->maxMagazines_ = maxMagazines; }
+ inline void setMaxMunitionPerMagazine(unsigned int maxMunitionPerMagazine)
+ { this->maxMunitionPerMagazine_ = maxMunitionPerMagazine; }
+ void setNumMagazines(unsigned int numMagazines);
};
}
Copied: code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/weaponsystem/ReplenishingMunition.cc)
===================================================================
--- code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.cc (rev 0)
+++ code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,92 @@
+/*
+ * 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 ReplenishingMunition.h
+ @brief Implementation of the ReplenishingMunition class.
+*/
+
+#include "ReplenishingMunition.h"
+
+#include "core/CoreIncludes.h"
+#include "core/command/Executor.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+ RegisterClass(ReplenishingMunition);
+
+ ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context)
+ {
+ RegisterObject(ReplenishingMunition);
+
+ this->replenishInterval_ = 1.0f;
+ this->replenishAmount_ = 1;
+
+ // Use the timer to initialize itself after the first tick (because the real values for
+ // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
+ // inheriting class, which comes after this constructor)
+ this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this)));
+ }
+
+ void ReplenishingMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(ReplenishingMunition, XMLPort, xmlelement, mode);
+
+ XMLPortParam(ReplenishingMunition, "replenishamount", setReplenishAmount, getReplenishAmount, xmlelement, mode);
+ XMLPortParam(ReplenishingMunition, "replenishinterval", setReplenishInterval, getReplenishInterval, xmlelement, mode);
+ }
+
+ float ReplenishingMunition::getProgress()
+ {
+ return replenishingTimer_.getRemainingTime()/this->replenishInterval_;
+ }
+
+ void ReplenishingMunition::initializeTimer()
+ {
+ // Initialize the timer
+ this->replenishingTimer_.setTimer(this->replenishInterval_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this)));
+ }
+
+ void ReplenishingMunition::replenish()
+ {
+ if (this->canAddMagazines(this->replenishAmount_))
+ {
+ // Make a temporary copy of bAllowMunitionRefilling_, because this might be disallowed in every
+ // case except the internal munition replenishing
+ bool temp = this->bAllowMunitionRefilling_;
+ this->bAllowMunitionRefilling_ = true;
+
+ // Replenish munition
+ this->addMagazines(this->replenishAmount_);
+
+ // Write back the temporary value
+ this->bAllowMunitionRefilling_ = temp;
+ }
+ }
+}
Copied: code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h (from rev 11051, code/branches/presentationHS15/src/orxonox/weaponsystem/ReplenishingMunition.h)
===================================================================
--- code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h (rev 0)
+++ code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,81 @@
+/*
+ * 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 ReplenishingMunition.h
+ @brief Definition of the ReplenishingMunition class.
+*/
+
+#ifndef _ReplenishingMunition_H__
+#define _ReplenishingMunition_H__
+
+#include "tools/Timer.h"
+#include "Munition.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ Munition that is replenished by a certain amount each time interval.
+ @author
+ Fabian 'x3n' Landau
+ @ingroup WeaponsMunitions
+ */
+ class _OrxonoxExport ReplenishingMunition : public Munition
+ {
+ public:
+ ReplenishingMunition(Context* context);
+ virtual ~ReplenishingMunition() {}
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ virtual float getProgress();
+ inline unsigned int getReplenishAmount() const
+ { return replenishAmount_; }
+ inline float getReplenishInterval() const
+ { return replenishInterval_; }
+
+ protected:
+ float replenishInterval_; //!< The interval in which the munition is replenished.
+ unsigned int replenishAmount_; //!< The amount of magazines by which it is replenished.
+
+ private:
+ void replenish(); //!< Every call of this function replenishes the munition. This function is called by the timer.
+ void initializeTimer();
+
+ Timer replenishingTimer_; //!< Timer to do the replenishing.
+
+ inline void setReplenishAmount(unsigned int replenishAmount)
+ { this->replenishAmount_ = replenishAmount; }
+ inline void setReplenishInterval(float replenishInterval)
+ { this->replenishInterval_ = replenishInterval; }
+ };
+}
+
+#endif /* _ReplenishingMunition_H__ */
Modified: code/trunk/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Weapon.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/Weapon.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -133,6 +133,10 @@
}
}
+ /**
+ @brief
+ Reload all @ref orxonox::WeaponMode weapon modes of this weapon.
+ */
void Weapon::reload()
{
for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
@@ -150,4 +154,10 @@
for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
it->second->setWeapon(this);
}
+
+ void Weapon::updateMunition()
+ {
+ for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+ it->second->updateMunition();
+ }
}
Modified: code/trunk/src/orxonox/weaponsystem/Weapon.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Weapon.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/Weapon.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -56,6 +56,10 @@
void addWeaponmode(WeaponMode* weaponmode);
WeaponMode* getWeaponmode(unsigned int index) const;
+ inline std::multimap<unsigned int, WeaponMode*>* getAllWeaponmodes()
+ { return &weaponmodes_; }
+ inline int getNumWeaponModes() const
+ { return weaponmodes_.size(); }
/**
@brief
@@ -74,6 +78,7 @@
{ this->weaponSlot_ = wSlot; }
inline WeaponSlot * getWeaponSlot() const
{ return this->weaponSlot_; }
+ void updateMunition();
private:
void reloaded();
Modified: code/trunk/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -74,6 +74,8 @@
this->muzzlePosition_ = Vector3::ZERO;
this->muzzleOrientation_ = Quaternion::IDENTITY;
+ hudImageString_ = "Orxonox/WSHUD_WM_Unknown";
+
if( GameMode::isMaster() )
{
this->defSndWpnFire_ = new WorldSound(this->getContext());
@@ -124,7 +126,8 @@
this->getWeapon()->attach(this->defSndWpnFire_);
this->bSoundAttached_ = true;
}
-
+
+ // Fireing is only possible if this weapon mode is not reloading and there is enough munition
if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
{
float tempReloadtime = this->reloadTime_;
@@ -133,13 +136,21 @@
{
if (this->munition_->reload(this))
{
+ // If true, the weapon reloads in parallel to the magazine reloading
if (this->bParallelReload_)
+ {
+ // The time needed to reload is the maximum of the reload time of the weapon mode and the magazine.
tempReloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime());
+ }
else
+ {
+ // The time needed to reload is the sum of the reload time of the weapon mode and the magazine.
tempReloadtime = this->reloadTime_ + this->munition_->getReloadTime();
+ }
}
}
+ // Mark this weapon mode as reloading and start the reload timer
this->bReloading_ = true;
this->reloadTimer_.setInterval(tempReloadtime);
this->reloadTimer_.startTimer();
@@ -231,7 +242,9 @@
}
}
else
- this->munition_ = 0;
+ {
+ this->munition_ = NULL;
+ }
}
void WeaponMode::reloaded()
@@ -282,8 +295,10 @@
return BLANKSTRING;
}
- void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume){
- if (this->defSndWpnFire_) {
+ void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume)
+ {
+ if (this->defSndWpnFire_)
+ {
this->defSndWpnFire_->setSource(soundPath);
this->defSndWpnFire_->setVolume(soundVolume);
}
Modified: code/trunk/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -37,6 +37,7 @@
#include "core/BaseObject.h"
#include "core/class/SubclassIdentifier.h"
#include "tools/Timer.h"
+#include "Munition.h"
namespace orxonox
{
@@ -103,6 +104,8 @@
{ this->bParallelReload_ = parallelreload; }
inline bool getParallelReload() const
{ return this->bParallelReload_; }
+ inline bool getReloading() const
+ { return this->bReloading_; }
// Fire
@@ -146,6 +149,10 @@
Vector3 getTarget();
+ inline const std::string& getHUDImageString() const
+ { return this->hudImageString_; }
+
+ void updateMunition();
protected:
virtual void fire() = 0;
@@ -154,16 +161,17 @@
unsigned int munitionPerShot_;
float reloadTime_;
- bool bAutoReload_;
- bool bParallelReload_;
+ bool bAutoReload_; // If true, the weapon reloads the magazine automatically.
+ bool bParallelReload_; // If true, the weapon reloads in parallel to the magazine reloading.
float damage_;
float healthdamage_;
float shielddamage_;
Vector3 muzzleOffset_;
- private:
- void updateMunition();
+ std::string hudImageString_;
+
+ private:
void reloaded();
Weapon* weapon_;
@@ -174,13 +182,13 @@
std::string munitionname_;
Timer reloadTimer_;
- bool bReloading_;
+ bool bReloading_; // If true, this weapon mode is marked as reloading.
Vector3 muzzlePosition_;
Quaternion muzzleOrientation_;
WorldSound* defSndWpnFire_;
- bool bSoundAttached_;
+ bool bSoundAttached_;
};
}
Modified: code/trunk/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponPack.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/WeaponPack.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -123,6 +123,11 @@
return 0;
}
+ std::vector<Weapon*>* WeaponPack::getAllWeapons()
+ {
+ return &weapons_;
+ }
+
void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link)
{
this->links_.insert(link);
@@ -155,4 +160,10 @@
for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
(*it)->setWeaponPack(this);
}
+
+ void WeaponPack::updateMunition()
+ {
+ for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+ (*it)->updateMunition();
+ }
}
Modified: code/trunk/src/orxonox/weaponsystem/WeaponPack.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponPack.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/WeaponPack.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -51,6 +51,7 @@
void addWeapon(Weapon * weapon);
void removeWeapon(Weapon * weapon);
Weapon * getWeapon(unsigned int index) const;
+ std::vector<Weapon*>* getAllWeapons();
inline size_t getNumWeapons() const
{ return this->weapons_.size(); }
@@ -64,6 +65,7 @@
{ this->weaponSystem_ = weaponSystem; this->notifyWeapons(); }
inline WeaponSystem * getWeaponSystem() const
{ return this->weaponSystem_; }
+ void updateMunition();
private:
void notifyWeapons();
Modified: code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -239,6 +239,11 @@
return 0;
}
+ std::vector<WeaponPack *> * WeaponSystem::getAllWeaponPacks()
+ {
+ return &weaponPacks_;
+ }
+
bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2)
{
if (!wSlot1 || !wSlot2)
@@ -309,15 +314,37 @@
{
return it->second;
}
- else if (identifier->getIdentifier()->isA(Class(Munition)))
+ else
{
- Munition* munition = identifier->fabricate(this->getContext());
- this->munitions_[identifier->getIdentifier()] = munition;
- return munition;
+ return NULL;
}
+ }
+
+ void WeaponSystem::addMunition(Munition* munition)
+ {
+ if (munition == NULL)
+ {
+ return;
+ }
+
+ SubclassIdentifier<Munition> identifier = munition->getIdentifier();
+
+ if (identifier)
+ {
+ this->munitions_[identifier] = munition;
+ updateMunition();
+ }
else
{
- return 0;
+ orxout(internal_warning) << "Adding munition failed. identifier == NULL " << endl;
}
}
-}
+
+ void WeaponSystem::updateMunition()
+ {
+ for (std::vector<WeaponPack*>::iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
+ {
+ (*it)->updateMunition();
+ }
+ }
+}
\ No newline at end of file
Modified: code/trunk/src/orxonox/weaponsystem/WeaponSystem.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSystem.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSystem.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -66,6 +66,7 @@
bool addWeaponPack(WeaponPack * wPack);
void removeWeaponPack(WeaponPack * wPack);
WeaponPack * getWeaponPack(unsigned int index) const;
+ std::vector<WeaponPack *> * getAllWeaponPacks();
// configure slots and firemodes
bool swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2);
@@ -75,6 +76,7 @@
void reload();
Munition * getMunition(SubclassIdentifier<Munition> * identifier);
+ void addMunition(Munition* munition);
inline void setPawn(Pawn * pawn)
{ this->pawn_ = pawn; }
@@ -94,6 +96,8 @@
static const unsigned int WEAPON_MODE_UNASSIGNED = static_cast<unsigned int>(-1);
private:
+ void updateMunition();
+
std::map<unsigned int, WeaponSet *> weaponSets_;
std::vector<WeaponSlot *> weaponSlots_;
std::vector<WeaponPack *> weaponPacks_;
Copied: code/trunk/src/orxonox/worldentities/Actionpoint.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/worldentities/Actionpoint.cc)
===================================================================
--- code/trunk/src/orxonox/worldentities/Actionpoint.cc (rev 0)
+++ code/trunk/src/orxonox/worldentities/Actionpoint.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,85 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "Actionpoint.h"
+
+namespace orxonox
+{
+ RegisterClass(Actionpoint);
+
+ Actionpoint::Actionpoint(Context* context) : StaticEntity(context)
+ {
+ RegisterObject(Actionpoint);
+
+ this->actionName_ = "";
+ this->name_ = "";
+
+ this->bLoopStart_ = false;
+ this->bLoopEnd_ = false;
+ this->bProtectMe_ = false;
+ }
+
+ void Actionpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(Actionpoint, XMLPort, xmlelement, mode);
+
+ XMLPortParam(Actionpoint, "action", setActionXML, getActionXML, xmlelement, mode);
+ XMLPortParam(Actionpoint, "protect", setProtectXML, getProtectXML, xmlelement, mode);
+ XMLPortParam(Actionpoint, "attack", setAttackXML, getAttackXML, xmlelement, mode);
+ XMLPortParam(Actionpoint, "protectMe", setProtectMeXML, getProtectMeXML, xmlelement, mode).defaultValues(false);
+ XMLPortParam(Actionpoint, "loopStart", setLoopStart, getLoopStart, xmlelement, mode).defaultValues(false);
+ XMLPortParam(Actionpoint, "loopEnd", setLoopEnd, getLoopEnd, xmlelement, mode).defaultValues(false);
+ }
+ /**
+ @brief
+ action is ATTACK -> returns name of object to attack
+ action is PROTECT -> returns name of object to protect
+ if asked to protect human, returns a special string.
+ @return
+ name of an object to interact with.
+ @note
+ never use more than one of following arguments for XMLPort:
+ attack, protect, protectMe or
+ loopStart and loopEnd.
+ */
+ std::string Actionpoint::getName() const
+ {
+ if (this->name_ != "")
+ {
+ return this->name_;
+ }
+ else if (this->bProtectMe_)
+ {
+ return "reservedKeyword:human";
+ }
+ else
+ {
+ return "";
+ }
+ }
+}
Copied: code/trunk/src/orxonox/worldentities/Actionpoint.h (from rev 11051, code/branches/presentationHS15/src/orxonox/worldentities/Actionpoint.h)
===================================================================
--- code/trunk/src/orxonox/worldentities/Actionpoint.h (rev 0)
+++ code/trunk/src/orxonox/worldentities/Actionpoint.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,156 @@
+/*
+ * 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:
+ * Gani Aliguzhinov
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _Actionpoint_H__
+#define _Actionpoint_H__
+
+#include <string> //need string for XML input
+
+#include "core/XMLPort.h" //need XMLPort
+#include "worldentities/StaticEntity.h" //this is a child of StaticEntity
+
+namespace orxonox
+{
+ /**
+ @brief
+ Actionpoints are used by ActionpointController and all derived classes.
+ Such classes will execute actions set in Actionpoints.
+
+ In XML file one can pass an array of Actionpoints to a controller. Each
+ Actionpoint can take action type, string and boolean or
+ action and two booleans as an argument.
+ If action is set to fly, Actionpoint's position is assumed to be the desired
+ location.
+ Example XML code:
+
+ <SpaceShip position="-2000, 1500, -1000" lookat="0,0,0" team=0 name="thisShipName">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="WALL">
+ <actionpoints>
+ <Actionpoint position="0,0,0" action="FLY" />
+ <Actionpoint position="-1000,750,-500" action="ATTACK" attack="someShipName" />
+ <Actionpoint position="-1000,750,-500" action="PROTECT" protectMe=true />
+ <Actionpoint position="-1000,750,-500" action="PROTECT" protect="otherShipName" />
+ <Actionpoint position="-1000,750,-500" action="FIGHTALL" />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ Example with loops:
+
+ <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="thisShipName">
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <DivisionController team=0 formationMode="finger4">
+ <actionpoints>
+ <Actionpoint position=" 0,2000,-600" action="FLY" loopStart=true/>
+ <Actionpoint position=" 0,2000,-700" action="FLY" />
+ <Actionpoint position="100,2000,-700" action="FLY" />
+ <Actionpoint position="100,2000,-600" action="FLY" loopEnd=true />
+ </actionpoints>
+ </DivisionController>
+ </controller>
+ </SpaceShip>
+
+ One can also use other Worldentities instead of Actionpoints just like Waypoints, but those points
+ will be included in loop.
+ For more information read descriptions of the methods.
+ */
+ class _OrxonoxExport Actionpoint : public StaticEntity
+ {
+ public:
+ Actionpoint(Context* context);
+ virtual ~Actionpoint() {}
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ /** @brief Decides what AI will do. @param val action to execute */
+ void setActionXML(std::string val)
+ { this->actionName_ = getUppercase (val); }
+ std::string getActionXML() const
+ { return this->actionName_; }
+
+ /** @brief Makes AI follow an entity. @param val name of entity to protect */
+ void setProtectXML(std::string val)
+ { this->name_ = val; }
+ std::string getProtectXML() const
+ { return this->name_; }
+
+ /** @brief Makes AI attack an entity. @param val name of entity to attack */
+ void setAttackXML(std::string val)
+ { this->name_ = val; }
+ std::string getAttackXML() const
+ { return this->name_; }
+
+ /** @brief Makes AI follow human player. @param c protect Human? */
+ void setProtectMeXML(bool c)
+ { this->bProtectMe_ = c; }
+ bool getProtectMeXML() const
+ { return this->bProtectMe_; }
+
+ /** @brief Starts a loop of Actionpoints. @param value start loop? */
+ void setLoopStart(bool value)
+ { this->bLoopStart_ = value; }
+ bool getLoopStart() const
+ { return this->bLoopStart_; }
+ /** @brief Ends a loop of Actionpoints. @param value end loop? */
+ void setLoopEnd (bool value)
+ { this->bLoopEnd_ = value; }
+ bool getLoopEnd() const
+ { return this->bLoopEnd_; }
+
+ std::string getName() const;
+
+ private:
+ std::string actionName_; //!< can be set to "FLY", "ATTACK",
+ //!< "PROTECT", "FIGHT", "FIGHTALL"
+ //!< or "NONE".
+
+ std::string name_; //!< name of the ship that is to be
+ //!< attacked or protected.
+
+ bool bLoopStart_; //!< if true, this and all following Actionpoints
+ //!< until the first Actionpoint with bLoopEnd_
+ //!< set to true are executed in a loop.
+
+ bool bLoopEnd_; //!< if true, this is the last element of
+ //!< a loop started by loopStart=true argument
+
+ bool bProtectMe_; //!< if player is to be protected,
+ //!< instead of passing name, one has
+ //!< to set protectMe to true.
+ };
+}
+
+#endif /* _Actionpoint_H__ */
Deleted: code/trunk/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,345 +0,0 @@
-/*
- * 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:
- * Benjamin de Capitani
- * Co-authors:
- * ...
- *
- */
-
-#include "BigExplosion.h"
-
-#include "util/Exception.h"
-#include "core/CoreIncludes.h"
-#include "core/GameMode.h"
-#include "core/command/Executor.h"
-#include "tools/ParticleInterface.h"
-#include "Scene.h"
-#include "graphics/ParticleSpawner.h"
-#include "graphics/Model.h"
-#include "MovableEntity.h"
-
-namespace orxonox
-{
- RegisterClass(BigExplosion);
-
- BigExplosion::BigExplosion(Context* context) : MobileEntity(context)
- {
- RegisterObject(BigExplosion);
-
- if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
- ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
-
- this->bStop_ = false;
- this->LOD_ = LODParticle::Normal;
-
- if ( GameMode::showsGraphics() )
- {
- try
- {
- this->init();
- }
- catch (const std::exception& ex)
- {
- orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
- this->initZero();
- }
- }
- else
- {
- this->initZero();
- }
-
- if (GameMode::isMaster())
- {
- this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
- }
-
- this->registerVariables();
- }
-
- void BigExplosion::init()
- {
- this->debrisEntity1_ = new MovableEntity(this->getContext());
- this->debrisEntity2_ = new MovableEntity(this->getContext());
- this->debrisEntity3_ = new MovableEntity(this->getContext());
- this->debrisEntity4_ = new MovableEntity(this->getContext());
-
- this->debrisEntity1_->setSyncMode(0);
- this->debrisEntity2_->setSyncMode(0);
- this->debrisEntity3_->setSyncMode(0);
- this->debrisEntity4_->setSyncMode(0);
-
- this->debris1_ = new Model(this->getContext());
- this->debris2_ = new Model(this->getContext());
- this->debris3_ = new Model(this->getContext());
- this->debris4_ = new Model(this->getContext());
-
- this->debris1_->setSyncMode(0);
- this->debris2_->setSyncMode(0);
- this->debris3_->setSyncMode(0);
- this->debris4_->setSyncMode(0);
-
- this->explosion_ = new StaticEntity(this->getContext());
- this->explosion_->setSyncMode(0);
-
- this->debrisSmoke1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
- this->debrisSmoke2_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
- this->debrisSmoke3_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
- this->debrisSmoke4_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
-
- this->debrisFire1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
- this->debrisFire2_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
- this->debrisFire3_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
- this->debrisFire4_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
-
- this->debris1_->attachOgreObject(this->debrisSmoke1_->getParticleSystem());
- this->debris1_->attachOgreObject(this->debrisFire1_->getParticleSystem());
- this->debris2_->attachOgreObject(this->debrisSmoke2_->getParticleSystem());
- this->debris2_->attachOgreObject(this->debrisFire2_->getParticleSystem());
- this->debris3_->attachOgreObject(this->debrisSmoke3_->getParticleSystem());
- this->debris3_->attachOgreObject(this->debrisFire3_->getParticleSystem());
- this->debris4_->attachOgreObject(this->debrisSmoke4_->getParticleSystem());
- this->debris4_->attachOgreObject(this->debrisFire4_->getParticleSystem());
-
- this->debris1_->setMeshSource("CockpitDebris.mesh");
- this->debris2_->setMeshSource("WingDebris1.mesh");
- this->debris3_->setMeshSource("BodyDebris1.mesh");
- this->debris4_->setMeshSource("WingDebris2.mesh");
-
- this->debrisEntity1_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
- this->debrisEntity1_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- this->debrisEntity1_->setScale(4);
-
- this->debrisEntity2_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
- this->debrisEntity2_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- this->debrisEntity2_->setScale(4);
-
- this->debrisEntity3_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
- this->debrisEntity3_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- this->debrisEntity3_->setScale(4);
-
- this->debrisEntity4_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
- this->debrisEntity4_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- this->debrisEntity4_->setScale(4);
-
- this->debrisEntity1_->attach(debris1_);
- this->debrisEntity2_->attach(debris2_);
- this->debrisEntity3_->attach(debris3_);
- this->debrisEntity4_->attach(debris4_);
-
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setDestroyAfterLife(true);
- effect->setSource("Orxonox/explosion2b");
- effect->setLifetime(4.0f);
- effect->setSyncMode(0);
-
- ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
- effect2->setDestroyAfterLife(true);
- effect2->setSource("Orxonox/smoke6");
- effect2->setLifetime(4.0f);
- effect2->setSyncMode(0);
-
- this->explosion_->attach(effect);
- this->explosion_->attach(effect2);
-
- this->attach(explosion_);
- this->attach(debrisEntity1_);
- this->attach(debrisEntity2_);
- this->attach(debrisEntity3_);
- this->attach(debrisEntity4_);
-
-
- for(int i=0;i<10;i++)
- {
- Model* part1 = new Model(this->getContext());
- Model* part2 = new Model(this->getContext());
-
- MovableEntity* partEntity1 = new MovableEntity(this->getContext());
- MovableEntity* partEntity2 = new MovableEntity(this->getContext());
-
- part1->setSyncMode(0);
- part2->setSyncMode(0);
- partEntity1->setSyncMode(0);
- partEntity2->setSyncMode(0);
-
- partEntity1->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10,100));
- partEntity1->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- partEntity1->setScale(rnd(1, 3));
-
- partEntity2->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 100));
- partEntity2->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- partEntity2->setScale(rnd(1, 3));
-
- part1->setMeshSource("SmallPart1.mesh");
- part2->setMeshSource("SmallPart2.mesh");
-
- partEntity1->attach(part1);
- partEntity2->attach(part2);
-
- this->attach(partEntity1);
- this->attach(partEntity2);
- }
- }
-
- void BigExplosion::initZero()
- {
- this->debrisFire1_ = 0;
- this->debrisFire2_ = 0;
- this->debrisFire3_ = 0;
- this->debrisFire4_ = 0;
-
- this->debrisSmoke1_ = 0;
- this->debrisSmoke2_ = 0;
- this->debrisSmoke3_ = 0;
- this->debrisSmoke4_ = 0;
-
- this->explosionSmoke_=0;
- this->explosionFire_=0;
- }
-
- BigExplosion::~BigExplosion()
- {
- if (this->isInitialized())
- {
- if (this->debrisFire1_)
- {
- this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
- delete this->debrisFire1_;
- }
- if (this->debrisSmoke1_)
- {
- this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
- delete this->debrisSmoke1_;
- }
-
- if (this->debrisFire2_)
- {
- this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
- delete this->debrisFire2_;
- }
- if (this->debrisSmoke2_)
- {
- this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
- delete this->debrisSmoke2_;
- }
-
- if (this->debrisFire3_)
- {
- this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
- delete this->debrisFire3_;
- }
- if (this->debrisSmoke3_)
- {
- this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
- delete this->debrisSmoke3_;
- }
-
- if (this->debrisFire4_)
- {
- this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
- delete this->debrisFire4_;
- }
- if (this->debrisSmoke4_)
- {
- this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
- delete this->debrisSmoke4_;
- }
- }
- }
-
- void BigExplosion::registerVariables()
- {
- registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));
- registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));
- }
-
- void BigExplosion::LODchanged()
- {
- if (this->debrisFire1_)
- this->debrisFire1_->setDetailLevel(this->LOD_);
- if (this->debrisSmoke1_)
- this->debrisSmoke1_->setDetailLevel(this->LOD_);
-
- if (this->debrisFire2_)
- this->debrisFire2_->setDetailLevel(this->LOD_);
- if (this->debrisSmoke2_)
- this->debrisSmoke2_->setDetailLevel(this->LOD_);
-
- if (this->debrisFire3_)
- this->debrisFire3_->setDetailLevel(this->LOD_);
- if (this->debrisSmoke3_)
- this->debrisSmoke3_->setDetailLevel(this->LOD_);
-
- if (this->debrisFire4_)
- this->debrisFire4_->setDetailLevel(this->LOD_);
- if (this->debrisSmoke4_)
- this->debrisSmoke4_->setDetailLevel(this->LOD_);
- }
-
- void BigExplosion::checkStop()
- {
- if (this->bStop_)
- this->stop();
- }
-
- void BigExplosion::stop()
- {
- if (this->debrisFire1_)
- this->debrisFire1_->setEnabled(false);
- if (this->debrisSmoke1_)
- this->debrisSmoke1_->setEnabled(false);
-
- if (this->debrisFire2_)
- this->debrisFire2_->setEnabled(false);
- if (this->debrisSmoke2_)
- this->debrisSmoke2_->setEnabled(false);
-
- if (this->debrisFire3_)
- this->debrisFire3_->setEnabled(false);
- if (this->debrisSmoke3_)
- this->debrisSmoke3_->setEnabled(false);
-
- if (this->debrisFire4_)
- this->debrisFire4_->setEnabled(false);
- if (this->debrisSmoke4_)
- this->debrisSmoke4_->setEnabled(false);
-
- if (GameMode::isMaster())
- {
- this->bStop_ = true;
- this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
- }
- }
-
-/* TODO
-
- void BigExplosion::setDebrisMeshes()
- {
-
- }
- void BigExplosion::getDebrisMeshes()
- {
-
- }
-*/
-}
Deleted: code/trunk/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,94 +0,0 @@
-/*
- * 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:
- * Benjamin de Capitani
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _BigExplosion_H__
-#define _BigExplosion_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "tools/Timer.h"
-#include "MobileEntity.h"
-
-namespace orxonox
-{
- class _OrxonoxExport BigExplosion : public MobileEntity
- {
- public:
- BigExplosion(Context* context);
- virtual ~BigExplosion();
-
- inline void setLOD(LODParticle::Value level)
- { this->LOD_ = level; this->LODchanged(); }
- inline LODParticle::Value getLOD() const
- { return this->LOD_; }
-
- private:
- void registerVariables();
-
- void LODchanged();
- void checkStop();
- void stop();
- void init();
- void initZero();
-
-
- bool bStop_;
-
- StaticEntity* explosion_;
-
- MovableEntity* debrisEntity1_;
- MovableEntity* debrisEntity2_;
- MovableEntity* debrisEntity3_;
- MovableEntity* debrisEntity4_;
-
- Model* debris1_;
- Model* debris2_;
- Model* debris3_;
- Model* debris4_;
-
-
-
- ParticleInterface* debrisSmoke1_;
- ParticleInterface* debrisSmoke2_;
- ParticleInterface* debrisSmoke3_;
- ParticleInterface* debrisSmoke4_;
-
- ParticleInterface* debrisFire1_;
- ParticleInterface* debrisFire2_;
- ParticleInterface* debrisFire3_;
- ParticleInterface* debrisFire4_;
-
- ParticleInterface* explosionSmoke_;
- ParticleInterface* explosionFire_;
-
- LODParticle::Value LOD_;
- Timer destroyTimer_;
- };
-}
-
-#endif /* _BigExplosion_H__ */
Modified: code/trunk/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/worldentities/CMakeLists.txt 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/CMakeLists.txt 2016-01-09 17:26:20 UTC (rev 11052)
@@ -5,12 +5,13 @@
MobileEntity.cc
ControllableEntity.cc
Drone.cc
- BigExplosion.cc
EffectContainer.cc
ExplosionChunk.cc
CameraPosition.cc
SpawnPoint.cc
TeamSpawnPoint.cc
+ ExplosionPart.cc
+ Actionpoint.cc
)
ADD_SUBDIRECTORY(pawns)
Copied: code/trunk/src/orxonox/worldentities/ExplosionPart.cc (from rev 11051, code/branches/presentationHS15/src/orxonox/worldentities/ExplosionPart.cc)
===================================================================
--- code/trunk/src/orxonox/worldentities/ExplosionPart.cc (rev 0)
+++ code/trunk/src/orxonox/worldentities/ExplosionPart.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,260 @@
+/*
+ * 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:
+ * Vedat Aydin
+ * Co-authors:
+ * ...
+ *
+ */
+
+
+
+#include "ExplosionPart.h"
+#include "core/XMLPort.h"
+
+
+namespace orxonox
+{
+
+ RegisterClass(ExplosionPart);
+
+ ExplosionPart::ExplosionPart(Context* context) : MovableEntity(context)
+ {
+ RegisterObject(ExplosionPart);
+ this->bStop_ = false;
+ this->LOD_ = LODParticle::Normal;
+ this->mesh_ = "";
+ this->effect1_ = "";
+ this->effect2_ = "";
+ this->model_= new Model(this->getContext());
+ this->effect1Particle_= NULL;
+ this->effect2Particle_= NULL;
+ this->explosionEntity_ = new MovableEntity(this->getContext());
+ this->posOffset_ = Vector3::ZERO;
+
+
+
+ }
+
+
+ ExplosionPart::~ExplosionPart()
+ {
+ if (this->isInitialized())
+ {
+ if (this->effect1Particle_)
+ {
+ this->model_->detachOgreObject(this->effect1Particle_->getParticleSystem());
+ delete this->effect1Particle_;
+ }
+ if (this->effect2Particle_)
+ {
+ this->model_->detachOgreObject(this->effect2Particle_->getParticleSystem());
+ delete this->effect2Particle_;
+ }
+ }
+ }
+
+
+ void ExplosionPart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(ExplosionPart, XMLPort, xmlelement, mode);
+
+ XMLPortParam(ExplosionPart, "mesh", setMesh, getMesh, xmlelement, mode).defaultValues(""); //Define mesh file, that is going to fly out
+ XMLPortParam(ExplosionPart, "minspeed", setMinSpeed, getMinSpeed, xmlelement, mode).defaultValues(50); //Minimum velocity at which parts fly out
+ XMLPortParam(ExplosionPart, "maxspeed", setMaxSpeed, getMaxSpeed, xmlelement, mode).defaultValues(100); //Maximum velocity at which parts fly out, set both minspeed and maxspeed to 0 to have stationary effects
+ XMLPortParam(ExplosionPart, "effect1", setEffect1, getEffect1, xmlelement, mode).defaultValues(""); //particle effect 1
+ XMLPortParam(ExplosionPart, "effect2", setEffect2, getEffect2, xmlelement, mode).defaultValues(""); //particle effect 2
+ XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO); //Offset of the position if you need to have an explosion off-center
+ XMLPortParam(ExplosionPart, "direction", setDirection, getDirection, xmlelement, mode).defaultValues(Vector3(1,1,1)); //general direction the parts fly in
+ XMLPortParam(ExplosionPart, "angle", setAngle, getAngle, xmlelement, mode).defaultValues(180); //defines a cone shape with direction "direction" and angle "angle" inside which the parts fly out of
+ XMLPortParam(ExplosionPart, "delay", setDelay, getDelay, xmlelement, mode).defaultValues(0); //delay to the explosion in seconds
+ }
+
+
+ void ExplosionPart::Explode()
+ {
+ this->destroyTimer_.setTimer(delay_, false, createExecutor(createFunctor(&ExplosionPart::ActuallyExplode, this)));
+ }
+
+ void ExplosionPart::stop()
+ {
+ if (this->effect1Particle_)
+ this->effect1Particle_->setEnabled(false);
+ if (this->effect2Particle_)
+ this->effect2Particle_->setEnabled(false);
+ if (this->model_)
+ this->model_->setVisible(false);
+
+ if (GameMode::isMaster())
+ {
+ this->bStop_ = true;
+ this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionPart::destroy, this)));
+ }
+ }
+
+ void ExplosionPart::ActuallyExplode()
+ {
+ this->model_->setVisible(true);
+
+ //this->explosionEntity_->setSyncMode(0);
+
+ //this->model_->setSyncMode(0);
+
+
+ if(effect1_ != "")
+ {
+ this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_);
+ this->effect1Particle_->setDimensions(this->getScale());
+ this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem());
+ }
+
+ if(effect2_ != "")
+ {
+ this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_);
+ this->effect2Particle_->setDimensions(this->getScale());
+ this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem());
+ }
+
+
+
+
+ Vector3 velocityOffset = direction_.perpendicular();
+ velocityOffset.normalise();
+ Degree offsetDirection = Degree(rnd(0,360));
+ velocityOffset = Quaternion(offsetDirection, direction_.normalisedCopy()) * velocityOffset;
+ velocityOffset.normalise();
+ direction_.normalise();
+
+ Vector3 finalDirection = direction_ + sin((rnd(0, angle_))*math::pi/180)*velocityOffset;
+
+ this->explosionEntity_->setVelocity(finalDirection*rnd(minSpeed_,maxSpeed_));
+ this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+ this->explosionEntity_->setScale(this->getScale() * 4);
+
+
+ this->explosionEntity_->attach(model_);
+
+
+ this->attach(explosionEntity_);
+
+ if (GameMode::isMaster())
+ {
+ this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&ExplosionPart::stop, this)));
+ }
+ }
+
+
+
+
+ void ExplosionPart::setMesh(const std::string& newString)
+ {
+ if(newString != "")
+ {
+ this->mesh_ = newString;
+ this->model_->setMeshSource(mesh_);
+ this->model_->setVisible(false);
+ }
+ }
+
+ void ExplosionPart::setEffect1(const std::string& newString)
+ {
+ this->effect1_ = newString;
+ }
+
+ void ExplosionPart::setEffect2(const std::string& newString)
+ {
+ this->effect2_ = newString;
+ }
+
+ void ExplosionPart::setMinSpeed(float speed)
+ {
+ this->minSpeed_ = speed;
+ }
+
+ void ExplosionPart::setMaxSpeed(float speed)
+ {
+ this->maxSpeed_ = speed;
+ }
+
+ void ExplosionPart::setOffset(Vector3 newVector)
+ {
+ this->posOffset_ = newVector;
+ this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_ / this->getScale());
+ }
+
+ void ExplosionPart::setDirection(Vector3 newDirection)
+ {
+ this->direction_ = newDirection;
+ }
+
+ void ExplosionPart::setAngle(float newAngle)
+ {
+ this->angle_ = newAngle;
+ }
+
+ void ExplosionPart::setDelay(float newDelay)
+ {
+ this->delay_ = newDelay;
+ }
+
+ std::string& ExplosionPart::getMesh()
+ { return this->mesh_; }
+
+ std::string& ExplosionPart::getEffect1()
+ { return this->effect1_; }
+
+ std::string& ExplosionPart::getEffect2()
+ { return this->effect2_; }
+
+ float ExplosionPart::getMinSpeed()
+ {
+ return this->minSpeed_;
+ }
+
+ float ExplosionPart::getMaxSpeed()
+ {
+ return this->maxSpeed_;
+ }
+
+ Vector3 ExplosionPart::getOffset()
+ {
+ return this->posOffset_;
+ }
+
+ Vector3 ExplosionPart::getDirection()
+ {
+ return direction_;
+ }
+
+ float ExplosionPart::getAngle()
+ {
+ return angle_;
+ }
+
+ float ExplosionPart::getDelay()
+ {
+ return delay_;
+ }
+
+
+
+}
Copied: code/trunk/src/orxonox/worldentities/ExplosionPart.h (from rev 11051, code/branches/presentationHS15/src/orxonox/worldentities/ExplosionPart.h)
===================================================================
--- code/trunk/src/orxonox/worldentities/ExplosionPart.h (rev 0)
+++ code/trunk/src/orxonox/worldentities/ExplosionPart.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -0,0 +1,108 @@
+/*
+ * 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:
+ * Vedat Aydin
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _ExplosionPart_H__
+#define _ExplosionPart_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "graphics/Model.h"
+#include "tools/ParticleInterface.h"
+#include "MovableEntity.h"
+#include "graphics/ParticleSpawner.h"
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "util/Exception.h"
+#include "core/command/Executor.h"
+#include "Scene.h"
+#include "tools/Timer.h"
+
+
+ namespace orxonox
+{
+ class _OrxonoxExport ExplosionPart : public MovableEntity
+ {
+ public:
+ ExplosionPart(Context* context);
+ ~ExplosionPart();
+ void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ void Explode();
+ void stop();
+ void ActuallyExplode();
+
+ void setMesh(const std::string& newString);
+ std::string& getMesh();
+ void setEffect1(const std::string& newString);
+ std::string& getEffect1();
+ void setEffect2(const std::string& newString);
+ std::string& getEffect2();
+ void setMinSpeed(float speed);
+ float getMinSpeed();
+ void setMaxSpeed(float speed);
+ float getMaxSpeed();
+ void setOffset(Vector3 newVector);
+ Vector3 getOffset();
+ void setDirection(Vector3 newDirection);
+ Vector3 getDirection();
+ void setAngle(float newAgnle);
+ float getAngle();
+ void setDelay(float newDelay);
+ float getDelay();
+
+
+ private:
+
+ bool bStop_;
+ LODParticle::Value LOD_;
+
+
+ Model* model_;
+ ParticleInterface* effect1Particle_;
+ ParticleInterface* effect2Particle_;
+
+
+ float minSpeed_;
+ float maxSpeed_;
+ std::string mesh_;
+ std::string effect1_;
+ std::string effect2_;
+ Vector3 posOffset_;
+ Vector3 direction_;
+ float angle_;
+ float delay_;
+
+ MovableEntity* explosionEntity_;
+
+ Timer destroyTimer_;
+
+
+
+ };
+}
+
+#endif /* _ExplosionPart_H__ */
Modified: code/trunk/src/orxonox/worldentities/MobileEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/MobileEntity.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/MobileEntity.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -46,6 +46,8 @@
Every time the @see tick function is called the linear acceleration is multiplied by the time since the last call of tick and then added to the
linear velocity. Then the linear velocity is multiplied by the time since the last call of tick and then added to the position. The same happens with
the angular acceleration and velocity. With this procedure MobileEntities can change their position and orientation with time.
+
+ A MobileEntity can only have the collisition type WorldEntity::None, WorldEntity::Dynamic or WorldEntity::Kinematic. The collsion type WorldEntity::Static is illegal.
*/
class _OrxonoxExport MobileEntity : public WorldEntity, public Tickable
Modified: code/trunk/src/orxonox/worldentities/SpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/SpawnPoint.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/SpawnPoint.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -54,7 +54,7 @@
inline Template* getTemplate() const
{ return this->template_; }
- Pawn* spawn();
+ virtual Pawn* spawn();
void spawn(ControllableEntity* entity);
private:
Modified: code/trunk/src/orxonox/worldentities/StaticEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/StaticEntity.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/StaticEntity.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -43,6 +43,8 @@
In contrast to the MobileEntity the StaticEntity cannot move with respect to the parent to which it is attached. That's why
it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the
function @see setPosition to changee it.
+
+ A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal.
*/
class _OrxonoxExport StaticEntity : public WorldEntity
Modified: code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -48,4 +48,10 @@
XMLPortParam(TeamSpawnPoint, "team", setTeamNumber, getTeamNumber, xmlelement, mode).defaultValues(0);
}
+ Pawn* TeamSpawnPoint::spawn()
+ {
+ Pawn* entity = SpawnPoint::spawn();
+ static_cast<ControllableEntity*>(entity)->setTeam (this->teamNumber_);
+ return entity;
+ }
}
Modified: code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -48,9 +48,10 @@
{ this->teamNumber_ = team; }
unsigned int getTeamNumber() const
{ return this->teamNumber_; }
+ virtual Pawn* spawn();
private:
- unsigned int teamNumber_;
+ int teamNumber_;
};
}
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -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"
@@ -40,11 +41,12 @@
#include "gametypes/Gametype.h"
#include "graphics/ParticleSpawner.h"
#include "worldentities/ExplosionChunk.h"
-#include "worldentities/BigExplosion.h"
+#include "worldentities/ExplosionPart.h"
#include "weaponsystem/WeaponSystem.h"
#include "weaponsystem/WeaponSlot.h"
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSet.h"
+#include "weaponsystem/Munition.h"
#include "sound/WorldSound.h"
#include "controllers/FormationController.h"
@@ -60,7 +62,7 @@
RegisterObject(Pawn);
this->bAlive_ = true;
- this->bReload_ = false;
+ this->bVulnerable_ = true;
this->health_ = 0;
this->maxHealth_ = 0;
@@ -70,11 +72,10 @@
this->initialShieldHealth_ = 0;
this->maxShieldHealth_ = 100; //otherwise shield might increase to float_max
this->shieldAbsorption_ = 0.5;
+ this->shieldRechargeRate_ = 0;
+ this->shieldRechargeWaitTime_ = 1.0f;
+ this->shieldRechargeWaitCountdown_ = 0;
- this->reloadRate_ = 0;
- this->reloadWaitTime_ = 1.0f;
- this->reloadWaitCountdown_ = 0;
-
this->lastHitOriginator_ = 0;
// set damage multiplier to default value 1, meaning nominal damage
@@ -84,6 +85,8 @@
this->aimPosition_ = Vector3::ZERO;
+ //this->explosionPartList_ = NULL;
+
if (GameMode::isMaster())
{
this->weaponSystem_ = new WeaponSystem(this->getContext());
@@ -134,49 +137,59 @@
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(7);
+ XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(0);
XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
- XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode);
+ XMLPortObject(Pawn, WeaponPack, "weaponpacks", addWeaponPackXML, getWeaponPack, xmlelement, mode);
+ XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode);
- XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
- XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
+ 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);
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);
- registerVariable(this->health_, VariableDirection::ToClient);
- registerVariable(this->maxHealth_, VariableDirection::ToClient);
- registerVariable(this->shieldHealth_, VariableDirection::ToClient);
- registerVariable(this->maxShieldHealth_, VariableDirection::ToClient);
- registerVariable(this->shieldAbsorption_, VariableDirection::ToClient);
- registerVariable(this->bReload_, VariableDirection::ToServer);
- registerVariable(this->aimPosition_, VariableDirection::ToServer); // For the moment this variable gets only transfered to the server
+ registerVariable(this->bAlive_, VariableDirection::ToClient);
+ registerVariable(this->health_, VariableDirection::ToClient);
+ registerVariable(this->maxHealth_, VariableDirection::ToClient);
+ registerVariable(this->shieldHealth_, VariableDirection::ToClient);
+ registerVariable(this->maxShieldHealth_, VariableDirection::ToClient);
+ registerVariable(this->shieldAbsorption_, VariableDirection::ToClient);
+ registerVariable(this->aimPosition_, VariableDirection::ToServer); // For the moment this variable gets only transfered to the server
}
void Pawn::tick(float dt)
{
+ //BigExplosion* chunk = new BigExplosion(this->getContext());
SUPER(Pawn, tick, dt);
- this->bReload_ = false;
-
+ // Recharge the shield
// TODO: use the existing timer functions instead
- if(this->reloadWaitCountdown_ > 0)
+ if(this->shieldRechargeWaitCountdown_ > 0)
{
- this->decreaseReloadCountdownTime(dt);
+ this->decreaseShieldRechargeCountdownTime(dt);
}
else
{
- this->addShieldHealth(this->getReloadRate() * dt);
- this->resetReloadCountdown();
+ this->addShieldHealth(this->getShieldRechargeRate() * dt);
+ this->resetShieldRechargeCountdown();
}
if (GameMode::isMaster())
@@ -228,29 +241,44 @@
this->maxShieldHealth_ = maxshieldhealth;
}
- void Pawn::setReloadRate(float reloadrate)
+ void Pawn::setShieldRechargeRate(float shieldRechargeRate)
{
- this->reloadRate_ = reloadrate;
+ this->shieldRechargeRate_ = shieldRechargeRate;
}
- void Pawn::setReloadWaitTime(float reloadwaittime)
+ void Pawn::setShieldRechargeWaitTime(float shieldRechargeWaitTime)
{
- this->reloadWaitTime_ = reloadwaittime;
+ this->shieldRechargeWaitTime_ = shieldRechargeWaitTime;
}
- void Pawn::decreaseReloadCountdownTime(float dt)
+ void Pawn::decreaseShieldRechargeCountdownTime(float dt)
{
- this->reloadWaitCountdown_ -= dt;
+ 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();
if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
{
+ // Health-damage cannot be absorbed by shields.
+ // Shield-damage only reduces shield health.
+ // Normal damage can be (partially) absorbed by shields.
+
if (shielddamage >= this->getShieldHealth())
{
this->setShieldHealth(0);
@@ -365,125 +393,46 @@
}
if (GameMode::isMaster())
{
- this->deatheffect();
this->goWithStyle();
}
}
}
void Pawn::goWithStyle()
{
+
this->bAlive_ = false;
this->setDestroyWhenPlayerLeft(false);
- BigExplosion* chunk = new BigExplosion(this->getContext());
- chunk->setPosition(this->getPosition());
- chunk->setVelocity(this->getVelocity());
-
- this->explosionSound_->setPosition(this->getPosition());
- this->explosionSound_->play();
- }
- void Pawn::deatheffect()
- {
- // play death effect
- /*{
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("Orxonox/explosion2b");
- effect->setLifetime(4.0f);
- }
+ while(!explosionPartList_.empty())
{
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("Orxonox/smoke6");
- effect->setLifetime(4.0f);
+ explosionPartList_.back()->setPosition(this->getPosition());
+ explosionPartList_.back()->setVelocity(this->getVelocity());
+ explosionPartList_.back()->setOrientation(this->getOrientation());
+ explosionPartList_.back()->Explode();
+ explosionPartList_.pop_back();
}
- {
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("Orxonox/sparks");
- effect->setLifetime(4.0f);
- }*/
-
-
- {
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("orxonox/explosion_flash2");
- effect->setLifetime(5.0f);
- }
- {
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("orxonox/explosion_flame2");
- effect->setLifetime(5.0f);
- }
- {
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("orxonox/explosion_shockwave2");
- effect->scale(20);
- effect->setLifetime(5.0f);
- }{
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("orxonox/explosion_sparks2");
- effect->setLifetime(5.0f);
- }
- {
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("orxonox/explosion_streak2");
- effect->setLifetime(5.0f);
- }
- {
- ParticleSpawner* effect = new ParticleSpawner(this->getContext());
- effect->setPosition(this->getPosition());
- effect->setOrientation(this->getOrientation());
- effect->setDestroyAfterLife(true);
- effect->setSource("orxonox/explosion_afterglow");
- effect->scale(20);
- effect->setLifetime(5.0f);
- }
-
-
+
for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
{
ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
chunk->setPosition(this->getPosition());
}
+
+ this->explosionSound_->setPosition(this->getPosition());
+ this->explosionSound_->play();
}
/**
@brief
Check whether the Pawn has a @ref Orxonox::WeaponSystem and fire it with the specified firemode if it has one.
*/
+
void Pawn::fired(unsigned int firemode)
{
if (this->weaponSystem_)
this->weaponSystem_->fire(firemode);
}
- void Pawn::reload()
- {
- this->bReload_ = true;
- }
-
void Pawn::postSpawn()
{
this->setHealth(this->initialHealth_);
@@ -491,6 +440,16 @@
this->spawneffect();
}
+
+ void Pawn::addExplosionPart(ExplosionPart* ePart)
+ {this->explosionPartList_.push_back(ePart);}
+
+
+ ExplosionPart * Pawn::getExplosionPart()
+ {return this->explosionPartList_.back();}
+
+
+
/* WeaponSystem:
* functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.
* with setWeaponPack you can not just load a Pack from XML but if a Pack already exists anywhere, you can attach it.
@@ -553,10 +512,41 @@
return 0;
}
+ std::vector<WeaponPack *> * Pawn::getAllWeaponPacks()
+ {
+ if (this->weaponSystem_)
+ return this->weaponSystem_->getAllWeaponPacks();
+ else
+ return 0;
+ }
+
+ void Pawn::addMunitionXML(Munition* munition)
+ {
+ if (this->weaponSystem_ && munition)
+ {
+ this->weaponSystem_->addMunition(munition);
+ }
+ }
+
+ Munition* Pawn::getMunitionXML() const
+ {
+ return NULL;
+ }
+
+ Munition* Pawn::getMunition(SubclassIdentifier<Munition> * identifier)
+ {
+ if (weaponSystem_)
+ {
+ return weaponSystem_->getMunition(identifier);
+ }
+
+ return NULL;
+ }
+
//Tell the Map (RadarViewable), if this is a playership
void Pawn::startLocalHumanControl()
{
-// SUPER(ControllableEntity, changedPlayer());
+// SUPER(ControllableEntity, startLocalHumanControl());
ControllableEntity::startLocalHumanControl();
this->isHumanShip_ = true;
}
@@ -613,4 +603,4 @@
assert(0);
return BLANKSTRING;
}
-}
+}
\ No newline at end of file
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -32,20 +32,22 @@
#include "OrxonoxPrereqs.h"
#include <string>
+#include <vector>
#include "interfaces/PickupCarrier.h"
#include "interfaces/RadarViewable.h"
#include "worldentities/ControllableEntity.h"
+#include "worldentities/ExplosionPart.h"
namespace orxonox // tolua_export
{
/**
@brief
- Everything in Orxonoy that has a health attribute is a Pawn. After a Pawn is spawned its health is set to
+ Everything in Orxonox that has a health attribute is a Pawn. After a Pawn is spawned its health is set to
its initial health. In every call of the Pawns tick function the game checks whether the pawns health is at
or below zero. If it is, the pawn gets killed.
- Pawns can carry pickups and fire weapons. The can also have shields.
+ Pawns can carry pickups and fire weapons. They can also have shields.
Notice that every Pawn is a ControllableEntity.
*/
@@ -61,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
@@ -115,37 +118,50 @@
inline float getShieldAbsorption()
{ return this->shieldAbsorption_; }
- // TODO: Rename to shieldRechargeRate
- virtual void setReloadRate(float reloadrate);
- inline float getReloadRate() const
- { return this->reloadRate_; }
+ virtual void setShieldRechargeRate(float shieldRechargeRate);
+ inline float getShieldRechargeRate() const
+ { return this->shieldRechargeRate_; }
- virtual void setReloadWaitTime(float reloadwaittime);
- inline float getReloadWaitTime() const
- { return this->reloadWaitTime_; }
+ virtual void setShieldRechargeWaitTime(float shieldRechargeWaitTime);
+ inline float getShieldRechargeWaitTime() const
+ { return this->shieldRechargeWaitTime_; }
- inline void resetReloadCountdown()
- { this->reloadWaitCountdown_ = 0; }
+ inline void resetShieldRechargeCountdown()
+ { this->shieldRechargeWaitCountdown_ = 0; }
- inline void startReloadCountdown()
- { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } // TODO: Implement in Projectile.cc
+ inline void startShieldRechargeCountdown()
+ { this->shieldRechargeWaitCountdown_ = this->getShieldRechargeWaitTime(); } // TODO: Implement in Projectile.cc
- virtual void decreaseReloadCountdownTime(float dt);
+ 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_; }
- //virtual void hit(Pawn* originator, const Vector3& force, float damage);
- //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
virtual void kill();
virtual void fired(unsigned int firemode);
- virtual void reload();
virtual void postSpawn();
+ void addExplosionPart(ExplosionPart* ePart);
+ ExplosionPart * getExplosionPart();
+
void addWeaponSlot(WeaponSlot * wSlot);
WeaponSlot * getWeaponSlot(unsigned int index) const;
void addWeaponSet(WeaponSet * wSet);
@@ -153,7 +169,13 @@
void addWeaponPack(WeaponPack * wPack);
void addWeaponPackXML(WeaponPack * wPack);
WeaponPack * getWeaponPack(unsigned int index) const;
+ std::vector<WeaponPack *> * getAllWeaponPacks();
+ void addMunitionXML(Munition* munition);
+ Munition* getMunitionXML() const;
+
+ Munition* getMunition(SubclassIdentifier<Munition> * identifier);
+
virtual void addedWeaponPack(WeaponPack* wPack) {}
inline void setSpawnParticleSource(const std::string& source)
@@ -193,6 +215,9 @@
void setExplosionSound(const std::string& engineSound);
const std::string& getExplosionSound();
+ virtual const WeaponSystem* getWeaponSystem() const
+ { return this->weaponSystem_; }
+
protected:
virtual void preDestroy();
@@ -203,13 +228,12 @@
virtual bool hasSlaves();
virtual Controller* getSlave();
virtual void goWithStyle();
- virtual void deatheffect();
virtual void spawneffect();
- //virtual void damage(float damage, Pawn* originator = 0);
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*>(); }
@@ -225,21 +249,22 @@
float maxShieldHealth_;
float initialShieldHealth_;
float shieldAbsorption_; ///< Has to be between 0 and 1
- float reloadRate_;
- float reloadWaitTime_;
- float reloadWaitCountdown_;
+ float shieldRechargeRate_;
+ float shieldRechargeWaitTime_;
+ float shieldRechargeWaitCountdown_;
float damageMultiplier_; ///< Used by the Damage Boost Pickup.
WeakPtr<Pawn> lastHitOriginator_;
WeaponSystem* weaponSystem_;
- bool bReload_;
std::string spawnparticlesource_;
float spawnparticleduration_;
unsigned int numexplosionchunks_;
+ std::vector<ExplosionPart*> explosionPartList_;
+
private:
void registerVariables();
inline void setWeaponSystem(WeaponSystem* weaponsystem)
Modified: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -114,6 +114,8 @@
XMLPortParamVariable(SpaceShip, "stallSpeed", stallSpeed_, xmlelement, mode);
XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode);
+
+
}
void SpaceShip::registerVariables()
@@ -296,6 +298,24 @@
this->resetCamera();
}
}
+
+ void SpaceShip::gainBoostPower(float gainedBoostPower)
+ {
+ this->boostPower_ += gainedBoostPower;
+
+ if (this->boostPower_ > this->initialBoostPower_)
+ {
+ this->boostPower_ = this->initialBoostPower_;
+ }
+
+ // If the booster is in cooldown mode and we gained boost power, the abort the cooldown.
+ if (this->isBoostCoolingDown() && this->boostPower_ > 0.0f)
+ {
+ timer_.stopTimer();
+ this->boostCooledDown();
+ }
+ }
+
/**
@brief
Add an Engine to the SpaceShip.
Modified: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h 2016-01-09 17:26:20 UTC (rev 11052)
@@ -52,8 +52,10 @@
- The <b>rotationThrust</b>, specifies the force with which the SpaceShip rotates.
- The <b>boost</b>, there are quite some parameters pertaining to boosting. The boost is a special move of the SpaceShip, where, for a limited amount of time, it can fly considerably faster than usual. The <b>boostPower</b> is the amount of power available for boosting. The <b>boostPowerRate</b> is the rate at which the boost power is replenished. The <b>boostRate</b> is the rate at which boosting uses power. And the <b>boostCooldownDuration</b> is the time the SpaceShip cannot boost, once all the boost power has been used up. Naturally all of these parameters must be non-negative.
- The <b>boost shaking</b>, when the SpaceShip boosts, the camera shakes to create a more immersive effect. Two parameters can be used to adjust the effect. The <b>shakeFrequency</b> is the frequency with which the camera shakes. And the <b>shakeAmplitude</b> is the amount with which the camera shakes. Again these parameters must bee non-negative.
- - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again tow parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
+ - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again two parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
+ A spaceship always needs to have the collision type "dynamic". Other collision types are illegal.
+
As mentioned @ref orxonox::Engine Engines can be mounted on the SpaceShip. Here is a (primitive) example of a SpaceShip defined in XML:
@code
<SpaceShip
@@ -249,6 +251,11 @@
*/
inline float getShakeAmplitude() const
{ return this->shakeAmplitude_; }
+ /**
+ @brief Add boost power. Is non-negative.
+ @return Returns the current boost power.
+ */
+ void gainBoostPower(float gainedBoostPower);
protected:
bool bInvertYAxis_;
@@ -261,7 +268,7 @@
bool bBoost_; //!< Whether the SpaceShip is currently boosting.
bool bBoostCooldown_; //!< Whether the SpaceShip is currently in boost cooldown, during which boosting is impossible.
float initialBoostPower_; //!< The initial (and maximal) boost power.
- float boostPower_; //!< The current boost power.
+ float boostPower_; //!< The current boost power. If the boost power is reduced to zero the boost cooldown will start.
float boostPowerRate_; //!< The rate at which the boost power is recharged.
float boostRate_; //!< The rate at which boost power is used up.
float boostCooldownDuration_; //!< The duration for which boost cooldown is in effect.
@@ -288,7 +295,7 @@
std::vector<Engine*> engineList_; //!< The list of all Engines mounted on this SpaceShip.
- Timer timer_; //!< Timer for the cooldown duration.
+ Timer timer_; //!< Timer for the cooldown of the boost.
float shakeDt_; //!< Temporary variable for the shaking of the camera.
Vector3 cameraOriginalPosition_; //!< The original position of the camera before shaking it.
Quaternion cameraOriginalOrientation_; //!< The original orientation of the camera before shaking it.
Modified: code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -1,355 +1,355 @@
-#include <gtest/gtest.h>
-#include "core/CoreIncludes.h"
-#include "core/class/Identifiable.h"
-#include "core/class/OrxonoxClass.h"
-#include "core/class/OrxonoxInterface.h"
-#include "core/module/ModuleInstance.h"
-
-namespace orxonox
-{
- // Tests the class hierarchy with classes that contain other classes as members.
- //
- // +------ Nested1 +------ Class1_notNested
- // +------ Nested2 +------ Class2_oneNested
- // OrxonoxClass <-----+------ BaseClass <-----+------ Class3_twoNested <----------- Class3_Child
- // +------ Class4_class1Nested
- // +------ Class5_class2Nested
- // +------ Class6_class3Nested <-------- Class6_Child
-
- namespace
- {
- class Nested1 : public OrxonoxClass
- {
- public:
- Nested1() { RegisterObject(Nested1); }
- };
-
- class Nested2 : public OrxonoxClass
- {
- public:
- Nested2() { RegisterObject(Nested2); }
- };
-
- class BaseClass : public OrxonoxClass
- {
- public:
- BaseClass() { RegisterObject(BaseClass); }
- };
-
- class Class1_notNested : public BaseClass
- {
- public:
- Class1_notNested() { RegisterObject(Class1_notNested); }
- };
-
- class Class2_oneNested : public BaseClass
- {
- public:
- Class2_oneNested() { RegisterObject(Class2_oneNested); }
- Nested1 nested1_;
- };
-
- class Class3_twoNested : public BaseClass
- {
- public:
- Class3_twoNested() { RegisterObject(Class3_twoNested); }
- Nested1 nested1_;
- Nested2 nested2_;
- };
-
- class Class4_class1Nested : public BaseClass
- {
- public:
- Class4_class1Nested() { RegisterObject(Class4_class1Nested); }
- Class1_notNested nested_;
- };
-
- class Class5_class2Nested : public BaseClass
- {
- public:
- Class5_class2Nested() { RegisterObject(Class5_class2Nested); }
- Class2_oneNested nested_;
- };
-
- class Class6_class3Nested : public BaseClass
- {
- public:
- Class6_class3Nested() { RegisterObject(Class6_class3Nested); }
- Class3_twoNested nested_;
- };
-
- class Class3_Child : public Class3_twoNested
- {
- public:
- Class3_Child() { RegisterObject(Class3_Child); }
- };
-
- class Class6_Child : public Class6_class3Nested
- {
- public:
- Class6_Child() { RegisterObject(Class6_Child); }
- };
-
- RegisterClassNoArgs(Nested1);
- RegisterClassNoArgs(Nested2);
- RegisterClassNoArgs(BaseClass);
- RegisterClassNoArgs(Class1_notNested);
- RegisterClassNoArgs(Class2_oneNested);
- RegisterClassNoArgs(Class3_twoNested);
- RegisterClassNoArgs(Class4_class1Nested);
- RegisterClassNoArgs(Class5_class2Nested);
- RegisterClassNoArgs(Class6_class3Nested);
- RegisterClassNoArgs(Class3_Child);
- RegisterClassNoArgs(Class6_Child);
-
- // Fixture
- class IdentifierNestedClassHierarchyTest : public ::testing::Test
- {
- public:
- virtual void SetUp()
- {
- new IdentifierManager();
- ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
- Context::setRootContext(new Context(NULL));
- Identifier::initConfigValues_s = false; // TODO: hack!
- IdentifierManager::getInstance().createClassHierarchy();
- }
-
- virtual void TearDown()
- {
- IdentifierManager::getInstance().destroyClassHierarchy();
- Context::destroyRootContext();
- ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
- delete &IdentifierManager::getInstance();
- }
- };
-
- bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
- {
- return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
- }
-
- bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
- {
- return identifiers.find(identifier) != identifiers.end();
- }
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestNested1)
- {
- Identifier* identifier = Class(Nested1);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
-
- EXPECT_EQ(4u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestNested2)
- {
- Identifier* identifier = Class(Nested2);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
-
- EXPECT_EQ(4u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestBaseClass)
- {
- Identifier* identifier = Class(BaseClass);
-
- EXPECT_EQ(6u, identifier->getDirectChildren().size());
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1_notNested)));
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2_oneNested)));
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3_twoNested)));
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class4_class1Nested)));
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class5_class2Nested)));
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class6_class3Nested)));
-
- EXPECT_EQ(8u, identifier->getChildren().size());
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1_notNested)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2_oneNested)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_twoNested)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class4_class1Nested)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class5_class2Nested)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_class3Nested)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_Child)));
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_Child)));
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
-
- EXPECT_EQ(4u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass1_notNested)
- {
- Identifier* identifier = Class(Class1_notNested);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
-
- EXPECT_EQ(5u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass2_oneNested)
- {
- Identifier* identifier = Class(Class2_oneNested);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
-
- EXPECT_EQ(5u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass3_twoNested)
- {
- Identifier* identifier = Class(Class3_twoNested);
-
- EXPECT_EQ(1u, identifier->getDirectChildren().size());
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3_Child)));
-
- EXPECT_EQ(1u, identifier->getChildren().size());
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_Child)));
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
-
- EXPECT_EQ(5u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass4_class1Nested)
- {
- Identifier* identifier = Class(Class4_class1Nested);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
-
- EXPECT_EQ(5u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass5_class2Nested)
- {
- Identifier* identifier = Class(Class5_class2Nested);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
-
- EXPECT_EQ(5u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass6_class3Nested)
- {
- Identifier* identifier = Class(Class6_class3Nested);
-
- EXPECT_EQ(1u, identifier->getDirectChildren().size());
- EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class6_Child)));
-
- EXPECT_EQ(1u, identifier->getChildren().size());
- EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_Child)));
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
-
- EXPECT_EQ(5u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass3_Child)
- {
- Identifier* identifier = Class(Class3_Child);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Class3_twoNested)));
-
- EXPECT_EQ(6u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Class3_twoNested)));
- }
-
- TEST_F(IdentifierNestedClassHierarchyTest, TestClass6_Child)
- {
- Identifier* identifier = Class(Class6_Child);
-
- EXPECT_EQ(0u, identifier->getDirectChildren().size());
- EXPECT_EQ(0u, identifier->getChildren().size());
-
- EXPECT_EQ(1u, identifier->getDirectParents().size());
- EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Class6_class3Nested)));
-
- EXPECT_EQ(6u, identifier->getParents().size());
- EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
- EXPECT_TRUE(contains(identifier->getParents(), Class(Class6_class3Nested)));
- }
-}
+#include <gtest/gtest.h>
+#include "core/CoreIncludes.h"
+#include "core/class/Identifiable.h"
+#include "core/class/OrxonoxClass.h"
+#include "core/class/OrxonoxInterface.h"
+#include "core/module/ModuleInstance.h"
+
+namespace orxonox
+{
+ // Tests the class hierarchy with classes that contain other classes as members.
+ //
+ // +------ Nested1 +------ Class1_notNested
+ // +------ Nested2 +------ Class2_oneNested
+ // OrxonoxClass <-----+------ BaseClass <-----+------ Class3_twoNested <----------- Class3_Child
+ // +------ Class4_class1Nested
+ // +------ Class5_class2Nested
+ // +------ Class6_class3Nested <-------- Class6_Child
+
+ namespace
+ {
+ class Nested1 : public OrxonoxClass
+ {
+ public:
+ Nested1() { RegisterObject(Nested1); }
+ };
+
+ class Nested2 : public OrxonoxClass
+ {
+ public:
+ Nested2() { RegisterObject(Nested2); }
+ };
+
+ class BaseClass : public OrxonoxClass
+ {
+ public:
+ BaseClass() { RegisterObject(BaseClass); }
+ };
+
+ class Class1_notNested : public BaseClass
+ {
+ public:
+ Class1_notNested() { RegisterObject(Class1_notNested); }
+ };
+
+ class Class2_oneNested : public BaseClass
+ {
+ public:
+ Class2_oneNested() { RegisterObject(Class2_oneNested); }
+ Nested1 nested1_;
+ };
+
+ class Class3_twoNested : public BaseClass
+ {
+ public:
+ Class3_twoNested() { RegisterObject(Class3_twoNested); }
+ Nested1 nested1_;
+ Nested2 nested2_;
+ };
+
+ class Class4_class1Nested : public BaseClass
+ {
+ public:
+ Class4_class1Nested() { RegisterObject(Class4_class1Nested); }
+ Class1_notNested nested_;
+ };
+
+ class Class5_class2Nested : public BaseClass
+ {
+ public:
+ Class5_class2Nested() { RegisterObject(Class5_class2Nested); }
+ Class2_oneNested nested_;
+ };
+
+ class Class6_class3Nested : public BaseClass
+ {
+ public:
+ Class6_class3Nested() { RegisterObject(Class6_class3Nested); }
+ Class3_twoNested nested_;
+ };
+
+ class Class3_Child : public Class3_twoNested
+ {
+ public:
+ Class3_Child() { RegisterObject(Class3_Child); }
+ };
+
+ class Class6_Child : public Class6_class3Nested
+ {
+ public:
+ Class6_Child() { RegisterObject(Class6_Child); }
+ };
+
+ RegisterClassNoArgs(Nested1);
+ RegisterClassNoArgs(Nested2);
+ RegisterClassNoArgs(BaseClass);
+ RegisterClassNoArgs(Class1_notNested);
+ RegisterClassNoArgs(Class2_oneNested);
+ RegisterClassNoArgs(Class3_twoNested);
+ RegisterClassNoArgs(Class4_class1Nested);
+ RegisterClassNoArgs(Class5_class2Nested);
+ RegisterClassNoArgs(Class6_class3Nested);
+ RegisterClassNoArgs(Class3_Child);
+ RegisterClassNoArgs(Class6_Child);
+
+ // Fixture
+ class IdentifierNestedClassHierarchyTest : public ::testing::Test
+ {
+ public:
+ virtual void SetUp()
+ {
+ new IdentifierManager();
+ ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+ Context::setRootContext(new Context(NULL));
+ Identifier::initConfigValues_s = false; // TODO: hack!
+ IdentifierManager::getInstance().createClassHierarchy();
+ }
+
+ virtual void TearDown()
+ {
+ IdentifierManager::getInstance().destroyClassHierarchy();
+ Context::destroyRootContext();
+ ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+ delete &IdentifierManager::getInstance();
+ }
+ };
+
+ bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
+ {
+ return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
+ }
+
+ bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
+ {
+ return identifiers.find(identifier) != identifiers.end();
+ }
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestNested1)
+ {
+ Identifier* identifier = Class(Nested1);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+ EXPECT_EQ(4u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestNested2)
+ {
+ Identifier* identifier = Class(Nested2);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+ EXPECT_EQ(4u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestBaseClass)
+ {
+ Identifier* identifier = Class(BaseClass);
+
+ EXPECT_EQ(6u, identifier->getDirectChildren().size());
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1_notNested)));
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2_oneNested)));
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3_twoNested)));
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class4_class1Nested)));
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class5_class2Nested)));
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class6_class3Nested)));
+
+ EXPECT_EQ(8u, identifier->getChildren().size());
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1_notNested)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2_oneNested)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_twoNested)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class4_class1Nested)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class5_class2Nested)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_class3Nested)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_Child)));
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_Child)));
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+ EXPECT_EQ(4u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass1_notNested)
+ {
+ Identifier* identifier = Class(Class1_notNested);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+ EXPECT_EQ(5u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass2_oneNested)
+ {
+ Identifier* identifier = Class(Class2_oneNested);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+ EXPECT_EQ(5u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass3_twoNested)
+ {
+ Identifier* identifier = Class(Class3_twoNested);
+
+ EXPECT_EQ(1u, identifier->getDirectChildren().size());
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3_Child)));
+
+ EXPECT_EQ(1u, identifier->getChildren().size());
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_Child)));
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+ EXPECT_EQ(5u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass4_class1Nested)
+ {
+ Identifier* identifier = Class(Class4_class1Nested);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+ EXPECT_EQ(5u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass5_class2Nested)
+ {
+ Identifier* identifier = Class(Class5_class2Nested);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+ EXPECT_EQ(5u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass6_class3Nested)
+ {
+ Identifier* identifier = Class(Class6_class3Nested);
+
+ EXPECT_EQ(1u, identifier->getDirectChildren().size());
+ EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class6_Child)));
+
+ EXPECT_EQ(1u, identifier->getChildren().size());
+ EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_Child)));
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+ EXPECT_EQ(5u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass3_Child)
+ {
+ Identifier* identifier = Class(Class3_Child);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Class3_twoNested)));
+
+ EXPECT_EQ(6u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Class3_twoNested)));
+ }
+
+ TEST_F(IdentifierNestedClassHierarchyTest, TestClass6_Child)
+ {
+ Identifier* identifier = Class(Class6_Child);
+
+ EXPECT_EQ(0u, identifier->getDirectChildren().size());
+ EXPECT_EQ(0u, identifier->getChildren().size());
+
+ EXPECT_EQ(1u, identifier->getDirectParents().size());
+ EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Class6_class3Nested)));
+
+ EXPECT_EQ(6u, identifier->getParents().size());
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+ EXPECT_TRUE(contains(identifier->getParents(), Class(Class6_class3Nested)));
+ }
+}
Property changes on: code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: code/trunk/test/util/MathTest.cc
===================================================================
--- code/trunk/test/util/MathTest.cc 2016-01-09 16:00:19 UTC (rev 11051)
+++ code/trunk/test/util/MathTest.cc 2016-01-09 17:26:20 UTC (rev 11052)
@@ -336,7 +336,7 @@
/*
getAngle
get2DViewdirection
- get2DViewcoordinates
+ get2DViewCoordinates
getPredictedPosition
*/
}
More information about the Orxonox-commit
mailing list