10 [
Serialize(0.0f,
IsPropertySaveable.No, description:
"How far along the scan is. When the timer goes above ScanDuration, the scan is completed.")]
21 bool wasScanCompletedPreviously = IsScanCompleted;
22 scanTimer = Math.Max(0.0f, value);
23 if (!wasScanCompletedPreviously && IsScanCompleted)
25 OnScanCompleted?.Invoke(
this);
28 if (wasScanCompletedPreviously != IsScanCompleted || Math.Abs(LastSentScanTimer - scanTimer) > 0.1f)
30 item.CreateServerEvent(
this);
31 LastSentScanTimer = scanTimer;
38 [
Serialize(
true,
IsPropertySaveable.No, description:
"Should the progress bar always be displayed when the item has been attached.")]
46 private bool IsScanCompleted => scanTimer >=
ScanDuration;
48 private float scanTimer;
77 partial
void UpdateProjSpecific();
85 DebugConsole.ThrowError(
"Error in initializing a Scanner component: an attachable Holdable component is required on the same item and none was found",
void IncreaseSoundRange(float deltaTime, float speed=1)
static NetworkMember NetworkMember
The base class for components holding the different functionalities of the item
void ApplyStatusEffects(ActionType type, float deltaTime, Character character=null, Limb targetLimb=null, Entity useTarget=null, Character user=null, Vector2? worldPosition=null, float afflictionMultiplier=1.0f)
bool DisplayProgressBar
Should the progress bar be displayed. Use when AlwaysDisplayProgressBar is set to false.
override void Update(float deltaTime, Camera cam)
override void OnItemLoaded()
Called when all the components of the item have been loaded. Use to initialize connections between co...
Scanner(Item item, ContentXElement element)
bool AlwaysDisplayProgressBar
Action< Scanner > OnScanStarted
ContentPackage? ContentPackage
ActionType
ActionTypes define when a StatusEffect is executed.