Move study body back to fn_selfActions

Adding UserActions to players (CAManBase) is not efficient, because the
condition evaluates onEachFrame when you are "inside" that vehicle type.
Also admins usually want to add more custom actions to dead bodies
anyway.
https://community.bistudio.com/wiki/addAction#Syntax

This partially reverts 3aad4b6.
This commit is contained in:
ebayShopper
2017-02-21 15:12:41 -05:00
parent 12f59f046c
commit d416ae80ab
8 changed files with 16 additions and 21 deletions

View File

@@ -26,6 +26,7 @@
[CHANGED] SpawnCheck for loot and zombies has been lowered to 200m and switched to nearObjects instead of nearestObjects (same as 1051) for better client FPS. #1816
[CHANGED] Increased head shot damage for normal hits (non-zombie and non-melee)
[CHANGED] Slightly increased damage from vehicle run over
[CHANGED] Moved study body back to fn_selfActions for easy admin customization.
[FIXED] Wrong texture for z_hunter zombie. #1805 @schwanzkopfhegel @ebayShopper
[FIXED] Refuel with generator at gas station not working. #1806 @Helios27 @ebayShopper

View File

@@ -8,22 +8,6 @@ class CAManBase: Man //includes all skins except animals
class HitHead;
class HitBody;
};
class UserActions
{
class StudyBody
{
displayName = $STR_ACTION_STUDYBODY;
displayNameDefault = $STR_ACTION_STUDYBODY;
priority = 0;
radius = 3;
position = "";
showWindow = 0;
onlyForPlayer = 1;
shortcut = "";
condition = "(['StudyBody',this] call userActionConditions)";
statement = "this call player_studyBody;";
};
};
};
class Civilian: CAManBase
{

View File

@@ -73,7 +73,6 @@ class zZombie_Base : Zed_Base {
condition = "(['Butcher',this] call userActionConditions)";
statement = "this spawn player_butcher;";
};
delete StudyBody;
};
class HitPoints {

View File

@@ -1,6 +1,6 @@
private["_body","_name","_method","_methodStr","_message","_killingBlow"];
_body = _this;
_body = _this select 3;
_name = _body getVariable["bodyName","unknown"];
_method = _body getVariable["deathType","unknown"];
_methodStr = localize format ["str_death_%1",_method];

View File

@@ -6,7 +6,7 @@
#define IS_PZOMBIE (player isKindOf "PZombie_VB")
/*
(['StudyBody',this] call userActionConditions)
(['Butcher',this] call userActionConditions)
Return - must be true for action to show.
*/
@@ -17,7 +17,6 @@ _action = _this select 0;
_object = _this select 1;
_show = switch _action do {
case "StudyBody": {!IS_ALIVE};
case "Butcher": {!IS_ALIVE && !IN_VEHICLE && CAN_DO && !(_object getVariable["meatHarvested",false]) && !IS_PZOMBIE};
case "Drink": {!IN_VEHICLE && CAN_DO && !dayz_isSwimming};
case "PushPlane": {IS_ALIVE && !IN_VEHICLE && CAN_DO && count crew _object == 0 && !isEngineOn _object && !IS_PZOMBIE};

View File

@@ -476,6 +476,16 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
player removeAction s_player_sleep;
s_player_sleep = -1;
};
//Study Body
if (_cursorTarget getVariable["bodyName",""] != "") then {
if (s_player_studybody < 0) then {
s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true];
};
} else {
player removeAction s_player_studybody;
s_player_studybody = -1;
};
/*
//Carbomb
_hasCarBomb = "ItemCarBomb" in _magazinesPlayer;
@@ -1038,6 +1048,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
s_player_packtentinfected = -1;
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
player removeAction s_player_studybody;
s_player_studybody = -1;
//fuel
player removeAction s_player_fillfuel210;
s_player_fillfuel210 = -1;

View File

@@ -123,7 +123,6 @@ if (!isDedicated) then {
player_pushPlane = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_pushPlane.sqf";
//player_repairVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\repair_vehicle.sqf";
//player_salvageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\salvage_vehicle.sqf";
player_studyBody = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\study_body.sqf";
//ui
player_toggleSoundMute = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_toggleSoundMute.sqf";

View File

@@ -177,6 +177,7 @@ dayz_resetSelfActions = {
s_player_grabflare = -1;
s_player_removeflare = -1;
s_player_painkiller = -1;
s_player_studybody = -1;
s_build_Sandbag1_DZ = -1;
s_build_Hedgehog_DZ = -1;
s_build_Wire_cat1 = -1;