internal void OnEnter(CreatureInstance instance) { if(!(bool)this.RunOptionalScript(Scripts.OnEnter, this, Descriptor, instance, instance.Descriptor, MapCell,false)) { Descriptor.RunScript(Scripts.OnEnter, this, Descriptor, instance, instance.Descriptor, MapCell); } }
internal bool CanEnter(CreatureInstance instance) { //bool property trumps anything else if(GetBoolProperty(Scripts.CanEnter)??false) { return true; } //attempt to handle with instance script var result = (bool)this.RunOptionalScript(Scripts.CanEnter, this, Descriptor, instance, instance.Descriptor, MapCell, false); if (result) { return result; } return (bool)Descriptor.RunOptionalScript(Scripts.CanEnter, this, Descriptor, instance, instance.Descriptor, MapCell,false); }
internal void Pickup(CreatureInstance creatureInstance) { this.RunOptionalScript(Scripts.OnPickup, this, Descriptor, creatureInstance, creatureInstance.Descriptor, this.MapCell, false); }
internal bool CanPickup(CreatureInstance instance) { return (bool)this.RunOptionalScript(Scripts.CanPickup, this, Descriptor, instance, instance.Descriptor, this.MapCell, false); }
internal void OnEnter(CreatureInstance instance) { if(TerrainInstance!= null) { TerrainInstance.OnEnter(instance); } instance.OnEnter(this); }
public bool CanEnter(CreatureInstance instance) { //if there is already a creature here, then no if(CreatureInstance!= null) { return false; } //if there are items, then no if(PeekItem()!= null) { if (PeekItem().CanPickup(instance)) { return true; } else { return false; } } //if no terrain, then no if(TerrainInstance== null) { return false; } return TerrainInstance.CanEnter(instance) && instance.CanEnter(this); }