Skip to content

Commit

Permalink
[docs, website] Final comments
Browse files Browse the repository at this point in the history
- Added comments to all uncommented remaining files
- Updated README a bit
- Added website
- Updated package.json
  • Loading branch information
Owmacohe committed Dec 26, 2023
1 parent 03c04a4 commit 0182960
Show file tree
Hide file tree
Showing 60 changed files with 1,673 additions and 483 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
// Please see https://omch.tech/descant/#changedchoice for documentation

using System;
using System.Collections.Generic;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(float.PositiveInfinity), NodeType(DescantNodeType.Choice)]
public class ChangedChoice : DescantNodeComponent
public class ChangedChoice : DescantComponent
{
[Inline] public string ActorName;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
// Please see https://omch.tech/descant/#changedresponse for documentation

using System;
using System.Collections.Generic;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(float.PositiveInfinity), NodeType(DescantNodeType.Response)]
public class ChangedResponse : DescantNodeComponent
public class ChangedResponse : DescantComponent
{
[Inline] public string ActorName;

Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions Components/Nodes/Event.cs → Components/Custom/Event.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
// Please see https://omch.tech/descant/#event for documentation

using System;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(float.PositiveInfinity), NodeType(DescantNodeType.Any)]
public class Event : DescantNodeComponent
public class Event : DescantComponent
{
[Inline] public string ObjectTag;
[ParameterGroup("Script to find")] public string ScriptName;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
// Please see https://omch.tech/descant/#interruptable for documentation

using System;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(float.PositiveInfinity), NodeType(DescantNodeType.Response)]
public class Interruptable : DescantNodeComponent
public class Interruptable : DescantComponent
{
[ParameterGroup("Keys/buttons to check")] public string KeyCode;
[ParameterGroup("Keys/buttons to check")] public string ButtonName;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
// Please see https://omch.tech/descant/#lockedchoice for documentation

using System;

namespace DescantComponents
{
[Serializable, MaxQuantity(Single.PositiveInfinity), NodeType(DescantNodeType.Choice)]
public class LockedChoice : DescantNodeComponent
public class LockedChoice : DescantComponent
{
[Inline] public string ActorName;

Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions Components/Nodes/Log.cs → Components/Custom/Log.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
// Please see https://omch.tech/descant/#log for documentation

using System;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(float.PositiveInfinity), NodeType(DescantNodeType.Any)]
public class Log : DescantNodeComponent
public class Log : DescantComponent
{
[Inline] public string Message;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
// Please see https://omch.tech/descant/#portraitchange for documentation

using System;

namespace DescantComponents
{
public enum PortraitChangeType { Set, Enable, Disable }

[Serializable, MaxQuantity(Single.PositiveInfinity), NodeType(DescantNodeType.Any)]
public class PortraitChange : DescantNodeComponent
public class PortraitChange : DescantComponent
{
[Inline] public bool PlayerPortrait;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
// Please see https://omch.tech/descant/#randomizedchoice for documentation

using System;
using System.Collections.Generic;
using Random = UnityEngine.Random;

namespace DescantComponents
{
[Serializable, MaxQuantity(1), NodeType(DescantNodeType.Choice)]
public class RandomizedChoice : DescantNodeComponent // TODO: make this always last
public class RandomizedChoice : DescantComponent // TODO: make this always last
{
public override DescantNodeInvokeResult Invoke(DescantNodeInvokeResult result)
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
// Please see https://omch.tech/descant/#relationshipchange for documentation

using System;

namespace DescantComponents
{
[Serializable, MaxQuantity(Single.PositiveInfinity), NodeType(DescantNodeType.Any)]
public class RelationshipChange : DescantNodeComponent
public class RelationshipChange : DescantComponent
{
[ParameterGroup("Actors")] public string FirstActorName;
[ParameterGroup("Actors")] public string SecondActorName;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
// Please see https://omch.tech/descant/#statisticchange for documentation

using System;

namespace DescantComponents
{
[Serializable, MaxQuantity(Single.PositiveInfinity), NodeType(DescantNodeType.Any)]
public class StatisticChange : DescantNodeComponent
public class StatisticChange : DescantComponent
{
[Inline] public string ActorName;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
// Please see https://omch.tech/descant/#statisticreveal for documentation

using System;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(Single.PositiveInfinity), NodeType(DescantNodeType.Any)]
public class StatisticReveal : DescantNodeComponent
public class StatisticReveal : DescantComponent
{
[Inline] public string ActorName;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
// Please see https://omch.tech/descant/#timedchoice for documentation

using System;
using UnityEngine;

namespace DescantComponents
{
[Serializable, MaxQuantity(1), NodeType(DescantNodeType.Choice)]
public class TimedChoice : DescantNodeComponent
public class TimedChoice : DescantComponent
{
[Inline] public float Time;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
// Please see https://omch.tech/descant/#topicchange for documentation

using System;

namespace DescantComponents
{
[Serializable, MaxQuantity(Single.PositiveInfinity), NodeType(DescantNodeType.Response)]
public class TopicChange : DescantNodeComponent
public class TopicChange : DescantComponent
{
[Inline] public string ActorName;

Expand Down
File renamed without changes.
51 changes: 47 additions & 4 deletions Components/DescantActor.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,71 @@
using System;
using System.Collections.Generic;
using UnityEngine.Serialization;

namespace DescantComponents
{
/// <summary>
/// A data class representing an actor (player or NPC) in a Descant Dialogue
/// </summary>
[Serializable]
public class DescantActor
{
/// <summary>
/// The name of the actor
/// </summary>
public string Name;

/// <summary>
/// The local path to the file after the Assets folder
/// (useful for knowing where to save the file when no longer in its directory)
/// </summary>
public string Path;

/// <summary>
/// The actor's statistics dictionary keys
/// (C# Dictionaries can't be [Serialized], so we use two Lists instead)
/// </summary>
public List<string> StatisticKeys;

/// <summary>
/// The actor's statistics dictionary values
/// (C# Dictionaries can't be [Serialized], so we use two Lists instead)
/// </summary>
public List<float> StatisticValues;

/// <summary>
/// The actor's topics list
/// </summary>
public List<string> Topics;

/// <summary>
/// The actor's relationships dictionary keys
/// (C# Dictionaries can't be [Serialized], so we use two Lists instead)
/// </summary>
public List<string> RelationshipKeys;

/// <summary>
/// The actor's relationships dictionary values
/// (C# Dictionaries can't be [Serialized], so we use two Lists instead)
/// </summary>
public List<float> RelationshipValues;

/// <summary>
/// The number of times that the player has attempted to start a dialogue with the actor
/// </summary>
public int DialogueAttempts;


/// <summary>
/// Parameterized constructor
/// (most of the DescantActor's properties are set after
/// it has been initialized, as part of the saving process)
/// </summary>
/// <param name="name">The name of the actor</param>
public DescantActor(string name)
{
#if UNITY_EDITOR
Name = DescantUtilities.FilterText(name);
Name = DescantUtilities.FilterText(name);
#else
Name = name;
Name = name;
#endif

StatisticKeys = new List<string>();
Expand All @@ -37,6 +77,9 @@ public DescantActor(string name)
RelationshipValues = new List<float>();
}

/// <summary>
/// Overridden ToString method
/// </summary>
public override string ToString()
{
string statistics = "";
Expand Down
Loading

0 comments on commit 0182960

Please sign in to comment.