Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
CodexManager Class Reference
Inheritance diagram for CodexManager:
EClass

Public Member Functions

CodexCreature GetOrCreate (string id)
 
void OnLoad ()
 
void AddCard (string id, int num=1)
 
bool Has (string id)
 
void MarkCardDrop (string id)
 
bool DroppedCard (string id)
 
void AddKill (string id)
 
void AddWeakspot (string id)
 
void AddSpawn (string id)
 
List< CardRowListKills ()
 

Public Attributes

Dictionary< string, CodexCreaturecreatures = new Dictionary<string, CodexCreature>()
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 4 of file CodexManager.cs.

Member Function Documentation

◆ AddCard()

void CodexManager.AddCard ( string  id,
int  num = 1 
)
inline

Definition at line 31 of file CodexManager.cs.

32 {
33 GetOrCreate(id).numCard += num;
34 }
CodexCreature GetOrCreate(string id)
Definition: CodexManager.cs:9

References GetOrCreate(), and CodexCreature.numCard.

Referenced by ContentCodex.Collect(), and ContentCodex.OnClickAddCards().

◆ AddKill()

void CodexManager.AddKill ( string  id)
inline

Definition at line 55 of file CodexManager.cs.

56 {
57 GetOrCreate(id).kills++;
58 }

References GetOrCreate(), and CodexCreature.kills.

Referenced by Card.DamageHP().

◆ AddSpawn()

void CodexManager.AddSpawn ( string  id)
inline

Definition at line 65 of file CodexManager.cs.

66 {
67 GetOrCreate(id).spawns++;
68 }

References GetOrCreate(), and CodexCreature.spawns.

Referenced by Zone.AddCard().

◆ AddWeakspot()

void CodexManager.AddWeakspot ( string  id)
inline

Definition at line 60 of file CodexManager.cs.

61 {
63 }

References GetOrCreate(), and CodexCreature.weakspot.

Referenced by TraitBaseSpellbook.OnRead().

◆ DroppedCard()

bool CodexManager.DroppedCard ( string  id)
inline

Definition at line 46 of file CodexManager.cs.

47 {
48 if (creatures.ContainsKey(id))
49 {
50 return creatures[id].droppedCard;
51 }
52 return false;
53 }
Dictionary< string, CodexCreature > creatures
Definition: CodexManager.cs:7

References creatures.

Referenced by Card.SpawnLoot().

◆ GetOrCreate()

CodexCreature CodexManager.GetOrCreate ( string  id)
inline

Definition at line 9 of file CodexManager.cs.

10 {
11 CodexCreature codexCreature = creatures.TryGetValue(id);
12 if (codexCreature == null)
13 {
14 codexCreature = new CodexCreature
15 {
16 id = id
17 };
18 creatures[id] = codexCreature;
19 }
20 return codexCreature;
21 }

References creatures.

Referenced by AddCard(), AddKill(), AddSpawn(), AddWeakspot(), Card.DamageHP(), MarkCardDrop(), and Card.SpawnLoot().

◆ Has()

bool CodexManager.Has ( string  id)
inline

Definition at line 36 of file CodexManager.cs.

37 {
38 return creatures.ContainsKey(id);
39 }

References creatures.

Referenced by InvOwnerChaosOffering._OnProcess(), and Card.DamageHP().

◆ ListKills()

List< CardRow > CodexManager.ListKills ( )
inline

Definition at line 70 of file CodexManager.cs.

71 {
72 List<CardRow> list = new List<CardRow>();
73 foreach (KeyValuePair<string, CodexCreature> creature in creatures)
74 {
75 if (creature.Value.kills > 0)
76 {
77 CardRow cardRow = EClass.sources.cards.map.TryGetValue(creature.Key);
78 if (cardRow != null && !cardRow.HasTag(CTAG.noRandomProduct))
79 {
80 list.Add(cardRow);
81 }
82 }
83 }
84 return list;
85 }
CTAG
Definition: CTAG.cs:2
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:125
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards

References SourceManager.cards, creatures, RenderRow.HasTag(), SourceCard.map, and EClass.sources.

Referenced by TraitCrafter.Craft().

◆ MarkCardDrop()

void CodexManager.MarkCardDrop ( string  id)
inline

Definition at line 41 of file CodexManager.cs.

42 {
43 GetOrCreate(id).droppedCard = true;
44 }

References CodexCreature.droppedCard, and GetOrCreate().

Referenced by Card.SpawnLoot().

◆ OnLoad()

void CodexManager.OnLoad ( )
inline

Definition at line 23 of file CodexManager.cs.

24 {
25 foreach (KeyValuePair<string, CodexCreature> creature in creatures)
26 {
27 creature.Value.id = creature.Key;
28 }
29 }

References creatures.

Referenced by Player.OnLoad().

Member Data Documentation

◆ creatures

Dictionary<string, CodexCreature> CodexManager.creatures = new Dictionary<string, CodexCreature>()

The documentation for this class was generated from the following file: