9 public override bool CanBeOnlyBuiltInHome
19 public override bool IsHomeItem
28 public Chara GetTarget()
30 foreach (
Chara chara
in this.owner.pos.Charas)
33 if (condition !=
null && condition.uidMachine ==
this.owner.uid)
42 public bool IsTargetUsingGene()
44 Chara target = this.GetTarget();
45 return target !=
null && target.GetCondition<
ConSuspend>().HasGene;
49 public float GetProgress()
52 if (condition ==
null || !condition.HasGene)
56 int remainingHours =
EClass.world.date.GetRemainingHours(condition.dateFinish);
57 if (condition.duration == 0 ||
EClass.debug.enable)
61 return Mathf.Clamp((
float)(condition.duration - remainingHours) / (
float)condition.duration, 0f, 1f);
65 public string GetProgressText()
68 int remainingHours =
EClass.world.date.GetRemainingHours(condition.dateFinish);
69 if (remainingHours > 0)
71 return remainingHours.ToString() +
" h";
73 return "progress_finish".lang();
77 public override bool CanUse(
Chara c)
79 return this.owner.IsInstalled && this.owner.isOn && (!this.IsTargetUsingGene() || this.GetProgress() >= 1f);
83 public override bool OnUse(
Chara c)
85 Chara target = this.GetTarget();
92 if (chara.GetCondition<
ConSuspend>() ==
null && chara.host ==
null && !chara.IsPC && chara.IsAliveInCurrentZone && chara.memberType == FactionMemberType.Default)
101 EClass.pc.party.RemoveMember(c);
103 if (!c.pos.Equals(
this.owner.pos))
105 EClass.pc.Kick(this.owner.pos,
false);
106 c.Teleport(this.owner.pos,
false,
true);
110 if (c.c_genes ==
null)
114 c.c_genes.inferior += 20;
118 c.PlaySound(
"ride", 1f,
true);
120 }, (
Chara a) =>
"gene_note".lang(((a.c_genes !=
null) ? a.c_genes.items.Count : 0).ToString() ??
"", a.MaxGene.ToString() ??
"", a.feat.ToString() ??
"", a.GetTotalFeat().ToString() +
" ",
null));
122 else if (this.GetProgress() >= 1f)
125 if (condition.gene.GetRootCard() != target)
127 Msg.SayNothingHappen();
131 target.Say(
"gene_finish", target, condition.gene,
null,
null);
132 condition.gene.c_DNA.Apply(target);
133 condition.gene.Destroy();
134 condition.gene =
null;
137 target.MoveNeighborDefinitely();
138 target.PlaySound(
"ding_potential", 1f,
true);
139 target.pos.PlayEffect(
"mutation");