1using System.Globalization;
24 if (attackerCreature !=
null) {
33 if (componentDamage !=
null) {
49 set =>
Target = value.Entity;
92 if (componentClothing !=
null) {
98 if (componentFactors !=
null) {
103 if (componentHealth !=
null) {
107 if (componentDamage !=
null) {
120 string text2 = (0f - damage).ToString(
"0", CultureInfo.InvariantCulture);
122 if (attackerBody !=
null) {
123 hitValueParticleVelocity = attackerBody.
Velocity;
125 Color color = attackerComponentPlayer !=
null && damage > 0f && attackedComponentHealth !=
null ? Color.White :
Color.
Transparent;
128 "SetHitValueParticleSystem",
130 modLoader.SetHitValueParticleSystem(particleSystem,
this);
141 if (componentHealth ==
null
142 || componentBody ==
null) {
147 float healthBeforeAttack = componentHealth.
Health;
149 if (injuryAmount > 0f) {
164 if (componentDamage ==
null
165 || componentBody ==
null) {
171 float hitPointsBeforeAttack = componentDamage.
Hitpoints;
172 componentDamage.
Damage(injuryAmount);
175 if (injuryAmount > 0f
183 if (
Attacker?.FindComponent<ComponentPlayer>() !=
null
184 &&
Target?.FindComponent<ComponentPlayer>() !=
null
205 if (componentLocomotion !=
null) {
220 loader.ProcessAttackment(
this);
224 float injuryAmount = 0f;
227 componentBody?.
Attacked?.Invoke(
this);
229 if (componentHealth !=
null) {
233 if (componentDamage !=
null) {
238 "AttackPowerParameter",
240 bool reclalculate =
false;
242#pragma warning disable CS0618
243 modloader.AttackPowerParameter(
252#pragma warning restore CS0618
253 if (stunTimeSet >= 0f) {
static int Max(int x1, int x2)
virtual bool DisableFriendlyFire()
bool AllowImpulseAndStunWhenDamageIsZero
virtual void ProcessAttackmentToNonCreature(out float injuryAmount)
bool EnableResilienceFactor
virtual void StunTarget()
ValuesDictionary DictionaryForOtherMods
模组可以向Dictionary里面添加内容,另一个模组可以从Dictionary读取内容,以实现模组联动效果
bool EnableHitValueParticleSystem
Attackment(ComponentBody target, Entity attacker, Vector3 hitPoint, Vector3 hitDirection, float attackPower)
virtual void ImpulseTarget()
virtual float CalculateInjuryAmount()
virtual float ArmorProtectionDivision
该攻击被护甲结算时,护甲的防御值会除以ArmorProtectionDivision。 例如当ArmorProtectionDivision = 2,模组护甲的ArmorProtection = 150...
bool EnableArmorProtection
Attackment(Entity target, Entity attacker, Vector3 hitPoint, Vector3 hitDirection, float attackPower)
virtual void ProcessAttackment()
virtual ComponentBody TargetBody
virtual void ProcessAttackmentToCreature(out float injuryAmount)
virtual void AddHitValueParticleSystem(float damage)
virtual Action< Attackment > Attacked
float ApplyArmorProtection(float attackPower)
ReadOnlyList< string > KillVerbs
virtual void Damage(float amount)
virtual void Injure(float amount, ComponentCreature attacker, bool ignoreInvulnerability, string cause)
virtual float AttackResilience
攻击抗性
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
WorldSettings WorldSettings
bool IsFriendlyFireEnabled
Component FindComponent(Type type, string name, bool throwOnError)
static void HookAction(string HookName, Func< ModLoader, bool > action)
执行Hook
static Vector3 Normalize(Vector3 v)
static readonly Vector3 Zero
static readonly Vector3 UnitY