Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2012, 4:33:13 PM (13 years ago)
Author:
landauf
Message:

merged presentation2012 to presentation2012merge

Location:
code/branches/presentation2012merge
Files:
20 edited
14 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge

  • code/branches/presentation2012merge/data/gui/scripts/AudioMenu.lua

    r8351 r9269  
    3434    table.insert(themeList, "8-Bit Style")
    3535    table.insert(themeList, "Corny Jazz")
     36    table.insert(themeList, "Metal")
    3637    for k,v in pairs(themeList) do
    3738        item = CEGUI.createListboxTextItem(v)
     
    4546    elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
    4647        listboxwindow:setItemSelectState(3,true)
     48    elseif orxonox.getConfig("MoodManager", "mood_") == "metal" then
     49        listboxwindow:setItemSelectState(4,true)
    4750    else
    4851        listboxwindow:setItemSelectState(0,true)
     
    178181    elseif listboxwindow:isItemSelected(3) then
    179182        orxonox.config("MoodManager", "mood_", "jazzy")
     183    elseif listboxwindow:isItemSelected(4) then
     184        orxonox.config("MoodManager", "mood_", "metal")
    180185    else
    181186        orxonox.config("MoodManager", "mood_", "default")
  • code/branches/presentation2012merge/data/gui/scripts/SingleplayerMenu.lua

    r9251 r9269  
    22
    33local P = createMenuSheet("SingleplayerMenu")
    4 
     4P.loadAlong = {"ShipSelectionMenu"}
    55P.levelList = {}
    66P.activeTabIndexes = {}
    77P.scrollbarWidth = 13
     8selectedlevel = {} -- level for ship selection
    89
    910function P.onLoad()
     
    4647    while index < size do
    4748        level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
    48         if level ~= nil then
     49        if (level ~= nil and level:getXMLFilename() ~= "_temp.oxw") then
     50            --os.execute("echo " .. level:getXMLFilename() .." >> ~/outputorx")
    4951            local levelXMLFilename = level:getXMLFilename()
    5052            -- create an imageset for each screenshot
     
    141143
    142144function P.SingleplayerStartButton_clicked(e)
    143     local level = P.SingleplayerGetSelectedLevel()
    144     if level ~= nil then
    145         orxonox.execute("startGame " .. level:getXMLFilename())
    146         hideAllMenuSheets()
     145    selectedlevel = P.SingleplayerGetSelectedLevel()
     146    if selectedlevel ~= nil then
     147        if selectedlevel:hasTag("shipselection") then
     148            local shipSelectionMenu = showMenuSheet("ShipSelectionMenu", true)
     149            shipSelectionMenu:update()
     150        else
     151            orxonox.execute("startGame " .. selectedlevel:getXMLFilename())
     152            hideAllMenuSheets()
     153        end
    147154    end
    148155end
  • code/branches/presentation2012merge/data/levels/includes/pickups.oxi

    r8713 r9269  
    210210</PickupRepresentation>
    211211
     212<!-- DamageBoost Pickup -->
     213
     214<PickupRepresentation
     215    pickupName = "Small DamageBoost Pickup"
     216    pickupDescription = "Multiplies the ship damage with 2."
     217    spawnerTemplate = "smalldamageboostpickupRepresentation"
     218    inventoryRepresentation = "SmallDamageBoost"
     219>
     220    <pickup>
     221        <DamageBoostPickup template=smalldamageboostpickup />
     222    </pickup>
     223</PickupRepresentation>
     224
     225<PickupRepresentation
     226    pickupName = "Medium DamageBoost Pickup"
     227    pickupDescription = "Multiplies the ship damage with 5."
     228    spawnerTemplate = "mediumdamageboostpickupRepresentation"
     229    inventoryRepresentation = "MediumDamageBoost"
     230>
     231    <pickup>
     232        <DamageBoostPickup template=mediumdamageboostpickup />
     233    </pickup>
     234</PickupRepresentation>
     235
     236<PickupRepresentation
     237    pickupName = "Large DamageBoost Pickup"
     238    pickupDescription = "Multiplies the ship damage with 7."
     239    spawnerTemplate = "largedamageboostpickupRepresentation"
     240    inventoryRepresentation = "LargeDamageBoost"
     241>
     242    <pickup>
     243        <DamageBoostPickup template=largedamageboostpickup />
     244    </pickup>
     245</PickupRepresentation>
     246
    212247<!-- Shrink Pickup -->
    213248
  • code/branches/presentation2012merge/data/levels/pickups.oxw

    r9016 r9269  
    168168      </pickup>
    169169    </PickupSpawner>
     170   
     171    <!-- DamageBoost pickup -->
     172   
     173    <PickupSpawner position="-50,75,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     174      <pickup>
     175        <DamageBoostPickup template=smalldamageboostpickup />
     176      </pickup>
     177    </PickupSpawner>
     178   
     179      <PickupSpawner position="-50,100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     180      <pickup>
     181        <DamageBoostPickup template=mediumdamageboostpickup />
     182      </pickup>
     183    </PickupSpawner>
     184   
     185      <PickupSpawner position="-50,125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     186      <pickup>
     187        <DamageBoostPickup template=largedamageboostpickup />
     188      </pickup>
     189    </PickupSpawner>
     190   
    170191   
    171192    <!-- Other pickups -->
     
    206227      </pickup>
    207228    </PickupSpawner>
     229   
     230    <!-- @Objects: 4 boxes (uncontrolled pawns) -->
     231    <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
     232        <events>
     233          <visibility>
     234            <EventListener event="flying4" />
     235          </visibility>
     236        </events>
     237        <attached>
     238            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     239        </attached>
     240        <collisionShapes>
     241            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     242        </collisionShapes>
     243    </Pawn>
     244
     245    <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
     246        <events>
     247          <visibility>
     248            <EventListener event="flying4" />
     249          </visibility>
     250        </events>
     251        <attached>
     252           <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     253        </attached>
     254        <collisionShapes>
     255            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     256        </collisionShapes>
     257    </Pawn>
     258
     259    <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
     260        <events>
     261          <visibility>
     262            <EventListener event="flying4" />
     263          </visibility>
     264        </events>
     265        <attached>
     266           <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     267        </attached>
     268        <collisionShapes>
     269            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     270        </collisionShapes>
     271    </Pawn>
     272
     273    <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
     274        <events>
     275          <visibility>
     276            <EventListener event="flying4" />
     277          </visibility>
     278        </events>
     279        <attached>
     280            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     281        </attached>
     282        <collisionShapes>
     283           <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     284        </collisionShapes>
     285    </Pawn>
    208286
    209287    <!--StaticEntity position="0,-200,0" direction="0,-1,0" collisionType=static mass=500 friction=0.01 >
  • code/branches/presentation2012merge/data/levels/portals.oxw

    r9016 r9269  
    2929        <PortalEndPoint>
    3030            <attached>
    31                 <Billboard material="Portals/Default" />
     31                <Model mesh="Spacegate.mesh" yaw="90"/>
    3232            </attached>
    3333        </PortalEndPoint>
  • code/branches/presentation2012merge/data/levels/teamDeathMatch.oxw

    r9016 r9269  
    2525  <Scene
    2626   ambientlight = "0.7, 0.6, 0.6"
    27    skybox       = "Orxonox/skypanoramagen1"
     27   skybox       = "Orxonox/creeper1"
    2828  >
    2929    <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" />
  • code/branches/presentation2012merge/data/levels/templates/pickupRepresentationTemplates.oxt

    r8706 r9269  
    215215    </PickupRepresentation>
    216216</Template>
     217
     218<!-- DamageBoost pickups -->
     219
     220<Template name=smalldamageboostpickupRepresentation>
     221    <PickupRepresentation>
     222        <spawner-representation>
     223            <StaticEntity>
     224                <attached>
     225                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
     226                        <attached>
     227                            <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageSmall" scale=0.7 />
     228                        </attached>
     229                    </Billboard>
     230                </attached>
     231            </StaticEntity>
     232        </spawner-representation>
     233    </PickupRepresentation>
     234</Template>
     235
     236<Template name=smalldamageboostpickup>
     237  <DamageBoostPickup
     238    duration = 10.0
     239    damageMultiplier = 2.0
     240    activationType = "immediate"
     241    durationType = "continuous"
     242  />
     243</Template>
     244
     245<Template name=mediumdamageboostpickupRepresentation>
     246    <PickupRepresentation>
     247        <spawner-representation>
     248            <StaticEntity>
     249                <attached>
     250                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
     251                        <attached>
     252                            <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageMedium" scale=0.7 />
     253                        </attached>
     254                    </Billboard>
     255                </attached>
     256            </StaticEntity>
     257        </spawner-representation>
     258    </PickupRepresentation>
     259</Template>
     260
     261<Template name=mediumdamageboostpickup>
     262  <DamageBoostPickup
     263    duration = 10.0
     264    damageMultiplier = 5.0
     265    activationType = "immediate"
     266    durationType = "continuous"
     267  />
     268</Template>
     269
     270<Template name=largedamageboostpickupRepresentation>
     271    <PickupRepresentation>
     272        <spawner-representation>
     273            <StaticEntity>
     274                <attached>
     275                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
     276                        <attached>
     277                            <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageLarge" scale=0.7 />
     278                        </attached>
     279                    </Billboard>
     280                </attached>
     281            </StaticEntity>
     282        </spawner-representation>
     283    </PickupRepresentation>
     284</Template>
     285
     286<Template name=largedamageboostpickup>
     287  <DamageBoostPickup
     288    duration = 10.0
     289    damageMultiplier = 7.0
     290    activationType = "immediate"
     291    durationType = "continuous"
     292  />
     293</Template>
     294
    217295
    218296<!-- Speed pickups -->
  • code/branches/presentation2012merge/data/levels/templates/spaceshipPirate.oxt

    r8858 r9269  
    3535   angularDamping    = 0.9999999
    3636  >
     37
    3738    <engines>
    3839      <MultiStateEngine position=" 0, 0, 0" template=spaceshippirateengine />
    3940    </engines>
    4041    <attached>
    41       <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="pirate.mesh" />
     42      <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=20 mesh="pirate.mesh" />
    4243      <BlinkingBillboard position=" 12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 />
    4344      <BlinkingBillboard position="-12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 phase="90"/>
  • code/branches/presentation2012merge/data/levels/theTimeMachine.oxw

    r9016 r9269  
    5757?>
    5858  </SpaceShip>
     59</Template>
     60
     61<Template name=spaceshipassffengine baseclass=MultiStateEngine>
     62  <MultiStateEngine
     63   boostfactor    = 2
     64
     65   speedfront     = 150
     66   speedback      =  50
     67   speedleftright =  50
     68   speedupdown    =  50
     69
     70   defEngineSndNormal = "sounds/Engine_low.ogg"
     71   defEngineSndBoost = "sounds/Engine_high.ogg"
     72
     73   accelerationfront     = 500
     74   accelerationbrake     = 500
     75   accelerationback      =  125
     76   accelerationleftright =  125
     77   accelerationupdown    =  125
     78  >
     79
     80  </MultiStateEngine>
    5981</Template>
    6082
  • code/branches/presentation2012merge/data/levels/tutorial.oxw

    r9016 r9269  
    22 name = "Coding Tutorial"
    33 description = "Level for the coding tutorial."
    4  tags = "tutorial"
     4 tags = "tutorial, shipselection"
    55 screenshot = "codingtutorial.png"
     6 startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser"
    67/>
    78
     
    1011  include("stats.oxo")
    1112  include("templates/spaceshipAssff.oxt")
     13  include("templates/spaceshipGhost.oxt")
     14  include("templates/spaceshipSpacecruiser.oxt")
    1215  include("templates/lodInformation.oxt")
    1316?>
     
    2326   skybox       = "Orxonox/skypanoramagen1"
    2427  >
    25 
    26 
    27 
    28 
    2928<Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
    3029  <attached>
     
    5352      for i = 1, 10, 1 do
    5453    ?>
    55       <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 />
     54      <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=shipselection />
    5655    <?lua end ?>
    5756
  • code/branches/presentation2012merge/src/modules/CMakeLists.txt

    r8706 r9269  
    3838ADD_SUBDIRECTORY(weapons)
    3939ADD_SUBDIRECTORY(docking)
     40ADD_SUBDIRECTORY(towerdefense)
  • code/branches/presentation2012merge/src/modules/pickup/PickupPrereqs.h

    r8706 r9269  
    8686    class ShieldPickup;
    8787    class ShrinkPickup;
    88 
     88    class DamageBoostPickup;
    8989}
    9090
  • code/branches/presentation2012merge/src/modules/pickup/items/CMakeLists.txt

    r8706 r9269  
    77  ShieldPickup.cc
    88  ShrinkPickup.cc
     9  DamageBoostPickup.cc
    910)
  • code/branches/presentation2012merge/src/modules/pickup/items/SpeedPickup.h

    r8727 r9269  
    112112        private:
    113113            void initialize(void); //!< Initializes the member variables.
    114             SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceSHip, and throw an error message if the conversion fails.
     114            SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    115115
    116116            Timer durationTimer_; //!< Timer.
  • code/branches/presentation2012merge/src/orxonox/LevelInfo.cc

    r9016 r9269  
    9393            LevelInfoItem::possibleTags_s.insert("gametype");
    9494            LevelInfoItem::possibleTags_s.insert("minigame");
     95            LevelInfoItem::possibleTags_s.insert("shipselection");
    9596        }
    9697    }
     
    110111
    111112        this->tagsUpdated();
     113    }
     114    /**
     115    @brief
     116        Set the starting ship models of the level
     117    @param tags
     118        A comma-seperated string of all the allowed ship models for the shipselection.
     119    */
     120    void LevelInfoItem::setShips(const std::string& ships)
     121    {
     122        SubString substr = SubString(ships, ",", " "); // Split the string into tags.
     123        const std::vector<std::string>& strings = substr.getAllStrings();
     124        for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
     125            this->addShip(*it, false);
     126
     127        this->shipsUpdated();
    112128    }
    113129
     
    137153    /**
    138154    @brief
     155        Add a ship model to allowed models for the shipselection
     156    @param ship
     157        The ship model to be added.
     158    @param update
     159        Whether the comma-seperated string of all ship models should be updated. Default is true.
     160    @return
     161        Returns true if the ship was successfully added, if the ship was already present it returns false.
     162    */
     163    bool LevelInfoItem::addShip(const std::string& ship, bool update)
     164    {
     165        bool success = this->ships_.insert(ship).second;
     166        if(update && success)
     167            this->shipsUpdated();
     168           
     169        return success;
     170    }
     171
     172
     173    /**
     174    @brief
    139175        Updates the comma-seperated string of all tags, if the set of tags has changed.
    140176    */
     
    155191    }
    156192
     193    /**
     194    @brief
     195        Updates the comma-seperated string of all ships, if the set of tags has changed.
     196    */
     197    void LevelInfoItem::shipsUpdated(void)
     198    {
     199        std::stringstream stream;
     200        std::set<std::string>::iterator temp;
     201        for(std::set<std::string>::iterator it = this->ships_.begin(); it != this->ships_.end(); )
     202        {
     203            temp = it;
     204            if(++it == this->ships_.end()) // If this is the last ship we don't add a comma.
     205                stream << *temp;
     206            else
     207                stream << *temp << ", ";
     208        }
     209
     210        this->startingShipsString_ = std::string(stream.str());
     211    }
    157212    // LevelInfo
    158213
     
    192247        XMLPortParam(LevelInfo, "screenshot", setScreenshot, getScreenshot, xmlelement, mode);
    193248        XMLPortParam(LevelInfo, "tags", setTags, getTags, xmlelement, mode);
     249        XMLPortParam(LevelInfo, "startingships", setShips, getShips, xmlelement, mode);
    194250    }
    195251
     
    207263        info->setScreenshot(this->getScreenshot());
    208264        info->setTags(this->getTags());
     265        info->setShips(this->getShips());
    209266        return info;
    210267    }
  • code/branches/presentation2012merge/src/orxonox/LevelInfo.h

    r9016 r9269  
    2424 *   Co-authors:
    2525 *      ...
    26  *
     26 *   
    2727 */
    2828
     
    4343
    4444#include "core/BaseObject.h"
     45#include <iostream>
     46#include <fstream>
    4547#include "core/OrxonoxClass.h"
    4648
     
    115117            */
    116118            inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export
    117 
     119 
     120            void setShips(const std::string& ships); //!< Set the starting ship models of the level
     121            bool addShip(const std::string& ship, bool update = true); //!< Add a model to shipselection
     122            /**
     123            @brief Get the set of starting ship models the Level allows
     124            @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
     125            */
     126            inline const std::string& getShips(void) const
     127                { return this->startingShipsString_; }   
     128            /**
     129            @brief Get whether the Level allows a specific starting ship model
     130            @param ship The ship model for which is checked.
     131            @return Returns true if the Level allows the input ship model
     132            */
     133            inline bool hasShip(const std::string& ship) const { return this->ships_.find(ship) != this->ships_.end(); } // tolua_export       
    118134            /**
    119135            @brief Get the XML-filename of the Level.
    120136            @return Returns the XML-filename (including *.oxw extension) of the Level.
    121137            */
     138
    122139            inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
     140            inline void selectShip (const std::string& ship) { this->changeShip(ship); } // tolua_export
     141
    123142
    124143        protected:
     
    133152
    134153        private:
     154
     155            inline void changeShip (const std::string& model) {
     156                static std::string shipSelectionTag = "shipselection";
     157                //HACK: Read Level XML File, find "shipselection", replace with ship model
     158                std::string levelPath = "../levels/";
     159                levelPath.append(this->getXMLFilename());
     160                std::string tempPath = "../levels/";
     161                tempPath.append("_temp.oxw");
     162                orxout(user_status) << levelPath << endl;
     163                orxout(user_status) << tempPath << endl;
     164                std::ifstream myLevel (levelPath.c_str());
     165                        std::ofstream tempLevel (tempPath.c_str());
     166                        while(!myLevel.eof())
     167                        {
     168                                std::string buff;
     169                                std::getline(myLevel, buff);
     170                                std::string pawndesignString = "pawndesign=";
     171                                size_t found = buff.find(pawndesignString.append(shipSelectionTag));
     172                                if (found!= std::string::npos)
     173                                        buff = buff.substr(0, found + 11) + model + buff.substr(found+11+shipSelectionTag.length(), std::string::npos);
     174                                tempLevel.write(buff.c_str(), buff.length());
     175                                tempLevel << std::endl;
     176                        }
     177                        myLevel.close();
     178                        tempLevel.close();
     179                        orxout(user_status) << "done" << endl;
     180            }
    135181            void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    136 
     182            void shipsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    137183            static void initializeTags(void); //!< Initialize the set of allowed tags.
    138184            /**
     
    152198            std::set<std::string> tags_; //!< The set of tags the Level is tagged with.
    153199            std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with.
     200            std::set<std::string> ships_; //!< The set of starting ship models the Level allows.
     201            std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection.           
    154202    }; // tolua_export
    155203
     
    161209        - @b description The description of the level.
    162210        - @b screenshot The screenshot of the level.
    163         - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>.
    164 
     211        - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>, <em>shipselection</em>.
     212        - @b (optional) startingships The comma-seperated string of starting ship models
    165213        An example would be:
    166214        @code
     
    176224    @author
    177225        Damian 'Mozork' Frick
    178 
     226        @edit
     227                Matthias Hutter
    179228    @ingroup Orxonox
    180229    */
     
    223272            inline const std::string& getTags(void) const
    224273                { return this->LevelInfoItem::getTags(); }
    225 
     274            /**
     275            @brief Set the starting ship models of the level
     276            @param A comma-seperated string of all the allowed ship models for the shipselection.
     277            */
     278            inline void setShips(const std::string& ships)
     279                { this->LevelInfoItem::setShips(ships); }
     280            /**
     281            @brief Get the starting ship models of the level
     282            @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
     283            */
     284            inline const std::string& getShips(void) const
     285                { return this->LevelInfoItem::getShips(); }             
    226286            LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object.
    227 
    228287    };
    229288
  • code/branches/presentation2012merge/src/orxonox/controllers/FormationController.cc

    r9265 r9269  
    280280        }
    281281
    282         Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
     282        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
    283283        float distance = (target - this->getControllableEntity()->getPosition()).length();
    284 
     284                if(coord.x < 0.0001 && coord.y < 0.0001)
     285                {
     286                        // if the ship reaches a direction very close to the direct one, set it to the direct one
     287                        Vector3 v_temp = this->getControllableEntity()->getPosition();
     288                        Quaternion quat = v_temp.getRotationTo(target);
     289                        this->getControllableEntity()->rotate(quat);
     290                }
    285291
    286292        if(this->state_ == FREE)
     
    289295            {
    290296                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
    291                 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
    292                 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
    293             }
    294 
    295             if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
     297                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * coord.x * 2);
     298                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * coord.y * 2);
     299            }
     300
     301            if (this->target_ && distance <  200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
    296302            {
    297303              this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
     
    305311            if (this->target_ || distance > 10)
    306312            {
    307                 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
    308                 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
     313                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * coord.x * 2);
     314                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * coord.y * 2);
    309315            }
    310316
     
    318324
    319325        if(this->state_ == SLAVE)
    320         {
    321 
    322            this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
    323            this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
    324 
    325             if (distance < 300)
    326             {
    327                  if (bHasTargetOrientation_)
    328                     {
    329                         copyTargetOrientation();
    330                     }
    331                 if (distance < 100)
    332                 {  //linear speed reduction
    333                     this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
    334 
    335                 } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
    336 
    337             } else {
    338                 this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
    339             }
    340         }
     326                {
     327
     328                        this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * coord.x * 2);
     329                        this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * coord.y * 2);
     330
     331                        if (distance < 300)
     332                        {
     333                                if (bHasTargetOrientation_)
     334                                {
     335                                        copyTargetOrientation();
     336                                }
     337                                if (distance < 100)
     338                                { //linear speed reduction
     339                                        this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
     340
     341                                } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
     342
     343                        } else {
     344                                this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
     345                        }
     346                }
    341347
    342348        if (distance < 10)
  • code/branches/presentation2012merge/src/orxonox/worldentities/pawns/Pawn.cc

    r9257 r9269  
    7575        this->lastHitOriginator_ = 0;
    7676
     77        // set damage multiplier to default value 1, meaning nominal damage
     78        this->damageMultiplier_ = 1;
     79
    7780        this->spawnparticleduration_ = 3.0f;
    7881
     
    228231    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
    229232    {
    230         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
     233        //Applies multiplier given by the DamageBoost Pickup.
     234        Pawn *test = dynamic_cast<Pawn *>(originator);
     235        if( test != NULL )
     236        {
     237          damage *= originator->getDamageMultiplier();
     238        }
     239
     240        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
    231241        {
    232242            if (shielddamage >= this->getShieldHealth())
  • code/branches/presentation2012merge/src/orxonox/worldentities/pawns/Pawn.h

    r9254 r9269  
    162162                { return this->numexplosionchunks_; }
    163163
     164            // These are used with the Damage Boost Pickup to use the damage multiplier.
     165            inline void setDamageMultiplier(float multiplier)
     166                { this->damageMultiplier_ = multiplier; }
     167            inline float getDamageMultiplier()
     168                { return this->damageMultiplier_; }
     169
     170
    164171            virtual void startLocalHumanControl();
    165172
     
    208215            float reloadWaitCountdown_;
    209216
     217            // Modifier
     218            float damageMultiplier_; // Used by the Damage Boost Pickup.
     219
    210220            WeakPtr<Pawn> lastHitOriginator_;
    211221
Note: See TracChangeset for help on using the changeset viewer.