Class LevelRulesDef

Namespace
TDMaker.Core.Defs
Assembly
TDMaker.Core.dll

Level-wide economy and M2 authoring data.

public sealed class LevelRulesDef
Inheritance
LevelRulesDef
Inherited Members

Constructors

LevelRulesDef(float, float, float?, bool, float, SpellDef[], IMovementPolicy, ILevelCompletionRule)

Creates level-wide behavior settings.

public LevelRulesDef(float leakBountyShare = 0, float refundShare = 0.6, float? earlyCallRewardRate = null, bool earlyCallSpellCooldownCut = true, float earlyCallCutThreshold = 0, SpellDef[] spells = null, IMovementPolicy movement = null, ILevelCompletionRule completion = null)

Parameters

leakBountyShare float
refundShare float
earlyCallRewardRate float?
earlyCallSpellCooldownCut bool
earlyCallCutThreshold float
spells SpellDef[]
movement IMovementPolicy
completion ILevelCompletionRule

Properties

Completion

Optional additional victory condition for authored level actions.

public ILevelCompletionRule Completion { get; }

Property Value

ILevelCompletionRule

EarlyCallCutThreshold

Time credit must strictly exceed this value.

public float EarlyCallCutThreshold { get; }

Property Value

float

EarlyCallRewardRate

Reward per rounded second; null preserves each legacy wave's reward rate.

public float? EarlyCallRewardRate { get; }

Property Value

float?

EarlyCallSpellCooldownCut

Applies early-call time credit to cooling, unlocked spells.

public bool EarlyCallSpellCooldownCut { get; }

Property Value

bool

LeakBountyShare

Share of enemy bounty paid on a leak; defaults to zero.

public float LeakBountyShare { get; }

Property Value

float

Movement

Optional walkable-waypoint provider; null uses direct friendly movement.

public IMovementPolicy Movement { get; }

Property Value

IMovementPolicy

RefundShare

Post-start sale share of all actual investment.

public float RefundShare { get; }

Property Value

float

Spells

Spell definitions resolved by AvailableSpells identifiers.

public IReadOnlyList<SpellDef> Spells { get; }

Property Value

IReadOnlyList<SpellDef>

VictoryRating

Victory rating bands. The product default grants two stars at half lives and three at full lives.

public VictoryRatingDef VictoryRating { get; }

Property Value

VictoryRatingDef

Methods

WithVictoryRating(VictoryRatingDef)

Copies all level rules and replaces only the victory-rating bands.

public LevelRulesDef WithVictoryRating(VictoryRatingDef rating)

Parameters

rating VictoryRatingDef

Returns

LevelRulesDef

Examples

var rules = new LevelRulesDef().WithVictoryRating(new VictoryRatingDef(0.6f, 0.9f));