23 lines
1.2 KiB
C++
23 lines
1.2 KiB
C++
#pragma once
|
|
#include "gateway/legacy_stream.hpp"
|
|
#include "gateway/spell_modifier_operations.hpp"
|
|
#include <optional>
|
|
#include <array>
|
|
#include <vector>
|
|
namespace gateway::spell_modifier {
|
|
// Offline/paired-profile projection. Caller supplies its received-state view;
|
|
// availability does not assert that all server updates have arrived.
|
|
std::vector<LegacyPacket> translate_group_snapshot(uint8_t character_class,
|
|
uint8_t source_operation, Kind kind, const std::array<int32_t,64>& values,
|
|
uint64_t available_values, std::optional<uint8_t> changed_bit=std::nullopt);
|
|
// Both kinds of one source operation. Source arithmetic is base*(1+P/100)+F,
|
|
// native is (base+F')*(1+P/100): a flat route whose same-bit percent partner
|
|
// totals P sends F'=F/(1+P/100) and is re-sent when that percent changes.
|
|
// P<=-100 has no native flat equivalent; that flat route is not sent.
|
|
struct ChangedSource { Kind kind; uint8_t bit; };
|
|
std::vector<LegacyPacket> translate_group_state(uint8_t character_class,
|
|
uint8_t source_operation, const std::array<int32_t,64>& flat_values,
|
|
const std::array<int32_t,64>& percent_values, uint64_t available_values,
|
|
std::optional<ChangedSource> changed=std::nullopt);
|
|
}
|