13 public static string fName =
"SubsystemCrossbowBlockBehavior";
27 componentPlayer.ComponentGui.ModalPanelWidget = componentPlayer.ComponentGui.ModalPanelWidget ==
null
35 if (inventory !=
null) {
37 if (activeSlotIndex >= 0) {
51 ((componentMiner.ComponentCreature.ComponentBody.IsCrouching ? 0.01f : 0.03f)
67 if (componentFirstPersonModel !=
null) {
69 componentFirstPersonModel.ItemOffsetOrder =
new Vector3(-0.22f, 0.15f, 0.1f);
70 componentFirstPersonModel.ItemRotationOrder =
new Vector3(-0.7f, 0f, 0f);
72 componentMiner.ComponentCreature.ComponentCreatureModel.AimHandAngleOrder = 1.3f;
73 componentMiner.ComponentCreature.ComponentCreatureModel.InHandItemOffsetOrder =
new Vector3(-0.08f, -0.1f, 0.07f);
74 componentMiner.ComponentCreature.ComponentCreatureModel.InHandItemRotationOrder =
new Vector3(-1.55f, 0f, 0f);
88 else if (!arrowType.HasValue) {
97 Vector3 vector = componentMiner.ComponentCreature.ComponentCreatureModel.EyePosition
98 + componentMiner.ComponentCreature.ComponentBody.Matrix.Right * 0.3f
99 - componentMiner.ComponentCreature.ComponentBody.Matrix.Up * 0.2f;
103 Vector3 velocity = componentMiner.ComponentCreature.ComponentBody.Velocity + s * v2;
129 "Audio/CrossbowBoing",
155 if (!arrowType2.HasValue
168 out
int processedValue,
169 out
int processedCount) {
170 if (processCount == 1) {
179 processedValue = value;
180 processedCount = count;
190 base.Load(valuesDictionary);
static float Remainder(float x, float y)
static float Saturate(float x)
static int SetArrowType(int data, ArrowType arrowType)
static ArrowType GetArrowType(int data)
static int GetBlockIndex(string BlockName, bool throwIfNotFound=false)
通过方块名称来获取方块的Index
virtual void ShowAimingSights(Vector3 position, Vector3 direction)
ComponentCreatureModel ComponentCreatureModel
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 ArrowBlock.? ArrowType GetArrowType(int data)
static int GetDraw(int data)
static int SetArrowType(int data, ArrowBlock.ArrowType? arrowType)
static int SetDraw(int data, int draw)
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
static float OctavedNoise(float x, float frequency, int octaves, float frequencyStep, float amplitudeStep, bool ridged=false)
override int GetProcessInventoryItemCapacity(IInventory inventory, int slotIndex, int value)
override void Load(ValuesDictionary valuesDictionary)
ArrowBlock.ArrowType[] m_supportedArrowTypes
override int[] HandledBlocks
override bool OnEditInventoryItem(IInventory inventory, int slotIndex, ComponentPlayer componentPlayer)
override bool OnAim(Ray3 aim, ComponentMiner componentMiner, AimState state)
SubsystemTime m_subsystemTime
override void ProcessInventoryItem(IInventory inventory, int slotIndex, int value, int count, int processCount, out int processedValue, out int processedCount)
SubsystemProjectiles m_subsystemProjectiles
Dictionary< ComponentMiner, double > m_aimStartTimes
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 Normalize(Vector3 v)
static readonly Vector3 Zero