Changeset 9298 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jul 17, 2006, 9:29:22 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/gate.cc
r9235 r9298 13 13 ### File Specific 14 14 main-programmer: Patrick Boenzli 15 co-programmer: 15 co-programmer: Silvan Nellen 16 16 */ 17 17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY … … 41 41 addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide)) 42 42 ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide)) 43 // ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy()))43 ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy)) 44 44 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 45 45 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) … … 66 66 this->scale = 1.0f; 67 67 this->actionRadius = 1.0; 68 this->destroyed = false; 68 69 69 70 if( root != NULL) … … 151 152 void Gate::open() 152 153 { 153 if( this->bLocked )154 if( this->bLocked || this->destroyed) 154 155 return; 155 156 … … 164 165 void Gate::close() 165 166 { 167 168 if( this->destroyed) 169 return; 170 166 171 this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE); 167 172 this->bOpen = false; … … 171 176 void Gate::destroy() 172 177 { 178 if( this->destroyed) 179 return; 180 173 181 this->setAnimation(GATE_DIE, MD2_ANIM_ONCE); 174 182 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; 176 187 } 177 188 -
trunk/src/world_entities/npcs/gate.h
r9235 r9298 50 50 51 51 private: 52 bool destroyed; //!< true if the door is destroyed 52 53 bool bOpen; //!< true if the door is open 53 54 bool bLocked; //!< true if this door is locked -
trunk/src/world_entities/projectiles/guided_missile.cc
r9235 r9298 43 43 this->lifeSpan = 4.0; 44 44 this->agility = 3.5; 45 this->maxVelocity = 75;45 this->maxVelocity = 100; 46 46 47 47 this->emitter = new DotEmitter(100, 5, M_2_PI); -
trunk/src/world_entities/script_trigger.cc
r9235 r9298 32 32 ->addMethod("setTarget", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTarget)) 33 33 ->addMethod("setTriggerParent", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTriggerParent)) 34 ->addMethod("setTriggerLasts", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setTriggerLasts)) 34 ->addMethod("setTriggerRemains", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setTriggerRemains)) 35 ->addMethod("setActiveOnCreation", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setActiveOnCreation)) 35 36 ->addMethod("setInvert", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setInvert)) 36 37 ->addMethod("setRadius", ExecutorLua1<ScriptTrigger, float>(&ScriptTrigger::setRadius)) … … 48 49 */ 49 50 ScriptTrigger::ScriptTrigger(const TiXmlElement* root) 50 { 51 { PRINT(1)("testerror\n"); 51 52 this->setClassID(CL_SCRIPT_TRIGGER, "ScriptTrigger"); 52 53 this->toList(OM_COMMON); … … 59 60 scriptCalled = false; 60 61 scriptIsOk = false; 61 trigger Lasts = true;62 triggerRemains = true; 62 63 addToScript = false; 64 this->activeOnCreation = false; 63 65 64 66 if(root != NULL) … … 119 121 .describe("") 120 122 .defaultValues(false); 121 LoadParam(root, "trigger lasts", this, ScriptTrigger, setTriggerLasts)123 LoadParam(root, "triggerRemains", this, ScriptTrigger, setTriggerRemains) 122 124 .describe("") 123 125 .defaultValues(true); … … 172 174 if(scriptFinished) return; 173 175 174 if(triggerLasts && scriptCalled) 176 if(activeOnCreation) 177 { 178 executeAction(timestep); 179 return; 180 } 181 182 if(triggerRemains && scriptCalled) 175 183 { 176 184 executeAction(timestep); … … 182 190 executeAction(timestep); 183 191 scriptCalled = true; 192 return; 184 193 185 194 } … … 188 197 executeAction(timestep); 189 198 scriptCalled = true; 199 return; 190 200 } 191 201 //else … … 202 212 //testScriptingFramework(); 203 213 if(!(script->selectFunction(this->functionName,returnCount)) ) 204 printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());214 PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 205 215 206 216 script->pushParam( timestep, this->functionName); 207 217 208 218 if( !(script->executeFunction()) ) 209 printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());219 PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 210 220 211 221 scriptFinished = script->getReturnedBool(); -
trunk/src/world_entities/script_trigger.h
r9006 r9298 35 35 void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; } 36 36 void setTriggerParent(const std::string& name); 37 void setTriggerLasts(const bool lasts) { this->triggerLasts = lasts; } 37 void setTriggerRemains(const bool lasts) { this->triggerRemains = lasts; } 38 void setActiveOnCreation(const bool avtive) { this->activeOnCreation = avtive; } 38 39 void setInvert(const bool inv) { this->invert = invert; } 39 40 void setDelay(float delay) { this->delay = delay; }; … … 50 51 51 52 WorldEntity* target; 52 bool triggerLasts; 53 bool triggerRemains; 54 bool activeOnCreation; 53 55 bool invert; 54 56 float radius; -
trunk/src/world_entities/space_ships/spacecraft_2d.cc
r9235 r9298 498 498 this->bForward = event.bPressed; //this->shiftCoor(0,.1,0); 499 499 else if( event.type == KeyMapper::PEV_BACKWARD) 500 this->bBackward = event.bPressed;//this->shiftCoor(0,-.1,0);500 {this->bBackward = event.bPressed; printf(" %f, %f, %f \n",getAbsCoorX(),getAbsCoorY(),getAbsCoorZ());} //this->shiftCoor(0,-.1,0); 501 501 else if( event.type == EV_MOUSE_MOTION) 502 502 { -
trunk/src/world_entities/weapons/aiming_system.cc
r9235 r9298 115 115 if( this->owner != killer) 116 116 { 117 PRINTF(0)("real hit: %s\n", killer->getClassName());117 //PRINTF(0)("real hit: %s\n", killer->getClassName()); 118 118 this->selectionList.push_back(killer); 119 119 } -
trunk/src/world_entities/world_entity.h
r9235 r9298 129 129 130 130 /* --- Character Attribute Block --- */ 131 /** @returns the scaling of the model */ 132 float getScaling(){return this->scaling;} 131 133 /** @returns the damage dealt by this world entity */ 132 134 float getDamage() const { return this->damage; }
Note: See TracChangeset
for help on using the changeset viewer.