示例#1
0
 public static async void CloseDoors(this AreaEvents.OnExit obj)
 {
     foreach (var door in obj.Area.FindObjectsOfTypeInArea <NwDoor>().Where(d => d.IsOpen))
     {
         await door.Close();
     }
 }
示例#2
0
 public static void CleanupPlaceables(this AreaEvents.OnExit obj)
 {
     foreach (var item in obj.Area.FindObjectsOfTypeInArea <NwPlaceable>().Where(i => i.HasInventory))
     {
         while (item.Inventory.Items.Any())
         {
             item.Destroy();
         }
     }
 }
示例#3
0
 public static void CleanupCreatures(this AreaEvents.OnExit obj)
 {
     foreach (NwGameObject trash in obj.Area.Objects.Where(t => t is NwCreature))
     {
         if (trash is NwCreature creature)
         {
             foreach (NwItem item in creature.Inventory.Items)
             {
                 item.Destroy();
             }
         }
         trash.Destroy();
     }
 }