/*
* olds_basebuilder.inc - API of the Base Builder Core Mode (olds.ro), for class and
* extra-item plugins. Copyright (C) 2026 daemon (olds.ro). GPL-3.0-or-later.
*/
#if defined _olds_basebuilder_included
#endinput
#endif
#define _olds_basebuilder_included
#pragma reqlib olds_basebuilder
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib olds_basebuilder
#endif
/* Phases, in the order a round goes through them. */
enum
{
OLDS_BB_OFF = 0, // before the first round of the map
OLDS_BB_BUILD, // humans move blocks, zombies are frozen in spawn
OLDS_BB_PREP, // blocks are locked, zombies still frozen
OLDS_BB_FIGHT, // zombies released
OLDS_BB_OVER // the round has ended
}
/* Who may buy an extra item. */
#define OLDS_BB_TEAM_ZOMBIES 1
#define OLDS_BB_TEAM_HUMANS 2
#define OLDS_BB_TEAM_BOTH 3
/* The current phase (OLDS_BB_*). */
native olds_bb_get_phase();
/* 1 when the player is a zombie (T side) while the mode runs. */
native olds_bb_is_zombie(id);
/*
* Adds a zombie class to the /bb class menu; returns its id, or -1.
* health 0 = olds_bb_zombiehp; speed 0 = the knife's normal speed; gravity 1.0 = normal.
* Call it in plugin_precache or plugin_init.
*/
native olds_bb_register_class(const name[], const info[], health, Float:speed, Float:gravity);
/* The class the player plays this life (0 = the built-in class). */
native olds_bb_get_class(id);
/* Adds an extra item to the /bb item menu; returns its id, or -1. team: OLDS_BB_TEAM_*. */
native olds_bb_register_item(const name[], cost, team);
/* The phase changed. */
forward olds_bb_phase_changed(phase);
/* A zombie spawned with this class; a class plugin applies its extras here. */
forward olds_bb_zombie_spawned(id, class);
/* The player chose a class (used from their next zombie spawn). */
forward olds_bb_class_chosen(id, class);
/* The player bought the item (the money is already taken): give it here. */
forward olds_bb_item_bought(id, item);