Skip to content

Commit

Permalink
(#642): renamed event functions for hit and killed enemies
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansible2 committed Jul 9, 2023
1 parent 9a7b17e commit 196c697
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 157 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/* ----------------------------------------------------------------------------
Function: BLWK_fnc_stdEnemyHitEventPlayer
Function: BLWK_fnc_event_hitEnemy
Description:
Executes from an enemy's hit eventhandler. The message is sent from whomever
controls the AI to the instigator.
This is what will add the points to a player and create a hit marker.
Executed from the event added by "BLWK_fnc_stdEnemyHitEventLocal"
Parameters:
0: _hitUnit : <OBJECT> - The unit hit
1: _damage : <NUMBER> - The numerical damage done to a unit (for points/hit markers)
Expand All @@ -19,16 +17,15 @@ Returns:
Examples:
(begin example)
// from hit event
[_hitUnit,_damage] remoteExecCall ["BLWK_fnc_handleHitEventPlayer",_instigator];
[_hitUnit,_damage] remoteExecCall ["BLWK_fnc_event_hitEnemy",_instigator];
(end)
Author(s):
Hilltop(Willtop) & omNomios,
Modified by: Ansible2 // Cipher
Modified by: Ansible2
---------------------------------------------------------------------------- */
#define SCRIPT_NAME "BLWK_fnc_handleHitEventPlayer"
scriptName SCRIPT_NAME;
scriptName "BLWK_fnc_event_hitEnemy";

if !(hasInterface) exitWith {};

Expand All @@ -52,4 +49,6 @@ if (missionNamespace getVariable ["BLWK_isAircraftGunner",false]) then {
private _points = round (BLWK_pointsForHit + _damagePoints);
[_points] call BLWK_fnc_addPoints;
[_hitUnit,_points] call BLWK_fnc_createHitMarker;
};
};

nil
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Description:
This is what will add the points to a player and create a hit marker.
Executed from the event added by "BLWK_fnc_stdEnemyKilledEvent"
Parameters:
0: _killedUnit : <OBJECT> - The unit killed
1: _isVehicle : <BOOL> - True if anything other then a man unit (tank,car,etc.)
Expand All @@ -19,15 +17,14 @@ Returns:
Examples:
(begin example)
// from hit event
[_killedUnit] remoteExecCall ["BLWK_fnc_handleKillEventPlayer",_instigator];
[_killedUnit] remoteExecCall ["BLWK_fnc_event_killedEnemy",_instigator];
(end)
Author(s):
Hilltop(Willtop) & omNomios,
Modified by: Ansible2 // Cipher
Modified by: Ansible2
---------------------------------------------------------------------------- */
scriptName "BLWK_fnc_handleKillEventPlayer";
scriptName "BLWK_fnc_event_killedEnemy";

if !(hasInterface) exitWith {};

Expand All @@ -44,10 +41,15 @@ if (isNull _killedUnit) exitWith {
private _points = [_killedUnit] call BLWK_fnc_getPointsForKill;

// aircraft gunners get limited points
if (missionNamespace getVariable ["BLWK_isAircraftGunner",false] AND {!_isVehicle}) then {

if (
(missionNamespace getVariable ["BLWK_isAircraftGunner",false]) AND
(!_isVehicle)
) then {
_points = round (_points / 4);
};

[_points] call BLWK_fnc_addPoints;
[_killedUnit,_points,true] call BLWK_fnc_createHitMarker;


nil

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 8 additions & 4 deletions Headers/descriptionEXT/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,14 @@ class BLWK
{};
};

class Events
{
file = "Functions\Wave Type Libraries\Events";
class event_killedEnemy
{};
class event_hitEnemy
{};
};

class StandardWaveLibrary
{
Expand All @@ -492,10 +500,6 @@ class BLWK
{};
class handleDefectorWave
{};
class handleKillEventPlayer
{};
class handleHitEventPlayer
{};
class handleStandardWave
{};
class stdEnemyHitEvent
Expand Down

0 comments on commit 196c697

Please sign in to comment.