[Orxonox-commit 4252] r8923 - in code/branches/gamecontent: data/levels src/modules/weapons/projectiles src/orxonox/controllers src/orxonox/gametypes src/orxonox/worldentities
jo at orxonox.net
jo at orxonox.net
Fri Nov 4 10:44:57 CET 2011
Author: jo
Date: 2011-11-04 10:44:56 +0100 (Fri, 04 Nov 2011)
New Revision: 8923
Modified:
code/branches/gamecontent/data/levels/missionOne.oxw
code/branches/gamecontent/src/modules/weapons/projectiles/Rocket.cc
code/branches/gamecontent/src/orxonox/controllers/AIController.cc
code/branches/gamecontent/src/orxonox/controllers/AIController.h
code/branches/gamecontent/src/orxonox/controllers/ArtificialController.cc
code/branches/gamecontent/src/orxonox/gametypes/Mission.cc
code/branches/gamecontent/src/orxonox/gametypes/Mission.h
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h
code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc
code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h
Log:
Tutorial level enhancements (quest work, better texts are still needed), reverted old rocket hack, reworked configurable botlevel for the ai.
Modified: code/branches/gamecontent/data/levels/missionOne.oxw
===================================================================
--- code/branches/gamecontent/data/levels/missionOne.oxw 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/data/levels/missionOne.oxw 2011-11-04 09:44:56 UTC (rev 8923)
@@ -163,7 +163,7 @@
</QuestEffectBeacon>
<!--helper trigger to end the getHelp quest -->
- <DistanceTrigger name="getHelpEnd" position="-48900,0,0" distance=2000 target="SpaceShip" stayActive="false" delay=0.1>
+ <DistanceTrigger name="getHelpEnd" position="-47000,-1000,1300" distance=1400 target="SpaceShip" stayActive="false" delay=0.1>
<EventTrigger>
<events>
<trigger>
@@ -231,14 +231,14 @@
<LocalQuest id="missionOne.basicFlying">
<QuestDescription title="Flying" description="Can you see the blinking light straight ahead? Your goal is to fly through it.
-Use 'W' to accelerate and steer with your mouse.
+Use (W) to accelerate and steer with your mouse.
Further flying moves:
-S : break
-Q and E : roll
-Space : boost
+break (S)
+roll (Q) and (E)
+boost (Space)
-P.S: Whenever a new quest is added you can view it by pressing F3. Quit via Esc." failmessage="" completeMessage="" />
+Whenever a new quest is added you can view it by pressing (F3). Quit this menu via (Esc)." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.navigation" />
</complete-effects>
@@ -254,7 +254,13 @@
</LocalQuest>
<LocalQuest id ="missionOne.weaponsystemI">
- <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes. The four weapons are laser (left click), plasma (right click), self targeting rockets (middle click) and manual rockets (press 'T'). Attention if you use manual rockets: Press 'T' only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing 'T' once more." failmessage="" completeMessage="" />
+ <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes:
+1. laser (left click)
+2. plasma (right click)
+3. target seeking rockets (middle click)
+4. manual rockets (T)
+
+Attention if you use manual rockets: Press (T) only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing (T) once more." failmessage="" completeMessage="" />
<hints>
<QuestHint id="missionOne.weaponsystem.laser">
<QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." />
@@ -275,7 +281,8 @@
</LocalQuest>
<LocalQuest id="missionOne.weaponsystemII">
- <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates." failmessage="" completeMessage="" />
+ <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates.
+Find out which weapon is best to tackle moving targets. Get close enough." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.DuballStation" />
</complete-effects>
@@ -290,8 +297,11 @@
<LocalQuest id="missionOne.getHelp">
<QuestDescription title="Get Help" description="There are several enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer.
- There you might get help - as far as we know there should be a stronger spaceship docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer.
- Simply fly to the center of the Hydrogen Farmer, which is between its three legs." failmessage="" completeMessage="" />
+The Hydrogen Farmer is a large spaceship with three legs.
+There you might get help - as far as we know there should be a strong spaceruiser docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer.
+Simply fly to the center of the Hydrogen Farmer, which is between its three legs.
+
+How to dock: Accept the dialogue, take your hands off the keyboard and watch." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.getHome" />
</complete-effects>
@@ -299,26 +309,23 @@
<LocalQuest id="missionOne.getHome">
<QuestDescription title="Return ASAP" description="So you managed to get the spacecruiser. Use the portal to return to the DuBall Space Station.
- Hurry! Your help is desperately needed." failmessage="" completeMessage="" />
+Hurry! Your help is desperately needed." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.defence" />
</complete-effects>
</LocalQuest>
<LocalQuest id="missionOne.defence">
- <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack. Do not hesitate to attack or you will be the target.
- Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." />
+ <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack.
+Do not hesitate to fight or you will be the target.
+
+Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." />
</LocalQuest>
+<!-- --------------------- END OF QUESTS -------------------------- -->
-<!-- TUTORIAL-TODO: -->
-<!-- 1. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"-->
-<!-- 2. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"-->
-<!-- 3. Game handling (quests, knowing when a game is over :-), pausing, chat, ... ) --> <!--"F3", "F2", "ESC" -->
-<!-- 4. Extras (other things to discover) --> <!-- "Q","E","A","D","C", "CTRL", "", ... -->
-
<DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/>
- <SimpleNotification message="Press 'F3' to see your mission briefing.">
+ <SimpleNotification message="Press (F3) to see your mission briefing.">
<events>
<trigger>
<EventListener event="spawndelaytrigger0" />
@@ -326,6 +333,7 @@
</events>
</SimpleNotification>
+<!-- Blinking Billboard should be replaced with WAYPOINT -->
<BlinkingBillboard position="-900,640,600" frequency=0.4 amplitude=2 material="Flares/lensflare" colour="1,1,0">
<events>
<visibility>
@@ -365,7 +373,7 @@
</SimpleNotification>
<DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/>
- <SimpleNotification message="Use 'W' to accelerate and the mouse to steer.">
+ <SimpleNotification message="Use (W) to accelerate and the mouse to steer.">
<events>
<trigger>
<EventListener event="flying2" />
@@ -528,8 +536,7 @@
</events>
</SimpleNotification>
-
- <SimpleNotification message="Aim at the last target and press 'T'." broadcast="true">
+ <SimpleNotification message="Aim at the last target and press (T)." broadcast="true">
<events>
<trigger>
<EventListener event="boxtrigger3" />
@@ -893,7 +900,6 @@
</collisionShapes>
</SpaceShip>
- <Billboard position="-48900,0,0" material="Examples/Flare" colour="0.6,0,0" scale=3/>
<Dock position="-48900,0,0" roll=90 yaw=180 >
<animations>
<MoveToDockingTarget target="destroyer" />
@@ -913,16 +919,14 @@
</attached>
</Dock>
+<!-- at Objects: SpaceCruiser as docking target -->
<SpaceShip template="spaceshipspacecruiser" position="-48900,800,0" orientation="-0.14, 0.68, 0.68, 0.223" health="300" maxhealth="400" initialhealth="300" name="cruiser" >
<attached>
<DockingTarget name="spaceShip" />
</attached>
</SpaceShip>
-<!-- TESTBOX-->
-<!-- TESTBOX-->
-
<Trigger name="cruiserKilled" mode="and" stayActive="true">
<EventTrigger stayActive="true">
<events>
@@ -985,7 +989,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="Press 'Esc' and restart the mission." broadcast="true">
+ <SimpleNotification message="Press (Esc) and restart the mission." broadcast="true">
<events>
<trigger>
<EventListener event="earlyEnd" />
@@ -993,7 +997,6 @@
</events>
</SimpleNotification>
-
<!-- hydrogen farmer & docking END -->
@@ -1065,7 +1068,7 @@
</EventTrigger>
</DistanceTrigger>
- <SimpleNotification message="Return before it's too late. Boost with 'Space'." broadcast="true">
+ <SimpleNotification message="Return before it's too late. Boost with (Space)." broadcast="true">
<events>
<trigger>
<EventListener event=ondock />
@@ -1337,7 +1340,7 @@
</events>
</EventTrigger>
- <SimpleNotification message="Either quit by pressing 'Esc' or ..." broadcast="true">
+ <SimpleNotification message="Either quit by pressing (Esc) or ..." broadcast="true">
<events>
<trigger>
<EventListener event="postAttack1" />
@@ -1407,7 +1410,7 @@
- <SimpleNotification message="Rotate your ship. Press 'Q' or 'E'. " broadcast="true">
+ <SimpleNotification message="Rotate your ship. Press (Q) or (E). " broadcast="true">
<events>
<trigger>
<EventListener event=bonus1 />
@@ -1415,7 +1418,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="Switch the camera's position. Press 'C'. " broadcast="true">
+ <SimpleNotification message="Switch the camera's position. Press (C). " broadcast="true">
<events>
<trigger>
<EventListener event=bonus2 />
@@ -1423,7 +1426,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="360° view: press 'Ctrl' + use the mouse " broadcast="true">
+ <SimpleNotification message="360° view: press (Ctrl) + use the mouse " broadcast="true">
<events>
<trigger>
<EventListener event=bonus3 />
@@ -1455,7 +1458,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="Press 'Esc' and return to the main menu." broadcast="true">
+ <SimpleNotification message="Press (Esc) and return to the main menu." broadcast="true">
<events>
<trigger>
<EventListener event=bonus7 />
@@ -1483,9 +1486,9 @@
</Scene>
</Level>
<!-- TODO:
-! Quest Interface
+- Story & more precise Questmessages; more quest hints;
+- Colouring: Show who is friend or foe via the colour
+- Waypoints: show the player the way
- Foolproof text messages (e.g. verspätete Nachrichten unterdrücken)
-- Radar visibility & Hud Markers (done)
- End Tutorial, if either the Hydrogen Farmer or the SpaceCruiser gets destroyed. (~done)
-
-->
Modified: code/branches/gamecontent/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/gamecontent/src/modules/weapons/projectiles/Rocket.cc 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/modules/weapons/projectiles/Rocket.cc 2011-11-04 09:44:56 UTC (rev 8923)
@@ -65,7 +65,6 @@
this->localAngularVelocity_ = 0;
this->lifetime_ = 100.0f;
- this->bIsRocket_= true;
if (GameMode::isMaster())
{
@@ -134,7 +133,6 @@
{
if(this->isInitialized())
{
- this->bIsRocket_= false;
if (GameMode::isMaster())
{
this->destructionEffect();
Modified: code/branches/gamecontent/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/controllers/AIController.cc 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/controllers/AIController.cc 2011-11-04 09:44:56 UTC (rev 8923)
@@ -73,59 +73,7 @@
this->searchNewMaster();
}
- // search enemy
- random = rnd(maxrand);
- if (random < (15 + botlevel_* 20) && (!this->target_))
- this->searchNewTarget();
-
- // forget enemy
- random = rnd(maxrand);
- if (random < ((1-botlevel_)*6) && (this->target_))
- this->forgetTarget();
-
- // next enemy
- random = rnd(maxrand);
- if (random < (botlevel_*20) && (this->target_))
- this->searchNewTarget();
-
- // fly somewhere
- random = rnd(maxrand);
- if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
- // stop flying
- random = rnd(maxrand);
- if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
- this->bHasTargetPosition_ = false;
-
- // fly somewhere else
- random = rnd(maxrand);
- if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
- // shoot
- random = rnd(maxrand);
- if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
- this->bShooting_ = true;
-
- // stop shooting
- random = rnd(maxrand);
- if (random < ((1 - botlevel_)*25) && (this->bShooting_))
- this->bShooting_ = false;
-
- // boost
- random = rnd(maxrand);
- if (random < botlevel_*100 )
- this->boostControl();
-
- // update Checkpoints
- /*random = rnd(maxrand);
- if (this->defaultWaypoint_ && random > (maxrand-10))
- this->manageWaypoints();
- else //if(random > maxrand-10) //CHECK USABILITY!!*/
- if (this->waypoints_.size() == 0 )
- this->manageWaypoints();
-
+ this->defaultBehaviour(maxrand);
}
if (this->state_ == SLAVE)
@@ -135,8 +83,6 @@
if (this->state_ == MASTER)
{
-
-
this->commandSlaves();
if (this->specificMasterAction_ != NONE)
@@ -169,60 +115,9 @@
if(this->slaves_.size() < 3 && random < 20)
this->searchNewMaster();
- // search enemy
- random = rnd(maxrand);
- if (random < (botlevel_)*25 && (!this->target_))
- this->searchNewTarget();
-
- // forget enemy
- random = rnd(maxrand);
- if (random < (1-botlevel_)*6 && (this->target_))
- this->forgetTarget();
-
- // next enemy
- random = rnd(maxrand);
- if (random < 10 && (this->target_))
- this->searchNewTarget();
-
- // fly somewhere
- random = rnd(maxrand);
- if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
-
- // fly somewhere else
- random = rnd(maxrand);
- if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
- // shoot
- random = rnd(maxrand);
- if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
- {
- this->bShooting_ = true;
- this->forceFreeSlaves();
- }
-
- // stop shooting
- random = rnd(maxrand);
- if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
- this->bShooting_ = false;
-
- // boost
- random = rnd(maxrand);
- if (random < botlevel_*100 )
- this->boostControl();
-
- // update Checkpoints
- /*random = rnd(maxrand);
- if (this->defaultWaypoint_ && random > (maxrand-10))
- this->manageWaypoints();
- else //if(random > maxrand-10) //CHECK USABILITY!!*/
- if (this->waypoints_.size() == 0 )
- this->manageWaypoints();
+ this->defaultBehaviour(maxrand);
}
}
-
}
void AIController::tick(float dt)
@@ -320,8 +215,9 @@
else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant.
{ //Vector-implementation: mode_.back() == ROCKET;
if(controllable)
- {
- if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
+ {//Check wether the bot is controlling the rocket and if the timeout is over.
+ if(controllable->getIdentifier() == ClassByString("Rocket"))
+
{
this->follow();
this->timeout_ -= dt;
@@ -341,4 +237,72 @@
SUPER(AIController, tick, dt);
}
+ void AIController::defaultBehaviour(float maxrand)
+ { float random;
+ // search enemy
+ random = rnd(maxrand);
+ if (random < (botlevel_* 100) && (!this->target_))
+ this->searchNewTarget();
+
+ // forget enemy
+ random = rnd(maxrand);
+ if (random < ((1-botlevel_)*20) && (this->target_))
+ this->forgetTarget();
+
+ // next enemy
+ random = rnd(maxrand);
+ if (random < (botlevel_*30) && (this->target_))
+ this->searchNewTarget();
+
+ // fly somewhere
+ random = rnd(maxrand);
+ if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
+ this->searchRandomTargetPosition();
+
+ // stop flying
+ random = rnd(maxrand);
+ if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
+ this->bHasTargetPosition_ = false;
+
+ // fly somewhere else
+ random = rnd(maxrand);
+ if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+ this->searchRandomTargetPosition();
+
+ if (this->state_ == MASTER) // master: shoot
+ {
+ random = rnd(maxrand);
+ if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_))
+ {
+ this->bShooting_ = true;
+ this->forceFreeSlaves();
+ }
+ }
+ else
+ {
+ // shoot
+ random = rnd(maxrand);
+ if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
+ this->bShooting_ = true;
+ }
+
+ // stop shooting
+ random = rnd(maxrand);
+ if (random < ((1 - botlevel_)*50) && (this->bShooting_))
+ this->bShooting_ = false;
+
+ // boost
+ random = rnd(maxrand);
+ if (random < botlevel_*50 )
+ this->boostControl();
+
+ // update Checkpoints
+ /*random = rnd(maxrand);
+ if (this->defaultWaypoint_ && random > (maxrand-10))
+ this->manageWaypoints();
+ else //if(random > maxrand-10) //CHECK USABILITY!!*/
+ if (this->waypoints_.size() == 0 )
+ this->manageWaypoints();
+ }
+
}
Modified: code/branches/gamecontent/src/orxonox/controllers/AIController.h
===================================================================
--- code/branches/gamecontent/src/orxonox/controllers/AIController.h 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/controllers/AIController.h 2011-11-04 09:44:56 UTC (rev 8923)
@@ -43,15 +43,16 @@
AIController(BaseObject* creator);
virtual ~AIController();
- virtual void tick(float dt);
+ virtual void tick(float dt); //<! Carrying out the targets set in action().
protected:
- virtual void action();
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
+ void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
private:
static const float ACTION_INTERVAL;
- Timer actionTimer_;
+ Timer actionTimer_; //<! Regularly calls action().
};
}
Modified: code/branches/gamecontent/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/controllers/ArtificialController.cc 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/controllers/ArtificialController.cc 2011-11-04 09:44:56 UTC (rev 8923)
@@ -91,7 +91,7 @@
this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
this->bSetupWorked = false;
- this->botlevel_ = 0.2f;
+ this->botlevel_ = 0.5f;
this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
this->timeout_ = 0;
this->currentWaypoint_ = 0;
Modified: code/branches/gamecontent/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/Mission.cc 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/gametypes/Mission.cc 2011-11-04 09:44:56 UTC (rev 8923)
@@ -27,7 +27,8 @@
*/
#include "Mission.h"
-//#inclued "TeamGametype.h"
+//#include "TeamGametype.h"
+#include "items/Engine.h"
#include "core/CoreIncludes.h"
#include "network/Host.h"
@@ -69,7 +70,8 @@
{
Gametype::start();
-
+ /*for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it != ObjectList<Engine>::end(); ++it)
+ it->setActive(false); // works -> @sr :*/
this->gtinfo_->sendAnnounceMessage("Your mission has started!");
}
Modified: code/branches/gamecontent/src/orxonox/gametypes/Mission.h
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/Mission.h 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/gametypes/Mission.h 2011-11-04 09:44:56 UTC (rev 8923)
@@ -48,7 +48,7 @@
virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
inline void setLives(unsigned int amount)
{this->lives_ = amount;}
- inline unsigned int getLives()
+ inline unsigned int getLives()
{return this->lives_;}
protected:
Modified: code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc 2011-11-04 09:44:56 UTC (rev 8923)
@@ -43,6 +43,7 @@
RegisterObject(TeamGametype);
this->teams_ = 2;
+ this->allowFriendlyFire_ = false;
this->setConfigValues();
}
@@ -103,18 +104,18 @@
}
bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
- {
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
+ {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed
+ return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
}
bool TeamGametype::allowPawnDamage(Pawn* victim, Pawn* originator)
{
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
+ return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
}
bool TeamGametype::allowPawnDeath(Pawn* victim, Pawn* originator)
{
- return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
+ return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
}
SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
Modified: code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h 2011-11-04 09:44:56 UTC (rev 8923)
@@ -64,6 +64,7 @@
virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+ bool allowFriendlyFire_; //<! friendlyfire is per default switched off: friendlyFire_ = false;
std::map<PlayerInfo*, int> teamnumbers_;
std::vector<ColourValue> teamcolours_;
unsigned int teams_;
Modified: code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc 2011-11-04 09:44:56 UTC (rev 8923)
@@ -73,7 +73,6 @@
this->currentCameraPosition_ = 0;
this->bMouseLook_ = false;
this->mouseLookSpeed_ = 200;
- this->bIsRocket_ = false;
this->server_position_ = Vector3::ZERO;
this->client_position_ = Vector3::ZERO;
Modified: code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h 2011-11-02 15:33:24 UTC (rev 8922)
+++ code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h 2011-11-04 09:44:56 UTC (rev 8923)
@@ -162,8 +162,6 @@
virtual WorldEntity* getTarget()
{ return this->target_.get(); }
void setTargetInternal( uint32_t targetID );
- inline bool getRocket() const
- { return this-> bIsRocket_; }
protected:
virtual void preDestroy();
@@ -182,7 +180,6 @@
void destroyHud(void);
Ogre::SceneNode* cameraPositionRootNode_;
- bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
private:
void registerVariables();
More information about the Orxonox-commit
mailing list