Elin Decompiled Documentation EA 23.153 Nightly
Loading...
Searching...
No Matches
Faction Class Reference
Inheritance diagram for Faction:
EClass Guild GuildFighter GuildMage GuildMerchant GuildThief

Public Member Functions

void Init ()
 
void OnLoad ()
 
float GetHappiness ()
 
Sprite GetSprite ()
 
int CountTax ()
 
int GetMaxReserve ()
 
List< FactionBranchGetChildren ()
 
int CountWealth ()
 
int CountTerritories ()
 
int CountMembers ()
 
Hostility GetHostility ()
 
void ModRelation (int a)
 
bool HasMember (string id, bool includeReserve=true)
 
bool IsWearingPanty (Chara c)
 
void AddContribution (int a)
 
void AddReserve (Chara c)
 
void RemoveReserve (Chara c)
 
void OnAdvanceDay ()
 
void OnAdvanceMonth ()
 
void TryPayBill (Thing bill)
 
FactionBranch FindBranch (Chara c)
 
void AddGlobalPolicy (int id)
 
bool IsGlobalPolicyActive (int id)
 
void SetGlobalPolicyActive (int id, bool active)
 
int GetResidentTax ()
 
int GetRankIncome ()
 
int GetFactionSalary ()
 
int GetTotalTax (bool evasion)
 
int GetBaseTax (bool evasion)
 
int GetFameTax (bool evasion)
 
int EvadeTax (int v, bool evasion)
 
void SetTaxTooltip (UINote n)
 
int CountTaxFreeLand ()
 

Static Public Member Functions

static Faction Create (SourceFaction.Row r)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
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

FactionRelation relation = new FactionRelation()
 
string id
 
string uid
 
string name
 
List< HireInfolistReserve = new List<HireInfo>()
 
ElementContainerZone elements = new ElementContainerZone()
 
HashSet< int > globalPolicies = new HashSet<int>()
 
ElementContainerFaction charaElements = new ElementContainerFaction()
 
SourceFaction.Row _source
 

Properties

string Name [get]
 
SourceFaction.Row source [get]
 
