14 enum ESubscriberSystems
16 TRIGGERS = 0x00000001,
22 typedef Param1<int> SendDiagRPCSelfBasicParam;
38 int m_TotalHairLevelsAdjusted;
46 g_Game.ConfigGetTextArray(
"cfgVehicles Head_Default simpleHiddenSelections", m_HairSelectionArray);
47 m_TotalHairLevelsAdjusted = m_HairSelectionArray.Count() - 1;
48 for (
int i = 0; i < m_HairSelectionArray.Count(); ++i)
50 m_HairHidingStateMap.Insert(i, 1);
65 protected void RegisterDiags()
67 RegisterDeveloperDiags();
68 RegisterModdedDiagsIDs();
69 RegisterModdedDiags();
77 private void RegisterDeveloperDiags()
198 #ifdef DIAG_MISC_ACTION_ON_CURSOR
245 DiagMenu.RegisterRange(
DiagMenuIDs.MISC_HAIR_LEVEL,
"",
"Hair Level#",
DiagMenuIDs.MISC_HAIR_MENU,
string.Format(
"0,%1,0,1", m_TotalHairLevelsAdjusted));
268 DiagMenu.RegisterRange(
DiagMenuIDs.MISC_HIT_INDICATION_SPAWN_HIT_DIRECTION,
"",
"Spawn Hit Direction",
DiagMenuIDs.MISC_HIT_INDICATION_MENU,
"0, 359, 0, 1");
272 DiagMenu.RegisterRange(
DiagMenuIDs.MISC_HIT_INDICATION_DURATION,
"",
"Hit Duration Max",
DiagMenuIDs.MISC_HIT_INDICATION_MENU,
"0.1, 5.0, 1.0, 0.1");
273 DiagMenu.RegisterRange(
DiagMenuIDs.MISC_HIT_INDICATION_BREAKPOINT,
"",
"Hit Breakpoint",
DiagMenuIDs.MISC_HIT_INDICATION_MENU,
"0.0, 1.0, 0.8, 0.05");
274 DiagMenu.RegisterRange(
DiagMenuIDs.MISC_HIT_INDICATION_DISTANCE,
"",
"Distance Adjust",
DiagMenuIDs.MISC_HIT_INDICATION_MENU,
"0.0, 1.0, 0.0, 0.01");
357 DiagMenu.RegisterItem(
DiagMenuIDs.BLEEDING_ACTIVATE_SOURCE_LEVEL,
"",
"Activate Blsource Level",
DiagMenuIDs.BLEEDING_MENU,
"None, Low, Medium, High");
380 DiagMenu.RegisterRange(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_SLIDEDISTANCE,
"",
"Drop Slide Distance",
DiagMenuIDs.BLEEDINGINDICATORS_MENU,
"0.0, 500.0, 0, 0.1");
386 DiagMenu.RegisterBool(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_ENABLEDESATURATION,
"",
"Desaturate",
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_MENU);
434 #ifdef TRIGGER_DEBUG_BASIC
517 protected int GetModdedDiagID()
519 return ++m_ModdedDiagID;
523 protected int GetModdedRootMenu()
529 protected void RegisterModdedDiagsIDs();
532 protected void RegisterModdedDiags()
541 Class.CastTo(parent, player.GetParent());
548 case ERPCs.DIAG_ITEM_DEBUG_ACTIONS:
559 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON:
560 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF:
561 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG:
563 if (player.GetSymptomManager())
565 player.GetSymptomManager().OnRPCDebug(rpc_type, ctx);
575 case ERPCs.DIAG_CRAFTING_INSTANT:
579 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
589 case ERPCs.DIAG_CHEATS_MODIFIERS:
597 case ERPCs.DIAG_CHEATS_KILL_PLAYER:
599 player.SetHealth(
"",
"", -1);
604 case ERPCs.DIAG_CHEATS_INVINCIBILITY:
614 parent.SetAllowDamage(
true);
615 parent.SetCanBeDestroyed(
true);
618 player.SetAllowDamage(
true);
619 player.SetCanBeDestroyed(
true);
626 parent.SetAllowDamage(
true);
627 parent.SetCanBeDestroyed(
false);
630 player.SetAllowDamage(
true);
631 player.SetCanBeDestroyed(
false);
638 parent.SetAllowDamage(
false);
641 player.SetAllowDamage(
false);
650 case ERPCs.DIAG_CHEATS_DISABLE_STAMINA:
658 case ERPCs.DIAG_CHEATS_RESET_PLAYER:
660 player.ResetPlayer(
false);
665 case ERPCs.DIAG_CHEATS_RESET_PLAYER_MAX:
667 player.ResetPlayer(
true);
672 case ERPCs.DIAG_CHEATS_INVENTORY_ACCESS:
680 case ERPCs.DIAG_CHEATS_ITEMS_FIX:
682 player.FixAllInventoryItems();
688 case ERPCs.DIAG_CHEATS_CREATE_HIT:
690 player.ProcessDirectDamage(
DamageType.CUSTOM, player,
"",
"Dummy_Heavy",
"0 0 0");
694 case ERPCs.DIAG_CHEATS_CREATE_HIT_LIGHT:
696 player.ProcessDirectDamage(
DamageType.CUSTOM, player,
"",
"MeleeFist",
"0 0 0");
703 case ERPCs.DIAG_SOFT_SKILLS_SHOW_DEBUG:
709 player.GetSoftSkillsManager().StartSynchTimer();
713 player.GetSoftSkillsManager().StopSynchTimer();
714 player.GetSoftSkillsManager().ResetDebugWindow();
721 case ERPCs.DIAG_SOFT_SKILLS_TOGGLE_STATE:
729 case ERPCs.DIAG_SOFT_SKILLS_TOGGLE_MODEL:
737 case ERPCs.DIAG_SOFT_SKILLS_SPECIALTY_VALUE:
743 softSkillsMngr.SynchSpecialtyLevel();
752 case ERPCs.DIAG_LIFESPAN_BLOODY_HANDS:
757 pluginLifespan.UpdateBloodyHandsVisibility(player,
CachedObjectsParams.PARAM1_BOOL.param1);
763 case ERPCs.DIAG_LIFESPAN_PLAYTIME_UPDATE:
771 player.SetLastShavedSeconds(0);
775 pluginLifespann.UpdateLifespan(player,
true);
784 case ERPCs.DIAG_MISC_LOG_PLAYER_STATS:
796 case ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG:
800 if (player.m_Environment)
806 case ERPCs.DIAG_MISC_ENVIRONMENT_LOGGING_DRYWET:
810 if (player.m_Environment)
819 case ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG:
823 if (player.GetFallDamage())
830 case ERPCs.DIAG_MISC_GO_UNCONSCIOUS:
832 GoUnconscious(player);
837 case ERPCs.DIAG_MISC_GO_UNCONSCIOUS_DELAYED:
844 case ERPCs.DIAG_MISC_QUICK_RESTRAIN:
854 case ERPCs.DIAG_MISC_HAIR_LEVEL_HIDE:
859 player.UpdateHairSelectionVisibility(
true);
867 case ERPCs.DIAG_MISC_QUICK_FISHING:
875 case ERPCs.DIAG_MISC_TARGETABLE_BY_AI:
883 case ERPCs.DIAG_MISC_DEBUG_MONITOR:
893 case ERPCs.DIAG_SIMULATE_INFINITE_LOOP:
897 Print(
"simulating infinite loop");
903 case ERPCs.DIAG_SIMULATE_NULL_POINTER:
906 NULL_player.SetHealth(
"",
"", -1);
911 case ERPCs.DIAG_SIMULATE_DIVISION_BY_ZERO:
914 int division_by_zero = 1/zero;
919 case ERPCs.DIAG_SIMULATE_ERROR_FUNCTION:
929 case ERPCs.DIAG_WEAPON_PARTICLES:
937 case ERPCs.DIAG_WEAPON_RECOIL:
940 player.GetAimingModel().SetProceduralRecoilEnabled(
CachedObjectsParams.PARAM1_BOOL.param1);
945 case ERPCs.DIAG_WEAPON_BURST_VERSION:
956 case ERPCs.DIAG_BLEEDING_DISABLE_BLOOD_LOSS:
964 case ERPCs.DIAG_BLEEDING_ACTIVATE_SOURCE:
967 player.GetBleedingManagerServer().DebugActivateBleedingSource(
CachedObjectsParams.PARAM1_INT.param1);
972 case ERPCs.DIAG_BLEEDING_ACTIVATE_ALL_SOURCES:
974 player.GetBleedingManagerServer().ActivateAllBS();
982 case ERPCs.DIAG_LOGS_ACTIONS:
990 case ERPCs.DIAG_LOGS_WEAPONS:
998 case ERPCs.DIAG_LOGS_SYNC:
1006 case ERPCs.DIAG_LOGS_BASEBUILDING:
1014 case ERPCs.DIAG_LOGS_SYMPTOMS:
1022 case ERPCs.DIAG_LOGS_INVENTORY_MOVE:
1030 case ERPCs.DIAG_LOGS_INVENTORY_RESERVATION:
1038 case ERPCs.DIAG_LOGS_INVENTORY_HFSM:
1046 case ERPCs.DIAG_LOGS_QUICKBAR:
1054 case ERPCs.DIAG_LOGS_BLEEDING_CHANCES:
1064 case ERPCs.DIAG_BASEBUILDING_WOOD:
1072 case ERPCs.DIAG_BASEBUILDING_GATE:
1083 case ERPCs.DIAG_FINISHERS_FORCE_FINISHER:
1086 player.GetMeleeCombat().DebugSetForcedFinisherType(
CachedObjectsParams.PARAM1_INT.param1);
1094 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
1096 if (!player.m_CameraToolsMenuClient)
1098 player.m_CameraToolsMenuClient =
new CameraToolsMenuClient();
1101 player.m_CameraToolsMenuClient.OnRPC(ctx);
1109 case ERPCs.DIAG_TIMEACCEL:
1111 TimeAccelParam tap =
new TimeAccelParam(
false, 0, 0);
1115 FeatureTimeAccel.m_CurrentTimeAccel = tap;
1118 GetGame().GetPlayers(players);
1119 foreach (Man p : players)
1124 GetGame().RPCSingleParam( p,
ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, tap,
true, p.GetIdentity());
1143 case ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC:
1145 TimeAccelParam tap2 =
new TimeAccelParam(
false, 0, 0);
1149 int bigFactor = tap2.param2;
1150 float smallFactor = tap2.param2 - bigFactor;
1151 SetTimeAccelMenuState(tap2.param1, bigFactor, smallFactor, tap2.param3);
1152 FeatureTimeAccel.m_CurrentTimeAccel = tap2;
1160 case ERPCs.DIAG_VEHICLE_DEBUG_OUTPUT:
1167 case ERPCs.DIAG_VEHICLES_DUMP_CRASH_DATA_REQUEST:
1170 CrashDebugData.SendData(player);
1179 if (player.IsUnconscious())
1181 player.SetHealth(
"",
"Shock", 100);
1185 player.m_UnconsciousEndTime = -60;
1186 player.SetHealth(
"",
"Shock", 0);
1191 void InitTimeAccel()
1193 FeatureTimeAccel.m_CurrentTimeAccel = GetTimeAccelMenuState();
1197 if (
GetGame().CommandlineGetParam(
"timeAccel", value))
1201 value.Replace(
" ",
"");
1202 value.Split(
",", params);
1204 bool enable = params[0].ToInt();
1205 int timeAccelBig = params[1].ToInt();
1206 float timeAccelSmall = params[2].ToFloat();
1207 int bitMask = params[3].ToInt();
1209 SetTimeAccelMenuState(enable, timeAccelBig, timeAccelSmall, bitMask);
1213 TimeAccelParam GetTimeAccelMenuState()
1218 float timeAccel = timeAccelBig + timeAccelSmall;
1219 int bitMask = FeatureTimeAccel.GetTimeAccelBitmask();
1221 TimeAccelParam param =
new TimeAccelParam(enable, timeAccel, bitMask);
1225 void SetTimeAccelMenuState(
bool enable,
int bigFactor,
float smallFactor,
int bitmask)
1231 for (
int i = 0; i <
EnumTools.GetEnumSize(ETimeAccelCategories); ++i)
1234 bool on = (bit & bitmask);
1235 DiagMenu.SetValue(FeatureTimeAccel.GetDiagIDByCategory(bit), on);