17 public static string fName =
"SubsystemMusketBlockBehavior";
28 componentPlayer.ComponentGui.ModalPanelWidget = componentPlayer.ComponentGui.ModalPanelWidget ==
null
36 if (inventory !=
null) {
38 if (activeSlotIndex >= 0) {
54 ((componentMiner.ComponentCreature.ComponentBody.IsCrouching ? 0.01f : 0.03f)
75 if (componentFirstPersonModel !=
null) {
77 componentFirstPersonModel.ItemOffsetOrder =
new Vector3(-0.21f, 0.15f, 0.08f);
78 componentFirstPersonModel.ItemRotationOrder =
new Vector3(-0.7f, 0f, 0f);
80 componentMiner.ComponentCreature.ComponentCreatureModel.AimHandAngleOrder = 1.4f;
81 componentMiner.ComponentCreature.ComponentCreatureModel.InHandItemOffsetOrder =
new Vector3(-0.08f, -0.08f, 0.07f);
82 componentMiner.ComponentCreature.ComponentCreatureModel.InHandItemRotationOrder =
new Vector3(-1.7f, 0f, 0f);
128 vector =
new Vector3(0.04f, 0.04f, 0.25f);
138 vector =
new Vector3(0.06f, 0.06f, 0f);
141 else if (bulletType.HasValue) {
156 "Audio/MusketMisfire",
165 Vector3 vector2 = componentMiner.ComponentCreature.ComponentCreatureModel.EyePosition
166 + componentMiner.ComponentCreature.ComponentBody.Matrix.Right * 0.3f
167 - componentMiner.ComponentCreature.ComponentBody.Matrix.Up * 0.2f;
171 for (
int i = 0; i < num6; i++) {
173 +
m_random.Float(0f - vector.
Y, vector.
Y) * v2
174 +
m_random.Float(0f - vector.
Z, vector.
Z) * vector3;
175 Vector3 velocity = componentMiner.ComponentCreature.ComponentBody.Velocity + s * (vector3 + v3);
183 if (projectile !=
null) {
221 if (num2 != slotValue) {
256 out
int processedValue,
257 out
int processedCount) {
258 processedValue = value;
259 processedCount = count;
260 if (processCount == 1) {
300 base.Load(valuesDictionary);
static float Remainder(float x, float y)
static float Saturate(float x)
static int GetBlockIndex(string BlockName, bool throwIfNotFound=false)
通过方块名称来获取方块的Index
static BulletType GetBulletType(int data)
static int SetBulletType(int data, BulletType bulletType)
virtual void ShowAimingSights(Vector3 position, Vector3 direction)
virtual float ImmersionFactor
virtual void ApplyImpulse(Vector3 impulse)
ComponentBody ComponentBody
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 string Get(string className, int key)
获取在当前语言类名键对应的字符串
static int SetLoadState(int data, LoadState loadState)
static LoadState GetLoadState(int data)
static BulletBlock.? BulletType GetBulletType(int data)
static int SetHammerState(int data, bool state)
static int SetBulletType(int data, BulletBlock.BulletType? bulletType)
static bool GetHammerState(int data)
static float OctavedNoise(float x, float frequency, int octaves, float frequencyStep, float amplitudeStep, bool ridged=false)
SubsystemTerrain SubsystemTerrain
override void Load(ValuesDictionary valuesDictionary)
override bool OnEditInventoryItem(IInventory inventory, int slotIndex, ComponentPlayer componentPlayer)
Dictionary< ComponentMiner, double > m_aimStartTimes
SubsystemAudio m_subsystemAudio
SubsystemTerrain m_subsystemTerrain
override int[] HandledBlocks
override int GetProcessInventoryItemCapacity(IInventory inventory, int slotIndex, int value)
SubsystemProjectiles m_subsystemProjectiles
SubsystemParticles m_subsystemParticles
override bool OnAim(Ray3 aim, ComponentMiner componentMiner, AimState state)
SubsystemNoise m_subsystemNoise
override void ProcessInventoryItem(IInventory inventory, int slotIndex, int value, int count, int processCount, out int processedValue, out int processedCount)
SubsystemTime m_subsystemTime
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