custom_teams_and_roles
This is an old revision of the document!
Table of Contents
Custom Teams and Roles
Custom teams and roles are created by deriving from the BaseTeam class. New roles will automatically be picked up and loaded when the game first starts if they derive from this class.
Properties and methods
A number of properties and methods can be overridden to customize the team.
TerrorTown.TeamAlignment TeamAlignment- Determines how this team is aligned, relative to the other teams. You might set this toTeamAlignment.Innocentto inherit enemies of the innocents,TeamAlignment.Traitorto inherit enemies of the traitors,TeamAlignment.NoAlliesto make this team an enemy of everyone, orTeamAlignment.NoEnemiesto make this team friendly with all other teams.List<string> AdversaryTeams- Manually specify which teams are enemies of this team. You probably don't want to ever set this directly and useTeamAlignmentinstead.string TeamName- The name of this team. This will be visible to players.Color TeamColour- The color of this team. This will be visible to players.TerrorTown.TeamMemberVisibility TeamMemberVisibility- How this team looks to other teams. This is a bitfield - you can specify multiple of these values by separating them with a pipe (|). You might set this toTeamMemberVisibility.Publicif all players should know members affiliated with this team (i.e. Detectives),TeamMemberVisibility.Teamif players on this same team should know which players are on this team (i.e. Traitors),TeamMemberVisibility.Noneif no one but individual players should know the team they are on (i.e. Innocents),TeamMemberVisibility.PublicWhenConfirmedDeadif this team member's affiliation should be revealed when they die (i.e. Traitors).string VictimKillMessage- The message to show to a victim when they are killed by a member of this team, if that is enabled.string RoleDescription- The role description to show when the player is added to this team at the beginning of the round.string IdentifyString- The message that should be shown when a member of this team is confirmed dead.float TeamPlayerPercentage- The percentage of total players (minus spectators and slain players) that should be assigned to this role.bool ShouldWin()- Called periodically to determine whether this team has won the game. The default is to check whether all of this team's enemies are dead. For innocent and traitor-aligned teams, this should probably always return false.
Example roles
custom_teams_and_roles.1690771161.txt.gz · Last modified: 2023/07/31 02:39 by antigravities