virtual string TextType [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 123 of file FACTION.cs.

Member Function Documentation

◆ AddContribution()

void Faction.AddContribution ( int  a)
inline

Definition at line 318 of file FACTION.cs.

319 {
320 if (a != 0 && relation.type == FactionRelation.RelationType.Member)
321 {
322 relation.exp += a;
323 Msg.Say("contribute", a.ToString() ?? "", Name);
324 }
325 }
RelationType type
string Name
Definition: FACTION.cs:150
FactionRelation relation
Definition: FACTION.cs:126
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58

References Name, relation, Msg.Say(), and FactionRelation.type.

Referenced by AI_Shopping.Buy(), CoreDebug.ModContribution(), ShopTransaction.OnEndTransaction(), and TraitBaseSpellbook.OnRead().

◆ AddGlobalPolicy()

void Faction.AddGlobalPolicy ( int  id)
inline

Definition at line 437 of file FACTION.cs.

438 {
439 globalPolicies.Add(id);
440 }
HashSet< int > globalPolicies
Definition: FACTION.cs:144

References globalPolicies.

Referenced by PolicyManager.AddPolicy().

◆ AddReserve()

void Faction.AddReserve ( Chara  c)
inline

Definition at line 327 of file FACTION.cs.

328 {
329 if (c.IsPCParty)
330 {
332 }
333 if (c.memberType == FactionMemberType.Livestock)
334 {
335 c.SetInt(36, EClass.world.date.GetRaw() + 14400);
336 }
337 if (c.IsHomeMember())
338 {
340 }
341 if (c.currentZone != null)
342 {
344 }
345 if (EClass.Branch.uidMaid == c.uid)
346 {
347 EClass.Branch.uidMaid = 0;
348 }
350 {
351 chara = c,
352 isNew = true
353 };
354 listReserve.Add(item);
355 }
FactionMemberType
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
int uid
Definition: Card.cs:118
override bool IsPCParty
Definition: Chara.cs:611
Party party
Definition: Chara.cs:43
Zone currentZone
Definition: Chara.cs:251
FactionMemberType memberType
Definition: Chara.cs:46
bool IsHomeMember()
Definition: Chara.cs:6092
FactionBranch homeBranch
Definition: Chara.cs:932
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
Definition: EClass.cs:5
static World world
Definition: EClass.cs:40
static FactionBranch Branch
Definition: EClass.cs:22
static Chara pc
Definition: EClass.cs:14
void RemoveMemeber(Chara c)
List< HireInfo > listReserve
Definition: FACTION.cs:138
void RemoveMember(Chara c)
Definition: Party.cs:89
GameDate date
Definition: World.cs:6
void RemoveCard(Card t)
Definition: Zone.cs:1950

References EClass.Branch, Chara.currentZone, World.date, Date.GetRaw(), Chara.homeBranch, Chara.IsHomeMember(), Chara.IsPCParty, item, listReserve, Chara.memberType, Chara.party, EClass.pc, Zone.RemoveCard(), Party.RemoveMember(), FactionBranch.RemoveMemeber(), BaseCard.SetInt(), Card.uid, FactionBranch.uidMaid, and EClass.world.

Referenced by ItemGachaResult.Confirm(), and BaseListPeople.OnClick().

◆ CountMembers()

int Faction.CountMembers ( )
inline

Definition at line 242 of file FACTION.cs.

243 {
244 int num = 0;
245 foreach (Chara value in EClass.game.cards.globalCharas.Values)
246 {
247 if (value.Chara.faction == this)
248 {
249 num++;
250 }
251 }
252 return num;
253 }
GlobalCharaList globalCharas
Definition: CardManager.cs:46
virtual Chara Chara
Definition: Card.cs:2006
Definition: Chara.cs:10
Faction faction
Definition: Chara.cs:423
static Game game
Definition: EClass.cs:8
CardManager cards
Definition: Game.cs:155

References Game.cards, Card.Chara, Chara.faction, EClass.game, and CardManager.globalCharas.

Referenced by LayerGlobalMap.RefreshSummary().

◆ CountTax()

int Faction.CountTax ( )
inline

Definition at line 187 of file FACTION.cs.

188 {
189 return (int)((float)CountWealth() * 0.1f);
190 }
int CountWealth()
Definition: FACTION.cs:215

References CountWealth().

◆ CountTaxFreeLand()

int Faction.CountTaxFreeLand ( )
inline

Definition at line 550 of file FACTION.cs.

551 {
552 int num = 0;
553 foreach (FactionBranch child in GetChildren())
554 {
555 if (child.policies.IsActive(2514))
556 {
557 num++;
558 }
559 }
560 return num;
561 }
PolicyManager policies
List< FactionBranch > GetChildren()
Definition: FACTION.cs:202
bool IsActive(int id, int days=-1)

References GetChildren(), PolicyManager.IsActive(), and FactionBranch.policies.

Referenced by FactionBranch.OnClaimZone(), and ContentPolicy.RefreshPolicyList().

◆ CountTerritories()

int Faction.CountTerritories ( )
inline

Definition at line 229 of file FACTION.cs.

230 {
231 int num = 0;
232 foreach (Spatial value in EClass.game.spatials.map.Values)
233 {
234 if (value.mainFaction == this)
235 {
236 num++;
237 }
238 }
239 return num;
240 }
SpatialManager spatials
Definition: Game.cs:152
GlobalSpatialList map
Faction mainFaction
Definition: Spatial.cs:430

References EClass.game, Spatial.mainFaction, SpatialManager.map, and Game.spatials.

Referenced by WindowChara.RefreshProfile(), and LayerGlobalMap.RefreshSummary().

◆ CountWealth()

int Faction.CountWealth ( )
inline

Definition at line 215 of file FACTION.cs.

216 {
218 {
220 }
221 int num = 0;
222 foreach (FactionBranch child in GetChildren())
223 {
224 num += child.Worth;
225 }
226 return num;
227 }
static Zone _zone
Definition: EClass.cs:20
HomeResourceManager resources
FactionBranch branch
Definition: Zone.cs:34
bool IsPCFaction
Definition: Zone.cs:466

References EClass._zone, Zone.branch, GetChildren(), Zone.IsPCFaction, HomeResourceManager.Refresh(), FactionBranch.resources, and FactionBranch.Worth.

Referenced by CountTax(), and LayerGlobalMap.RefreshSummary().

◆ Create()

static Faction Faction.Create ( SourceFaction::Row  r)
inlinestatic

Definition at line 156 of file FACTION.cs.

157 {
158 Faction faction = ClassCache.Create<Faction>(r.type, "Elin");
159 faction.id = r.id;
160 faction.Init();
161 return faction;
162 }
void Init()
Definition: FACTION.cs:164

References id, and Init().

Referenced by FactionManager.OnCreateGame().

◆ EvadeTax()

int Faction.EvadeTax ( int  v,
bool  evasion 
)
inline

Definition at line 528 of file FACTION.cs.

529 {
530 if (!evasion)
531 {
532 return v;
533 }
534 int num = 0;
535 foreach (FactionBranch child in GetChildren())
536 {
537 num += child.Evalue(2119);
538 }
539 return (int)(long)((float)(v * 100) / (100f + Mathf.Sqrt(num * 5)));
540 }
int Evalue(int ele)

References FactionBranch.Evalue(), and GetChildren().

Referenced by GetBaseTax(), and GetFameTax().

◆ FindBranch()

FactionBranch Faction.FindBranch ( Chara  c)
inline

Definition at line 425 of file FACTION.cs.

426 {
427 foreach (FactionBranch child in GetChildren())
428 {
429 if (child.members.Contains(c))
430 {
431 return child;
432 }
433 }
434 return null;
435 }
List< Chara > members

References GetChildren(), and FactionBranch.members.

Referenced by FactionBranch.AddMemeber().

◆ GetBaseTax()

int Faction.GetBaseTax ( bool  evasion)
inline

Definition at line 510 of file FACTION.cs.

511 {
512 int a = EClass.world.date.year - EClass.game.Prologue.year;
513 int v = 500 + Mathf.Min(a, 10) * 500;
514 return EvadeTax(v, evasion);
515 }
int EvadeTax(int v, bool evasion)
Definition: FACTION.cs:528
Prologue Prologue
Definition: Game.cs:257
int year
Definition: Prologue.cs:13

References EvadeTax(), EClass.game, Game.Prologue, and Prologue.year.

Referenced by GetTotalTax(), and SetTaxTooltip().

◆ GetChildren()

List< FactionBranch > Faction.GetChildren ( )
inline

Definition at line 202 of file FACTION.cs.

203 {
204 List<FactionBranch> list = new List<FactionBranch>();
205 foreach (Spatial value in EClass.game.spatials.map.Values)
206 {
207 if (value.mainFaction == this)
208 {
209 list.Add((value as Zone).branch);
210 }
211 }
212 return list;
213 }
Definition: Zone.cs:12

References EClass.game, Spatial.mainFaction, SpatialManager.map, and Game.spatials.

Referenced by CountTaxFreeLand(), CountWealth(), EvadeTax(), FindBranch(), RankedZoneManager.GetIncome(), GetMaxReserve(), GetRankIncome(), GetResidentTax(), IsGlobalPolicyActive(), OnAdvanceDay(), OnAdvanceMonth(), Game.OnLoad(), TraitBookSkill.OnRead(), TraitDeedRelocate.OnRead(), Card.PurgeDuplicateArtifact(), SetGlobalPolicyActive(), Player.SimulateFaction(), and TraitBookPlan.WriteNote().

◆ GetFactionSalary()

int Faction.GetFactionSalary ( )
inline

Definition at line 491 of file FACTION.cs.

492 {
493 int num = 0;
494 foreach (Faction value in EClass.game.factions.dictAll.Values)
495 {
496 num += value.relation.GetSalary();
497 }
498 if (num > 0)
499 {
500 Msg.Say("getFactionSalary", Lang._currency(num, "money"));
501 }
502 return num;
503 }
Dictionary< string, Faction > dictAll
FactionManager factions
Definition: Game.cs:161
Definition: Lang.cs:6
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162

References Lang._currency(), FactionManager.dictAll, Game.factions, EClass.game, FactionRelation.GetSalary(), relation, and Msg.Say().

Referenced by OnAdvanceMonth().

◆ GetFameTax()

int Faction.GetFameTax ( bool  evasion)
inline

Definition at line 517 of file FACTION.cs.

518 {
519 int v = EClass.curve(EClass.player.fame * 2, 10000, 2000, 80);
520 v = EvadeTax(v, evasion);
521 if (v < 0)
522 {
523 v = 50000;
524 }
525 return v;
526 }
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:63
static Player player
Definition: EClass.cs:12
int fame
Definition: Player.cs:700

References EClass.curve(), EvadeTax(), Player.fame, and EClass.player.

Referenced by GetTotalTax(), and SetTaxTooltip().

◆ GetHappiness()

float Faction.GetHappiness ( )
inline

Definition at line 177 of file FACTION.cs.

178 {
179 return 50f;
180 }

◆ GetHostility()

Hostility Faction.GetHostility ( )
inline

Definition at line 255 of file FACTION.cs.

256 {
257 if (this == EClass.Home || relation.affinity >= 200)
258 {
259 return Hostility.Ally;
260 }
261 if (relation.affinity >= 100)
262 {
263 return Hostility.Friend;
264 }
265 if (relation.affinity <= -100)
266 {
267 return Hostility.Enemy;
268 }
269 return Hostility.Neutral;
270 }
Hostility
Definition: Hostility.cs:2
static Faction Home
Definition: EClass.cs:26

References FactionRelation.affinity, EClass.Home, and relation.

Referenced by Chara.SetFaction().

◆ GetMaxReserve()

int Faction.GetMaxReserve ( )
inline

Definition at line 192 of file FACTION.cs.

193 {
194 int num = 2;
195 foreach (FactionBranch child in GetChildren())
196 {
197 num += child.lv;
198 }
199 return num;
200 }

References GetChildren(), and FactionBranch.lv.

Referenced by BaseListPeople.OnClick().

◆ GetRankIncome()

int Faction.GetRankIncome ( )
inline

Definition at line 477 of file FACTION.cs.

478 {
479 int num = 0;
480 foreach (FactionBranch child in GetChildren())
481 {
482 num += EClass.game.spatials.ranks.GetIncome(child.owner);
483 }
484 if (num > 0)
485 {
486 Msg.Say("getRankIncome", Lang._currency(num, "money"));
487 }
488 return num;
489 }
int GetIncome(Zone z)
RankedZoneManager ranks

References Lang._currency(), EClass.game, GetChildren(), RankedZoneManager.GetIncome(), FactionBranch.owner, SpatialManager.ranks, Msg.Say(), and Game.spatials.

Referenced by OnAdvanceMonth().

◆ GetResidentTax()

int Faction.GetResidentTax ( )
inline

Definition at line 463 of file FACTION.cs.

464 {
465 int num = 0;
466 foreach (FactionBranch child in GetChildren())
467 {
468 num += child.GetResidentTax();
469 }
470 if (num > 0)
471 {
472 Msg.Say("getResidentTax", Lang._currency(num, "money"));
473 }
474 return num;
475 }

References Lang._currency(), GetChildren(), FactionBranch.GetResidentTax(), and Msg.Say().

Referenced by OnAdvanceMonth().

◆ GetSprite()

Sprite Faction.GetSprite ( )
inline

Definition at line 182 of file FACTION.cs.

183 {
184 return ResourceCache.Load<Sprite>("Media/Graphics/Image/Faction/" + source.id);
185 }
SourceFaction.Row source
Definition: FACTION.cs:152

References source.

◆ GetTotalTax()

int Faction.GetTotalTax ( bool  evasion)
inline

Definition at line 505 of file FACTION.cs.

506 {
507 return GetBaseTax(evasion) + GetFameTax(evasion) + EClass.player.extraTax;
508 }
int GetFameTax(bool evasion)
Definition: FACTION.cs:517
int GetBaseTax(bool evasion)
Definition: FACTION.cs:510
int extraTax
Definition: Player.cs:751

References Player.extraTax, GetBaseTax(), GetFameTax(), and EClass.player.

Referenced by OnAdvanceMonth(), and UIHomeInfo.RefreshReport().

◆ HasMember()

bool Faction.HasMember ( string  id,
bool  includeReserve = true 
)
inline

Definition at line 277 of file FACTION.cs.

278 {
279 foreach (Chara value in EClass.game.cards.globalCharas.Values)
280 {
281 if (value.id == id && value.IsHomeMember())
282 {
283 return true;
284 }
285 }
286 if (includeReserve)
287 {
288 foreach (HireInfo item in listReserve)
289 {
290 if (item.chara.id == id)
291 {
292 return true;
293 }
294 }
295 }
296 return false;
297 }
string id
Definition: Card.cs:31

References Game.cards, EClass.game, CardManager.globalCharas, Card.id, Chara.IsHomeMember(), item, and listReserve.

Referenced by QuestDialog.CanStartQuest().

◆ Init()

void Faction.Init ( )
inline

Definition at line 164 of file FACTION.cs.

165 {
167 relation.faction = this;
168 relation.affinity = source.relation;
169 name = source.GetText();
170 }
void AssignUID(Faction s)
string name
Definition: FACTION.cs:135

References FactionManager.AssignUID(), Game.factions, EClass.game, name, and source.

Referenced by Create().

◆ IsGlobalPolicyActive()

bool Faction.IsGlobalPolicyActive ( int  id)
inline

Definition at line 442 of file FACTION.cs.

443 {
444 bool result = false;
445 foreach (FactionBranch child in GetChildren())
446 {
447 if (child.policies.IsActive(id))
448 {
449 result = true;
450 }
451 }
452 return result;
453 }

References GetChildren(), PolicyManager.IsActive(), and FactionBranch.policies.

Referenced by FactionBranch.DailyOutcome(), FortuneRollData.GetPrizeList(), IsWearingPanty(), TryPayBill(), and FactionBranch.ValidateUpgradePolicies().

◆ IsWearingPanty()

bool Faction.IsWearingPanty ( Chara  c)
inline

Definition at line 299 of file FACTION.cs.

300 {
301 if ((!c.IsUnique || c.bio.gender != 2) && (c.race.IsHuman || c.race.IsFairy) && !(c.trait is TraitMerchant))
302 {
303 return true;
304 }
305 if (IsGlobalPolicyActive(2712))
306 {
307 foreach (Chara value in EClass.game.cards.globalCharas.Values)
308 {
309 if (value.id == c.id && value.IsHomeMember())
310 {
311 return true;
312 }
313 }
314 }
315 return false;
316 }
int gender
Definition: Biography.cs:29
bool IsUnique
Definition: Card.cs:2027
Biography bio
Definition: Card.cs:40
new TraitChara trait
Definition: Chara.cs:499
SourceRace.Row race
Definition: Chara.cs:460
bool IsGlobalPolicyActive(int id)
Definition: FACTION.cs:442

References Card.bio, Game.cards, EClass.game, Biography.gender, CardManager.globalCharas, Card.id, IsGlobalPolicyActive(), Chara.IsHomeMember(), Card.IsUnique, Chara.race, and Chara.trait.

◆ ModRelation()

void Faction.ModRelation ( int  a)
inline

Definition at line 272 of file FACTION.cs.

273 {
274 relation.affinity += a;
275 }

◆ OnAdvanceDay()

void Faction.OnAdvanceDay ( )
inline

Definition at line 368 of file FACTION.cs.

369 {
370 foreach (FactionBranch child in GetChildren())
371 {
372 child.OnAdvanceDay();
373 }
374 }
void OnAdvanceDay()

References GetChildren(), and FactionBranch.OnAdvanceDay().

Referenced by GameDate.AdvanceDay().

◆ OnAdvanceMonth()

void Faction.OnAdvanceMonth ( )
inline

Definition at line 376 of file FACTION.cs.

377 {
378 if (GetChildren().Count == 0)
379 {
380 return;
381 }
382 int num = 0;
383 num += GetResidentTax();
384 num += GetRankIncome();
385 num += GetFactionSalary();
386 if (num > 0)
387 {
388 Thing container_deposit = EClass.game.cards.container_deposit;
389 if (EClass.pc.homeBranch.policies.IsActive(2711) && (container_deposit.GetCurrency() > 0 || !container_deposit.things.IsFull()))
390 {
391 container_deposit.ModCurrency(num);
392 Msg.Say("bankIncome", Lang._currency(num, "money"));
393 }
394 else
395 {
396 Thing thing = ThingGen.Create("money").SetNum(num);
397 Thing p = ThingGen.CreateParcel("parcel_salary", thing);
399 }
400 }
401 num = GetTotalTax(evasion: true);
402 Thing thing2 = ThingGen.CreateBill(num, tax: true);
403 thing2.SetInt(35, EClass.player.extraTax);
404 Msg.Say("getBill", Lang._currency(num, "money"));
405 TryPayBill(thing2);
406 Msg.Say("bills", EClass.player.taxBills.ToString() ?? "");
408 {
410 }
411 }
Thing container_deposit
Definition: CardManager.cs:58
Thing SetNum(int a)
Definition: Card.cs:3356
int GetCurrency(string id="money")
Definition: Card.cs:3820
void ModCurrency(int a, string id="money")
Definition: Card.cs:3806
ThingContainer things
Definition: Card.cs:34
bool godMode
Definition: CoreDebug.cs:172
static CoreDebug debug
Definition: EClass.cs:48
int GetFactionSalary()
Definition: FACTION.cs:491
int GetTotalTax(bool evasion)
Definition: FACTION.cs:505
void TryPayBill(Thing bill)
Definition: FACTION.cs:413
int GetResidentTax()
Definition: FACTION.cs:463
int GetRankIncome()
Definition: FACTION.cs:477
GamePrincipal principal
Definition: Game.cs:221
void ModKarma(int a)
Definition: Player.cs:2311
int taxBills
Definition: Player.cs:727
bool IsFull(int y=0)
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
static Thing CreateBill(int pay, bool tax)
Definition: ThingGen.cs:85
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
void SendPackage(Thing p)
Definition: World.cs:68

References Lang._currency(), Game.cards, CardManager.container_deposit, ThingGen.Create(), ThingGen.CreateBill(), ThingGen.CreateParcel(), EClass.debug, Player.extraTax, EClass.game, GetChildren(), Card.GetCurrency(), GetFactionSalary(), GetRankIncome(), GetResidentTax(), GetTotalTax(), CoreDebug.godMode, Chara.homeBranch, PolicyManager.IsActive(), ThingContainer.IsFull(), Card.ModCurrency(), Player.ModKarma(), EClass.pc, EClass.player, FactionBranch.policies, Game.principal, Msg.Say(), World.SendPackage(), BaseCard.SetInt(), Card.SetNum(), GamePrincipal.tax, Player.taxBills, Card.things, TryPayBill(), and EClass.world.

Referenced by GameDate.AdvanceMonth().

◆ OnLoad()

void Faction.OnLoad ( )
inline

Definition at line 172 of file FACTION.cs.

173 {
174 relation.faction = this;
175 }

Referenced by FactionManager.OnLoad().

◆ RemoveReserve()

void Faction.RemoveReserve ( Chara  c)
inline

Definition at line 357 of file FACTION.cs.

358 {
359 listReserve.ForeachReverse(delegate(HireInfo i)
360 {
361 if (i.chara == c || i.chara.uid == c.uid)
362 {
363 listReserve.Remove(i);
364 }
365 });
366 }
Chara chara
Definition: HireInfo.cs:6

References HireInfo.chara, listReserve, and Card.uid.

Referenced by FactionBranch.AddMemeber().

◆ SetGlobalPolicyActive()

void Faction.SetGlobalPolicyActive ( int  id,
bool  active 
)
inline

Definition at line 455 of file FACTION.cs.

456 {
457 foreach (FactionBranch child in GetChildren())
458 {
459 child.policies.SetActive(id, active);
460 }
461 }
void SetActive(int id, bool active)

References GetChildren(), FactionBranch.policies, and PolicyManager.SetActive().

Referenced by FactionBranch.ValidateUpgradePolicies().

◆ SetTaxTooltip()

void Faction.SetTaxTooltip ( UINote  n)
inline

Definition at line 542 of file FACTION.cs.

543 {
544 n.AddHeader("tax");
545 n.AddTopic("tax_base", Lang._currency(GetBaseTax(evasion: true), showUnit: true) + " (" + Lang._currency(GetBaseTax(evasion: false)) + ")");
546 n.AddTopic("tax_fame", Lang._currency(GetFameTax(evasion: true), showUnit: true) + " (" + Lang._currency(GetFameTax(evasion: false)) + ")");
547 n.AddTopic("tax_extra", Lang._currency(EClass.player.extraTax, showUnit: true));
548 }
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddTopic(string id, string text, string value=null)
Definition: UINote.cs:144

References Lang._currency(), UINote.AddHeader(), UINote.AddTopic(), Player.extraTax, GetBaseTax(), GetFameTax(), and EClass.player.

Referenced by UIHomeInfo.RefreshReport().

◆ TryPayBill()

void Faction.TryPayBill ( Thing  bill)
inline

Definition at line 413 of file FACTION.cs.

414 {
416 {
417 InvOwnerDeliver.PayBill(bill, fromBank: true);
418 }
419 else
420 {
422 }
423 }
static void PayBill(Thing t, bool fromBank=false)

References bill, Game.cards, CardManager.container_deposit, EClass.game, Card.GetCurrency(), IsGlobalPolicyActive(), InvOwnerDeliver.PayBill(), World.SendPackage(), and EClass.world.

Referenced by OnAdvanceMonth(), and GameDate.ShipPackages().

Member Data Documentation

◆ _source

SourceFaction.Row Faction._source

Definition at line 148 of file FACTION.cs.

◆ charaElements

◆ elements

◆ globalPolicies

HashSet<int> Faction.globalPolicies = new HashSet<int>()

Definition at line 144 of file FACTION.cs.

Referenced by AddGlobalPolicy(), and FactionBranch.ValidateUpgradePolicies().

◆ id

string Faction.id

◆ listReserve

◆ name

◆ relation

◆ uid

string Faction.uid

Definition at line 132 of file FACTION.cs.

Referenced by FactionManager.AssignUID(), and RefFaction.RefFaction().

Property Documentation

◆ Name

◆ source

SourceFaction.Row Faction.source
get

Definition at line 152 of file FACTION.cs.

Referenced by GetSprite(), and Init().

◆ TextType

virtual string Faction.TextType
get

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