Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 9, 2016, 6:26:20 PM (8 years ago)
Author:
landauf
Message:

merged branch presentationHS15 back to trunk

Location:
code/trunk
Files:
2 deleted
67 edited
27 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/CMakeLists.txt

    r10258 r11052  
    4343ADD_SUBDIRECTORY(mini4dgame)
    4444ADD_SUBDIRECTORY(dodgerace)
     45ADD_SUBDIRECTORY(hover)
  • code/trunk/src/modules/docking/DockingController.cc

    r9667 r11052  
    6161
    6262        float distance = (this->dock_->getWorldPosition() - entity->getPosition()).length();
    63         Vector2 coord = get2DViewcoordinates(     // I don't understand this too
     63        Vector2 coord = get2DViewCoordinates(     // I don't understand this too
    6464            entity->getPosition(),
    6565            entity->getOrientation() * WorldEntity::FRONT,
  • code/trunk/src/modules/dodgerace/DodgeRace.cc

    r10624 r11052  
    7171            for (int i = 0; i < 7; i++)
    7272            {
    73                 BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    74                 chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    75                 chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
    76                 chunk->setScale(20);
     73                WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
     74                chunk5->setPosition(Vector3(600, 0, 100.f * i - 300));
     75                chunk5->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     76                chunk5->setScale(10);
     77                chunk5->setEffect1("Orxonox/explosion2b");
     78                chunk5->setEffect2("Orxonox/smoke6");
     79                chunk5->Explode();
     80
    7781            }
    7882        }
  • code/trunk/src/modules/dodgerace/DodgeRace.h

    r10624 r11052  
    5656
    5757#include "core/command/ConsoleCommand.h"
    58 #include "worldentities/BigExplosion.h"
    5958
    6059#include "gametypes/Deathmatch.h"
  • code/trunk/src/modules/invader/Invader.cc

    r10624 r11052  
    5151
    5252#include "core/command/ConsoleCommand.h"
    53 #include "worldentities/BigExplosion.h"
     53#include "worldentities/ExplosionPart.h"
    5454
    5555namespace orxonox
     
    8282            for (int i = 0; i < 7; i++)
    8383            {
    84                 BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    85                 chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    86                 chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
    87                 chunk->setScale(20);
     84
     85                WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
     86                chunk5->setPosition(this->center_->getPosition());
     87                chunk5->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     88                chunk5->setScale(10);
     89                chunk5->setEffect1("Orxonox/explosion2b");
     90                chunk5->setEffect2("Orxonox/smoke6");
     91                chunk5->setMinSpeed(0);
     92                chunk5->setMaxSpeed(0);
     93                chunk5->Explode();
     94
    8895            }
    8996        }
  • code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc

    r9667 r11052  
    101101        std::stringstream stream;
    102102        stream << this->getPreMessage();
    103         stream << this->bindingNiceifyer(KeyBinderManager::getInstance().getCurrent()->getBinding(this->getCommand()));
     103        stream << KeyBinderManager::getInstance().getCurrent()->getBindingReadable(this->getCommand());
    104104        stream << this->getPostMessage();
    105105        return *(new std::string(stream.str()));
    106106    }
    107 
    108     /**
    109     @brief
    110         Transforms the input binding into a human readable form.
    111     @param binding
    112         The binding to be transformed
    113     @return
    114         Returns a human readable version of the input binding.
    115     */
    116     //TODO: Move to KeyBinderManager...
    117     const std::string& CommandNotification::bindingNiceifyer(const std::string& binding)
    118     {
    119         SubString substring = SubString(binding, ".");
    120         std::string name;
    121         std::string group;
    122         switch(substring.size())
    123         {
    124             case 0:
    125                 return binding;
    126             case 1:
    127                 return binding;
    128             case 2:
    129                 group = substring[0];
    130             default:
    131                 name = substring.subSet(1).join(".");
    132         }
    133 
    134         std::stringstream stream;
    135         if(group.compare("Keys") == 0)
    136             stream << "Key " << name.substr(3);
    137         else if(group.compare("MouseButtons") == 0)
    138             stream << "Mouse " << name;
    139         else if(group.compare("JoyStickButtons") == 0)
    140             stream << "Joystick " << name;
    141         else if(group.compare("JoyStickAxes") == 0)
    142             stream << "Joystick Axis" << name.substr(5, 6) << name.substr(name.find("Axis")+6);
    143         else if(group.compare("MouseAxes") == 0)
    144             stream << "Mouse " << name.substr(1,3) << " " << name.substr(0, 1) << "-Axis";
    145         else
    146             return binding;
    147 
    148         return *(new std::string(stream.str()));
    149     }
    150 
    151107}
  • code/trunk/src/modules/notifications/dispatchers/CommandNotification.h

    r9667 r11052  
    122122            void setPostMessage(const std::string& message)
    123123                 { this->postMessage_ = message; }
    124 
    125             const std::string& bindingNiceifyer(const std::string& binding); //!< Transforms the input binding into a human readable form.
    126 
    127124    };
    128125
  • code/trunk/src/modules/objects/Turret.h

    r10622 r11052  
    103103
    104104            inline void setRotationThrust(float rotationthrust)
    105                 { this->rotationThrust_ = rotationthrust; }
     105                { this->rotationThrust_ = rotationthrust; }
    106106
    107107            inline float getRotationThrust()
    108                 { return this->rotationThrust_; }
     108                { return this->rotationThrust_; }
    109109
    110110        protected:
  • code/trunk/src/modules/overlays/OverlaysPrereqs.h

    r9939 r11052  
    9090    class HUDRadar;
    9191    class HUDSpeedBar;
     92    class HUDShieldBar;
    9293    class HUDBoostBar;
     94    class HUDRocketFuelBar;
     95    class HUDEnemyHealthBar;
     96    class HUDEnemyShieldBar;
     97    class HUDWeaponSystem;
     98    class HUDWeapon;
     99    class HUDWeaponMode;
    93100    class HUDTimer;
    94101    class HUDAimAssistant;
  • code/trunk/src/modules/overlays/hud/CMakeLists.txt

    r9939 r11052  
    55  HUDSpeedBar.cc
    66  HUDBoostBar.cc
     7  HUDShieldBar.cc
    78  HUDHealthBar.cc
     9  HUDRocketFuelBar.cc
    810  HUDTimer.cc
    911  HUDEnemyHealthBar.cc
     12  HUDEnemyShieldBar.cc
     13  HUDWeaponMode.cc
     14  HUDWeapon.cc
     15  HUDWeaponSystem.cc
    1016  ChatOverlay.cc
    1117  AnnounceMessage.cc
  • code/trunk/src/modules/overlays/hud/HUDBar.cc

    r9667 r11052  
    4747    RegisterClass(BarColour);
    4848
    49     BarColour::BarColour(Context* context)
    50         : BaseObject(context)
     49    BarColour::BarColour(Context* context) : BaseObject(context)
    5150    {
    5251        RegisterObject(BarColour);
    53 
     52       
    5453        this->setColour(ColourValue(1.0, 1.0, 1.0, 1.0));
    5554        this->setPosition(0.0);
     
    6968    RegisterClass(HUDBar);
    7069
    71     HUDBar::HUDBar(Context* context)
    72         : OrxonoxOverlay(context), right2Left_(false), autoColour_(false)
     70    HUDBar::HUDBar(Context* context) : OrxonoxOverlay(context), right2Left_(false), autoColour_(false)
    7371    {
    7472        RegisterObject(HUDBar);
     
    8886        this->bar_->setMaterialName(materialname);
    8987
     88        this->bar_->setPosition(0.0f,0.0f);
     89        this->bar_->setDimensions(1.0f,1.0f);
     90
     91        this->bUseIcon_ = false;
    9092        this->value_ = 1.0f;  // initialize with 1.0f to trigger a change when calling setValue(0.0f) on the line below
    9193        this->setAutoColour(true);
     
    9597
    9698        this->background_->addChild(bar_);
     99
     100        this->icon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDBar_icon_" + getUniqueNumberString()));
     101        this->icon_->setPosition(0.06f,0.0f);
     102        this->icon_->setDimensions(0.1f,1.0f);
     103        this->background_->addChild(this->icon_);
    97104    }
    98105
     
    115122        XMLPortParam(HUDBar, "autocolour",   setAutoColour,  getAutoColour,  xmlelement, mode);
    116123        XMLPortParam(HUDBar, "bartexture",   setBarTexture,  getBarTexture, xmlelement, mode);
     124        XMLPortParam(HUDBar, "iconmaterial", setIconMaterial, getIconMaterial, xmlelement, mode);
    117125        XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlelement, mode);
    118126    }
     
    161169        }
    162170
     171        float height = this->bar_->getHeight();
     172        float top = this->bar_->getTop();
     173
    163174        // set value
    164175        if (this->right2Left_)
    165176        {
    166177            // backward case
    167             this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), 0.0f);
    168             this->bar_->setDimensions(0.88f * this->value_, 1.0f);
     178            if (this->bUseIcon_)
     179            {
     180                this->bar_->setPosition(0.16f + 0.78f * (1 - this->value_), top);
     181                this->bar_->setDimensions(0.78f * this->value_, height);
     182            }
     183            else
     184            {
     185                this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), top);
     186                this->bar_->setDimensions(0.88f * this->value_, height);
     187            }
    169188        }
    170189        else
    171190        {
    172191            // default case
    173             this->bar_->setPosition(0.06f, 0.0f);
    174             this->bar_->setDimensions(0.88f * this->value_, 1.0f);
    175         }
     192            if (this->bUseIcon_)
     193            {
     194                this->bar_->setPosition(0.16f, top);
     195                this->bar_->setDimensions(0.78f * this->value_, height);
     196            }
     197            else
     198            {
     199                this->bar_->setPosition(0.06f, top);
     200                this->bar_->setDimensions(0.88f * this->value_, height);
     201            }
     202        }
     203
    176204        if (this->value_ != 0)
    177205            this->bar_->setTiling(this->value_, 1.0);
     
    208236        return this->textureUnitState_->getTextureName();
    209237    }
     238
     239    void HUDBar::setIconMaterial(const std::string& iconMaterial)
     240    {
     241        this->bUseIcon_ = true;
     242        this->icon_->setMaterialName(iconMaterial);
     243        valueChanged();
     244    }
     245
     246    const std::string& HUDBar::getIconMaterial() const
     247    {
     248        return this->icon_->getMaterialName();
     249    }
    210250}
  • code/trunk/src/modules/overlays/hud/HUDBar.h

    r9667 r11052  
    3737#include <map>
    3838#include <vector>
     39#include <OgrePanelOverlayElement.h>
    3940
    4041#include "util/Math.h"
     
    5152        virtual ~BarColour() { }
    5253
    53         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);     
    5455
    5556        void setColour(const ColourValue& colour) { this->colour_ = colour; }
     
    115116        const std::string& getBarTexture() const;
    116117
     118        void setIconMaterial(const std::string& iconMaterial);
     119        const std::string& getIconMaterial() const;
     120
    117121        inline const ColourValue& getCurrentBarColour() const
    118122            { return this->currentColour_; }
    119123
     124        inline void setIconPosition(Vector2 position)
     125            { this->icon_->setPosition(position.x, position.y); }
     126        inline void setIconDimensions(Vector2 dimensions)
     127            { this->icon_->setDimensions(dimensions.x, dimensions.y); }
     128
    120129    protected:
    121130        virtual void valueChanged();
    122 
    123131    private:
    124132        void addColour(BarColour* colour);
     
    129137        float value_;                       //!< progress of bar
    130138        ColourValue currentColour_;
     139        bool bUseIcon_;
    131140
    132141        Ogre::PanelOverlayElement* bar_;
    133142        Ogre::TextureUnitState* textureUnitState_;
     143        Ogre::PanelOverlayElement* icon_;
    134144        std::map<float, ColourValue> colours_;
    135145        std::vector<BarColour*> barColours_;
  • code/trunk/src/modules/overlays/hud/HUDBoostBar.cc

    r9667 r11052  
    5959            if (this->owner_->isBoostCoolingDown())
    6060            {
    61                 this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
     61                //this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
    6262                if (this->flashDt_ <= 0.0f)
    6363                {
     
    7272                this->flashDt_ = 0.0f;
    7373                this->show();
    74                 this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
     74                //this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
    7575            }
    7676
  • code/trunk/src/modules/overlays/hud/HUDHealthBar.cc

    r9667 r11052  
    4545        this->owner_ = 0;
    4646        this->bUseBarColour_ = false;
     47        this->textOffset_ = Vector2(0.0f, 0.0f);
     48        this->textScale_ = 1.0f;
     49
     50        this->setIconPosition(Vector2(0.05f,0.5f));
     51        this->setIconDimensions(Vector2(0.1f,0.5f));
    4752
    4853        this->textoverlay_ = new OverlayText(this->getContext());
     
    5156
    5257        this->textoverlay_->setCaption("");
     58        this->textoverlay_->setAspectCorrection(false);
     59
     60        positionText();
    5361    }
    5462
     
    5866        {
    5967            this->textoverlay_->destroy();
    60             this->textoverlay_ = 0;
     68            this->textoverlay_ = NULL;
    6169        }
    6270    }
     
    7078        XMLPortParam(HUDHealthBar, "textusebarcolour",  setTextUseBarColour,     getTextUseBarColour,     xmlelement, mode).defaultValues(false);
    7179        XMLPortParam(HUDHealthBar, "textcolour",        setTextColour,           getTextColour,           xmlelement, mode).defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0));
    72         XMLPortParam(HUDHealthBar, "textsize",          setTextSize,             getTextSize,             xmlelement, mode).defaultValues(1.0f);
    7380        XMLPortParam(HUDHealthBar, "textalign",         setTextAlignmentString,  getTextAlignmentString,  xmlelement, mode).defaultValues("left");
    7481        XMLPortParam(HUDHealthBar, "textoffset",        setTextOffset,           getTextOffset,           xmlelement, mode).defaultValues(Vector2::ZERO);
     82        XMLPortParam(HUDHealthBar, "textscale",         setTextScale,            getTextScale,            xmlelement, mode).defaultValues(1.0f);
    7583        XMLPortParam(HUDHealthBar, "textpickpoint",     setTextPickPoint,        getTextPickPoint,        xmlelement, mode).defaultValues(Vector2::ZERO);
    7684        XMLPortParam(HUDHealthBar, "textrotation",      setTextRotation,         getTextRotation,         xmlelement, mode).defaultValues(0.0f);
    77         XMLPortParam(HUDHealthBar, "textcorrectaspect", setTextAspectCorrection, getTextAspectCorrection, xmlelement, mode).defaultValues(true);
    7885        XMLPortParam(HUDHealthBar, "textspacewidth",    setTextSpaceWidth,       getTextSpaceWidth,       xmlelement, mode).defaultValues(true);
    7986    }
     
    139146            this->textoverlay_->setColour(this->textColour_);
    140147    }
     148
     149    void HUDHealthBar::positionText()
     150    {
     151        this->textoverlay_->setPosition(this->getPosition() + this->textOffset_*this->getActualSize());
     152        this->textoverlay_->setTextSize(this->getActualSize().y*this->textScale_);
     153    }
     154
     155    void HUDHealthBar::positionChanged()
     156    {
     157        HUDBar::positionChanged();
     158        positionText();
     159    }
     160
     161    void HUDHealthBar::sizeChanged()
     162    {
     163        HUDBar::sizeChanged();
     164        positionText();
     165    }   
    141166}
  • code/trunk/src/modules/overlays/hud/HUDHealthBar.h

    r10624 r11052  
    7575                { return this->textoverlay_->getAlignmentString(); }
    7676
    77             inline void setTextSize(float size)
    78                 { this->textoverlay_->setTextSize(size); }
    79             inline float getTextSize() const
    80                 { return this->textoverlay_->getTextSize(); }
    81 
    8277            inline void setTextVisible(bool bVisible)
    8378                { this->textoverlay_->setVisible(bVisible); }
    8479            inline bool getTextVisible() const
    8580                { return this->textoverlay_->isVisible(); }
     81
     82            inline void setTextScale(float scale)
     83                { this->textScale_ = scale;
     84                  positionText();
     85                }
     86            inline float getTextScale() const
     87                { return this->textScale_; }
    8688
    8789            inline void setTextPickPoint(const Vector2& pickpoint)
     
    9193
    9294            inline void setTextOffset(const Vector2& position)
    93                 { this->textoverlay_->setPosition(this->getPosition() + (position - this->getPickPoint()) * this->getSize()); }
     95                { this->textOffset_ = position;
     96                  this->positionText();
     97                }
    9498            inline Vector2 getTextOffset() const
    95                 { return (this->textoverlay_->getPosition() - this->getPosition()) / this->getSize() + this->getPickPoint(); }
    96 
    97             inline void setTextAspectCorrection(bool correct)
    98                 { this->textoverlay_->setAspectCorrection(correct); }
    99             inline bool getTextAspectCorrection() const
    100                 { return this->textoverlay_->getAspectCorrection(); }
     99                { return this->textOffset_; }
    101100
    102101            inline void setTextRotation(const Degree& angle)
     
    112111            inline void setHealthBarOwner(Pawn* owner)
    113112                { this->owner_ = owner; }
    114 
     113        protected:
     114            virtual void positionChanged();
     115            virtual void sizeChanged();
    115116        private:
     117            virtual void positionText();
    116118            WeakPtr<Pawn> owner_;
    117119            StrongPtr<OverlayText> textoverlay_;
    118120            bool bUseBarColour_;
    119121            ColourValue textColour_;
     122            Vector2 textOffset_;
     123            float textScale_;
    120124    };
    121125}
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r9945 r11052  
    240240            }
    241241            else
    242                 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
     242                coord = get2DViewCoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
    243243
    244244            coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
  • code/trunk/src/modules/pickup/PickupPrereqs.h

    r9348 r11052  
    8585    class ShrinkPickup;
    8686    class DamageBoostPickup;
     87    class MunitionPickup;
     88    class MunitionContainer;
    8789}
    8890
  • code/trunk/src/modules/pickup/PickupRepresentation.cc

    r9667 r11052  
    187187        Billboard* icon = new Billboard(spawner->getContext());
    188188        icon->setColour(ColourValue(0.89f, 0.79f, 0.08f));
    189         icon->setMaterial("asterisk");
     189        icon->setMaterial("Unknown");
    190190        icon->setScale(0.5);
    191191        sphere->attach(icon);
  • code/trunk/src/modules/pickup/items/CMakeLists.txt

    r9348 r11052  
    88  ShrinkPickup.cc
    99  DamageBoostPickup.cc
     10  BoostPickup.cc
     11  MunitionPickup.cc
     12  MunitionContainer.cc
    1013)
  • code/trunk/src/modules/pickup/items/DronePickup.h

    r9667 r11052  
    4343#include "tools/interfaces/Tickable.h"
    4444
    45 namespace orxonox {
     45namespace orxonox
     46{
    4647
    4748    /**
     
    8081            std::string droneTemplate_; //!< The name of the template, based upon which the Drone is created.
    8182            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    82 
    83 
    84 
    8583    };
    8684}
  • code/trunk/src/modules/towerdefense/TowerDefenseField.cc

    • Property svn:eol-style set to native
  • code/trunk/src/modules/towerdefense/TowerDefenseField.h

    • Property svn:eol-style set to native
  • code/trunk/src/modules/towerdefense/TowerDefenseSelecter.cc

    r10629 r11052  
    8888            {
    8989                moveDownPressed_ = false;
    90                 selectedPos_->Set(selecterPosX, selecterPosY - 1);
     90                selectedPos_->Set(selecterPosX, selecterPosY - 1);
    9191                updatePosition();
    9292            }
     
    100100            {
    101101                moveRightPressed_ = false;
    102                 selectedPos_->Set(selecterPosX + 1, selecterPosY);
     102                selectedPos_->Set(selecterPosX + 1, selecterPosY);
    103103                updatePosition();
    104104            }
  • code/trunk/src/modules/towerdefense/TowerDefenseTower.cc

    r10727 r11052  
    6161        {
    6262            upgrade++;
    63             float reloadrate = getReloadRate();
    64             float reloadwaittime = getReloadWaitTime();
    6563            this->setDamageMultiplier((upgrade+1)*2.0f);
     64
    6665            //this->setRotationThrust(2*this->getRotationThrust());
    67             reloadrate = 0.5f*reloadrate;
    68             reloadwaittime = 0.5f*reloadwaittime;
    69             setReloadRate(reloadrate);
    70             setReloadWaitTime(reloadwaittime);
    7166            //this->addTemplate("towerturret1");
    7267        }
  • code/trunk/src/modules/weapons/IceGunFreezer.cc

    • Property svn:eol-style set to native
  • code/trunk/src/modules/weapons/IceGunFreezer.h

    • Property svn:eol-style set to native
  • code/trunk/src/modules/weapons/WeaponsPrereqs.h

    r10622 r11052  
    6969{
    7070    class MuzzleFlash;
     71    class IceGunFreezer;
     72    class RocketController;
    7173
    7274    // munitions
    7375    class FusionMunition;
    7476    class LaserMunition;
    75     class ReplenishingMunition;
    7677    class RocketMunition;
    7778    class GravityBombMuntion;
     79    class IceMunition;
     80    class LightningMunition;
     81    class SplitMunition;
    7882
    7983    // projectiles
     
    8185    class LightningGunProjectile;
    8286    class ParticleProjectile;
     87    class IceProjectile;
     88    class SplitProjectile;
    8389    class Projectile;
     90    class BasicProjectile;
    8491    class Rocket;
    8592    class RocketOld;
     
    9198    class FusionFire;
    9299    class HsW01;
     100    class IceGun;
     101    class SplitGun;
    93102    class LaserFire;
    94103    class LightningGun;
     104    class MineGun;
    95105    class RocketFire;
    96106    class RocketFireOld;
  • code/trunk/src/modules/weapons/munitions/CMakeLists.txt

    r10629 r11052  
    11ADD_SOURCE_FILES(WEAPONS_SRC_FILES
    2   ReplenishingMunition.cc
    32  LaserMunition.cc
     3  LightningMunition.cc
    44  FusionMunition.cc
    55  RocketMunition.cc
     
    77  IceMunition.cc
    88  SplitMunition.cc
     9  MineMunition.cc
    910)
  • code/trunk/src/modules/weapons/munitions/FusionMunition.cc

    r9667 r11052  
    2828
    2929/**
    30     @file FusionMunition.h
     30    @file FusionMunition.cc
    3131    @brief Implementation of the FusionMunition class.
    3232*/
     
    3434#include "FusionMunition.h"
    3535#include "core/CoreIncludes.h"
     36#include "core/XMLPort.h"
    3637
    3738namespace orxonox
     
    4546        this->maxMunitionPerMagazine_ = 10;
    4647        this->maxMagazines_ = 10;
    47         this->magazines_ = 10;
     48        this->unassignedMagazines_ = 10;
    4849
    49         this->bUseSeparateMagazines_ = true;
    50         this->bStackMunition_ = false;
     50        this->deployment_ = MunitionDeployment::Separate;
     51
    5152        this->reloadTime_ = 1.0f;
    5253
    5354        this->bAllowMunitionRefilling_ = true;
    5455        this->bAllowMultiMunitionRemovementUnderflow_ = true;
     56
     57        this->reloadTime_ = 0.5f;
     58    }
     59
     60    void FusionMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     61    {
     62        SUPER(FusionMunition, XMLPort, xmlelement, mode);
    5563    }
    5664}
  • code/trunk/src/modules/weapons/munitions/FusionMunition.h

    r9667 r11052  
    5353            FusionMunition(Context* context);
    5454            virtual ~FusionMunition() {}
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5556    };
    5657}
  • code/trunk/src/modules/weapons/munitions/GravityBombMunition.cc

    r10622 r11052  
    77#include "GravityBombMunition.h"
    88#include "core/CoreIncludes.h"
     9#include "core/XMLPort.h"
    910
    1011namespace orxonox
     
    1718        this->maxMunitionPerMagazine_ = 1;
    1819        this->maxMagazines_ = 30;
    19         this->magazines_ = 15;
     20        this->unassignedMagazines_ = 15;
    2021
    21         this->bUseSeparateMagazines_ = false;
    22         this->bStackMunition_ = true;
     22        this->deployment_ = MunitionDeployment::Stack;
    2323
    2424        this->bAllowMunitionRefilling_ = true;
    2525        this->bAllowMultiMunitionRemovementUnderflow_ = false;
     26
     27        this->reloadTime_ = 0.0f;
    2628    }
    2729
     30    void GravityBombMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     31    {
     32        SUPER(GravityBombMunition, XMLPort, xmlelement, mode);
     33    }
    2834}
    2935
  • code/trunk/src/modules/weapons/munitions/GravityBombMunition.h

    r10622 r11052  
    2828            GravityBombMunition(Context* context);
    2929            virtual ~GravityBombMunition() {}
     30            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    3031    };
    3132
  • code/trunk/src/modules/weapons/munitions/IceMunition.cc

    • Property svn:eol-style set to native
    r10629 r11052  
    2828
    2929/**
    30     @file IceMunition.h
     30    @file IceMunition.cc
    3131    @brief Implementation of the IceMunition class.
    3232*/
     
    3434#include "IceMunition.h"
    3535#include "core/CoreIncludes.h"
     36#include "core/XMLPort.h"
    3637
    3738namespace orxonox
     
    4546        this->maxMunitionPerMagazine_ = 1;
    4647        this->maxMagazines_ = 50;
    47         this->magazines_ = 25;
     48        this->unassignedMagazines_ = 25;
    4849
    49         this->bUseSeparateMagazines_ = false;
    50         this->bStackMunition_ = true;
     50        this->deployment_ = MunitionDeployment::Stack;
    5151
    52         this->bAllowMunitionRefilling_ = false;
     52        this->bAllowMunitionRefilling_ = true;
    5353        this->bAllowMultiMunitionRemovementUnderflow_ = false;
     54
     55        this->reloadTime_ = 0.5f;
     56    }
     57
     58    void IceMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     59    {
     60        SUPER(IceMunition, XMLPort, xmlelement, mode);
    5461    }
    5562}
  • code/trunk/src/modules/weapons/munitions/IceMunition.h

    • Property svn:eol-style set to native
    r10629 r11052  
    5353            IceMunition(Context* context);
    5454            virtual ~IceMunition() {}
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5556    };
    5657}
  • code/trunk/src/modules/weapons/munitions/LaserMunition.cc

    r9667 r11052  
    2828
    2929/**
    30     @file LaserMunition.h
     30    @file LaserMunition.cc
    3131    @brief Implementation of the LaserMunition class.
    3232*/
     
    3434#include "LaserMunition.h"
    3535#include "core/CoreIncludes.h"
     36#include "core/XMLPort.h"
    3637
    3738namespace orxonox
     
    4445
    4546        this->maxMunitionPerMagazine_ = 20;
    46         this->maxMagazines_ = 1;
    47         this->magazines_ = 1;
     47        this->maxMagazines_ = 10;
     48        this->unassignedMagazines_ = 10;
    4849
    49         this->bUseSeparateMagazines_ = false;
    50         this->bStackMunition_ = true;
     50        this->deployment_ = MunitionDeployment::Separate;
    5151
    5252        this->bAllowMunitionRefilling_ = true;
    5353        this->bAllowMultiMunitionRemovementUnderflow_ = true;
    5454
    55         this->replenishInterval_ = 0.5f;
    56         this->replenishMunitionAmount_ = 1;
     55        this->replenishInterval_ = 7.0f;
     56        this->replenishAmount_ = 1;
     57
     58        this->reloadTime_ = 0.5f;
     59    }
     60
     61    void LaserMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     62    {
     63        SUPER(LaserMunition, XMLPort, xmlelement, mode);
    5764    }
    5865}
  • code/trunk/src/modules/weapons/munitions/LaserMunition.h

    r9667 r11052  
    3636
    3737#include "weapons/WeaponsPrereqs.h"
    38 #include "ReplenishingMunition.h"
     38#include "weaponsystem/ReplenishingMunition.h"
    3939
    4040namespace orxonox
     
    5353            LaserMunition(Context* context);
    5454            virtual ~LaserMunition() {}
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5556    };
    5657}
  • code/trunk/src/modules/weapons/munitions/RocketMunition.cc

    r9667 r11052  
    2828
    2929/**
    30     @file RocketMunition.h
     30    @file RocketMunition.cc
    3131    @brief Implementation of the RocketMunition class.
    3232*/
     
    3434#include "RocketMunition.h"
    3535#include "core/CoreIncludes.h"
     36#include "core/XMLPort.h"
    3637
    3738namespace orxonox
     
    4546        this->maxMunitionPerMagazine_ = 1;
    4647        this->maxMagazines_ = 30;
    47         this->magazines_ = 10;
     48        this->unassignedMagazines_ = 10;
    4849
    49         this->bUseSeparateMagazines_ = false;
    50         this->bStackMunition_ = true;
     50        this->deployment_ = MunitionDeployment::Stack;
    5151
    52         this->bAllowMunitionRefilling_ = false;
     52        this->bAllowMunitionRefilling_ = true;
    5353        this->bAllowMultiMunitionRemovementUnderflow_ = false;
     54
     55        this->reloadTime_ = 0.5f;
     56    }
     57
     58    void RocketMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     59    {
     60        SUPER(RocketMunition, XMLPort, xmlelement, mode);
    5461    }
    5562}
  • code/trunk/src/modules/weapons/munitions/RocketMunition.h

    r9667 r11052  
    5353            RocketMunition(Context* context);
    5454            virtual ~RocketMunition() {}
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5556    };
    5657}
  • code/trunk/src/modules/weapons/munitions/SplitMunition.cc

    • Property svn:eol-style set to native
    r10629 r11052  
    2828
    2929/**
    30     @file SplitMunition.h
     30    @file SplitMunition.cc
    3131    @brief Implementation of the SplitMunition class.
    3232*/
     
    3434#include "SplitMunition.h"
    3535#include "core/CoreIncludes.h"
     36#include "core/XMLPort.h"
    3637
    3738namespace orxonox
     
    4344        RegisterObject(SplitMunition);
    4445
    45         this->maxMunitionPerMagazine_ = 1;
    46         this->maxMagazines_ = 100;
    47         this->magazines_ = 25;
     46        this->maxMunitionPerMagazine_ = 5;
     47        this->maxMagazines_ = 10;
     48        this->unassignedMagazines_ = 5;
    4849
    49         this->bUseSeparateMagazines_ = false;
    50         this->bStackMunition_ = true;
     50        this->deployment_ = MunitionDeployment::Share;
    5151
    5252        this->bAllowMunitionRefilling_ = true;
    5353        this->bAllowMultiMunitionRemovementUnderflow_ = false;
     54
     55        this->reloadTime_ = 0.5f;
     56    }
     57
     58    void SplitMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     59    {
     60        SUPER(SplitMunition, XMLPort, xmlelement, mode);
    5461    }
    5562}
  • code/trunk/src/modules/weapons/munitions/SplitMunition.h

    • Property svn:eol-style set to native
    r10629 r11052  
    5353            SplitMunition(Context* context);
    5454            virtual ~SplitMunition() {}
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5556    };
    5657}
  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc

    r10293 r11052  
    6868    @brief
    6969        The function called when a projectile hits another thing.
    70         Calls the hit-function, starts the reload countdown, displays visual hit effects defined in Pawn.
     70        Calls the hit-function, starts the shield recharge countdown, displays visual hit effects defined in Pawn.
    7171        Needs to be called in the collidesAgainst() function by every Class directly inheriting from BasicProjectile.
    7272    @param otherObject
     
    9797            {
    9898                victim->hit(this->getShooter(), contactPoint, cs, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
    99                 victim->startReloadCountdown();
     99                victim->startShieldRechargeCountdown();
    100100            }
    101101
  • code/trunk/src/modules/weapons/projectiles/CMakeLists.txt

    r10629 r11052  
    1212  GravityBomb.cc
    1313  GravityBombField.cc
     14  MineProjectile.cc
    1415)
  • code/trunk/src/modules/weapons/projectiles/GravityBombField.cc

    r10622 r11052  
    164164        if (lifetime_ <= -4)
    165165        {
    166             orxout(debug_output) << "Timeout. Destroying field." << endl;
    167166            this->destroy();
    168167        }
  • code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc

    • Property svn:eol-style set to native
    r10629 r11052  
    3434#include "IceGunProjectile.h"
    3535
     36#include <OgreSceneManager.h>
     37#include <OgreSceneNode.h>
     38
    3639#include "core/CoreIncludes.h"
    3740#include "graphics/Model.h"
     41#include "graphics/ParticleSpawner.h"
     42#include "Scene.h"
     43#include "core/command/Executor.h"
     44#include "tools/ParticleInterface.h"
    3845
    3946namespace orxonox
    4047{
    4148    RegisterClass(IceGunProjectile);
     49
     50    const float IceGunProjectile::particleDestructionDelay_ = 15.0f;
    4251
    4352    IceGunProjectile::IceGunProjectile(Context* context) : Projectile(context)
     
    5564        this->attach(model);
    5665        model->setPosition(Vector3(0,0,0));
     66
     67        // Add effect.
     68        spawner_ = new ParticleSpawner(this->getContext());
     69        this->attach(spawner_);
     70        spawner_->setOrientation(this->getOrientation());
     71        spawner_->setSource("Orxonox/ice");
     72        spawner_->setDeleteWithParent(false);
     73        spawner_->setDestroydelay(particleDestructionDelay_);
     74    }
     75
     76    IceGunProjectile::~IceGunProjectile()
     77    {
     78        if (this->isInitialized())
     79        {
     80            const Vector3& pos = spawner_->getWorldPosition();
     81            const Quaternion& rot = spawner_->getWorldOrientation();
     82            this->detach(spawner_);
     83            spawner_->setPosition(pos);
     84            spawner_->setOrientation(rot);
     85            this->getScene()->getRootSceneNode()->addChild(const_cast<Ogre::SceneNode*>(spawner_->getNode()));
     86            this->spawner_->stop(true);
     87        }
    5788    }
    5889
  • code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h

    • Property svn:eol-style set to native
    r10629 r11052  
    5656        public:
    5757            IceGunProjectile(Context* context);
    58             virtual ~IceGunProjectile() {}
     58            virtual ~IceGunProjectile();
    5959
    6060            virtual void setFreezeTime(float freezeTime);
     
    6363        protected:
    6464            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    65         private:         
     65            static const float particleDestructionDelay_;
     66        private:
     67            ParticleSpawner* spawner_;
    6668            float freezeTime_; //The duration of the freezing effect on a target
    6769            float freezeFactor_; //The strength of the freezing effect
  • code/trunk/src/modules/weapons/projectiles/Projectile.h

    r10629 r11052  
    6969        protected:
    7070            virtual void setCollisionShapeRadius(float radius);
     71            float lifetime_; //!< The time the projectile exists.
    7172
    7273        private:
    73             float lifetime_; //!< The time the projectile exists.
    7474            Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
    75             WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.           
     75            WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
    7676    };
    7777}
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r10622 r11052  
    6666
    6767        this->localAngularVelocity_ = 0;
    68         this->lifetime_ = 100.0f;
     68        this->lifetime_ = 20.0f;
    6969
    7070        if (GameMode::isMaster())
     
    7676            Model* model = new Model(this->getContext());
    7777            model->setMeshSource("rocket.mesh");
    78             model->scale(0.7f);
     78            model->scale(1.0f);
    7979            this->attach(model);
    8080
     
    100100            this->attachCollisionShape(collisionShape);
    101101
    102             this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
    103 
    104102            // Add sound
    105103            this->defSndWpnEngine_ = new WorldSound(this->getContext());
     
    114112            this->defSndWpnLaunch_->setVolume(1.0f);
    115113            this->attach(defSndWpnLaunch_);
     114
     115            this->setHudTemplate("rockethud");
    116116        }
    117117        else
     
    320320    }
    321321
     322    float Rocket::getFuel() const
     323    {
     324        return this->destroyTimer_.getRemainingTime();
     325    }
     326
     327    void Rocket::setMaxFuel(float fuel)
     328    {
     329        this->lifetime_ = fuel;
     330        this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
     331    }
    322332}
  • code/trunk/src/modules/weapons/projectiles/Rocket.h

    r10216 r11052  
    118118            virtual void fired(unsigned int firemode);
    119119
     120            /**
     121            @brief Set the maximum lifetime of the rocket.
     122            */
     123            virtual void setMaxFuel(float fuel);
     124            /**
     125            @brief Get the maximum lifetime of the rocket.
     126            */
     127            inline float getMaxFuel() const
     128                { return lifetime_; }
     129            virtual float getFuel() const;
     130
    120131        private:
    121132            Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r10299 r11052  
    7676            Model* model = new Model(this->getContext());
    7777            model->setMeshSource("rocket.mesh");
    78             model->scale(0.7f);
     78            model->scale(1.0f);
    7979            this->attach(model);
    8080
  • code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.cc

    • Property svn:eol-style set to native
  • code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.h

    • Property svn:eol-style set to native
  • code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt

    r10629 r11052  
    1111  SimpleRocketFire.cc
    1212  GravityBombFire.cc
     13  MineGun.cc
    1314)
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r10622 r11052  
    6363        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
    6464        this->delayTimer_.stopTimer();
     65
     66        hudImageString_ = "Orxonox/WSHUD_WM_EnergyDrink";
    6567    }
    6668
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc

    r10622 r11052  
    5858
    5959        this->setMunitionName("FusionMunition");
     60
     61        hudImageString_ = "Orxonox/WSHUD_WM_FusionFire";
    6062    }
    6163
  • code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.cc

    r10622 r11052  
    3131        this->setMunitionName("GravityBombMunition");
    3232        this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8);    ///< sets sound of the bomb as it is fired.
     33
     34        hudImageString_ = "Orxonox/WSHUD_WM_GravityBombFire";
    3335    }
    3436
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r10296 r11052  
    6969
    7070        this->setDefaultSound(this->sound_);
     71
     72        hudImageString_ = "Orxonox/WSHUD_WM_HsW01";
    7173    }
    7274
  • code/trunk/src/modules/weapons/weaponmodes/IceGun.cc

    • Property svn:eol-style set to native
    r10629 r11052  
    5959        this->setFreezeFactor(0.5);
    6060
    61         this->setMunitionName("LaserMunition");
     61        this->setMunitionName("IceMunition");
    6262        this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
     63
     64        hudImageString_ = "Orxonox/WSHUD_WM_IceGun";
    6365    }
    6466
  • code/trunk/src/modules/weapons/weaponmodes/IceGun.h

    • Property svn:eol-style set to native
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc

    r10622 r11052  
    5656
    5757        this->setMunitionName("LaserMunition");
     58
     59        hudImageString_ = "Orxonox/WSHUD_WM_LaserFire";
    5860    }
    5961
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r10296 r11052  
    5454        this->speed_ = 750.0f;
    5555
    56         this->setMunitionName("LaserMunition");
     56        this->setMunitionName("LightningMunition");
    5757        this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
     58
     59        hudImageString_ = "Orxonox/WSHUD_WM_LightningGun";
    5860    }
    5961
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc

    r10296 r11052  
    4141#include "weaponsystem/WeaponSystem.h"
    4242#include "worldentities/pawns/Pawn.h"
    43 
     43#include "core/XMLPort.h"
    4444#include "weapons/projectiles/Rocket.h"
    4545
     
    5656        this->damage_ = 0.0f;
    5757        this->speed_ = 500.0f;
     58        this->fuel_ = 10.0f;
    5859
    5960        this->setMunitionName("RocketMunition");
    6061        // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
     62
     63        hudImageString_ = "Orxonox/WSHUD_WM_RocketFire";
    6164    }
    6265
    6366    RocketFire::~RocketFire()
    6467    {
     68    }
     69
     70    /**
     71    @brief
     72        XMLPort for the RocketFire. You can define the maximum lifetime of the rockets
     73    */
     74    void RocketFire::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     75    {
     76        SUPER(RocketFire, XMLPort, xmlelement, mode);
     77
     78        XMLPortParam(RocketFire, "fuel", setFuel, getFuel, xmlelement, mode);
    6579    }
    6680
     
    7791        rocket->setPosition(this->getMuzzlePosition());
    7892        rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
    79         rocket->scale(2);
     93        rocket->scale(1.0f);
    8094
    8195        rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     
    8397        rocket->setShieldDamage(this->getShieldDamage());
    8498        rocket->setHealthDamage(this->getHealthDamage());
     99        rocket->setMaxFuel(this->fuel_);
    85100    }
    86101}
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.h

    r9667 r11052  
    5454            virtual ~RocketFire();
    5555
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     57
    5658            virtual void fire();
     59            inline void setFuel(float fuel)
     60                { this->fuel_ = fuel; }
     61            inline float getFuel() const
     62                { return this->fuel_; }
    5763
    5864        private:
    5965            float speed_; //!< The speed of the Rocket.
     66            float fuel_; //!< The maximum lifetime of the rocket
    6067    };
    6168}
  • code/trunk/src/modules/weapons/weaponmodes/RocketFireOld.cc

    r10622 r11052  
    5959        this->setMunitionName("RocketMunition");
    6060        // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
     61
     62        hudImageString_ = "Orxonox/WSHUD_WM_SimpleRocketFire";
    6163    }
    6264
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r9667 r11052  
    6464        this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4f);
    6565        // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
     66
     67        hudImageString_ = "Orxonox/WSHUD_WM_SimpleRocketFire";
    6668    }
    6769
     
    8385        rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
    8486        rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     87        rocket->scale(1.0f);
    8588
    8689        rocket->setDamage(this->damage_);
     
    8992
    9093        WorldEntity* pawn = static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
    91         if (pawn) controller->setTarget(pawn);
     94        if (pawn)
     95            controller->setTarget(pawn);
    9296    }
    9397}
  • code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc

    • Property svn:eol-style set to native
    r10629 r11052  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/XMLPort.h"   
     37#include "core/XMLPort.h"
    3838#include "weaponsystem/Weapon.h"
    3939#include "weaponsystem/WeaponPack.h"
     
    6262        this->setMunitionName("SplitMunition");
    6363        this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
     64
     65        hudImageString_ = "Orxonox/WSHUD_WM_SplitGun";
    6466    }
    6567
  • code/trunk/src/modules/weapons/weaponmodes/SplitGun.h

    • Property svn:eol-style set to native
Note: See TracChangeset for help on using the changeset viewer.