Skip to content

Commit

Permalink
Merge pull request #2 from diwako/zen_support
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuel authored Jul 1, 2019
2 parents 673aade + 728b10a commit d6b8869
Show file tree
Hide file tree
Showing 9 changed files with 2,197 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
release/*
releases/*
*.cache
*.pbo
texHeaders.bin
Expand Down
1 change: 1 addition & 0 deletions addons/api/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PREP(attachAresFunctions);
PREP(attachZenFunctions);
PREP(fog);
PREP(init);
PREP(registerZone);
Expand Down
69 changes: 69 additions & 0 deletions addons/api/functions/fnc_attachZenFunctions.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include "script_component.hpp"


if (!hasInterface || {RETDEF(GVAR(zen),false)} || {isNil "zen_custom_modules_fnc_register"}) exitWith {false};
GVAR(zen) = true;
private _cat = "FP Zombies";

[_cat, "Create zone", {
params ["_pos"];

private _opt1 = [-1, 10, 20, 30, fpz_defaultDensity];
private _opt2 = [20, 50, 100, 200, 300, 500];
private _opt3 = [-1, 5, 10, 20, 30, 50];

["Create zone settings", [
["COMBO", "Density", [_opt1, ["Infinite (respawning)"] + (_opt1 select [1, count _opt1] apply {str _x + " zombies"})]],
["COMBO", "Size of zone", [_opt2, _opt2 apply {str _x + "m"}, 2]],
["COMBO", "Max active zombies in zone", [_opt3, ["None (distance based)"] + (_opt3 select [1, count _opt3] apply {str _x})]]
], {
params ["_dialog", "_args"];
_dialog params ["_density", "_radius", "_maxActive"];
_args params ["_pos"];

([_pos, "AREA:", [_radius, _radius, 0, true]] call CBA_fnc_createTrigger) params ["_trigger"];
[_trigger, _density, -1, -1, _maxActive] remoteExecCall [QFUNC(registerZone), 2];
}, {}, [_pos]] call zen_dialog_fnc_create;
}] call zen_custom_modules_fnc_register;

[_cat, "Spawn wandering", {
params ["_pos"];

private _opt1 = [1, 5, 10, 15, 20];
private _opt2 = [5, 10, 20, 50, 100, 200];

["Spawn wandering zombies", [
["COMBO", "Amount", [_opt1, _opt1 apply {str _x + " zombies"}, 1]],
["COMBO", "Random radius", [_opt2, _opt2 apply {str _x + "m"}, 0]]
], {
params ["_dialog", "_args"];
_dialog params ["_amount", "_radius"];
_args params ["_pos"];
for "_i" from 1 to _amount do {
private _z = [] call EFUNC(zombies,spawnZombie);
if (!isNull _z) then {
private _rpos = [_pos, _radius] call CBA_fnc_randPos;
[_z, _rpos] call EFUNC(zombies,zombieInit);
};
};
}, {}, [_pos]] call zen_dialog_fnc_create;
}] call zen_custom_modules_fnc_register;

[_cat, "Spawn horde", {
params ["_pos"];

private _opt1 = [5, 10, 15, 20];
["Spawn zombie horde", [
["COMBO", "Amount", [_opt1, _opt1 apply {str _x + " zombies"}, 0]],
["CHECKBOX", "Spawn yell"],
["CHECKBOX", "Force spawn (ignore max zed)"]
], {
params ["_dialog", "_args"];
_dialog params ["_amount", "_sound", "_ignoreMaxZombies"];
_args params ["_pos"];

[_pos, _amount, _sound, _ignoreMaxZombies] call FUNC(spawnHorde);
}, {}, [_pos]] call zen_dialog_fnc_create;
}] call zen_custom_modules_fnc_register;

true
1 change: 1 addition & 0 deletions addons/api/functions/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GVAR(initialized) = true;
#include "default_settings.sqf"

[] call FUNC(attachAresFunctions);
[] call FUNC(attachZenFunctions);

[EFUNC(zombies,zombiePfh), 0] call CBA_fnc_addPerFrameHandler;
[{
Expand Down
22 changes: 22 additions & 0 deletions hemtt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "2",
"name": "fpz",
"prefix": "fpz",
"author": "FP Mod Team",
"modname": "fpz",
"keyname": "fpz_v{{version}}",
"signame": "fpz_v{{version}}",
"files": [
"mod.cpp",
"AUTHORS.txt",
"LICENSE",
"logo_ca.paa",
"README.md"
],
"reuse_private_key": false,
"exclude": [
"*.psd",
"*.png",
"*.tga"
]
}
Loading

0 comments on commit d6b8869

Please sign in to comment.