19#ifndef HEADER_ATTACHMENT_HPP
20#define HEADER_ATTACHMENT_HPP
22#include "items/attachment_plugin.hpp"
23#include "utils/no_copy.hpp"
30 namespace scene {
class IAnimatedMeshSceneNode; }
70 ATTACH_NOLOKS_SWATTER,
72 ATTACH_BUBBLEGUM_SHIELD,
73 ATTACH_NOLOK_BUBBLEGUM_SHIELD,
99 scene::IAnimatedMeshSceneNode
120 void updateGraphics(
float dt);
122 void update(
int ticks);
124 void set (AttachmentType type,
int ticks,
126 bool set_by_rewind_parachute =
false);
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
scene::IAnimatedMeshSceneNode * m_node
Scene node of the attachment, which will be attached to the kart's scene node.
Definition: attachment.hpp:100
void set(AttachmentType type)
Sets the type of the attachment, but keeps the old time left value.
Definition: attachment.hpp:132
AbstractKart * m_previous_owner
Used by bombs so that it's not passed back to previous owner.
Definition: attachment.hpp:103
void clear()
Removes any attachement currently on the kart.
Definition: attachment.cpp:179
scene::IAnimatedMeshSceneNode * getNode()
Return the currently associated scene node (used by e.g the swatter)
Definition: attachment.hpp:152
void rewindTo(BareNetworkString *buffer)
Called from the kart rewinder when resetting to a certain state.
Definition: attachment.cpp:222
void set(AttachmentType type, int ticks, AbstractKart *previous_kart=NULL, bool set_by_rewind_parachute=false)
Sets the attachment a kart has.
Definition: attachment.cpp:116
void saveState(BareNetworkString *buffer) const
Saves the attachment state.
Definition: attachment.cpp:196
SFXBase * m_bomb_sound
Ticking sound for the bomb.
Definition: attachment.hpp:110
AttachmentType getType() const
Returns the type of this attachment.
Definition: attachment.hpp:135
AttachmentType m_graphical_type
Graphical Attachment type (comparing in updateGraphics).
Definition: attachment.hpp:83
int16_t m_initial_speed
For parachutes only, stored in cm/s for networking.
Definition: attachment.hpp:92
AttachmentType m_type
Attachment type.
Definition: attachment.hpp:80
SFXBase * m_bubble_explode_sound
Sound for exploding bubble gum shield.
Definition: attachment.hpp:113
~Attachment()
Removes the attachment object.
Definition: attachment.cpp:87
int m_scaling_end_ticks
For zoom-in animation.
Definition: attachment.hpp:95
void hitBanana(ItemState *item)
Selects the new attachment.
Definition: attachment.cpp:270
AbstractKart * getPreviousOwner() const
Returns the previous owner of this attachment, used in bombs that are being passed between karts.
Definition: attachment.hpp:146
void handleCollisionWithKart(AbstractKart *other)
Updates the attachments in case of a kart-kart collision.
Definition: attachment.cpp:401
void setTicksLeft(int16_t t)
Sets how long this attachment will remain attached.
Definition: attachment.hpp:142
AttachmentPlugin * m_plugin
An optional attachment - additional functionality can be implemented for certain attachments.
Definition: attachment.hpp:107
float weightAdjust() const
Returns additional weight for the kart.
Definition: attachment.cpp:685
AbstractKart * m_kart
Kart the attachment is attached to.
Definition: attachment.hpp:86
int16_t getTicksLeft() const
Returns how much time (in ticks) is left before this attachment is removed.
Definition: attachment.hpp:139
int16_t m_ticks_left
Time left till attachment expires.
Definition: attachment.hpp:89
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
Contains the state information of an item, i.e.
Definition: item.hpp:53
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
Declares the general types that are used by the network.