mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
energy fixes
This commit is contained in:
parent
18dd7a5d80
commit
bbd958ed52
@ -22,7 +22,7 @@
|
|||||||
NOTHING
|
NOTHING
|
||||||
*/
|
*/
|
||||||
//[[[cog import generate_private_arrays ]]]
|
//[[[cog import generate_private_arrays ]]]
|
||||||
private ["_allowedSnapObjects","_allowedSnapPoints","_cfgBaseBuilding","_class","_create","_currentTarget","_dir2","_direction","_disallowed","_distance","_distanceMod","_distanceNear","_energyCost","_isSnap","_lastCheckTime","_maxHeight","_nearestObject","_nearestObjectRaw","_newObj","_objSlot","_objType","_object","_oemType","_offset","_onContactEH","_pOffset","_playerdistance","_pos2","_prevSnapDistance","_previousDistanceNear","_rejectMove","_return","_simulClassConfig","_snapArrayPara","_snapArrayPerp","_snapDistance","_snapObjects","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPosition","_snapType","_textureSlot","_up2","_vel2","_velocityTransformation","_worldspace"];
|
private ["_allowedSnapObjects","_allowedSnapPoints","_cfgBaseBuilding","_class","_create","_currentTarget","_dir2","_direction","_disallowed","_distance","_distanceMod","_distanceNear","_energyCost","_isSnap","_lastCheckTime","_maxHeight","_nearestObject","_nearestObjectRaw","_newObj","_objSlot","_objType","_object","_oemType","_offset","_onContactEH","_pOffset","_playerEnergy","_playerEnergyKeyFinal","_playerdistance","_pos2","_prevSnapDistance","_previousDistanceNear","_rejectMove","_return","_simulClassConfig","_snapArrayPara","_snapArrayPerp","_snapDistance","_snapObjects","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPosition","_snapType","_textureSlot","_up2","_vel2","_velocityTransformation","_worldspace"];
|
||||||
//[[[end]]]
|
//[[[end]]]
|
||||||
|
|
||||||
if !(isNil "EPOCH_simulSwap_Lock") exitWith{};
|
if !(isNil "EPOCH_simulSwap_Lock") exitWith{};
|
||||||
@ -34,7 +34,11 @@ _objType = typeOf _object;
|
|||||||
|
|
||||||
_isSnap = false;
|
_isSnap = false;
|
||||||
|
|
||||||
if (EPOCH_playerEnergy <= 0) exitWith {
|
_playerEnergyKeyFinal = "EPOCH_playerEnergy";
|
||||||
|
if !(isNil "_playerEnergyKey") then {_playerEnergyKeyFinal = _playerEnergyKey};
|
||||||
|
_playerEnergy = missionNamespace getVariable [_playerEnergyKeyFinal,[]];
|
||||||
|
|
||||||
|
if (_playerEnergy <= 0) exitWith {
|
||||||
["Need Energy", 5] call Epoch_message;
|
["Need Energy", 5] call Epoch_message;
|
||||||
};
|
};
|
||||||
if !(_object call EPOCH_isBuildAllowed) exitWith{};
|
if !(_object call EPOCH_isBuildAllowed) exitWith{};
|
||||||
@ -106,7 +110,8 @@ if (isText(_simulClassConfig)) then {
|
|||||||
EPOCH_Z_OFFSET = _offset select 2;
|
EPOCH_Z_OFFSET = _offset select 2;
|
||||||
_lastCheckTime = diag_tickTime;
|
_lastCheckTime = diag_tickTime;
|
||||||
while {EPOCH_target == _currentTarget} do {
|
while {EPOCH_target == _currentTarget} do {
|
||||||
if (EPOCH_playerEnergy <= 0) exitWith { EPOCH_target = objNull; };
|
_playerEnergy = missionNamespace getVariable [_playerEnergyKeyFinal,[]];
|
||||||
|
if (_playerEnergy <= 0) exitWith { EPOCH_target = objNull; };
|
||||||
_rejectMove = false;
|
_rejectMove = false;
|
||||||
if ((diag_tickTime - _lastCheckTime) > 10) then {
|
if ((diag_tickTime - _lastCheckTime) > 10) then {
|
||||||
_lastCheckTime = diag_tickTime;
|
_lastCheckTime = diag_tickTime;
|
||||||
@ -226,7 +231,7 @@ if (isText(_simulClassConfig)) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
EPOCH_playerEnergy = (EPOCH_playerEnergy - _energyCost) max 0;
|
[_playerEnergyKeyFinal, -_energyCost, 2500 , 0] call EPOCH_fnc_setVariableLimited;
|
||||||
uiSleep 0.1;
|
uiSleep 0.1;
|
||||||
};
|
};
|
||||||
_currentTarget removeEventHandler["EpeContactStart", _onContactEH];
|
_currentTarget removeEventHandler["EpeContactStart", _onContactEH];
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
NOTHING
|
NOTHING
|
||||||
*/
|
*/
|
||||||
//[[[cog import generate_private_arrays ]]]
|
//[[[cog import generate_private_arrays ]]]
|
||||||
private ["_AnchorPos","_EPOCH_1","_EPOCH_2","_MoveObject","_Snapdirection","_allowedSnapObjects","_allowedSnapPoints","_arr_snapPoints","_baselineSnapPos","_cfgBaseBuilding","_class","_currentOffSet","_currentPos","_currentTarget","_currentTargetAttachedTo","_dir2","_direction","_distance","_energyCost","_helper","_ins","_isSnap","_lastCheckTime","_maxHeight","_maxSnapDistance","_nearestObject","_nearestObjects","_newDirAndUp","_numberOfContacts","_objSlot","_objType","_offSet","_offsetZPos","_pOffset","_pos1_snap","_pos2","_pos2ATL","_pos2_snap","_pos_snapObj","_rejectMove","_simulClass","_snapChecks","_snapConfig","_snapDistance","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPos1","_snapPosition","_snapType","_snapped","_stabilityCheck","_worldspace","_snapMemoryPoint","_vectorDir","_vectorUp","_tempClass","_newDir"];
|
private ["_AnchorPos","_EPOCH_1","_EPOCH_2","_MoveObject","_Snapdirection","_allowedSnapObjects","_allowedSnapPoints","_arr_snapPoints","_baselineSnapPos","_cfgBaseBuilding","_class","_currentOffSet","_currentPos","_currentTarget","_currentTargetAttachedTo","_dir2","_direction","_distance","_energyCost","_helper","_ins","_isSnap","_lastCheckTime","_maxHeight","_maxSnapDistance","_nearestObject","_nearestObjects","_newDir","_newDirAndUp","_numberOfContacts","_objSlot","_objType","_offSet","_offsetZPos","_pOffset","_playerEnergy","_playerEnergyKeyFinal","_pos1_snap","_pos2","_pos2ATL","_pos2_snap","_pos_snapObj","_rejectMove","_simulClass","_snapChecks","_snapConfig","_snapDistance","_snapMemoryPoint","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPos1","_snapPosition","_snapType","_snapped","_stabilityCheck","_tempClass","_tiltFB","_tiltLR","_vectorDir","_vectorUp","_worldspace"];
|
||||||
//[[[end]]]
|
//[[[end]]]
|
||||||
if !(isNil "EPOCH_simulSwap_Lock") exitWith{};
|
if !(isNil "EPOCH_simulSwap_Lock") exitWith{};
|
||||||
|
|
||||||
@ -37,7 +37,11 @@ if (isNull _object) exitWith{ EPOCH_target = objNull; };
|
|||||||
// exit if item is not given
|
// exit if item is not given
|
||||||
if (_item == "") exitWith{ EPOCH_target = objNull; };
|
if (_item == "") exitWith{ EPOCH_target = objNull; };
|
||||||
|
|
||||||
if (EPOCH_playerEnergy <= 0) exitWith{
|
_playerEnergyKeyFinal = "EPOCH_playerEnergy";
|
||||||
|
if !(isNil "_playerEnergyKey") then {_playerEnergyKeyFinal = _playerEnergyKey};
|
||||||
|
_playerEnergy = missionNamespace getVariable [_playerEnergyKeyFinal,[]];
|
||||||
|
|
||||||
|
if (_playerEnergy <= 0) exitWith{
|
||||||
["Need Energy", 5] call Epoch_message;
|
["Need Energy", 5] call Epoch_message;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -172,7 +176,7 @@ if (_class != "") then {
|
|||||||
_EPOCH_1 = diag_tickTime;
|
_EPOCH_1 = diag_tickTime;
|
||||||
if !(isNull EPOCH_target) then {
|
if !(isNull EPOCH_target) then {
|
||||||
_nearestObjects = nearestObjects[EPOCH_target, _allowedSnapObjects, 12];
|
_nearestObjects = nearestObjects[EPOCH_target, _allowedSnapObjects, 12];
|
||||||
["EPOCH_playerEnergy", -_energyCost, 5000 , 0] call EPOCH_fnc_setVariableLimited;
|
[_playerEnergyKeyFinal, -_energyCost, 2500 , 0] call EPOCH_fnc_setVariableLimited;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if !(_currentTargetAttachedTo isequalto EPOCH_target_attachedTo) then {
|
if !(_currentTargetAttachedTo isequalto EPOCH_target_attachedTo) then {
|
||||||
|
@ -26,12 +26,14 @@
|
|||||||
BOOL
|
BOOL
|
||||||
*/
|
*/
|
||||||
//[[[cog import generate_private_arrays ]]]
|
//[[[cog import generate_private_arrays ]]]
|
||||||
private ["_adj","_currentPos","_handled","_playerStaminaKeyFinal","_step"];
|
private ["_adj","_currentPos","_handled","_playerEnergy","_playerEnergyKeyFinal","_playerStaminaKeyFinal","_step"];
|
||||||
//[[[end]]]
|
//[[[end]]]
|
||||||
params ["_display","_dikCode","_shift","_ctrl","_alt"];
|
params ["_display","_dikCode","_shift","_ctrl","_alt"];
|
||||||
|
|
||||||
_playerStaminaKeyFinal = "EPOCH_playerStamina";
|
_playerStaminaKeyFinal = "EPOCH_playerStamina";
|
||||||
|
_playerEnergyKeyFinal = "EPOCH_playerEnergy";
|
||||||
if !(isNil "_playerStaminaKey") then {_playerStaminaKeyFinal = _playerStaminaKey};
|
if !(isNil "_playerStaminaKey") then {_playerStaminaKeyFinal = _playerStaminaKey};
|
||||||
|
if !(isNil "_playerEnergyKey") then {_playerEnergyKeyFinal = _playerEnergyKey};
|
||||||
|
|
||||||
_handled = false;
|
_handled = false;
|
||||||
|
|
||||||
@ -253,7 +255,8 @@ if (_dikCode in (actionKeys "TacticalView")) then {
|
|||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
if (_dikCode in (actionKeys "NightVision")) then {
|
if (_dikCode in (actionKeys "NightVision")) then {
|
||||||
if (EPOCH_playerEnergy == 0) then {
|
_playerEnergy = missionNamespace getVariable [_playerEnergyKeyFinal,[]];
|
||||||
|
if (_playerEnergy == 0) then {
|
||||||
["Night Vision Goggles: Need Energy", 5] call Epoch_message;
|
["Night Vision Goggles: Need Energy", 5] call Epoch_message;
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
|
@ -57,7 +57,9 @@ class CfgClientFunctions
|
|||||||
class countdown {};
|
class countdown {};
|
||||||
class fnc_SelectTargetBuild {};
|
class fnc_SelectTargetBuild {};
|
||||||
class isBuildAllowed {};
|
class isBuildAllowed {};
|
||||||
class simulSwap {};
|
class simulSwap {
|
||||||
|
customHeader = 1;
|
||||||
|
};
|
||||||
class staticMove {
|
class staticMove {
|
||||||
customHeader = 1;
|
customHeader = 1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user