Elin Decompiled Documentation EA 23.268 Nightly
Loading...
Searching...
No Matches
TraitSyringeGene.cs
Go to the documentation of this file.
2{
3 public override void TrySetHeldAct(ActPlan p)
4 {
5 p.pos.Charas.ForEach(delegate(Chara c)
6 {
7 p.TrySetAct("actInject".lang("", c.Name), delegate
8 {
9 EffectInject(EClass.pc, c);
10 c.AddCondition<ConHallucination>(50);
11 TraitGeneMachine traitGeneMachine = c.pos.FindThing<TraitGeneMachine>();
12 if (traitGeneMachine != null && traitGeneMachine.GetTarget() == c)
13 {
14 int remainingHours = EClass.world.date.GetRemainingHours(c.conSuspend.dateFinish);
15 remainingHours = remainingHours * 2 / 3 - 10;
16 if (remainingHours < 0)
17 {
18 remainingHours = 0;
19 }
20 c.conSuspend.dateFinish = EClass.world.date.GetRaw(remainingHours);
21 c.PlayEffect("heal_tick");
22 c.PlaySound("heal_tick");
23 }
24 else
25 {
26 c.ModCorruption(-50);
27 }
28 owner.ModNum(-1);
29 return true;
30 }, c);
31 });
32 }
33}
Point pos
Definition: ActPlan.cs:152
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition: ActPlan.cs:368
string Name
Definition: Card.cs:2140
void ModNum(int a, bool notify=true)
Definition: Card.cs:3540
Definition: Chara.cs:10
List< Chara > Charas
Definition: Point.cs:340
override void TrySetHeldAct(ActPlan p)
Card owner
Definition: Trait.cs:28