Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitWhipLove.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
4public class TraitWhipLove : TraitTool
5{
6 public override bool HasCharges => true;
7
8 public override void OnCreate(int lv)
9 {
10 owner.c_charges = EClass.rnd(7) + 3;
11 }
12
13 public override void TrySetHeldAct(ActPlan p)
14 {
15 p.pos.ListCards().ForEach(delegate(Card a)
16 {
17 Chara c = a.Chara;
18 if (c != null)
19 {
20 List<Hobby> list = c.ListWorks(useMemberType: false);
21 List<Hobby> list2 = c.ListHobbies(useMemberType: false);
22 if (p.IsSelfOrNeighbor && EClass.pc.CanSee(a) && c.IsPCFaction && c.homeBranch != null && list.Count > 0 && list2.Count > 0)
23 {
24 p.TrySetAct("actWhip", delegate
25 {
26 EClass.pc.Say("use_whip", c, owner);
27 EClass.pc.Say("use_scope2", c);
28 c.Talk("pervert2");
29 EClass.pc.PlaySound("whip");
30 c.PlayAnime(AnimeID.Shiver);
31 c.OnInsulted();
32 if (this is TraitWhipInterest)
33 {
34 c.bio.idInterest = EClass.rnd(Enum.GetNames(typeof(Interest)).Length);
35 c.SetRandomTone();
36 c.SetRandomTalk();
37 EClass.pc.Say("use_whip4", c);
38 }
39 else
40 {
41 c.RerollHobby();
42 Hobby hobby = c.ListWorks(useMemberType: false)[0];
43 Hobby hobby2 = c.ListHobbies(useMemberType: false)[0];
44 EClass.pc.Say("use_whip2", c, hobby.Name, hobby2.Name);
45 c.RefreshWorkElements(c.homeBranch.elements);
46 }
47 owner.ModCharge(-1);
48 if (owner.c_charges <= 0)
49 {
50 EClass.pc.Say("spellbookCrumble", owner);
51 owner.Destroy();
52 }
53 return true;
54 }, c);
55 }
56 }
57 });
58 }
59}
Point pos
Definition: ActPlan.cs:149
bool IsSelfOrNeighbor
Definition: ActPlan.cs:175
Definition: Card.cs:11
virtual Chara Chara
Definition: Card.cs:1946
Definition: Chara.cs:10
override bool IsPCFaction
Definition: Chara.cs:656
bool CanSee(Card c)
Definition: Chara.cs:1027
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8136
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8109
FactionBranch homeBranch
Definition: Chara.cs:889
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
static Chara pc
Definition: EClass.cs:14
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1015
override void TrySetHeldAct(ActPlan p)
override void OnCreate(int lv)
Definition: TraitWhipLove.cs:8
override bool HasCharges
Definition: TraitWhipLove.cs:6