Class QuestResource
All quest resources hosted by a quest must inherit from this base class. Symbol will be set by inheriting class after parsing source text.
Namespace: DaggerfallWorkshop.Game.Questing
Assembly: Assembly-CSharp.dll
Syntax
public abstract class QuestResource : IDisposable
Constructors
| Improve this Doc View SourceQuestResource(Quest)
Constructor.
Declaration
public QuestResource(Quest parentQuest)
Parameters
Type | Name | Description |
---|---|---|
Quest | parentQuest | Parent quest owning this resource. Can be null. |
Fields
| Improve this Doc View SourceBLANK
Declaration
public const string BLANK = "BLANK"
Field Value
Type | Description |
---|---|
String |
Properties
| Improve this Doc View SourceGender
Gets resource gender where available. Will default to Male if inheriting class does not override.
Declaration
public virtual Genders Gender { get; }
Property Value
Type | Description |
---|---|
Genders |
HasPlayerClicked
Gets flag stating if player has clicked on this Person resource in world. If consuming click rearm using RearmPlayerClick().
Declaration
public bool HasPlayerClicked { get; }
Property Value
Type | Description |
---|---|
Boolean |
InfoMessageID
Gets or sets message ID for "tell me about" this resource in dialog. -1 is default and means no message of this type is associated with this resource.
Declaration
public int InfoMessageID { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
IsHidden
Gets or sets flag to hide this quest resource in world. Has no effect on Foes or quest resources not active inside scene.
Declaration
public bool IsHidden { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ParentQuest
Parent quest of this quest resource (if any).
Declaration
public Quest ParentQuest { get; }
Property Value
Type | Description |
---|---|
Quest |
QuestResourceBehaviour
Gets or sets reference to QuestResourceBehaviour in scene. This property is not serialized - it should be set at time of injection or deserialization.
Declaration
public QuestResourceBehaviour QuestResourceBehaviour { get; set; }
Property Value
Type | Description |
---|---|
QuestResourceBehaviour |
RumorsMessageID
Gets or sets message ID for "any news?" about this resource in dialog. -1 is default and means no message of this type is associated with this resource.
Declaration
public int RumorsMessageID { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Symbol
Symbol of this quest resource (if any).
Declaration
public Symbol Symbol { get; protected set; }
Property Value
Type | Description |
---|---|
Symbol |
UsedMessageID
Gets or sets message ID to display when resource (item) is used by player. -1 is default and means no message of this type is associated with this resource.
Declaration
public int UsedMessageID { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceDispose()
Called when quest ends so resource can clean up.
Declaration
public virtual void Dispose()
ExpandMacro(MacroTypes, out String)
Expand a macro from this resource.
Declaration
public virtual bool ExpandMacro(MacroTypes macro, out string textOut)
Parameters
Type | Name | Description |
---|---|---|
MacroTypes | macro | Type of macro to expand. |
String | textOut | Expanded text for this macro type. Empty if macro cannot be expanded. |
Returns
Type | Description |
---|---|
Boolean | True if macro expanded, otherwise false. |
GetMessage(Int32)
Declaration
public List<TextFile.Token[]> GetMessage(int messageId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | messageId |
Returns
Type | Description |
---|---|
List<TextFile.Token[]> |
GetResourceSaveData()
Get full resource save data including resource specific data.
Declaration
public QuestResource.ResourceSaveData_v1 GetResourceSaveData()
Returns
Type | Description |
---|---|
QuestResource.ResourceSaveData_v1 |
GetSaveData()
Request resource-specific save data only for serialization. Must be handled by implementing class.
Declaration
public abstract object GetSaveData()
Returns
Type | Description |
---|---|
Object |
ParseMessageTags(String)
Parse optional message tags from this resource.
Declaration
protected void ParseMessageTags(string line)
Parameters
Type | Name | Description |
---|---|---|
String | line |
PostTick(Quest)
Called at the end of every quest tick. Allows quest resources to perform some cleanup action after actions have run for this tick.
Declaration
public virtual void PostTick(Quest caller)
Parameters
Type | Name | Description |
---|---|---|
Quest | caller |
RearmPlayerClick()
Rearm click so player can click again if quest allows it.
Declaration
public void RearmPlayerClick()
RestoreResourceSaveData(QuestResource.ResourceSaveData_v1)
Restore full resource save data including resource specific data.
Declaration
public void RestoreResourceSaveData(QuestResource.ResourceSaveData_v1 data)
Parameters
Type | Name | Description |
---|---|---|
QuestResource.ResourceSaveData_v1 | data |
RestoreSaveData(Object)
Restore resource-specific deserialized data only. Must be handled by implementing class.
Declaration
public abstract void RestoreSaveData(object dataIn)
Parameters
Type | Name | Description |
---|---|---|
Object | dataIn |
SetPlayerClicked()
Check if player click has been triggered.
Declaration
public void SetPlayerClicked()
SetResource(String)
Set the resource source line. Always call this base method to ensure optional message tags are parsed.
Declaration
public virtual void SetResource(string line)
Parameters
Type | Name | Description |
---|---|---|
String | line | Source line for this resource. |
Tick(Quest)
Called every Quest tick. Allows quest resources to perform some action. Quest will not call Tick() on ActionTemplate items, they should override Update() instead.
Declaration
public virtual void Tick(Quest caller)
Parameters
Type | Name | Description |
---|---|---|
Quest | caller |