19 public override bool IsValidTC(
Card c)
21 return !EClass._zone.IsUserZone && !(c.isThing & EClass._zone is
Zone_LittleGarden) && (c.isNPCProperty || !c.isThing) && c.trait.CanBeStolen && c.c_lockLv <= 0 && (c.isThing || !c.IsPCFaction);
26 public override int MaxRadius
36 public override bool IsHostileAct
45 public override bool CanPerform()
47 return Act.TC !=
null;
51 public override bool Perform()
54 return base.Perform();
58 public override IEnumerable<
AIAct.Status> Run()
60 Chara chara = this.target.Chara;
63 this.target = chara.things.FindStealable();
64 if (this.target ==
null && chara.GetInt(30,
null) <
EClass.world.date.GetRaw(0))
68 this.target = chara.AddThing(
ThingGen.Create(
"money", -1, -1).SetNum(1 +
EClass.rnd(chara.LV * 10)),
true, -1, -1);
72 this.target = chara.AddThing(
ThingGen.CreateFromFilter(
"steal", chara.LV),
true, -1, -1);
73 chara.SetInt(30,
EClass.world.date.GetRaw(0) + 1440);
76 if (this.target ==
null)
78 this.owner.Say(
"steal_chara_nothing", this.owner, chara,
null,
null);
79 yield
return this.Cancel();
81 this.owner.Say(
"steal_chara", this.owner, chara,
null,
null);
85 if (this.target.things.Count > 0)
87 Thing thing = this.target.things.FindStealable();
93 this.owner.Say(
"steal_thing", this.owner, this.target,
null,
null);
101 Card root = card.GetRootCard();
103 progress_Custom.canProgress = (() => this.target.parent == targetParent && (chara ==
null || chara.ExistsOnMap));
104 progress_Custom.onProgressBegin = delegate()
107 Func<Chara, bool> <>9__4;
110 this.owner.LookAt(root);
111 this.owner.PlaySound(
"steal", 1f,
true);
112 root.renderer.PlayAnime(AnimeID.Shiver,
default(Vector3),
false);
118 if (chara !=
null && this.owner.Dist(chara) > 1)
120 EClass.pc.TryMoveTowards(chara.pos);
121 if (this.owner ==
null)
126 if (chara !=
null && this.owner.Dist(chara) > 1)
128 EClass.pc.Say(
"targetTooFar",
null,
null);
133 if (this.target.ChildrenAndSelfWeight >
this.owner.Evalue(281) * 200 +
this.owner.STR * 100 + 1000)
135 EClass.pc.Say(
"tooHeavy", this.target,
null,
null);
139 int count = this.owner.pos.ListWitnesses(this.owner, 4, WitnessType.crime, chara).Count;
140 Point pos = this.owner.pos;
141 Chara owner = this.owner;
144 Func<Chara, bool> funcWitness;
145 if ((funcWitness = <>9__4) ==
null)
147 funcWitness = (<>9__4 = delegate(
Chara c)
149 int num = c.CanSee(this.owner) ? 0 : 30;
150 int num2 = c.PER * 250 / 100;
151 if (this.target.isThing &&
this.target.Thing.isEquipped)
154 if (this.target.rarity >= Rarity.Legendary)
158 if (this.target.rarity >= Rarity.Artifact)
167 return EClass.rnd(num2) > this.owner.Evalue(281) + this.owner.DEX + num;
170 if (pos.TryWitnessCrime(owner, chara, radius, funcWitness))
175 this.owner.elements.ModExp(281, Mathf.Min(count * 5 + 5, 25),
false);
177 progress_Custom.onProgressComplete = delegate()
179 if (this.target.isThing &&
this.target.IsInstalled)
181 this.target.SetPlaceState(PlaceState.roaming,
false);
183 this.owner.Say(
"steal_end", this.owner, this.target,
null,
null);
184 if (chara !=
null && (chara.IsPCFaction || chara.OriginalHostility >= Hostility.Friend))
186 EClass.player.ModKarma(-1);
188 else if (chara ==
null || chara.hostility > Hostility.Enemy)
190 EClass.player.ModKarma(-1);
192 this.target.isNPCProperty =
false;
193 if (!this.target.category.IsChildOf(
"currency"))
195 this.target.isStolen =
true;
197 this.owner.Pick(this.target.Thing,
true,
true);
198 this.owner.elements.ModExp(281, 50,
false);
201 EClass.pc.stamina.Mod(-1);
205 yield
return base.Do(seq,
null);