Changeset 8942 for code/branches/gamecontent
- Timestamp:
- Nov 18, 2011, 6:52:21 PM (13 years ago)
- Location:
- code/branches/gamecontent
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamecontent/data/levels/fightInOurBack.oxw
r8891 r8942 110 110 name="Fight in our back" 111 111 description="Our fleet is far ahead of us. We need to get rid of all the enemies in its back, because we do not want our enemies to attack from everywhere. So let us clear this Sector!" 112 gametype= TeamDeathmatch112 gametype=Mission 113 113 > 114 114 <templates> … … 214 214 <?lua for i=0,0,1 do 215 215 x=800 216 health= 2050216 health=1500 217 217 ?> 218 218 <!--Transporter 1--> … … 239 239 240 240 <?lua for j=0,1,1 do 241 health=1 600241 health=1300 242 242 x=800 243 243 z=j*300 -
code/branches/gamecontent/data/levels/missionOne.oxw
r8932 r8942 57 57 <events> 58 58 <trigger> 59 <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /> 59 <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff> 60 <EventTrigger invert=true> 61 <events> 62 <trigger> 63 <EventListener event="attack" /> 64 </trigger> 65 </events> 66 </EventTrigger> 67 </TeamSpawnPoint> 60 68 </trigger> 61 69 </events> … … 163 171 </QuestEffectBeacon> 164 172 173 <QuestEffectBeacon times=1> <!-- alternative quest end --> 174 <effects> 175 <CompleteQuest questId="missionOne.DuballStation" /> 176 </effects> 177 <events> 178 <execute> 179 <EventListener event=toHydroFarmer /> 180 </execute> 181 </events> 182 </QuestEffectBeacon> 183 165 184 <!--helper trigger to end the getHelp quest --> 166 185 <DistanceTrigger name="getHelpEnd" position="-47000,-1000,1300" distance=1400 target="SpaceShip" stayActive="false" delay=0.1> … … 228 247 </events> 229 248 </QuestEffectBeacon> 249 250 <!-- End the quest after own destruction of spacecruiser --> 251 <QuestEffectBeacon position="-100,0,0" times=1> 252 <effects> 253 <FailQuest questId="missionOne.getHelp" /> 254 </effects> 255 <events> 256 <execute> 257 <EventListener event="failQuest" /> 258 </execute> 259 </events> 260 <attached> 261 <DistanceTrigger name="failQuest" position="-47000,-1000,1300" distance=2300 target="SpaceShip"> 262 <EventTrigger> 263 <events> 264 <trigger> 265 <EventListener event="gameEnd" /> 266 </trigger> 267 </events> 268 </EventTrigger> 269 </DistanceTrigger> 270 </attached> 271 </QuestEffectBeacon> 272 273 230 274 231 275 … … 335 379 336 380 <!-- Blinking Billboard should be replaced with WAYPOINT --> 337 <BlinkingBillboard position="-900,640,600" frequency=0. 4 amplitude=2 material="Flares/lensflare" colour="1,1,0">381 <BlinkingBillboard position="-900,640,600" frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05"> 338 382 <events> 339 383 <visibility> … … 466 510 467 511 <!-- @Objects: 4 boxes (uncontrolled pawns) --> 468 <Pawn health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >512 <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box > 469 513 <events> 470 514 <visibility> … … 480 524 </Pawn> 481 525 482 <Pawn health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box visible="true">526 <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box visible="true"> 483 527 <events> 484 528 <visibility> … … 493 537 </collisionShapes> 494 538 </Pawn> 495 <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >539 <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1> 496 540 <events> 497 541 <visibility> … … 506 550 </collisionShapes> 507 551 </Pawn> 508 <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >552 <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1> 509 553 <events> 510 554 <visibility> … … 889 933 890 934 <!-------------------------------------- PART FOUR : Get Help ---------------------------------------> 891 <!-- TODO: cruiserKilled --> 935 892 936 <Trigger name="famer1" mode="and" stayActive="true"> 893 937 <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 /> … … 932 976 <!-- @Objects: HYDROGEN FARMER & DOCKING --> 933 977 <SpaceShip 978 team=0 934 979 position="-48900,100,0" 935 980 roll=90 yaw=0 pitch=20 … … 1006 1051 <SpaceShip 1007 1052 template = "spaceshipspacecruiser" 1053 team = "0" 1008 1054 position = "-48900,800,0" 1009 1055 orientation = "-0.14, 0.68, 0.68, 0.223" … … 1150 1196 1151 1197 <!-------------------------------------- The attack ---------------------------------------> 1152 1153 1198 <!-- TODO: 1154 1199 - update spaceshipTransporter 1155 1200 - bots do friendly fire (is drone function reusable?) 1156 1201 --> 1202 1203 <!-- Fallback Spawnpoint: on cruiserdeath caused by pirates. Unfortunately unstable behaviour concerning activity. --> 1204 <TeamSpawnPoint team=0 position="2000,1500,-1500" direction="-1,-1,1" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser> 1205 <events> 1206 <activity> 1207 <EventListener event="attack" /> 1208 </activity> 1209 </events> 1210 </TeamSpawnPoint> 1157 1211 1158 1212 <!-- @Triggers: toHydroFamer <-> first portal usage … … 1607 1661 </Scene> 1608 1662 </Level> 1663 1609 1664 <!-- TODO: 1610 1665 - Story & more precise Questmessages; more quest hints; fail-quest; -
code/branches/gamecontent/data/levels/pirateAttack.oxw
r8706 r8942 28 28 name="Dani's Testlevel" 29 29 description="Erste Versuche mit den Quests" 30 gametype= TeamDeathmatch30 gametype=Mission 31 31 > 32 32 … … 252 252 </events> 253 253 </QuestEffectBeacon> 254 <!--Stick found--> 254 <!--Stick found-->zz 255 255 <QuestEffectBeacon position="4800,5785,-10725" times=1> 256 256 <attached> -
code/branches/gamecontent/src/orxonox/controllers/ArtificialController.cc
r8923 r8942 42 42 #include "gametypes/TeamDeathmatch.h" 43 43 #include "gametypes/Dynamicmatch.h" 44 #include "gametypes/Mission.h" 44 45 #include "controllers/WaypointPatrolController.h" 45 46 #include "controllers/NewHumanController.h" … … 996 997 if (entity2->getPlayer()) 997 998 team2 = tdm->getTeam(entity2->getPlayer()); 999 } 1000 1001 Mission* miss = orxonox_cast<Mission*>(gametype); 1002 if (miss) 1003 { 1004 if (entity1->getPlayer()) 1005 team1 = miss->getTeam(entity1->getPlayer()); 1006 1007 if (entity2->getPlayer()) 1008 team2 = miss->getTeam(entity2->getPlayer()); 998 1009 } 999 1010 -
code/branches/gamecontent/src/orxonox/controllers/HumanController.cc
r8858 r8942 195 195 this->boosting_ = true; 196 196 this->boostingTimeout_.startTimer(); 197 198 this->controllableEntity_->boost(this->boosting_);197 if(this->controllableEntity_) 198 this->controllableEntity_->boost(this->boosting_); 199 199 // orxout() << "Start boosting" << endl; 200 200 } … … 209 209 this->boosting_ = false; 210 210 this->boostingTimeout_.stopTimer(); 211 212 this->controllableEntity_->boost(this->boosting_);211 if(this->controllableEntity_) 212 this->controllableEntity_->boost(this->boosting_); 213 213 // orxout() << "Stop boosting" << endl; 214 214 } -
code/branches/gamecontent/src/orxonox/gametypes/Mission.cc
r8941 r8942 90 90 91 91 void Mission::setTeams() 92 { 92 {//Set pawn-colours 93 93 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 94 this->setObjectColour(*it); 94 { 95 Pawn* pawn = static_cast<Pawn*>(*it); 96 if(!pawn) continue; 97 this->setDefaultObjectColour(pawn); 98 } 95 99 } 96 100 -
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
r8941 r8942 35 35 #include "worldentities/TeamSpawnPoint.h" 36 36 #include "worldentities/pawns/Pawn.h" 37 #include "worldentities/ControllableEntity.h" 37 38 #include "controllers/ArtificialController.h" 38 39 … … 117 118 { 118 119 if(true)//check if dead player is allowed to enter -> if maximum nr of players is exceeded & player was not in game before: disallow 119 continue;120 //continue; 120 121 if (it->second.state_ == PlayerState::Dead) 121 122 { … … 249 250 if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size())) 250 251 { 251 if (pawn) 252 { 253 pawn->setRadarObjectColour(this->teamcolours_[it_player->second]); 254 255 std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects(); 256 for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it) 257 { 258 if ((*it)->isA(Class(TeamColourable))) 259 { 260 TeamColourable* tc = orxonox_cast<TeamColourable*>(*it); 261 tc->setTeamColour(this->teamcolours_[it_player->second]); 262 } 263 } 264 } 265 } 266 } 267 268 void TeamGametype::setObjectColour(Pawn* pawn) 252 this->colourPawn(pawn, it_player->second); 253 } 254 } 255 256 void TeamGametype::setDefaultObjectColour(Pawn* pawn) 269 257 { 270 258 if(pawn == NULL) 271 259 return; 260 261 int teamnumber = pawn->getTeam(); 262 263 if(teamnumber >= 0) 264 { 265 this->colourPawn(pawn, teamnumber); return; 266 } 272 267 //get Pawn's controller 273 ArtificialController* controller = orxonox_cast<ArtificialController*>(pawn); 274 if(controller == NULL) 268 ControllableEntity* entity = orxonox_cast<ControllableEntity*>(pawn); 269 270 Controller* controller = 0; 271 if (entity->getController()) 272 controller = entity->getController(); 273 else if (entity->getXMLController()) 274 controller = entity->getXMLController(); 275 else 275 276 return; 277 278 ArtificialController* artificial = orxonox_cast<ArtificialController*>(controller); 276 279 //get Teamnumber - get the data 277 int teamnumber= controller->getTeam(); 278 if(teamnumber < 0) 280 if(artificial == NULL) 279 281 return; 282 teamnumber= artificial->getTeam(); 283 280 284 //set ObjectColour 281 pawn->setRadarObjectColour(this->teamcolours_[teamnumber]); 285 this->colourPawn(pawn, teamnumber); 286 } 287 288 void TeamGametype::colourPawn(Pawn* pawn, int teamNr) 289 {// catch no-colouring-case and wrong input 290 if(teamNr < 0 || pawn == NULL) return; 291 pawn->setRadarObjectColour(this->teamcolours_[teamNr]); 282 292 283 293 std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects(); … … 287 297 { 288 298 TeamColourable* tc = orxonox_cast<TeamColourable*>(*it); 289 tc->setTeamColour(this->teamcolours_[team number]);299 tc->setTeamColour(this->teamcolours_[teamNr]); 290 300 } 291 301 } 292 302 } 293 303 294 295 304 } -
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h
r8941 r8942 75 75 std::map<PlayerInfo*, bool> allowedInGame_; //!< Only those players are allowed to spawn which are listed here as 'true'. 76 76 void setTeamColour(PlayerInfo* player, Pawn* pawn); 77 void setObjectColour(Pawn* pawn); 77 void setDefaultObjectColour(Pawn* pawn); 78 void colourPawn(Pawn* pawn, int teamNr); 78 79 }; 79 80 } -
code/branches/gamecontent/src/orxonox/interfaces/CMakeLists.txt
r8706 r8942 6 6 PickupListener.cc 7 7 RadarViewable.cc 8 PartyMember.cc 8 9 ) -
code/branches/gamecontent/src/orxonox/interfaces/PartyMember.h
r8907 r8942 52 52 public: 53 53 PartyMember(); 54 virtual ~PartyMember() {}54 virtual ~PartyMember(); 55 55 56 56 /** -
code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.cc
r8904 r8942 60 60 this->bReload_ = false; 61 61 62 this->team_ = -1; 62 63 this->health_ = 0; 63 64 this->maxHealth_ = 0; … … 110 111 SUPER(Pawn, XMLPort, xmlelement, mode); 111 112 113 XMLPortParam(Pawn, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1); 114 112 115 XMLPortParam(Pawn, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100); 113 116 XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200); … … 129 132 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 130 133 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 134 135 131 136 } 132 137 -
code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.h
r8891 r8942 35 35 #include "interfaces/PickupCarrier.h" 36 36 #include "interfaces/RadarViewable.h" 37 #include "interfaces/PartyMember.h" 37 38 #include "worldentities/ControllableEntity.h" 38 39 … … 40 41 { // tolua_export 41 42 class _OrxonoxExport Pawn // tolua_export 42 : public ControllableEntity, public RadarViewable, public PickupCarrier 43 : public ControllableEntity, public RadarViewable, public PickupCarrier//, public PartyMember 43 44 { // tolua_export 44 45 friend class WeaponSystem; … … 53 54 inline bool isAlive() const 54 55 { return this->bAlive_; } 56 57 inline void setTeam(int team) 58 { this->team_ = team; } 59 inline float getTeam() const 60 { return this->team_; } 55 61 56 62 virtual void setHealth(float health); … … 194 200 { return NULL; } 195 201 202 int team_; 203 196 204 float health_; 197 205 float maxHealth_;
Note: See TracChangeset
for help on using the changeset viewer.