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

Public Types

enum  Type { Default , Race }
 
enum  Setup { Random , FighterGuild }
 

Public Member Functions

override bool IsComplete ()
 
override void OnInit ()
 
override void OnKillChara (Chara c)
 
override string GetTextProgress ()
 
override void OnGetDetail (ref string detail, bool onJournal)
 
- Public Member Functions inherited from QuestTask
void SetOwner (Quest quest)
 
virtual bool IsComplete ()
 
virtual void OnInit ()
 
virtual void OnStart ()
 
virtual void OnKillChara (Chara c)
 
virtual void OnGiveItem (Chara c, Thing t)
 
virtual void OnModKarma (int a)
 
virtual string GetTextProgress ()
 
virtual void OnGetDetail (ref string detail, bool onJournal)
 

Static Public Member Functions

static List< SourceChara.RowListTargets (string idRace)
 
- 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)
 

Public Attributes

int numHunted
 
int numRequired
 
string idRace
 
Type type
 
Setup setup
 
- Public Attributes inherited from QuestTask
Quest owner
 

Properties

SourceRace.Row Race [get]
 
override string RefDrama2 [get]
 
override string RefDrama3 [get]
 
- Properties inherited from QuestTask
virtual string RefDrama1 [get]
 
virtual string RefDrama2 [get]
 
virtual string RefDrama3 [get]
 
- 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]
 

Additional Inherited Members

- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 5 of file QuestTaskHunt.cs.

Member Enumeration Documentation

◆ Setup

Enumerator
Random 
FighterGuild 

Definition at line 13 of file QuestTaskHunt.cs.

◆ Type

Enumerator
Default 
Race 

Definition at line 7 of file QuestTaskHunt.cs.

8 {
10 Race
11 }
SourceRace.Row Race

Member Function Documentation

◆ GetTextProgress()

override string QuestTaskHunt.GetTextProgress ( )
inlinevirtual

Reimplemented from QuestTask.

Definition at line 124 of file QuestTaskHunt.cs.

125 {
126 if (type == Type.Race)
127 {
128 return "progressHuntRace".lang(numHunted.ToString() ?? "", numRequired.ToString() ?? "", Race.GetName());
129 }
130 return "progressHunt".lang(numHunted.ToString() ?? "", numRequired.ToString() ?? "");
131 }

References numHunted, numRequired, Race, and type.

◆ IsComplete()

override bool QuestTaskHunt.IsComplete ( )
inlinevirtual

Reimplemented from QuestTask.

Definition at line 49 of file QuestTaskHunt.cs.

50 {
51 return numHunted >= numRequired;
52 }

References numHunted, and numRequired.

◆ ListTargets()

static List< SourceChara.Row > QuestTaskHunt.ListTargets ( string  idRace)
inlinestatic

Definition at line 54 of file QuestTaskHunt.cs.

