diff --git a/addons/feedback/XEH_PREP.hpp b/addons/feedback/XEH_PREP.hpp index 82eba5926..f5eab06cf 100644 --- a/addons/feedback/XEH_PREP.hpp +++ b/addons/feedback/XEH_PREP.hpp @@ -1,7 +1,10 @@ PREP(effectBreathingWheeze); PREP(effectCoughing); +PREP(effectEyeBlink); +PREP(effectEyeInjury); +PREP(effectHurtEye); PREP(effectLowSpO2); PREP(effectOpioid); PREP(effectTearHaze); PREP(handleEffects); -PREP(initEffects); +PREP(initEffects); \ No newline at end of file diff --git a/addons/feedback/XEH_postInit.sqf b/addons/feedback/XEH_postInit.sqf index d10f16232..e352f6460 100644 --- a/addons/feedback/XEH_postInit.sqf +++ b/addons/feedback/XEH_postInit.sqf @@ -9,4 +9,4 @@ params ["_unit", "_newCamera"]; [true] call FUNC(handleEffects); -}] call CBA_fnc_addPlayerEventHandler; +}] call CBA_fnc_addPlayerEventHandler; \ No newline at end of file diff --git a/addons/feedback/data/BlindEffect.paa b/addons/feedback/data/BlindEffect.paa new file mode 100644 index 000000000..0d56f1ab8 Binary files /dev/null and b/addons/feedback/data/BlindEffect.paa differ diff --git a/addons/feedback/data/LeftEyeEffect.paa b/addons/feedback/data/LeftEyeEffect.paa new file mode 100644 index 000000000..facabf44f Binary files /dev/null and b/addons/feedback/data/LeftEyeEffect.paa differ diff --git a/addons/feedback/data/LowerBlink.paa b/addons/feedback/data/LowerBlink.paa new file mode 100644 index 000000000..61e7af9ec Binary files /dev/null and b/addons/feedback/data/LowerBlink.paa differ diff --git a/addons/feedback/data/RightEyeEffect.paa b/addons/feedback/data/RightEyeEffect.paa new file mode 100644 index 000000000..2da143109 Binary files /dev/null and b/addons/feedback/data/RightEyeEffect.paa differ diff --git a/addons/feedback/data/UpperBlink.paa b/addons/feedback/data/UpperBlink.paa new file mode 100644 index 000000000..f3aa90575 Binary files /dev/null and b/addons/feedback/data/UpperBlink.paa differ diff --git a/addons/feedback/functions/fnc_effectEyeBlink.sqf b/addons/feedback/functions/fnc_effectEyeBlink.sqf new file mode 100644 index 000000000..3800eaade --- /dev/null +++ b/addons/feedback/functions/fnc_effectEyeBlink.sqf @@ -0,0 +1,75 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski + * Handles shock from explosions and covers eye injury transitions + * +* Arguments: + * 0: Time + * 1: Shock + * + * Return Value: + * None + * + * Example: + * [1, false] call kat_feedback_fnc_effectEyeShock; + * + * Public: No + */ + +params ["_time", "_shock"]; +if (isNull findDisplay 46) exitWith {}; + +private _controls = uiNamespace getVariable [QGVAR(blinkControls), [controlNull, controlNull]]; +_controls params ["_upperLid", "_lowerLid"]; + +// Initialize controls +if (isNull _upperLid) then { + TRACE_1("Creating Blink Controls",_controls); + _upperLid = findDisplay 46 ctrlCreate ["RscPicture", -1]; + _lowerLid = findDisplay 46 ctrlCreate ["RscPicture", -1]; + + _upperLid ctrlSetText QPATHTOF(data\UpperBlink.paa); + _lowerLid ctrlSetText QPATHTOF(data\LowerBlink.paa); + + _upperLid ctrlSetPosition [safeZoneXAbs, (safeZoneY - safeZoneH), safeZoneWAbs, safeZoneH]; + _lowerLid ctrlSetPosition [safeZoneXAbs, (safeZoneY + safeZoneH), safeZoneWAbs, safeZoneH]; + + _upperLid ctrlSetFade 0; + _lowerLid ctrlSetFade 0; + + _upperLid ctrlCommit 0; + _lowerLid ctrlCommit 0; + + uiNamespace setVariable [QGVAR(blinkControls), [_upperLid, _lowerLid]]; +}; + +_upperLid ctrlSetPosition [safeZoneXAbs, safeZoneY, safeZoneWAbs, safeZoneH]; +_lowerLid ctrlSetPosition [safeZoneXAbs, safeZoneY, safeZoneWAbs, safeZoneH]; + +_upperLid ctrlCommit 0.04; +_lowerLid ctrlCommit 0.04; + +if (_shock) then { + GVAR(ppBlurBlink) ppEffectEnable true; + GVAR(ppBlurBlink) ppEffectAdjust [0.4]; + GVAR(ppBlurBlink) ppEffectCommit 0.04; +}; + +[{ + params ["_upperLid", "_lowerLid", "_shock", "_time"]; + _upperLid ctrlSetPosition [safeZoneXAbs, (safeZoneY - safeZoneH), safeZoneWAbs, safeZoneH]; + _lowerLid ctrlSetPosition [safeZoneXAbs, (safeZoneY + safeZoneH), safeZoneWAbs, safeZoneH]; + + if (_shock) then { + _upperLid ctrlCommit 0.1; + _lowerLid ctrlCommit 0.1; + + GVAR(ppBlurBlink) ppEffectAdjust [0]; + GVAR(ppBlurBlink) ppEffectCommit (_time * 4); + + [{ GVAR(ppBlurBlink) ppEffectEnable false; }, [], (_time * 4)] call CBA_fnc_waitAndExecute; + } else { + _upperLid ctrlCommit 0.04; + _lowerLid ctrlCommit 0.04; + }; +}, [_upperLid, _lowerLid, _shock, _time], _time] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/feedback/functions/fnc_effectEyeInjury.sqf b/addons/feedback/functions/fnc_effectEyeInjury.sqf new file mode 100644 index 000000000..127e7c056 --- /dev/null +++ b/addons/feedback/functions/fnc_effectEyeInjury.sqf @@ -0,0 +1,59 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski + * Triggers eye injury effect from dust and rotor wash. + * + * Arguments: + * 0: Enable + * 1: Severity + * + * Return Value: + * None + * + * Example: + * [true, 0.5] call kat_feedback_fnc_effectEyeInjury; + * + * Public: No + */ + +params ["_enable", "_injurySeverity"]; + +if (isNull findDisplay 46) exitWith {}; + +private _controls = uiNamespace getVariable [QGVAR(eyeInjuryControls), [controlNull, controlNull]]; +_controls params ["_upperLidShutter", "_lowerLidShutter"]; + +// Initialize controls +if (isNull _upperLidShutter) then { + TRACE_1("Creating Eye Injury Controls",_controls); + _upperLidShutter = findDisplay 46 ctrlCreate ["RscPicture", -1]; + _lowerLidShutter = findDisplay 46 ctrlCreate ["RscPicture", -1]; + + _upperLidShutter ctrlSetText QPATHTOF(data\UpperBlink.paa); + _lowerLidShutter ctrlSetText QPATHTOF(data\LowerBlink.paa); + + _upperLidShutter ctrlSetPosition [safeZoneXAbs, (safeZoneY - safeZoneH), safeZoneWAbs, safeZoneH]; + _lowerLidShutter ctrlSetPosition [safeZoneXAbs, (safeZoneY + safeZoneH), safeZoneWAbs, safeZoneH]; + + _upperLidShutter ctrlSetFade 0; + _lowerLidShutter ctrlSetFade 0; + + _upperLidShutter ctrlCommit 0; + _lowerLidShutter ctrlCommit 0; + + uiNamespace setVariable [QGVAR(eyeInjuryControls), [_upperLidShutter, _lowerLidShutter]]; +}; + +if (_enable) then { + _upperLidShutter ctrlSetPosition [safeZoneXAbs, ((safeZoneY - safeZoneH) + ((safeZoneH / 5) * _injurySeverity)), safeZoneWAbs, safeZoneH]; + _lowerLidShutter ctrlSetPosition [safeZoneXAbs, ((safeZoneY + safeZoneH) - ((safeZoneH / 5) * _injurySeverity)), safeZoneWAbs, safeZoneH]; + + _upperLidShutter ctrlCommit 0.05; + _lowerLidShutter ctrlCommit 0.05; +} else { + _upperLidShutter ctrlSetPosition [safeZoneXAbs, (safeZoneY - safeZoneH), safeZoneWAbs, safeZoneH]; + _lowerLidShutter ctrlSetPosition [safeZoneXAbs, (safeZoneY + safeZoneH), safeZoneWAbs, safeZoneH]; + + _upperLidShutter ctrlCommit 0; + _lowerLidShutter ctrlCommit 0; +}; diff --git a/addons/feedback/functions/fnc_effectHurtEye.sqf b/addons/feedback/functions/fnc_effectHurtEye.sqf new file mode 100644 index 000000000..42319f692 --- /dev/null +++ b/addons/feedback/functions/fnc_effectHurtEye.sqf @@ -0,0 +1,80 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Handles the hurted eyes effect from explosions. + * + * Arguments: + * 0: Enable effect + * 1: Eyes state + * 2: Instant change (optional, default false) + * + * Return Value: + * None + * + * Example: + * [false, 0.5] call kat_feedback_fnc_effectHurtEye + * Public: No + */ + +params ["_enable", "_eyeArray", ["_instant", false]]; +if (isNull findDisplay 46) exitWith {}; + +private _controls = uiNamespace getVariable [QGVAR(eyeControls), [controlNull, controlNull, controlNull]]; +_controls params ["_eye1", "_eye2", "_wholeInjury"]; + +if (!_enable) exitWith { + _eye1 ctrlSetFade 1; + _eye2 ctrlSetFade 1; + + _eye1 ctrlCommit 0; + _eye2 ctrlCommit 0; + + _wholeInjury ctrlSetFade 1; + _wholeInjury ctrlCommit 0; +}; + +// Initialize controls +if (isNull _eye1) then { + TRACE_1("Creating Eye Controls",_controls); + _eye1 = findDisplay 46 ctrlCreate ["RscPicture", -1]; + _eye2 = findDisplay 46 ctrlCreate ["RscPicture", -1]; + _wholeInjury = findDisplay 46 ctrlCreate ["RscPicture", -1]; + + _eye1 ctrlSetText QPATHTOF(data\RightEyeEffect.paa); + _eye2 ctrlSetText QPATHTOF(data\LeftEyeEffect.paa); + _wholeInjury ctrlSetText QPATHTOF(data\BlindEffect.paa); + + private _pos = [safeZoneXAbs, safeZoneY, safeZoneWAbs, safeZoneH]; + _eye1 ctrlSetPosition _pos; + _eye2 ctrlSetPosition _pos; + _wholeInjury ctrlSetPosition _pos; + + _eye1 ctrlSetFade 1; + _eye2 ctrlSetFade 1; + _wholeInjury ctrlSetFade 1; + + _eye1 ctrlCommit 0; + _eye2 ctrlCommit 0; + _wholeInjury ctrlCommit 0; + + uiNamespace setVariable [QGVAR(eyeControls), [_eye1, _eye2, _wholeInjury]]; +}; + +_eyeArray params ["_rightEye", "_leftEye"]; +_eye1 ctrlSetFade _rightEye; +_eye2 ctrlSetFade _leftEye; + +_eye1 ctrlCommit 0; +_eye2 ctrlCommit 0; + +if (_rightEye == 0 && _leftEye == 0) then { + _eye1 ctrlSetFade 1; + _eye2 ctrlSetFade 1; + _eye1 ctrlCommit 0; + _eye2 ctrlCommit 0; + _wholeInjury ctrlSetFade 0; + _wholeInjury ctrlCommit 0; +} else { + _wholeInjury ctrlSetFade 1; + _wholeInjury ctrlCommit 0; +}; diff --git a/addons/feedback/functions/fnc_handleEffects.sqf b/addons/feedback/functions/fnc_handleEffects.sqf index 119fdb3dc..353c9b04e 100644 --- a/addons/feedback/functions/fnc_handleEffects.sqf +++ b/addons/feedback/functions/fnc_handleEffects.sqf @@ -19,6 +19,8 @@ params [["_manualUpdate", false]]; if (ACEGVAR(common,OldIsCamera) || {!alive ACE_player}) exitWith { [false] call FUNC(effectOpioid); [false] call FUNC(effectLowSpO2); + [false] call FUNC(effectHurtEye); + [false] call FUNC(effectEyeInjury); }; BEGIN_COUNTER(handleEffects); @@ -30,6 +32,8 @@ private _unconscious = IS_UNCONSCIOUS(ACE_player); private _poisoned = IS_AIRPOISONED(ACE_player); private _tear = IN_TEARGAS(ACE_player); private _wheeze = ((ACE_player getVariable [QGVAR(pneumothorax), 0] > 0) || ACE_player getVariable [QGVAR(hemopneumothorax), false] || ACE_player getVariable [QGVAR(tensionpneumothorax), false] || ACE_player getVariable [QEGVAR(chemical,airPoisoning), false]); +private _eyeInjurySeverity = GET_DUST_INJURY(ACE_player); +private _eyeInjuries = GET_EYE_INJURIES(ACE_player); // - Visual effects ----------------------------------------------------------- @@ -43,5 +47,7 @@ private _wheeze = ((ACE_player getVariable [QGVAR(pneumothorax), 0] > 0) || ACE_ [!_unconscious, _poisoned, ACE_player] call FUNC(effectCoughing); [!_unconscious, _tear] call FUNC(effectTearHaze); [!_unconscious, _wheeze, ACE_player] call (effectBreathingWheeze); +[!_unconscious, _eyeInjurySeverity] call FUNC(effectEyeInjury); +[!_unconscious, _eyeInjuries, _manualUpdate] call FUNC(effectHurtEye); END_COUNTER(handleEffects); diff --git a/addons/feedback/functions/fnc_initEffects.sqf b/addons/feedback/functions/fnc_initEffects.sqf index 906106192..399a76699 100644 --- a/addons/feedback/functions/fnc_initEffects.sqf +++ b/addons/feedback/functions/fnc_initEffects.sqf @@ -61,3 +61,10 @@ GVAR(tearHaze) = [ 0.0054, 0.0041, 0.0090, 0.0070, 0.5, 0.3, 10.0, 6.0] ] call _fnc_createEffect; + +// - Eye Injury ----------------------------------------------------------- +GVAR(ppBlurBlink) = [ + "DynamicBlur", + 213706, + [1] +] call _fnc_createEffect; \ No newline at end of file diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index a0396d871..c2db02939 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -41,6 +41,8 @@ #define GETGVAR(var1,var2) GETMVAR(GVAR(var1),var2) #define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3) +#define QGETGVAR(var1,var2) QUOTE(GETMVAR(QGVAR(var1),var2)) + #define ARR_SELECT(ARRAY,INDEX,DEFAULT) (if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT}) #define ANY_OF(ARRAY,CONDITION) (ARRAY findIf {CONDITION} != -1) @@ -343,3 +345,7 @@ #define IS_AIRPOISONED(unit) (unit getVariable [QEGVAR(chemical,airPoisoning), false]) #define IN_TEARGAS(unit) (unit getVariable [QEGVAR(chemical,CSGas), 0]) + +//Ophthalmology +#define GET_DUST_INJURY(unit) ((unit getVariable [QEGVAR(ophthalmology,dustInjuryLight), 0]) + (unit getVariable [QEGVAR(ophthalmology,dustInjuryHeavy), 0])) +#define GET_EYE_INJURIES(unit) (unit getVariable [QEGVAR(ophthalmology,eyeInjuries), [1,1]]) \ No newline at end of file diff --git a/addons/ophthalmology/$PBOPREFIX$ b/addons/ophthalmology/$PBOPREFIX$ new file mode 100644 index 000000000..7e133646c --- /dev/null +++ b/addons/ophthalmology/$PBOPREFIX$ @@ -0,0 +1 @@ +x\kat\addons\ophthalmology diff --git a/addons/ophthalmology/ACE_Medical_Treatment_Actions.hpp b/addons/ophthalmology/ACE_Medical_Treatment_Actions.hpp new file mode 100644 index 000000000..75dc19155 --- /dev/null +++ b/addons/ophthalmology/ACE_Medical_Treatment_Actions.hpp @@ -0,0 +1,57 @@ +class ACE_Medical_Treatment_Actions { + class EyeWash { + displayName = CSTRING(eyewash_display); + displayNameProgress = CSTRING(eyewash_action); + category = "bandage"; + treatmentLocations = 0; + allowedSelections[] = {"Head"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(eyewash_medic_required); + treatmentTime = QGVAR(eyewash_treatment_time); + items[] = { + "ACE_salineIV", + "ACE_salineIV_500", + "ACE_salineIV_250" + }; + condition = QGETGVAR(enable,true); + callbackSuccess = QFUNC(treatmentAdvanced_eyewash); + callbackFailure = ""; + callbackProgress = ""; + consumeItem = 1; + animationPatient = ""; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"}; + animationMedic = "AinvPknlMstpSlayWrflDnon_medicOther"; + animationMedicProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; + animationMedicSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; + animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + litter[] = {}; + }; + + class EyeWashWater: EyeWash { + displayName = CSTRING(eyewash_display_water); + items[] = { + "ACE_Canteen", + "ACE_Canteen_Half", + "ACE_WaterBottle", + "ACE_WaterBottle_Half" + }; + }; + + class EyeWasher: EyeWash { + displayName = CSTRING(eyewasher_display_item); + items[] = {"KAT_Eyewasher"}; + }; + + class EyeShield: EyeWash { + displayName = CSTRING(eyeshield_display); + displayNameProgress = CSTRING(eyeshield_action); + medicRequired = QGVAR(eyeshield_medic_required); + treatmentTime = QGVAR(eyeshield_treatment_time); + items[] = { + "kat_eyecovers" + }; + condition = QFUNC(eyeShieldCondition); + callbackSuccess = QFUNC(treatmentAdvanced_eyeShield); + }; +}; diff --git a/addons/ophthalmology/CfgEventHandlers.hpp b/addons/ophthalmology/CfgEventHandlers.hpp new file mode 100644 index 000000000..4551ce282 --- /dev/null +++ b/addons/ophthalmology/CfgEventHandlers.hpp @@ -0,0 +1,20 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + disableModuload = "true"; + }; +}; + +class Extended_Init_EventHandlers { + class CAManBase { + class ADDON { + init = QUOTE([ARR_2((_this select 0),false)] call FUNC(init)); + }; + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/ophthalmology/CfgMagazines.hpp b/addons/ophthalmology/CfgMagazines.hpp new file mode 100644 index 000000000..1663418fe --- /dev/null +++ b/addons/ophthalmology/CfgMagazines.hpp @@ -0,0 +1,22 @@ +class CfgMagazines { + class CA_Magazine; + + class KAT_Eyewasher: CA_Magazine { + author = "Katalam"; + scope = 2; + + displayName = CSTRING(eyewasher_display); + descriptionShort = CSTRING(eyewasher_desc); + picture = QPATHTOF(ui\icon_eyewasher.paa); + + ammo = ""; + count = 30; + initSpeed = 0; + tracersEvery = 0; + lastRoundsTracer = 0; + mass = 1; + + ACE_isMedicalItem = 1; + ACE_asItem = 1; + }; +}; diff --git a/addons/ophthalmology/CfgWeapons.hpp b/addons/ophthalmology/CfgWeapons.hpp new file mode 100644 index 000000000..e30dfb858 --- /dev/null +++ b/addons/ophthalmology/CfgWeapons.hpp @@ -0,0 +1,50 @@ +class CfgWeapons +{ + class ACE_ItemCore; + class CBA_MiscItem_ItemInfo; + + class kat_eyecovers: ACE_ItemCore { + scope = 2; + author = "MrAdrianPL"; + displayName = CSTRING(EyeCover_Item); + picture = QPATHTOF(ui\icon_eyeshield.paa); + model = QPATHTOF(models\eyecovers\kat_eyecovers.p3d); + descriptionShort = CSTRING(EyeCover_Desc); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.2; + }; + }; + + class NVGoggles; + class kat_eyecovers_right: NVGoggles + { + author = "MrAdrianPL"; + displayName = CSTRING(EyeCover_Right); + scope = 2; + scopeArsenal = 0; + ace_nightvision_border = QPATHTOF(ui\RightEyeNVG.paa); + modelOptics = "\A3\Weapons_F\empty.p3d"; + + picture = QPATHTOF(ui\icon_eyeshield.paa); + hiddenSelections[] = {"eye_l","eye_r"}; + hiddenSelectionsTextures[] = {"",QPATHTOF(models\eyecovers\camo1_ca.paa)}; + visionMode[] = {}; + class ItemInfo: ItemInfo + { + type = 616; + hiddenSelections[] = {"eye_l","eye_r"}; + uniformModel = QPATHTOF(models\eyecovers\kat_eyecovers.p3d); + modelOff = QPATHTOF(models\eyecovers\kat_eyecovers.p3d); + mass = 0.1; + }; + }; + class kat_eyecovers_left: kat_eyecovers_right + { + displayName = CSTRING(EyeCover_Left); + ace_nightvision_border = QPATHTOF(ui\LeftEyeNVG.paa); + modelOptics = "\A3\Weapons_F\empty.p3d"; + hiddenSelections[] = {"eye_l","eye_r"}; + hiddenSelectionsTextures[] = {QPATHTOF(models\eyecovers\camo1_ca.paa),""}; + }; +}; diff --git a/addons/ophthalmology/RscTitles.hpp b/addons/ophthalmology/RscTitles.hpp new file mode 100644 index 000000000..2f49088b6 --- /dev/null +++ b/addons/ophthalmology/RscTitles.hpp @@ -0,0 +1,60 @@ +#define KAT_WATCH_GRID_WAbs (((safezoneW / safezoneH) min 0.7)) +#define KAT_WATCH_GRID_HAbs ((((safezoneW / safezoneH) min 1.2) / 1.6)) +#define KAT_WATCH_GRID_W ((((safeZoneW / safeZoneH) min 0.7) / 40)) +#define KAT_WATCH_GRID_H (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) +#define KAT_WATCH_GRID_X ((safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2)) / 11)) +#define KAT_WATCH_GRID_Y ((safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2)) / 0.8)) + +#define KAT_POS_H(N) ((N) * KAT_WATCH_GRID_H) + +#define ST_LEFT 0 +#define ST_CENTER 2 +#define ST_RIGHT 1 + +#define pixelW (1 / (getResolution select 2)) +#define pixelH (1 / (getResolution select 3)) +#define pixelScale 0.50 + +// pixel grids macros +#define UI_GRID_W (pixelW * pixelGridBase) +#define UI_GRID_H (pixelH * pixelGridBase) + +#define SAFEZONE_X_RIGHTEDGE ((safeZoneX - 1) * -1) +#define SAFEZONE_Y_LOWEDGE ((safeZoneY - 1) * -1) + +#define FRAME_W(N) ((UI_GRID_W * (N)) * (1.7777 / (getResolution select 4))) +#define FRAME_H(N) ((UI_GRID_H * (N))) + +class RscText; +class RscPicture; +class RscTitles +{ + class KAT_EyeShield + { + idd = 17101; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0; + fadeOut=1; + duration = 10e10; + onLoad = "uiNamespace setVariable ['KAT_EyeShield', _this select 0];"; + class controls + { + class EyeShieldRight: RscPicture + { + idc = 17102; + text = "\x\kat\addons\ophthalmology\UI\RightEyeShield.paa"; + show = 0; + x = QUOTE(safeZoneXAbs); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneWAbs); + h = QUOTE(safeZoneH); + }; + class EyeShieldLeft: EyeShieldRight + { + idc = 17103; + text = "\x\kat\addons\ophthalmology\UI\LeftEyeShield.paa"; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/ophthalmology/XEH_PREP.hpp b/addons/ophthalmology/XEH_PREP.hpp new file mode 100644 index 000000000..53c58f3ae --- /dev/null +++ b/addons/ophthalmology/XEH_PREP.hpp @@ -0,0 +1,10 @@ +PREP(eyeShieldCondition); +PREP(fullHealLocal); +PREP(gui_updateInjuryListPart); +PREP(handleDustInjury); +PREP(handleExplosion); +PREP(handleRespawn); +PREP(init); +PREP(initKeybinds); +PREP(treatmentAdvanced_eyeShield); +PREP(treatmentAdvanced_eyewash); diff --git a/addons/ophthalmology/XEH_postInit.sqf b/addons/ophthalmology/XEH_postInit.sqf new file mode 100644 index 000000000..6010b95e7 --- /dev/null +++ b/addons/ophthalmology/XEH_postInit.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +call FUNC(initKeybinds); + +["CBA_settingsInitialized", { + //If not enabled, dont't add + if (!GVAR(enable)) exitWith {}; + + [QACEGVAR(goggles,effect), LINKFUNC(handleDustInjury)] call CBA_fnc_addEventHandler; + + //Add Explosion XEH + ["CAManBase", "explosion", LINKFUNC(handleExplosion)] call CBA_fnc_addClassEventHandler; + +}] call CBA_fnc_addEventHandler; + +[QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler; +[QACEGVAR(medical_gui,updateInjuryListPart), LINKFUNC(gui_updateInjuryListPart)] call CBA_fnc_addEventHandler; +[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler; diff --git a/addons/ophthalmology/XEH_preInit.sqf b/addons/ophthalmology/XEH_preInit.sqf new file mode 100644 index 000000000..f9141bd04 --- /dev/null +++ b/addons/ophthalmology/XEH_preInit.sqf @@ -0,0 +1,92 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +#define CBA_SETTINGS_CAT "KAT - ADV Medical: Ophthalmology" + +// Enable Dust Injury +[ + QGVAR(enable), + "CHECKBOX", + LLSTRING(setting_enable), + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_injury)], + [true], + true +] call CBA_Settings_fnc_init; + +// Probability to get dust in the eyes +[ + QGVAR(probability_dust), + "SLIDER", + [LLSTRING(setting_probability_dust)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_injury)], + [1, 100, 5, 0], + true +] call CBA_Settings_fnc_init; + +// Probability to get dust in the eyes which is not treated by blink +[ + QGVAR(probability_dust_heavy), + "SLIDER", + [LLSTRING(setting_probability_dust_heavy)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_injury)], + [1, 100, 1, 0], + true +] call CBA_Settings_fnc_init; + +// Probability to treat the dust in the eyes with blinking +[ + QGVAR(probability_treatment_dust), + "SLIDER", + [LLSTRING(setting_probability_treatment_dust)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_injury)], + [1, 100, 20, 0], + true +] call CBA_Settings_fnc_init; + +// Eye Wash treatment time +[ + QGVAR(eyewash_treatment_time), + "SLIDER", + [LLSTRING(setting_eyewash_treatment_time)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_manual_blink)], + [1, 10, 2, 0], + true +] call CBA_Settings_fnc_init; + +// Eye Wash medic required +[ + QGVAR(eyewash_medic_required), + "LIST", + [LLSTRING(setting_eyewash_medic_required)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_manual_blink)], + [[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 0], + true +] call CBA_Settings_fnc_init; + +// Eye Shield treatment time +[ + QGVAR(eyeshield_treatment_time), + "SLIDER", + [LLSTRING(setting_eyeShield_treatment_time)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_manual_blink)], + [1, 10, 2, 0], + true +] call CBA_Settings_fnc_init; + + +// Eye Shield medic required +[ + QGVAR(eyeshield_medic_required), + "LIST", + [LLSTRING(setting_eyeShield_medic_required)], + [CBA_SETTINGS_CAT, LSTRING(setting_subcategory_manual_blink)], + [[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 0], + true +] call CBA_Settings_fnc_init; + +ADDON = true; diff --git a/addons/ophthalmology/config.cpp b/addons/ophthalmology/config.cpp new file mode 100644 index 000000000..c87fa2d4d --- /dev/null +++ b/addons/ophthalmology/config.cpp @@ -0,0 +1,28 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + requiredVersion = REQUIRED_VERSION; + units[] = {}; + weapons[] = { + "KAT_Eyewasher" + }; + magazines[] = { }; + requiredAddons[] = { + "kat_main", + "kat_feedback", + "cba_settings" + }; + author = "Katalam"; + authors[] = {"Katalam", "MiszczuZPolski", "Mazinski"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" +#include "ACE_Medical_Treatment_Actions.hpp" +#include "RscTitles.hpp" diff --git a/addons/ophthalmology/functions/fnc_eyeShieldCondition.sqf b/addons/ophthalmology/functions/fnc_eyeShieldCondition.sqf new file mode 100644 index 000000000..7df3d2dac --- /dev/null +++ b/addons/ophthalmology/functions/fnc_eyeShieldCondition.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski + * Sets condition for the Eye Shield + * + * Return Value: + * Boolean + * + * Example: + * [bob, patient] call kat_ophthalmology_fnc_eyeShieldCondition + * + * Public: No + */ + +params ["_medic", "_patient"]; + +private _eyeInjuries = _patient getVariable [QGVAR(eyeInjuries), [1, 1]]; +private _eyeInjurySevere = _patient getVariable [QGVAR(eyeInjurySevere), false]; + +if (_eyeInjurySevere && (({_x == 0} count _eyeInjuries) == 1)) exitWith { + true +}; + +false diff --git a/addons/ophthalmology/functions/fnc_fullHealLocal.sqf b/addons/ophthalmology/functions/fnc_fullHealLocal.sqf new file mode 100644 index 000000000..3582db50e --- /dev/null +++ b/addons/ophthalmology/functions/fnc_fullHealLocal.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Local callback for fully healing a patient. + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_ophthalmology_fnc_fullHealLocal + * + * Public: No + */ + +params ["_patient"]; +TRACE_1("fullHealLocal",_patient); + +_patient setVariable [QGVAR(dustInjuryLight), 0, true]; +_patient setVariable [QGVAR(dustInjuryHeavy), 0, true]; +_patient setVariable [QGVAR(eyeInjuries), [1,1], true]; +_patient setVariable [QGVAR(eyeInjurySevere), false, true]; \ No newline at end of file diff --git a/addons/ophthalmology/functions/fnc_gui_updateInjuryListPart.sqf b/addons/ophthalmology/functions/fnc_gui_updateInjuryListPart.sqf new file mode 100644 index 000000000..f766905fd --- /dev/null +++ b/addons/ophthalmology/functions/fnc_gui_updateInjuryListPart.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Updates injury list for given body part for the target. + * + * Arguments: + * 0: Injury list + * 1: Target + * 2: Body part, -1 to only show overall health info + * 3: Entries + * + * Return Value: + * None + * + * Example: + * [_ctrlInjuries, _target, 0] call kat_ophthamology_fnc_gui_updateInjuryListPart + * + * Public: No + */ + +params ["_ctrl", "_target", "_selectionN", "_entries"]; + +private _eyeInjuries = _target getVariable [QGVAR(eyeInjuries), [1,1]]; + +if ((({_x != 1} count _eyeInjuries) > 0) && (_selectionN == 0)) then { + _entries pushBack [LLSTRING(eyeInjuryPresent), [0.36, 0.58, 0.23, 1]]; +}; diff --git a/addons/ophthalmology/functions/fnc_handleDustInjury.sqf b/addons/ophthalmology/functions/fnc_handleDustInjury.sqf new file mode 100644 index 000000000..6add1fde2 --- /dev/null +++ b/addons/ophthalmology/functions/fnc_handleDustInjury.sqf @@ -0,0 +1,53 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Handles the possibility to have dust in the eye. + * + * Arguments: + * 0: Player + * 1: Cause + * + * Return Value: + * None + * + * Example: + * [player, "dust"] call kat_ophthalmology_fnc_handleDustInjury; + * + * Public: No + */ + +params ["_unit", "_cause"]; + +private _random = floor (random 100); + +if (_cause in ["dust", "rotorWash"]) then { + if (_random < GVAR(probability_dust)) exitWith { + [0.1, false] call EFUNC(feedback,effectEyeBlink); + + private _dustInjuryLight = _unit getVariable [QGVAR(dustInjuryLight), 0]; + + if (_random < GVAR(probability_dust_heavy)) then { + private _dustInjuryHeavy = _unit getVariable [QGVAR(dustInjuryLight), 0]; + + _unit setVariable [QGVAR(dustInjuryHeavy), ((_dustInjuryHeavy + (random 1)) min 5), true]; + } else { + _unit setVariable [QGVAR(_dustInjuryLight), ((_dustInjuryLight + (random 1)) min 5), true]; + }; + + if (GET_DUST_INJURY(_unit) > 5) then { + private _eyeInjuries = _unit getVariable [QGVAR(eyeInjuries), [1, 1]]; + + // Randomly choose which eye to injure (0 = right, 1 = left) + private _injuredEye = floor random 2; + + // Set the chosen eye to injured + _eyeInjuries set [_injuredEye, 0]; + + if (({_x == 0} count _eyeInjuries) > 1) then { + _unit setVariable [QGVAR(eyeInjurySevere), true, true]; + }; + + _unit setVariable [QGVAR(eyeInjuries), _eyeInjuries, true]; + }; + }; +}; diff --git a/addons/ophthalmology/functions/fnc_handleExplosion.sqf b/addons/ophthalmology/functions/fnc_handleExplosion.sqf new file mode 100644 index 000000000..f5cd4037c --- /dev/null +++ b/addons/ophthalmology/functions/fnc_handleExplosion.sqf @@ -0,0 +1,77 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Handles explosions. + * + * Arguments: + * 0: Unit + * 1: Damage Source + * 2: Explosion Source + * + * Return Value: + * None + * + * Example: + * [bob, damage, explosion] call kat_ophthalmology_fnc_handleExplosion + * + * Public: No + */ + +params ["_unit", "_damage", "_explosionSource"]; + +if (_unit != ACE_player) exitWith {}; + +private _eyePos = eyePos _unit; +private _grenadePosASL = getPosASL _explosionSource; +_grenadePosASL set [2, (_grenadePosASL select 2) + 0.2]; // compensate for grenade glitching into ground + +// Calculate distance-based strength +private _distance = _eyePos vectorDistance _grenadePosASL; +private _strength = 1 - (_distance min 30) / 30; + +private _losCount = { + !lineIntersects [_grenadePosASL vectorAdd _x, _eyePos, _unit] +} count [[0, 0, 0], [0, 0, 0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; + +// Adjust strength based on line of sight +private _losCoefficient = [1, 0.1] select (_losCount <= 1); +_strength = _strength * _losCoefficient; + +// Account for player's viewing direction +private _eyeDir = ((AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLToASL positionCameraToWorld [0, 0, 0])); +private _dirToGrenade = _eyePos vectorFromTo _grenadePosASL; +private _angleDiff = acos (_eyeDir vectorDotProduct _dirToGrenade); // Angle difference in radians + +if (_angleDiff > 50) exitWith {}; + +// Add visual and hearing effects +if (_strength > 0.2) then { + + // Eye closure from shock + [(_strength * 2), true] call EFUNC(feedback,effectEyeBlink); + private _random = floor (random 101); + + if (_random < GVAR(probability_dust_heavy)) then { + + // Get the current state of the eyes (defaulting to healthy if not set) + private _eyeInjuries = _unit getVariable [QGVAR(eyeInjuries), [1, 1]]; + + // Randomly choose which eye to injure (0 = right, 1 = left) + private _injuredEye = floor random 2; + + // Set the chosen eye to injured + _eyeInjuries set [_injuredEye, 0]; + + if (({_x == 0} count _eyeInjuries) > 1) then { + _unit setVariable [QGVAR(eyeInjurySevere), true, true]; + }; + + _unit setVariable [QGVAR(eyeInjuries), _eyeInjuries, true]; + }; + + // Reaction blink + [{ + [0.1, true] call EFUNC(feedback,effectEyeBlink); + [{ [0.05, true] call EFUNC(feedback,effectEyeBlink); }, [], 0.3] call CBA_fnc_waitAndExecute; + }, [], (_strength * 2.2)] call CBA_fnc_waitAndExecute; +}; diff --git a/addons/ophthalmology/functions/fnc_handleRespawn.sqf b/addons/ophthalmology/functions/fnc_handleRespawn.sqf new file mode 100644 index 000000000..45228545b --- /dev/null +++ b/addons/ophthalmology/functions/fnc_handleRespawn.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Ensures proper initial values reset on respawn + * + * Arguments: + * 0: Unit + * 1: Corpse + * + * Return Value: + * None + * + * Example: + * [alive, body] call kat_misc_fnc_handleRespawn; + * + * Public: No + */ + +params ["_unit","_dead"]; +TRACE_2("handleRespawn",_unit,_dead); + +[_unit] call FUNC(fullHealLocal); diff --git a/addons/ophthalmology/functions/fnc_init.sqf b/addons/ophthalmology/functions/fnc_init.sqf new file mode 100644 index 000000000..f6a1103c9 --- /dev/null +++ b/addons/ophthalmology/functions/fnc_init.sqf @@ -0,0 +1,16 @@ +#include "..\script_component.hpp" +/* + * Author: Katalam + * Initialize unit + * + * Return Value: + * None + * + * Public: No + */ + +params ["_unit", ["_isRespawn", true]]; + +if (!local _unit) exitWith {}; + +[_unit] call FUNC(fullHealLocal); diff --git a/addons/ophthalmology/functions/fnc_initKeybinds.sqf b/addons/ophthalmology/functions/fnc_initKeybinds.sqf new file mode 100644 index 000000000..2f457f657 --- /dev/null +++ b/addons/ophthalmology/functions/fnc_initKeybinds.sqf @@ -0,0 +1,29 @@ +#include "..\script_component.hpp" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" +/* + * Author: Katalam + * Initialize the keybinds. + * + * Return Value: + * None + * + * Public: No + * + * https://community.bistudio.com/wiki/DIK_KeyCodes + */ + +if (!hasInterface) exitWith {}; + +[QUOTE(COMPONENT_BEAUTIFIED), QGVAR(blinking), LLSTRING(blink_action), +{ + [0.2, false] call EFUNC(feedback,effectEyeBlink); + + private _random = floor(random 100); + + if (_random <= GVAR(probability_treatment_dust)) then { + private _dustInjurySeverity = ACE_player getVariable [QGVAR(dustInjurySeverity), 0]; + ACE_player setVariable [QGVAR(dustInjurySeverity), ((_dustInjurySeverity - 0.5) max 0), true]; + }; +}, "", +[DIK_TAB, [false, false, false]], false] call CBA_fnc_addKeybind; +// [DIK, [shift, ctrl, alt]] \ No newline at end of file diff --git a/addons/ophthalmology/functions/fnc_treatmentAdvanced_eyeShield.sqf b/addons/ophthalmology/functions/fnc_treatmentAdvanced_eyeShield.sqf new file mode 100644 index 000000000..e20e3cd9d --- /dev/null +++ b/addons/ophthalmology/functions/fnc_treatmentAdvanced_eyeShield.sqf @@ -0,0 +1,71 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski + * Handles the placement of the eye shield + * + * Return Value: + * None + * + * Example: + * [bob, patient] call kat_ophthalmology_fnc_treatmentAdvanced_eyeShield + * + * Public: No + */ +params ["_medic", "_patient"]; + +private _eyeInjuries = _patient getVariable ["kat_ophthalmology_eyeInjuries", [1, 1]]; + +"KAT_EyeShield" cutRsc ["KAT_EyeShield", "PLAIN", 0, true]; + +private _display = uiNamespace getVariable ["KAT_EyeShield", displayNull]; +private _activeEye = _display displayCtrl 17102; + +if ((_eyeInjuries find 0) == 0) then { + _patient linkItem "kat_eyecovers_left"; + _activeEye = _display displayCtrl 17103; + + _activeEye ctrlShow true; + _activeEye ctrlCommit 0; + + [{ + _this params ["_args", "_pfhID"]; + _args params ["_unit", "_activeEye"]; + + if ((hmd _unit) != "kat_eyecovers_left") exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + "KAT_EyeShield" cutText ["","PLAIN",0,true]; + }; + + private _eyeInjury = _unit getVariable ["kat_ophthalmology_eyeInjuries", [1, 1]]; + _unit setVariable ["kat_ophthalmology_eyeInjuries", [(((_eyeInjury select 0) + 0.001) min 1), (_eyeInjury select 1)], true]; + }, 30, [ + _patient, + _activeEye + ]] call CBA_fnc_addPerFrameHandler; + +} else { + _patient linkItem "kat_eyecovers_right"; + _activeEye = _display displayCtrl 17102; + + _activeEye ctrlShow true; + _activeEye ctrlCommit 0; + + [{ + _this params ["_args", "_pfhID"]; + _args params ["_unit", "_activeEye"]; + + if ((hmd _unit) != "kat_eyecovers_right") exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + "KAT_EyeShield" cutText ["","PLAIN",0,true]; + }; + + private _eyeInjury = _unit getVariable ["kat_ophthalmology_eyeInjuries", [1, 1]]; + _unit setVariable ["kat_ophthalmology_eyeInjuries", [(_eyeInjury select 0), (((_eyeInjury select 1) + 0.001) min 1)], true]; + }, 1, [ + _patient, + _activeEye + ]] call CBA_fnc_addPerFrameHandler; +}; + +[_patient, LLSTRING(eyeshield_item)] call ACEFUNC(medical_treatment,addToTriageCard); +[_patient, "activity", ACELSTRING(medical_treatment,Activity_usedItem), [[_medic] call ACEFUNC(common,getName), LLSTRING(eyeshield_item)]] call ACEFUNC(medical_treatment,addToLog); \ No newline at end of file diff --git a/addons/ophthalmology/functions/fnc_treatmentAdvanced_eyewash.sqf b/addons/ophthalmology/functions/fnc_treatmentAdvanced_eyewash.sqf new file mode 100644 index 000000000..f07533110 --- /dev/null +++ b/addons/ophthalmology/functions/fnc_treatmentAdvanced_eyewash.sqf @@ -0,0 +1,35 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski + * Handles the treatment of dust or heavy dust in eyes. + * + * Return Value: + * None + * + * Example: + * [bob, patient] call kat_ophthalmology_fnc_treatmentAdvanced_eyewash + * + * Public: No + */ + +params ["_medic", "_patient"]; + +_patient setVariable [QGVAR(dustInjuryLight), 0, true]; +_patient setVariable [QGVAR(dustInjuryHeavy), 0, true]; + +private _eyeInjuries = _patient getVariable [QGVAR(eyeInjuries), [1, 1]]; +private _eyeInjurySevere = _patient getVariable [QGVAR(eyeInjurySevere), false]; + +if (_eyeInjurySevere && (({_x == 0} count _eyeInjuries) > 1)) then { + private _random = floor random 2; + _eyeInjuries set [_random, 1]; + + _patient setVariable [QGVAR(eyeInjuries), _eyeInjuries, true]; +}; + +if !(_eyeInjurySevere) then { + _patient setVariable [QGVAR(eyeInjuries), [1, 1], true]; +}; + +[_patient, LLSTRING(eyewash_item)] call ACEFUNC(medical_treatment,addToTriageCard); +[_patient, "activity", ACELSTRING(medical_treatment,Activity_usedItem), [[_medic] call ACEFUNC(common,getName), LLSTRING(eyewash_item)]] call ACEFUNC(medical_treatment,addToLog); diff --git a/addons/ophthalmology/models/eyecovers/camo1.rvmat b/addons/ophthalmology/models/eyecovers/camo1.rvmat new file mode 100644 index 000000000..3eee1df8b --- /dev/null +++ b/addons/ophthalmology/models/eyecovers/camo1.rvmat @@ -0,0 +1,72 @@ +ambient[] = { 1, 1, 1, 1 }; +diffuse[] = { 1, 1, 1, 1 }; +forcedDiffuse[] = { 0, 0, 0, 1 }; +emmisive[] = { 0, 0, 0, 1 }; +specular[] = { 0.2, 0.2, 0.2, 0.1 }; +specularPower = 30; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "x\kat\addons\ophthalmology\models\eyecovers\camo1_nohq.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = { 1, 0, 0 }; + up[] = { 0, 1, 0 }; + dir[] = { 0, 0, 0 }; + pos[] = { 0, 0, 0 }; + }; +}; +class Stage2 { + texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource = "tex"; + class uvTransform { + aside[] = { 1, 1, 0 }; + up[] = { 0, 1, 0 }; + dir[] = { 0, 0, 0 }; + pos[] = { 0, 0, 0 }; + }; +}; +class Stage3 { + texture = "#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource = "tex"; + class uvTransform { + aside[] = { 1, 0, 0 }; + up[] = { 0, 1, 0 }; + dir[] = { 0, 0, 0 }; + pos[] = { 0, 0, 0 }; + }; +}; +class Stage4 { + texture = "x\kat\addons\ophthalmology\models\eyecovers\camo1_as.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = { 1, 0, 0 }; + up[] = { 0, 1, 0 }; + dir[] = { 0, 0, 1 }; + pos[] = { 0, 0, 1 }; + }; +}; +class Stage5 { + texture = "x\kat\addons\ophthalmology\models\eyecovers\camo1_smdi.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = { 1, 0, 0 }; + up[] = { 0, 1, 0 }; + dir[] = { 0, 0, 0 }; + pos[] = { 0, 0, 0 }; + }; +}; +class Stage6 { + texture = "#(ai,64,64,1)fresnel(0.4,0.1)"; + uvSource = "tex"; + class uvTransform { + aside[] = { 1, 0, 0 }; + up[] = { 0, 1, 0 }; + dir[] = { 0, 0, 1 }; + pos[] = { 0, 0, 0 }; + }; +}; + +class StageTI { + texture = "a3\data_f\default_vehicle_ti_ca.paa"; +}; diff --git a/addons/ophthalmology/models/eyecovers/camo1_as.paa b/addons/ophthalmology/models/eyecovers/camo1_as.paa new file mode 100644 index 000000000..1f7a50054 Binary files /dev/null and b/addons/ophthalmology/models/eyecovers/camo1_as.paa differ diff --git a/addons/ophthalmology/models/eyecovers/camo1_ca.paa b/addons/ophthalmology/models/eyecovers/camo1_ca.paa new file mode 100644 index 000000000..4f06995cb Binary files /dev/null and b/addons/ophthalmology/models/eyecovers/camo1_ca.paa differ diff --git a/addons/ophthalmology/models/eyecovers/camo1_co.paa b/addons/ophthalmology/models/eyecovers/camo1_co.paa new file mode 100644 index 000000000..4f06995cb Binary files /dev/null and b/addons/ophthalmology/models/eyecovers/camo1_co.paa differ diff --git a/addons/ophthalmology/models/eyecovers/camo1_nohq.paa b/addons/ophthalmology/models/eyecovers/camo1_nohq.paa new file mode 100644 index 000000000..99cf3f28e Binary files /dev/null and b/addons/ophthalmology/models/eyecovers/camo1_nohq.paa differ diff --git a/addons/ophthalmology/models/eyecovers/camo1_smdi.paa b/addons/ophthalmology/models/eyecovers/camo1_smdi.paa new file mode 100644 index 000000000..cf31d1263 Binary files /dev/null and b/addons/ophthalmology/models/eyecovers/camo1_smdi.paa differ diff --git a/addons/ophthalmology/models/eyecovers/kat_eyecovers.p3d b/addons/ophthalmology/models/eyecovers/kat_eyecovers.p3d new file mode 100644 index 000000000..d56456d94 Binary files /dev/null and b/addons/ophthalmology/models/eyecovers/kat_eyecovers.p3d differ diff --git a/addons/ophthalmology/models/eyecovers/model.cfg b/addons/ophthalmology/models/eyecovers/model.cfg new file mode 100644 index 000000000..fb042cf7a --- /dev/null +++ b/addons/ophthalmology/models/eyecovers/model.cfg @@ -0,0 +1,165 @@ + +class CfgSkeletons +{ + class Default + { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class OFP2_ManSkeleton + { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = + { + "Pelvis","", + "Spine","Pelvis", + "Spine1","Spine", + "Spine2","Spine1", + "Spine3","Spine2", + "Camera","Pelvis", + "weapon","Spine1", + "launcher","Spine1", + + // Head skeleton in hierarchy + "neck","Spine3", + "neck1","neck", + "head","neck1", + + // New facial features + "Face_Hub","head", + "Face_Jawbone","Face_Hub", + "Face_Jowl","Face_Jawbone", + "Face_chopRight","Face_Jawbone", + "Face_chopLeft","Face_Jawbone", + "Face_LipLowerMiddle","Face_Jawbone", + "Face_LipLowerLeft","Face_Jawbone", + "Face_LipLowerRight","Face_Jawbone", + "Face_Chin","Face_Jawbone", + "Face_Tongue","Face_Jawbone", + "Face_CornerRight","Face_Hub", + "Face_CheekSideRight","Face_CornerRight", + "Face_CornerLeft","Face_Hub", + "Face_CheekSideLeft","Face_CornerLeft", + "Face_CheekFrontRight","Face_Hub", + "Face_CheekFrontLeft","Face_Hub", + "Face_CheekUpperRight","Face_Hub", + "Face_CheekUpperLeft","Face_Hub", + "Face_LipUpperMiddle","Face_Hub", + "Face_LipUpperRight","Face_Hub", + "Face_LipUpperLeft","Face_Hub", + "Face_NostrilRight","Face_Hub", + "Face_NostrilLeft","Face_Hub", + "Face_Forehead","Face_Hub", + "Face_BrowFrontRight","Face_Forehead", + "Face_BrowFrontLeft","Face_Forehead", + "Face_BrowMiddle","Face_Forehead", + "Face_BrowSideRight","Face_Forehead", + "Face_BrowSideLeft","Face_Forehead", + "Face_Eyelids","Face_Hub", + "Face_EyelidUpperRight","Face_Hub", + "Face_EyelidUpperLeft","Face_Hub", + "Face_EyelidLowerRight","Face_Hub", + "Face_EyelidLowerLeft","Face_Hub", + "EyeLeft","Face_Hub", + "EyeRight","Face_Hub", + + // Left upper side + "LeftShoulder","Spine3", + "LeftArm","LeftShoulder", + "LeftArmRoll","LeftArm", + "LeftForeArm","LeftArmRoll", + "LeftForeArmRoll","LeftForeArm", + "LeftHand","LeftForeArmRoll", + "LeftHandRing","LeftHand", + "LeftHandRing1","LeftHandRing", + "LeftHandRing2","LeftHandRing1", + "LeftHandRing3","LeftHandRing2", + "LeftHandPinky1","LeftHandRing", + "LeftHandPinky2","LeftHandPinky1", + "LeftHandPinky3","LeftHandPinky2", + "LeftHandMiddle1","LeftHand", + "LeftHandMiddle2","LeftHandMiddle1", + "LeftHandMiddle3","LeftHandMiddle2", + "LeftHandIndex1","LeftHand", + "LeftHandIndex2","LeftHandIndex1", + "LeftHandIndex3","LeftHandIndex2", + "LeftHandThumb1","LeftHand", + "LeftHandThumb2","LeftHandThumb1", + "LeftHandThumb3","LeftHandThumb2", + + // Right upper side + "RightShoulder","Spine3", + "RightArm","RightShoulder", + "RightArmRoll","RightArm", + "RightForeArm","RightArmRoll", + "RightForeArmRoll","RightForeArm", + "RightHand","RightForeArmRoll", + "RightHandRing","RightHand", + "RightHandRing1","RightHandRing", + "RightHandRing2","RightHandRing1", + "RightHandRing3","RightHandRing2", + "RightHandPinky1","RightHandRing", + "RightHandPinky2","RightHandPinky1", + "RightHandPinky3","RightHandPinky2", + "RightHandMiddle1","RightHand", + "RightHandMiddle2","RightHandMiddle1", + "RightHandMiddle3","RightHandMiddle2", + "RightHandIndex1","RightHand", + "RightHandIndex2","RightHandIndex1", + "RightHandIndex3","RightHandIndex2", + "RightHandThumb1","RightHand", + "RightHandThumb2","RightHandThumb1", + "RightHandThumb3","RightHandThumb2", + + // Left lower side + "LeftUpLeg","Pelvis", + "LeftUpLegRoll","LeftUpLeg", + "LeftLeg","LeftUpLegRoll", + "LeftLegRoll","LeftLeg", + "LeftFoot","LeftLegRoll", + "LeftToeBase","LeftFoot", + + // Right lower side + "RightUpLeg","Pelvis", + "RightUpLegRoll","RightUpLeg", + "RightLeg","RightUpLegRoll", + "RightLegRoll","RightLeg", + "RightFoot","RightLegRoll", + "RightToeBase","RightFoot" + }; + // location of pivot points (local axes) for hierarchical animation + pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d"; + }; +}; + +class CfgModels +{ + class Default + { + sectionsInherit=""; + sections[] = {}; + skeletonName = ""; + }; + class ArmaMan : Default + { + htMin = 60; // Minimum half-cooling time (in seconds) + htMax = 1800; // Maximum half-cooling time (in seconds) + afMax = 30; // Maximum temperature in case the model is alive (in celsius) + mfMax = 0; // Maximum temperature when the model is moving (in celsius) + mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)). + tBody = 37; // Metabolism temperature of the model (in celsius) + + sections[] = + { + "osobnost","Head_Injury","Body_Injury","l_leg_injury","l_arm_injury","r_arm_injury","r_leg_injury","injury_body", "injury_legs", "injury_hands", + "clan","clan_sign","Camo","CamoB","Camo1","Camo2","personality","hl", "injury_head" + }; + skeletonName = "OFP2_ManSkeleton"; + }; + + class kat_eyecovers : ArmaMan { + sections[] = { "eye_l", "eye_r" }; + }; +}; diff --git a/addons/ophthalmology/script_component.hpp b/addons/ophthalmology/script_component.hpp new file mode 100644 index 000000000..e6483cebe --- /dev/null +++ b/addons/ophthalmology/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT ophthalmology +#define COMPONENT_BEAUTIFIED KAT - Ophthalmology +#include "\x\kat\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_OPHTHALMOLOGY + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_OPHTHALMOLOGY + #define DEBUG_SETTINGS DEBUG_SETTINGS_OPHTHALMOLOGY +#endif + +#include "\x\kat\addons\main\script_macros.hpp" diff --git a/addons/ophthalmology/stringtable.xml b/addons/ophthalmology/stringtable.xml new file mode 100644 index 000000000..132369694 --- /dev/null +++ b/addons/ophthalmology/stringtable.xml @@ -0,0 +1,77 @@ + + + + + Enable eye injuries + + + Eye injuries + + + Probability to get eye injury + + + Probability to get heavy eye injury + + + Probability to treat (non-heavy) eye injury with blinking + + + Manual blinking + + + Treatment time of Eye Wash + + + Medic required to Eye Wash + + + Blinking + + + Blink + + + Wash eyes with saline + + + Wash eyes with water + + + Washing + + + Eye Wash + + + Eye Washer + + + Wash eyes + + + Eyewash bottles allow an individual to flush the injured area immediately + + + Eye Shield + + + Apply Eye Shield + + + Applying + + + Eye Shield + + + Medic required for eye shield + + + Treatment time for eye shield + + + Eye Injury + + + diff --git a/addons/ophthalmology/ui/LeftEyeNVG.paa b/addons/ophthalmology/ui/LeftEyeNVG.paa new file mode 100644 index 000000000..3eaca49c1 Binary files /dev/null and b/addons/ophthalmology/ui/LeftEyeNVG.paa differ diff --git a/addons/ophthalmology/ui/LeftEyeShield.paa b/addons/ophthalmology/ui/LeftEyeShield.paa new file mode 100644 index 000000000..ea6c701f3 Binary files /dev/null and b/addons/ophthalmology/ui/LeftEyeShield.paa differ diff --git a/addons/ophthalmology/ui/LowerBlink.paa b/addons/ophthalmology/ui/LowerBlink.paa new file mode 100644 index 000000000..61e7af9ec Binary files /dev/null and b/addons/ophthalmology/ui/LowerBlink.paa differ diff --git a/addons/ophthalmology/ui/RightEyeNVG.paa b/addons/ophthalmology/ui/RightEyeNVG.paa new file mode 100644 index 000000000..dd714dc2c Binary files /dev/null and b/addons/ophthalmology/ui/RightEyeNVG.paa differ diff --git a/addons/ophthalmology/ui/RightEyeShield.paa b/addons/ophthalmology/ui/RightEyeShield.paa new file mode 100644 index 000000000..1a99e246e Binary files /dev/null and b/addons/ophthalmology/ui/RightEyeShield.paa differ diff --git a/addons/ophthalmology/ui/UpperBlink.paa b/addons/ophthalmology/ui/UpperBlink.paa new file mode 100644 index 000000000..f3aa90575 Binary files /dev/null and b/addons/ophthalmology/ui/UpperBlink.paa differ diff --git a/addons/ophthalmology/ui/icon_eyeshield.paa b/addons/ophthalmology/ui/icon_eyeshield.paa new file mode 100644 index 000000000..1703c12be Binary files /dev/null and b/addons/ophthalmology/ui/icon_eyeshield.paa differ diff --git a/addons/ophthalmology/ui/icon_eyewasher.paa b/addons/ophthalmology/ui/icon_eyewasher.paa new file mode 100644 index 000000000..4513e9a1d Binary files /dev/null and b/addons/ophthalmology/ui/icon_eyewasher.paa differ