Table of Contents

Class DungeonDifficultyDefinition

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

One difficulty a dungeon can be run at: what it takes to get in, what it does to the dungeon, and what it pays for the trouble.

[Serializable]
public class DungeonDifficultyDefinition
Inheritance
DungeonDifficultyDefinition
Inherited Members

Remarks

A plain serializable class rather than an enum, because dungeons do not agree on how many difficulties they have or what those difficulties mean. A short introductory dungeon may offer only one; a raid may offer five, with the top one banning resurrection outright. Every dungeon declares its own list in Difficulties and an instance records the index it was opened at, so the name and the rules are always read back from the same dungeon that defined them.

Every difficulty is a trade. The fields are deliberately grouped into requirements, detriments and benefits, and BuildRulesSummary() renders all three into the text the dungeon finder shows — from these values, not from a hand-written blurb that can drift away from them. An author who makes a difficulty harder without paying for it will see exactly that in the panel.

Fields

AllowResurrection

Whether characters may be resurrected inside the instance.

[Tooltip("Whether characters may be resurrected inside the instance.")]
public bool AllowResurrection

Field Value

bool

CurrencyMultiplier

Multiplier applied to the currency corpses inside drop.

[Tooltip("Multiplier applied to the currency corpses drop inside the instance.")]
[Min(0.01)]
public float CurrencyMultiplier

Field Value

float

Description

Optional flavour text shown above the generated rules summary.

[Tooltip("Optional flavour text. The rules list underneath is generated from the values below.")]
[TextArea(2, 4)]
public string Description

Field Value

string

Remarks

Flavour only. The rules the player is actually agreeing to are generated from the fields below, so a note left stale by a later balance change cannot misrepresent them.

EnemyAttributeScalars

Named NPC attributes to scale inside the instance, and by how much.

[Tooltip("NPC attributes to scale inside the instance, e.g. an attack power attribute.")]
public List<DungeonAttributeScalar> EnemyAttributeScalars

Field Value

List<DungeonAttributeScalar>

Remarks

Deliberately a list of named templates rather than a fixed "enemy damage" figure. There is no built-in notion of which attribute represents damage — that is a decision each build makes when it authors its attribute templates — so a fixed field would have had to guess at one, and would have been wrong for any build that split damage across several attributes or called it something else.

Naming them also makes the rules summary say what actually changes: "Attack Power +40%" rather than a generic figure the player has to take on trust.

EnemyResourceMultiplier

Multiplier applied to every resource attribute of NPCs spawned inside — health, and whatever else a build treats as a resource.

[Header("Detriments")]
[Tooltip("Multiplier applied to NPC health and other resource attributes inside the instance.")]
[Min(0.01)]
public float EnemyResourceMultiplier

Field Value

float

Remarks

The tankiness lever, and separate from EnemyAttributeScalars because resource attributes are the one group the code can identify on its own. Everything else has to be named.

LifetimeMinutes

Lifetime of an instance at this difficulty in minutes, or 0 for the server default.

[Tooltip("Instance lifetime in minutes. 0 uses the server's MaxInstanceLifetimeMinutes.")]
[Min(0)]
public int LifetimeMinutes

Field Value

int

LivesPerCharacter

Deaths a character may suffer inside before being removed from the instance. 0 is unlimited.

[Tooltip("Deaths allowed per character before removal from the instance. 0 is unlimited.")]
[Min(0)]
public int LivesPerCharacter

Field Value

int

Remarks

1 is the "one death" rule: the first death ends that character's run and returns them to the open world. It removes only the character who died — the instance and everybody else in it carry on, because ending a group's run over one member's mistake is a harsher rule than any dungeon here is trying to express.

LootQuantityMultiplier

Multiplier applied to how many item stacks a corpse inside drops.

[Header("Benefits")]
[Tooltip("Multiplier applied to the number of item stacks corpses drop inside the instance.")]
[Min(0.01)]
public float LootQuantityMultiplier

Field Value

float

MaximumPlayers

Capacity of an instance at this difficulty, or 0 to use the scene's own MaxClients.

[Tooltip("Instance capacity at this difficulty. 0 uses the scene's own MaxClients.")]
[Min(0)]
public int MaximumPlayers

Field Value

int

MinimumPartySize

Smallest party permitted, counting the character entering. 1 allows a solo run.

[Header("Requirements")]
[Tooltip("Smallest party permitted, counting the entering character. 1 allows solo.")]
[Min(1)]
public int MinimumPartySize

Field Value

int

Remarks

Checked against the party roster rather than against who is currently inside, so a dungeon that requires a group cannot be entered by the one member who arrives first and then abandoned to a solo player.

Name

Display name of this difficulty, e.g. "Normal" or "Hardcore".

[Tooltip("Display name shown on the difficulty tab, e.g. Normal or Hardcore.")]
public string Name

Field Value

string

Methods

BuildRulesSummary()

Renders this difficulty's requirements, detriments and benefits as display lines.

public string BuildRulesSummary()

Returns

string

One line per rule, newline separated. Empty when nothing differs from default.

Remarks

Generated rather than authored so the panel can never describe a ruleset the server is not enforcing. Lines that say nothing — a multiplier of exactly 1, a requirement of 0 — are omitted, so a difficulty that changes little produces a short list rather than a wall of "no change".

ResolveCapacity(int)

Capacity of an instance at this difficulty, resolved against the scene's own limit.

public int ResolveCapacity(int sceneMaxClients)

Parameters

sceneMaxClients int

The scene's declared MaxClients.

Returns

int

The capacity to enforce, never below 1.