8 public override bool IsTool
18 public override bool CanStack
32 return this.owner.c_idRefName;
37 public override void TrySetHeldAct(
ActPlan p)
41 p.TrySetAct(this.LangUse, () => this.OnUse(
EClass.pc),
this.owner,
null, 1,
false,
true,
false);
46 public override bool OnUse(
Chara c)
48 Dialog.InputName(
"dialogDetector", this.term, delegate(
bool cancel,
string text)
52 this.owner.c_idRefName = text;
55 },
Dialog.InputType.Default);
60 public override void OnHeld()
66 public override void OnTickHeld()
69 if (this.interval <= 0)
78 if (this.term.IsEmpty())
86 int num2 =
EClass.pc.Dist(thing);
87 if ((thing.id.ToLower().Contains(
this.term.ToLower()) || thing.Name.ToLower().Contains(
this.term.ToLower())) && num2 < num)
96 EClass.pc.PlaySound(
"detect_none", 1f,
true);
100 EClass.pc.PlaySound(
"detect_" + ((num <= 1) ?
"detected" : ((num < 5) ?
"near" : ((num < 15) ?
"medium" : ((num < 30) ?
"far" : ((num < 50) ?
"veryFar" :
"superFar"))))), 1f,
true);
101 this.interval = ((num <= 1) ? 1 : ((num < 5) ? 2 : ((num < 15) ? 4 : ((num < 30) ? 7 : 10))));
103 this.owner.PlayAnime(AnimeID.HitObj,
false);
107 public override void SetName(ref
string s)
109 if (!this.term.IsEmpty())
111 s =
"_detect".lang(s, this.term,
null,
null,
null);