Class BombDamage
Namespace: ValveResourceFormat.ResourceTypes.GenericData.CS2
Assembly: ValveResourceFormat.dll
CS2 baked bomb damage data.
public sealed class BombDamage : GenericDataInheritance
object ← Block ← BinaryKV3 ← GenericData ← BombDamage
Inherited Members
GenericData.GenericDataType, GenericData.GetGenericDataType(BinaryKV3), GenericData.Construct(BinaryKV3), BinaryKV3.Type, BinaryKV3.MAGIC0, BinaryKV3.MAGIC1, BinaryKV3.MAGIC2, BinaryKV3.MAGIC3, BinaryKV3.MAGIC4, BinaryKV3.MAGIC5, BinaryKV3.IsBinaryKV3(uint), BinaryKV3.Data, BinaryKV3.Read(BinaryReader), BinaryKV3.WriteText(IndentedTextWriter), BinaryKV3.ConvertBinaryKV3ToText(nint, int), BinaryKV3.Serialize(Stream), Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Constructors
BombDamage(BinaryKV3)
Wraps an already-read DATA block and parses the bomb damage payload from it.
[SetsRequiredMembers]
public BombDamage(BinaryKV3 kv3)Parameters
kv3 BinaryKV3
The KV3 DATA block that has already been read.
Fields
DataType
The generic_data_type value identifying a baked bomb damage resource.
public const string DataType = "CS2_BOMB_DAMAGE_DATA"Field Value
Properties
Bombsites
Stores information about each bombsite on the map, such as AABB and bomb power.
public BombDamageBombsite[] Bombsites { get; }Property Value
DamageValues
Contains baked damage information, such as yaw, angle, and phase. The length of this array should be equal to the number of positions multiplied by the number of bombsites. To retrieve the damage information for a given position and bombsite, use .
public BombDamageDamageValue[] DamageValues { get; }Property Value
Positions
Contains points on the map that have associated baked damage information.
public Vector3[] Positions { get; }Property Value
Vector3[]
Version
Version of the baked bomb damage data format.
public int Version { get; }Property Value
Methods
CalculateDamage(in BombDamageBombsite, in BombDamageDamageValue)
Calculates the damage dealt by the bomb for a given damage value, replicating the game's formula. This is approximately 100 * BombPower / Phase when is at most 1800.
public static float CalculateDamage(in BombDamageBombsite bombsite, in BombDamageDamageValue damageValue)Parameters
bombsite BombDamageBombsite
The bombsite the bomb is planted at.
damageValue BombDamageDamageValue
The baked damage value for a position, see .
Returns
Damage in the range [0, 255].
GetBombsiteDamageValue(int, int)
Returns the damage information for a given position and bombsite.
public BombDamageDamageValue GetBombsiteDamageValue(int positionIndex, int bombsiteIndex)Parameters
positionIndex int
Position index to retrieve damage information for.
bombsiteIndex int
Bombsite index to retrieve damage information for. Index 0 is not guaranteed to be bombsite A.
Returns
Exceptions
Thrown if positionIndex or bombsiteIndex are out of range (see and ).

