Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8492


Ignore:
Timestamp:
May 16, 2011, 5:25:00 PM (14 years ago)
Author:
simonmie
Message:

New Shield effect added (from tibork), first working BasicProjectile class, changes in weapon classes to fit new BasicProjectile system, some spam messages in Pawn.cc removed

Location:
code/branches/gameimmersion
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gameimmersion/data/levels/includes/weaponSettingsImmTest.oxi

    r8395 r8492  
    2626          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
    2727          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
    28           <LightningGun mode=1 muzzleoffset="0,0,0" damage=0 shielddamage=75 />
     28          <LightningGun mode=1 muzzleoffset="0,0,0" damage=0 shielddamage=5 healthdamage=200 />
    2929        </Weapon>
    3030        <Weapon>
     
    3636          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
    3737          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
    38           <LightningGun mode=1 muzzleoffset="0,0,0" damage=0 shielddamage=75 />
     38          <LightningGun mode=1 muzzleoffset="0,0,0" damage=0 shielddamage=5 healthdamage=200 />
    3939        </Weapon>
    4040        <Weapon>
  • code/branches/gameimmersion/src/modules/weapons/projectiles/CMakeLists.txt

    r7163 r8492  
    66  Rocket.cc
    77  SimpleRocket.cc
     8  BasicProjectile.cc
    89)
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.cc

    r8386 r8492  
    3636#include "worldentities/pawns/Pawn.h"
    3737#include "graphics/ParticleSpawner.h"
     38#include "BasicProjectile.h"
    3839
    3940namespace orxonox
     
    4142    CreateFactory(Projectile);
    4243
    43     Projectile::Projectile(BaseObject* creator) : MovableEntity(creator)
     44    Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile()
    4445    {
    4546        RegisterObject(Projectile);
    4647
    4748        this->setConfigValues();
    48         this->bDestroy_ = false;
     49//        this->bDestroy_ = false;
    4950        this->owner_ = 0;
    50         this->damage_ = 115;
     51//        this->damage_ = 115;
    5152///////////////////me
    52         this->healthdamage_ = 0;
    53         this->shielddamage_ = 0;
     53//        this->healthdamage_ = 0;
     54//        this->shielddamage_ = 0;
    5455///////////////////end me
    5556
     
    8889            return;
    8990
    90         if (this->bDestroy_)
     91        if (this->getBDestroy())
    9192            this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick()
    9293    }
     
    9899    }
    99100
     101    bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     102    {
     103        return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->owner_,this);
     104    }
     105
    100106//////////////////////////me edit
    101     bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     107/*    bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    102108    {
    103109        if (!this->bDestroy_ && GameMode::isMaster())
     
    150156    }
    151157//////////////////////////////////////////////////////////////////////end edit
    152 
     158*/
    153159    void Projectile::setOwner(Pawn* owner)
    154160    {
    155161        this->owner_ = owner;
    156162    }
     163
    157164}
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.h

    r8386 r8492  
    3535#include "worldentities/MovableEntity.h"
    3636
     37#include "BasicProjectile.h"
     38
    3739namespace orxonox
    3840{
    39     class _WeaponsExport Projectile : public MovableEntity
     41    class _WeaponsExport Projectile : public MovableEntity, public BasicProjectile
    4042    {
    4143        public:
     
    4951            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    5052
    51             inline void setDamage(float damage)
     53/*            inline void setDamage(float damage)
    5254                { this->damage_ = damage;  COUT(3) << "DAMAGE-SET-FUNKTION WIRD AUFGERUFEN" << endl; }
    5355            inline float getDamage() const
    5456                { return this->damage_; }
    55 
     57*/
    5658            void setOwner(Pawn* owner);
    5759            inline Pawn* getOwner() const
    5860                { return this->owner_; }
    5961
    60 ////////////////////me
     62/*///////////////////me
    6163
    6264            inline void setHealthDamage(float healthdamage)
     
    7173
    7274///////////////////end me
    73 
     75*/
    7476
    7577        private:
    7678            WeakPtr<Pawn> owner_;
    7779            float lifetime_;
    78             float damage_;
     80/*            float damage_;
    7981///////me
    8082            float healthdamage_;
     
    8284///////end me
    8385            bool bDestroy_;
    84             Timer destroyTimer_;
     86*/            Timer destroyTimer_;
    8587    };
    8688}
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r7284 r8492  
    112112        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    113113        projectile->setDamage(this->getDamage());
     114        projectile->setShieldDamage(this->getShieldDamage());
     115        projectile->setHealthDamage(this->getHealthDamage());
    114116
    115117        EnergyDrink::muendungsfeuer();
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/FusionFire.cc

    r6732 r8492  
    6565        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    6666        projectile->setDamage(this->getDamage());
     67        projectile->setShieldDamage(this->getShieldDamage());
     68        projectile->setHealthDamage(this->getHealthDamage());
     69
    6770        projectile->setColour(ColourValue(1.0f, 0.7f, 0.3f, 1.0f));
    6871    }
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/HsW01.cc

    r7284 r8492  
    126126        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    127127        projectile->setDamage(this->getDamage());
     128        projectile->setShieldDamage(this->getShieldDamage());
     129        projectile->setHealthDamage(this->getHealthDamage());
    128130
    129131        HsW01::muendungsfeuer();
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/LaserFire.cc

    r6732 r8492  
    6161        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    6262        projectile->setDamage(this->getDamage());
     63        projectile->setShieldDamage(this->getShieldDamage());
     64        projectile->setHealthDamage(this->getHealthDamage());
    6365    }
    6466}
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/LightningGun.cc

    r8386 r8492  
    7070        projectile->setDamage(this->getDamage());
    7171        projectile->setShieldDamage(this->getShieldDamage());
     72        projectile->setHealthDamage(this->getHealthDamage());
    7273    }
    7374}
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/RocketFire.cc

    r7846 r8492  
    7171        rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    7272        rocket->setDamage(this->getDamage());
     73//        rocket->setShieldDamage(this->getShieldDamage());
     74//        rocket->setHealthDamage(this->getHealthDamage());
    7375    }
    7476}
  • code/branches/gameimmersion/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r7846 r8492  
    7171        rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
    7272        rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     73
    7374        rocket->setDamage(this->damage_);
     75//        rocket->setShieldDamage(this->getShieldDamage());
     76//        rocket->setHealthDamage(this->getHealthDamage());
     77
    7478        WorldEntity* pawnn=static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
    7579        if (pawnn) con->setTarget(pawnn);
  • code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc

    r8386 r8492  
    201201    {
    202202        this->reloadRate_ = reloadrate;
    203         COUT(2) << "RELOAD RATE SET TO " << this->reloadRate_ << endl;
     203        //COUT(2) << "RELOAD RATE SET TO " << this->reloadRate_ << endl;
    204204    }
    205205
     
    207207    {
    208208        this->reloadWaitTime_ = reloadwaittime;
    209         COUT(2) << "RELOAD WAIT TIME SET TO " << this->reloadWaitTime_ << endl;
     209        //COUT(2) << "RELOAD WAIT TIME SET TO " << this->reloadWaitTime_ << endl;
    210210    }
    211211
     
    293293            // play damage effect
    294294        }
    295         COUT(3) << "neue damage-Funktion wurde aufgerufen // " << "Shield:" << this->getShieldHealth() << endl;
     295        //COUT(3) << "neue damage-Funktion wurde aufgerufen // " << "Shield:" << this->getShieldHealth() << endl;
    296296    }
    297297
     
    346346    void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage)
    347347    {
    348         COUT(3) << "neue hit2-Funktion wurde aufgerufen // shielddamage: " << shielddamage << std::flush;
     348//        COUT(3) << "neue hit2-Funktion wurde aufgerufen // shielddamage: " << shielddamage << std::flush;
    349349        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
    350350        {
Note: See TracChangeset for help on using the changeset viewer.