Added more status functions

This commit is contained in:
BaerMitUmlaut 2017-04-27 18:53:49 +02:00
parent 56818ac780
commit ac126aea28
7 changed files with 94 additions and 2 deletions

View File

@ -0,0 +1,20 @@
/*
* Author: BaerMitUmlaut
* Adds a heart rate adjustment that will take effect over time.
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Heart rate change <NUMBER>
* 2: Time in system for the adjustment to reach its peak <NUMBER>
* 3: Duration the adjustment will have an effect <NUMVER>
*
* Return Value:
* None
*/
#include "script_component.hpp"
params ["_unit", "_change", "_timeToMaxEffect", "_maxTimeInSystem"];
private _adjustments = _unit getVariable [QGVAR(heartRateAdjustments), []];
// The last number indicates the time the adjustment is already in the system
_adjustments pushBack [_change, _timeToMaxEffect, _maxTimeInSystem, 0];
_unit setVariable [QGVAR(heartRateAdjustments), _heartRateAdjustments];

View File

@ -0,0 +1,14 @@
/*
* Author: BaerMitUmlaut
* Get the heart rate of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* Heart Rate <NUMBER>
*/
#include "script_component.hpp"
params ["_unit"];
_unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE]

View File

@ -1,11 +1,11 @@
/*
* Author: Ruthberg
* Get the total pain level of a unit.
* Get the perceived pain level of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Return Value:
* Pain level (0 .. 1) <NUMBER>
*
* Public: No

View File

@ -0,0 +1,14 @@
/*
* Author: BaerMitUmlaut
* Get the total pain level of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* Pain level (0 .. 1) <NUMBER>
*/
#include "script_component.hpp"
params ["_unit"];
_unit getVariable [QGVAR(pain), 0]

View File

@ -0,0 +1,14 @@
/*
* Author: BaerMitUmlaut
* Check if the unit is unconscious.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* Is unconscious <BOOL>
*/
#include "script_component.hpp"
params ["_unit"];
_unit getVariable [QGVAR(isUnconscious), false]

View File

@ -0,0 +1,15 @@
/*
* Author: BaerMitUmlaut
* Sets the heart rate of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Heart rate <NUMBER>
*
* Return Value:
* None
*/
#include "script_component.hpp"
params ["_unit", "_heartRate"];
_unit setVariable [QGVAR(heartRate), _heartRate];

View File

@ -0,0 +1,15 @@
/*
* Author: BaerMitUmlaut
* Sets the total pain level of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Pain level (0..1) <NUMBER>
*
* Return Value:
* None
*/
#include "script_component.hpp"
params ["_unit", "_pain"];
_unit setVariable [QGVAR(pain), 0 max _pain min 1];