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

56 lines
1.9 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 EAmmo extends EItem
abstract;
//! Abstract interface that represents ammunition of a certain type.
/// Checks whether the owner of the referred ammo item also has a weapon that
/// can be loaded with this ammo.
public function bool HasWeapon() {
return false;
}
/// Returns an array of all weapons in the owner's inventory that can be loaded
/// with the specified ammo.
///
/// Ensures that the array contains no `none` values or references to
/// non-existent entities.
public function array<EWeapon> GetCompatibleWeapons() {
local array<EWeapon> emptyArray;
return emptyArray;
}
/// Maxes out amount of ammo of the referred ammunition item.
///
/// Does nothing if current ammo is already at (or higher) than maximum value
/// (see [`GetMaxAmount()`]).
public function Fill() {
if (GetMaxStackSize() < 0) return;
if (GetStackSize() >= GetMaxStackSize()) return;
SetStackSize(GetMaxStackSize());
}
defaultproperties {
}