overheating: Replace calls to core for calls to common

This commit is contained in:
Nicolás Badano 2015-01-13 00:30:39 -03:00
parent 1db298722b
commit a53a265117
7 changed files with 20 additions and 20 deletions

View File

@ -19,7 +19,7 @@ class CfgPatches {
class ACE_Core_Default_Keys { class ACE_Core_Default_Keys {
class clearJam { class clearJam {
displayName = "$STR_ACE_Overheating_UnjamWeapon"; displayName = "$STR_ACE_Overheating_UnjamWeapon";
condition = QUOTE( [_player] call EFUNC(core,canUseWeapon) && {currentWeapon _player in (_player getVariable [QUOTE(QGVAR(jammedWeapons)), []])} ); condition = QUOTE( [_player] call EFUNC(common,canUseWeapon) && {currentWeapon _player in (_player getVariable [QUOTE(QGVAR(jammedWeapons)), []])} );
statement = QUOTE( [_player, currentMuzzle _player, false] call FUNC(clearJam); ); statement = QUOTE( [_player, currentMuzzle _player, false] call FUNC(clearJam); );
key = 19; key = 19;
shift = 1; shift = 1;

View File

@ -17,7 +17,7 @@ _this spawn {
// Calculate cooling // Calculate cooling
_temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown); _temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown);
["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(core,log); ["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log);
// Store new temperature // Store new temperature
_time = time; _time = time;
@ -46,7 +46,7 @@ _this spawn {
for "_a" from 1 to _count do { for "_a" from 1 to _count do {
_string = _string + "|"; _string = _string + "|";
}; };
_text = [_string, _color] call EFUNC(core,stringToColoredText); _text = [_string, _color] call EFUNC(common,stringToColoredText);
_string = ""; _string = "";
for "_a" from (_count + 1) to 12 do { for "_a" from (_count + 1) to 12 do {
@ -55,10 +55,10 @@ _this spawn {
_text = composeText [ _text = composeText [
_text, _text,
[_string, [0.5, 0.5, 0.5]] call EFUNC(core,stringToColoredTex)t [_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredTex)t
]; ];
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[_text, _picture] call EFUNC(core,displayTextPicture); [_text, _picture] call EFUNC(common,displayTextPicture);
}; };

View File

@ -18,7 +18,7 @@ if (_weapon in _jammedWeapons) then {
private "_id"; private "_id";
_id = _unit getVariable [QGVAR(JammingActionID), -1]; _id = _unit getVariable [QGVAR(JammingActionID), -1];
[_unit, "DefaultAction", _id] call EFUNC(core,removeActionEventHandler); [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler);
_unit setVariable [QGVAR(JammingActionID), -1]; _unit setVariable [QGVAR(JammingActionID), -1];
}; };
@ -34,5 +34,5 @@ if (_weapon in _jammedWeapons) then {
_unit playActionNow _clearJamAction; _unit playActionNow _clearJamAction;
}; };
[localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(core,displayTextStructured); [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
}; };

View File

@ -29,7 +29,7 @@ _unit setVariable [QGVAR(jammedWeapons), _jammedWeapons];
waitUntil {_frame < diag_frameno}; waitUntil {_frame < diag_frameno};
_unit setAmmo [_weapon, _ammo]; _unit setAmmo [_weapon, _ammo];
//[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(core,displayTextStructured); //[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured);
}; };
}; };
@ -40,7 +40,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {
private ["_condition", "_statement", "_condition2", "_statement2", "_id"]; private ["_condition", "_statement", "_condition2", "_statement2", "_id"];
_condition = { _condition = {
[_this select 1] call EFUNC(core,canUseWeapon) [_this select 1] call EFUNC(common,canUseWeapon)
&& {currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(jammedWeapons), []])} && {currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(jammedWeapons), []])}
&& {!(currentMuzzle (_this select 1) in ((_this select 1) getVariable [QEGVAR(safemode,safedWeapons), []]))} && {!(currentMuzzle (_this select 1) in ((_this select 1) getVariable [QEGVAR(safemode,safedWeapons), []]))}
}; };
@ -49,7 +49,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {
playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0]; playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0];
if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0}) then { if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0}) then {
[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(core,displayTextStructured); [localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured);
GVAR(knowAboutJam) = true; GVAR(knowAboutJam) = true;
}; };
}; };
@ -62,8 +62,8 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {
[_this select 1, currentWeapon (_this select 1), false] call FUNC(clearJam); [_this select 1, currentWeapon (_this select 1), false] call FUNC(clearJam);
}; };
//_id = [_unit, format ["<t color=""#FFFF00"" >%1</t>", localize "STR_ACE_Overheating_UnjamWeapon"], "DefaultAction", _condition, _statement, _condition2, _statement2, 10] call EFUNC(core,addActionMenuEventHandler); //_id = [_unit, format ["<t color=""#FFFF00"" >%1</t>", localize "STR_ACE_Overheating_UnjamWeapon"], "DefaultAction", _condition, _statement, _condition2, _statement2, 10] call EFUNC(common,addActionMenuEventHandler);
_id = [_unit, "DefaultAction", _condition, _statement] call EFUNC(core,addActionEventHandler); _id = [_unit, "DefaultAction", _condition, _statement] call EFUNC(common,addActionEventHandler);
_unit setVariable [QGVAR(JammingActionID), _id]; _unit setVariable [QGVAR(JammingActionID), _id];
}; };

