Hi,
How could I override or extend the default behaviour of an entity ?
Let's take a BaseOven as an example:
I would like to write a custom cook() method so I can add additional functionality to it.
How can this be accomplished ?
How could I override or extend the default behaviour of an entity ?
Let's take a BaseOven as an example:
// BaseOven
// Token: 0x0600082D RID: 2093 RVA: 0x0002BC74 File Offset: 0x00029E74
public void Cook()
{
global::Item item = this.FindBurnable();
if (item == null)
{
this.StopCooking();
return;
}
base.inventory.OnCycle(0.5f);
global::BaseEntity slot = base.GetSlot(global::BaseEntity.Slot.FireMod);
if (slot)
{
slot.SendMessage("Cook", 0.5f, SendMessageOptions.DontRequireReceiver);
}
global::ItemModBurnable component = item.info.GetComponent<global::ItemModBurnable>();
item.fuel -= 0.5f * (this.cookingTemperature / 200f);
if (!item.HasFlag(global::Item.Flag.OnFire))
{
item.SetFlag(global::Item.Flag.OnFire, true);
item.MarkDirty();
}
if (item.fuel <= 0f)
{
this.ConsumeFuel(item, component);
}
}I would like to write a custom cook() method so I can add additional functionality to it.
How can this be accomplished ?