Merge selfbloodbag and self_transfuse

This commit is contained in:
ebaydayz
2016-03-30 20:50:06 -04:00
parent 69091965a1
commit c54a52a103
56 changed files with 172 additions and 970 deletions

View File

@@ -16,6 +16,7 @@
- Dupicate functions have been renamed:
- dayz_HungerThirst --> dayz_NutritionSystem
- dayz_objectUID3 --> dayz_objectUID2
- fnc_usec_playerBleed --> fnc_usec_playerHandleBlood
- object_handleServerKilled --> vehicle_handleServerKilled
- object_setFixServer --> fnc_veh_setFixServer
- vehicle_handleDamage --> fnc_veh_handleDam

View File

@@ -93,7 +93,7 @@ switch (_item) do {
_id = [player,"wholeBloodBagOPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "ItemBloodbag": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\self_transfusion.sqf";
_id = [player,"ItemBloodbag"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
};
if (vehicle player != player) then {

View File

@@ -1,155 +0,0 @@
======================================================
DynamicWeatherEffects v2.00 by Engima of <20>stg<74>ta Ops
======================================================
As a mission designer I have always had problems with the weather. It has not been dynamic the way I want it to be, && I've always thought that it synchronizes terribly in multiplayer as soon I start experimenting with it (especially rain).
This is a simple script that makes the weather dynamic, && it works in single player, multiplayer (hosted && dedicated) && for JIPs. The weather is constantly changing over time intervals of the mission designer's choice. Weather is unpredictable && always synchronized among all players in a multiplayer game!
Script handles fog, overcast, rain && wind.
=======================
TECHNICAL INFORMATION
=======================
Data sent over network (using publicVariable) is minimal, as data is only sent when weather "forecast" changes && when weather needs to be synchronized because of a JIP player.
Fog && overcast is divided into four levels (clear, some, more, heavy) each representing a smaller value interval, since I don't regard pure random values as especially realistic (e.g. there would very seldom be a clear day). These levels are then chosen randomly, but they are forced to change. So If the weather is heavy fog, it will not change to heavy fog again, but to *another* randomly chosen fog level.
Each client runs a "rain loop" that sets the rain value every third second. This is a workaround for the "rain bug" (|| what it is) causing rain to behave randomly on all clients when left unwatched.
If overcast goes above 0.75, there is chance of rain, otherwise it cannot rain (limitation in the game).
Fog && overcast does not change at the same time (limitation in game).
==============
CHANGELOG
==============
v2.00
- Added section for mission makers to customize && tweak weather behaviour && details.
- Dependency to CommonLib.sqf deleted.
- Improved rain behaviour.
- Initial weather is passed as arguments.
- Slightly better performance.
v1.00
- First version.
==============
REQUIREMENTS
==============
No requirements.
==============
INSTALLATION
==============
1. Copy the folder "Scripts" to your mission folder, || just make sure that the following file (&& path) exists in your mission folder:
Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf
2. If the init file (init.sqf) not already exists, create the file in the root of your mission folder.
3. In init.sqf, Start the weather script by adding the the following line:
execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf";
==============
VARIABLES
==============
In the script file (DynamicWeatherEffects.sqf) there is a section allowing mission designers to tweak some details regarding weather behavior. The following variables can be altered:
// Minimum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to 1 && less than || equal to _maxWeatherChangeTimeMin. When weather changes, it is fog || overcast that changes, not both at the same time. (Suggested value: 10).
_minWeatherChangeTimeMin = 10;
// Maximum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 20).
_maxWeatherChangeTimeMin = 20;
// Minimum time in minutes that weather (fog && overcast) stays constant between weather changes. Must be less than || equal to 0 && greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 5).
_minTimeBetweenWeatherChangesMin = 5;
// Maximum time in minutes that weather (fog && overcast) stays unchanged between weather changes. Must be greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 10).
_maxTimeBetweenWeatherChangesMin = 10;
// Fog intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumFog (0 = no fog, 1 = pea soup). (Suggested value: 0).
_minimumFog = 0;
// Fog intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumFog (0 = no fog, 1 = pea soup). (Suggested value: 0.8).
_maximumFog = 0.8;
// Overcast intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumOvercast (0 = no overcast, 1 = maximum overcast). (Suggested value: 0).
_minimumOvercast = 0;
// Overcast intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumOvercast (0 = no overcast, 1 = maximum overcast). (Suggested value: 1).
_maximumOvercast = 1;
// When raining, rain intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumRain (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0);
_minimumRain = 0;
// When raining, rain intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumRain (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0.8);
_maximumRain = 0.8;
// Wind vector strength never falls below this value. Must be greater || equal to 0 && less than || equal to _maximumWind. (Suggested value: 0);
_minimumWind = 0;
// Wind vector strength never exceeds this value. Must be greater || equal to 0 && greater than || equal to _minimumWind. (Suggested value: 8).
_maximumWind = 8;
// Probability in percent for wind to change when weather changes. If set to 0 then wind will never change. If set to 100 then rain will change every time the weather (fog || overcast) start to change. (Suggested value: 25);
_windChangeProbability = 25;
// A "rain interval" is defined as "a time interval during which it may rain in any intensity (|| it may not rain at all)". When overcast goes above 0.75, a chain of rain intervals (defined below) is started. It cycles on until overcast falls below 0.75. At overcast below 0.75 rain intervals never execute (thus it cannot rain).
// Probability in percent (0-100) for rain to start at every rain interval. Set this to 0 if you don't want rain at all. Set this to 100 if you want it to rain constantly when overcast is greater than 0.75. In short: if you think that it generally rains to often then lower this value && vice versa. (Suggested value: 50).
_rainIntervalRainProbability = 50;
// Minimum time in minutes for rain intervals. Must be greater || equal to 0 && less than || equal to _maxRainIntervalTimeMin. (Suggested value: 0).
_minRainIntervalTimeMin = 0;
// Maximum time in minutes for rain intervals. Must be greater than || equal to _minRainIntervalTimeMin. (Suggested value: (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2)).
_maxRainIntervalTimeMin = (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2;
// If set to true, then the rain is forced to stop after one rain interval during which it has rained (use this for example if you only want small occational cloudbursts). If set to false, then the rain may stop, but it may also just change intensity for an immedeate new rain interval. (Suggested value: false).
_forceRainToStopAfterOneRainInterval = false;
==============
ARGUMENTS
==============
Arguments can be passed to the script to set initial mission weather. The following five arguments can be passed to the script:
1) [_initialFog]: Optional. Fog when mission starts. Must be between 0 && 1 where 0 = no fog, 1 = maximum fog. -1 = random fog.
2) [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 && 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast.
3) [_initialRain]: Optional. Rain when mission starts. Must be between 0 && 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than || equal to 0.75).
4) [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector && z is the other. x && z must be greater than || equal to 0. [-1, -1] = random wind.
5) [_debug]: Optional. true if debug text is to be shown, otherwise false.
==============
EXAMPLES
==============
Only one line is needed in init.sqf, && here are some examples:
// The mission will start with random weather.
execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf";
// The mission will start with fog set to 0.5, but overcast, rain && wind will be random.
[0.5] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf";
// The mission will start with fog set to 0.1, overcast set to 0.9, rain set to 1, && wind will be random.
[0.1, 0.9, 1] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf";
// The mission will start with random fog, random overcast, random rain && no wind. Debug messages will be displayed for all players.
[-1, -1, -1, [0, 0], true] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf";
// The mission will start with fog set to 0.5, overcast set to 0.5, no rain (since the overcast is less than 0.75), && strong wind in direction south west.
[0.5, 0.5, 0.5, [10, 10]] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf";

