63 lines
2.4 KiB
Ucode
63 lines
2.4 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 HealthGameplayAPI extends AcediaObject
|
|
abstract;
|
|
|
|
var protected Health_OnDamage_Signal onDamageSignal;
|
|
|
|
protected function Constructor() {
|
|
onDamageSignal = Health_OnDamage_Signal(_.memory.Allocate(class'Health_OnDamage_Signal'));
|
|
}
|
|
|
|
protected function Finalizer() {
|
|
_.memory.Free(onDamageSignal);
|
|
onDamageSignal = none;
|
|
}
|
|
|
|
/// Signal that will be emitted whenever a pawn takes damage.
|
|
///
|
|
/// # Signal signature
|
|
///
|
|
/// void <slot>(EPawn target, EPawn instigator, HashTable damageData)
|
|
///
|
|
/// Parameter [`target`] refers to the pawn that took damage and
|
|
/// [`instigator`] to the pawn responsible for dealing damage.
|
|
/// [`damageData`] parameter stores arbitrary data that describes the damage
|
|
/// dealt in detail.
|
|
/// Exact stored values can differ based on the implementation, but any
|
|
/// implementation must support at least 4 values:
|
|
///
|
|
/// * *damage* - [`int`] value representing amount of damage [`target`]
|
|
/// will be dealt;
|
|
/// * *originalDamage* - originally intended damage for [`target`], before other
|
|
/// event handlers altered *damage* value (you shouldn't modify this value);
|
|
/// * *hitLocation* - [`Vector`] that describes the point of contact with
|
|
/// whatever dealt this damage;
|
|
/// * *momentum* - [`Vector`] value describing momentum transferred to
|
|
/// [`target`] as a result of the damage dealt.
|
|
/* SIGNAL */
|
|
public function Health_OnDamage_Slot OnDamage(AcediaObject receiver) {
|
|
return Health_OnDamage_Slot(onDamageSignal.NewSlot(receiver));
|
|
}
|
|
|
|
defaultproperties {
|
|
} |