mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3.git
This commit is contained in:
commit
465ae0bbfe
@ -1,80 +0,0 @@
|
|||||||
class CfgPatches {
|
|
||||||
class AGM_Backblast {
|
|
||||||
units[] = {};
|
|
||||||
weapons[] = {};
|
|
||||||
requiredVersion = 0.60;
|
|
||||||
requiredAddons[] = {AGM_Core};
|
|
||||||
version = "0.95";
|
|
||||||
versionStr = "0.95";
|
|
||||||
versionAr[] = {0,95,0};
|
|
||||||
author[] = {"commy2", "KoffeinFlummi"};
|
|
||||||
authorUrl = "https://github.com/commy2/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class CfgFunctions {
|
|
||||||
class AGM_Backblast {
|
|
||||||
class AGM_Backblast {
|
|
||||||
file = "\AGM_Backblast\functions";
|
|
||||||
class getDistance;
|
|
||||||
class launcherBackblast;
|
|
||||||
class tankDangerZone;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class Extended_FiredNear_EventHandlers {
|
|
||||||
class CAManBase {
|
|
||||||
class AGM_FiredNear_LauncherBackblast {
|
|
||||||
FiredNear = "if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 3 >> 'AGM_Backblast_Damage') > 0}) then {_this call AGM_Backblast_fnc_launcherBackblast}";
|
|
||||||
};
|
|
||||||
class AGM_FiredNear_TankDangerZone {
|
|
||||||
FiredNear = "if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 3 >> 'AGM_DangerZone_Damage') > 0}) then {_this call AGM_Backblast_fnc_tankDangerZone}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class CfgWeapons {
|
|
||||||
|
|
||||||
class LauncherCore;
|
|
||||||
class Launcher: LauncherCore {
|
|
||||||
AGM_Backblast_Angle = 60;
|
|
||||||
AGM_Backblast_Range = 10;
|
|
||||||
AGM_Backblast_Damage = 0.7;
|
|
||||||
};
|
|
||||||
class Launcher_Base_F: Launcher {};
|
|
||||||
|
|
||||||
class launch_Titan_base: Launcher_Base_F {
|
|
||||||
AGM_Backblast_Angle = 40;
|
|
||||||
AGM_Backblast_Range = 8;
|
|
||||||
AGM_Backblast_Damage = 0.5;
|
|
||||||
};
|
|
||||||
class launch_Titan_short_base: launch_Titan_base {
|
|
||||||
AGM_Backblast_Angle = 40;
|
|
||||||
AGM_Backblast_Range = 8;
|
|
||||||
AGM_Backblast_Damage = 0.5;
|
|
||||||
};
|
|
||||||
|
|
||||||
class launch_NLAW_F: Launcher_Base_F {
|
|
||||||
AGM_Backblast_Angle = 40;
|
|
||||||
AGM_Backblast_Range = 5;
|
|
||||||
AGM_Backblast_Damage = 0.6;
|
|
||||||
};
|
|
||||||
class launch_RPG32_F: Launcher_Base_F {
|
|
||||||
AGM_Backblast_Angle = 60;
|
|
||||||
AGM_Backblast_Range = 15;
|
|
||||||
AGM_Backblast_Damage = 0.7;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CannonCore;
|
|
||||||
class cannon_120mm: CannonCore {
|
|
||||||
AGM_DangerZone_Angle = 90;
|
|
||||||
AGM_DangerZone_Range = 50;
|
|
||||||
AGM_DangerZone_Damage = 0.85;
|
|
||||||
};
|
|
||||||
class mortar_155mm_AMOS: CannonCore {
|
|
||||||
AGM_DangerZone_Angle = 90;
|
|
||||||
AGM_DangerZone_Range = 60;
|
|
||||||
AGM_DangerZone_Damage = 1;
|
|
||||||
};
|
|
||||||
};
|
|
1
addons/backblast/$PBOPREFIX$
Normal file
1
addons/backblast/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
|||||||
|
z\ace\addons\backblast
|
17
addons/backblast/CfgEventHandlers.hpp
Normal file
17
addons/backblast/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_FiredNear_EventHandlers {
|
||||||
|
class CAManBase {
|
||||||
|
class GVAR(LauncherBackblast) {
|
||||||
|
FiredNear = QUOTE( if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 3 >> 'ACE_Backblast_Damage') > 0}) then {_this call FUNC(launcherBackblast)} );
|
||||||
|
};
|
||||||
|
class GVAR(TankDangerZone) {
|
||||||
|
FiredNear = QUOTE( if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 3 >> 'ACE_DangerZone_Damage') > 0}) then {_this call FUNC(tankDangerZone)} );
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
44
addons/backblast/CfgWeapons.hpp
Normal file
44
addons/backblast/CfgWeapons.hpp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
class CfgWeapons {
|
||||||
|
|
||||||
|
class LauncherCore;
|
||||||
|
class Launcher: LauncherCore {
|
||||||
|
ACE_Backblast_Angle = 60;
|
||||||
|
ACE_Backblast_Range = 10;
|
||||||
|
ACE_Backblast_Damage = 0.7;
|
||||||
|
};
|
||||||
|
class Launcher_Base_F: Launcher {};
|
||||||
|
|
||||||
|
class launch_Titan_base: Launcher_Base_F {
|
||||||
|
ACE_Backblast_Angle = 40;
|
||||||
|
ACE_Backblast_Range = 8;
|
||||||
|
ACE_Backblast_Damage = 0.5;
|
||||||
|
};
|
||||||
|
class launch_Titan_short_base: launch_Titan_base {
|
||||||
|
ACE_Backblast_Angle = 40;
|
||||||
|
ACE_Backblast_Range = 8;
|
||||||
|
ACE_Backblast_Damage = 0.5;
|
||||||
|
};
|
||||||
|
|
||||||
|
class launch_NLAW_F: Launcher_Base_F {
|
||||||
|
ACE_Backblast_Angle = 40;
|
||||||
|
ACE_Backblast_Range = 5;
|
||||||
|
ACE_Backblast_Damage = 0.6;
|
||||||
|
};
|
||||||
|
class launch_RPG32_F: Launcher_Base_F {
|
||||||
|
ACE_Backblast_Angle = 60;
|
||||||
|
ACE_Backblast_Range = 15;
|
||||||
|
ACE_Backblast_Damage = 0.7;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CannonCore;
|
||||||
|
class cannon_120mm: CannonCore {
|
||||||
|
ACE_DangerZone_Angle = 90;
|
||||||
|
ACE_DangerZone_Range = 50;
|
||||||
|
ACE_DangerZone_Damage = 0.85;
|
||||||
|
};
|
||||||
|
class mortar_155mm_AMOS: CannonCore {
|
||||||
|
ACE_DangerZone_Angle = 90;
|
||||||
|
ACE_DangerZone_Range = 60;
|
||||||
|
ACE_DangerZone_Damage = 1;
|
||||||
|
};
|
||||||
|
};
|
5
addons/backblast/XEH_preInit.sqf
Normal file
5
addons/backblast/XEH_preInit.sqf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
PREP(getDistance);
|
||||||
|
PREP(launcherBackblast);
|
||||||
|
PREP(tankDangerZone);
|
17
addons/backblast/config.cpp
Normal file
17
addons/backblast/config.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
units[] = {};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
requiredAddons[] = {"ace_common"};
|
||||||
|
author[] = {"commy2", "KoffeinFlummi"};
|
||||||
|
authorUrl = "https://github.com/commy2/";
|
||||||
|
VERSION_CONFIG;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
|
||||||
|
#include "CfgWeapons.hpp"
|
@ -1,4 +1,5 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_position", "_direction", "_maxDistance", "_distance", "_iteration", "_laser", "_line"];
|
private ["_position", "_direction", "_maxDistance", "_distance", "_iteration", "_laser", "_line"];
|
||||||
|
|
@ -1,22 +1,23 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
_firer = _this select 1;
|
_firer = _this select 1;
|
||||||
_distance = _this select 2;
|
_distance = _this select 2;
|
||||||
_weapon = _this select 3;
|
_weapon = _this select 3;
|
||||||
|
|
||||||
if (vehicle _unit != _unit || {!([_firer] call AGM_Core_fnc_isPlayer)}) exitWith {};
|
if (vehicle _unit != _unit || {!([_firer] call EFUNC(common,isPlayer))}) exitWith {};
|
||||||
|
|
||||||
_backblastAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> "AGM_Backblast_Angle") / 2;
|
_backblastAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Backblast_Angle") / 2;
|
||||||
_backblastRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> "AGM_Backblast_Range");
|
_backblastRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Backblast_Range");
|
||||||
_backblastDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> "AGM_Backblast_Damage");
|
_backblastDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Backblast_Damage");
|
||||||
|
|
||||||
_position = eyePos _firer;
|
_position = eyePos _firer;
|
||||||
_direction = _firer weaponDirection currentWeapon _firer;
|
_direction = _firer weaponDirection currentWeapon _firer;
|
||||||
|
|
||||||
if (_unit == _firer) then {
|
if (_unit == _firer) then {
|
||||||
_distance = [_position, _direction, _backblastRange] call AGM_Backblast_fnc_getDistance;
|
_distance = [_position, _direction, _backblastRange] call FUNC(getDistance);
|
||||||
|
hint format ["%1", _distance];
|
||||||
if (_distance < _backblastRange) then {
|
if (_distance < _backblastRange) then {
|
||||||
_alpha = sqrt (1 - _distance / _backblastRange);
|
_alpha = sqrt (1 - _distance / _backblastRange);
|
||||||
_beta = sqrt 0.5;
|
_beta = sqrt 0.5;
|
||||||
@ -24,11 +25,13 @@ if (_unit == _firer) then {
|
|||||||
_damage = 2 * _alpha * _beta * _backblastDamage;
|
_damage = 2 * _alpha * _beta * _backblastDamage;
|
||||||
[_damage * 100] call BIS_fnc_bloodEffect;
|
[_damage * 100] call BIS_fnc_bloodEffect;
|
||||||
|
|
||||||
if (isClass (configFile >> "CfgPatches" >> "AGM_Medical")) then {
|
// TODO: Sort this interaction with medical
|
||||||
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call AGM_Medical_fnc_handleDamage)] call AGM_Medical_fnc_setHitPointDamage;
|
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then {
|
||||||
|
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
|
||||||
} else {
|
} else {
|
||||||
_unit setDamage (damage _unit + _damage);
|
_unit setDamage (damage _unit + _damage);
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_direction = [0, 0, 0] vectorDiff _direction;
|
_direction = [0, 0, 0] vectorDiff _direction;
|
||||||
@ -52,16 +55,18 @@ if (_unit == _firer) then {
|
|||||||
_beta = sqrt (1 - _angle / _backblastAngle);
|
_beta = sqrt (1 - _angle / _backblastAngle);
|
||||||
|
|
||||||
_damage = 2 * _alpha * _beta * _backblastDamage;
|
_damage = 2 * _alpha * _beta * _backblastDamage;
|
||||||
if (_unit == AGM_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
|
if (_unit == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
|
||||||
|
|
||||||
if (isClass (configFile >> "CfgPatches" >> "AGM_Medical")) then {
|
// TODO: Sort this interaction with medical
|
||||||
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call AGM_Medical_fnc_handleDamage)] call AGM_Medical_fnc_setHitPointDamage;
|
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then {
|
||||||
|
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
|
||||||
_unit spawn {
|
_unit spawn {
|
||||||
sleep 0.5;
|
sleep 0.5;
|
||||||
[_this, "", 0, objNull, objNull] call AGM_Medical_fnc_handleDamage;
|
[_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_unit setDamage (damage _unit + _damage);
|
_unit setDamage (damage _unit + _damage);
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
@ -1,4 +1,5 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define BARREL_MUZZLE "usti hlavne"
|
#define BARREL_MUZZLE "usti hlavne"
|
||||||
|
|
||||||
@ -7,11 +8,11 @@ _vehicle = vehicle (_this select 1);
|
|||||||
_distance = _this select 2;
|
_distance = _this select 2;
|
||||||
_weapon = _this select 3;
|
_weapon = _this select 3;
|
||||||
|
|
||||||
if (vehicle _unit != _unit || {!([gunner _firer] call AGM_Core_fnc_isPlayer)}) exitWith {};
|
if (vehicle _unit != _unit || {!([gunner _firer] call EFUNC(common,isPlayer))}) exitWith {};
|
||||||
|
|
||||||
_dangerZoneAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> "AGM_DangerZone_Angle") / 2;
|
_dangerZoneAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_DangerZone_Angle") / 2;
|
||||||
_dangerZoneRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> "AGM_DangerZone_Range");
|
_dangerZoneRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_DangerZone_Range");
|
||||||
_dangerZoneDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> "AGM_DangerZone_Damage");
|
_dangerZoneDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_DangerZone_Damage");
|
||||||
|
|
||||||
_position = ATLToASL (_vehicle modelToWorld (_vehicle selectionPosition BARREL_MUZZLE));
|
_position = ATLToASL (_vehicle modelToWorld (_vehicle selectionPosition BARREL_MUZZLE));
|
||||||
_direction = _vehicle weaponDirection _weapon;
|
_direction = _vehicle weaponDirection _weapon;
|
||||||
@ -36,16 +37,18 @@ if (_unit != _vehicle) then {
|
|||||||
_beta = sqrt (1 - _angle / _dangerZoneAngle);
|
_beta = sqrt (1 - _angle / _dangerZoneAngle);
|
||||||
|
|
||||||
_damage = 2 * _alpha * _beta * _dangerZoneDamage;
|
_damage = 2 * _alpha * _beta * _dangerZoneDamage;
|
||||||
if (_unit == AGM_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
|
if (_unit == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
|
||||||
|
|
||||||
if (isClass (configFile >> "CfgPatches" >> "AGM_Medical")) then {
|
// TODO: Sort this interaction with medical
|
||||||
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call AGM_Medical_fnc_handleDamage)] call AGM_Medical_fnc_setHitPointDamage;
|
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then {
|
||||||
|
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
|
||||||
_unit spawn {
|
_unit spawn {
|
||||||
sleep 0.5;
|
sleep 0.5;
|
||||||
[_this, "", 0, objNull, objNull] call AGM_Medical_fnc_handleDamage;
|
[_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_unit setDamage (damage _unit + _damage);
|
_unit setDamage (damage _unit + _damage);
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
1
addons/backblast/functions/script_component.hpp
Normal file
1
addons/backblast/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "\z\ace\addons\backblast\script_component.hpp"
|
12
addons/backblast/script_component.hpp
Normal file
12
addons/backblast/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#define COMPONENT backblast
|
||||||
|
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_BACKBLAST
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_BACKBLAST
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_BACKBLAST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\Addons\main\script_macros.hpp"
|
@ -1,4 +1,5 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_wall = _this select 0;
|
_wall = _this select 0;
|
||||||
|
|
||||||
@ -8,5 +9,5 @@ if (local _wall) then {
|
|||||||
_paper attachTo [_wall, [0,-0.02,0.6]];
|
_paper attachTo [_wall, [0,-0.02,0.6]];
|
||||||
_paper setDir getDir _wall;
|
_paper setDir getDir _wall;
|
||||||
|
|
||||||
_paper setObjectTextureGlobal [0, "\AGM_Ballistics\textures\target_ca.paa"];
|
_paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))];
|
||||||
};
|
};
|
||||||
|
1
addons/ballistics/scripts/script_component.hpp
Normal file
1
addons/ballistics/scripts/script_component.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "\z\ace\addons\ballistics\script_component.hpp"
|
Loading…
Reference in New Issue
Block a user