C# Class AlertSpeaker.Building_AlertSpeaker

AlertSpeaker class.
Inheritance: Building
Afficher le fichier Open project: Rikiki123456789/Rimworld Class Usage Examples

Méthodes publiques

Свойство Type Description
alarmSoundTick int
alertStartTick int
currentDangerRate StoryDanger
glowColor ColorInt
glowRadius float
glowerComp CompGlower
highDangerAlarmSound SoundDef
highDangerDrawingTick int
lastUpdateTick int
lowDangerAlarmSound SoundDef
lowDangerDrawingTick int
numberOfAlertSpeakers int
powerComp CompPowerTrader
previousDangerRate StoryDanger
sirenSoundDisabledIcon UnityEngine.Texture2D
sirenSoundEnabledIcon UnityEngine.Texture2D
soundIsActivated bool

Méthodes publiques

Méthode Description
CheckIfColonistHasAMediumAdrenalineBoostBonus ( Pawn colonist ) : bool

Check if the given colonist has a medium adrenaline boost bonus.

CheckIfColonistHasASmallAdrenalineBoostBonus ( Pawn colonist ) : bool

Check if the given colonist has a small adrenaline boost bonus.

CheckIfColonistHasASmallStressMalus ( Pawn colonist ) : bool

Check if the given colonist has a small stress malus.

CheckIfSupportingWallIsAlive ( IntVec3 alertSpeakerPosition, Rot4 alertSpeakerRotation ) : bool

Checks if the wall supporting the alert speaker is still alive.

ComputeDrawingParameters ( ) : void

Compute the global drawing parameters. o danger rate == None => small green light. o danger rate == Low => medium yellow light ramping up and down. o danger rate == High => big flashing red light.

Destroy ( DestroyMode mode = DestroyMode.Vanish ) : void

Destroys the alert speaker and remove any bonus/malus i fthere are no more on the map.

DisplayActiveMote ( ) : void

Displays the active mote when applicable.

Draw ( ) : void

Performs the drawing treatment. Applies the drawing parameters.

ExposeData ( ) : void

Saves and loads variables (stored in savegame data).

GetEffectZoneCells ( IntVec3 alertSpeakerPosition ) : List

Get the effect zone cells.

GetGizmos ( ) : IEnumerable

This creates the command buttons to control the alert speaker sound activation.

PerformDrawingTreatment ( ) : void

Performs the drawing treatment. Applies the drawing parameters.

PerformSirenSoundAction ( ) : void

Activates/deactivates siren sound.

PerformSoundTreatment ( ) : void

Performs the sound treatment. o danger rate == None => no sound. o danger rate == Low => plays low danger alarm sound o danger rate == High => plays high danger alarm sound

PerformTreatmentDuringAlert ( ) : void

Performs the treatments during an alert according to the current danger rate. o danger rate == None => no bonus. o danger rate == Low => * early phase: small adrenaline boost. * middle and late phase: no bonus. o danger rate == High => * early phase: medium adrenaline boost. * middle phase: no bonus. * late phase: small stress malus.

PerformTreatmentOnDangerRateTransition ( ) : void

Check if a danger rate transition is occuring and perform the corresponding treatment. Transitions management: Transition 1: beginning alert. => set the alert start tick. Transition 2: finished alert. => remove any stat bonus/malus and malus thought. => add a bonus thought. Transition 3: increased danger rating. => convert the small adrenaline boost into medium adrenaline boost. Transition 4: decreased danger rating. => keep the medium adrenaline boost (nothing to do).

PlayOneHighDangerAlarmSound ( ) : void

Play one high danger alarm sound.

PlayOneLowDangerAlarmSound ( ) : void

Play one low danger alarm sound.

RemoveAnyStatBonusFromAllColonists ( ) : void

Remove any stat bonus from all colonists.

RemoveAnyStatMalusFromAllColonists ( ) : void

Remove any stat malus from all colonists.

RemoveAnyThoughtBonusFromAllColonists ( ) : void

Remove any thought bonus from all colonists.

RemoveAnyThoughtMalusFromAllColonists ( ) : void

Remove any thought malus from all colonists.

SpawnSetup ( ) : void

Initializes instance variables.

Tick ( ) : void

- Checks if the supporting wall is still alive. - Checks current threat level. - Performs adequate treatment when a danger level transition occurs. - Applies an adrenaline bonus to nearby colonists according to current danger rate.

TryApplyColonyIsThreatenedThoughtToAllColonists ( ) : void

