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