-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c21a60
commit e074e55
Showing
14 changed files
with
212 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
PREP(attackProfile_DRAGON); | ||
PREP(canPickupTripod); | ||
PREP(onFired); | ||
PREP(onDisassemble); | ||
PREP(canDeployWeapon); | ||
PREP(sightAttach); | ||
PREP(sightCanAttach); | ||
PREP(sightCanDetach); | ||
PREP(sightDetach); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "script_component.hpp" | ||
|
||
[QGVAR(detachSight), LINKFUNC(sightDetach)] call CBA_fnc_addEventHandler; | ||
[QGVAR(attachSight), LINKFUNC(sightAttach)] call CBA_fnc_addEventHandler; | ||
|
||
["vehicle", { | ||
params ["","_vehicle"]; | ||
TRACE_2("vehicle change",_vehicle,typeOf _vehicle); | ||
if (!(_vehicle isKindOf QGVAR(staticBase))) exitWith {}; | ||
|
||
_vehicle animate ["rest_rotate", 0]; | ||
|
||
if (isNil QGVAR(pfID)) then {GVAR(pfID) = -1}; | ||
[GVAR(pfID)] call CBA_fnc_removePerFrameHandler; | ||
|
||
private _lastView = cameraView; | ||
if (!(_lastView in ["INTERNAL", "EXTERNAL"])) then { _lastView == "INTERNAL"; }; | ||
|
||
GVAR(pfID) = [{ | ||
params ["_args"]; | ||
(_this select 0) params ["_vehicle", "_lastView"]; | ||
|
||
if ((!alive _vehicle) || {!alive ACE_player} || {(vehicle ACE_player) != _vehicle}) exitWith { | ||
TRACE_1("exiting PFEH",GVAR(pfID)); | ||
[GVAR(pfID)] call CBA_fnc_removePerFrameHandler; | ||
if ((!isNull _vehicle) && {!alive (gunner _vehicle)}) then { | ||
TRACE_1("reseting rest anim",gunner _vehicle); | ||
_vehicle animate ["rest_rotate", -0.35]; | ||
}; | ||
}; | ||
|
||
if (cameraView in ["INTERNAL", "EXTERNAL"]) then { | ||
_args set [1, cameraView]; | ||
} else { | ||
if ((cameraOn == _vehicle) && {!(_vehicle getVariable [QGVAR(sightAttached), ((typeOf _vehicle) == QGVAR(staticAssembled))])}) then { | ||
_vehicle switchCamera _lastView; | ||
}; | ||
}; | ||
}, 0, [_vehicle, _lastView]] call CBA_fnc_addPerFrameHandler; | ||
TRACE_1("started PFEH",GVAR(pfID)); | ||
}, true] call CBA_fnc_addPlayerEventHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: Brandon (TCVM) | ||
* Attaches the sighting unit to the Dragon missile. | ||
* | ||
* Arguments: | ||
* 0: Target <OBJECT> | ||
* 1: Unit Performing Action <OBJECT> | ||
* | ||
* Return Value: | ||
* Can Attach Sighting Unit <BOOL> | ||
* | ||
* Example: | ||
* [cursorObject, player] call ace_dragon_fnc_sightAttach | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_target", "_unit", ["_event", false]]; | ||
TRACE_3("sightAttach",_target,_unit,_event); | ||
|
||
if (_event isEqualTo true) then { | ||
if (!(_target turretLocal [0])) exitWith {}; | ||
_target setVariable [QGVAR(sightAttached), true, true]; | ||
_target animate ["optic_hide", 0]; | ||
_target addWeapon QGVAR(superStatic); | ||
_target removeWeapon QGVAR(dummyStatic); | ||
TRACE_2("added sight",_target weaponsTurret [0],_target animationPhase "optic_hide"); | ||
} else { | ||
_unit removeWeapon QGVAR(sight); | ||
[QGVAR(attachSight), [_target, _unit, true]] call CBA_fnc_globalEvent; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: Brandon (TCVM) | ||
* Determines if you can attach the sighting unit to the Dragon missile. | ||
* | ||
* Arguments: | ||
* 0: Target <OBJECT> | ||
* 1: Unit Performing Action <OBJECT> | ||
* | ||
* Return Value: | ||
* Can Attach Sighting Unit <BOOL> | ||
* | ||
* Example: | ||
* [cursorObject, player] call ace_dragon_fnc_sightCanAttach | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_target", "_unit"]; | ||
|
||
(alive _target) | ||
// && {!(_target getVariable [QGVAR(fired), false])} | ||
&& {!(_target getVariable [QGVAR(sightAttached), ((typeOf _target) == QGVAR(staticAssembled))])} | ||
&& {QGVAR(sight) in (weapons _unit)} |
Oops, something went wrong.