Try to apply the "colony is threathened" malus thought to all colonists.

TryApplyMediumAdrenalineBoostBonusToColonists ( List colonistList ) : void

Try to apply a medium adrenaline boost bonus to each colonist if he has not already one.

TryApplySmallAdrenalineBoostBonusToColonists ( List colonistList ) : void

Try to apply a small adrenaline boost to each colonist if he has not already a small or a medium one.

TryApplySmallStressMalusToAllColonists ( ) : void

Try to apply a small stress malus to all colonists.

TryApplyThreatIsFinishedThoughtToAllColonists ( ) : void

Try to apply the "threat is finished" thought to all colonists.

Method Details

CheckIfColonistHasAMediumAdrenalineBoostBonus() public méthode

Check if the given colonist has a medium adrenaline boost bonus.
public CheckIfColonistHasAMediumAdrenalineBoostBonus ( Pawn colonist ) : bool
colonist Pawn
Résultat bool

CheckIfColonistHasASmallAdrenalineBoostBonus() public méthode

Check if the given colonist has a small adrenaline boost bonus.
public CheckIfColonistHasASmallAdrenalineBoostBonus ( Pawn colonist ) : bool
colonist Pawn
Résultat bool

CheckIfColonistHasASmallStressMalus() public méthode

Check if the given colonist has a small stress malus.
public CheckIfColonistHasASmallStressMalus ( Pawn colonist ) : bool
colonist Pawn
Résultat bool

CheckIfSupportingWallIsAlive() public static méthode

Checks if the wall supporting the alert speaker is still alive.
public static CheckIfSupportingWallIsAlive ( IntVec3 alertSpeakerPosition, Rot4 alertSpeakerRotation ) : bool
alertSpeakerPosition IntVec3
alertSpeakerRotation Rot4
Résultat bool

ComputeDrawingParameters() public méthode

Compute the global drawing parameters. o danger rate == None => small green light. o danger rate == Low => medium yellow light ramping up and down. o danger rate == High => big flashing red light.
public ComputeDrawingParameters ( ) : void
Résultat void

Destroy() public méthode

Destroys the alert speaker and remove any bonus/malus i fthere are no more on the map.
public Destroy ( DestroyMode mode = DestroyMode.Vanish ) : void
mode DestroyMode
Résultat void

DisplayActiveMote() public méthode

Displays the active mote when applicable.
public DisplayActiveMote ( ) : void
Résultat void

Draw() public méthode

Performs the drawing treatment. Applies the drawing parameters.
public Draw ( ) : void
Résultat void

ExposeData() public méthode

Saves and loads variables (stored in savegame data).
public ExposeData ( ) : void
Résultat void

GetEffectZoneCells() public static méthode

Get the effect zone cells.
public static GetEffectZoneCells ( IntVec3 alertSpeakerPosition ) : List
alertSpeakerPosition IntVec3
Résultat List

GetGizmos() public méthode

This creates the command buttons to control the alert speaker sound activation.
public GetGizmos ( ) : IEnumerable
Résultat IEnumerable

PerformDrawingTreatment() public méthode

Performs the drawing treatment. Applies the drawing parameters.
public PerformDrawingTreatment ( ) : void
Résultat void

PerformSirenSoundAction() public méthode

Activates/deactivates siren sound.
public PerformSirenSoundAction ( ) : void
Résultat void

PerformSoundTreatment() public méthode

Performs the sound treatment. o danger rate == None => no sound. o danger rate == Low => plays low danger alarm sound o danger rate == High => plays high danger alarm sound
public PerformSoundTreatment ( ) : void
Résultat void

PerformTreatmentDuringAlert() public méthode

Performs the treatments during an alert according to the current danger rate. o danger rate == None => no bonus. o danger rate == Low => * early phase: small adrenaline boost. * middle and late phase: no bonus. o danger rate == High => * early phase: medium adrenaline boost. * middle phase: no bonus. * late phase: small stress malus.
public PerformTreatmentDuringAlert ( ) : void
Résultat void

PerformTreatmentOnDangerRateTransition() public méthode

Check if a danger rate transition is occuring and perform the corresponding treatment. Transitions management: Transition 1: beginning alert. => set the alert start tick. Transition 2: finished alert. => remove any stat bonus/malus and malus thought. => add a bonus thought. Transition 3: increased danger rating. => convert the small adrenaline boost into medium adrenaline boost. Transition 4: decreased danger rating. => keep the medium adrenaline boost (nothing to do).
public PerformTreatmentOnDangerRateTransition ( ) : void
Résultat void

