-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from gruppe-adler/blackforest-improvements
Blackforest II improvements
- Loading branch information
Showing
136 changed files
with
6,861 additions
and
2,046 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,6 @@ | ||
#include "component.hpp" | ||
|
||
_this spawn { | ||
params ["_configName","_winText","_winners","_winTextParams"]; | ||
private ["_winText","_winners","_winTextParams"]; | ||
params [["_winners",[]]]; | ||
|
||
if (isNil "_winText") then { | ||
_winText = [missionConfigFile >> "CfgWinConditions" >> _configName,"winText",""] call BIS_fnc_returnConfigEntry; | ||
}; | ||
if (isNil "_winners") then { | ||
_winners = ([missionConfigFile >> "CfgWinConditions" >> _configName,"winners",[]] call BIS_fnc_returnConfigEntry) apply {call compile _x}; | ||
}; | ||
private _winTextParams = ([missionConfigFile >> "CfgWinConditions" >> _configName,"winTextParams",[]] call BIS_fnc_returnConfigEntry) apply {call compile _x}; | ||
|
||
_winText = "<img size= '6' style='vertical-align:middle' shadow='false' image='data\gruppe-adler.paa'/><br/><t size='.9' color='#FFFFFF'>" + _winText + "</t>"; | ||
|
||
_text = format ([_winText] + _winTextParams); | ||
[_text,0,0,4,2] spawn BIS_fnc_dynamicText; | ||
|
||
INFO_3("%1 %2 %3",_winText,_text,_winners); | ||
|
||
sleep 5; | ||
|
||
if (({[_x] call grad_points_fnc_getPoints > 0} count [WEST,EAST,INDEPENDENT,CIVILIAN]) > 0) then { | ||
[] call grad_points_fnc_displayPoints; | ||
sleep 16; | ||
}; | ||
|
||
["end1",playerSide in _winners,true,true,true] spawn BIS_fnc_endMission; | ||
}; | ||
waitUntil {missionNamespace getVariable ["REPLAY_FINISHED",false]}; | ||
["end1",playerSide in _winners,true,true,true] spawn BIS_fnc_endMission; |
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,9 +1,38 @@ | ||
#include "component.hpp" | ||
|
||
params ["_configName","_winText","_winners","_winTextParams"]; | ||
|
||
if (missionNamespace getVariable ["grad_endings_endingInProgress",false]) exitWith {}; | ||
missionNamespace setVariable ["grad_endings_endingInProgress",true]; | ||
INFO_1("Ending %1 in progress.",_configName); | ||
|
||
[_configName,_winText,_winners,_winTextParams] remoteExec ["grad_endings_fnc_endMissionClient",0,false]; | ||
_this spawn { | ||
params ["_configName","_winText","_winners","_winTextParams"]; | ||
private ["_winText","_winners","_winTextParams"]; | ||
|
||
INFO_1("Ending %1 in progress.",_configName); | ||
|
||
if (isNil "_winText") then { | ||
_winText = [missionConfigFile >> "CfgWinConditions" >> _configName,"winText",""] call BIS_fnc_returnConfigEntry; | ||
}; | ||
if (isNil "_winners") then { | ||
_winners = ([missionConfigFile >> "CfgWinConditions" >> _configName,"winners",[]] call BIS_fnc_returnConfigEntry) apply {call compile _x}; | ||
}; | ||
_winTextParams = ([missionConfigFile >> "CfgWinConditions" >> _configName,"winTextParams",[]] call BIS_fnc_returnConfigEntry) apply {call compile _x}; | ||
|
||
_winText = "<img size= '6' style='vertical-align:middle' shadow='false' image='data\gruppe-adler.paa'/><br/><t size='.9' color='#FFFFFF'>" + _winText + "</t>"; | ||
|
||
_text = format ([_winText] + _winTextParams); | ||
|
||
// show end title | ||
[_text,0,0,4,2] remoteExec ["BIS_fnc_dynamicText",0,false]; | ||
INFO_3("%1 %2 %3",_winText,_text,_winners); | ||
sleep 5; | ||
|
||
// show points | ||
if (({[_x] call grad_points_fnc_getPoints > 0} count [WEST,EAST,INDEPENDENT,CIVILIAN]) > 0) then { | ||
[] remoteExecCall ["grad_points_fnc_displayPoints",0,false]; | ||
sleep 16; | ||
}; | ||
|
||
// show replay | ||
[] call GRAD_replay_fnc_stopRecord; | ||
[_winners] remoteExec ["grad_endings_fnc_endMissionClient",0,false]; | ||
}; |
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,45 +1,68 @@ | ||
#include "component.hpp" | ||
#define PLAYABLE_UNITS (playableUnits + switchableUnits) | ||
|
||
params ["_winName","_sides"]; | ||
_sides = _sides apply {call compile _x}; | ||
params ["_winName","_sides",["_isRecursion",false],["_taskID","taskElimination"]]; | ||
|
||
private _winners = [missionConfigFile >> "CfgWinConditions" >> _winName, "winners",[]] call BIS_fnc_returnConfigEntry; | ||
_winners = _winners apply {call compile _x}; | ||
|
||
//CREATE TASK ================================================================== | ||
private _taskID = "taskElimination"; | ||
{_taskID = _taskID + "_w" + str _x} forEach _winners; | ||
{_taskID = _taskID + "_l" + str _x} forEach _sides; | ||
if (!_isRecursion) then { | ||
_sides = _sides apply {call compile _x}; | ||
|
||
private _taskDesc = format ["Eliminate all players of side %1",[_sides select 0] call grad_common_fnc_getSideDisplayName]; | ||
_winners = [missionConfigFile >> "CfgWinConditions" >> _winName, "winners",[]] call BIS_fnc_returnConfigEntry; | ||
_winners = _winners apply {call compile _x}; | ||
|
||
//CREATE TASK ================================================================== | ||
{_taskID = _taskID + "_w" + str _x} forEach _winners; | ||
{_taskID = _taskID + "_l" + str _x} forEach _sides; | ||
|
||
_taskDesc = format ["Eliminate all players of side %1",[_sides select 0] call grad_common_fnc_getSideDisplayName]; | ||
{ | ||
if (_forEachIndex > 0) then { | ||
_taskDesc = _taskDesc + "and " + ([_x] call grad_common_fnc_getSideDisplayName); | ||
}; | ||
} forEach _sides; | ||
_taskDesc = _taskDesc + "."; | ||
|
||
[_taskID,_winners,[_taskDesc,"Eliminate Enemies",""],objNull,"AUTOASSIGNED",3,true,true,"kill"] call BIS_fnc_setTask; | ||
}; | ||
|
||
//PFH ========================================================================== | ||
private _respawningPlayersArrays = []; | ||
{ | ||
if (_forEachIndex > 0) then { | ||
_taskDesc = _taskDesc + "and " + ([_x] call grad_common_fnc_getSideDisplayName); | ||
_array = switch (_x) do { | ||
case (WEST): {waitingPlayersBlu}; | ||
case (EAST): {waitingPlayersOpf}; | ||
case (INDEPENDENT): {waitingPlayersInd}; | ||
default {[]}; | ||
}; | ||
_respawningPlayersArrays pushBack _array; | ||
} forEach _sides; | ||
_taskDesc = _taskDesc + "."; | ||
|
||
[_taskID,_winners,[_taskDesc,"Eliminate Enemies",""],objNull,"AUTOASSIGNED",3,true,true,"kill"] call BIS_fnc_setTask; | ||
private _fnc_check = [ | ||
{ | ||
{(side _x) in _sides} count playableUnits == 0 | ||
}, | ||
{ | ||
{(side _x) in _sides} count playableUnits == 0 && | ||
{{({!isNull _x} count _x) > 0} count _respawningPlayersArrays == 0} | ||
} | ||
] select (([missionConfigFile >> "missionsettings","waveRespawnEnabled",0] call BIS_fnc_returnConfigEntry) == 1); | ||
|
||
//PFH ========================================================================== | ||
[{ | ||
params ["_args","_handle"]; | ||
_args params ["_winName","_sides","_taskID"]; | ||
_args params ["_winName","_sides","_taskID","_fnc_check","_respawningPlayersArrays"]; | ||
|
||
if ({_side = _x; ({side _x == _side} count PLAYABLE_UNITS) > 0} count _sides == 0) exitWith { | ||
if (call _fnc_check) exitWith { | ||
|
||
[{ | ||
params ["_winName","_sides","_taskID"]; | ||
if ({_side = _x; ({side _x == _side} count PLAYABLE_UNITS) > 0} count _sides == 0) then { | ||
params ["_winName","_sides","_taskID","_fnc_check","_respawningPlayersArrays"]; | ||
if (call _fnc_check) then { | ||
|
||
[_taskID,"SUCCEEDED",true] call BIS_fnc_taskSetState; | ||
[_winName] call grad_endings_fnc_endMissionServer; | ||
} else { | ||
_this call grad_endings_fnc_presetElimination; | ||
[_winName,_sides,true,_taskID] call grad_endings_fnc_presetElimination; | ||
}; | ||
}, [_winName,_sides,_taskID], 10] call CBA_fnc_waitAndExecute; | ||
}, [_winName,_sides,_taskID,_fnc_check,_respawningPlayersArrays], 10] call CBA_fnc_waitAndExecute; | ||
|
||
[_handle] call CBA_fnc_removePerFrameHandler; | ||
}; | ||
},10,[_winName,_sides,_taskID]] call CBA_fnc_addPerFrameHandler; | ||
},10,[_winName,_sides,_taskID,_fnc_check,_respawningPlayersArrays]] call CBA_fnc_addPerFrameHandler; |
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "component.hpp" | ||
|
||
params ["_deadPlayer",["_deadPlayerSide", sideUnknown],["_add",true]]; | ||
|
||
if (isNil QGVAR(waitingPlayersBlu)) then {GVAR(waitingPlayersBlu) = []}; | ||
if (isNil QGVAR(waitingPlayersOpf)) then {GVAR(waitingPlayersOpf) = []}; | ||
if (isNil QGVAR(waitingPlayersInd)) then {GVAR(waitingPlayersInd) = []}; | ||
|
||
//add player to array | ||
private _array = switch (_deadPlayerSide) do { | ||
case (WEST): {GVAR(waitingPlayersBlu)}; | ||
case (EAST): {GVAR(waitingPlayersOpf)}; | ||
case (INDEPENDENT): {GVAR(waitingPlayersInd)}; | ||
default {[]}; | ||
}; | ||
|
||
if (_add) then { | ||
_array pushBackUnique _deadPlayer | ||
} else { | ||
_id = _array find _deadPlayer; | ||
while {_id >= 0} do { | ||
_array deleteAt _id; | ||
_id = _array find _deadPlayer; | ||
}; | ||
}; | ||
|
||
[_deadPlayerSide] call FUNC(checkEnoughForWave); |
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,34 +1,32 @@ | ||
#include "component.hpp" | ||
|
||
params ["_deadPlayerName", ["_deadPlayerSide", sideUnknown]]; | ||
params ["_deadPlayer", ["_deadPlayerSide", sideUnknown]]; | ||
|
||
if (isNil "deadPlayersBlu") then {deadPlayersBlu = []}; | ||
if (isNil "deadPlayersOpf") then {deadPlayersOpf = []}; | ||
if (isNil "deadPlayersInd") then {deadPlayersInd = []}; | ||
|
||
_deadPlayerName = [_deadPlayerName] call BIS_fnc_filterString; | ||
if (isNil QGVAR(wavePlayersBlu)) then {GVAR(wavePlayersBlu) = []}; | ||
if (isNil QGVAR(wavePlayersOpf)) then {GVAR(wavePlayersOpf) = []}; | ||
if (isNil QGVAR(wavePlayersInd)) then {GVAR(wavePlayersInd) = []}; | ||
|
||
//add player to array | ||
switch (_deadPlayerSide) do { | ||
case (WEST): { | ||
deadPlayersBlu pushBackUnique _deadPlayerName; | ||
INFO_2("Added player %1 to deadPlayersBlu. %2 dead blufor total.", _deadPlayerName, count deadPlayersBlu); | ||
WAVERESPAWNPLAYERSLEFTBLU = BLUFORWAVESIZE - (count deadPlayersBlu); | ||
publicVariable "WAVERESPAWNPLAYERSLEFTBLU"; | ||
GVAR(wavePlayersBlu) pushBackUnique _deadPlayer; | ||
INFO_2("Added player %1 to wavePlayersBlu. %2 dead blufor total.", _deadPlayer, count GVAR(wavePlayersBlu)); | ||
GVAR(WAVERESPAWNPLAYERSLEFTBLU) = GVAR(BLUFORWAVESIZE) - (count GVAR(wavePlayersBlu)); | ||
publicVariable QGVAR(WAVERESPAWNPLAYERSLEFTBLU); | ||
}; | ||
case (EAST): { | ||
deadPlayersOpf pushBackUnique _deadPlayerName; | ||
INFO_2("Added player %1 to deadPlayersOpf. %2 dead opfor total.", _deadPlayerName, count deadPlayersOpf); | ||
WAVERESPAWNPLAYERSLEFTOPF = OPFORWAVESIZE - (count deadPlayersOpf); | ||
publicVariable "WAVERESPAWNPLAYERSLEFTOPF"; | ||
GVAR(wavePlayersOpf) pushBackUnique _deadPlayer; | ||
INFO_2("Added player %1 to wavePlayersOpf. %2 dead opfor total.", _deadPlayer, count GVAR(wavePlayersOpf)); | ||
GVAR(WAVERESPAWNPLAYERSLEFTOPF) = GVAR(OPFORWAVESIZE) - (count GVAR(wavePlayersOpf)); | ||
publicVariable QGVAR(WAVERESPAWNPLAYERSLEFTOPF); | ||
}; | ||
case (INDEPENDENT): { | ||
deadPlayersInd pushBackUnique _deadPlayerName; | ||
INFO_2("Added player %1 to deadPlayersOpf. %2 dead opfor total.", _deadPlayerName, count deadPlayersInd); | ||
WAVERESPAWNPLAYERSLEFTIND = INDEPWAVESIZE - (count deadPlayersInd); | ||
publicVariable "WAVERESPAWNPLAYERSLEFTIND"; | ||
GVAR(wavePlayersInd) pushBackUnique _deadPlayer; | ||
INFO_2("Added player %1 to wavePlayersOpf. %2 dead opfor total.", _deadPlayer, count GVAR(wavePlayersInd)); | ||
GVAR(WAVERESPAWNPLAYERSLEFTIND) = GVAR(INDEPWAVESIZE) - (count GVAR(wavePlayersInd)); | ||
publicVariable QGVAR(WAVERESPAWNPLAYERSLEFTIND); | ||
}; | ||
default { | ||
ERROR_1("Unknown side for player %1", _deadPlayerName); | ||
ERROR_1("Unknown side for player %1", _deadPlayer); | ||
}; | ||
}; |
Oops, something went wrong.