Skip to content

Commit

Permalink
Merge pull request #188 from Sparker95/medical-shit
Browse files Browse the repository at this point in the history
Medical shit
  • Loading branch information
Sparker95 authored Nov 16, 2019
2 parents 9219bdc + 61d9853 commit f55c491
Show file tree
Hide file tree
Showing 16 changed files with 1,067 additions and 1,362 deletions.
6 changes: 0 additions & 6 deletions Project_0.Altis/Camp/Camp.hpp

This file was deleted.

143 changes: 0 additions & 143 deletions Project_0.Altis/Camp/Camp.sqf

This file was deleted.

Empty file.
27 changes: 0 additions & 27 deletions Project_0.Altis/Camp/fn_createCamp.sqf

This file was deleted.

2 changes: 0 additions & 2 deletions Project_0.Altis/Camp/initClasses.sqf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Returns an empty default array with no items
private _return = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
_return
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ Author: Sparker

if (!isServer) exitWith {};

params [["_object", objNull, [objNull]]];
params [["_object", objNull, [objNull]], ["_initialValue", []]];

// Bail if a null object is passed (why??)
if (isNull _object) exitWith {};

// Set initial arsenal item array value
if (count _initialValue > 0) then {
_object setVariable ["jna_datalist", _initialValue];
};

