From e222efa6422d2689999ce0ddf88345c8311fe433 Mon Sep 17 00:00:00 2001 From: A Clark Date: Thu, 20 Dec 2012 15:04:59 -0600 Subject: [PATCH] v0.3 --- dayz_code/compile/fn_damageHandler.sqf | 41 +++--- dayz_code/compile/player_checkStealth.sqf | 2 +- dayz_code/compile/player_death.sqf | 59 +------- dayz_code/compile/zombie_findTargetAgent.sqf | 2 + dayz_code/system/player_monitor.fsm | 136 ++++++++++++------- dayz_equip/config.cpp | 4 +- dayz_server/compile/server_playerDied.sqf | 3 +- dayz_server/compile/server_playerLogin.sqf | 13 +- dayz_weapons/config.cpp | 26 +++- 9 files changed, 156 insertions(+), 130 deletions(-) diff --git a/dayz_code/compile/fn_damageHandler.sqf b/dayz_code/compile/fn_damageHandler.sqf index c7169f125..f54525496 100644 --- a/dayz_code/compile/fn_damageHandler.sqf +++ b/dayz_code/compile/fn_damageHandler.sqf @@ -165,27 +165,30 @@ if (_damage > 0.4) then { //0.25 }; }; if(!_isHit) then { - //Create Wound - _unit setVariable[_wound,true,true]; - [_unit,_wound,_hit] spawn fnc_usec_damageBleed; - usecBleed = [_unit,_wound,_hit]; - publicVariable "usecBleed"; + _isPZombie = player isKindOf "PZombie_VB"; + if(!_isPZombie) then { + //Create Wound + _unit setVariable[_wound,true,true]; + [_unit,_wound,_hit] spawn fnc_usec_damageBleed; + usecBleed = [_unit,_wound,_hit]; + publicVariable "usecBleed"; - //Set Injured if not already - _isInjured = _unit getVariable["USEC_injured",false]; - if (!_isInjured) then { - _unit setVariable["USEC_injured",true,true]; - if ((_unit == player) and (_ammo != "zombie")) then { - dayz_sourceBleeding = _source; + //Set Injured if not already + _isInjured = _unit getVariable["USEC_injured",false]; + if (!_isInjured) then { + _unit setVariable["USEC_injured",true,true]; + if ((_unit == player) and (_ammo != "zombie")) then { + dayz_sourceBleeding = _source; + }; + }; + //Set ability to give blood + _lowBlood = _unit getVariable["USEC_lowBlood",false]; + if (!_lowBlood) then { + _unit setVariable["USEC_lowBlood",true,true]; + }; + if (_unit == player) then { + r_player_injured = true; }; - }; - //Set ability to give blood - _lowBlood = _unit getVariable["USEC_lowBlood",false]; - if (!_lowBlood) then { - _unit setVariable["USEC_lowBlood",true,true]; - }; - if (_unit == player) then { - r_player_injured = true; }; }; }; diff --git a/dayz_code/compile/player_checkStealth.sqf b/dayz_code/compile/player_checkStealth.sqf index 2066bde0a..3e0571c63 100644 --- a/dayz_code/compile/player_checkStealth.sqf +++ b/dayz_code/compile/player_checkStealth.sqf @@ -8,7 +8,7 @@ _scaleLight = 0.5; _scaleAlert = 1; _isPZombie = player isKindOf "PZombie_VB"; -if(_isPZombie) exitWith {}; +if(_isPZombie) exitWith { DAYZ_disAudial = 0; DAYZ_disVisual = 0; }; //Assess Players Position _anim = animationState player; diff --git a/dayz_code/compile/player_death.sqf b/dayz_code/compile/player_death.sqf index 4e3da349a..db2d8a451 100644 --- a/dayz_code/compile/player_death.sqf +++ b/dayz_code/compile/player_death.sqf @@ -1,73 +1,28 @@ -private["_array","_source","_kills","_killsV","_humanity","_wait","_myKills","_dont_kill","_model"]; +private["_array","_source","_kills","_killsV","_humanity","_wait","_myKills","_infected"]; if (deathHandled) exitWith {}; + deathHandled = true; //Death -_dont_kill = false; _body = player; _playerID = getPlayerUID player; - - -// If player was infected resurect as a zombie before death -if (r_player_infected) then { - if(player isKindOf "PZombie_VB") then { - // do nothing kill anyways - } else { - _model = ["pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest"] select floor (random 11); - [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph; - - r_player_inpain = false; - r_player_dead = false; - r_player_injured = false; - r_player_cardiac = false; - - //Give Blood - r_player_blood = r_player_bloodTotal; - player setVariable["USEC_lowBlood",false,true]; - usecMorphine = [player,player]; - publicVariable "usecMorphine"; - player setVariable ["USEC_inPain", false, true]; - usecBandage = [player,player]; - publicVariable "usecBandage"; - player setdamage 0; - {player setVariable[_x,false,true];} forEach USEC_woundHit; - player setVariable ["USEC_injured",false,true]; - - sleep 1; - r_player_handler = false; - nul = [] spawn fnc_usec_recoverUncons; - - disableUserInput false; - - // player setVariable ["medForceUpdate",true,true]; - - if (!(player getVariable ["NORRN_unconscious", true])) then { - nul = [] spawn fnc_usec_recoverUncons; - }; - if(animationState player == "AmovPpneMstpSnonWnonDnon_healed") then { - nul = [] spawn fnc_usec_recoverUncons; - }; - - _dont_kill = true; - }; - +_infected = 0; +if (r_player_infected) then { + _infected = 1; }; -if (_dont_kill) exitWith {}; - //Send Death Notice -dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName]; +dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName,_infected]; publicVariableServer "dayzDeath"; if (isServer) then { - _id = dayzDeath spawn server_playerDied; + _id = dayzDeath spawn server_playerDied; }; _id = [player,50,true,getPosATL player] spawn player_alertZombies; sleep 0.5; - player setDamage 1; 0.1 fadeSound 0; diff --git a/dayz_code/compile/zombie_findTargetAgent.sqf b/dayz_code/compile/zombie_findTargetAgent.sqf index 118e93ff0..78df2fe8e 100644 --- a/dayz_code/compile/zombie_findTargetAgent.sqf +++ b/dayz_code/compile/zombie_findTargetAgent.sqf @@ -7,6 +7,7 @@ _range = 300; _manDis = 0; _targets = _agent getVariable ["targets",[]]; +/* //Search for fires if (count _targets == 0) then { _fires = nearestObjects [_agent,["Land_Fire"],_range]; @@ -20,6 +21,7 @@ if (count _targets == 0) then { }; } forEach _fires; }; +*/ if (isNil "_targets") exitWith {}; //Search for objects diff --git a/dayz_code/system/player_monitor.fsm b/dayz_code/system/player_monitor.fsm index d0ad9e263..4d93e01c5 100644 --- a/dayz_code/system/player_monitor.fsm +++ b/dayz_code/system/player_monitor.fsm @@ -1,4 +1,4 @@ -/*%FSM*/ +/*%FSM*/ /*%FSM*/ /* item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"}; @@ -36,7 +36,7 @@ item31[] = {"ERROR__Bad_Versi",2,250,175.000000,650.000000,275.000000,700.000000 item32[] = {"Display_Ready",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Display" \n "Ready"}; item33[] = {"Preload_Display",2,250,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Preload" \n "Display"}; item34[] = {"Preload_Done",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Preload" \n "Done"}; -item35[] = {"Initialize",2,4346,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"}; +item35[] = {"Initialize",2,250,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"}; item36[] = {"Finish",1,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Finish"}; item37[] = {"True",8,218,25.000000,1100.000000,125.000000,1150.000000,0.000000,"True"}; item38[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"}; @@ -45,15 +45,17 @@ item40[] = {"Too_Long",4,218,300.000000,550.000000,400.000000,600.000000,0.00000 item41[] = {"Too_Long",4,218,300.000000,650.000000,400.000000,700.000000,0.000000,"Too" \n "Long"}; item42[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"}; item43[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"}; -item44[] = {"New_Character",4,218,-275.000000,350.000000,-175.000000,400.000000,5.000000,"New" \n "Character"}; -item45[] = {"Gender_Selection",2,250,-400.000000,350.000000,-300.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"}; -item46[] = {"Selected",4,218,-400.000000,450.000000,-300.000000,500.000000,0.000000,"Selected"}; -item47[] = {"Process",2,250,-275.000000,450.000000,-175.000000,500.000000,0.000000,"Process"}; +item44[] = {"New_Character",4,4314,-425.000000,275.000000,-325.000000,325.000000,5.000000,"New" \n "Character"}; +item45[] = {"Gender_Selection",2,250,-500.000000,350.000000,-400.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"}; +item46[] = {"Selected",4,218,-450.000000,450.000000,-350.000000,500.000000,0.000000,"Selected"}; +item47[] = {"Process",2,250,-300.000000,475.000000,-200.000000,525.000000,0.000000,"Process"}; item48[] = {"no_PlayerID",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"}; item49[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"}; item50[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"}; item51[] = {"Stream",2,250,-75.000000,750.000000,25.000000,800.000000,0.000000,"Stream"}; item52[] = {"Preloaded",4,218,-175.000000,800.000000,-75.000000,850.000000,0.000000,"Preloaded"}; +item53[] = {"Pzombie_Characte",4,218,-250.000000,350.000000,-150.000000,400.000000,5.000000,"Pzombie" \n "Character"}; +item54[] = {"PZombie_Selectio",2,250,-375.000000,375.000000,-275.000000,425.000000,0.000000,"PZombie Selection"}; link0[] = {0,1}; link1[] = {0,5}; link2[] = {1,2}; @@ -77,45 +79,48 @@ link19[] = {16,17}; link20[] = {17,18}; link21[] = {17,20}; link22[] = {17,44}; -link23[] = {18,19}; -link24[] = {19,39}; -link25[] = {20,21}; -link26[] = {21,22}; -link27[] = {22,23}; -link28[] = {23,24}; -link29[] = {23,26}; -link30[] = {24,25}; -link31[] = {25,40}; -link32[] = {26,27}; -link33[] = {27,28}; -link34[] = {27,30}; -link35[] = {28,51}; -link36[] = {29,32}; -link37[] = {30,31}; -link38[] = {31,41}; -link39[] = {32,33}; -link40[] = {33,34}; -link41[] = {34,35}; -link42[] = {35,37}; -link43[] = {37,36}; -link44[] = {38,14}; -link45[] = {39,19}; -link46[] = {40,25}; -link47[] = {41,31}; -link48[] = {42,6}; -link49[] = {42,48}; -link50[] = {43,42}; -link51[] = {44,45}; -link52[] = {45,46}; -link53[] = {46,47}; -link54[] = {47,20}; -link55[] = {48,49}; -link56[] = {49,50}; -link57[] = {50,49}; -link58[] = {51,52}; -link59[] = {52,29}; -globals[] = {25.000000,1,0,0,0,640,480,1,81,6316128,1,-561.815979,576.218079,1244.091797,527.904846,613,601,1}; -window[] = {2,-1,-1,-32000,-32000,890,110,1081,110,3,630}; +link23[] = {17,53}; +link24[] = {18,19}; +link25[] = {19,39}; +link26[] = {20,21}; +link27[] = {21,22}; +link28[] = {22,23}; +link29[] = {23,24}; +link30[] = {23,26}; +link31[] = {24,25}; +link32[] = {25,40}; +link33[] = {26,27}; +link34[] = {27,28}; +link35[] = {27,30}; +link36[] = {28,51}; +link37[] = {29,32}; +link38[] = {30,31}; +link39[] = {31,41}; +link40[] = {32,33}; +link41[] = {33,34}; +link42[] = {34,35}; +link43[] = {35,37}; +link44[] = {37,36}; +link45[] = {38,14}; +link46[] = {39,19}; +link47[] = {40,25}; +link48[] = {41,31}; +link49[] = {42,6}; +link50[] = {42,48}; +link51[] = {43,42}; +link52[] = {44,45}; +link53[] = {45,46}; +link54[] = {46,47}; +link55[] = {47,20}; +link56[] = {48,49}; +link57[] = {49,50}; +link58[] = {50,49}; +link59[] = {51,52}; +link60[] = {52,29}; +link61[] = {53,54}; +link62[] = {54,20}; +globals[] = {25.000000,1,0,0,0,640,480,1,85,6316128,1,-783.086182,670.969788,890.729858,-115.220749,1272,880,1}; +window[] = {2,-1,-1,-1,-1,806,1706,2677,26,3,1290}; *//*%FSM*/ class FSM { @@ -456,8 +461,10 @@ class FSM "_version = _msg select 5;" \n "_model = _msg select 6;" \n "" \n - "_isHiveOk = false;" \n - "_newPlayer = false;" \n + "_isHiveOk = false; // _msg select 7;" \n + "_newPlayer = false; // _msg select 8;" \n + "" \n + "_isInfected = _msg select 9;" \n "" \n "if (count _msg > 7) then {" \n " _isHiveOk = _msg select 7;" \n @@ -508,7 +515,17 @@ class FSM priority = 5.000000; to="Gender_Selection"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_isNew"/*%FSM*/; + condition=/*%FSM*/"_isNew && _isInfected == 0"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Pzombie_Characte + { + priority = 5.000000; + to="PZombie_Selectio"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_isNew && _isInfected == 1"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -559,7 +576,7 @@ class FSM "dayz_playerName = name player;" \n "_model call player_switchModel;" \n "" \n - "player allowDamage false;" \n + "player allowDamage false;" \n "_lastAte = _survival select 1;" \n "_lastDrank = _survival select 2;" \n "" \n @@ -1276,6 +1293,27 @@ class FSM }; }; /*%FSM*/ + /*%FSM*/ + class PZombie_Selectio + { + name = "PZombie_Selectio"; + init = /*%FSM*/"_model = ""pz_villager1"";"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Hive_Ok + { + priority = 0.000000; + to="Phase_One"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ }; initState="init"; finalStates[] = diff --git a/dayz_equip/config.cpp b/dayz_equip/config.cpp index d14752cae..bf52ea916 100644 --- a/dayz_equip/config.cpp +++ b/dayz_equip/config.cpp @@ -1071,13 +1071,13 @@ class CfgMagazines { scope = 2; displayName = "Business Suit"; - descriptionShort = "Rebel Uniform; + descriptionShort = "Business Suit; }; class Skin_Priest_DZ: SkinBase { scope = 2; displayName = "Priest Outfit"; - descriptionShort = "Rebel Uniform; + descriptionShort = "Priest Outfit; }; class Skin_Rocker2_DZ: SkinBase { diff --git a/dayz_server/compile/server_playerDied.sqf b/dayz_server/compile/server_playerDied.sqf index df118ec31..a2f0ac38f 100644 --- a/dayz_server/compile/server_playerDied.sqf +++ b/dayz_server/compile/server_playerDied.sqf @@ -5,6 +5,7 @@ _minutes = _this select 1; _newObject = _this select 2; _playerID = _this select 3; _playerName = _this select 4; +_infected = _this select 5; dayz_disco = dayz_disco - [_playerID]; _newObject setVariable["processedDeath",time]; @@ -23,7 +24,7 @@ if (typeName _minutes == "STRING") then if (_characterID != "0") then { - _key = format["CHILD:202:%1:%2:",_characterID,_minutes]; + _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected]; //diag_log ("HIVE: WRITE: "+ str(_key)); _key call server_hiveWrite; } diff --git a/dayz_server/compile/server_playerLogin.sqf b/dayz_server/compile/server_playerLogin.sqf index b5ac69d74..a04c22d07 100644 --- a/dayz_server/compile/server_playerLogin.sqf +++ b/dayz_server/compile/server_playerLogin.sqf @@ -1,4 +1,4 @@ -private["_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"]; +private["_isInfected","_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"]; //Set Variables diag_log ("STARTING LOGIN: " + str(_this)); @@ -25,6 +25,7 @@ _survival = [0,0,0]; _tent = []; _state = []; _direction = 0; +_isInfected = 0; _model = ""; _newUnit = objNull; _botActive = false; @@ -63,7 +64,7 @@ if ((_primary select 0) == "ERROR") exitWith { //Process request _newPlayer = _primary select 1; -_isNew = count _primary < 6; //_result select 1; +_isNew = count _primary < 7; //_result select 1; _charID = _primary select 2; _randomSpot = false; @@ -85,8 +86,10 @@ if (!_isNew) then { }; } else { - _model = _primary select 3; - _hiveVer = _primary select 4; + _isInfected = _primary select 3; + _model = _primary select 4; + _hiveVer = _primary select 5; + if (isNil "_model") then { _model = "Survivor2_DZ"; } else { @@ -118,5 +121,5 @@ if (_hiveVer >= dayz_hiveVersionNo) then { //Server publishes variable to clients and WAITS //_playerObj setVariable ["publish",[_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer],true]; -dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer]; +dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer,_isInfected]; (owner _playerObj) publicVariableClient "dayzPlayerLogin"; diff --git a/dayz_weapons/config.cpp b/dayz_weapons/config.cpp index 487140f07..5b89246ca 100644 --- a/dayz_weapons/config.cpp +++ b/dayz_weapons/config.cpp @@ -473,7 +473,7 @@ class cfgWeapons recoil = "recoil_single_primary_4outof10"; recoilProne = "recoil_single_primary_prone_4outof10"; }; - magazines[] = {"BoltSteel"}; + magazines[] = {"BoltSteel", "BoltSteel4pack", "BoltSteel8pack"}; bullet1[] = {"dayz_weapons\sounds\crossbow_bolt",0.177828,1,15}; soundBullet[] = {"bullet1",1}; }; @@ -709,6 +709,30 @@ class cfgMagazines descriptionShort = "$STR_MAG_DESC_3"; displayNameShort = "$STR_MAG_ACTION_3"; }; + class BoltSteel4pack: CA_Magazine + { + scope = 2; + displayName = "$STR_MAG_NAME_3"; + model = "\dayz_weapons\models\bolt_gear"; + picture = "\dayz_weapons\textures\equip_bolt_ca.paa"; + ammo = "BoltSteel"; + count = 4; + initSpeed = 150; + descriptionShort = "$STR_MAG_DESC_3"; + displayNameShort = "$STR_MAG_ACTION_3"; + }; + class BoltSteel8pack: CA_Magazine + { + scope = 2; + displayName = "$STR_MAG_NAME_3"; + model = "\dayz_weapons\models\bolt_gear"; + picture = "\dayz_weapons\textures\equip_bolt_ca.paa"; + ammo = "BoltSteel"; + count = 8; + initSpeed = 150; + descriptionShort = "$STR_MAG_DESC_3"; + displayNameShort = "$STR_MAG_ACTION_3"; + }; }; class CfgCloudlets {