844{
846
850
859
861
863 {
865 {
867
869 RegisterNetSyncVariableInt("m_FoodStage.m_SelectionIndex", 0, 6);
870 RegisterNetSyncVariableInt("m_FoodStage.m_TextureIndex", 0, 6);
871 RegisterNetSyncVariableInt("m_FoodStage.m_MaterialIndex", 0, 6);
872 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
873
877 RegisterNetSyncVariableBool("m_MakeCookingSounds");
878 }
879 }
880
882 {
884
886 }
887
889 {
890 super.EEDelete(parent);
891
893 }
894
896 {
898
901 {
902 switch (
oldLoc.GetParent().GetType())
903 {
904 case "FryingPan":
905 case "Pot":
906 case "Cauldron":
907 case "SharpWoodenStick":
909 break;
910 }
911
915 }
916 }
917
919 {
922 }
923
925 {
928
929 return true;
930 }
931
933
934
936 {
937 return false;
938 }
939
941 {
942 return false;
943 }
944
945
946
947
949 {
950 SetSynchDirty();
951
954 }
955
957 {
958 super.OnVariablesSynchronized();
959
961
962
965 else
967 }
968
969
970
971
973 {
976
978 }
979
981 {
983
985
987 {
992 break;
995 break;
998 break;
999 default:
1001 break;
1002 }
1003
1005 }
1006
1008 {
1011 }
1012
1013
1014
1015
1017 {
1019
1022
1023
1026 }
1027
1029 {
1030 if (!
super.OnStoreLoad(
ctx, version))
1031 return false;
1032
1034 {
1036 return false;
1037 }
1038
1039 if (version >= 115)
1040 {
1042 {
1044 return false;
1045 }
1047 {
1049 return false;
1050 }
1051 }
1052
1053 return true;
1054 }
1055
1057 {
1058 super.AfterStoreLoad();
1059
1061 }
1062
1063
1065 {
1067 }
1068
1069
1071 {
1072 return false;
1073 }
1074
1076 {
1077 return false;
1078 }
1079
1081 {
1082 return false;
1083 }
1084
1086 {
1087 return false;
1088 }
1089
1090
1091
1092
1093
1095 {
1103
1104 }
1105
1107 {
1115 }
1116
1118 {
1126 }
1127
1129 {
1137
1138 }
1139
1141 {
1149 }
1150
1152 {
1160 }
1161
1163 {
1171 }
1172
1174 {
1175 return new NutritionalProfile(
GetFoodEnergy(
item,
classname,
food_stage),
GetFoodWater(
item,
classname,
food_stage),
GetFoodNutritionalIndex(
item,
classname,
food_stage),
GetFoodTotalVolume(
item,
classname,
food_stage),
GetFoodToxicity(
item,
classname,
food_stage),
GetFoodAgents(
item,
classname,
food_stage),
GetFoodDigestibility(
item,
classname,
food_stage));
1176 }
1177
1178
1179
1180
1182 {
1184 }
1185
1186
1188 {
1191
1192 return false;
1193 }
1194
1196 {
1199
1200 return false;
1201 }
1202
1204 {
1207
1208 return false;
1209 }
1210
1212 {
1215
1216 return false;
1217 }
1218
1220 {
1223
1224 return false;
1225 }
1226
1228 {
1231
1232 return false;
1233 }
1234
1235
1237 {
1239 }
1240
1242 {
1244 }
1245
1247 {
1249 }
1250
1252 {
1254 }
1255
1256
1258 {
1259 if (!
source.HasFoodStage())
1260 return;
1265 }
1266
1267
1268
1269
1270
1272 {
1274 }
1275
1277 {
1279
1280
1282 }
1283
1284
1286 {
1289 {
1292 }
1293 else
1294 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1295 }
1296
1298 {
1300
1303 }
1304
1306 {
1307#ifndef SERVER
1309 {
1311
1314 }
1315#endif
1316 }
1317
1319 {
1320#ifndef SERVER
1322 {
1326 }
1327#endif
1328 }
1329
1331 {
1332 return true;
1333 }
1334
1336 {
1337 return false;
1338 }
1339
1341 {
1343 }
1344
1346 {
1347 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1351
1352
1353
1354
1355
1356
1357
1359 {
1360
1362 {
1364 {
1368 break;
1369
1373 break;
1374
1378 break;
1379
1383 default:
1386 return;
1387 }
1388
1389
1390 }
1391
1393
1395 {
1397 {
1398
1402 {
1406 else
1407 {
1410 else
1412 }
1413 }
1414 }
1415 }
1416
1417 }
1419 {
1420
1422 {
1424 {
1428 break;
1429
1433 break;
1434
1438 break;
1439
1443 break;
1444
1447 default:
1450 return;
1451 }
1452 }
1453
1455
1457 {
1459 {
1460
1463 }
1464 }
1465 }
1467 {
1468
1470 {
1472 {
1476 break;
1477
1480 default:
1483 return;
1484 }
1485 }
1486
1488
1490 {
1492 {
1493
1496 }
1497 }
1498 }
1499 else
1500 {
1501
1503
1505 {
1508
1509 }
1510 else
1511 {
1513 {
1516 }
1517 }
1518 }
1519
1521 }
1522
1524 {
1526
1528 {
1531 }
1532 }
1533
1535 {
1537
1539 {
1541 {
1546 return true;
1547 }
1549 {
1554 return true;
1555 }
1556 }
1557 return false;
1558 }
1559
1561 {
1563
1565
1568
1570 }
1571
1572
1573
1574
1575
1577 {
1579 }
1580
1582 {
1584 }
1585
1587 {
1589 }
1590}
1591
1593{
1595};
Param4< int, int, string, int > TSelectableActionInfoWithColor
void AddAction(typename actionName)
void ReplaceEdibleWithNew(string typeName)
ref FoodStage m_FoodStage
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
override bool CanBeCooked()
override string GetDebugText()
override void AfterStoreLoad()
override void OnVariablesSynchronized()
const string SOUND_BURNING_DONE
bool CanChangeToNewStage(CookingMethodType cooking_method)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void SetActions()
const string DIRECT_COOKING_SLOT_NAME
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
void ChangeFoodStage(FoodStageType new_food_stage_type)
void OnConsume(float amount, PlayerBase consumer)
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
SoundOnVehicle m_SoundCooking
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
const string SOUND_BAKING_DONE
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
override void EEDelete(EntityAI parent)
FoodStageType m_LastDecayStage
override bool CanHaveTemperature()
override bool CanBeCookedOnStick()
FoodStageType GetLastDecayStage()
string GetFoodStageName(FoodStageType food_stage_type)
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
void TransferFoodStage(notnull Edible_Base source)
override void ProcessDecay(float delta, bool hasRootAsPlayer)
void SetCookingTime(float time)
void SoundCookingStart(string sound_name)
const string SOUND_BAKING_START
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
Edible_Base ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
bool Consume(float amount, PlayerBase consumer)
EffectSound m_SoundEffectCooking
DEPRECATED.
override bool OnStoreLoad(ParamsReadContext ctx, int version)
FoodStageType GetFoodStageType()
override bool CanProcessDecay()
void MakeSoundsOnClient(bool soundstate, CookingMethodType cookingMethod=CookingMethodType.NONE)
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
override bool IsMushroom()
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
CookingMethodType m_CookedByMethod
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void OnStoreSave(ParamsWriteContext ctx)
InventoryLocationType
types of Inventory Location
override void InsertAgent(int agent, float count=1)
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
class JsonUndergroundAreaTriggerData GetPosition
Wrapper class for managing sound through SEffectManager.
override void Stop()
Stops sound.
provides access to slot configuration
static proto native owned string GetSlotName(int id)
converts slot_id to string
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Serialization general interface. Serializer API works with:
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
const float DECAY_FOOD_BAKED_FRVG
const float DECAY_FOOD_CAN_OPEN
const float DECAY_FOOD_RAW_FRVG
const int DECAY_TIMER_RANDOM_PERCENTAGE
const int DECAY_FOOD_FRVG_DRIED_CHANCE
const float DECAY_FOOD_RAW_MEAT
const float DECAY_FOOD_BAKED_MEAT
const float DECAY_FOOD_BOILED_MEAT
const float DECAY_FOOD_BOILED_FRVG
const float DECAY_FOOD_DRIED_MEAT
const float DECAY_FOOD_RAW_CORPSE
const float DECAY_RATE_ON_PLAYER
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
const int SAT_DEBUG_ACTION