ZombieComponent.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using Content.Shared.Antag;
  2. using Content.Shared.Chat.Prototypes;
  3. using Content.Shared.Chemistry.Reagent;
  4. using Content.Shared.Damage;
  5. using Content.Shared.Humanoid;
  6. using Content.Shared.Roles;
  7. using Content.Shared.StatusIcon;
  8. using Robust.Shared.Audio;
  9. using Robust.Shared.GameStates;
  10. using Robust.Shared.Prototypes;
  11. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  12. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  13. namespace Content.Shared.Zombies;
  14. [RegisterComponent, NetworkedComponent]
  15. public sealed partial class ZombieComponent : Component
  16. {
  17. /// <summary>
  18. /// The baseline infection chance you have if you are completely nude
  19. /// </summary>
  20. [ViewVariables(VVAccess.ReadWrite)]
  21. public float MaxZombieInfectionChance = 0.80f;
  22. /// <summary>
  23. /// The minimum infection chance possible. This is simply to prevent
  24. /// being invincible by bundling up.
  25. /// </summary>
  26. [ViewVariables(VVAccess.ReadWrite)]
  27. public float MinZombieInfectionChance = 0.25f;
  28. [ViewVariables(VVAccess.ReadWrite)]
  29. public float ZombieMovementSpeedDebuff = 0.70f;
  30. /// <summary>
  31. /// The skin color of the zombie
  32. /// </summary>
  33. [DataField("skinColor")]
  34. public Color SkinColor = new(0.45f, 0.51f, 0.29f);
  35. /// <summary>
  36. /// The eye color of the zombie
  37. /// </summary>
  38. [DataField("eyeColor")]
  39. public Color EyeColor = new(0.96f, 0.13f, 0.24f);
  40. /// <summary>
  41. /// The base layer to apply to any 'external' humanoid layers upon zombification.
  42. /// </summary>
  43. [DataField("baseLayerExternal")]
  44. public string BaseLayerExternal = "MobHumanoidMarkingMatchSkin";
  45. /// <summary>
  46. /// The attack arc of the zombie
  47. /// </summary>
  48. [DataField("attackArc", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  49. public string AttackAnimation = "WeaponArcBite";
  50. /// <summary>
  51. /// The role prototype of the zombie antag role
  52. /// </summary>
  53. [DataField("zombieRoleId", customTypeSerializer: typeof(PrototypeIdSerializer<AntagPrototype>))]
  54. public string ZombieRoleId = "Zombie";
  55. /// <summary>
  56. /// The CustomBaseLayers of the humanoid to restore in case of cloning
  57. /// </summary>
  58. [DataField("beforeZombifiedCustomBaseLayers")]
  59. public Dictionary<HumanoidVisualLayers, CustomBaseLayerInfo> BeforeZombifiedCustomBaseLayers = new ();
  60. /// <summary>
  61. /// The skin color of the humanoid to restore in case of cloning
  62. /// </summary>
  63. [DataField("beforeZombifiedSkinColor")]
  64. public Color BeforeZombifiedSkinColor;
  65. /// <summary>
  66. /// The eye color of the humanoid to restore in case of cloning
  67. /// </summary>
  68. [DataField("beforeZombifiedEyeColor")]
  69. public Color BeforeZombifiedEyeColor;
  70. [DataField("emoteId", customTypeSerializer: typeof(PrototypeIdSerializer<EmoteSoundsPrototype>))]
  71. public string? EmoteSoundsId = "Zombie";
  72. public EmoteSoundsPrototype? EmoteSounds;
  73. [DataField("nextTick", customTypeSerializer:typeof(TimeOffsetSerializer))]
  74. public TimeSpan NextTick;
  75. [DataField("zombieStatusIcon")]
  76. public ProtoId<FactionIconPrototype> StatusIcon { get; set; } = "ZombieFaction";
  77. /// <summary>
  78. /// Healing each second
  79. /// </summary>
  80. [DataField("passiveHealing")]
  81. public DamageSpecifier PassiveHealing = new()
  82. {
  83. DamageDict = new ()
  84. {
  85. { "Blunt", -0.4 },
  86. { "Slash", -0.2 },
  87. { "Piercing", -0.2 },
  88. { "Heat", -0.02 },
  89. { "Shock", -0.02 }
  90. }
  91. };
  92. /// <summary>
  93. /// A multiplier applied to <see cref="PassiveHealing"/> when the entity is in critical condition.
  94. /// </summary>
  95. [DataField("passiveHealingCritMultiplier")]
  96. public float PassiveHealingCritMultiplier = 2f;
  97. /// <summary>
  98. /// Healing given when a zombie bites a living being.
  99. /// </summary>
  100. [DataField("healingOnBite")]
  101. public DamageSpecifier HealingOnBite = new()
  102. {
  103. DamageDict = new()
  104. {
  105. { "Blunt", -2 },
  106. { "Slash", -2 },
  107. { "Piercing", -2 }
  108. }
  109. };
  110. /// <summary>
  111. /// Path to antagonist alert sound.
  112. /// </summary>
  113. [DataField("greetSoundNotification")]
  114. public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg");
  115. /// <summary>
  116. /// Hit sound on zombie bite.
  117. /// </summary>
  118. [DataField]
  119. public SoundSpecifier BiteSound = new SoundPathSpecifier("/Audio/Effects/bite.ogg");
  120. /// <summary>
  121. /// The blood reagent of the humanoid to restore in case of cloning
  122. /// </summary>
  123. [DataField("beforeZombifiedBloodReagent")]
  124. public string BeforeZombifiedBloodReagent = string.Empty;
  125. /// <summary>
  126. /// The blood reagent to give the zombie. In case you want zombies that bleed milk, or something.
  127. /// </summary>
  128. [DataField("newBloodReagent", customTypeSerializer: typeof(PrototypeIdSerializer<ReagentPrototype>))]
  129. public string NewBloodReagent = "ZombieBlood";
  130. }