Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9298 in orxonox.OLD for trunk/src/world_entities/npcs


Ignore:
Timestamp:
Jul 17, 2006, 9:29:22 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the branche scripting back here.

merged with command:
svn merge -r9239:HEAD https://svn.orxonox.net/orxonox/branches/scripting .
no conflicts

Location:
trunk/src/world_entities/npcs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/gate.cc

    r9235 r9298  
    1313   ### File Specific
    1414   main-programmer: Patrick Boenzli
    15    co-programmer:
     15   co-programmer: Silvan Nellen
    1616*/
    1717#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
     
    4141                            addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
    4242                            ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
    43                            // ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy()))   
     43                            ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy))   
    4444                            ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    4545                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
     
    6666  this->scale = 1.0f;
    6767  this->actionRadius = 1.0;
     68  this->destroyed = false;
    6869
    6970  if( root != NULL)
     
    151152void Gate::open()
    152153{
    153   if( this->bLocked)
     154  if( this->bLocked || this->destroyed)
    154155    return;
    155156
     
    164165void Gate::close()
    165166{
     167 
     168  if( this->destroyed)
     169    return;
     170 
    166171  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
    167172  this->bOpen = false;
     
    171176void Gate::destroy()
    172177{
     178  if( this->destroyed)
     179    return;
     180 
    173181  this->setAnimation(GATE_DIE, MD2_ANIM_ONCE);
    174182
    175   Explosion::explode(this, Vector(10,10,10));
     183  Explosion::explode(this, Vector(this->getScaling()/160,this->getScaling()/160,this->getScaling()/160));
     184 
     185 
     186  this->destroyed = true;
    176187}
    177188
  • trunk/src/world_entities/npcs/gate.h

    r9235 r9298  
    5050
    5151  private:
     52    bool           destroyed;         //!< true if the door is destroyed
    5253    bool           bOpen;             //!< true if the door is open
    5354    bool           bLocked;           //!< true if this door is locked
Note: See TracChangeset for help on using the changeset viewer.