Skip to content

Cannibal health gain and victim digestion#924

Open
joel4848 wants to merge 8 commits intoCustom-Roles-for-TTT:devfrom
joel4848:dev
Open

Cannibal health gain and victim digestion#924
joel4848 wants to merge 8 commits intoCustom-Roles-for-TTT:devfrom
joel4848:dev

Conversation

@joel4848
Copy link
Contributor

@joel4848 joel4848 commented Mar 3, 2026

Changelog

  • Added Cannibal gaining a configurable percentage of their victims' health
  • Added Cannibal 'digesting' (permamnently killing) their victims a configurable amount of time after eating them
  • Added Cannibal dropping a poop when a victim is fully digested, with or without an audible cue

Affected Issues

Checklist

  • Tested in-game
  • Release Notes updated
  • API Docs updated
    • Markdown
    • Website (changes marked with "beta only" notation if applicable)
  • If this is for a new role:
    • Icons created
    • Tutorial created
    • Documentation
      • CONVARS.md
      • Website (changes marked with "beta only" notation if applicable)
    • ConVars added to ULX list
    • plymeta:IsRoleAbilityDisabled used
  • Otherwise:
    • CONVARS.md updated, if applicable
    • ULX updated (either added to list of convars for a role, or PR created in ULX repo [Add link below])

Copy link
Member

@Malivil Malivil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the other comments, add attribution for the sounds and poop model to the README.md

if gainedhealthpercentage == 0 then
gainedhealth = 100
else
gainedhealthunrounded = (gainedhealthpercentage / 100) * victimhealth
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gainedhealthunrounded = (gainedhealthpercentage / 100) * victimhealth
local gainedhealthunrounded = (gainedhealthpercentage / 100) * victimhealth


-- Cannibal health gain
if self.GainsHealthConVar:GetBool() then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

if newcannibalhealth > cannibalhealth then
owner:SetHealth(newcannibalhealth)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


-- Victim digestion
if self.DigestsVictimsConVar:GetBool() then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

if self.DigestsVictimsConVar:GetBool() then

local digestiontime = self.DigestionTimeConVar:GetInt()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


ttt_cannibal_gains_health 1 // Whether the Cannibal gains their victim's health when eating them
ttt_cannibal_gained_health_percentage 100 // What percentage of their victim's health the Cannibal gains (set to 0 to always gain a flat 100HP)
ttt_cannibal_digests_victims 1 // Whether the Cannibal digests and permanently kills their victims over time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ttt_cannibal_digests_victims 1 // Whether the Cannibal digests and permanently kills their victims over time
ttt_cannibal_digestion_bones 1 // Whether the Cannibal digests and permanently kills their victims over time

ttt_cannibal_gained_health_percentage 100 // What percentage of their victim's health the Cannibal gains (set to 0 to always gain a flat 100HP)
ttt_cannibal_digests_victims 1 // Whether the Cannibal digests and permanently kills their victims over time
ttt_cannibal_digestion_time 30 // How long in seconds a victim takes to be digested when eaten (set to 0 for immediate digestion)
ttt_cannibal_does_poopy 1 // Whether the Cannibal poops themselves when a victim is digested
Copy link
Member

@Malivil Malivil Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ttt_cannibal_does_poopy 1 // Whether the Cannibal poops themselves when a victim is digested
ttt_cannibal_digestion_poop 1 // Whether the Cannibal drops poop when a victim is digested

ttt_cannibal_digests_victims 1 // Whether the Cannibal digests and permanently kills their victims over time
ttt_cannibal_digestion_time 30 // How long in seconds a victim takes to be digested when eaten (set to 0 for immediate digestion)
ttt_cannibal_does_poopy 1 // Whether the Cannibal poops themselves when a victim is digested
ttt_cannibal_does_poopy_noise 1 // Whether the Cannibal's poops produce an audible cue
Copy link
Member

@Malivil Malivil Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ttt_cannibal_does_poopy_noise 1 // Whether the Cannibal's poops produce an audible cue
ttt_cannibal_digestion_poop_sound 1 // Whether the Cannibal causes a sound when poop is dropped from a digested victim

ttt_cannibal_can_see_jesters 0 // Whether jesters are revealed (via head icons, color/icon on the scoreboard, etc.) to the Cannibal (Only applies if ttt_cannibal_is_independent is enabled)
ttt_cannibal_update_scoreboard 0 // Whether the Cannibal shows dead players as missing in action (Only applies if ttt_cannibal_is_independent is enabled)


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -765,6 +765,14 @@ ttt_cannibal_damage_penalty 0 // The fraction a Canniba
ttt_cannibal_can_see_jesters 0 // Whether jesters are revealed (via head icons, color/icon on the scoreboard, etc.) to the Cannibal (Only applies if ttt_cannibal_is_independent is enabled)
ttt_cannibal_update_scoreboard 0 // Whether the Cannibal shows dead players as missing in action (Only applies if ttt_cannibal_is_independent is enabled)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


html = html .. "<span style='display: block; margin-top: 10px;'>Eaten players are not dead, but they are <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>unable to do anything</span> except talk with other eaten players and spectate the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. ".</span>"
if GetConVar("ttt_cannibal_digests_victims"):GetBool() then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

html = html .. "<span style='display: block; margin-top: 10px;'>Eaten players are <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>digested and killed </span>" .. GetConVar("ttt_cannibal_digestion_time"):GetInt() .. " seconds after being eaten.</span>"

html = html .. "<span style='display: block; margin-top: 10px;'>If the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. " dies, all undigested eaten players are <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>freed</span> at the position where the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. " died.</span>"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

html = html .. "<span style='display: block; margin-top: 10px;'>If the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. " dies, all undigested eaten players are <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>freed</span> at the position where the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. " died.</span>"

else

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

html = html .. "<span style='display: block; margin-top: 10px;'>Eaten players are not dead, but they are <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>unable to do anything</span> except talk with other eaten players and spectate the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. ".</span>"

html = html .. "<span style='display: block; margin-top: 10px;'>If the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. " dies, all eaten players are <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>freed</span> at the position where the " .. ROLE_STRINGS[ROLE_CANNIBAL] .. " died.</span>"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Member

@Malivil Malivil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more tweak

end

-- Victim digestion
if self.DigestsVictimsConVar:GetBool() then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.DigestsVictimsConVar:GetBool() then
if self.DigestionConVar:GetBool() then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants