Merge branch 'experimental' of https://github.com/EpochModTeam/Epoch into experimental

This commit is contained in:
DirtySanchez
2017-10-19 20:39:16 -05:00
4 changed files with 22 additions and 19 deletions

View File

@ -1,5 +1,6 @@
// init // init
_forceBloodRise = false; _forceBloodRise = false;
_forceBloodDrop = false;
_forceFatigue = false; _forceFatigue = false;
_allowBloodDrop = false; _allowBloodDrop = false;
_forceStaminaDrop = false; _forceStaminaDrop = false;
@ -88,9 +89,13 @@ EPOCH_currentTargetMode = _currentTargetMode;
_curCtrl ctrlSetText _ctrlText; _curCtrl ctrlSetText _ctrlText;
_critical = (_criticalHigh || _criticalLow); _critical = (_criticalHigh || _criticalLow);
if (_critical) then { if (_critical) then {
if ((_criticalAttributes param [0,""]) isEqualType []) then {
_criticalAttributes = _criticalAttributes select _criticalLow;
};
_forceUpdate = "forceUpdate" in _criticalAttributes; _forceUpdate = "forceUpdate" in _criticalAttributes;
_forceFatigue = "forceFatigue" in _criticalAttributes; _forceFatigue = "forceFatigue" in _criticalAttributes;
_forceBloodRise = "forceBloodRise" in _criticalAttributes; _forceBloodRise = "forceBloodRise" in _criticalAttributes;
_forceBloodDrop = "forceBloodDrop" in _criticalAttributes;
[_curCtrl,0.55] call epoch_2DCtrlHeartbeat; [_curCtrl,0.55] call epoch_2DCtrlHeartbeat;
}; };
// todo make this reversable or even limited to a color range. // todo make this reversable or even limited to a color range.
@ -124,9 +129,9 @@ if (_forceFatigue) then {
if (_forceBloodRise) then { if (_forceBloodRise) then {
_playerBloodP = [_playerBloodPKey, 0.05, _playerBloodPMax , _playerBloodPMin] call EPOCH_fnc_setVariableLimited; _playerBloodP = [_playerBloodPKey, 0.05, _playerBloodPMax , _playerBloodPMin] call EPOCH_fnc_setVariableLimited;
} else { } else {
if (_allowBloodDrop) then { if (_allowBloodDrop || _forceBloodDrop) then {
// allow player to bleed out // allow player to bleed out or die from hypothermia
_lowerBPlimit = [100,0] select (isBleeding player); _lowerBPlimit = [100,0] select (isBleeding player || _forceBloodDrop);
_playerBloodP = [_playerBloodPKey, -1, _playerBloodPMax , _lowerBPlimit] call EPOCH_fnc_setVariableLimited; _playerBloodP = [_playerBloodPKey, -1, _playerBloodPMax , _lowerBPlimit] call EPOCH_fnc_setVariableLimited;
}; };
}; };

View File

@ -140,8 +140,6 @@ if ((getFatigue player) >= 0.7 && _airTemp > 100) then {
_maxTemp = _airTemp; _maxTemp = _airTemp;
}; };
// toxic fever and immunity increase // toxic fever and immunity increase
_playerToxicity = missionNamespace getVariable [_playerToxicityKey, _playerToxicityDefault]; _playerToxicity = missionNamespace getVariable [_playerToxicityKey, _playerToxicityDefault];
// _playerImmunity = missionNamespace getVariable [_playerImmunityKey, _playerImmunityDefault]; // _playerImmunity = missionNamespace getVariable [_playerImmunityKey, _playerImmunityDefault];
@ -202,11 +200,8 @@ _playerThirst = [_playerThirstKey,-_thirstlossRate,_playerThirstMax,_playerThirs
_playerNuisance = [_playerNuisanceKey,-1,_playerNuisanceMax,_playerNuisanceMin] call EPOCH_fnc_setVariableLimited; _playerNuisance = [_playerNuisanceKey,-1,_playerNuisanceMax,_playerNuisanceMin] call EPOCH_fnc_setVariableLimited;
// Radiation Handler // Radiation Handler
if (_radsLevel == 0) then { if (_radsLevel > 0) then {
// only lower rads if player has taken medicine and it no longer in a radiation zone. // increase rads based on radiation levels
_playerRadiation = [_playerRadiationKey,-0.01,_playerRadiationMax,_playerRadiationMin] call EPOCH_fnc_setVariableLimited;
} else {
// allow increase rads based on radiation levels and consumed rads
_playerRadiation = [_playerRadiationKey,_radsLevel,_playerRadiationMax,_playerRadiationMin] call EPOCH_fnc_setVariableLimited; _playerRadiation = [_playerRadiationKey,_radsLevel,_playerRadiationMax,_playerRadiationMin] call EPOCH_fnc_setVariableLimited;
}; };

View File

@ -125,11 +125,11 @@ class CfgEpochClient
{{"Oxygen","getPlayerOxygenRemaining","",{},{1,0,2,2,1,0.55}},"topRight","x\addons\a3_epoch_code\Data\UI\oxygen_ca.paa"}, {{"Oxygen","getPlayerOxygenRemaining","",{},{1,0,2,2,1,0.55}},"topRight","x\addons\a3_epoch_code\Data\UI\oxygen_ca.paa"},
{"Hunger","topRight","x\addons\a3_epoch_code\Data\UI\hunger_ca.paa",{"forceBloodRise"}}, {"Hunger","topRight","x\addons\a3_epoch_code\Data\UI\hunger_ca.paa",{"forceBloodRise"}},
{"Thirst","topRight","x\addons\a3_epoch_code\Data\UI\thirst_ca.paa",{"forceBloodRise"}}, {"Thirst","topRight","x\addons\a3_epoch_code\Data\UI\thirst_ca.paa",{"forceBloodRise"}},
{"Temp","topRight",{"x\addons\a3_epoch_code\Data\UI\hot_ca.paa","x\addons\a3_epoch_code\Data\UI\cold_ca.paa"},{"forceFatigue"}}, {"Temp","topRight",{"x\addons\a3_epoch_code\Data\UI\hot_ca.paa","x\addons\a3_epoch_code\Data\UI\cold_ca.paa"},{{"forceFatigue","forceBloodRise"},{"forceFatigue","forceBloodDrop"}}},
{"Toxicity","topRight","x\addons\a3_epoch_code\Data\UI\hazzard_ca.paa"}, {"Toxicity","topRight","x\addons\a3_epoch_code\Data\UI\hazzard_ca.paa",{"forceBloodRise"}},
{"Alcohol","topRight","x\addons\a3_epoch_code\Data\UI\drunk_ca.paa"}, {"Alcohol","topRight","x\addons\a3_epoch_code\Data\UI\drunk_ca.paa"},
{"Soiled","topRight","x\addons\a3_epoch_code\Data\UI\soiled_ca.paa"}, {"Soiled","topRight","x\addons\a3_epoch_code\Data\UI\soiled_ca.paa"},
{"Radiation","topRight","x\addons\a3_epoch_code\Data\UI\rads_ca.paa"}, {"Radiation","topRight","x\addons\a3_epoch_code\Data\UI\rads_ca.paa",{"forceBloodRise"}},
{{"HitPoints","getPlayerHitPointDamage","HitLegs"},"topRight","x\addons\a3_epoch_code\Data\UI\broken_ca.paa"} {{"HitPoints","getPlayerHitPointDamage","HitLegs"},"topRight","x\addons\a3_epoch_code\Data\UI\broken_ca.paa"}
}; };
defineCommunityStats[] = { defineCommunityStats[] = {

View File

@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_savePlayer.sqf https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_savePlayer.sqf
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_Svars","_allowSave","_appearance","_cIndex","_dmg","_extraLoadoutInfo","_group","_hitpoints","_loadout","_medical","_playerUID","_pos","_return","_return2","_revive","_schemaVersion","_server_vars","_stats","_vehiclePlyr"]; private ["_Svars","_allowSave","_appearance","_bloodPIndex","_bloodPressure","_group","_hitpoints","_loadout","_medical","_playerUID","_pos","_return","_return2","_revive","_schemaVersion","_server_vars","_stats","_vehiclePlyr"];
//[[[end]]] //[[[end]]]
params [["_player",objNull], ["_vars",[]] ]; params [["_player",objNull], ["_vars",[]] ];
@ -48,7 +48,7 @@ if (_allowSave) then{
private _serverOnly = ["Crypto"]; private _serverOnly = ["Crypto"];
_Svars = _player getVariable["VARS", call EPOCH_defaultVars_SEPXVar]; _Svars = _player getVariable["VARS", call EPOCH_defaultVars_SEPXVar];
{ {
_cIndex = EPOCH_customVars find _x; private _cIndex = EPOCH_customVars find _x;
if (_cIndex != -1) then{ if (_cIndex != -1) then{
_vars set[_cIndex, (_Svars select _cIndex)]; _vars set[_cIndex, (_Svars select _cIndex)];
}; };
@ -86,7 +86,7 @@ if (_allowSave) then{
// build medical array // build medical array
_medical = [getBleedingRemaining _player, 0, getOxygenRemaining _player, damage _player, _hitpoints]; _medical = [getBleedingRemaining _player, 0, getOxygenRemaining _player, damage _player, _hitpoints];
// appearance now handled with getUnitLoadout, typeof is still need to determine players class. // appearance now handled with getUnitLoadout, typeof is still needed to determine players class.
_appearance = ["", "", "", "", currentWeapon _player, typeOf _player]; _appearance = ["", "", "", "", currentWeapon _player, typeOf _player];
// new save format // new save format
@ -102,9 +102,12 @@ if (_allowSave) then{
_stats = _player getVariable["COMMUNITY_STATS", EPOCH_defaultStatVars]; _stats = _player getVariable["COMMUNITY_STATS", EPOCH_defaultStatVars];
_return2 = ["CommunityStats", _playerUID, EPOCH_expiresCommunityStats, [_stats]] call EPOCH_fnc_server_hiveSETEX; _return2 = ["CommunityStats", _playerUID, EPOCH_expiresCommunityStats, [_stats]] call EPOCH_fnc_server_hiveSETEX;
// kill player if blood pressure >= 180 // blood pressure must stay within 11-179 range
if (_vars select 12 >= 180) then { _bloodPIndex = EPOCH_customVars find "BloodP";
_bloodPressure = _vars param [_bloodPIndex,100];
if (_bloodPressure >= 180 || _bloodPressure <= 10) then {
_player setDamage 1; _player setDamage 1;
["PlayerStats", _playerUID, 0, 1] call EPOCH_fnc_server_hiveSETBIT;
} else { } else {
// set player alive bit // set player alive bit
["PlayerStats", _playerUID, 0, 0] call EPOCH_fnc_server_hiveSETBIT; ["PlayerStats", _playerUID, 0, 0] call EPOCH_fnc_server_hiveSETBIT;