Changeset 9241 for code/branches/presentation2012/src/modules/gametypes
- Timestamp:
- May 24, 2012, 8:49:19 PM (13 years ago)
- Location:
- code/branches/presentation2012
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012
- Property svn:mergeinfo changed
/code/branches/newlevel2012 merged: 9236
- Property svn:mergeinfo changed
-
code/branches/presentation2012/src
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/dockingsystem2/src merged eligible /code/branches/environment3/src merged eligible /code/branches/formation/src merged eligible /code/branches/gamecontent/src merged eligible /code/branches/hud/src merged eligible /code/branches/masterserverfix/src merged eligible /code/branches/menue/src merged eligible /code/branches/newlevel2012/src merged eligible /code/branches/output/src merged eligible /code/branches/pickup2012/src merged eligible /code/branches/presentation/src merged eligible /code/branches/presentation2011/src merged eligible /code/branches/shipSelection/src merged eligible /code/branches/sound2012/src merged eligible /code/branches/spacegate/src merged eligible /code/branches/spaceraceTwo/src merged eligible /code/branches/surfaceRace/src merged eligible /code/branches/usability/src merged eligible /code/trunk/src merged eligible /code/branches/ai/src 6592-7033 /code/branches/ai2/src 8721-8880 /code/branches/bigships/src 8137-8588 /code/branches/buildsystem/src 1874-2276,2278-2400 /code/branches/buildsystem2/src 2506-2658 /code/branches/buildsystem3/src 2662-2708 /code/branches/ceguilua/src 1802-1808 /code/branches/chat/src 6527-6797 /code/branches/chat2/src 6836-6910 /code/branches/console/src 5941-6104 /code/branches/consolecommands2/src 6451-7178 /code/branches/consolecommands3/src 7178-7283 /code/branches/core3/src 1572-1739 /code/branches/core4/src 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/src 5768-5928,6009 /code/branches/data_cleanup/src 7537-7686 /code/branches/doc/src 7290-7400 /code/branches/dockingsystem/src 8101-8192 /code/branches/dynamicmatch/src 6584-7030 /code/branches/fps/src 6591-7072 /code/branches/gameimmersion/src 8102-8577 /code/branches/gamestate/src 6430-6572,6621-6661 /code/branches/gamestates2/src 6594-6745 /code/branches/gametypes/src 2826-3031 /code/branches/gcc43/src 1580 /code/branches/gui/src 1635-1723,2795-2894 /code/branches/hudelements/src 6584-6941 /code/branches/hudimprovements/src 7920-8672 /code/branches/ingamemenu/src 6000-6023 /code/branches/input/src 1629-1636 /code/branches/ipv6/src 7293-7458 /code/branches/kicklib/src 7940-8096,8098-8277 /code/branches/kicklib2/src 8282-8350 /code/branches/lastmanstanding/src 7479-7644 /code/branches/lastmanstanding3/src 7903-8175 /code/branches/libraries/src 5612-5692 /code/branches/libraries2/src 5703-5737 /code/branches/lod/src 6586-6911 /code/branches/lodfinal/src 2372-2411 /code/branches/mac_osx/src 7789-8128,8135 /code/branches/map/src 2801-3086,3089 /code/branches/masterserver/src 7502-7738 /code/branches/menu/src 5941-6146,6148,7536-7687 /code/branches/miniprojects/src 2754-2824 /code/branches/netp2/src 2835-2988 /code/branches/netp3/src 2988-3082 /code/branches/netp6/src 3214-3302 /code/branches/network/src 2356 /code/branches/network2/src 6434-6465 /code/branches/network3/src 7196-7344 /code/branches/network4/src 7497-7755 /code/branches/network5/src 7757-7781 /code/branches/network6/src 7823-8315 /code/branches/network64/src 2210-2355 /code/branches/notifications/src 7314-7401 /code/branches/objecthierarchy/src 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src 2171-2479 /code/branches/ois_update/src 7506-7788 /code/branches/overlay/src 2117-2385 /code/branches/particles/src 2829-3085 /code/branches/particles2/src 6050-6106,6109 /code/branches/pch/src 3113-3194 /code/branches/physics/src 1912-2055,2107-2439 /code/branches/physics_merge/src 2436-2457 /code/branches/pickup/src 8145-8555 /code/branches/pickup2/src 5942-6405 /code/branches/pickup3/src 6418-6523 /code/branches/pickup4/src 6594-6710 /code/branches/pickups/src 1926-2086,2127,2827-2915 /code/branches/pickups2/src 2107-2497,2915-3071 /code/branches/png2/src 7262-7263 /code/branches/portals/src 8087-8455 /code/branches/portals2/src 8460-8602 /code/branches/ppspickups1/src 6552-6708 /code/branches/ppspickups2/src 6527-6532,6554-6709 /code/branches/ppspickups3/src 6757-6997 /code/branches/ppspickups4/src 7003-7089 /code/branches/presentation2/src 6106-6416,7787-7800 /code/branches/presentation3/src 6913-7162 /code/branches/questsystem/src 1894-2088 /code/branches/questsystem2/src 2107-2259 /code/branches/questsystem5/src 2776-2905 /code/branches/releasetodo/src 7614-7647 /code/branches/resource/src 3327-3366 /code/branches/resource2/src 3372-5694 /code/branches/rocket/src 6523-6950 /code/branches/rocket2/src 6953-6970 /code/branches/script_trigger/src 1295-1953,1955 /code/branches/skybox2/src 6559-6989 /code/branches/sound/src 2829-3010 /code/branches/sound3/src 5941-6102 /code/branches/spaceboundaries/src 8085-8457 /code/branches/spaceboundaries2/src 8460-8613 /code/branches/spacerace/src 8182-8630 /code/branches/steering/src 5949-6091,8140-8595 /code/branches/tetris/src 8100-8563 /code/branches/tutoriallevel/src 7827-8370 /code/branches/tutoriallevel2/src 8370-8452 /code/branches/tutoriallevel3/src 8453-8636 /code/branches/unity_build/src 8440-8716 /code/branches/weapon/src 1925-2094 /code/branches/weapon2/src 2107-2488 /code/branches/weapons/src 2897-3051,8143-8591 /code/branches/weaponsystem/src 2742-2890
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/presentation2012/src/modules
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/dockingsystem2/src/modules merged eligible /code/branches/environment3/src/modules merged eligible /code/branches/formation/src/modules merged eligible /code/branches/gamecontent/src/modules merged eligible /code/branches/hud/src/modules merged eligible /code/branches/masterserverfix/src/modules merged eligible /code/branches/menue/src/modules merged eligible /code/branches/newlevel2012/src/modules merged eligible /code/branches/output/src/modules merged eligible /code/branches/pickup2012/src/modules merged eligible /code/branches/presentation/src/modules merged eligible /code/branches/presentation2011/src/modules merged eligible /code/branches/shipSelection/src/modules merged eligible /code/branches/sound2012/src/modules merged non-inheritable eligible /code/branches/spacegate/src/modules merged eligible /code/branches/spaceraceTwo/src/modules merged eligible /code/branches/surfaceRace/src/modules merged eligible /code/branches/usability/src/modules merged eligible /code/trunk/src/modules merged eligible /code/branches/ai/src/modules 6592-7033 /code/branches/ai2/src/modules 8721-8880 /code/branches/bigships/src/modules 8137-8588 /code/branches/buildsystem/src/modules 1874-2276,2278-2400 /code/branches/buildsystem2/src/modules 2506-2658 /code/branches/buildsystem3/src/modules 2662-2708 /code/branches/ceguilua/src/modules 1802-1808 /code/branches/chat/src/modules 6527-6797 /code/branches/chat2/src/modules 6836-6910 /code/branches/console/src/modules 5941-6104 /code/branches/consolecommands2/src/modules 6451-7178 /code/branches/consolecommands3/src/modules 7178-7283 /code/branches/core3/src/modules 1572-1739 /code/branches/core4/src/modules 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/src/modules 5768-5928,6009 /code/branches/data_cleanup/src/modules 7537-7686 /code/branches/doc/src/modules 7290-7400 /code/branches/dockingsystem/src/modules 8101-8192 /code/branches/dynamicmatch/src/modules 6584-7030 /code/branches/fps/src/modules 6591-7072 /code/branches/gameimmersion/src/modules 8102-8577 /code/branches/gamestate/src/modules 6430-6572,6621-6661 /code/branches/gamestates2/src/modules 6594-6745 /code/branches/gametypes/src/modules 2826-3031 /code/branches/gcc43/src/modules 1580 /code/branches/gui/src/modules 1635-1723,2795-2894 /code/branches/hudelements/src/modules 6584-6941 /code/branches/hudimprovements/src/modules 7920-8672 /code/branches/ingamemenu/src/modules 6000-6023 /code/branches/input/src/modules 1629-1636 /code/branches/ipv6/src/modules 7293-7458 /code/branches/kicklib/src/modules 7940-8096,8098-8277 /code/branches/kicklib2/src/modules 8282-8350 /code/branches/lastmanstanding/src/modules 7479-7644 /code/branches/lastmanstanding3/src/modules 7903-8175 /code/branches/libraries/src/modules 5612-5692 /code/branches/libraries2/src/modules 5703-5737 /code/branches/lod/src/modules 6586-6911 /code/branches/lodfinal/src/modules 2372-2411 /code/branches/mac_osx/src/modules 7789-8128,8135 /code/branches/map/src/modules 2801-3086,3089 /code/branches/masterserver/src/modules 7502-7738 /code/branches/menu/src/modules 5941-6146,6148,7536-7687 /code/branches/miniprojects/src/modules 2754-2824 /code/branches/netp2/src/modules 2835-2988 /code/branches/netp3/src/modules 2988-3082 /code/branches/netp6/src/modules 3214-3302 /code/branches/network/src/modules 2356 /code/branches/network2/src/modules 6434-6465 /code/branches/network3/src/modules 7196-7344 /code/branches/network4/src/modules 7497-7755 /code/branches/network5/src/modules 7757-7781 /code/branches/network6/src/modules 7823-8315 /code/branches/network64/src/modules 2210-2355 /code/branches/notifications/src/modules 7314-7401 /code/branches/objecthierarchy/src/modules 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/modules 2171-2479 /code/branches/ois_update/src/modules 7506-7788 /code/branches/overlay/src/modules 2117-2385 /code/branches/particles/src/modules 2829-3085 /code/branches/particles2/src/modules 6050-6106,6109 /code/branches/pch/src/modules 3113-3194 /code/branches/physics/src/modules 1912-2055,2107-2439 /code/branches/physics_merge/src/modules 2436-2457 /code/branches/pickup/src/modules 8145-8555 /code/branches/pickup2/src/modules 5942-6405 /code/branches/pickup3/src/modules 6418-6523 /code/branches/pickup4/src/modules 6594-6710 /code/branches/pickups/src/modules 1926-2086,2127,2827-2915 /code/branches/pickups2/src/modules 2107-2497,2915-3071 /code/branches/png2/src/modules 7262-7263 /code/branches/portals/src/modules 8087-8455 /code/branches/portals2/src/modules 8460-8602 /code/branches/ppspickups1/src/modules 6552-6708 /code/branches/ppspickups2/src/modules 6527-6532,6554-6709 /code/branches/ppspickups3/src/modules 6757-6997 /code/branches/ppspickups4/src/modules 7003-7089 /code/branches/presentation2/src/modules 6106-6416,7787-7800 /code/branches/presentation3/src/modules 6913-7162 /code/branches/questsystem/src/modules 1894-2088 /code/branches/questsystem2/src/modules 2107-2259 /code/branches/questsystem5/src/modules 2776-2905 /code/branches/releasetodo/src/modules 7614-7647 /code/branches/resource/src/modules 3327-3366 /code/branches/resource2/src/modules 3372-5694 /code/branches/rocket/src/modules 6523-6950 /code/branches/rocket2/src/modules 6953-6970 /code/branches/script_trigger/src/modules 1295-1953,1955 /code/branches/skybox2/src/modules 6559-6989 /code/branches/sound/src/modules 2829-3010 /code/branches/sound3/src/modules 5941-6102 /code/branches/spaceboundaries/src/modules 8085-8457 /code/branches/spaceboundaries2/src/modules 8460-8613 /code/branches/spacerace/src/modules 8182-8630 /code/branches/steering/src/modules 5949-6091,8140-8595 /code/branches/tetris/src/modules 8100-8563 /code/branches/tutoriallevel/src/modules 7827-8370 /code/branches/tutoriallevel2/src/modules 8370-8452 /code/branches/tutoriallevel3/src/modules 8453-8636 /code/branches/unity_build/src/modules 8440-8716 /code/branches/weapon/src/modules 1925-2094 /code/branches/weapon2/src/modules 2107-2488 /code/branches/weapons/src/modules 2897-3051,8143-8591 /code/branches/weaponsystem/src/modules 2742-2890
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/presentation2012/src/modules/gametypes
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/environment3/src/modules/gametypes merged eligible /code/branches/formation/src/modules/gametypes merged eligible /code/branches/gamecontent/src/modules/gametypes merged eligible /code/branches/hud/src/modules/gametypes merged eligible /code/branches/masterserverfix/src/modules/gametypes merged eligible /code/branches/menue/src/modules/gametypes merged eligible /code/branches/newlevel2012/src/modules/gametypes merged eligible /code/branches/output/src/modules/gametypes merged eligible /code/branches/pickup2012/src/modules/gametypes merged eligible /code/branches/presentation/src/modules/gametypes merged eligible /code/branches/presentation2011/src/modules/gametypes merged eligible /code/branches/shipSelection/src/modules/gametypes merged eligible /code/branches/sound2012/src/modules/gametypes merged eligible /code/branches/spacegate/src/modules/gametypes merged eligible /code/branches/spaceraceTwo/src/modules/gametypes merged eligible /code/branches/surfaceRace/src/modules/gametypes merged eligible /code/trunk/src/modules/gametypes merged eligible /code/branches/ai/src/modules/gametypes 6592-7033 /code/branches/ai2/src/modules/gametypes 8721-8880 /code/branches/bigships/src/modules/gametypes 8137-8588 /code/branches/buildsystem/src/modules/gametypes 1874-2276,2278-2400 /code/branches/buildsystem2/src/modules/gametypes 2506-2658 /code/branches/buildsystem3/src/modules/gametypes 2662-2708 /code/branches/ceguilua/src/modules/gametypes 1802-1808 /code/branches/chat/src/modules/gametypes 6527-6797 /code/branches/chat2/src/modules/gametypes 6836-6910 /code/branches/console/src/modules/gametypes 5941-6104 /code/branches/consolecommands2/src/modules/gametypes 6451-7178 /code/branches/consolecommands3/src/modules/gametypes 7178-7283 /code/branches/core3/src/modules/gametypes 1572-1739 /code/branches/core4/src/modules/gametypes 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/src/modules/gametypes 5768-5928,6009 /code/branches/data_cleanup/src/modules/gametypes 7537-7686 /code/branches/doc/src/modules/gametypes 7290-7400 /code/branches/dockingsystem/src/modules/gametypes 8101-8192 /code/branches/dockingsystem2/src/modules/gametypes 8196-8560 /code/branches/dynamicmatch/src/modules/gametypes 6584-7030 /code/branches/fps/src/modules/gametypes 6591-7072 /code/branches/gameimmersion/src/modules/gametypes 8102-8577 /code/branches/gamestate/src/modules/gametypes 6430-6572,6621-6661 /code/branches/gamestates2/src/modules/gametypes 6594-6745 /code/branches/gametypes/src/modules/gametypes 2826-3031 /code/branches/gcc43/src/modules/gametypes 1580 /code/branches/gui/src/modules/gametypes 1635-1723,2795-2894 /code/branches/hudelements/src/modules/gametypes 6584-6941 /code/branches/hudimprovements/src/modules/gametypes 7920-8672 /code/branches/ingamemenu/src/modules/gametypes 6000-6023 /code/branches/input/src/modules/gametypes 1629-1636 /code/branches/ipv6/src/modules/gametypes 7293-7458 /code/branches/kicklib/src/modules/gametypes 7940-8096,8098-8277 /code/branches/kicklib2/src/modules/gametypes 8282-8350 /code/branches/lastmanstanding/src/modules/gametypes 7479-7644 /code/branches/lastmanstanding3/src/modules/gametypes 7903-8175 /code/branches/libraries/src/modules/gametypes 5612-5692 /code/branches/libraries2/src/modules/gametypes 5703-5737 /code/branches/lod/src/modules/gametypes 6586-6911 /code/branches/lodfinal/src/modules/gametypes 2372-2411 /code/branches/mac_osx/src/modules/gametypes 7789-8128,8135 /code/branches/map/src/modules/gametypes 2801-3086,3089 /code/branches/masterserver/src/modules/gametypes 7502-7738 /code/branches/menu/src/modules/gametypes 5941-6146,6148,7536-7687 /code/branches/miniprojects/src/modules/gametypes 2754-2824 /code/branches/netp2/src/modules/gametypes 2835-2988 /code/branches/netp3/src/modules/gametypes 2988-3082 /code/branches/netp6/src/modules/gametypes 3214-3302 /code/branches/network/src/modules/gametypes 2356 /code/branches/network2/src/modules/gametypes 6434-6465 /code/branches/network3/src/modules/gametypes 7196-7344 /code/branches/network4/src/modules/gametypes 7497-7755 /code/branches/network5/src/modules/gametypes 7757-7781 /code/branches/network6/src/modules/gametypes 7823-8315 /code/branches/network64/src/modules/gametypes 2210-2355 /code/branches/notifications/src/modules/gametypes 7314-7401 /code/branches/objecthierarchy/src/modules/gametypes 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/modules/gametypes 2171-2479 /code/branches/ois_update/src/modules/gametypes 7506-7788 /code/branches/overlay/src/modules/gametypes 2117-2385 /code/branches/particles/src/modules/gametypes 2829-3085 /code/branches/particles2/src/modules/gametypes 6050-6106,6109 /code/branches/pch/src/modules/gametypes 3113-3194 /code/branches/physics/src/modules/gametypes 1912-2055,2107-2439 /code/branches/physics_merge/src/modules/gametypes 2436-2457 /code/branches/pickup/src/modules/gametypes 8145-8555 /code/branches/pickup2/src/modules/gametypes 5942-6405 /code/branches/pickup3/src/modules/gametypes 6418-6523 /code/branches/pickup4/src/modules/gametypes 6594-6710 /code/branches/pickups/src/modules/gametypes 1926-2086,2127,2827-2915 /code/branches/pickups2/src/modules/gametypes 2107-2497,2915-3071 /code/branches/png2/src/modules/gametypes 7262-7263 /code/branches/portals/src/modules/gametypes 8087-8455 /code/branches/portals2/src/modules/gametypes 8460-8602 /code/branches/ppspickups1/src/modules/gametypes 6552-6708 /code/branches/ppspickups2/src/modules/gametypes 6527-6532,6554-6709 /code/branches/ppspickups3/src/modules/gametypes 6757-6997 /code/branches/ppspickups4/src/modules/gametypes 7003-7089 /code/branches/presentation2/src/modules/gametypes 6106-6416,7787-7800 /code/branches/presentation3/src/modules/gametypes 6913-7162 /code/branches/questsystem/src/modules/gametypes 1894-2088 /code/branches/questsystem2/src/modules/gametypes 2107-2259 /code/branches/questsystem5/src/modules/gametypes 2776-2905 /code/branches/releasetodo/src/modules/gametypes 7614-7647 /code/branches/resource/src/modules/gametypes 3327-3366 /code/branches/resource2/src/modules/gametypes 3372-5694 /code/branches/rocket/src/modules/gametypes 6523-6950 /code/branches/rocket2/src/modules/gametypes 6953-6970 /code/branches/script_trigger/src/modules/gametypes 1295-1953,1955 /code/branches/skybox2/src/modules/gametypes 6559-6989 /code/branches/sound/src/modules/gametypes 2829-3010 /code/branches/sound3/src/modules/gametypes 5941-6102 /code/branches/spaceboundaries/src/modules/gametypes 8085-8457 /code/branches/spaceboundaries2/src/modules/gametypes 8460-8613 /code/branches/spacerace/src/modules/gametypes 8182-8630 /code/branches/steering/src/modules/gametypes 5949-6091,8140-8595 /code/branches/tetris/src/modules/gametypes 8100-8563 /code/branches/tutoriallevel/src/modules/gametypes 7827-8370 /code/branches/tutoriallevel2/src/modules/gametypes 8370-8452 /code/branches/tutoriallevel3/src/modules/gametypes 8453-8636 /code/branches/unity_build/src/modules/gametypes 8440-8716 /code/branches/usability/src/modules/gametypes 7915-8078 /code/branches/weapon/src/modules/gametypes 1925-2094 /code/branches/weapon2/src/modules/gametypes 2107-2488 /code/branches/weapons/src/modules/gametypes 2897-3051,8143-8591 /code/branches/weaponsystem/src/modules/gametypes 2742-2890
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.cc
r9240 r9241 28 28 #include "CaptureTheFlag.h" 29 29 30 #include "core/CoreIncludes.h"31 30 #include "core/ConfigValueIncludes.h" 32 31 #include "interfaces/TeamColourable.h" … … 39 38 { 40 39 CreateUnloadableFactory(CaptureTheFlag); 41 40 42 41 CaptureTheFlag::CaptureTheFlag(BaseObject* creator) : TeamBaseMatch(creator) 43 42 { … … 47 46 this->pointsTeam1_ = 0; 48 47 this->pointsTeam2_ = 0; 49 50 //this->flagTeamBlue = new FlagPickup(this);51 //this->flagTeamRed = new FlagPickup(this);52 48 49 // this->flagTeamBlue = new FlagPickup(this); 50 // this->flagTeamRed = new FlagPickup(this); 51 53 52 this->setConfigValues(); 54 53 } 55 54 56 55 void CaptureTheFlag::tick(float dt){ 56 57 SUPER(CaptureTheFlag, tick, dt); 58 57 59 if(this->flagTeamBlue->isPickedUp()){ 58 if(getTeam(this->flagTeamBlue->pickedUpBy()->getPlayer()) == 1){ 60 teamnr = getTeam(this->flagTeamBlue->pickedUpBy()->getPlayer()); 61 if(teamnr == 1){ 59 62 this->flagTeamBlue->ignorePickedUp(); 60 63 61 64 if(this->flagTeamBlue->pickedUpBy()->hasFlag()){ 62 pointsTeam1_ += 1000;65 this->addTeamPoints(teamnr, 1000); 63 66 this->flagTeamBlue->pickedUpBy()->setHasFlag(false); 64 67 } … … 70 73 } 71 74 if(this->flagTeamRed->isPickedUp()){ 72 if(getTeam(this->flagTeamRed->pickedUpBy()->getPlayer()) == 0){ 75 teamnr = getTeam(this->flagTeamBlue->pickedUpBy()->getPlayer()); 76 if(teamnr == 0){ 73 77 this->flagTeamRed->ignorePickedUp(); 74 78 75 79 if(this->flagTeamRed->pickedUpBy()->hasFlag()){ 76 pointsTeam1_ += 1000;80 this->addTeamPoints(teamnr, 1000); 77 81 this->flagTeamRed->pickedUpBy()->setHasFlag(false); 78 82 } … … 83 87 } 84 88 } 89 85 90 } 86 91 void CaptureTheFlag::setConfigValues() 87 92 { 88 93 SetConfigValue(teams_, 2); 89 94 90 95 static ColourValue colours[] = 91 96 { … … 96 101 }; 97 102 static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue)); 98 103 99 104 SetConfigValue(teamcolours_, defaultcolours); 100 105 } 101 106 102 107 void CaptureTheFlag::playerEntered(PlayerInfo* player) 103 108 { 104 Deathmatch::playerEntered(player);105 109 TeamBaseMatch::playerEntered(player); 110 106 111 std::vector<unsigned int> playersperteam(this->teams_, 0); 107 112 108 113 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 109 114 if (it->second < static_cast<int>(this->teams_) && it->second >= 0) 110 115 playersperteam[it->second]++; 111 116 112 117 unsigned int minplayers = static_cast<unsigned int>(-1); 113 118 size_t minplayersteam = 0; … … 120 125 } 121 126 } 122 127 123 128 this->teamnumbers_[player] = minplayersteam; 124 129 } 125 130 126 131 bool CaptureTheFlag::playerLeft(PlayerInfo* player) 127 132 { 128 133 bool valid_player = Deathmatch::playerLeft(player); 129 134 130 135 if (valid_player) 131 136 this->teamnumbers_.erase(player); 132 137 133 138 return valid_player; 134 139 } 135 140 136 141 bool CaptureTheFlag::allowPawnHit(Pawn* victim, Pawn* originator) 137 142 { 138 143 return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator); 139 144 } 140 145 141 146 bool CaptureTheFlag::allowPawnDamage(Pawn* victim, Pawn* originator) 142 147 { 143 148 return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator); 144 149 } 145 150 146 151 bool CaptureTheFlag::allowPawnDeath(Pawn* victim, Pawn* originator) 147 152 { 148 153 return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator); 149 154 } 150 155 151 156 // collect Points for killing oppenents 152 void CaptureTheFlag::playerScored(PlayerInfo* player) 153 { 154 int teamnr = this->getTeam(player); 155 this->addTeamPoints(teamnr, 5); 156 } 157 158 159 // show points or each interval of time 160 void CaptureTheFlag::showPoints() 161 { 162 if (!this->hasStarted() || this->hasEnded()) 163 return; 164 165 orxout(message) << "Points standing:" << '\n' << "Team Blue: "<< pointsTeam1_ << '\n' << "Team Red: " << pointsTeam2_ << endl; 166 if(pointsTeam1_ >=1700 && pointsTeam1_ < 2000) orxout(message) << "Team Blue is near victory!" << endl; 167 if(pointsTeam2_ >=1700 && pointsTeam2_ < 2000) orxout(message) << "Team Red is near victory!" << endl; 168 } 169 170 // end game if one team reaches 2000 points 171 void CaptureTheFlag::endGame() 172 { 173 if (this->pointsTeam1_ >= 2000 || this->pointsTeam2_ >= 2000) 174 { 175 int winningteam = -1; 176 177 if (this->pointsTeam1_ > this->pointsTeam2_) 178 { 179 orxout(message) << "Team Blue has won the match" << endl; 180 winningteam = 0; 181 } 157 void CaptureTheFlag::playerScored(PlayerInfo* player) 158 { 159 int teamnr = this->getTeam(player); 160 this->addTeamPoints(teamnr, 5); 161 } 162 163 164 // show points or each interval of time 165 void CaptureTheFlag::showPoints() 166 { 167 if (!this->hasStarted() || this->hasEnded()) 168 return; 169 170 orxout(message) << "Points standing:" << '\n' << "Team Blue: "<< pointsTeam1_ << '\n' << "Team Red: " << pointsTeam2_ << endl; 171 if(pointsTeam1_ >=1700 && pointsTeam1_ < 2000) orxout(message) << "Team Blue is near victory!" << endl; 172 if(pointsTeam2_ >=1700 && pointsTeam2_ < 2000) orxout(message) << "Team Red is near victory!" << endl; 173 } 174 175 // end game if one team reaches 2000 points 176 void CaptureTheFlag::endGame() 177 { 178 if (this->pointsTeam1_ >= 2000 || this->pointsTeam2_ >= 2000) 179 { 180 int winningteam = -1; 181 182 if (this->pointsTeam1_ > this->pointsTeam2_) 183 { 184 orxout(message) << "Team Blue has won the match" << endl; 185 winningteam = 0; 186 } 187 else 188 { 189 orxout(message) << "Team Red has won the match" << endl; 190 winningteam = 1; 191 } 192 193 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 194 { 195 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 196 continue; 197 198 if (it->second == winningteam) 199 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID()); 182 200 else 183 { 184 orxout(message) << "Team Red has won the match" << endl; 185 winningteam = 1; 186 } 187 188 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 189 { 190 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 191 continue; 192 193 if (it->second == winningteam) 194 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID()); 195 else 196 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 197 } 198 199 this->end(); 200 this->scoreTimer_.stopTimer(); 201 this->outputTimer_.stopTimer(); 202 } 203 } 204 205 // this function is called by the function winPoints() which adds points to the teams for every base and killed openents at a certain time 206 void CaptureTheFlag::addTeamPoints(int team, int points) 207 { 208 if(team == 0) 209 { 210 this->pointsTeam1_ += points; 211 } 212 if(team == 1) 213 { 214 this->pointsTeam2_ += points; 215 } 216 217 this->endGame(); 218 } 219 220 int TeamBaseMatch::getTeamPoints(int team) 221 { 222 if(team == 0) 223 { 224 return this->pointsTeam1_; 225 } 226 if(team == 1) 227 { 228 return this->pointsTeam2_; 229 } 230 231 return 0; 232 } 233 201 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 202 } 203 204 this->end(); 205 this->scoreTimer_.stopTimer(); 206 this->outputTimer_.stopTimer(); 207 } 208 } 209 210 // this function is called by the function winPoints() which adds points to the teams for every base and killed openents at a certain time 211 void CaptureTheFlag::addTeamPoints(int team, int points) 212 { 213 if(team == 0) 214 { 215 this->pointsTeam1_ += points; 216 } 217 if(team == 1) 218 { 219 this->pointsTeam2_ += points; 220 } 221 222 this->endGame(); 223 } 224 225 int TeamBaseMatch::getTeamPoints(int team) 226 { 227 if(team == 0) 228 { 229 return this->pointsTeam1_; 230 } 231 if(team == 1) 232 { 233 return this->pointsTeam2_; 234 } 235 236 return 0; 237 } 238 234 239 SpawnPoint* CaptureTheFlag::getBestSpawnPoint(PlayerInfo* player) const 235 240 { … … 238 243 if (it_player != this->teamnumbers_.end()) 239 244 desiredTeamNr = it_player->second; 240 245 241 246 // Only use spawnpoints of the own team (or non-team-spawnpoints) 242 247 std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_; … … 252 257 } 253 258 } 254 259 255 260 ++it; 256 261 } 257 262 258 263 SpawnPoint* fallbackSpawnPoint = NULL; 259 264 if (teamSpawnPoints.size() > 0) … … 269 274 break; 270 275 } 271 276 272 277 ++index; 273 278 } 274 279 275 280 // Remove all inactive SpawnPoints from the list. 276 281 for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ) … … 281 286 continue; 282 287 } 283 288 284 289 ++it; 285 290 } 286 291 287 292 randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size()))); 288 293 index = 0; … … 291 296 if (index == randomspawn) 292 297 return (*it); 293 298 294 299 ++index; 295 300 } 296 301 297 302 return fallbackSpawnPoint; 298 303 } 299 304 300 305 return 0; 301 306 } 302 307 303 308 void CaptureTheFlag::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) 304 309 { 305 310 if (!player) 306 311 return; 307 312 308 313 // Set the team colour 309 314 std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player); … … 313 318 { 314 319 pawn->setRadarObjectColour(this->teamcolours_[it_player->second]); 315 320 316 321 std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects(); 317 322 for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it) … … 326 331 } 327 332 } 328 333 329 334 bool CaptureTheFlag::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2) 330 335 { … … 333 338 std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer()); 334 339 std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer()); 335 340 336 341 if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end()) 337 342 return (it1->second == it2->second); … … 339 344 return false; 340 345 } 341 346 342 347 int CaptureTheFlag::getTeam(PlayerInfo* player) 343 348 { -
code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.h
r9240 r9241 32 32 #include "OrxonoxPrereqs.h" 33 33 #include <set> 34 #include "core/CoreIncludes.h" 35 34 36 #include "tools/Timer.h" 35 37 #include "gametypes/TeamBaseMatch.h" 36 38 #include "infos/PlayerInfo.h" 37 39 #include "pickup/items/FlagPickup.h" 40 #include "pickup/PickupPrereqs.h" 38 41 39 42 namespace orxonox … … 42 45 { 43 46 public: 44 CaptureTheFlag(BaseObject* creator); 45 virtual ~CaptureTheFlag() {} 46 47 void tick(float dt); 48 49 void setConfigValues(); 50 51 virtual void playerEntered(PlayerInfo* player); 52 virtual bool playerLeft(PlayerInfo* player); 53 54 virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0); 55 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); 56 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0); 57 58 virtual void playerScored(PlayerInfo* player); 59 virtual void showPoints(); 60 virtual void endGame(); 61 62 void addTeamPoints(int team, int points); 63 int getTeamPoints(int team); 64 65 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); 66 67 int getTeam(PlayerInfo* player); 68 inline const ColourValue& getTeamColour(int teamnr) const 69 { return this->teamcolours_[teamnr]; } 70 71 protected: 72 virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const; 73 bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2); 74 75 std::map<PlayerInfo*, int> teamnumbers_; 76 std::vector<ColourValue> teamcolours_; 77 unsigned int teams_; 78 79 FlagPickup* flagTeamBlue; 80 FlagPickup* flagTeamRed; 81 //points for each team 82 int pointsTeam1_; 83 int pointsTeam2_; 84 47 CaptureTheFlag(BaseObject* creator); 48 virtual ~CaptureTheFlag() {} 49 50 void tick(float dt); 51 52 void setConfigValues(); 53 54 virtual void playerEntered(PlayerInfo* player); 55 virtual bool playerLeft(PlayerInfo* player); 56 57 virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0); 58 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); 59 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0); 60 61 virtual void playerScored(PlayerInfo* player); 62 virtual void showPoints(); 63 virtual void endGame(); 64 65 void addTeamPoints(int team, int points); 66 int getTeamPoints(int team); 67 68 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); 69 70 int getTeam(PlayerInfo* player); 71 inline const ColourValue& getTeamColour(int teamnr) const 72 { return this->teamcolours_[teamnr]; } 73 74 protected: 75 virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const; 76 bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2); 77 78 std::map<PlayerInfo*, int> teamnumbers_; 79 std::vector<ColourValue> teamcolours_; 80 unsigned int teams_; 81 82 FlagPickup* flagTeamBlue; 83 FlagPickup* flagTeamRed; 84 85 //points for each team 86 int pointsTeam1_; 87 int pointsTeam2_; 88 int teamnr; 89 85 90 }; 86 91 }
Note: See TracChangeset
for help on using the changeset viewer.