rott/kf_sources/AcediaCore/Classes/EPawn.uc
2026-07-14 20:27:09 +07:00

55 lines
2.0 KiB
Ucode

/**
* Author: dkanus
* Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore
* License: GPL
* Copyright 2022-2024 Anton Tarasenko
*------------------------------------------------------------------------------
* This file is part of Acedia.
*
* Acedia is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License, or
* (at your option) any later version.
*
* Acedia is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/
class EPawn extends EPlaceable
abstract;
//! Interface for a *Pawn* - base class for any entity that can be controlled by
//! player or AI.
//! This interface provides access to typical pawn components like health.
/// Returns a player that controls caller pawn.
///
/// Returns `none` if and only if caller pawn is not controlled by a player.
public function EPlayer GetPlayer();
/// Returns the current health of the caller pawn, assuming the entity includes
/// a health component.
///
/// If the referred entity lacks a health component, the method returns `0`.
public function int GetHealth() {
return 0;
}
/// Returns the maximum amount of health the caller pawn can have, assuming
/// the entity includes a health component.
///
/// If the referred entity lacks a health component, the method returns `0`.
public function int GetMaxHealth();
/// Triggers a self-destruct event for the caller [`EPawn`], causing it to
/// deplete its health and transition to a dead state, with specific behaviors
/// depending on the implementation.
public function Suicide();
defaultproperties {
}