#pragma once

#include "CoreMinimal.h"
#include "ZMMOAttributeTypes.generated.h"

/**
 *  Snapshot completo dos atributos do char vindo do server via
 *  S_ATTRIBUTE_SNAPSHOT_FULL (opcode 1200).
 *
 *  Cliente NUNCA recalcula derivados — apenas exibe o que recebe. Os campos
 *  HP/MaxHp/SP/MaxSp ja sao os "efetivos" (base + equip + buff somados no
 *  servidor); o cliente nao ve as 3 camadas separadas.
 *
 *  Espelha `FZeusAttributesPayload` do plugin ZeusNetwork + a serializacao
 *  em `Server/.../AttributeService.cpp::WriteSnapshotPayload`.
 */
USTRUCT(BlueprintType)
struct ZMMOATTRIBUTES_API FZMMOAttributesSnapshot
{
	GENERATED_BODY()

	// === Identidade + classe ===
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 EntityId = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 ClassId = 0;

	// === Progressao ===
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 BaseLevel = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int64 BaseExp = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 JobLevel = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int64 JobExp = 0;

	// === Stats primarios (Camada 1 base; efetivos vao em derivados) ===
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Stats") int32 Str = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Stats") int32 Agi = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Stats") int32 Vit = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Stats") int32 Int = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Stats") int32 Dex = 1;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Stats") int32 Luk = 1;

	// === Pontos nao gastos ===
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 StatusPoint = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 SkillPoint = 0;

	// === Pool efetivo (camadas 1+2+3 somadas no servidor) ===
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 Hp = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 MaxHp = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 Sp = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 MaxSp = 0;

	// === Moeda ===
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int64 Money = 0;

	// === Derivados split em pares (base, equipBonus) ===
	// Padrao RO: display mostra "ATK 51 + 0" (base + equip). Cliente NUNCA
	// recalcula — servidor envia ambos prontos no S_ATTRIBUTE_SNAPSHOT_FULL.
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 AtkBase = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 AtkEquipBonus = 0;

	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 MatkBase = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 MatkEquipBonus = 0;

	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 DefBase = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 DefEquipBonus = 0;

	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 MdefBase = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 MdefEquipBonus = 0;

	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 HitBase = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 HitEquipBonus = 0;

	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 FleeBase = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 FleeEquipBonus = 0;

	/** Critico × 10 internamente (10 = 1.0). Divida por 10 para exibir. */
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 CritBaseX10 = 0;
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 CritEquipBonusX10 = 0;

	/** ASPD nao splita — calculo nao-linear via aspd_base × stats. Display direto. */
	UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes|Derived") int32 Aspd = 0;
};
