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);
164 CursorSystem.ignoreCount = 1;
192 owner.lastEmo =
Emo.angry;
200 owner.lastEmo =
Emo.angry;
218 bool haltSecondMove =
false;
240 yield
return Status.Running;
251 haltSecondMove =
true;
267 haltSecondMove =
true;
274 haltSecondMove =
true;
278 Debug.Log(
owner.
Name +
"/" + move +
"/" + haltSecondMove +
"/" + dist);
284 yield
return Status.Running;
294 yield
return Status.Running;
305 yield
return Status.Running;
315 yield
return Status.Running;
341 if (aiIdle ==
"stand" || aiIdle ==
"root")
353 yield
return Status.Running;
356 yield
return Status.Running;
363 owner.ride.enemy =
null;
367 owner.parasite.enemy =
null;
375 tc.ride.enemy =
null;
379 tc.parasite.enemy =
null;
439 Debug.Log(
"TryMove:" +
owner.
Name +
"/" + flag +
"/" + dist +
"/" + num);
444 public void AddAbility(
Act a,
int mod = 0,
int chance = 100,
bool aiPt =
false)
464 if (obj !=
null && obj.
id == ele)
481 if (obj !=
null && obj.
id == ele)
520 if ((text ==
"imotoroid" || text ==
"marshmallow_monster") &&
owner.
TryFuse(0.05f))
537 bool charaBuilt =
false;
553 ability.priority = 0;
567 if (flag5 && !(text ==
"melee") && !(text ==
"range") &&
EClass.
rnd(2) == 0)
590 bool flag10 = tactics.source.taunt != -1 && 100 * owner.hp / owner.MaxHP >=
tactics.
source.taunt;
591 num = ((flag9 && !flag10) ? 100 : ((!flag9 && flag10) ? 100 : 0));
597 bool num2 = baseSong !=
null;
599 num = ((!num2 || flag8) ? 200 : 0);
610 num -= (owner.IsPC ? 30 : 10);
614 num -= (owner.IsPC ? 50 : 10);
644 num -= (owner.IsPC ? 30 : 10);
648 num -= (owner.IsPC ? 50 : 10);
660 isHOT = text ==
"hot";
661 num = ForeachChara(ability, (
Chara c) => HealFactor(c), isFriendlyAbility:
true);
675 bool flag7 = text ==
"dot";
681 if (num > 0 && flag7)
702 GetNumEnemy(flag6 ? 6 : 5);
707 num = tactics.P_Spell - 20 + numEnemy * 10 + GetAttackMod(
act);
718 num = ForeachChara(ability, delegate(
Chara c)
722 }, isFriendlyAbility:
true);
729 num = ForeachChara(ability, (
Chara c) => c.
CountDebuff() * 30, isFriendlyAbility:
true);
751 num = ForeachChara(ability, delegate(
Chara c)
755 }, isFriendlyAbility:
false);
804 case "summonSpecial":
811 case "summonSpecial2":
821 num = ((dist <= 1) ? 1000 : 0);
825 if (
EClass.
rnd(200) <= num && (!owner.IsPowerful || owner.hp < owner.MaxHP / 2))
855 if (member.
Evalue(418) < 0)
857 owner.enemy = (
tc = member);
903 float num5 = 100f - (float)(member2.
mana.
value * 100) / MathF.Max(1f, member2.
mana.
max);
904 if (num5 > (
float)num)
912 num = 100 - owner.mana.value * 100 / Mathf.Max(1,
owner.
mana.
max);
920 num = 100 - owner.hp * 100 / Mathf.Max(1,
owner.
MaxHP);
936 if (s.
target ==
"Neighbor")
960 if (flag2 || isConfused || flag4)
971 if (isConfused || flag4)
981 ability.priority = num;
982 int HealFactor(
Chara c)
988 float num6 = (float)c.
hp / (
float)c.
MaxHP;
989 if (num6 > (isHOT ? 0.85f : 0.75f))
993 int num7 = tactics.P_Heal - (int)((
float)tactics.P_Heal * num6) + (isHOT ? 50 : 25);
1008 else if (condition2 is
ConDim)
1031 if (ability2.
act.
source.alias ==
"ActRanged")
1048 if (isPCFaction && cost.
cost > 0)
1101 void BuildCharaList()
1112 if (chara2 !=
owner)
1123 int ForeachChara(
ItemAbility a, Func<Chara, int> func,
bool isFriendlyAbility)
1134 int num7 = func(chara3);
1137 if (isFriendlyAbility)
1150 if (chara3 !=
owner)
1168 int GetAttackMod(
Act a)
1207 void GetNumEnemy(
int radius)
1223 int GetNumNeutral(
int radius)
1225 if (numNeutral != -1)
1256 AddAbility(item2.act, 0, item2.chance, item2.pt);
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()
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)
MoveResult TryMoveFrom(Point p)
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)
int GetInt(string id, int? defaultInt=null)
bool HasElement(int ele, bool includeNagative=false)
int ResistLvFrom(int ele)
void Say(string lang, string ref1=null, string ref2=null)
override bool IsAliveInCurrentZone
BaseCondition GetCondition(string idCon)
Hostility OriginalHostility
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)
bool CanInteractTo(Card c)
MoveResult TryMoveTowards(Point p)
bool FindNearestNewEnemy()
Chara SetEnemy(Chara c=null)
ConBaseTransmuteMimic mimicry
void TrySetEnemy(Chara c)
bool TryFuse(float chance=1f)
static CursorInfo IconMelee
int GetRaw(int offsetHours=0)
static SourceManager sources
virtual int GetPower(Card c)
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)
void SetBridge(int x, int z, int height=0, int idMat=0, int idBridge=0, int dir=0, byte idPillar=0)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
HashSet< int > favAbility
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)