11 public static string fName =
"SubsystemBowBlockBehavior";
31 componentPlayer.ComponentGui.ModalPanelWidget = componentPlayer.ComponentGui.ModalPanelWidget ==
null
39 if (inventory !=
null) {
41 if (activeSlotIndex >= 0) {
54 ((componentMiner.ComponentCreature.ComponentBody.IsCrouching ? 0.02f : 0.04f)
70 if (componentFirstPersonModel !=
null) {
72 componentFirstPersonModel.ItemOffsetOrder =
new Vector3(-0.1f, 0.15f, 0f);
73 componentFirstPersonModel.ItemRotationOrder =
new Vector3(0f, -0.7f, 0f);
75 componentMiner.ComponentCreature.ComponentCreatureModel.AimHandAngleOrder = 1.2f;
76 componentMiner.ComponentCreature.ComponentCreatureModel.InHandItemOffsetOrder =
new Vector3(0f, 0f, 0f);
77 componentMiner.ComponentCreature.ComponentCreatureModel.InHandItemRotationOrder =
new Vector3(0f, -0.2f, 0f);
93 if (arrowType.HasValue) {
94 Vector3 vector = componentMiner.ComponentCreature.ComponentCreatureModel.EyePosition
95 + componentMiner.ComponentCreature.ComponentBody.Matrix.Right * 0.3f
96 - componentMiner.ComponentCreature.ComponentBody.Matrix.Up * 0.2f;
98 float num4 =
MathUtils.
Lerp(0f, 28f, MathF.Pow(draw / 15f, 0.75f));
100 num4 *= 0.5f * (componentMiner.ComponentPlayer.ComponentLevel.StrengthFactor - 1f) + 1f;
104 vector3 =
new Vector3(0.025f, 0.025f, 0.025f);
107 vector3 =
new Vector3(0.01f, 0.01f, 0.01f);
113 +
m_random.Float(0f - vector3.
Y, vector3.
Y) * v2
114 +
m_random.Float(0f - vector3.
Z, vector3.
Z) * vector2;
115 Vector3 velocity = componentMiner.ComponentCreature.ComponentBody.Velocity + (vector2 + v3) * num4;
143 else if (draw >= 4) {
174 out
int processedValue,
175 out
int processedCount) {
176 if (processCount == 1) {
185 processedValue = value;
186 processedCount = count;
196 base.Load(valuesDictionary);
static float Remainder(float x, float y)
static int Min(int x1, int x2)
static float Saturate(float x)
static float Lerp(float x1, float x2, float f)
static int SetArrowType(int data, ArrowType arrowType)
static ArrowType GetArrowType(int data)
static int GetBlockIndex(string BlockName, bool throwIfNotFound=false)
通过方块名称来获取方块的Index
static int SetDraw(int data, int draw)
static ArrowBlock.? ArrowType GetArrowType(int data)
static int SetArrowType(int data, ArrowBlock.ArrowType? arrowType)
static int GetDraw(int data)
virtual void ShowAimingSights(Vector3 position, Vector3 direction)
ComponentCreatureSounds ComponentCreatureSounds
virtual void PlayMoanSound()
virtual void DisplaySmallMessage(string text, Color color, bool blinking, bool playNotificationSound)
ComponentPlayer ComponentPlayer
ComponentCreature ComponentCreature
virtual void DamageActiveTool(int damageCount)
ComponentGui ComponentGui
ComponentAimingSights ComponentAimingSights
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
static float OctavedNoise(float x, float frequency, int octaves, float frequencyStep, float amplitudeStep, bool ridged=false)
override bool OnAim(Ray3 aim, ComponentMiner componentMiner, AimState state)
SubsystemTime m_subsystemTime
override int GetProcessInventoryItemCapacity(IInventory inventory, int slotIndex, int value)
Dictionary< ComponentMiner, double > m_aimStartTimes
override void ProcessInventoryItem(IInventory inventory, int slotIndex, int value, int count, int processCount, out int processedValue, out int processedCount)
override int[] HandledBlocks
override void Load(ValuesDictionary valuesDictionary)
override bool OnEditInventoryItem(IInventory inventory, int slotIndex, ComponentPlayer componentPlayer)
SubsystemProjectiles m_subsystemProjectiles
ArrowBlock.ArrowType[] m_supportedArrowTypes
SubsystemAudio m_subsystemAudio
static int ExtractContents(int value)
static int MakeBlockValue(int contents)
static int ExtractData(int value)
Component FindComponent(Type type, string name, bool throwOnError)
ValuesDictionary ValuesDictionary
int RemoveSlotItems(int slotIndex, int count)
实际移除的数量
int GetSlotCount(int slotIndex)
void AddSlotItems(int slotIndex, int value, int count)
int GetSlotValue(int slotIndex)
static Vector3 Cross(Vector3 v1, Vector3 v2)
static Vector3 Normalize(Vector3 v)
static readonly Vector3 Zero
static readonly Vector3 UnitY