PlayOneHighDangerAlarmSound() public méthode

Play one high danger alarm sound.
public PlayOneHighDangerAlarmSound ( ) : void
Résultat void

PlayOneLowDangerAlarmSound() public méthode

Play one low danger alarm sound.
public PlayOneLowDangerAlarmSound ( ) : void
Résultat void

RemoveAnyStatBonusFromAllColonists() public méthode

Remove any stat bonus from all colonists.
public RemoveAnyStatBonusFromAllColonists ( ) : void
Résultat void

RemoveAnyStatMalusFromAllColonists() public méthode

Remove any stat malus from all colonists.
public RemoveAnyStatMalusFromAllColonists ( ) : void
Résultat void

RemoveAnyThoughtBonusFromAllColonists() public méthode

Remove any thought bonus from all colonists.
public RemoveAnyThoughtBonusFromAllColonists ( ) : void
Résultat void

RemoveAnyThoughtMalusFromAllColonists() public méthode

Remove any thought malus from all colonists.
public RemoveAnyThoughtMalusFromAllColonists ( ) : void
Résultat void

SpawnSetup() public méthode

Initializes instance variables.
public SpawnSetup ( ) : void
Résultat void

Tick() public méthode

- Checks if the supporting wall is still alive. - Checks current threat level. - Performs adequate treatment when a danger level transition occurs. - Applies an adrenaline bonus to nearby colonists according to current danger rate.
public Tick ( ) : void
Résultat void

TryApplyColonyIsThreatenedThoughtToAllColonists() public méthode

Try to apply the "colony is threathened" malus thought to all colonists.
public TryApplyColonyIsThreatenedThoughtToAllColonists ( ) : void
Résultat void

TryApplyMediumAdrenalineBoostBonusToColonists() public méthode

Try to apply a medium adrenaline boost bonus to each colonist if he has not already one.
public TryApplyMediumAdrenalineBoostBonusToColonists ( List colonistList ) : void
colonistList List
Résultat void

TryApplySmallAdrenalineBoostBonusToColonists() public méthode

Try to apply a small adrenaline boost to each colonist if he has not already a small or a medium one.
public TryApplySmallAdrenalineBoostBonusToColonists ( List colonistList ) : void
colonistList List
Résultat void

TryApplySmallStressMalusToAllColonists() public méthode

Try to apply a small stress malus to all colonists.
public TryApplySmallStressMalusToAllColonists ( ) : void
Résultat void

TryApplyThreatIsFinishedThoughtToAllColonists() public méthode

Try to apply the "threat is finished" thought to all colonists.
public TryApplyThreatIsFinishedThoughtToAllColonists ( ) : void
Résultat void

Property Details

alarmSoundTick public_oe static_oe property

public static int alarmSoundTick
Résultat int

alertStartTick public_oe static_oe property

public static int alertStartTick
Résultat int

currentDangerRate public_oe static_oe property

public static StoryDanger currentDangerRate
Résultat StoryDanger

glowColor public_oe static_oe property

public static ColorInt glowColor
Résultat ColorInt

glowRadius public_oe static_oe property

public static float glowRadius
Résultat float

glowerComp public_oe property

public CompGlower glowerComp
Résultat CompGlower

highDangerAlarmSound public_oe static_oe property

public static SoundDef highDangerAlarmSound
Résultat SoundDef

highDangerDrawingTick public_oe static_oe property

public static int highDangerDrawingTick
Résultat int

lastUpdateTick public_oe static_oe property

public static int lastUpdateTick
Résultat int

lowDangerAlarmSound public_oe static_oe property

public static SoundDef lowDangerAlarmSound
Résultat SoundDef

lowDangerDrawingTick public_oe static_oe property

public static int lowDangerDrawingTick
Résultat int

numberOfAlertSpeakers public_oe static_oe property

public static int numberOfAlertSpeakers
Résultat int

powerComp public_oe property

public CompPowerTrader powerComp
Résultat CompPowerTrader

previousDangerRate public_oe static_oe property

public static StoryDanger previousDangerRate
Résultat StoryDanger

sirenSoundDisabledIcon public_oe property

public Texture2D,UnityEngine sirenSoundDisabledIcon
Résultat UnityEngine.Texture2D

sirenSoundEnabledIcon public_oe property

public Texture2D,UnityEngine sirenSoundEnabledIcon
Résultat UnityEngine.Texture2D

soundIsActivated public_oe static_oe property

public static bool soundIsActivated
Résultat bool