2using System.Collections.Generic;
36 public List<Chara>
charas =
new List<Chara>();
55 public override IEnumerable<Status>
Run()
71 bool canSeeLos =
false;
101 tc = (owner.enemy =
null);
106 tc = (owner.enemy =
null);
122 lostCount = ((!canSeeLos) ? (lostCount + 1) : 0);
154 CursorSystem.ignoreCount = 1;
178 owner.lastEmo =
Emo.angry;
186 owner.lastEmo =
Emo.angry;
201 bool haltSecondMove =
false;
223 yield
return Status.Running;
234 haltSecondMove =
true;
250 haltSecondMove =
true;
257 haltSecondMove =
true;
261 Debug.Log(
owner.
Name +
"/" + move +
"/" + haltSecondMove +
"/" + dist);
267 yield
return Status.Running;
277 yield
return Status.Running;
288 yield
return Status.Running;
298 yield
return Status.Running;
324 if (aiIdle ==
"stand" || aiIdle ==
"root")
332 yield
return Status.Running;
335 yield
return Status.Running;
342 owner.ride.enemy =
null;
346 owner.parasite.enemy =
null;
354 tc.ride.enemy =
null;
358 tc.parasite.enemy =
null;
418 Debug.Log(
"TryMove:" +
owner.
Name +
"/" + flag +
"/" + dist +
"/" + num);
423 public void AddAbility(
Act a,
int mod = 0,
int chance = 100,
bool aiPt =
false)
443 if (obj !=
null && obj.
id == ele)
460 if (obj !=
null && obj.
id == ele)
506 bool charaBuilt =
false;
522 ability.priority = 0;
536 if (flag5 && !(text ==
"melee") && !(text ==
"range") &&
EClass.
rnd(2) == 0)
559 bool flag11 = tactics.source.taunt != -1 && 100 * owner.hp / owner.MaxHP >=
tactics.
source.taunt;
560 num = ((flag10 && !flag11) ? 100 : ((!flag10 && flag11) ? 100 : 0));
566 bool flag8 = owner.mana.value > owner.mana.max / 3;
567 num = ((flag7 && !flag8) ? 100 : ((!flag7 && flag8) ? 100 : 0));
578 num -= (owner.IsPC ? 30 : 10);
582 num -= (owner.IsPC ? 50 : 10);
612 num -= (owner.IsPC ? 30 : 10);
616 num -= (owner.IsPC ? 50 : 10);
628 isHOT = text ==
"hot";
629 num = ForeachChara(ability, (
Chara c) => HealFactor(c), isFriendlyAbility:
true);
643 bool flag9 = text ==
"dot";
649 if (num > 0 && flag9)
670 GetNumEnemy(flag6 ? 6 : 5);
675 num = tactics.P_Spell - 20 + numEnemy * 10 + GetAttackMod(
act);
686 num = ForeachChara(ability, delegate(
Chara c)
690 }, isFriendlyAbility:
true);
697 num = ForeachChara(ability, (
Chara c) => c.
CountDebuff() * 30, isFriendlyAbility:
true);
719 num = ForeachChara(ability, delegate(
Chara c)
723 }, isFriendlyAbility:
false);
772 case "summonSpecial":
779 case "summonSpecial2":
789 num = ((dist <= 1) ? 1000 : 0);
793 if (
EClass.
rnd(200) <= num && (!owner.IsPowerful || owner.hp < owner.MaxHP / 2))
817 if (member.
Evalue(418) < 0)
819 owner.enemy = (
tc = member);
865 float num4 = 100f - (float)(member2.
mana.
value * 100) / MathF.Max(1f, member2.
mana.
max);
866 if (num4 > (
float)num)
874 num = 100 - owner.mana.value * 100 / Mathf.Max(1,
owner.
mana.
max);
882 num = 100 - owner.hp * 100 / Mathf.Max(1,
owner.
MaxHP);
898 if (s.
target ==
"Neighbor")
922 if (flag2 || isConfused || flag4)
933 if (isConfused || flag4)
943 ability.priority = num;
944 int HealFactor(
Chara c)
950 float num5 = (float)c.
hp / (
float)c.
MaxHP;
951 if (num5 > (isHOT ? 0.85f : 0.75f))
955 int num6 = tactics.P_Heal - (int)((
float)tactics.P_Heal * num5) + (isHOT ? 50 : 25);
970 else if (condition2 is
ConDim)
993 if (ability2.
act.
source.alias ==
"ActRanged")
1010 if (isPCFaction && cost.
cost > 0)
1052 void BuildCharaList()
1063 if (chara2 !=
owner)
1074 int ForeachChara(
ItemAbility a, Func<Chara, int> func,
bool isFriendlyAbility)
1085 int num8 = func(chara3);
1088 if (isFriendlyAbility)
1101 if (chara3 !=
owner)
1119 int GetAttackMod(
Act a)
1158 void GetNumEnemy(
int radius)
1174 int GetNumNeutral(
int radius)
1176 if (numNeutral != -1)
static Act Create(int id)
virtual bool ShouldAllyAttack(Chara tg)
override string ToString()
Status DoGoto(Point pos, int dist=0, bool ignoreConnection=false, Func< Status > _onChildFail=null)
void SetTurbo(int mtp=-1)
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
override bool CanPerform()
virtual TargetType TargetType
virtual bool HaveLongPressAction
virtual bool CanPerform()
bool IsTargetHostileParty()
int GetInt(int id, int? defaultInt=null)
virtual ConditionType Type
void Teleport(Point point, bool silent=false, bool force=false)
bool IsRestrainedResident
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
bool HasEditorTag(EditorTag tag)
void ModExp(string alias, int a)
bool HasElement(int ele, bool includeNagative=false)
int ResistLvFrom(int ele)
void Say(string lang, string ref1=null, string ref2=null)
Hostility OriginalHostility
MoveResult TryMoveFrom(Point p)
Element GetBuffStats(string alias)
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Chara GetNearbyCatToSniff()
bool CanSeeLos(Card c, int dist=-1)
override string ToString()
List< Condition > conditions
bool HasCondition(string alias)
override bool IsPCFaction
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
override bool IsPCFactionMinion
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
bool CanBeTempAlly(Chara c)
MoveResult TryMoveTowards(Point p)
bool FindNearestNewEnemy()
Chara SetEnemy(Chara c=null)
void TrySetEnemy(Chara c)
static CursorInfo IconMelee
int GetRaw(int offsetHours=0)
static SourceManager sources
static Element Create(int id, int v=0)
virtual Act.Cost GetCost(Chara c)
ConfigAutoCombat autoCombat
virtual bool TryUseRanged(int dist)
override IEnumerable< Status > Run()
virtual bool TryThrow(int dist)
virtual void BuildAbilityList()
void TryRemoveAbility(int ele)
virtual bool TryAbortCombat()
override bool CancelOnAggro
List< ItemAbility > abilities
virtual bool TryUseAbility(int dist, bool beforeMove=false)
override CursorInfo CursorIcon
override bool CancelWhenDamaged
void TryAddAbility(int ele)
override bool CanManualCancel()
void AddAbility(Act a, int mod=0, int chance=100, bool aiPt=false)
Point GetRandomSurface(int x, int z, int radius, bool walkable=true, bool allowWater=false)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
virtual TargetRange Range
int CountMinions(Chara c)
virtual bool SetAlarmOnBreakLaw
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
virtual void SetAlarm(bool enable)