-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIExamineActionInterruptable.cs
41 lines (40 loc) · 1.62 KB
/
IExamineActionInterruptable.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Il2Cpp;
namespace ExamineActionsAPI
{
/// <summary>
/// Actions implementing this may be interrupted when conditions met.
/// You may want to always implement this for long actions so players won't die when performing your actions.
/// </summary>
public interface IExamineActionInterruptable
{
/// <summary>
/// Action not finished, for example: light goes out during during the process.
/// Note that you may want to call this in IExamineAction.OnActionInterruptedBySystem so both types of interruption results the same
/// </summary>
void OnInterruption (ExamineActionState state);
/// <summary>
/// Will the subject be consumed on interruption
/// </summary>
bool ShouldConsumeOnInterruption (ExamineActionState state) => false;
ActionsToBlock? GetLightRequirementType (ExamineActionState state);
bool InterruptOnStarving { get; }
bool InterruptOnExhausted { get; }
bool InterruptOnFreezing { get; }
bool InterruptOnDehydrated { get; }
/// <summary>
/// Will (non-risk) afflictions interrupt the action. (Non-Risk means not something like Infection Risk)
/// </summary>
bool InterruptOnNonRiskAffliction { get; }
/// <summary>
/// When the player's condition is below this value, the action will be interrupted
/// </summary>
/// <value>0-1</value>
float NormalizedConditionInterruptThreshold { get; }
/// <summary>
/// Define custom conditions to trigger interruption. It is recommended to show HUDMessage to explain to player on returning true.
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
bool ShouldInterrupt (ExamineActionState state) => false;
}
}