mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
interaction with portable lamps
This commit is contained in:
@ -94,4 +94,16 @@ class Extended_Init_EventHandlers {
|
|||||||
init = QUOTE(_this call DFUNC(initObject));
|
init = QUOTE(_this call DFUNC(initObject));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Land_PortableLight_single_F {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(_this call DFUNC(initObject));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Land_PortableLight_double_F {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(_this call DFUNC(initObject));
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
@ -291,4 +291,14 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Lamps_base_F;
|
||||||
|
class Land_PortableLight_single_F: Lamps_base_F {
|
||||||
|
GVAR(size) = 1;
|
||||||
|
GVAR(canLoad) = 1;
|
||||||
|
};
|
||||||
|
class Land_PortableLight_double_F: Land_PortableLight_single_F {
|
||||||
|
GVAR(size) = 1;
|
||||||
|
GVAR(canLoad) = 1;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -33,6 +33,16 @@ class Extended_Init_EventHandlers {
|
|||||||
init = QUOTE(_this call DFUNC(initObject));
|
init = QUOTE(_this call DFUNC(initObject));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
class Land_PortableLight_single_F {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(_this call DFUNC(initObject));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Land_PortableLight_double_F {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(_this call DFUNC(initObject));
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_Killed_EventHandlers {
|
class Extended_Killed_EventHandlers {
|
||||||
|
@ -97,4 +97,18 @@ class CfgVehicles {
|
|||||||
GVAR(carryPosition[]) = {0,1,1};
|
GVAR(carryPosition[]) = {0,1,1};
|
||||||
GVAR(carryDirection) = 0;
|
GVAR(carryDirection) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Lamps_base_F;
|
||||||
|
class Land_PortableLight_single_F: Lamps_base_F {
|
||||||
|
GVAR(canCarry) = 1;
|
||||||
|
GVAR(carryPosition[]) = {0,1.2,0};
|
||||||
|
GVAR(carryDirection) = 180;
|
||||||
|
|
||||||
|
GVAR(canDrag) = 1;
|
||||||
|
GVAR(dragPosition[]) = {0,1.2,0};
|
||||||
|
GVAR(dragDirection) = 180;
|
||||||
|
};
|
||||||
|
class Land_PortableLight_single_off_F: Land_PortableLight_single_F {};
|
||||||
|
class Land_PortableLight_double_F: Land_PortableLight_single_F {};
|
||||||
|
class Land_PortableLight_double_off_F: Land_PortableLight_double_F {};
|
||||||
};
|
};
|
||||||
|
@ -604,4 +604,97 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
class ACE_SelfActions {};
|
class ACE_SelfActions {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Lamps_base_F;
|
||||||
|
class Land_PortableLight_single_F: Lamps_base_F {
|
||||||
|
scope = 2;
|
||||||
|
GVAR(switchLampClass) = "Land_PortableLight_single_off_F";
|
||||||
|
XEH_ENABLED;
|
||||||
|
class ACE_Actions {
|
||||||
|
class ACE_MainActions {
|
||||||
|
displayName = CSTRING(MainAction);
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
condition = "true";
|
||||||
|
class ACE_SwitchLamp {
|
||||||
|
displayName = CSTRING(TurnOff);
|
||||||
|
condition = QUOTE(alive _target);
|
||||||
|
statement = QUOTE([ARR_1(_target)] call DFUNC(switchLamp));
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
showDisabled = 0;
|
||||||
|
priority = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class ACE_SelfActions {};
|
||||||
|
};
|
||||||
|
class Land_PortableLight_single_off_F: Land_PortableLight_single_F {
|
||||||
|
scope = 1;
|
||||||
|
GVAR(switchLampClass) = "Land_PortableLight_single_F";
|
||||||
|
GVAR(switchLampOff) = 1;
|
||||||
|
class ACE_Actions {
|
||||||
|
class ACE_MainActions {
|
||||||
|
displayName = CSTRING(MainAction);
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
condition = "true";
|
||||||
|
class ACE_SwitchLamp {
|
||||||
|
displayName = CSTRING(TurnOn);
|
||||||
|
condition = QUOTE(alive _target);
|
||||||
|
statement = QUOTE([ARR_1(_target)] call DFUNC(switchLamp));
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
showDisabled = 0;
|
||||||
|
priority = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Land_PortableLight_double_F: Land_PortableLight_single_F {
|
||||||
|
scope = 2;
|
||||||
|
GVAR(switchLampClass) = "Land_PortableLight_double_off_F";
|
||||||
|
XEH_ENABLED;
|
||||||
|
class ACE_Actions {
|
||||||
|
class ACE_MainActions {
|
||||||
|
displayName = CSTRING(MainAction);
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
condition = "true";
|
||||||
|
class ACE_SwitchLamp {
|
||||||
|
displayName = CSTRING(TurnOff);
|
||||||
|
condition = QUOTE(alive _target);
|
||||||
|
statement = QUOTE([ARR_1(_target)] call DFUNC(switchLamp));
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
showDisabled = 0;
|
||||||
|
priority = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class ACE_SelfActions {};
|
||||||
|
};
|
||||||
|
class Land_PortableLight_double_off_F: Land_PortableLight_double_F {
|
||||||
|
scope = 1;
|
||||||
|
GVAR(switchLampClass) = "Land_PortableLight_double_F";
|
||||||
|
GVAR(switchLampOff) = 1;
|
||||||
|
class ACE_Actions {
|
||||||
|
class ACE_MainActions {
|
||||||
|
displayName = CSTRING(MainAction);
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
condition = "true";
|
||||||
|
class ACE_SwitchLamp {
|
||||||
|
displayName = CSTRING(TurnOn);
|
||||||
|
condition = QUOTE(alive _target);
|
||||||
|
statement = QUOTE([ARR_1(_target)] call DFUNC(switchLamp));
|
||||||
|
selection = "";
|
||||||
|
distance = 2;
|
||||||
|
showDisabled = 0;
|
||||||
|
priority = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class ACE_SelfActions {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -34,5 +34,6 @@ PREP(sendAway);
|
|||||||
PREP(showMouseHint);
|
PREP(showMouseHint);
|
||||||
PREP(sortOptionsByPriority);
|
PREP(sortOptionsByPriority);
|
||||||
PREP(tapShoulder);
|
PREP(tapShoulder);
|
||||||
|
PREP(switchLamp);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
58
addons/interaction/functions/fnc_switchLamp.sqf
Normal file
58
addons/interaction/functions/fnc_switchLamp.sqf
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Author: SzwedzikPL
|
||||||
|
* Turn on/off lamp
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Lamp <OBJECT>
|
||||||
|
* 1: On/Off <SCALAR>
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [lamp] call ace_interaction_fnc_switchLamp
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#define DISABLED_LAMP_DMG 0.95
|
||||||
|
|
||||||
|
params ["_object"];
|
||||||
|
|
||||||
|
private ["_objectClass", "_class"];
|
||||||
|
|
||||||
|
_objectClass = typeof _object;
|
||||||
|
_class = getText (configFile >> "CfgVehicles" >> _objectClass >> QGVAR(switchLampClass));
|
||||||
|
|
||||||
|
if (_class == "") exitWith {};
|
||||||
|
|
||||||
|
private ["_vectors", "_pos", "_reflectors", "_hitpointsdmg"];
|
||||||
|
|
||||||
|
_vectors = [vectorDir _object, vectorUp _object];
|
||||||
|
_pos = getPosATL _object;
|
||||||
|
|
||||||
|
_reflectors = (configfile >> "CfgVehicles" >> _objectClass >> "Reflectors") call BIS_fnc_getCfgSubClasses;
|
||||||
|
_hitpointsdmg = [];
|
||||||
|
{
|
||||||
|
_hitpoint = getText (configfile >> "CfgVehicles" >> _objectClass >> "Reflectors" >> _x >> "hitpoint");
|
||||||
|
_hitpointsdmg pushback [_hitpoint, _object getHit _hitpoint];
|
||||||
|
nil
|
||||||
|
} count _reflectors;
|
||||||
|
|
||||||
|
deleteVehicle _object;
|
||||||
|
|
||||||
|
private ["_newobject", "_isOff"];
|
||||||
|
|
||||||
|
_newobject = createVehicle [_class, _pos, [], 0, "CAN_COLLIDE"];
|
||||||
|
_newobject setVectorDirAndUp _vectors;
|
||||||
|
_newobject setPosATL _pos;
|
||||||
|
_isOff = getNumber (configFile >> "CfgVehicles" >> _class >> QGVAR(switchLampOff)) == 1;
|
||||||
|
|
||||||
|
if(_isOff) then {
|
||||||
|
//this lamp is off
|
||||||
|
{_newobject sethit [_x select 0, (_x select 1) max DISABLED_LAMP_DMG];nil} count _hitpointsdmg;
|
||||||
|
} else {
|
||||||
|
//new lamp is on
|
||||||
|
{if((_x select 1) > DISABLED_LAMP_DMG) then {_newobject sethit _x;};nil} count _hitpointsdmg;
|
||||||
|
};
|
@ -807,5 +807,11 @@
|
|||||||
<Russian>O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes.</Russian>
|
<Russian>O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes.</Russian>
|
||||||
<Spanish>La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos.</Spanish>
|
<Spanish>La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos.</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Interaction_TurnOn">
|
||||||
|
<English>Turn on</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Interaction_TurnOff">
|
||||||
|
<English>Turn off</English>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Reference in New Issue
Block a user