mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Implemented surrender module
Improved knockout module
This commit is contained in:
parent
3702d0b671
commit
a4512e4740
@ -4,23 +4,23 @@ class CfgVehicles {
|
|||||||
class ACE_Module;
|
class ACE_Module;
|
||||||
|
|
||||||
class ModuleCurator_F: Module_F {
|
class ModuleCurator_F: Module_F {
|
||||||
function = QUOTE(DFUNC(bi_moduleCurator));
|
function = QFUNC(bi_moduleCurator);
|
||||||
};
|
};
|
||||||
class ModuleMine_F: ModuleEmpty_F {
|
class ModuleMine_F: ModuleEmpty_F {
|
||||||
function = QUOTE(DFUNC(bi_moduleMine));
|
function = QFUNC(bi_moduleMine);
|
||||||
};
|
};
|
||||||
class ModuleOrdnance_F: Module_F {
|
class ModuleOrdnance_F: Module_F {
|
||||||
function = QUOTE(DFUNC(bi_moduleProjectile));
|
function = QFUNC(bi_moduleProjectile);
|
||||||
};
|
};
|
||||||
class ModuleRemoteControl_F: Module_F {
|
class ModuleRemoteControl_F: Module_F {
|
||||||
function = QUOTE(DFUNC(bi_moduleRemoteControl));
|
function = QFUNC(bi_moduleRemoteControl);
|
||||||
};
|
};
|
||||||
class GVAR(moduleZeusSettings): ACE_Module {
|
class GVAR(moduleZeusSettings): ACE_Module {
|
||||||
scope = 2;
|
scope = 2;
|
||||||
displayName = "$STR_ACE_Zeus_Module_DisplayName";
|
displayName = "$STR_ACE_Zeus_Module_DisplayName";
|
||||||
//icon = QUOTE(PATHTOF(iconGoesHere));
|
//icon = QUOTE(PATHTOF(iconGoesHere));
|
||||||
category = "ACE_zeus";
|
category = "ACE_zeus";
|
||||||
function = QUOTE(DFUNC(moduleZeusSettings));
|
function = QFUNC(moduleZeusSettings);
|
||||||
functionPriority = 1;
|
functionPriority = 1;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
isTriggerActivated = 0;
|
isTriggerActivated = 0;
|
||||||
@ -76,19 +76,26 @@ class CfgVehicles {
|
|||||||
sync[] = {};
|
sync[] = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class GVAR(moduleKnockout): Module_F {
|
class GVAR(moduleBase): Module_F {
|
||||||
scopeCurator = 2;
|
|
||||||
displayName = "Knockout/Wakeup Unit";
|
|
||||||
//icon = QUOTE(PATHTOF(iconGoesHere));
|
|
||||||
category = "ACE_zeus";
|
|
||||||
function = QUOTE(DFUNC(moduleKnockout));
|
|
||||||
functionPriority = 1;
|
|
||||||
isGlobal = 1;
|
|
||||||
isTriggerActivated = 0;
|
|
||||||
curatorCanAttach = 1;
|
|
||||||
author = "SilentSpike";
|
author = "SilentSpike";
|
||||||
|
category = "ACE";
|
||||||
|
scopeCurator = 2;
|
||||||
|
};
|
||||||
|
class GVAR(moduleKnockout): GVAR(moduleBase) {
|
||||||
|
curatorCanAttach = 1;
|
||||||
|
displayName = "Knockout/Wakeup Unit";
|
||||||
|
function = QFUNC(moduleKnockout);
|
||||||
class ModuleDescription {
|
class ModuleDescription {
|
||||||
description = "Knocks out or wakes up the specified unit.";
|
description = "Flips the unconscious state of the specified unit.";
|
||||||
|
sync[] = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class GVAR(moduleSurrender): GVAR(moduleBase) {
|
||||||
|
curatorCanAttach = 1;
|
||||||
|
displayName = "Force Surrender";
|
||||||
|
function = QFUNC(moduleSurrender);
|
||||||
|
class ModuleDescription {
|
||||||
|
description = "Flips the surrender state of the specified unit.";
|
||||||
sync[] = {};
|
sync[] = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@ PREP(bi_moduleMine);
|
|||||||
PREP(bi_moduleProjectile);
|
PREP(bi_moduleProjectile);
|
||||||
PREP(bi_moduleRemoteControl);
|
PREP(bi_moduleRemoteControl);
|
||||||
PREP(moduleKnockout);
|
PREP(moduleKnockout);
|
||||||
|
PREP(moduleSurrender);
|
||||||
PREP(moduleZeusSettings);
|
PREP(moduleZeusSettings);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
class CfgPatches {
|
class CfgPatches {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
units[] = {
|
units[] = {
|
||||||
QGVAR(moduleKnockout)
|
QGVAR(moduleKnockout),
|
||||||
|
QGVAR(moduleSurrender)
|
||||||
};
|
};
|
||||||
weapons[] = {};
|
weapons[] = {};
|
||||||
requiredVersion = REQUIRED_VERSION;
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
@ -15,30 +15,31 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_logic","_unit","_conscious","_previous"];
|
PARAMS_3(_logic,_units,_activated);
|
||||||
|
private ["_activated","_unit","_logic","_conscious"];
|
||||||
|
|
||||||
_logic = _this select 0;
|
if (!_activated) exitWith {};
|
||||||
_unit = attachedTo _logic;
|
|
||||||
|
|
||||||
if (isNil QEFUNC(medical,setUnconscious)) exitWith {
|
if (isNil QEFUNC(medical,setUnconscious)) then {
|
||||||
["Requires ACE_Medical to work."] call DEFUNC(common,displayTextStructured);
|
["Requires ACE_Medical"] call DEFUNC(common,displayTextStructured);
|
||||||
deleteVehicle _logic;
|
} else {
|
||||||
};
|
_unit = attachedTo _logic;
|
||||||
if (isNull _unit) exitWith {
|
|
||||||
["Module must be placed on a unit."] call DEFUNC(common,displayTextStructured);
|
if (isNull _unit) then {
|
||||||
deleteVehicle _logic;
|
["Place on a unit"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
if (!_unit isKindOf "CAManBase") then {
|
||||||
|
["Unit must be infantry"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
if (!alive _unit) then {
|
||||||
|
["Unit must be alive"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
_conscious = GETVAR(_unit,ACE_isUnconscious,false);
|
||||||
|
// Function handles locality for me
|
||||||
|
[_unit, !_conscious, true] call DEFUNC(medical,setUnconscious);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_conscious = _unit getVariable ["ACE_isUnconscious", false];
|
deleteVehicle _logic;
|
||||||
|
|
||||||
//Hacky method, will be replaced once #1205 is complete
|
|
||||||
_previous = _unit getvariable [QEGVAR(medical,enableUnconsciousnessAI), EGVAR(medical,enableUnconsciousnessAI)];
|
|
||||||
if (_previous < 2) then {_unit setvariable [QEGVAR(medical,enableUnconsciousnessAI), 2];};
|
|
||||||
|
|
||||||
[_unit, !_conscious] call DEFUNC(medical,setUnconscious);
|
|
||||||
|
|
||||||
if (_previous < 2) then {
|
|
||||||
_unit setvariable [QEGVAR(medical,enableUnconsciousnessAI), _previous];
|
|
||||||
};
|
|
||||||
|
|
||||||
deleteVehicle _logic;
|
|
||||||
|
47
addons/zeus/functions/fnc_moduleSurrender.sqf
Normal file
47
addons/zeus/functions/fnc_moduleSurrender.sqf
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Author: SilentSpike
|
||||||
|
* Flips the surrender state of the unit the module is attached to.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The module logic <LOGIC>
|
||||||
|
* 1: units <ARRAY>
|
||||||
|
* 2: activated <BOOL>
|
||||||
|
*
|
||||||
|
* ReturnValue:
|
||||||
|
* nil
|
||||||
|
*
|
||||||
|
* Public: no
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
[_unit,!_surrendering] call DEFUNC(captives,setSurrendered);
|
||||||
|
|
||||||
|
PARAMS_3(_logic,_units,_activated);
|
||||||
|
private ["_logic","_activated","_unit","_conscious","_previous"];
|
||||||
|
|
||||||
|
if (!_activated) exitWith {};
|
||||||
|
|
||||||
|
if (isNil QEFUNC(captives,setSurrendered)) then {
|
||||||
|
["Requires ACE_Captives"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
_unit = attachedTo _logic;
|
||||||
|
|
||||||
|
if (isNull _unit) then {
|
||||||
|
["Place on a unit"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
if (!_unit isKindOf "CAManBase") then {
|
||||||
|
["Unit must be infantry"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
if (!alive _unit) then {
|
||||||
|
["Unit must be alive"] call DEFUNC(common,displayTextStructured);
|
||||||
|
} else {
|
||||||
|
_surrendering = GETVAR(_unit,QEGVAR(captives,isSurrendering),false);
|
||||||
|
// Event initalized by ACE_Captives
|
||||||
|
["SetSurrendered", _unit, [_unit, !_surrendering]] call DEFUNC(common,targetEvent);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
deleteVehicle _logic;
|
Loading…
Reference in New Issue
Block a user