View File

@ -102,7 +102,7 @@ _dispersion = getArray (configFile >> "CfgWeapons" >> _weapon >> "ACE_Overheatin
_count = count _dispersion; _count = count _dispersion;
if (_count > 0) then { if (_count > 0) then {
_dispersion = ([_dispersion, (_count - 1) * _scaledTemperature] call EFUNC(core,interpolateFromArray)) max 0; _dispersion = ([_dispersion, (_count - 1) * _scaledTemperature] call EFUNC(common,interpolateFromArray)) max 0;
} else { } else {
_dispersion = 0; _dispersion = 0;
}; };
@ -111,12 +111,12 @@ _slowdownFactor = getArray (configFile >> "CfgWeapons" >> _weapon >> "ACE_Overhe
_count = count _slowdownFactor; _count = count _slowdownFactor;
if (_count > 0) then { if (_count > 0) then {
_slowdownFactor = ([_slowdownFactor, (_count - 1) * _scaledTemperature] call EFUNC(core,interpolateFromArray)) max 0; _slowdownFactor = ([_slowdownFactor, (_count - 1) * _scaledTemperature] call EFUNC(common,interpolateFromArray)) max 0;
} else { } else {
_slowdownFactor = 1; _slowdownFactor = 1;
}; };
[_projectile, _dispersion - 2 * random _dispersion, _dispersion - 2 * random _dispersion, (_slowdownFactor - 1) * vectorMagnitude _velocity] call EFUNC(core,changeProjectileDirection); [_projectile, _dispersion - 2 * random _dispersion, _dispersion - 2 * random _dispersion, (_slowdownFactor - 1) * vectorMagnitude _velocity] call EFUNC(common,changeProjectileDirection);
// jamming // jamming
@ -130,7 +130,7 @@ if (_count == 0) then {
_count = 1; _count = 1;
}; };
_jamChance = [_jamChance, (_count - 1) * _scaledTemperature] call EFUNC(core,interpolateFromArray); _jamChance = [_jamChance, (_count - 1) * _scaledTemperature] call EFUNC(common,interpolateFromArray);
// increase jam chance on dusty grounds if prone // increase jam chance on dusty grounds if prone
if (stance _unit == "PRONE") then { if (stance _unit == "PRONE") then {
@ -148,7 +148,7 @@ if ("Jam" in (missionNamespace getvariable ["ACE_Debug", []])) then {
_jamChance = 0.5; _jamChance = 0.5;
}; };
["Overheating", [_temperature, _jamChance], {format ["Temperature: %1 - JamChance: %2", _this select 0, _this select 1]}] call EFUNC(core,log); ["Overheating", [_temperature, _jamChance], {format ["Temperature: %1 - JamChance: %2", _this select 0, _this select 1]}] call EFUNC(common,log);
if (random 1 < _jamChance) then { if (random 1 < _jamChance) then {
[_unit, _weapon] call FUNC(jamWeapon); [_unit, _weapon] call FUNC(jamWeapon);

View File

@ -7,10 +7,10 @@ _player = _this select 0;
_weapon = _this select 1; _weapon = _this select 1;
if (stance _player != "PRONE") then { if (stance _player != "PRONE") then {
[_player, "amovpknlmstpsraswrfldnon", 1] call EFUNC(core,doAnimation); [_player, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation);
}; };
_player playActionNow "GestureDismountMuzzle"; _player playActionNow "GestureDismountMuzzle";
_player playAction "GestureMountMuzzle"; _player playAction "GestureMountMuzzle";
playSound "ACE_BarrelSwap"; playSound "ACE_BarrelSwap";
[10, [_player, _weapon], QFUNC(swapBarrelCallback), localize "STR_ACE_Overheating_SwappingBarrel"] call EFUNC(core,progressBar); [10, [_player, _weapon], QFUNC(swapBarrelCallback), localize "STR_ACE_Overheating_SwappingBarrel"] call EFUNC(common,progressBar);

View File

@ -9,6 +9,6 @@ _weapon = _this select 1;
// don't consume the barrel, but rotate through them. // don't consume the barrel, but rotate through them.
//player removeItem "ACE_SpareBarrel"; //player removeItem "ACE_SpareBarrel";
[localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHOF(UI\spare_barrel_ca.paa))] call EFUNC(core,displayTextPicture); [localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture);
_player setVariable [format [QGVAR(%1), _weapon], [0, 0], false]; _player setVariable [format [QGVAR(%1), _weapon], [0, 0], false];