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

@@ -59,7 +59,8 @@ class CfgLoot
#include "Groups\Zombies\Prisoner.hpp" //DZE
#include "Groups\Zombies\Hero.hpp" //DZE
#include "Groups\Zombies\Bandit.hpp" //DZE
};
#include "Groups\Zombies\Bloodsucker.hpp" //DZE
};
class Buildings
{

View File

@@ -0,0 +1,4 @@
Bloodsucker[] =
{
{Loot_MAGAZINE, 1, ItemZombieParts}
};

View File

@@ -8,7 +8,6 @@ class z_bloodsucker : Zed_Base {
//hiddenSelectionsTextures[] = {};
fsmDanger = "";
fsmFormation = "";
//zombieLoot = "bloodsucker";
moves = "CfgMovesBloodsucker";
isMan = false;
weapons[] = {};
@@ -20,15 +19,15 @@ class z_bloodsucker : Zed_Base {
languages[] = {};
armor = 46;
damageScale = 250;
sepsisChance = 0;
BleedChance = 10; // Maybe this should be higher
sepsisChance = 20;
BleedChance = 35;
forcedSpeed = 6; // Left here to prevent errors in player_zombieCheck
class Eventhandlers {
init = "[(_this select 0)] execFSM ""\z\AddOns\dayz_code\system\mutant_agent.fsm""";
local = "_z = _this select 0; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [_z,true] execFSM '\z\AddOns\dayz_code\system\mutant_agent.fsm';";
//HandleDamage = "_this call local_zombieDamage;";
//Killed = "[_this,'zombieKills'] call local_eventKill;";
HandleDamage = "_this call mutant_damageHandler;";
Killed = "_this call mutant_eventKill;";
};
class UserActions

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];

View File

@@ -163,6 +163,7 @@ if (!isDedicated) then {
DZE_DisabledChannels = [(localize "str_channel_side"),(localize "str_channel_global"),(localize "str_channel_command")]; //List of disabled voice channels. Other channels are: "str_channel_group","str_channel_direct","str_channel_vehicle"
DZE_NutritionDivisor = [1, 1, 1, 1]; //array of DIVISORS that regulate the rate of [calories, thirst, hunger, temperature] use when "working" (keep in mind that temperature raises with actions) - min values 0.1 - Larger values slow the effect, smaller values accelerate it
DZE_ZombieSpeed = [0,0]; //Default agro speed is 6 per zombie config, set array elements 0 and 1 the same for non-variable speed, set to 0 to disable. array format = [min, max]; Ex: [2, 6]; results in a range of speed between 2 and 6 (2 is the old DZE_slowZombies hard-coded speed)
DZE_ZombieHumanity = 5;
DZE_lockablesHarderPenalty = true; // Enforce an exponential wait on attempts between unlocking a safe/lockbox from a failed code.
DZE_Hide_Body = true; //Enable hide dead bodies. Hiding a dead body removes the corpse marker from the map too. Default = true
DZE_PVE_Mode = false; //Disable the PvP damage on the server. If DZE_BackpackAntiTheft = true, the backpack anti theft is active on the whole server. This is just a basic support for PVE Servers. Default = false
@@ -357,6 +358,7 @@ if (!isDedicated) then {
DZE_BloodsuckerScreenEffect = true; // On screen slash marks when the bloodsuckers attack.
DZE_BloodsuckerDeleteNearTrader = true; // Deletes bloodsuckers when near trader cities.
DZE_MutantHeartProtect = true; // Disables targeting and attack if the player has a mutant heart in inventory.
DZE_MutantHumanity = 20;
};
// Garage Door Opener

View File

@@ -244,6 +244,8 @@ if (!isDedicated) then {
player_mutantAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_mutantAttack.sqf";
mutant_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\mutant_generate.sqf";
mutant_findTarget = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\mutant_findTarget.sqf";
mutant_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\mutant_damageHandler.sqf";
mutant_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\mutant_eventKill.sqf";
};
// Weather