/// <summary>
        /// Runs the script event with the given input.
        /// </summary>
        /// <param name="prio">The priority to run with.</param>
        /// <param name="oevt">The details of the script to be ran.</param>
        /// <returns>The event details after firing.</returns>
        public void Run(int prio, VehicleDamagedEventArgs oevt)
        {
            VehicleDamagedScriptEvent evt = (VehicleDamagedScriptEvent)Duplicate();

            evt.Cancelled = oevt.Cancelled;
            evt.Vehicle   = oevt.Vehicle;
            evt.Amount    = oevt.Amount;
            evt.Call(prio);
            oevt.Amount    = evt.Amount;
            oevt.Cancelled = evt.Cancelled;
        }
 public static bool VehicleDamaged(InteractableVehicle vehicle, ref ushort amount, ref bool repairable)
 {
     // TODO: causes?
     VehicleTag vehicleTag = new VehicleTag(vehicle);
     if (!repairable && (vehicle.isDead || amount >= vehicle.health))
     {
         VehicleDestroyedEventArgs explodeevt = new VehicleDestroyedEventArgs();
         explodeevt.Vehicle = vehicleTag;
         explodeevt.Amount = new NumberTag(amount);
         explodeevt.Repairable = new BooleanTag(repairable);
         UnturnedFreneticEvents.OnVehicleDestroyed.Fire(explodeevt);
         amount = (ushort)explodeevt.Amount.Internal;
         repairable = explodeevt.Repairable.Internal;
         return explodeevt.Cancelled || EntityDestroyed(vehicleTag, ref amount);
     }
     VehicleDamagedEventArgs evt = new VehicleDamagedEventArgs();
     evt.Vehicle = vehicleTag;
     evt.Amount = new NumberTag(amount);
     evt.Repairable = new BooleanTag(repairable);
     UnturnedFreneticEvents.OnVehicleDamaged.Fire(evt);
     amount = (ushort)evt.Amount.Internal;
     return evt.Cancelled || EntityDamaged(vehicleTag, ref amount);
 }
 /// <summary>
 /// Runs the script event with the given input.
 /// </summary>
 /// <param name="prio">The priority to run with.</param>
 /// <param name="oevt">The details of the script to be ran.</param>
 /// <returns>The event details after firing.</returns>
 public void Run(int prio, VehicleDamagedEventArgs oevt)
 {
     VehicleDamagedScriptEvent evt = (VehicleDamagedScriptEvent)Duplicate();
     evt.Cancelled = oevt.Cancelled;
     evt.Vehicle = oevt.Vehicle;
     evt.Amount = oevt.Amount;
     evt.Call(prio);
     oevt.Amount = evt.Amount;
     oevt.Cancelled = evt.Cancelled;
 }