|
@@ -25,131 +25,121 @@ class Enemy{
|
|
|
|
|
|
|
|
public:
|
|
public:
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * Enemy animation states.
|
|
|
|
|
- */
|
|
|
|
|
- enum AnimationState{
|
|
|
|
|
|
|
+ struct Element{
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * An animation has been requested.
|
|
|
|
|
|
|
+ * The element ID.
|
|
|
*/
|
|
*/
|
|
|
- REQUESTED_ANIMATION,
|
|
|
|
|
|
|
+ unsigned int id;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * An animation is set to play automatically.
|
|
|
|
|
|
|
+ * Damage modification factor when attacked by the element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * 1 means normal damage taken.
|
|
|
|
|
+ * 0 means no damage taken.
|
|
|
|
|
+ * [0-1] means reduced damage.
|
|
|
|
|
+ * [1-10) means extended damage.
|
|
|
|
|
+ * (-10-0) means recovery
|
|
|
|
|
+ * >10 means death.
|
|
|
|
|
+ * <-10 means full recovery.
|
|
|
*/
|
|
*/
|
|
|
- AUTO_ANIMATION
|
|
|
|
|
|
|
+ float factor;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Types of animations.
|
|
|
|
|
|
|
+ * Enemy attack data.
|
|
|
*/
|
|
*/
|
|
|
- enum AnimationPlayType{
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Default animation mode.
|
|
|
|
|
- *
|
|
|
|
|
- * @todo Same as PLAY_ONCE?
|
|
|
|
|
- */
|
|
|
|
|
- PLAY_DEFAULT,
|
|
|
|
|
|
|
+ struct Attack{
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Play the animation once, then stop.
|
|
|
|
|
|
|
+ * Attack ID.
|
|
|
*/
|
|
*/
|
|
|
- PLAY_ONCE,
|
|
|
|
|
|
|
+ unsigned int id;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Play an animation in a continous loop.
|
|
|
|
|
|
|
+ * Camera ID to use during the attack.
|
|
|
|
|
+ *
|
|
|
|
|
+ * -1 to not move the camera.
|
|
|
*/
|
|
*/
|
|
|
- PLAY_LOOPED
|
|
|
|
|
|
|
+ int camera;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Action types.
|
|
|
|
|
|
|
+ * Data for drop and steal items.
|
|
|
*/
|
|
*/
|
|
|
- enum ActionType{
|
|
|
|
|
|
|
+ struct Item{
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * No action.
|
|
|
|
|
|
|
+ * Item ID.
|
|
|
*/
|
|
*/
|
|
|
- AT_NONE,
|
|
|
|
|
|
|
+ unsigned int id;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Linear action.
|
|
|
|
|
- *
|
|
|
|
|
- * It starts and ends at full speed.
|
|
|
|
|
|
|
+ * Steal or drop rate.
|
|
|
*/
|
|
*/
|
|
|
- AT_LINEAR,
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Smooth action.
|
|
|
|
|
- *
|
|
|
|
|
- * The action speed steadily increases when started, and it steadily
|
|
|
|
|
- * decreases before the end.
|
|
|
|
|
- */
|
|
|
|
|
- AT_SMOOTH
|
|
|
|
|
|
|
+ float rate;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * The direction for an entity turn.
|
|
|
|
|
|
|
+ * Status immunity.
|
|
|
*/
|
|
*/
|
|
|
- enum TurnDirection{
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Turn clockwise.
|
|
|
|
|
- */
|
|
|
|
|
- TD_CLOCKWISE,
|
|
|
|
|
|
|
+ struct Immunity{
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Turn anticlockwise.
|
|
|
|
|
|
|
+ * Status ID.
|
|
|
*/
|
|
*/
|
|
|
- TD_ANTICLOCKWISE,
|
|
|
|
|
|
|
+ unsigned int status;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Choose direction automatically.
|
|
|
|
|
|
|
+ * Immunity rate.
|
|
|
*
|
|
*
|
|
|
- * The direction in which the turn is shorter will be selected.
|
|
|
|
|
|
|
+ * 0 or lower means no immunity, 1 or higher completely immune. Values between 0 and 1
|
|
|
|
|
+ * indicate resistance.
|
|
|
*/
|
|
*/
|
|
|
- TD_CLOSEST
|
|
|
|
|
|
|
+ float rate;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Constructor.
|
|
* Constructor.
|
|
|
*
|
|
*
|
|
|
- * @param[in] name Enemy ID.
|
|
|
|
|
- * @param[in] node Scene node to which the enemy should be attached.
|
|
|
|
|
- */
|
|
|
|
|
- Enemy(const int enemy_id, Ogre::SceneNode* node);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Destructor.
|
|
|
|
|
|
|
+ * @param[in] id Enemy ID.
|
|
|
*/
|
|
*/
|
|
|
- virtual ~Enemy();
|
|
|
|
|
|
|
+ Enemy(const unsigned int id);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Updates the enemy status.
|
|
|
|
|
- */
|
|
|
|
|
- virtual void Update();
|
|
|
|
|
|
|
+ * Constructor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] id Enemy ID.
|
|
|
|
|
+ * @param[in] pos Enemy position (x, y, z).
|
|
|
|
|
+ * @param[in] front True to set the enemy in the front row, false for back row.
|
|
|
|
|
+ * @param[in] visible Indicates enemy visibility.
|
|
|
|
|
+ * @param[in] targeteable Indicates if the enemy can be targeted.
|
|
|
|
|
+ * @param[in] active Indicates whether the enemy main script is active or not.
|
|
|
|
|
+ * @param[in] cover Cover binary flags string.
|
|
|
|
|
+ */
|
|
|
|
|
+ Enemy(
|
|
|
|
|
+ const unsigned int id, const Ogre::Vector3 pos, const bool front, const bool visible,
|
|
|
|
|
+ const bool targeteable, const bool active, const std::string cover
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Updates the enemy status with debug information.
|
|
|
|
|
|
|
+ * Destructor.
|
|
|
*/
|
|
*/
|
|
|
- virtual void UpdateDebug();
|
|
|
|
|
|
|
+ virtual ~Enemy();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Retrieves the enemy ID.
|
|
* Retrieves the enemy ID.
|
|
|
*
|
|
*
|
|
|
* @return The enemy ID, or -1 if it's not loaded.
|
|
* @return The enemy ID, or -1 if it's not loaded.
|
|
|
*/
|
|
*/
|
|
|
- const int GetEnemyId() const;
|
|
|
|
|
|
|
+ const int GetId() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Sets the enemy ID.
|
|
* Sets the enemy ID.
|
|
|
*
|
|
*
|
|
|
* @param[in] id The enemy ID.
|
|
* @param[in] id The enemy ID.
|
|
|
*/
|
|
*/
|
|
|
- void SetEnemyId(const int id);
|
|
|
|
|
|
|
+ void SetId(const int id);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Retrieves the enemy name.
|
|
* Retrieves the enemy name.
|
|
@@ -221,6 +211,107 @@ class Enemy{
|
|
|
*/
|
|
*/
|
|
|
void SetMoney(const unsigned int money);
|
|
void SetMoney(const unsigned int money);
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the enemy animation IDs.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return The list of animation IDs
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<unsigned int> GetAnimations() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an animation for the enemy.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] Animation ID.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddAnimation(const unsigned int animation);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the enemy attacks.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return The list of attacks.
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<Attack> GetAttacks() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an attack for the enemy.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] Attack to add.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddAttack(const Attack attack);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the enemy possible item drops.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return List of items that can be droped by the enemy.
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<Item> GetDrop() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an item drop for the enemy.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] item The dropable item.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddDrop(const Item item);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of the enemy elemental affinities.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return The list of elemental affinities.
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<Element> GetElements() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an elemental affinity to the monster.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] element Elemental affinity.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddElement(const Element element);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of status immunities.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return The list of status immunities.
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<Immunity> GetImmunities() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an immunity to the monster.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] immunity The immunity to add.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddImmunity(const Immunity immunity);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of attacks that can be used during the manipulated state.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The first attack of the list is also the attack the enemy will use when in berserkr
|
|
|
|
|
+ * state. If the list is empty, the enemy can't be manipulated or berserkred.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return List of IDs of attacks usable during manipulation
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<unsigned int> GetManipulateAttacks() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an attack usable during manipulation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] attack ID of the attack.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddManipulateAttack(const unsigned int attack);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the enemy possible item stelas.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return List of items that can be stolen from the enemy.
|
|
|
|
|
+ */
|
|
|
|
|
+ std::vector<Item> GetSteal() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Adds an item steal to the enemy.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] item The stealableitem.
|
|
|
|
|
+ */
|
|
|
|
|
+ void AddSteal(const Item item);
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Retrieves the ID of the item the monster can be morphed into.
|
|
* Retrieves the ID of the item the monster can be morphed into.
|
|
|
*
|
|
*
|
|
@@ -333,6 +424,34 @@ class Enemy{
|
|
|
*/
|
|
*/
|
|
|
void SetLck(const unsigned int lck);
|
|
void SetLck(const unsigned int lck);
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the enemy's evasion stat.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return The evasion stat.
|
|
|
|
|
+ */
|
|
|
|
|
+ unsigned int GetEva() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Sets the enemy's evasion stat.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] eva The evasion stat.
|
|
|
|
|
+ */
|
|
|
|
|
+ void SetEva(const unsigned int eva);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the enemy's magic evasion stat.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return The magic evasion stat.
|
|
|
|
|
+ */
|
|
|
|
|
+ unsigned int GetMeva() const;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Sets the enemy's magic evasion stat.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[in] meva The magic evasion stat.
|
|
|
|
|
+ */
|
|
|
|
|
+ void SetMeva(const unsigned int meva);
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Retrieves the enemy's current HP.
|
|
* Retrieves the enemy's current HP.
|
|
|
*
|
|
*
|
|
@@ -402,507 +521,169 @@ class Enemy{
|
|
|
void SetMpMax(const unsigned int mp_max);
|
|
void SetMpMax(const unsigned int mp_max);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the enemy position.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] position Enemy's new position.
|
|
|
|
|
- */
|
|
|
|
|
- void SetPosition(const Ogre::Vector3& position);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Sets the enemy position.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] x Enemy's new position X coordinate.
|
|
|
|
|
- * @param[in] y Enemy's new position Y coordinate.
|
|
|
|
|
- * @param[in] z Enemy's new position Z coordinate.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptSetPosition(const float x, const float y, const float z);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the enemy position.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The enemy position.
|
|
|
|
|
- */
|
|
|
|
|
- const Ogre::Vector3 GetPosition() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Informs the script manager of the enemy position.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptGetPosition() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Sets the enemy offset.
|
|
|
|
|
- *
|
|
|
|
|
- * The offset is relative to it's defined position.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] position The enemy's offset.
|
|
|
|
|
- */
|
|
|
|
|
- void SetOffset(const Ogre::Vector3& position);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the enemy offset.
|
|
|
|
|
- *
|
|
|
|
|
- * The offset is relative to it's defined position.
|
|
|
|
|
|
|
+ * Retrieves the enemy position in the battlefield.
|
|
|
*
|
|
*
|
|
|
- * @return The enemy's offset.
|
|
|
|
|
|
|
+ * @return The enemy position (x, y, z).
|
|
|
*/
|
|
*/
|
|
|
- const Ogre::Vector3 GetOffset() const;
|
|
|
|
|
|
|
+ Ogre::Vector3& GetPos();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the enemy rotation.
|
|
|
|
|
|
|
+ * Sets the enemy position in the battlefield.
|
|
|
*
|
|
*
|
|
|
- * @param[in] rotation The enemy rotation.
|
|
|
|
|
|
|
+ * @param[in] pos The enemy position (x, y, z).
|
|
|
*/
|
|
*/
|
|
|
- void SetRotation(const Ogre::Degree& rotation);
|
|
|
|
|
|
|
+ void SetPos(const Ogre::Vector3 &pos);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the enemy rotation.
|
|
|
|
|
|
|
+ * Checks if the enemy is in the front row.
|
|
|
*
|
|
*
|
|
|
- * @param[in] rotation The enemy rotation, in degrees (0-360).
|
|
|
|
|
|
|
+ * @return True if the enemy is in the front row. false if not.
|
|
|
*/
|
|
*/
|
|
|
- void ScriptSetRotation(const float rotation);
|
|
|
|
|
|
|
+ bool IsFront() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy rotation.
|
|
|
|
|
|
|
+ * Sets the enemy in or out the front row.
|
|
|
*
|
|
*
|
|
|
- * @return The enemy rotation, in degrees.
|
|
|
|
|
|
|
+ * @param[in] front True to set the enemy in the front row, false for the back row.
|
|
|
*/
|
|
*/
|
|
|
- Ogre::Degree GetRotation() const;
|
|
|
|
|
|
|
+ void SetFront(bool front);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy rotation.
|
|
|
|
|
|
|
+ * Checks the enemy visibility.
|
|
|
*
|
|
*
|
|
|
- * @return The enemy rotation (0-360).
|
|
|
|
|
|
|
+ * @return True if the enemy is visible, false if not.
|
|
|
*/
|
|
*/
|
|
|
- float ScriptGetRotation() const;
|
|
|
|
|
|
|
+ bool IsVisible() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the enemy scale.
|
|
|
|
|
|
|
+ * Toggles the enemy visibility.
|
|
|
*
|
|
*
|
|
|
- * @param[in] scale Three dimensional scale.
|
|
|
|
|
|
|
+ * @param[in] visible True to make the enemy visible, false to make it invisible.
|
|
|
*/
|
|
*/
|
|
|
- virtual void setScale(const Ogre::Vector3 &scale);
|
|
|
|
|
|
|
+ void SetVisible(bool visible);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the enemy index in the field.
|
|
|
|
|
|
|
+ * Checks whether the enemy can be targeted.
|
|
|
*
|
|
*
|
|
|
- * @param[in] index Index of the enemy.
|
|
|
|
|
|
|
+ * @return True if the enemy can be targeted, false if not.
|
|
|
*/
|
|
*/
|
|
|
- void SetIndex(const int index);
|
|
|
|
|
|
|
+ bool IsTargeteable() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy index in the field.
|
|
|
|
|
|
|
+ * Determines whether the enemy can be targeted.
|
|
|
*
|
|
*
|
|
|
- * @return Index of the enemy.
|
|
|
|
|
|
|
+ * @param[in] targeteable True to allow targeting the enemy false to prevent it.
|
|
|
*/
|
|
*/
|
|
|
- int GetIndex();
|
|
|
|
|
|
|
+ void SetTargeteable(bool targeteable);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the enemy's absolute orientation.
|
|
|
|
|
|
|
+ * Checks whether the enemy's main script is active.
|
|
|
*
|
|
*
|
|
|
- * @param[in] root_orientation The enemy's new orientation.
|
|
|
|
|
|
|
+ * @return True if the script is active, false if not.
|
|
|
*/
|
|
*/
|
|
|
- virtual void setRootOrientation(const Ogre::Quaternion &root_orientation);
|
|
|
|
|
|
|
+ bool IsActive() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy's height.
|
|
|
|
|
|
|
+ * Activates or deactivates the enemy main script.
|
|
|
*
|
|
*
|
|
|
- * @return The enemy's height.
|
|
|
|
|
|
|
+ * @param[in] active True to activate the script, false to deactivate it.
|
|
|
*/
|
|
*/
|
|
|
- float GetHeight() const;
|
|
|
|
|
|
|
+ void SetActive(bool active);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Makes the enemy visible or invisible.
|
|
|
|
|
|
|
+ * Retrieves the flags for enemy covering.
|
|
|
*
|
|
*
|
|
|
- * Invisible entities can't be interacted with.
|
|
|
|
|
|
|
+ * {@see https://wiki.ffrtt.ru/index.php/FF7/Battle/Battle_Scenes#Binary_.22Cover_Flags.22}
|
|
|
|
|
+ * for more info about cover flags.
|
|
|
*
|
|
*
|
|
|
- * @param[in] visible True to make the unit visible, false to make it invisible.
|
|
|
|
|
|
|
+ * @return A string with five 0s or 1s indicating the cover flags.
|
|
|
*/
|
|
*/
|
|
|
- virtual void SetVisible(const bool visible) = 0;
|
|
|
|
|
|
|
+ std::string GetCover() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Checks if the enemy is visible or invisible.
|
|
|
|
|
|
|
+ * Sets the flags for enemy covering.
|
|
|
*
|
|
*
|
|
|
- * Invisible entities can't be interacted with.
|
|
|
|
|
|
|
+ * {@see https://wiki.ffrtt.ru/index.php/FF7/Battle/Battle_Scenes#Binary_.22Cover_Flags.22}
|
|
|
|
|
+ * for more info about cover flags.
|
|
|
*
|
|
*
|
|
|
- * @return True if the unit is visible, false if it's invisible.
|
|
|
|
|
|
|
+ * @param[in] A string with five 0s or 1s indicating the cover flags.
|
|
|
*/
|
|
*/
|
|
|
- virtual bool IsVisible() const = 0;
|
|
|
|
|
|
|
+ void SetCover(std::string cover);
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * Sets the enemy's movement destination position.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] target The destination position.
|
|
|
|
|
- */
|
|
|
|
|
- void SetMovePosition(const Ogre::Vector3& target);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Sets the enemy's model movement speed.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] speed Movement speed.
|
|
|
|
|
- */
|
|
|
|
|
- void SetMoveSpeed(const float speed);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the enemy's automatic movement speed.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The movement speed.
|
|
|
|
|
- */
|
|
|
|
|
- float GetMoveSpeed() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the enemy's movement destination position.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The destination position.
|
|
|
|
|
- */
|
|
|
|
|
- const Ogre::Vector3& GetMovePosition() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the distance to destination.
|
|
|
|
|
- *
|
|
|
|
|
- * It's the distance between the enemy's current position and it's current movement
|
|
|
|
|
- * destination point.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The distance to destination.
|
|
|
|
|
- */
|
|
|
|
|
- float GetMoveStopDistance() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Makes the enemy move to a point in the map.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] x X coordinate of the destination point.
|
|
|
|
|
- * @param[in] y Y coordinate of the destination point.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptMoveToPosition(const float x, const float y);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Waits for enemy's movement to end.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Always -1.
|
|
|
|
|
- */
|
|
|
|
|
- int ScriptMoveSync();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Cancels the enemy's current movement.
|
|
|
|
|
- *
|
|
|
|
|
- * It also clears the movement sync queue.
|
|
|
|
|
- */
|
|
|
|
|
- void UnsetMove();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] x X coordinate of the destination point.
|
|
|
|
|
- * @param[in] y Y coordinate of the destination point.
|
|
|
|
|
- * @param[in] z Z coordinate of the destination point.
|
|
|
|
|
- * @param[in] type Type of action.
|
|
|
|
|
- * @param[in] seconds Duration of the action, in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptOffsetToPosition(
|
|
|
|
|
- const float x, const float y, const float z,
|
|
|
|
|
- const ActionType type, const float seconds
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Always -1.
|
|
|
|
|
- */
|
|
|
|
|
- int ScriptOffsetSync();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- void UnsetOffset();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Starting position.
|
|
|
|
|
- */
|
|
|
|
|
- const Ogre::Vector3& GetOffsetPositionStart() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Ending position.
|
|
|
|
|
- */
|
|
|
|
|
- const Ogre::Vector3& GetOffsetPositionEnd() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The action type.
|
|
|
|
|
- */
|
|
|
|
|
- ActionType GetOffsetType() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Action total duration in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- float GetOffsetSeconds() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] seconds Action current duration in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- void SetOffsetCurrentSeconds(const float seconds);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Action current duration in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- float GetOffsetCurrentSeconds() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Makes the enemy turn to a fixed direction.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] direction Final direction to turn the enemy's to.
|
|
|
|
|
- * @param[in] turn_direction Direction of the turn.
|
|
|
|
|
- * @param[in] turn_type Turn mode.
|
|
|
|
|
- * @param[in] seconds Total turn duration, in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptTurnToDirection(
|
|
|
|
|
- const float direction, const TurnDirection turn_direction,
|
|
|
|
|
- const ActionType turn_type, const float seconds
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Makes the enemy turn to a fixed point.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] x X coordinate of the point to turn to.
|
|
|
|
|
- * @param[in] y Y coordinate of the point to turn to.
|
|
|
|
|
- * @param[in] turn_direction Direction of the turn.
|
|
|
|
|
- * @param[in] turn_type Turn mode.
|
|
|
|
|
- * @param[in] seconds Total turn duration, in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptTurnToPosition(
|
|
|
|
|
- const int x, const int y, const TurnDirection turn_direction,
|
|
|
|
|
- const ActionType turn_type, const float seconds
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Adds the enemy's turn to the sync queue.
|
|
|
|
|
- *
|
|
|
|
|
- * @return Always -1.
|
|
|
|
|
- * @todo Properly describe this.
|
|
|
|
|
- */
|
|
|
|
|
- int ScriptTurnSync();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Makes the enemy turn towards a point or another enemy.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] direction_to Final direction to turn the enemy's to.
|
|
|
|
|
- * @param[in] turn_direction Direction of the turn.
|
|
|
|
|
- * @param[in] turn_type Turn mode.
|
|
|
|
|
- * @param[in] seconds Total turn duration, in seconds.
|
|
|
|
|
- * @todo What if the point
|
|
|
|
|
- */
|
|
|
|
|
- void SetTurn(
|
|
|
|
|
- const Ogre::Degree& direction_to, const TurnDirection turn_direction,
|
|
|
|
|
- const ActionType turn_type, const float seconds
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Cancels the enemy's current turn.
|
|
|
|
|
- *
|
|
|
|
|
- * It also clears the movement sync queue.
|
|
|
|
|
- */
|
|
|
|
|
- void UnsetTurn();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Calculates the turn angle.
|
|
|
|
|
- *
|
|
|
|
|
- * If the turn direction is {@see TD_CLOSEST}, the result is the
|
|
|
|
|
- * smallest angle between the two orientations. Otherwise, is the angle
|
|
|
|
|
- * in the specified turn direction.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] start Starting angle.
|
|
|
|
|
- * @param[in] end Ending angle.
|
|
|
|
|
- * @return[in] Calculated turn angle.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Degree CalculateTurnAngle(const Ogre::Degree& start, const Ogre::Degree& end) const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the turn staring orientation.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The turn starting orientation.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Degree GetTurnDirectionStart() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the turn ending orientation.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The turn ending orientation.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Degree GetTurnDirectionEnd() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the turn type.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The turn type.
|
|
|
|
|
- */
|
|
|
|
|
- ActionType GetTurnType() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the turn total duration.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The turn total duration, in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- float GetTurnSeconds() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Sets the turn current duration.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] seconds The turn current duration, in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- void SetTurnCurrentSeconds(const float seconds);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Retrieves the turn current duration.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The turn current duration, in seconds.
|
|
|
|
|
- */
|
|
|
|
|
- float GetTurnCurrentSeconds() const;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Sets the animation speed.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] speed The animation speed.
|
|
|
|
|
- * @todo Indicate units, max and mins, or references.
|
|
|
|
|
- */
|
|
|
|
|
- void ScriptSetAnimationSpeed(const float speed);
|
|
|
|
|
|
|
+ private:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy's default animation name.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The default animation name.
|
|
|
|
|
|
|
+ * Reads enemy data from the xml file.
|
|
|
*/
|
|
*/
|
|
|
- const Ogre::String& GetDefaultAnimationName() const;
|
|
|
|
|
|
|
+ void ReadFromXml();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy's current animation name.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The current animation name.
|
|
|
|
|
|
|
+ * The enemy ID.
|
|
|
*/
|
|
*/
|
|
|
- const Ogre::String& GetCurrentAnimationName() const;
|
|
|
|
|
|
|
+ int id_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Retrieves the enemy's current animation state.
|
|
|
|
|
- *
|
|
|
|
|
- * @return The current animation state.
|
|
|
|
|
|
|
+ * The name of the enemy.
|
|
|
*/
|
|
*/
|
|
|
- AnimationState GetAnimationState() const;
|
|
|
|
|
|
|
+ Ogre::String name_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Plays one of the enemy's animations.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] animation Name of the animation to play.
|
|
|
|
|
- * @param[in] state The animation initial state.
|
|
|
|
|
- * @param[in] play_type The animation play type, to play it once or in
|
|
|
|
|
- * a loop.
|
|
|
|
|
- * @param[in] start Animation starting point in time, in seconds.
|
|
|
|
|
- * @param[in] end Animation ending point in time, in seconds.
|
|
|
|
|
|
|
+ * The enemy level.
|
|
|
*/
|
|
*/
|
|
|
- virtual void PlayAnimation(
|
|
|
|
|
- const Ogre::String& animation, AnimationState state,
|
|
|
|
|
- AnimationPlayType play_type, const float start, const float end
|
|
|
|
|
- ) = 0;
|
|
|
|
|
|
|
+ unsigned int level_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Resumes an animation.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] animation Name of the animation to resume.
|
|
|
|
|
|
|
+ * EXP given upon defeating the enemy.
|
|
|
*/
|
|
*/
|
|
|
- virtual void PlayAnimationContinue(const Ogre::String& animation) = 0;
|
|
|
|
|
|
|
+ unsigned int exp_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Updates the animation state.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] delta The animation delta.
|
|
|
|
|
|
|
+ * AP given upon defeating the enemy.
|
|
|
*/
|
|
*/
|
|
|
- virtual void UpdateAnimation(const float delta) = 0;
|
|
|
|
|
|
|
+ unsigned int ap_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Plays one of the enemy's animations.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] name Name of the animation to play.
|
|
|
|
|
|
|
+ * Money given upon defeating the enemy.
|
|
|
*/
|
|
*/
|
|
|
- void ScriptPlayAnimation(const char* name);
|
|
|
|
|
|
|
+ unsigned int money_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Stops one of the enemy's animations.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] name Name of the animation to stop.
|
|
|
|
|
|
|
+ * List of animations.
|
|
|
*/
|
|
*/
|
|
|
- void ScriptPlayAnimationStop(const char* name);
|
|
|
|
|
|
|
+ std::vector<unsigned int> animations_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Plays one of the enemy's animations.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] name Name of the animation to play.
|
|
|
|
|
- * @param[in] start Animation starting point in time, in seconds.
|
|
|
|
|
- * @param[in] end Animation ending point in time, in seconds.
|
|
|
|
|
|
|
+ * Elemental affinities.
|
|
|
*/
|
|
*/
|
|
|
- void ScriptPlayAnimation(const char* name, const float start, const float end);
|
|
|
|
|
|
|
+ std::vector<Element> elements_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Stops one of the enemy's animations.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] name Name of the animation to stop.
|
|
|
|
|
- * @param[in] start Animation starting point in time, in seconds.
|
|
|
|
|
- * @param[in] end Animation ending point in time, in seconds.
|
|
|
|
|
|
|
+ * Status immunities and resistances.
|
|
|
*/
|
|
*/
|
|
|
- void ScriptPlayAnimationStop(const char* name, const float start, const float end);
|
|
|
|
|
|
|
+ std::vector<Immunity> immunities_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the default animation of the enemy.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] animation Name of the default animation.
|
|
|
|
|
|
|
+ * Enemy attacks.
|
|
|
*/
|
|
*/
|
|
|
- void ScriptSetDefaultAnimation(const char* animation);
|
|
|
|
|
|
|
+ std::vector<Attack> attacks_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Adds the enemy's animation to the sync queue.
|
|
|
|
|
|
|
+ * List of attacks that can be used while manipulated.
|
|
|
*
|
|
*
|
|
|
- * @return Always -1.
|
|
|
|
|
- * @todo Properly describe this.
|
|
|
|
|
- */
|
|
|
|
|
- int ScriptAnimationSync();
|
|
|
|
|
-
|
|
|
|
|
- protected:
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy ID.
|
|
|
|
|
- */
|
|
|
|
|
- int enemy_id_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The name of the enemy.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::String name_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy level.
|
|
|
|
|
|
|
+ * The first one is also the one used in berserkr. If empty, it means the enemy can't be
|
|
|
|
|
+ * manipulated or berserkd.
|
|
|
*/
|
|
*/
|
|
|
- unsigned int level_;
|
|
|
|
|
|
|
+ std::vector<unsigned int> manipulate_attacks_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * EXP given upon defeating the enemy.
|
|
|
|
|
|
|
+ * List of the items that can be stolen from the enemy.
|
|
|
*/
|
|
*/
|
|
|
- unsigned int exp_;
|
|
|
|
|
|
|
+ std::vector<Item> steal_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * AP given upon defeating the enemy.
|
|
|
|
|
|
|
+ * List of the items that can be dropped from the enemy.
|
|
|
*/
|
|
*/
|
|
|
- unsigned int ap_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Money given upon defeating the enemy.
|
|
|
|
|
- */
|
|
|
|
|
- unsigned int money_;
|
|
|
|
|
|
|
+ std::vector<Item> drop_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* ID of the item the enemy can be morphed into. -1 if none..
|
|
* ID of the item the enemy can be morphed into. -1 if none..
|
|
@@ -940,10 +721,20 @@ class Enemy{
|
|
|
unsigned int dex_;
|
|
unsigned int dex_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Enemy luck stat
|
|
|
|
|
|
|
+ * Enemy luck stat.
|
|
|
*/
|
|
*/
|
|
|
unsigned int lck_;
|
|
unsigned int lck_;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Enemy evasion stat.
|
|
|
|
|
+ */
|
|
|
|
|
+ unsigned int eva_;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Enemy magic evasion stat.
|
|
|
|
|
+ */
|
|
|
|
|
+ unsigned int meva_;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Enemy's current HP.
|
|
* Enemy's current HP.
|
|
|
*/
|
|
*/
|
|
@@ -965,179 +756,34 @@ class Enemy{
|
|
|
unsigned int mp_max_;
|
|
unsigned int mp_max_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * The scene node the enemy is attached to.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::SceneNode* scene_node_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's model.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::SceneNode* model_node_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's root node.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::SceneNode* model_root_node_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's height.
|
|
|
|
|
- */
|
|
|
|
|
- float height_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Enemy's movement sync queue.
|
|
|
|
|
- */
|
|
|
|
|
- std::vector<ScriptId> sync_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The speed of the models movements.
|
|
|
|
|
- */
|
|
|
|
|
- float move_speed_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's movement destination point.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Vector3 move_position_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Distance between the enemy and it's movement destination point.
|
|
|
|
|
- */
|
|
|
|
|
- float move_stop_distance_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Indicates if the enemy can rotate while moving.
|
|
|
|
|
- */
|
|
|
|
|
- bool move_auto_rotation_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Indicates if the enemy can animate while moving.
|
|
|
|
|
- */
|
|
|
|
|
- bool move_auto_animation_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Vector3 offset_position_start_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Vector3 offset_position_end_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- ActionType offset_type_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- float offset_seconds_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- float offset_current_seconds_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @todo Understand and document.
|
|
|
|
|
- */
|
|
|
|
|
- std::vector<ScriptId> offset_sync_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Turn movement direction.
|
|
|
|
|
- */
|
|
|
|
|
- TurnDirection turn_direction_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Turn initial orientation.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Degree turn_direction_start_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Turn final orientation.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::Degree turn_direction_end_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The turn type.
|
|
|
|
|
- */
|
|
|
|
|
- ActionType turn_type_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Total turn duration.
|
|
|
|
|
- */
|
|
|
|
|
- float turn_seconds_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Current turn duration.
|
|
|
|
|
- */
|
|
|
|
|
- float turn_current_seconds_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Enemy's turning sync queue.
|
|
|
|
|
- */
|
|
|
|
|
- std::vector<ScriptId> turn_sync_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The animation speed.
|
|
|
|
|
- */
|
|
|
|
|
- float animation_speed_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's current animation name.
|
|
|
|
|
- */
|
|
|
|
|
- Ogre::String animation_current_name_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Enemy's animation sync queue.
|
|
|
|
|
- */
|
|
|
|
|
- std::vector<ScriptId> animation_sync_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's current animation state.
|
|
|
|
|
- */
|
|
|
|
|
- AnimationState animation_state_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The enemy's current animation type.
|
|
|
|
|
- */
|
|
|
|
|
- AnimationPlayType animation_play_type_;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * The name of the enemy's default name.
|
|
|
|
|
|
|
+ * Enemy position in the battlefield (x, y, z).
|
|
|
*/
|
|
*/
|
|
|
- Ogre::String animation_default_;
|
|
|
|
|
|
|
+ Ogre::Vector3 pos_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @todo Understand and document.
|
|
|
|
|
|
|
+ * Indicates if the enmy is in the frontline.
|
|
|
*/
|
|
*/
|
|
|
- float animation_end_time_;
|
|
|
|
|
|
|
+ bool front_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Indicates if an automation must be played automatically.
|
|
|
|
|
|
|
+ * Indicates if the enemy is visible.
|
|
|
*/
|
|
*/
|
|
|
- bool animation_auto_play_;
|
|
|
|
|
-
|
|
|
|
|
- private:
|
|
|
|
|
|
|
+ bool visible_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Constructor.
|
|
|
|
|
|
|
+ * Indicates if the enemy can be targeted.
|
|
|
*/
|
|
*/
|
|
|
- Enemy();
|
|
|
|
|
|
|
+ bool targeteable_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Calculates the angular distance to a point.
|
|
|
|
|
- *
|
|
|
|
|
- * @param[in] point Point to calculate the angular distance to.
|
|
|
|
|
- * @return Angular distance to the specified point.
|
|
|
|
|
|
|
+ * Indicates if the enemy's main script is active.
|
|
|
*/
|
|
*/
|
|
|
- Ogre::Degree GetDirectionToPoint(Ogre::Vector2 point) const;
|
|
|
|
|
|
|
+ bool active_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Index of the enemy on the battle.
|
|
|
|
|
|
|
+ * Cover binary flags.
|
|
|
*/
|
|
*/
|
|
|
- int index_;
|
|
|
|
|
|
|
+ std::string cover_;
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|