Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitSyringeGene.cs
Go to the documentation of this file.
1public class TraitSyringeGene : Trait
2{
3 public override bool CanChangeHeight => false;
4
5 public override void TrySetHeldAct(ActPlan p)
6 {
7 p.pos.Charas.ForEach(delegate(Chara c)
8 {
9 p.TrySetAct("actInject".lang("", c.Name), delegate
10 {
11 EClass.pc.PlaySound("syringe");
12 EClass.pc.Say("syringe", EClass.pc, owner.NameOne, c.Name);
13 c.PlayEffect("blood").SetParticleColor(EClass.Colors.matColors[c.material.alias].main).Emit(20);
14 c.AddBlood(2 + EClass.rnd(2));
15 c.AddCondition<ConHallucination>(50);
16 TraitGeneMachine traitGeneMachine = c.pos.FindThing<TraitGeneMachine>();
17 if (traitGeneMachine != null && traitGeneMachine.GetTarget() == c)
18 {
19 int remainingHours = EClass.world.date.GetRemainingHours(c.conSuspend.dateFinish);
20 remainingHours = remainingHours * 2 / 3 - 10;
21 if (remainingHours < 0)
22 {
23 remainingHours = 0;
24 }
25 c.conSuspend.dateFinish = EClass.world.date.GetRaw(remainingHours);
26 c.PlayEffect("heal_tick");
27 c.PlaySound("heal_tick");
28 }
29 else
30 {
31 c.ModCorruption(-50);
32 }
33 owner.ModNum(-1);
34 return false;
35 }, c);
36 });
37 }
38}
Point pos
Definition: ActPlan.cs:149
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:344
string Name
Definition: Card.cs:2013
void ModNum(int a, bool notify=true)
Definition: Card.cs:3262
Definition: Chara.cs:10
List< Chara > Charas
Definition: Point.cs:316
override bool CanChangeHeight
override void TrySetHeldAct(ActPlan p)
Definition: Trait.cs:7
Card owner
Definition: Trait.cs:26