Skip to content

Class "Entity"⚓︎

Functions⚓︎

AddBaited ()⚓︎

void AddBaited ( EntityRef Source, int Duration )⚓︎


AddBleeding ()⚓︎

void AddBleeding ( EntityRef Source, int Duration )⚓︎


AddBrimstoneMark ()⚓︎

void AddBrimstoneMark ( EntityRef Source, int Duration )⚓︎


AddIce ()⚓︎

void AddIce ( EntityRef Source, int Duration )⚓︎


AddKnockback () 添加击退效果⚓︎

void AddKnockback ( EntityRef Source, Vector PushDirection, int Duration, boolean TakeImpactDamage )⚓︎

持续时间信息

持续时间最长为 0.5 秒/15 帧。


AddMagnetized ()⚓︎

void AddMagnetized ( EntityRef Source, int Duration )⚓︎


AddWeakness ()⚓︎

void AddWeakness ( EntityRef Source, int Duration )⚓︎


ComputeStatusEffectDuration ()⚓︎

int ComputeStatusEffectDuration ( int InitialLength, EntityRef Source )⚓︎


CopyStatusEffects ()⚓︎

void CopyStatusEffects ( Entity Target, boolean Overwrite = false )⚓︎

如果未指定 Target,则会将状态效果递归复制到所有 子实体Overwrite 还会移除目标的所有其他状态效果,并将现有效果的属性设置为与该实体匹配。


ForceCollide ()⚓︎

boolean ForceCollide ( Entity Entity, boolean Force )⚓︎

如果应该 跳过 其余的碰撞逻辑,则返回 true;这可能是因为实体最初并未发生碰撞(如果 Force 为 false),

或者是因为其中一个实体的内部碰撞逻辑决定如此(这可能会受到 PRE_COLLISION 回调之一的影响)。

如果将 Force 设置为 false,那么游戏将在触发碰撞之前检查实体的 EntityCollisionClass 是否兼容,以及两个实体是否都未 Dead

碰撞逻辑更改

某些实体类型在强制碰撞时,其碰撞逻辑会发生变化。 例如:赌博机激活时不会让玩家支付常规费用。


GetBaitedCountdown ()⚓︎

int GetBaitedCountdown ( )⚓︎


GetBleedingCountdown ()⚓︎

int GetBleedingCountdown ( )⚓︎


GetBossStatusEffectCooldown ()⚓︎

int GetBossStatusEffectCooldown ( )⚓︎


GetBrimstoneMarkCountdown ()⚓︎

int GetBrimstoneMarkCountdown ( )⚓︎


GetBurnCountdown ()⚓︎

int GetBurnCountdown ( )⚓︎


GetBurnDamageTimer ()⚓︎

int GetBurnDamageTimer ( )⚓︎


GetCharmedCountdown ()⚓︎

int GetCharmedCountdown ( )⚓︎


GetCollisionCapsule ()⚓︎

Capsule GetCollisionCapsule ( Vector Vector )⚓︎


GetColorParams ()⚓︎

ColorParams[] GetColorParams ( )⚓︎

返回由 SetColor 当前排队的所有颜色及其参数的表。


GetConfusionCountdown ()⚓︎

int GetConfusionCountdown ( )⚓︎


GetDamageCountdown ()⚓︎

int GetDamageCountdown ( )⚓︎

请注意,这与玩家的 无敌帧数(EntityPlayer:GetDamageCooldown()) 不同。DAMAGE_COUNTDOWN DamageFlag 以及此关联的倒计时通常用于控制敌人从少数使用该标志的来源(如“彩虹独角兽”、“钉子”和“游戏掌机”的碰撞伤害效果)受到伤害的速度。

如果实体最近受到了带有 DAMAGE_COUNTDOWN DamageFlag 的伤害,则返回在它再次受到带有 DAMAGE_COUNTDOWN DamageFlag 的伤害之前还需要经过多少帧。


GetDebugShape ()⚓︎

Shape GetDebugShape ( boolean Unknown )⚓︎


GetEntityConfigEntity ()⚓︎

EntityConfigEntity GetEntityConfigEntity ( )⚓︎

返回此实体对应的 EntityConfig 条目。

GetFearCountdown ()⚓︎

int GetFearCountdown ( )⚓︎


GetFireDamageCooldown ()⚓︎