// Generate a JIP ID
private _ID = 0;
if(isNil "jna_nextID") then {
Expand Down
4 changes: 4 additions & 0 deletions Project_0.Altis/JeroenArsenal/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class JN {
class arsenal_removeItem {};
class arsenal_requestOpen {};
class arsenal_requestClose {};
class arsenal_getEmptyArray {};
};
class JNG {
file = "JeroenArsenal\JNG";
Expand All @@ -59,6 +60,8 @@ class JN {
class garage_updatePoints {};
};

/*
// Sorry had to disable that, it seems to desynchronize and nullify fual amounts sometimes
class Fuel {
file = "JeroenArsenal\Fuel";
class fuel_init {postinit = 1;};
Expand All @@ -77,6 +80,7 @@ class JN {
class fuel_getCargoCapacity {};
class fuel_setCargoCapacity {};
};
*/

class Ammo {
file = "JeroenArsenal\Ammo";
Expand Down
65 changes: 65 additions & 0 deletions Project_0.Altis/Location/Location.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ CLASS("Location", "MessageReceiverEx")
// Init radio object actions
CALLSM1("Location", "initRadioObject", _hObject);
};

_index = location_bt_medical find _type;
if (_index != -1) then {
CALLSM1("Location", "initMedicalObject", _hObject);
};
} ENDMETHOD;


Expand Down Expand Up @@ -1151,6 +1156,66 @@ CLASS("Location", "MessageReceiverEx")


// Initalization of different objects
STATIC_METHOD("initMedicalObject") {
params [P_THISCLASS, P_OBJECT("_object")];

if (!isServer) exitWith {
OOP_ERROR_0("initMedicalObject must be called on server!");
};

// Generate a JIP ID
private _ID = 0;
if(isNil "location_medical_nextID") then {
location_medical_nextID = 0;
_ID = 0;
} else {
_ID = location_medical_nextID;
};
location_medical_nextID = location_medical_nextID + 1;

private _JIPID = format ["loc_medical_jip_%1", _ID];
_object setVariable ["loc_medical_jip", _JIPID];

// Add an event handler to delete the init from the JIP queue when the object is gone
_object addEventHandler ["Deleted", {
params ["_entity"];
private _JIPID = _entity getVariable "loc_medical_jip";
if (isNil "_JIPID") exitWith {
OOP_ERROR_1("loc_medical_jip not found for object %1", _entity);
};
remoteExecCall ["", _JIPID]; // Remove it from the queue
}];

REMOTE_EXEC_CALL_STATIC_METHOD("Location", "initMedicalObjectAction", [_object], 0, _JIPID); // global, JIP

} ENDMETHOD;

STATIC_METHOD("initMedicalObjectAction") {
params [P_THISCLASS, P_OBJECT("_object")];

OOP_INFO_1("INIT MEDICAL OBJECT ACTION: %1", _object);

// Estimate usage radius
private _radius = (sizeof typeof _object) + 5;

_object addAction ["<img size='1.5' image='\A3\ui_f\data\IGUI\Cfg\Actions\heal_ca.paa'/> Heal Yourself", // title
{
player setdamage 0;
[player, player] call ACE_medical_fnc_treatmentAdvanced_fullHealLocal;
player playMove "AinvPknlMstpSlayWrflDnon_medic";
},
0, // Arguments
100, // Priority
true, // ShowWindow
false, //hideOnUse
"", //shortcut
"true", //condition
_radius, //radius
false, //unconscious
"", //selection
""]; //memoryPoint
} ENDMETHOD;

STATIC_METHOD("initRadioObject") {
params [P_THISCLASS, P_OBJECT("_object")];

Expand Down
7 changes: 7 additions & 0 deletions Project_0.Altis/Location/initBuildingTypes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ location_bt_radio =
"Land_Communication_F" // Tall tower with antennas on top, often found at military outposts
];

// Objects which heal units
location_bt_medical =
[
"Land_MedicalTent_01_digital_closed_F",
"Land_MedicalTent_01_brownhex_closed_F"
];

/*
_newdir = direction b + 180;
(vehicle player) setDir _newDir;
Expand Down
36 changes: 18 additions & 18 deletions Project_0.Altis/Templates/Undercover/CivObjects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ g_UM_civUniforms = [
"U_BG_Guerilla3_1",
"U_BG_Guerilla3_2",
"U_C_Commoner_shorts",
"U_C_Commoner1_1",
"U_C_Commoner1_2",
"U_C_Commoner1_3",
"U_C_Commoner2_1",
"U_C_Commoner2_2",
"U_C_Commoner2_3",
//"U_C_Commoner1_1",
//"U_C_Commoner1_2",
//"U_C_Commoner1_3",
//"U_C_Commoner2_1",
//"U_C_Commoner2_2",
//"U_C_Commoner2_3",
"U_C_ConstructionCoverall_Black_F",
"U_C_ConstructionCoverall_Blue_F",
"U_C_ConstructionCoverall_Red_F",
Expand All @@ -40,10 +40,10 @@ g_UM_civUniforms = [
"U_C_Driver_2",
"U_C_Driver_3",
"U_C_Driver_4",
"U_C_Farmer",
"U_C_Fisherman",
"U_C_FishermanOveralls",
"U_C_HunterBody_brn",
//"U_C_Farmer",
//"U_C_Fisherman",
//"U_C_FishermanOveralls",
//"U_C_HunterBody_brn",
"U_C_IDAP_Man_cargo_F",
"U_C_IDAP_Man_casual_F",
"U_C_IDAP_Man_Jeans_F",
Expand All @@ -70,16 +70,16 @@ g_UM_civUniforms = [
"U_C_Poloshirt_tricolour",
"U_C_Poor_1",
"U_C_Poor_2",
"U_C_Poor_shorts_1",
"U_C_Poor_shorts_2",
"U_C_Scavenger_1",
"U_C_Scavenger_2",
//"U_C_Poor_shorts_1",
//"U_C_Poor_shorts_2",
//"U_C_Scavenger_1",
//"U_C_Scavenger_2",
"U_C_Scientist",
"U_C_ShirtSurfer_shorts",
//"U_C_ShirtSurfer_shorts",
"U_C_TeeSurfer_shorts_1",
"U_C_TeeSurfer_shorts_2",
"U_C_WorkerCoveralls",
"U_C_WorkerOveralls",
//"U_C_WorkerOveralls",
"U_Competitor",
"U_I_C_Soldier_Bandit_1_F",
"U_I_C_Soldier_Bandit_2_F",
Expand All @@ -91,14 +91,14 @@ g_UM_civUniforms = [
"U_IG_Guerilla2_3",
"U_IG_Guerilla3_1",
"U_IG_Guerilla3_2",
"U_IG_Menelaos",
//"U_IG_Menelaos",
"U_Marshal",
"U_OG_Guerilla2_1",
"U_OG_Guerilla2_2",
"U_OG_Guerilla2_3",
"U_OG_Guerilla3_1",
"U_OG_Guerilla3_2",
"U_OI_Scientist",
//"U_OI_Scientist",
"U_C_HunterBody_grn",
"U_OrestesBody",
"U_Rangemaster"
Expand Down
Loading

0 comments on commit f55c491

Please sign in to comment.