2020-09-14 00:00:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2020-10-09 00:00:00 +00:00
|
|
|
#include <stdint.h>
|
2020-09-14 00:00:00 +00:00
|
|
|
|
|
|
|
#include <msgpack.h>
|
|
|
|
|
|
|
|
#include "core/locommon/ticker.h"
|
|
|
|
|
|
|
|
#include "./effect.h"
|
|
|
|
#include "./generic.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
float attack;
|
|
|
|
float defence;
|
|
|
|
|
|
|
|
float speed; /* [chunks/sec] */
|
|
|
|
float jump; /* [chunks/sec^2] */
|
|
|
|
} loeffect_recipient_status_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const locommon_ticker_t* ticker;
|
|
|
|
|
2020-10-09 00:00:00 +00:00
|
|
|
loeffect_recipient_status_t status;
|
2020-09-14 00:00:00 +00:00
|
|
|
|
2020-10-09 00:00:00 +00:00
|
|
|
float madness;
|
|
|
|
float faith;
|
2020-09-14 00:00:00 +00:00
|
|
|
|
2020-10-09 00:00:00 +00:00
|
|
|
uint64_t last_die;
|
|
|
|
loeffect_id_t last_die_reason;
|
2020-09-14 00:00:00 +00:00
|
|
|
|
2020-10-09 00:00:00 +00:00
|
|
|
uint64_t lost_damage_since;
|
|
|
|
|
|
|
|
uint64_t last_resuscitate;
|
|
|
|
uint64_t last_damage;
|
|
|
|
uint64_t last_heal;
|
|
|
|
uint64_t last_lost;
|
|
|
|
uint64_t last_retrieval;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
loeffect_generic_lasting_param_t fanatic;
|
|
|
|
loeffect_generic_lasting_param_t curse;
|
|
|
|
loeffect_generic_lasting_param_t amnesia;
|
|
|
|
} effects;
|
2020-09-14 00:00:00 +00:00
|
|
|
} loeffect_recipient_t;
|
|
|
|
|
|
|
|
void
|
|
|
|
loeffect_recipient_initialize(
|
2020-10-09 00:00:00 +00:00
|
|
|
loeffect_recipient_t* recipient,
|
|
|
|
const locommon_ticker_t* ticker,
|
|
|
|
const loeffect_recipient_status_t* status /* NULLABLE */
|
2020-09-14 00:00:00 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
void
|
|
|
|
loeffect_recipient_deinitialize(
|
|
|
|
loeffect_recipient_t* recipient
|
|
|
|
);
|
|
|
|
|
|
|
|
void
|
|
|
|
loeffect_recipient_apply_effect(
|
|
|
|
loeffect_recipient_t* recipient,
|
|
|
|
const loeffect_t* effect
|
|
|
|
);
|
|
|
|
|
|
|
|
void
|
|
|
|
loeffect_recipient_update(
|
|
|
|
loeffect_recipient_t* recipient,
|
|
|
|
const loeffect_recipient_status_t* base
|
|
|
|
);
|
|
|
|
|
2020-10-09 00:00:00 +00:00
|
|
|
bool
|
|
|
|
loeffect_recipient_is_alive(
|
|
|
|
const loeffect_recipient_t* recipient
|
|
|
|
);
|
|
|
|
|
2020-09-14 00:00:00 +00:00
|
|
|
void
|
2020-10-09 00:00:00 +00:00
|
|
|
loeffect_recipient_pack(
|
|
|
|
const loeffect_recipient_t* recipient,
|
|
|
|
msgpack_packer* packer
|
2020-09-14 00:00:00 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
bool
|
2020-10-09 00:00:00 +00:00
|
|
|
loeffect_recipient_unpack(
|
|
|
|
loeffect_recipient_t* recipient,
|
|
|
|
const msgpack_object* obj
|
2020-09-14 00:00:00 +00:00
|
|
|
);
|