int GetFireDamageCooldown ( )⚓︎


GetFreezeCountdown ()⚓︎

int GetFreezeCountdown ( )⚓︎


GetHitListIndex ()⚓︎

int GetHitListIndex ( )⚓︎


GetIceCountdown ()⚓︎

int GetIceCountdown ( )⚓︎


GetKnockbackCountdown ()⚓︎

int GetKnockbackCountdown ( )⚓︎


GetKnockbackDirection ()⚓︎

Vector GetKnockbackDirection ( )⚓︎


GetMagnetizedCountdown ()⚓︎

int GetMagnetizedCountdown ( )⚓︎


GetMidasFreezeCountdown ()⚓︎

int GetMidasFreezeCountdown ( )⚓︎


GetMinecart ()⚓︎

EntityNPC GetMinecart ( )⚓︎

返回实体所乘坐的矿车。

返回行为

如果实体没有乘坐矿车,则此函数返回 nil


GetNullCapsule ()⚓︎

Capsule GetNullCapsule ( string NullLayerName )⚓︎


GetNullOffset ()⚓︎

Vector GetNullOffset ( string NullLayerName )⚓︎

返回空图层标记的位置。或者,如果图层不可见、当前动画没有可用帧或由于其他未知原因,则返回 Vector.Zero

GetPauseTime ()⚓︎

int GetPauseTime ( )⚓︎


GetPoisonCountdown ()⚓︎

int GetPoisonCountdown ( )⚓︎


GetPoisonDamageTimer ()⚓︎

int GetPoisonDamageTimer ( )⚓︎


GetPosVel ()⚓︎

PosVel GetPosVel ( )⚓︎

返回 2 个值,均为向量。第一个是实体的位置,第二个是实体的速度。

GetPredictedTargetPosition ()⚓︎

Vector GetPredictedTargetPosition ( Entity Target, float Delay )⚓︎

预测值是目标的当前位置加上其速度乘以该实体与目标之间的距离。 Delay 用作预测提前量的乘数。例如,1.0 会预测目标的速度在下一次更新时会将其置于何处。


GetShadowSize ()⚓︎

float GetShadowSize ( )⚓︎


GetShrinkCountdown ()⚓︎

int GetShrinkCountdown ( )⚓︎


GetSlowingCountdown ()⚓︎

int GetSlowingCountdown ( )⚓︎


GetSpeedMultiplier ()⚓︎

float GetSpeedMultiplier ( )⚓︎

弃用通知

此变量实际上是实体的时间缩放比例。未来版本中将添加一个命名更合适的替代函数。


GetType ()⚓︎

EntityType GetType ( )⚓︎


GetWeaknessCountdown ()⚓︎

int GetWeaknessCountdown ( )⚓︎


GiveMinecart ()⚓︎

EntityNPC GiveMinecart ( Vector Position, Vector Velocity )⚓︎


IgnoreEffectFromFriendly ()⚓︎

boolean IgnoreEffectFromFriendly ( EntityRef Source )⚓︎

用于确定此实体是否应忽略来自 Source 的任何状态效果。


MakeBloodPoof ()⚓︎

EntityEffect MakeBloodPoof ( Vector Position = self.Position, Color Color = default, float Scale = 1.0 )⚓︎

此函数会生成两个子类型为 3 和 4 的血溅效果;返回的第二个效果将是第一个效果的子效果。


MakeGroundPoof ()⚓︎

EntityEffect MakeGroundPoof ( Vector Position = self.Position, Color Color = default, float Scale = 1.0 )⚓︎

此函数会生成两个子类型为 1 和 2 的灰尘飞溅效果;返回的第二个效果将是第一个效果的子效果。


SetBaitedCountdown ()⚓︎

void SetBaitedCountdown ( int Countdown )⚓︎


SetBleedingCountdown ()⚓︎

void SetBleedingCountdown ( int Countdown )⚓︎


SetBossStatusEffectCooldown ()⚓︎

void SetBossStatusEffectCooldown ( int Cooldown )⚓︎


SetBrimstoneMarkCountdown ()⚓︎

void SetBrimstoneMarkCountdown ( int Countdown )⚓︎


SetBurnCountdown ()⚓︎

void SetBurnCountdown ( int Countdown )⚓︎


SetBurnDamageTimer ()⚓︎

