Add loot, damageEV and killedEV for mutants

This commit is contained in:
A Man
2021-08-26 11:49:59 +02:00
parent 451b02cda6
commit d5656fb48b
9 changed files with 70 additions and 10 deletions

View File

@@ -0,0 +1,30 @@
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
local _mutant = _this select 0;
local _selection = _this select 1;
local _damage = _this select 2;
local _hitter = _this select 3;
local _projectile = _this select 4;
if (_projectile in MeleeAmmo) then {
_damage = _damage * 5;
};
if (local _mutant) then {
if (_damage > 1 && _projectile != "") then {
//diag_log format["0: %1, 1: %2, 2: %3, 3: %4, 4: %5",_mutant,_selection,_damage,_hitter,_projectile];
if (_projectile isKindOf "Bolt") then {
local _damageOrg = _hitter getVariable["firedDamage",0]; //_unit getVariable["firedSelection",_selection];
if (_damageOrg < _damage) then {
_hitter setVariable["firedHit",[_mutant,_selection],true];
_hitter setVariable["firedDamage",_damage,true];
};
};
};
};
// all "HandleDamage event" functions should return the effective damage that the engine will record
_damage

View File

@@ -0,0 +1,14 @@
//[unit, killer]
//will only run when local to the created object
//record any key hits to the required selection
local _array = _this;
local _mutant = _array select 0;
local _killer = _array select 1;
if (local _mutant && isPlayer _killer) then {
//increase players humanity when mutant killed
local _humanity = _killer getVariable["humanity",0];
_humanity = _humanity + DZE_MutantHumanity;
_killer setVariable["humanity",_humanity,true];
};

View File

@@ -1,10 +1,12 @@
#include "\z\addons\dayz_code\loot\Loot.hpp"
// Select random position between 50 and 100 meters away from the building.
local _pos = [_this, 50, 100, 1] call fn_selectRandomLocation;
if (surfaceIsWater _pos) exitWith { diag_log "Mutant_Generate: Location is in water...abort"; };
// Create mutant
_agent = createAgent ["z_bloodsucker", _pos, [], 0, "NONE"];
local _agent = createAgent ["z_bloodsucker", _pos, [], 0, "NONE"];
_agent setDir (random 360);
_agent setPosATL _pos;
@@ -13,4 +15,10 @@ dayz_spawnBloodsuckers = dayz_spawnBloodsuckers + 1;
dayz_CurrentNearBloodsuckers = dayz_CurrentNearBloodsuckers + 1;
dayz_currentGlobalBloodsuckers = dayz_currentGlobalBloodsuckers + 1;
//Add some loot
if (0.4 > random 1) then {
local _lootGroup = Loot_GetGroup("Bloodsucker");
Loot_Insert(_agent, _lootGroup, 1);
};
//diag_log format ["Bloodsucker Counts: Current local - %1, Current near - %2, Current global - %3",dayz_spawnBloodsuckers,dayz_CurrentNearBloodsuckers,dayz_currentGlobalBloodsuckers];