Skip to main content

terraria_protocol/packets/
mana_effect.rs

1use crate::packets::PacketBody;
2use crate::SliceCursor;
3
4/// Apply a mana healing effect.
5///
6/// Direction: Server <-> Client (Sync).
7#[derive(Debug)]
8pub struct ManaEffect {
9    pub player_id: u8,
10    pub mana_amount: i16,
11}
12
13impl PacketBody for ManaEffect {
14    const TAG: u8 = 43;
15
16    fn write_body(&self, cursor: &mut SliceCursor) {
17        cursor.write(&self.player_id);
18        cursor.write(&self.mana_amount);
19    }
20
21    fn from_body(cursor: &mut SliceCursor) -> Self {
22        Self {
23            player_id: cursor.read(),
24            mana_amount: cursor.read(),
25        }
26    }
27}