void SetBurnDamageTimer ( int Timer )⚓︎


SetCharmedCountdown ()⚓︎

void SetCharmedCountdown ( int Countdown )⚓︎


SetColorParams ()⚓︎

void SetColorParams ( ColorParams[] Params )⚓︎

设置要使用的颜色及其参数。


SetConfusionCountdown ()⚓︎

void SetConfusionCountdown ( int Countdown )⚓︎


SetDamageCountdown ()⚓︎

void SetDamageCountdown ( int countdown )⚓︎

请注意,这与玩家的无敌帧数(EntityPlayer:GetDamageCooldown())不同。DAMAGE_COUNTDOWN DamageFlag 以及此关联的倒计时通常用于控制敌人从少数使用该标志的来源(如“彩虹独角兽”、“钉子”和“游戏掌机”的碰撞伤害效果)受到伤害的速度。

设置实体在受到带有 DAMAGE_COUNTDOWN DamageFlag 的伤害之前必须经过的帧数。


SetDead ()⚓︎

void SetDead ( boolean IsDead )⚓︎


SetFearCountdown ()⚓︎

void SetFearCountdown ( int Countdown )⚓︎


SetFireDamageCooldown ()⚓︎

void SetFireDamageCooldown ( int Cooldown )⚓︎


SetFreezeCountdown ()⚓︎

void SetFreezeCountdown ( int Countdown )⚓︎


SetIceCountdown ()⚓︎

void SetIceCountdown ( int Countdown )⚓︎


SetInvincible ()⚓︎

void SetInvincible ( boolean IsInvincible )⚓︎


SetKnockbackCountdown ()⚓︎

void SetKnockbackCountdown ( int Countdown )⚓︎


SetKnockbackDirection ()⚓︎

void SetKnockbackDirection ( Vector Direction )⚓︎


SetMagnetizedCountdown ()⚓︎

void SetMagnetizedCountdown ( int Countdown )⚓︎


SetMidasFreezeCountdown ()⚓︎

void SetMidasFreezeCountdown ( int Countdown )⚓︎


SetPauseTime ()⚓︎

void SetPauseTime ( int Duration )⚓︎


SetPoisonCountdown ()⚓︎

void SetPoisonCountdown ( int Countdown )⚓︎


SetPoisonDamageTimer ()⚓︎

void SetPoisonDamageTimer ( int Timer )⚓︎


SetShadowSize ()⚓︎

float SetShadowSize ( float Size )⚓︎


SetShrinkCountdown ()⚓︎

void SetShrinkCountdown ( int Countdown )⚓︎


SetSlowingCountdown ()⚓︎

void SetSlowingCountdown ( int Countdown )⚓︎


SetSpeedMultiplier ()⚓︎

void SetSpeedMultiplier ( float Amount )⚓︎

弃用通知

此变量实际上是实体的时间缩放比例。未来版本中将添加一个命名更合适的替代函数。


SetWeaknessCountdown ()⚓︎

void SetWeaknessCountdown ( int Countdown )⚓︎


SpawnBloodEffect ()⚓︎

EntityEffect SpawnBloodEffect ( int SubType = 0, Vector position = self.Position, Vector Offset = Vector.Zero, Color Color = Default, Vector Velocity = Vector.Zero )⚓︎


SpawnWaterImpactEffects ()⚓︎

void SpawnWaterImpactEffects ( Vector Position, Vector Velocity = Vector.Zero, float Strength )⚓︎

Warning

仅当房间的 水量 大于或等于 0.2 时,此函数才会生成效果。


TeleportToRandomPosition ()⚓︎

void TeleportToRandomPosition ( )⚓︎


ToDelirium ()⚓︎

EntityDelirium ToDelirium ( )⚓︎

Entity 用户数据转换为 EntityDelirium 用户数据。 仅当源实体是幻痛(以其正常形态或变形形态)的实例时,转换才会成功。

返回行为

如果转换失败,此函数返回 nil


ToSlot ()⚓︎

EntitySlot ToSlot ( )⚓︎

用于将 Entity 对象转换为 EntitySlot 对象。

返回行为

如果转换不成功,此函数返回 nil


TryThrow ()⚓︎

boolean TryThrow ( EntityRef Source, Vector ThrowDirection, float Force )⚓︎