Last change
on this file since 10737 was
10618,
checked in by bknecht, 18 years ago
|
merged cleanup into trunk (only improvements)
|
File size:
931 bytes
|
Rev | Line | |
---|
[10244] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Thomas Fahrni |
---|
| 13 | co-programmer: |
---|
| 14 | */ |
---|
| 15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI |
---|
| 16 | #include "swarm_wait.h" |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | void SwarmWait::process(float dt) |
---|
| 20 | { |
---|
[10618] | 21 | if(taskRelObjectName!=""){ |
---|
| 22 | WorldEntity* taskRelObject = dynamic_cast<WorldEntity*>(WorldEntity::objectList().getBaseObject( taskRelObjectName )); |
---|
| 23 | Vector distVect=taskRelObject->getAbsCoor()-getSwarmPosition(); |
---|
| 24 | float distance=distVect.len(); |
---|
| 25 | if(distance<attackDistance+100)taskComplete=true; //### change wakeup distance here |
---|
[10515] | 26 | } |
---|
| 27 | |
---|
[10244] | 28 | taskMaxTime-=dt; |
---|
| 29 | if(taskMaxTime<=0)taskComplete=true; |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.