/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Gani Aliguzhinov * Co-authors: * Fabian 'x3n' Landau, Dominik Solenicki * */ #ifndef _FightingController_H__ #define _FightingController_H__ #include "controllers/FlyingController.h" namespace orxonox { /** @brief FightingController stores all the fighting methods and member variables of AI. Main methods here are maneuver() and dodge(). */ class _OrxonoxExport FightingController : public FlyingController { public: FightingController(Context* context); virtual ~FightingController(); virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); float squaredDistanceToTarget() const; bool isLookingAtTarget(float angle) const; bool hasTarget() const; ControllableEntity* getTarget() const { return this->target_; } bool bKeepFormation_; //even if action_ == FIGHT, you might still want to keep formation if far enough form the target protected: void setTarget(ControllableEntity* target); //set a target to shoot at void setPositionOfTarget(const Vector3& target); //good to know where target is void setOrientationOfTarget(const Quaternion& orient); //I don't really use that void stopLookingAtTarget(); // you need to be able to fly void startLookingAtTarget(); //targetPosition_, which is a Vector3 of where this ship flies. Decision is made based on //target_. void dodge(const Vector3& thisPosition, float diffLength, Vector3& diffUnit); // target_; void setClosestTarget(); bool bHasPositionOfTarget_; Vector3 positionOfTarget_; bool bHasOrientationOfTarget_; Quaternion orientationOfTarget_; Pawn* closestTarget() const; int attackRange_; bool bShooting_; float maneuverCounter_; bool bLookAtTarget_; float deltaHp; float previousHp; bool bStartedDodging_; float timeDodged_; //WEAPONSYSTEM DATA int rocketsLeft_; float timeout_; bool bFiredRocket_; std::map weaponModes_; // projectiles_; //