Any idea how to add the Gingerbread people in the Christmas event dungeons?Solved

There are two types of NPCs that spawn in the Christmas event dungeons, "gingerbread_dungeon" for the ones with guns and "gingerbread_meleedungeon" - is there a way to get these to show up in the deathnotes as the killer and the victim as appropriate?

Hi, I noticed this too. I'm not sure if anyone also noticed that Halloween Scarecrows were broken, also. In any case, here are the fixes. First, open your deathnotes.cs plugin and replace the GetCombatEntityType function with:

		private CombatEntityType GetCombatEntityType(BaseEntity entity)
		{
			if (entity == null)
				return CombatEntityType.None;

			if (_combatEntityTypes.Contents != null)
			{
				if (_combatEntityTypes.Contents.ContainsKey(entity.GetType().Name))
					return _combatEntityTypes.Contents[entity.GetType().Name];

				if (_combatEntityTypes.Contents.ContainsKey(entity.ShortPrefabName))
					return _combatEntityTypes.Contents[entity.ShortPrefabName];
			}

			//Added by Terceran on 9/1/2024
			if (entity.GetType().Name.Equals("PatrolHelicopter"))
				return CombatEntityType.Helicopter;

			//Added by Terceran on 10/7/2024
			if (entity.GetType().Name.Equals("SimpleShark"))
            	return CombatEntityType.Animal;

			//Added by Terceran on 11/7/2024
			if (entity.GetType().Name.Equals("Wolf2"))
            	return CombatEntityType.Animal;

			if (entity is BaseOven)
				return CombatEntityType.HeatSource;

			if (entity is SimpleBuildingBlock)
				return CombatEntityType.ExternalWall;

			if (entity is BaseAnimalNPC)
				return CombatEntityType.Animal;

			if (entity is BaseTrap)
				return CombatEntityType.Trap;

			if (entity is Barricade)
				return CombatEntityType.Barricade;

			if (entity is IOEntity)
				return CombatEntityType.Trap;

			if (entity is ScientistNPC)
				return CombatEntityType.Scientist;

			//Added by Terceran on 20241218
			if (entity.GetType().Name.Equals("GingerbreadNPC"))
				return CombatEntityType.GingerbreadNPC;

			if (entity.GetType().Name.Equals("ZombieNPC"))
				return CombatEntityType.ZombieNPC;

			return CombatEntityType.Other;
		}​

Next, replace the GetEntityName function with:

		private string GetEntityName(BaseEntity entity, CombatEntityType combatEntityType)
		{
			// Entity may be null for helicopter or bradley, see HandleExceptions(...)
			if (entity == null &&
			    combatEntityType != CombatEntityType.Helicopter &&
			    combatEntityType != CombatEntityType.Bradley)
				return null;

			switch (combatEntityType)
			{
				case CombatEntityType.Player:
					return StripRichText(entity.ToPlayer().displayName);

				//Added CombatEnttiyType.GingerbreadNPC: case statement and changed Scarecrow to ScarecrowNPC by Terceran on 20241218
				case CombatEntityType.Murderer:
				case CombatEntityType.ScarecrowNPC:
				case CombatEntityType.Scientist:
				case CombatEntityType.ZombieNPC:
				case CombatEntityType.GingerbreadNPC:
					var name = entity.ToPlayer()?.displayName;

					if (!string.IsNullOrEmpty(name) && name != entity.ToPlayer()?.userID.ToString())
					{
						return name;
					}

					if (!_enemyPrefabs.Contents.ContainsKey(entity.ShortPrefabName))
					{
						return combatEntityType.ToString();
					}

					break;

				case CombatEntityType.TunnelDweller:
					return "Tunnel Dweller";

				case CombatEntityType.UnderwaterDweller:
					return "Underwater Dweller";

				case CombatEntityType.Helicopter:
					return "Patrol Helicopter (Karen)";

				case CombatEntityType.Bradley:
					return "Bradley APC";

				case CombatEntityType.Sentry:
					return "Sentry";
                
				case CombatEntityType.Fire:
					return entity.creatorEntity?.ToPlayer()?.displayName ?? "Fire";
			}

			if (_enemyPrefabs.Contents.ContainsKey(entity.ShortPrefabName))
				return _enemyPrefabs.Contents[entity.ShortPrefabName];

			return HumanizePascalCase(entity.GetType().Name);
		}​

 


Then, replace the "internal enum CombatEntityType" block with the below:
		internal enum CombatEntityType
		{
			Helicopter = 0,
			Bradley = 1,
			Animal = 2,
			Murderer = 3,
			Scientist = 4,
			Player = 5,
			Trap = 6,
			Turret = 7,
			Barricade = 8,
			ExternalWall = 9,
			HeatSource = 10,
			Fire = 11,
			Lock = 12,
			Sentry = 13,
			Other = 14,
			None = 15,
			//Changed by Terceran on 20241218
			ScarecrowNPC = 16,
			TunnelDweller = 17,
			UnderwaterDweller = 18,
			ZombieNPC = 19,
			//Added by Terceran on 20241218
			GingerbreadNPC = 20
		}​

That's it for the code changes. Next, you will need to update your config/DeathNotes.json file such that:
  1. The Names block contains "ScarecrowNPC": "Scarecrow" and "GingerbreadNPC": "Gingerbread Man"
  2. You create death messages for both GingerbreadNPC and ScarecrowNPC. An example of what mine looks like below:
      {
        "KillerType": "Player",
        "VictimType": "ScarecrowNPC",
        "DamageType": "*",
        "Messages": [
          "{killer} fought off a spooky {victim} with their {weapon}."
        ]
      },
      {
        "KillerType": "Player",
        "VictimType": "ScarecrowNPC",
        "DamageType": "Bullet",
        "Messages": [
          "{killer} did some scaring of their own against a {victim} with their {weapon} over a distance of {distance}."
        ]
      },
      {
        "KillerType": "Player",
        "VictimType": "GingerbreadNPC",
        "DamageType": "*",
        "Messages": [
          "{killer} fought off a deliciously deadly {victim} with their {weapon}."
        ]
      },
      {
        "KillerType": "Player",
        "VictimType": "GingerbreadNPC",
        "DamageType": "Bullet",
        "Messages": [
          "{killer} took a bite out of a deliciously deadly {victim} with their {weapon} over a distance of {distance}."
        ]
      },​
If anyone runs into any issues, message me your Email address and I can send you my files. Enjoy!

Oh wow, you absolute legend! This worked perfectly, thank you!

You are very welcome. If you're happy with the fix, please change the status of this ticket to Solved.