Appliance - KitchenMods/KitchenLib GitHub Wiki
An Appliance is an object you find inside the game world, most of the game world is built of Appliances ( With exceptions such as Doors. )
// Prefab is used to display the visuals of the Appliance in the game world.
public override GameObject Prefab => Main.bundle.LoadAsset<GameObject>("Apple");
// HeldAppliancePrefab is used to display the visuals of the Appliance when it's held by the player.
public override GameObject HeldAppliancePrefab => Main.bundle.LoadAsset<GameObject>("Apple");
// Processes is a list of Appliance Processes, which is used to decide what Processes this Appliance can apply to Items. ( Note : Appliance Processes, and Processes are different )
public override List<Appliance.ApplianceProcesses> Processes => new List<Appliance.ApplianceProcesses>
{
new Appliance.ApplianceProcesses
{
Process = (Process)GDOUtils.GetExistingGDO(ProcessReferences.Cook),
IsAutomatic = true,
Speed = 1.0f,
Validity = ProcessValidity.Generic
}
};
// Properties is a list of IApplianceProperty which is used to attach properties to the Appliance's entity.
public override List<IApplianceProperty> Properties => new List<IApplianceProperty>
{
new CItemHolder()
};
// EffectRange is used to decide the distance of the Appliance which should be affected.
public override IEffectRange EffectRange => new CEffectRangeGlobal();
// EffectCondition is used to decide if something should be affected by this Appliance.
public override IEffectCondition EffectCondition => new CEffectAlways();
// EffectType is used to decide what Effect this Appliance has.
public override IEffectType EffectType => new CAppliesStatus
{
Bonus = DecorationBonus.FewerSides
};
// EffectRepresentation is used to decide the visuals of the Effect.
public override EffectRepresentation EffectRepresentation => (EffectRepresentation)GDOUtils.GetExistingGDO(EffectRepresentationReferences.Plant);
// IsNonInteractive is used to decide if the Player can interact with this Appliance.
public override bool IsNonInteractive => false;
// Layer is used to decide where this Appliance can be placed.
public override OccupancyLayer Layer => OccupancyLayer.Default;
// ForceHighInteractionPriority is used to decide if this Appliance should have priority when interacting with a tile containing 2 or more Appliances.
public override bool ForceHighInteractionPriority => false;
// EntryAnimation is used to decide what Animation plays when this Appliance is placed down.
public override EntryAnimation EntryAnimation => EntryAnimation.Placement;
// ExitAnimation is used to decide what Animation plays when this Appliance is picked up or destroyed.
public override ExitAnimation ExitAnimation => ExitAnimation.Destroy;
// SkipRotationAnimation is used to decide if the rotate animation should skip.
public override bool SkipRotationAnimation => false;
// IsPurchasable is used to decide if this Appliance can appear in the shop.
public override bool IsPurchasable => true;
// *IsPurchasableAsUpgrade is used to decide if this Appliance can appear in the Blueprint Desk
public override bool IsPurchasableAsUpgrade => true;
// ThemeRequired is used to decide what Theme card needs to be chosen for this Appliance to appear in the shop.
public override DecorationType ThemeRequired => DecorationType.Affordable;
// ShoppingTags is used to decide when this Appliance should appear in the shop.
public override ShoppingTags ShoppingTags => ShoppingTags.Basic;
// RarityTier is used to decide the border colour of the Appliance's Blueprint.
public override RarityTier RarityTier => RarityTier.Common;
// PriceTier is used to decide the price of an Appliance.
public override PriceTier PriceTier => PriceTier.Medium;
// *ShopRequirementFilter is only used for Supply Cabinets.
public override ShopRequirementFilter ShopRequirementFilter => ShopRequirementFilter.None;
// RequiresForShop is used to decide what Appliances are required to be owned before THIS Appliance appears in the shop.
public override List<Appliance> RequiresForShop => new List<Appliance>
{
(Appliance)GDOUtils.GetExistingGDO(ApplianceReferences.Hob)
};
// RequiresProcessForShop is used to decide what Processes are required before this Appliance appears in the shop.
public override List<Process> RequiresProcessForShop => new List<Process>
{
(Process)GDOUtils.GetExistingGDO(ProcessReferences.Cook)
};
// StapleWhenMissing is used to force this Appliance into the shop if not already owned.
public override bool StapleWhenMissing => false;
// SellOnlyAsDuplicate is used to only allow this Appliance to appear in the shop if it's already owned.
public override bool SellOnlyAsDuplicate => false;
// *SellOnlyAsUnique is used to only allow this Appliance to appear in the shop is it's NOT already owned.
public override bool SellOnlyAsUnique => false;
// PreventSale is used to decide if this Appliance can be sold during preperation.
public override bool PreventSale => false;
// Upgrades is used to decide what this Appliance can upgrade to in the Blueprint Cabinet.
public override List<Appliance> Upgrades => new List<Appliance>
{
(Appliance)GDOUtils.GetExistingGDO(ApplianceReferences.Hob)
};
// InfoList is used to add localisation to the Appliance.
public override List<(Locale, ApplianceInfo)> InfoList => new List<(Locale, ApplianceInfo)>
{
(Locale.English, new ApplianceInfo
{
Name = "",
Description = "",
Sections = new List<Appliance.Section>
{
new Appliance.Section
{
Title = "Heated",
Description = "Customers enjoy the heat",
RangeDescription = "2 Tiles"
}
},
Tags = new List<string>
{
"Tag 1"
}
})
};
// UniqueNameID is used to generate the ID of the GDO. THIS MUST BE UNIQUE!
public override string UniqueNameID => "My Cool GDO";
// PurchaseCostOverride is used to override the cost set in PriceTier. ( Allows for custom pricing )
public override int PurchaseCostOverride => 50;