Class Trait
It represents traits that characters have, and when they are placed in the game next to another character sharing the same trait, they unlock effects such as improved stats.
Namespace: AutoBattleFramework.Stats
Assembly: cs.temp.dll.dll
Syntax
public class Trait : ScriptableObject
Fields
ActivatedOption
Current unlocked effect due to a certain number of characters sharing the same trait being in play.
Declaration
public TraitOption ActivatedOption
Field Value
| Type | Description |
|---|---|
| TraitOption |
PreviousOption
Previous unlocked effect due to a certain number of characters sharing the same trait being in play.
Declaration
public TraitOption PreviousOption
Field Value
| Type | Description |
|---|---|
| TraitOption |
TraitDescription
Descr�ption of the trait.
Declaration
public string TraitDescription
Field Value
| Type | Description |
|---|---|
| String |
TraitImage
Sprite that represents the trait.
Declaration
public Sprite TraitImage
Field Value
| Type | Description |
|---|---|
| Sprite |
TraitName
The trait name.
Declaration
public string TraitName
Field Value
| Type | Description |
|---|---|
| String |
TraitNumber
Total number of characters in play that share the same trait.
Declaration
public int TraitNumber
Field Value
| Type | Description |
|---|---|
| Int32 |
TraitOptions
List of effects unlocked because a certain number of characters sharing the same trait are in play.
Declaration
public List<TraitOption> TraitOptions
Field Value
| Type | Description |
|---|---|
| List<TraitOption> |
Methods
ActivateOption(GameCharacter)
Adds the effects of ActivatedOption if the conditions have been met.
Declaration
public void ActivateOption(GameCharacter character)
Parameters
| Type | Name | Description |
|---|---|---|
| GameCharacter | character | Character to which the effects of ActivatedOption will be applied. |
CheckForActivation(List<GameCharacter>, Boolean)
Check if the goal of having a specific number of characters sharing the same trait in play has been achieved.
Declaration
public void CheckForActivation(List<GameCharacter> characters, bool TraitCheckForDistinctCharacters)
Parameters
| Type | Name | Description |
|---|---|---|
| List<GameCharacter> | characters | List of characters in play to check. |
| Boolean | TraitCheckForDistinctCharacters | Set it to true if you want only totally different characters to be taken into account when checking a trait activation. |
DeactivateOption(GameCharacter, TraitOption)
Substracts the effects of an TraitOption
Declaration
public void DeactivateOption(GameCharacter character, TraitOption option)
Parameters
| Type | Name | Description |
|---|---|---|
| GameCharacter | character | Character to which the effects of and TraitOption will be substracted. |
| TraitOption | option | TraitOption to be substracted. |
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | other |
Returns
| Type | Description |
|---|---|
| Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 |
InitializeTrait()
Initialize the variables of the Trait.
Declaration
public void InitializeTrait()
OptionChange()
Checks if the ActivatedOption has changed.
Declaration
public bool OptionChange()
Returns
| Type | Description |
|---|---|
| Boolean | If ActivatedOption has changed. |