12 int.TryParse(item.Attribute(
"Index").Value, out
int ClothIndex);
14 string newDescription = item.Attribute(
"Description")?.Value;
15 string newDisplayName = item.Attribute(
"DisplayName")?.Value;
16 if (newDescription !=
null
17 && newDescription.StartsWith(
'[')
18 && newDescription.EndsWith(
']')
22 if (newDisplayName !=
null
23 && newDisplayName.StartsWith(
'[')
24 && newDisplayName.EndsWith(
']')
99 public Action<int, ComponentClothing>
Mount;
109 public Action<int, ComponentClothing>
Update;
126 List<int> clothesBeforeProtection,
127 List<int> clothesAfterProtection,
130 ref
float attackPowerAfterProtection) {
131 int value = clothesBeforeProtection[sequence];
134 float remainingSturdiness = (maxDurability - block.
GetDamage(value)) / maxDurability *
Sturdiness;
135 float damageToAbsorb = MathF.Min(
139 if (damageToAbsorb > 0f) {
140 attackPowerAfterProtection -= damageToAbsorb;
142 float x2 = damageToAbsorb /
Sturdiness * maxDurability + 0.001f;
146 if (!blockDamaged.
CanWear(clothesAfterProtection[sequence])) {
185 float num2 = componentClothing.m_componentVitalStats.Wetness > 0f ? 10f *
Sturdiness : 20f *
Sturdiness;
195 int damagedClothingBlockValue = componentClothing.
m_clothesList[indexInClothesList];
197 if (!clothingBlock.
CanWear(damagedClothingBlockValue)) {
218 catch (Exception ex) {
static void Error(object message)
static float Remainder(float x, float y)
static float Saturate(float x)
The spell "Attackment" is wrong, But it is not recommended to change it because many mods rely on thi...
virtual float ArmorProtectionDivision
该攻击被护甲结算时,护甲的防御值会除以ArmorProtectionDivision。 例如当ArmorProtectionDivision = 2,模组护甲的ArmorProtection = 150...
virtual bool CanWear(int value)
virtual int GetDamage(int value)
virtual int GetDurability(int value)
static int DamageItem(int value, int damageCount, Entity owner=null)
static int GetClothingColor(int data)
virtual void OnClotheSet(ComponentClothing componentClothing)
在ComponentClothing执行SetClothes()时触发,用于调整ComponentClothing中的一些参数
Action< int, ComponentClothing > Update
ComponentClothing更新时触发。
ValuesDictionary DictionaryForOtherMods
模组可以向Dictionary里面添加特殊数据,另一个模组可以从Dictionary读取数据,以实现模组联动效果
float SteedMovementSpeedFactor
string ImpactSoundsFolder
virtual void UpdateGraduallyDamagedOverTime(ComponentClothing componentClothing, int indexInClothesList, float dt)
在ComponentClothing中每帧都会调用的UpdateGraduallyDamagedOverTime(),主要用于控制衣物随时间逐渐损坏
virtual Color GetColor(ComponentClothing componentClothing, int value)
获取衣物穿着在身上时的颜色附加
virtual void ApplyArmorProtection(ComponentClothing componentClothing, List< int > clothesBeforeProtection, List< int > clothesAfterProtection, int sequence, Attackment attackment, ref float attackPowerAfterProtection)
计算单件护甲的防御
float MovementSpeedFactor
Action< int, ComponentClothing > Mount
装备
ClothingData(XElement item)
Action< int, ComponentClothing > Dismount
卸载
static Dictionary< string, ClothingSlot > ClothingSlots
调用自定义部位(比如手臂)的ClothingSlot,可以用ClothingSlot.ClothingSlots["Arms"]
virtual Vector3 StanceBoxSize
ComponentGui m_componentGui
double? m_lastTotalElapsedGameTime
SubsystemTerrain m_subsystemTerrain
SubsystemParticles m_subsystemParticles
ComponentBody m_componentBody
SubsystemGameInfo m_subsystemGameInfo
List< int > m_clothesList
Dictionary< ClothingSlot, float > InsulationBySlots
SubsystemAudio m_subsystemAudio
virtual void DisplaySmallMessage(string text, Color color, bool blinking, bool playNotificationSound)
static object Get(Type type, string name)
static bool TryGetBlock(string blockName, string prop, out string result)
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
void PlayRandomSound(string directory, float volume, float pitch, float pan, float delay)
double TotalElapsedGameTime
WorldSettings WorldSettings
Color GetFabricColor(int index)
void AddParticleSystem(ParticleSystemBase particleSystem, bool throwOnAlreadyAdded=false)
static int ExtractContents(int value)
static int ExtractData(int value)
bool AreAdventureSurvivalMechanicsEnabled
static object GetAttributeValue(XElement node, string attributeName, Type type)