private void Awake() { itemAttributes = GetComponent <ItemAttributesV2>(); stackable = GetComponent <Stackable>(); if (itemAttributes) { itemAttributes.AddTrait(CommonTraits.Instance.Food); } else { Logger.LogErrorFormat("{0} prefab is missing ItemAttributes", Category.ItemSpawn, name); } }
public void ServerPerformInteraction(HandActivate interaction) { itemAttributeComponent.RemoveTrait(toolTraits[toolSetting]); // look over to ItemAttributeV2 and REMOVE the trait specified by the current toolSetting from this component // cycle though the list, keeping in check the size of said list toolSetting++; if (toolSetting >= toolTraits.Count) { toolSetting = 0; } Chat.AddExamineMsgFromServer(interaction.Performer, $"You flick the {gameObject.name} into {toolTraits[toolSetting].name} mode"); itemAttributeComponent.AddTrait(toolTraits[toolSetting]); // look over to ItemAttributeV2 and ADD the trait specified by the current toolSetting from this component }
private void Awake() { FoodContents = GetComponent <ReagentContainer>(); item = GetComponent <RegisterItem>(); itemAttributes = GetComponent <ItemAttributesV2>(); stackable = GetComponent <Stackable>(); if (itemAttributes != null) { itemAttributes.AddTrait(CommonTraits.Instance.Food); } else { Logger.LogErrorFormat("{0} prefab is missing ItemAttributes", Category.Objects, name); } }
private void Awake() { FoodContents = GetComponent <ReagentContainer>(); item = GetComponent <RegisterItem>(); itemAttributes = GetComponent <ItemAttributesV2>(); stackable = GetComponent <Stackable>(); FoodContents.Add(new ReagentMix(Nutriment, StartingNutrients, TemperatureUtils.ToKelvin(20f, TemeratureUnits.C))); if (itemAttributes != null) { itemAttributes.AddTrait(CommonTraits.Instance.Food); } else { Logger.LogErrorFormat("{0} prefab is missing ItemAttributes", Category.Objects, name); } }
private void ToggleBoots() { if (player == null) { return; } if (isOn) { itemAttributesV2.AddTrait(CommonTraits.Instance.NoSlip); ServerChangeSpeed(newSpeed); } else { itemAttributesV2.RemoveTrait(CommonTraits.Instance.NoSlip); ServerChangeSpeed(initialSpeed); } //if the ghost NRE will be thrown player.Script.pushPull.ServerSetPushable(!isOn); }
private void ApplyEffect() { itemAttributesV2.AddTrait(CommonTraits.Instance.NoSlip); playerMove.ServerChangeSpeed(playerMove.RunSpeed - runSpeedDebuff, playerMove.WalkSpeed); playerMove.PlayerScript.pushPull.ServerSetPushable(false); }
private void Awake() { itemAttributeComponent = GetComponent <ItemAttributesV2>(); itemAttributeComponent.AddTrait(toolTraits[toolSetting]); // send over the first entry in the component's list to the ItemAttributeV2 }
private void ApplyEffect() { itemAttributesV2.AddTrait(CommonTraits.Instance.NoSlip); playerMove.AddModifier(this); playerMove.PlayerScript.pushPull.ServerSetPushable(false); }