55 {
56 List<SourceChara.Row> list = new List<SourceChara.Row>();
57 foreach (SourceChara.Row row in EClass.sources.charas.rows)
58 {
59 if (row.quality == 0 && row.race == idRace && row.chance > 0 && row.hostility != "Friend")
60 {
61 list.Add(row);
62 }
63 }
64 return list;
65 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
SourceChara charas

References SourceManager.charas, idRace, and EClass.sources.

Referenced by OnGetDetail(), and OnInit().

◆ OnGetDetail()

override void QuestTaskHunt.OnGetDetail ( ref string  detail,
bool  onJournal 
)
inlinevirtual

Reimplemented from QuestTask.

Definition at line 133 of file QuestTaskHunt.cs.

134 {
135 if (type != Type.Race || !onJournal)
136 {
137 return;
138 }
139 List<SourceChara.Row> list = ListTargets(idRace);
140 int num = 0;
141 detail = detail + Environment.NewLine + Environment.NewLine + "target_huntRace".lang() + Environment.NewLine;
142 foreach (SourceChara.Row item in list)
143 {
144 detail = detail + item.GetName().ToTitleCase(wholeText: true) + " (" + EClass.sources.races.map[idRace].GetName() + ")";
145 num++;
146 if (num > 5)
147 {
148 break;
149 }
150 detail += Environment.NewLine;
151 }
152 }
static List< SourceChara.Row > ListTargets(string idRace)
SourceRace races

References idRace, item, ListTargets(), SourceManager.races, EClass.sources, and type.

◆ OnInit()

override void QuestTaskHunt.OnInit ( )
inlinevirtual

Reimplemented from QuestTask.

Definition at line 67 of file QuestTaskHunt.cs.

68 {
69 if (setup == Setup.FighterGuild)
70 {
71 numRequired = 20;
72 idRace = "yeek";
73 type = Type.Race;
74 }
75 else if (type == Type.Race)
76 {
77 for (int i = 0; i < 100; i++)
78 {
79 SourceRace.Row row = EClass.sources.races.rows.RandomItem();
80 if (ListTargets(row.id).Count != 0)
81 {
82 idRace = row.id;
83 }
84 }
85 numRequired = 3 + owner.difficulty * 2 + EClass.rnd(5);
86 }
87 else
88 {
89 numRequired = 10 + owner.difficulty * 3 + EClass.rnd(5);
90 }
91 }
static int rnd(int a)
Definition: EClass.cs:50

References SourceRace.Row.id, idRace, ListTargets(), numRequired, SourceManager.races, EClass.rnd(), setup, EClass.sources, and type.

◆ OnKillChara()

override void QuestTaskHunt.OnKillChara ( Chara  c)
inlinevirtual

Reimplemented from QuestTask.

Definition at line 93 of file QuestTaskHunt.cs.

94 {
95 if (c.IsPCFaction)
96 {
97 return;
98 }
99 if (type == Type.Race)
100 {
101 if (c.race.id == idRace)
102 {
103 CountKill();
104 }
105 }
106 else if (c.OriginalHostility <= Hostility.Enemy)
107 {
108 CountKill();
109 }
110 void CountKill()
111 {
112 numHunted++;
114 {
116 }
117 else
118 {
119 owner.bonusMoney += EClass.curve(3 + c.LV, 50, 10) * ((type != Type.Race) ? 1 : 2);
120 }
121 }
122 }
Hostility
Definition: Hostility.cs:2
int LV
Definition: Card.cs:370
Hostility OriginalHostility
Definition: Chara.cs:456
override bool IsPCFaction
Definition: Chara.cs:656
SourceRace.Row race
Definition: Chara.cs:449
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:55

References EClass.curve(), idRace, Chara.IsPCFaction, Card.LV, numHunted, numRequired, Chara.OriginalHostility, Chara.race, and type.

Member Data Documentation

◆ idRace

string QuestTaskHunt.idRace

Definition at line 26 of file QuestTaskHunt.cs.

Referenced by ListTargets(), OnGetDetail(), OnInit(), and OnKillChara().

◆ numHunted

int QuestTaskHunt.numHunted

Definition at line 20 of file QuestTaskHunt.cs.

Referenced by GetTextProgress(), IsComplete(), and OnKillChara().

◆ numRequired

int QuestTaskHunt.numRequired

Definition at line 23 of file QuestTaskHunt.cs.

Referenced by GetTextProgress(), IsComplete(), OnInit(), and OnKillChara().

◆ setup

Setup QuestTaskHunt.setup

Definition at line 31 of file QuestTaskHunt.cs.

Referenced by OnInit().

◆ type

Type QuestTaskHunt.type

Definition at line 29 of file QuestTaskHunt.cs.

Referenced by GetTextProgress(), OnGetDetail(), OnInit(), and OnKillChara().

Property Documentation

◆ Race

SourceRace.Row QuestTaskHunt.Race
get

Definition at line 33 of file QuestTaskHunt.cs.

Referenced by GetTextProgress().

◆ RefDrama2

override string QuestTaskHunt.RefDrama2
get

Definition at line 35 of file QuestTaskHunt.cs.

36 {
37 get
38 {
39 if (type != Type.Race)
40 {
41 return "";
42 }
43 return Race.GetName();
44 }
45 }

◆ RefDrama3

override string QuestTaskHunt.RefDrama3
get

Definition at line 47 of file QuestTaskHunt.cs.


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