View File

@@ -1,564 +0,0 @@
/* DynamicWeatherEffects.sqf version 1.01 by Engima of Ostgota Ops
* Description:
* Script that generates dynamic (random) weather. Works in single player, multiplayer (hosted && dedicated), && is JIP compatible.
* Arguments:
* [_initialFog]: Optional. Fog when mission starts. Must be between 0 && 1 where 0 = no fog, 1 = maximum fog. -1 = random fog.
* [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 && 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast.
* [_initialRain]: Optional. Rain when mission starts. Must be between 0 && 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than || equal to 0.75).
* [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector && z is the other. x && z must be greater than || equal to 0. [-1, -1] = random wind.
* [_debug]: Optional. true if debug text is to be shown, otherwise false.
*/
private ["_initialFog", "_initialOvercast", "_initialRain", "_initialWind", "_debug"];
private ["_minWeatherChangeTimeMin", "_maxWeatherChangeTimeMin", "_minTimeBetweenWeatherChangesMin", "_maxTimeBetweenWeatherChangesMin", "_rainIntervalRainProbability", "_windChangeProbability"];
private ["_minimumFog", "_maximumFog", "_minimumOvercast", "_maximumOvercast", "_minimumRain", "_maximumRain", "_minimumWind", "_maximumWind", "_minRainIntervalTimeMin", "_maxRainIntervalTimeMin", "_forceRainToStopAfterOneRainInterval", "_maxWind"];
if (isNil "_this") then { _this = []; };
if (count _this > 0) then { _initialFog = _this select 0; } else { _initialFog = -1; };
if (count _this > 1) then { _initialOvercast = _this select 1; } else { _initialOvercast = -1; };
if (count _this > 2) then { _initialRain = _this select 2; } else { _initialRain = -1; };
if (count _this > 3) then { _initialWind = _this select 3; } else { _initialWind = [-1, -1]; };
if (count _this > 4) then { _debug = _this select 4; } else { _debug = false; };
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The following variables can be changed to tweak weather behaviour
// Minimum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to 1 && less than || equal to
// _maxWeatherChangeTimeMin. When weather changes, it is fog || overcast that changes, not both at the same time. (Suggested value: 10).
_minWeatherChangeTimeMin = 10;
// Maximum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to _minWeatherChangeTimeMin.
// (Suggested value: 20).
_maxWeatherChangeTimeMin = 20;
// Minimum time in minutes that weather (fog && overcast) stays constant between weather changes. Must be less than || equal to 0 &&
// greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 5).
_minTimeBetweenWeatherChangesMin = 5;
// Maximum time in minutes that weather (fog && overcast) stays unchanged between weather changes. Must be greater than || equal to
// _minWeatherChangeTimeMin. (Suggested value: 10).
_maxTimeBetweenWeatherChangesMin = 10;
// Fog intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumFog
// (0 = no fog, 1 = pea soup). (Suggested value: 0).
_minimumFog = 0;
// Fog intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumFog
// (0 = no fog, 1 = pea soup). (Suggested value: 0.8).
_maximumFog = 0.5;
// Overcast intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumOvercast
// (0 = no overcast, 1 = maximum overcast). (Suggested value: 0).
_minimumOvercast = 0;
// Overcast intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumOvercast
// (0 = no overcast, 1 = maximum overcast). (Suggested value: 1).
_maximumOvercast = 1;
// When raining, rain intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumRain
// (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0);
_minimumRain = 0;
// When raining, rain intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumRain
// (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0.8);
_maximumRain = 0.8;
// Wind vector strength never falls below this value. Must be greater || equal to 0 && less than || equal to _maximumWind.
// (Suggested value: 0);
_minimumWind = 0;
// Wind vector strength never exceeds this value. Must be greater || equal to 0 && greater than || equal to _minimumWind.
// (Suggested value: 8).
_maximumWind = 8;
// Probability in percent for wind to change when weather changes. If set to 0 then wind will never change. If set to 100 then rain will
// change every time the weather (fog || overcast) start to change. (Suggested value: 25);
_windChangeProbability = 25;
// A "rain interval" is defined as "a time interval during which it may rain in any intensity (|| it may not rain at all)". When overcast
// goes above 0.75, a chain of rain intervals (defined below) is started. It cycles on until overcast falls below 0.75. At overcast
// below 0.75 rain intervals never execute (thus it cannot rain).
// Probability in percent (0-100) for rain to start at every rain interval. Set this to 0 if you don't want rain at all. Set this to 100
// if you want it to rain constantly when overcast is greater than 0.75. In short: if you think that it generally rains to often then
// lower this value && vice versa. (Suggested value: 50).
_rainIntervalRainProbability = 50;
// Minimum time in minutes for rain intervals. Must be greater || equal to 0 && less than || equal to _maxRainIntervalTimeMin.
// (Suggested value: 0).
_minRainIntervalTimeMin = 0;
// Maximum time in minutes for rain intervals. Must be greater than || equal to _minRainIntervalTimeMin. (Suggested value:
// (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2).
_maxRainIntervalTimeMin = (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2;
// If set to true, then the rain is forced to stop after one rain interval during which it has rained (use this for example if you only want
// small occational cloudbursts ). If set to false, then the rain may stop, but it may also just change intensity for an
// immedeate new rain interval. (Suggested value: false).
_forceRainToStopAfterOneRainInterval = false;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Don't touch anything beneath this line
drn_DynamicWeather_DebugTextEventArgs = []; // Empty
"drn_DynamicWeather_DebugTextEventArgs" addPublicVariableEventHandler {
drn_DynamicWeather_DebugTextEventArgs call drn_fnc_DynamicWeather_ShowDebugTextLocal;
};
/*
* Summary: Shows debug text on local client.
* Arguments:
* _text: Debug text.
*/
drn_fnc_DynamicWeather_ShowDebugTextLocal = {
private ["_minutes", "_seconds"];
if (!isNull player) then {
player sideChat (_this select 0);
};
_minutes = floor (time / 60);
_seconds = floor (time - (_minutes * 60));
diag_log ((str _minutes + ":" + str _seconds) + " Debug: " + (_this select 0));
};
/*
* Summary: Shows debug text on all clients.
* Arguments:
* _text: Debug text.
*/
drn_fnc_DynamicWeather_ShowDebugTextAllClients = {
drn_DynamicWeather_DebugTextEventArgs = _this;
publicVariable "drn_DynamicWeather_DebugTextEventArgs";
drn_DynamicWeather_DebugTextEventArgs call drn_fnc_DynamicWeather_ShowDebugTextLocal;
};
if (_debug) then {
["Starting script WeatherEffects.sqf..."] call drn_fnc_DynamicWeather_ShowDebugTextLocal;
};
drn_DynamicWeatherEventArgs = []; // [current overcast, current fog, current rain, current weather change ("OVERCAST", "FOG" || ""), target weather value, time until weather completion (in seconds), current wind x, current wind z]
drn_AskServerDynamicWeatherEventArgs = []; // []
drn_fnc_DynamicWeather_SetWeatherLocal = {
private ["_currentOvercast", "_currentFog", "_currentRain", "_currentWeatherChange", "_targetWeatherValue", "_timeUntilCompletion", "_currentWindX", "_currentWindZ"];
_currentOvercast = _this select 0;
_currentFog = _this select 1;
_currentRain = _this select 2;
_currentWeatherChange = _this select 3;
_targetWeatherValue = _this select 4;
_timeUntilCompletion = _this select 5;
_currentWindX = _this select 6;
_currentWindZ = _this select 7;
// Set current weather values
0 setOvercast _currentOvercast;
0 setFog _currentFog;
drn_var_DynamicWeather_Rain = _currentRain;
setWind [_currentWindX, _currentWindZ, true];
// Set forecast
if (_currentWeatherChange == "OVERCAST") then {
_timeUntilCompletion setOvercast _targetWeatherValue;
};
if (_currentWeatherChange == "FOG") then {
_timeUntilCompletion setFog _targetWeatherValue;
};
};
if (!isServer) then {
"drn_DynamicWeatherEventArgs" addPublicVariableEventHandler {
drn_DynamicWeatherEventArgs call drn_fnc_DynamicWeather_SetWeatherLocal;
};
waitUntil {!isNil "drn_var_DynamicWeather_ServerInitialized"};
drn_AskServerDynamicWeatherEventArgs = [true];
publicVariable "drn_AskServerDynamicWeatherEventArgs";
};
if (isServer) then {
drn_fnc_DynamicWeather_SetWeatherAllClients = {
private ["_timeUntilCompletion", "_currentWeatherChange"];
_timeUntilCompletion = drn_DynamicWeather_WeatherChangeCompletedTime - drn_DynamicWeather_WeatherChangeStartedTime;
if (_timeUntilCompletion > 0) then {
_currentWeatherChange = drn_DynamicWeather_CurrentWeatherChange;
}
else {
_currentWeatherChange = "";
};
drn_DynamicWeatherEventArgs = [overcast, fog, drn_var_DynamicWeather_Rain, _currentWeatherChange, drn_DynamicWeather_WeatherTargetValue, _timeUntilCompletion, drn_DynamicWeather_WindX, drn_DynamicWeather_WindZ];
publicVariable "drn_DynamicWeatherEventArgs";
drn_DynamicWeatherEventArgs call drn_fnc_DynamicWeather_SetWeatherLocal;
};
"drn_AskServerDynamicWeatherEventArgs" addPublicVariableEventHandler {
call drn_fnc_DynamicWeather_SetWeatherAllClients;
};
drn_DynamicWeather_CurrentWeatherChange = "";
drn_DynamicWeather_WeatherTargetValue = 0;
drn_DynamicWeather_WeatherChangeStartedTime = time;
drn_DynamicWeather_WeatherChangeCompletedTime = time;
drn_DynamicWeather_WindX = _initialWind select 0;
drn_DynamicWeather_WindZ = _initialWind select 1;
if (_initialFog == -1) then {
_initialFog = (_minimumFog + random (_maximumFog - _minimumFog));
}
else {
if (_initialFog < _minimumFog) then {
_initialFog = _minimumFog;
};
if (_initialFog > _maximumFog) then {
_initialFog = _maximumFog;
};
};
0 setFog _initialFog;
if (_initialOvercast == -1) then {
_initialOvercast = (_minimumOvercast + random (_maximumOvercast - _minimumOvercast));
}
else {
if (_initialOvercast < _minimumOvercast) then {
_initialOvercast = _minimumOvercast;
};
if (_initialOvercast > _maximumOvercast) then {
_initialOvercast = _maximumOvercast;
};
};
0 setOvercast _initialOvercast;
if (_initialOvercast >= 0.75) then {
if (_initialRain == -1) then {
_initialRain = (_minimumRain + random (_minimumRain - _minimumRain));
}
else {
if (_initialRain < _minimumRain) then {
_initialRain = _minimumRain;
};
if (_initialRain > _maximumRain) then {
_initialRain = _maximumRain;
};
};
}
else {
_initialRain = 0;
};
drn_var_DynamicWeather_Rain = _initialRain;
0 setRain drn_var_DynamicWeather_Rain;
_maxWind = _minimumWind + random (_maximumWind - _minimumWind);
if (drn_DynamicWeather_WindX == -1) then {
if (random 100 < 50) then {
drn_DynamicWeather_WindX = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindX = _minimumWind + random (_maxWind - _minimumWind);
};
};
if (drn_DynamicWeather_WindZ == -1) then {
if (random 100 < 50) then {
drn_DynamicWeather_WindZ = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindZ = _minimumWind + random (_maxWind - _minimumWind);
};
};
setWind [drn_DynamicWeather_WindX, drn_DynamicWeather_WindZ, true];
uiSleep 0.05;
publicVariable "drn_var_DynamicWeather_Rain";
drn_var_DynamicWeather_ServerInitialized = true;
publicVariable "drn_var_DynamicWeather_ServerInitialized";
// Start weather thread
[_minWeatherChangeTimeMin, _maxWeatherChangeTimeMin, _minTimeBetweenWeatherChangesMin, _maxTimeBetweenWeatherChangesMin, _minimumFog, _maximumFog, _minimumOvercast, _maximumOvercast, _minimumWind, _maximumWind, _windChangeProbability, _debug] spawn {
private ["_minWeatherChangeTimeMin", "_maxWeatherChangeTimeMin", "_minTimeBetweenWeatherChangesMin", "_maxTimeBetweenWeatherChangesMin", "_minimumFog", "_maximumFog", "_minimumOvercast", "_maximumOvercast", "_minimumWind", "_maximumWind", "_windChangeProbability", "_debug"];
private ["_weatherType", "_fogLevel", "_overcastLevel", "_oldFogLevel", "_oldOvercastLevel", "_weatherChangeTimeSek"];
_minWeatherChangeTimeMin = _this select 0;
_maxWeatherChangeTimeMin = _this select 1;
_minTimeBetweenWeatherChangesMin = _this select 2;
_maxTimeBetweenWeatherChangesMin = _this select 3;
_minimumFog = _this select 4;
_maximumFog = _this select 5;
_minimumOvercast = _this select 6;
_maximumOvercast = _this select 7;
_minimumWind = _this select 8;
_maximumWind = _this select 9;
_windChangeProbability = _this select 10;
_debug = _this select 11;
// Set initial fog level
_fogLevel = 2;
_overcastLevel = 2;
while {true} do {
// Sleep a while until next weather change
uiSleep floor (_minTimeBetweenWeatherChangesMin * 60 + random ((_maxTimeBetweenWeatherChangesMin - _minTimeBetweenWeatherChangesMin) * 60));
if (_minimumFog == _maximumFog && _minimumOvercast != _maximumOvercast) then {
_weatherType = "OVERCAST";
};
if (_minimumFog != _maximumFog && _minimumOvercast == _maximumOvercast) then {
_weatherType = "FOG";
};
if (_minimumFog != _maximumFog && _minimumOvercast != _maximumOvercast) then {
// Select type of weather to change
if ((random 100) < 50) then {
_weatherType = "OVERCAST";
}
else {
_weatherType = "FOG";
};
};
// DEBUG
//_weatherType = "OVERCAST";
if (_weatherType == "FOG") then {
drn_DynamicWeather_CurrentWeatherChange = "FOG";
// Select a new fog level
_oldFogLevel = _fogLevel;
_fogLevel = floor ((random 100) / 25);
while {_fogLevel == _oldFogLevel} do {
_fogLevel = floor ((random 100) / 25);
};
if (_fogLevel == 0) then {
drn_DynamicWeather_WeatherTargetValue = _minimumFog + (_maximumFog - _minimumFog) * random 0.05;
};
if (_fogLevel == 1) then {
drn_DynamicWeather_WeatherTargetValue = _minimumFog + (_maximumFog - _minimumFog) * (0.05 + random 0.2);
};
if (_fogLevel == 2) then {
drn_DynamicWeather_WeatherTargetValue = _minimumFog + (_maximumFog - _minimumFog) * (0.25 + random 0.3);
};
if (_fogLevel == 3) then {
drn_DynamicWeather_WeatherTargetValue = _minimumFog + (_maximumFog - _minimumFog) * (0.55 + random 0.45);
};
drn_DynamicWeather_WeatherChangeStartedTime = time;
_weatherChangeTimeSek = _minWeatherChangeTimeMin * 60 + random ((_maxWeatherChangeTimeMin - _minWeatherChangeTimeMin) * 60);
drn_DynamicWeather_WeatherChangeCompletedTime = time + _weatherChangeTimeSek;
if (_debug) then {
["Weather forecast: Fog " + str drn_DynamicWeather_WeatherTargetValue + " in " + str round (_weatherChangeTimeSek / 60) + " minutes."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};
if (_weatherType == "OVERCAST") then {
drn_DynamicWeather_CurrentWeatherChange = "OVERCAST";
// Select a new overcast level
_oldOvercastLevel = _overcastLevel;
//_overcastLevel = floor ((random 100) / 25);
_overcastLevel = 3;
while {_overcastLevel == _oldOvercastLevel} do {
_overcastLevel = floor ((random 100) / 25);
};
if (_overcastLevel == 0) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * random 0.05;
};
if (_overcastLevel == 1) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * (0.05 + random 0.3);
};
if (_overcastLevel == 2) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * (0.35 + random 0.35);
};
if (_overcastLevel == 3) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * (0.7 + random 0.3);
};
// DEBUG
/*
if (overcast > 0.8) then {
drn_DynamicWeather_WeatherTargetValue = 0.5;
}
else {
drn_DynamicWeather_WeatherTargetValue = 0.85;
};
*/
drn_DynamicWeather_WeatherChangeStartedTime = time;
_weatherChangeTimeSek = _minWeatherChangeTimeMin * 60 + random ((_maxWeatherChangeTimeMin - _minWeatherChangeTimeMin) * 60);
drn_DynamicWeather_WeatherChangeCompletedTime = time + _weatherChangeTimeSek;
if (_debug) then {
["Weather forecast: Overcast " + str drn_DynamicWeather_WeatherTargetValue + " in " + str round (_weatherChangeTimeSek / 60) + " minutes."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};
// On average every one fourth of weather changes, change wind too
if (random 100 < _windChangeProbability) then {
private ["_maxWind"];
_maxWind = _minimumWind + random (_maximumWind - _minimumWind);
if (random 100 < 50) then {
drn_DynamicWeather_WindX = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindX = _minimumWind + random (_maxWind - _minimumWind);
};
if (random 100 < 50) then {
drn_DynamicWeather_WindZ = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindZ = _minimumWind + random (_maxWind - _minimumWind);
};
if (_debug) then {
["Wind changes: [" + str drn_DynamicWeather_WindX + ", " + str drn_DynamicWeather_WindZ + "]."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};
call drn_fnc_DynamicWeather_SetWeatherAllClients;
uiSleep _weatherChangeTimeSek;
};
};
// Start rain thread
if (_rainIntervalRainProbability > 0) then {
[_minimumRain, _maximumRain, _forceRainToStopAfterOneRainInterval, _minRainIntervalTimeMin, _maxRainIntervalTimeMin, _rainIntervalRainProbability, _debug] spawn {
private ["_minimumRain", "_maximumRain", "_forceRainToStopAfterOneRainInterval", "_minRainIntervalTimeMin", "_maxRainIntervalTimeMin", "_rainIntervalRainProbability", "_debug"];
private ["_nextRainEventTime", "_forceStop"];
_minimumRain = _this select 0;
_maximumRain = _this select 1;
_forceRainToStopAfterOneRainInterval = _this select 2;
_minRainIntervalTimeMin = _this select 3;
_maxRainIntervalTimeMin = _this select 4;
_rainIntervalRainProbability = _this select 5;
_debug = _this select 6;
if (rain > 0) then {
drn_var_DynamicWeather_Rain = rain;
publicVariable "drn_var_DynamicWeather_Rain";
};
_nextRainEventTime = time;
_forceStop = false;
while {true} do {
if (overcast > 0.75) then {
if (time >= _nextRainEventTime) then {
private ["_rainTimeSec"];
// At every rain event time, start || stop rain with 50% probability
if (random 100 < _rainIntervalRainProbability && !_forceStop) then {
drn_var_DynamicWeather_rain = _minimumRain + random (_maximumRain - _minimumRain);
publicVariable "drn_var_DynamicWeather_rain";
_forceStop = _forceRainToStopAfterOneRainInterval;
}
else {
drn_var_DynamicWeather_rain = 0;
publicVariable "drn_var_DynamicWeather_rain";
_forceStop = false;
};
// Pick a time for next rain change
_rainTimeSec = _minRainIntervalTimeMin * 60 + random ((_maxRainIntervalTimeMin - _minRainIntervalTimeMin) * 60);
_nextRainEventTime = time + _rainTimeSec;
if (_debug) then {
["Rain set to " + str drn_var_DynamicWeather_rain + " for " + str (_rainTimeSec / 60) + " minutes"] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};
}
else {
if (drn_var_DynamicWeather_rain != 0) then {
drn_var_DynamicWeather_rain = 0;
publicVariable "drn_var_DynamicWeather_rain";
if (_debug) then {
["Rain stops due to low overcast."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};
_nextRainEventTime = time;
_forceStop = false;
};
if (_debug) then {
uiSleep 1;
}
else {
uiSleep 10;
};
};
};
};
};
[_rainIntervalRainProbability, _debug] spawn {
private ["_rainIntervalRainProbability", "_debug"];
private ["_rain", "_rainPerSecond"];
_rainIntervalRainProbability = _this select 0;
_debug = _this select 1;
if (_debug) then {
_rainPerSecond = 0.2;
}
else {
_rainPerSecond = 0.03;
};
if (_rainIntervalRainProbability > 0) then {
_rain = drn_var_DynamicWeather_Rain;
}
else {
_rain = 0;
};
0 setRain _rain;
uiSleep 0.1;
while {true} do {
if (_rainIntervalRainProbability > 0) then {
if (_rain < drn_var_DynamicWeather_Rain) then {
_rain = _rain + _rainPerSecond;
if (_rain > 1) then { _rain = 1; };
};
if (_rain > drn_var_DynamicWeather_Rain) then {
_rain = _rain - _rainPerSecond;
if (_rain < 0) then { _rain = 0; };
};
}
else {
_rain = 0;
};
3 setRain _rain;
uiSleep 3;
};
};

View File

@@ -66,7 +66,6 @@ class RscProgressNotFreeze
//
// the loading screen itself
//
class DayZ_loadingScreen
{
idd = -1;

View File

@@ -1,7 +1 @@
private["_holder","_type","_classname","_name","_null"];
_holder = _this select 0;
_type = _this select 1;
_classname = _this select 2;
_name = getText (configFile >> _type >> _classname >> "displayName");
_null = _holder addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
player reveal _holder;
// referenced in dayz_equip/config.cpp :: class WeaponHolder_ItemGenerator

View File

@@ -405,6 +405,9 @@ if(isNil "dayz_infectiouswaterholes") then {
if(isNil "dayz_POIs") then {
dayz_POIs = true; //Enable POI's
};
if(isNil "dayz_ForcefullmoonNights") then {
dayz_ForcefullmoonNights = false; // Forces night time to be full moon.
};
//Replace server individual settings with ranked settings
if(isNil "dayz_presets") then { dayz_presets = "Vanilla"; };
@@ -418,7 +421,6 @@ switch (dayz_presets) do {
if(isNil "dayz_spawnCrashSite_clutterCutter") then { dayz_spawnCrashSite_clutterCutter = 0; };
if(isNil "dayz_spawnInfectedSite_clutterCutter") then { dayz_spawnInfectedSite_clutterCutter = 0; };
if(isNil "dayz_bleedingeffect") then { dayz_bleedingeffect = 2; };
if(isNil "dayz_ForcefullmoonNights") then { dayz_ForcefullmoonNights = false; };
if(isNil "dayz_OpenTarget_TimerTicks") then { dayz_OpenTarget_TimerTicks = 60 * 10; };
if(isNil "dayz_temperature_override") then { dayz_temperature_override = true; };
if(isNil "dayz_nutritionValuesSystem") then { dayz_nutritionValuesSystem = false; };
@@ -433,7 +435,6 @@ switch (dayz_presets) do {
dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass
dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
dayz_bleedingeffect = 2; //1= blood on the ground, 2= partical effect, 3 = both.
dayz_ForcefullmoonNights = false; // Forces night time to be full moon.
dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
dayz_temperature_override = true; // Set to true to disable all temperature changes.
dayz_nutritionValuesSystem = false; //Enables nutrition system
@@ -448,7 +449,6 @@ switch (dayz_presets) do {
dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass
dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
dayz_ForcefullmoonNights = false; // Forces night time to be full moon.
dayz_OpenTarget_TimerTicks = 60 * 25; //how long can a player be freely attacked for after attacking someone unprovoked.
dayz_temperature_override = false; // Set to true to disable all temperature changes.
dayz_nutritionValuesSystem = true; //Enables nutrition system
@@ -463,7 +463,6 @@ switch (dayz_presets) do {
dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass
dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
dayz_ForcefullmoonNights = true; // Forces night time to be full moon.
dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
dayz_temperature_override = false; // Set to true to disable all temperature changes.
dayz_nutritionValuesSystem = true; //Enables nutrition system

View File

@@ -1,4 +0,0 @@
private ["_unit","_id"];
_unit = _this select 0;
_id = _unit addeventhandler ["HandleDamage",{_this call local_zombieDamage}];
_id = _unit addeventhandler ["Killed",{[_this,"zombieKills"] call local_eventKill}];

View File

@@ -39,7 +39,7 @@ while {r_doLoop} do {
r_doLoop = false;
_finished = true;
};
uisleep 0.1;
uiSleep 0.1;
};
r_doLoop = false;

View File

@@ -1,12 +1,10 @@
// bleed.sqf
private ["_unit","_isDead"];
_unit = (_this select 3) select 0;
_isDead = _unit getVariable["USEC_isDead",false];
call fnc_usec_medic_removeActions;
player removeMagazine "ItemEpinephrine";
player playActionNow "Medic";
player removeMagazine "ItemEpinephrine";
uiSleep 3;
@@ -14,7 +12,10 @@ if (!_isDead) then {
_unit setVariable ["NORRN_unconscious", false, true];
_unit setVariable ["USEC_isCardiac",false,true];
uiSleep 5;
/* PVS/PVC - Skaronator */
//give humanity
[player,25] call player_humanityChange;
PVDZ_send = [_unit,"Epinephrine",[_unit,player,"ItemEpinephrine"]];
publicVariableServer "PVDZ_send";
};

View File

@@ -1,6 +1,5 @@
// allowDamage.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";

View File

@@ -1,6 +1,5 @@
// animDrag.sqf
private ["_dragee"];
_dragee = _this select 0;
_dragee switchmove "ainjppnemstpsnonwrfldb_still";

View File

@@ -1,10 +1,9 @@
// animHealed.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
if ((_unit == player) || (vehicle player != player)) then {
if (_unit == player) then {
r_player_unconscious = false;
r_player_injured = false;
};

View File

@@ -1,5 +1,4 @@
//carriedUp.sqf
private ["_dragee"];
_dragee = _this select 0;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_up";

View File

@@ -1,6 +1,6 @@
//deadState.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "deadState";

View File

@@ -1,6 +1,6 @@
//lieStill.sqf
private ["_dragee"];
_dragee = _this select 0;
_dragee playMoveNow "ainjppnemstpsnonwrfldnon";

View File

@@ -1,6 +1,5 @@
// load_wounded.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "kia_hmmwv_driver";

View File

@@ -1,5 +1,6 @@
// called by PublicVariableEventHandler "PVCDZ_hlt_Epi", received from the server,
// because another player sent a PVDZ_send = [_unit,"Epinephrine",[_unit,player,"ItemEpinephrine"]];
_array = _this; //_this select 0;
_unit = _array select 0; // healed
_medic = _array select 1; // healer

View File

@@ -1,25 +1,48 @@
private ["_selfTransValues","_unit","_display","_control","_rndInfection","_TransfusionInfection"];
// animHealed.sqf
private["_array","_unit","_medic","_amount","_display","_control","_lowBlood"];
disableserialization;
_unit = _this select 0;
//[_unit,player,_bloodAmount]
_array = _this; //_this select 0;
_unit = _array select 0; //Player receving the blood
_medic = _array select 1; //Player sending the blood
_amount = _array select 2; //total amount of blood given
_rndInfection = (random 15);
_TransfusionInfection = (_rndInfection < 1);
_timer = diag_tickTime;
r_doLoop = true;
r_interrupt = false;
if (_amount < 0) exitWith { /* someone is trying to kill the player */ };
//Start the loop to mimic the transfusion to cut back on issues flooding the server
while {r_doLoop} do {
if ((diag_tickTime - _timer) >= 1) then {
_timer = diag_tickTime;
//Infection chance
_rndInfection = (random 20);
_TransfusionInfection = (_rndInfection < 0.3);
//Mimic the transfer of the blood (cut out the server)
if (_amount > 0) then {
_amount = _amount - 500;
};
cutText [localize "str_actions_medical_transfusion_start", "PLAIN DOWN"];
//Make sure the unit is a player and update stats based on whats being sent (should mimic 500 units of blood being sent)
if (_unit == player) then {
if (((count _this) > 1) && {(typeName (_this select 1)) == "ARRAY"}) then { //DO NOT TOUCH THE CODE BRACKETS!
_selfTransValues = _this select 1;
r_player_blood = (r_player_blood + (_selfTransValues select 0)) min r_player_bloodTotal;
if ((_selfTransValues select 1) < 0) then {
_TransfusionInfection = false;
} else {
_TransfusionInfection = ((random (_selfTransValues select 1)) < 1);
};
} else {
if ((r_player_blood + 500) >= r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;
player setVariable["USEC_BloodQty",r_player_bloodTotal,true];
} else {
r_player_blood = r_player_blood + 500;
player setVariable["USEC_BloodQty",r_player_blood,true];
};
if (((r_player_blood / r_player_bloodTotal) >= 0.35) and (r_player_lowblood)) then {
r_player_lowblood = false;
10 fadeSound 1;
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
player setVariable["USEC_lowBlood",false,true];
};
if (_TransfusionInfection) then {
r_player_infected = true;
@@ -30,6 +53,24 @@ if (_unit == player) then {
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1300;
_control ctrlShow true;
player setVariable["USEC_BloodQty",r_player_blood,true];
};
};
//If the players blood is equals too or aboue 12000 stop or if the blood mimic amount reaches 0 end the loop.
_blood = _unit getVariable ["USEC_BloodQty", 0];
//diag_log format["Player Blood %1 - %2, - %3, - %4",_blood,_unit,_medic,(_unit getVariable "USEC_BloodQty")];
if (_blood >= r_player_bloodTotal or _amount == 0) then {
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
r_doLoop = false;
};
if (r_interrupt) then {
cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"];
r_doLoop = false;
};
//Rerun the loop
sleep 1;
};

View File

@@ -1,6 +1,4 @@
// animHealed.sqf
private ["_array","_unit","_medic","_item"];
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;

View File

@@ -1,6 +1,5 @@
//noAnim.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "";

View File

@@ -1,9 +1,8 @@
// noDamage.sqf
private ["_unit"];
_unit = _this select 0;
_unit setCaptive 3;
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
_unit allowDamage false;
uiSleep 0.01;
sleep 0.01;

View File

@@ -1,6 +1,5 @@
// pickUp.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";

View File

@@ -1,6 +1,6 @@
// rolltoback.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "ainjppnemstpsnonwrfldnon_rolltoback";

View File

@@ -1,6 +1,6 @@
// rolltofront.sqf
private ["_unit"];
_unit = _this select 0;
_unit switchMove "ainjppnemstpsnonwrfldnon_rolltofront";

View File

@@ -1,6 +1,5 @@
//set180.sqf
private ["_dragee"];
_dragee = _this select 0;
_dragee setDir 180;

View File

@@ -1,56 +0,0 @@
private ["_started","_finished","_animState","_isMedic","_num_removed","_unit","_lastused","_timeout"];
if (!DZE_SelfTransfuse) exitWith {};
_unit = player;
_lastused = selfTransfusionTime;
_timeout = (DZE_selfTransfuse_Values select 2);
if ((round(time - _lastused)) <= _timeout) exitWith {cutText [format[(localize "str_actions_medical_18"),(_timeout - (round(time - _lastused)))] , "PLAIN DOWN"]};
call fnc_usec_medic_removeActions;
r_action = false;
if (vehicle player == player) then {
player playActionNow "Medic";
};
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
if (vehicle player != player) then {
uiSleep 6;
r_doLoop = false;
_finished = true;
};
uiSleep 0.1;
};
r_doLoop = false;
if (_finished) then {
selfTransfusionTime = time;
_unit setVariable["USEC_lowBlood",false,true];
_num_removed = ([player,"ItemBloodbag"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
if (vehicle player != player) then {
(findDisplay 106) closeDisplay 0;
};
[_unit, DZE_selfTransfuse_Values] call player_medTransfuse;
};
} else {
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
};

View File

@@ -1,3 +1,4 @@
if (!DZE_SelfTransfuse) exitWith {};
private ["_unit","_blood","_lowBlood","_injured","_inPain","_lastused","_animState","_started","_finished","_timer","_i","_isMedic","_isClose","_duration","_rhVal","_bloodBagArrayNeeded","_BBneeded","_bbselect","_bloodBagNeeded","_badBag","_wholeBag","_bagFound","_bagToRemove","_forceClose","_bloodType","_rh","_bloodBagArray","_bbarray_length","_bloodBagWholeNeeded","_haswholebag","_r"];
// bleed.sqf
_unit = _this select 0;
@@ -9,7 +10,7 @@ _injured = _unit getVariable ["USEC_injured", false];
_inPain = _unit getVariable ["USEC_inPain", false];
//_lastused = _unit getVariable ["LastTransfusion", time];
_lastused = selfTransfusionTime;
_timeout = (DZE_selfTransfuse_Values select 2);
_timeout = DZE_selfTransfuse_Values select 2;
if ((round(time - _lastused)) <= _timeout) exitWith {cutText [format[(localize "str_actions_medical_18"),(_timeout - (round(time - _lastused)))] , "PLAIN DOWN"]};
call gear_ui_init;
@@ -23,6 +24,7 @@ _wholeBag = false;
_bagFound = false;
_BBneeded = false;
_forceClose = false;
_TransfusionInfection = false;
if (_blood <= 4000) then {
@@ -39,8 +41,9 @@ if (_rh) then {_rhVal = "POS";} else {_rhVal = "NEG";};
//No subs for whole blood :(
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
_haswholebag = _bloodBagWholeNeeded in magazines player;
_hasUniversal = "ItemBloodbag" in magazines player;
if (_haswholebag) then {
if (_haswholebag or (!DZE_UseBloodTypes && _hasUniversal)) then {
_wholeBag = true;
} else {
_badBag = true;
@@ -69,7 +72,7 @@ while {r_doLoop and (_i < 12)} do {
if (_isMedic and !_started) then {
closeDialog 0;
//diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
if (_badBag) then {
for "_r" from 0 to 15 do {
_bagToRemove = _bagUsed;
@@ -81,7 +84,7 @@ while {r_doLoop and (_i < 12)} do {
};
};
} else {
if (_wholeBag) then {_bagToRemove = _bloodBagWholeNeeded; };
if (_wholeBag) then { _bagToRemove = if (!DZE_UseBloodTypes) then {"ItemBloodbag"} else {_bloodBagWholeNeeded}; };
if (_bagToRemove in magazines player) then { _bagFound = true; };
};
if (!_bagFound) then {_forceClose = true;} else { player removeMagazine _bagToRemove;};
@@ -101,8 +104,13 @@ while {r_doLoop and (_i < 12)} do {
r_player_blood = r_player_blood + 100 + _randomamount;
} else {
_randomamount = round(random 200);
if (DZE_SelfTransfuse) then {
r_player_blood = (r_player_blood + (DZE_selfTransfuse_Values select 0)) min r_player_bloodTotal;
_TransfusionInfection = if ((DZE_selfTransfuse_Values select 1) < 0) then {false} else {((random (DZE_selfTransfuse_Values select 1)) < 1)};
} else {
r_player_blood = r_player_blood + 800 + _randomamount;
};
};
//PVDZ_send = [_unit,"Transfuse",[_unit,player,1000]];
//publicVariableServer "PVDZ_send";
@@ -122,19 +130,19 @@ while {r_doLoop and (_i < 12)} do {
_blood = _unit getVariable ["USEC_BloodQty", 0];
if (((_blood >= r_player_bloodTotal) and !_badBag and _bagFound) or (_i == 12)) then {
//diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
selfTransfusionTime = time;
[_unit, DZE_selfTransfuse_Values] call player_medTransfuse;
if (_TransfusionInfection) then {r_player_infected = true; player setVariable["USEC_infected",true,true];};
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE;
[player,25] call player_humanityChange;
r_doLoop = false;
};
_isClose = ((player distance _unit) < ((sizeOf typeOf _unit) / 2));
if (r_interrupt or !_isClose or _forceClose) then {
//diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i]; cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"];
diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"];
[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_interrupted","PLAIN DOWN"] call RE;
r_doLoop = false;
};

View File

@@ -372,82 +372,3 @@ fnc_usec_damageBleed = {
deleteVehicle _source;
deleteVehicle _point;
};
//LEGACY BELOW HERE, LEFT IN FOR SCRIPTS THAT MAY REQUIRE THESE FUNCTIONS
fnc_usec_damageType = {
private["_damage","_ammo","_type"];
_damage = _this select 0;
_ammo = _this select 1;
_type = 0;
if ((_ammo isKindof "Grenade") || (_ammo isKindof "ShellBase") || (_ammo isKindof "TimeBombCore") || (_ammo isKindof "BombCore") || (_ammo isKindof "MissileCore") || (_ammo isKindof "RocketCore") || (_ammo isKindof "FuelExplosion") || (_ammo isKindof "GrenadeBase")) then {
_type = 1;
};
if ((_ammo isKindof "B_127x107_Ball") || (_ammo isKindof "B_127x99_Ball")) then {
_type = 2;
};
if (_ammo isKindof "Melee") then {
_type = 3;
};
_type;
};
fnc_usec_recoverUncons = {
player setVariable ["NORRN_unconscious",false,true];
player setVariable ["unconsciousTime",0,true];
player setVariable ["USEC_isCardiac",false,true];
// player setVariable["medForceUpdate",true,true];
r_player_unconscious = false;
r_player_cardiac = false;
r_player_handler1 = false;
uiSleep 1;
disableUserInput false;
if (vehicle player == player) then {
[objNull,player,rSwitchMove,"AinjPpneMstpSnonWnonDnon"] call RE;
player switchMove "AinjPpneMstpSnonWnonDnon";
player playMoveNow "AmovPpneMstpSnonWnonDnon_healed";
};
};
fnc_med_publicBlood = {
while {(r_player_injured || r_player_infected) && r_player_blood > 0} do {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
uiSleep 5;
};
};
fnc_usec_playerBleed = {
private ["_bleedTime","_bleedPerSec","_total","_bTime","_myBleedTime","_id"];
_bleedTime = 400; //seconds
_total = r_player_bloodTotal;
r_player_injured = true;
_myBleedTime = (random 300) + 30;
_bTime = 0;
while {r_player_injured} do {}
_bleedPerSec = 30;
// If kneeling || crawling reduce bleeding
if (dayz_isKneeling && !r_player_unconscious) then{
_bleedPerSec = 15;
};
if (dayz_isCrawling && !r_player_unconscious) then{
_bleedPerSec = 7.5;
};
//bleed out
if (r_player_blood > 0) then {
r_player_blood = r_player_blood - _bleedPerSec;
};
_bTime = _bTime + 1;
if (_bTime > _myBleedTime) then {
r_player_injured = false;
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
{player setVariable[_x,false,true];} count USEC_woundHit;
player setVariable ["USEC_injured",false,true];
};
uiSleep 1;
};
};

View File

@@ -108,7 +108,7 @@ while {r_doLoop} do {
if (_isMedic and !_started) then {
closeDialog 0;
//diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
if (_badBag) then {
for "_r" from 0 to 15 do {
//select random bloodbag if the player has more then one of the required types
@@ -188,7 +188,7 @@ while {r_doLoop} do {
_blood = _unit getVariable ["USEC_BloodQty", 0];
if (_blood >= r_player_bloodTotal or _bloodAmount == 0) then {
//diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
//see Note 1
//[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE;
@@ -199,7 +199,7 @@ while {r_doLoop} do {
_isClose = ((player distance _unit) < ((sizeOf typeOf _unit) / 2));
if (r_interrupt or !_isClose or _forceClose) then {
//diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"];
//see Note 1
//[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_interrupted","PLAIN DOWN"] call RE;

View File

@@ -1224,6 +1224,7 @@ class FSM
"_myAssets = getText(configFile >> ""CfgPatches"" >> ""dayz_communityassets"" >> ""dayzVersion"");" \n
"_mySfx = getNumber(configFile >> ""CfgPatches"" >> ""dayz_sfx"" >> ""dayzVersion"");" \n
"_myAnim = getNumber(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""dayzVersion"");" \n
"_myEpoch = getText(configFile >> ""CfgPatches"" >> ""dayz_epoch"" >> ""dayzVersion"");" \n
"_myEpochB = getText(configFile >> ""CfgPatches"" >> ""dayz_epoch_b"" >> ""dayzVersion"");" \n
"" \n
"/*" \n
@@ -1250,7 +1251,7 @@ class FSM
priority = 2.000000;
to="ERROR__Client_Files";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_myAnim != 1.8) || (_mySfx != 1.8) || (_myAssets != ""1.8.0.1"") || (_myEpochB != ""1.0.6"")"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_myAnim != 1.8) || (_mySfx != 1.8) || (_myAssets != ""1.8.0.1"") || (_myEpoch != ""1.0.4.2"") || (_myEpochB != ""1.0.6"")"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/

View File

@@ -370,12 +370,38 @@ while {1 == 1} do {
if (_startcombattimer == 1 || _PlayerNearby) then {
player setVariable["combattimeout", diag_tickTime + 30, false];
player setVariable["startcombattimer", 0, false];
dayz_combat = 1;
} else {
if (_ZedsNearby) then {
player setVariable["combattimeout", diag_tickTime + 10, false];
player setVariable["startcombattimer", 0, false];
dayz_combat = 1;
};
};
if (toLower DZE_UI != "vanilla") then {
_combattimeout = player getVariable["combattimeout",0];
if (_combattimeout > 0) then {
_timeleft = _combattimeout - time;
if (_timeleft > 0) then {
//hintSilent format["In Combat: %1",round(_timeleft)];
} else {
//hintSilent "Not in Combat";
player setVariable["combattimeout", 0, true];
dayz_combat = 0;
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
};
} else {
//hintSilent "Not in Combat";
dayz_combat = 0;
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
};
};
//setGroupIconsVisible [false,false];
//clearGroupIcons group player;

View File

@@ -132,7 +132,7 @@ server_hiveReadWrite = {
//diag_log ("ATTEMPT READ/WRITE: " + _key);
_data = "HiveExt" callExtension _key;
//diag_log ("READ/WRITE: " +str(_data));
_resultArray = call compile (str _data);
_resultArray = call compile _data;
_resultArray
};

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {

View File

@@ -16,7 +16,7 @@ dayz_POIs = true;
dayz_infectiousWaterholes = true;
//DayZMod presets
dayz_presets = "Vanilla"; //"Custom","Classic","Vanilla","Elite"
dayz_presets = "Custom"; //"Custom","Classic","Vanilla","Elite"
//Only need to edit if you are running a custom server.
if (dayz_presets == "Custom") then {