19#ifndef HEADER_SWATTER_HPP
20#define HEADER_SWATTER_HPP
22#include "config/stk_config.hpp"
23#include "items/attachment_plugin.hpp"
24#include "utils/cpp2011.hpp"
25#include "utils/no_copy.hpp"
35 class IAnimatedMeshSceneNode;
62 SWATTER_TO_TARGET = 1,
63 SWATTER_FROM_TARGET = 2
83 int m_swatter_duration;
89 int16_t m_swatter_animation_ticks;
100 void updateGraphics(
float dt) OVERRIDE;
108 return m_animation_phase == SWATTER_AIMING;
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
This is the base class for a plugin into an attachment.
Definition: attachment_plugin.hpp:39
This objects is permanently available in a kart and stores information about addons.
Definition: attachment.hpp:52
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
Definition: moveable.hpp:46
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
The base class for sound effects.
Definition: sfx_base.hpp:43
Definition: swatter.hpp:51
void squashThingsAround()
Squash karts or items that are around the end position (determined using a joint) of the swatter.
Definition: swatter.cpp:391
bool updateAndTestFinished(int ticks) OVERRIDE
Updates an armed swatter: it checks for any karts that are close enough and not invulnerable,...
Definition: swatter.cpp:234
void pointToTarget()
If there is a current target, point to it, otherwise adopt the default position.
Definition: swatter.cpp:365
AbstractKart * m_closest_kart
The kart the swatter is aiming at.
Definition: swatter.hpp:68
AnimationPhase
State of the animation, the swatter is successively:
Definition: swatter.hpp:60
int16_t m_bomb_remaining
Set the bomb remaing ticks so we can set the timer on the removing bomb animation.
Definition: swatter.hpp:87
bool isSwatterReady() const
Returns if the swatter is currently aiming, i.e.
Definition: swatter.hpp:106
bool m_discard_now
True if the swatter will be discarded now.
Definition: swatter.hpp:92
scene::IAnimatedMeshSceneNode * m_scene_node
Set the end ticks to complete the removing an attached bomb animation.
Definition: swatter.hpp:75
bool m_played_swatter_animation
True if the swatter animation has been played.
Definition: swatter.hpp:95
void chooseTarget()
Determine the nearest kart or item and update the current target accordingly.
Definition: swatter.cpp:325
virtual ~Swatter()
Destructor, stops any playing sfx.
Definition: swatter.cpp:92
scene::IAnimatedMeshSceneNode * m_bomb_scene_node
The scene node where a bomb is saved (in case that the swatter replaces a bomb.
Definition: swatter.hpp:79