/*
* olds_biohazard.inc - API of the Biohazard Zombie Core (olds.ro workshop card LIB-0030).
* Copyright (C) 2026 daemon (olds.ro). GPL-3.0-or-later.
*
* The core registers two libraries: "olds_biohazard" (the bh_* natives below) and
* "biohazardf" (the classic Biohazard natives is_user_zombie, infect_user, cure_user,
* game_started, register_class, set_class_data, get_class_data, get_user_class and the
* forwards event_infect, event_gamestart), so plugins written for Biohazard keep working.
*/
#if defined _olds_biohazard_included
#endinput
#endif
#define _olds_biohazard_included
#pragma reqlib olds_biohazard
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib olds_biohazard
#endif
/* Class data ids for set_class_data / get_class_data (the classic Biohazard order). */
enum
{
DATA_HEALTH = 0, // health of an infected player of the class
DATA_SPEED, // top speed
DATA_GRAVITY, // gravity multiplier (1.0 = normal)
DATA_ATTACK, // stored only (zombie knife hits infect)
DATA_DEFENCE, // multiplier of the damage the zombie takes (1.0 = normal)
DATA_HEDEFENCE, // multiplier of grenade damage the zombie takes
DATA_HITSPEED, // stored only
DATA_HITDELAY, // stored only
DATA_REGENDLY, // stored only
DATA_HITREGENDLY, // stored only
DATA_KNOCKBACK // stored only
}
/* Infects a living human. Returns false (no error) for a dead, disconnected or already
infected player, before the outbreak or after the round end, or when a bh_fw_infect_pre
handler blocks it. attacker 0 = no attacker. */
native bool:bh_infect(id, attacker = 0);
/* Turns a living zombie back into a human (CT, normal model, 100 HP, a knife).
Returns false (no error) when the player is not a living zombie. */
native bool:bh_cure(id);
/* true when the player is a zombie. */
native bool:bh_is_zombie(id);
/* true once the first zombies of this round are chosen. */
native bool:bh_game_started();
/* Adds a zombie class; returns its id (1 or more; 0 is the built-in "Classic"), or -1.
Call it in plugin_precache or plugin_init. */
native bh_register_class(const name[], const description[]);
/* Sets or reads one value of a class (DATA_*). */
native bh_set_class_data(classid, dataid, Float:value);
native Float:bh_get_class_data(classid, dataid);
/* The class the player plays (or will play when infected). */
native bh_get_user_class(id);
/* Before an infection (by a hit or bh_infect): return PLUGIN_HANDLED to block it. */
forward bh_fw_infect_pre(victim, attacker);
/* After an infection (the classic event_infect(victim, attacker) is fired too). */
forward bh_fw_infected(victim, attacker);
/* After a cure. */
forward bh_fw_cured(id);
/* A class was registered (by any plugin). */
forward bh_fw_class_registered(classid, const name[]);
/* The first zombies were chosen (the classic event_gamestart() is fired too). */
forward bh_fw_game_started();