using NewHorizons.External.Modules.Volumes.VolumeInfos;
using NewHorizons.External.SerializableData;
using NewHorizons.External.SerializableEnums;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.ComponentModel;
using System.Runtime.Serialization;
namespace NewHorizons.External.Modules.Props
{
[JsonObject]
public class TornadoInfo : GeneralPropInfo
{
[JsonConverter(typeof(StringEnumConverter))]
public enum TornadoType
{
[EnumMember(Value = @"upwards")] Upwards = 0,
[EnumMember(Value = @"downwards")] Downwards = 1,
[EnumMember(Value = @"hurricane")] Hurricane = 2
}
[Obsolete("Downwards is deprecated. Use Type instead.")] public bool downwards;
///
/// Alternative to setting the position. Will choose a random place at this elevation.
///
public float elevation;
///
/// The height of this tornado.
///
[DefaultValue(30f)] public float height = 30f;
///
/// The colour of the tornado.
///
public MColor tint;
///
/// What type of cyclone should this be? Upwards and downwards are both tornados and will push in that direction.
///
[DefaultValue("upwards")] public TornadoType type = TornadoType.Upwards;
///
/// Angular distance from the starting position that it will wander, in terms of the angle around the x-axis.
///
[DefaultValue(45f)] public float wanderDegreesX = 45f;
///
/// Angular distance from the starting position that it will wander, in terms of the angle around the z-axis.
///
[DefaultValue(45f)] public float wanderDegreesZ = 45f;
///
/// The rate at which the tornado will wander around the planet. Set to 0 for it to be stationary. Should be around
/// 0.1.
///
public float wanderRate;
///
/// The maximum distance at which you'll hear the sounds of the cyclone. If not set it will scale relative to the size of the cyclone.
///
public float audioDistance;
///
/// Fluid type for sounds/effects when colliding with this tornado.
///
[DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.CLOUD;
///
/// The type of hazard for this volume. Leave empty for this tornado to not be hazardous.
///
public HazardVolumeInfo.HazardType? hazardType;
///
/// The amount of damage you will take per second while inside this tornado. Only used it hazardType is set.
///
[DefaultValue(10f)] public float damagePerSecond = 10f;
///
/// The type of damage you will take when you first touch this volume. Leave empty for this tornado to not cause damage on first contact.
///
public HazardVolumeInfo.InstantDamageType? firstContactDamageType;
///
/// The amount of damage you will take when you first touch this volume. Only relevant if firstContactDamageType is set.
///
[DefaultValue(10f)] public float firstContactDamage = 10f;
}
}