FB2CrimeComponent
Overview
- Component that manages crime-related state.
Metadata
| Field | Value |
|---|---|
| Kind | component |
| Environment | B2 - Simulation |
| Category | components |
| Extends | FB2Component |
| Require | require('Components.B2CrimeComponent') |
Properties (5)
| Name | Type | Description |
|---|---|---|
CrimeScores | table<string, number> | |
CriminalBehaviorHistory | FB1CriminalBehaviorHistory | |
ImprisonmentHistory | FB1ImprisonmentHistory | |
PendingImprisonment | FB1PendingImprisonment | |
TrialHistory | FB1TrialHistory |
Functions (20)
| Function | Parameters | Returns | Description |
|---|---|---|---|
AddCrimeScore | CrimeId: string, ScoreToAdd: number | - | Adds Crime Score. |
ClearPendingImprisonment | - | - | Clears Pending Imprisonment. |
GetCrimeScore | CrimeId: string | number | Returns Crime Score. |
GetCriminalBehaviorCount | CrimeId: string | integer | Returns Criminal Behavior Count. |
GetCriminalBehaviorCounts | - | table<string, integer> | Returns Criminal Behavior Counts. |
GetCriminalBehaviorHistory | - | FB1CriminalBehaviorHistory | Returns Criminal Behavior History. |
GetImprisonmentCount | - | integer | Returns Imprisonment Count. |
GetPendingImprisonment | - | FB1PendingImprisonment | Returns Pending Imprisonment. |
GetTrialCount | - | integer | Returns Trial Count. |
HasPendingImprisonment | - | boolean | Returns whether it has Pending Imprisonment. |
HasTrialToday | - | boolean | Returns whether it has Trial Today. |
IncreaseTrialCount | - | - | |
IsInPrison | - | boolean | Returns whether In Prison. |
OnInteractionFinished | InteractionId: string, TargetEntityId: FB1EntityId, InteractionTags: string[] | - | Callback invoked on Interaction Finished. |
OnInteractionSequenceFinished | InteractionBagId: string, TargetEntityId: FB1EntityId, bIsTalk: boolean | - | Callback invoked on Interaction Sequence Finished. |
OnMobileMessageSent | MessageTags: string[], TargetEntityId: FB1EntityId | - | Callback invoked on Mobile Message Sent. |
OnVehicleAccidentCaused | VehicleAccidentId: string, TargetEntityId: FB1EntityId | - | Callback invoked on Vehicle Accident Caused. |
ResetAllCrimeScores | - | - | Resets All Crime Scores. |
ResetCrimeScore | CrimeId: string | - | Resets Crime Score. |
SetPendingImprisonment | InPendingImprisonment: FB1PendingImprisonment | - | Sets Pending Imprisonment. |
Override points (9)
Implement these in Lua as FB2CrimeComponent.Override_Name = function(...) end.
| Function | Parameters | Returns | Description |
|---|---|---|---|
Override_AddCrimeScore | CrimeId: string, ScoreToAdd: number | - | Adds Crime Score. |
Override_HasTrialToday | - | boolean | Returns whether it has Trial Today. |
Override_IncreaseTrialCount | - | - | |
Override_OnInteractionFinished | InteractionId: string, TargetEntityId: FB1EntityId, InteractionTags: string[] | - | Callback invoked on Interaction Finished. |
Override_OnInteractionSequenceFinished | InteractionBagId: string, TargetEntityId: FB1EntityId, bIsTalk: boolean | - | Callback invoked on Interaction Sequence Finished. |
Override_OnMobileMessageSent | MessageTags: string[], TargetEntityId: FB1EntityId | - | Callback invoked on Mobile Message Sent. |
Override_OnVehicleAccidentCaused | VehicleAccidentId: string, TargetEntityId: FB1EntityId | - | Callback invoked on Vehicle Accident Caused. |
Override_ResetAllCrimeScores | - | - | Resets All Crime Scores. |
Override_ResetCrimeScore | CrimeId: string | - | Resets Crime Score. |