36 bool skipVanilla =
false;
38 "CallNearbyCreaturesHelp",
40 modLoader.CallNearbyCreaturesHelp(
this, target, maxRange, maxChaseTime, isPersistent, out skipVanilla);
44 if (skipVanilla || target ==
null) {
51 if (componentHerdBehavior !=
null
52 && !
string.IsNullOrEmpty(componentHerdBehavior.
HerdName)
56 if (componentChaseBehavior !=
null
57 && componentChaseBehavior.
Target ==
null) {
58 componentChaseBehavior.
Attack(target, maxRange, maxChaseTime, isPersistent);
66 bool skipVanilla =
false;
67 Vector3? herdCenterFromMod =
null;
76 return herdCenterFromMod;
78 if (
string.IsNullOrEmpty(
HerdName)) {
87 if (componentHerdBehavior !=
null
117 HerdName = valuesDictionary.GetValue<
string>(
"HerdName");
118 m_herdingRange = valuesDictionary.GetValue<
float>(
"HerdingRange");
120 m_componentCreature.ComponentHealth.Injured += delegate(
Injury injury) {
128 if (
m_subsystemTime.PeriodicGameTimeEvent(1.0, 1f * (GetHashCode() % 256 / 256f))) {
130 if (vector2.HasValue) {
176 maxPathfindingPositions,
static float DegToRad(float degrees)
virtual void Attack(ComponentCreature componentCreature, float maxRange, float maxChaseTime, bool isPersistent)
ComponentHealth ComponentHealth
ComponentBody ComponentBody
SubsystemTime m_subsystemTime
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
Vector3? FindHerdCenter()
virtual void Update(float dt)
bool m_autoNearbyCreaturesHelp
override float ImportanceLevel
void CallNearbyCreaturesHelp(ComponentCreature target, float maxRange, float maxChaseTime, bool isPersistent)
ComponentCreature m_componentCreature
ComponentPathfinding m_componentPathfinding
SubsystemCreatureSpawn m_subsystemCreatureSpawn
StateMachine m_stateMachine
virtual ComponentCreature Attacker
ValuesDictionary ValuesDictionary
Component FindComponent(Type type, string name, bool throwOnError)
static void HookAction(string HookName, Func< ModLoader, bool > action)
执行Hook
static float DistanceSquared(Vector3 v1, Vector3 v2)
static readonly Vector3 Zero
static float Distance(Vector3 v1, Vector3 v2)