Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(participants): Allow teams in participants table #4022

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ function ParticipantTable:readEntry(sectionArgs, key, index, config)
note = valueFromArgs('note'),
}

assert(Opponent.isType(opponentArgs.type) and opponentArgs.type ~= Opponent.team,
'Missing or unsupported opponent type for "' .. sectionArgs[key] .. '"')
assert(Opponent.isType(opponentArgs.type), 'Invalid opponent type for "' .. sectionArgs[key] .. '"')

local opponent = Opponent.readOpponentArgs(opponentArgs) or {}

Expand All @@ -233,7 +232,7 @@ function ParticipantTable:readEntry(sectionArgs, key, index, config)
dq = Logic.readBool(opponentArgs.dq),
note = opponentArgs.note,
opponent = opponent,
name = Opponent.toName(opponent),
name = Logic.emptyOr(Opponent.toName(opponent), opponent.template),
inputIndex = index,
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ function StarcraftParticipantTable:readEntry(sectionArgs, key, index, config)
race = valueFromArgs('race'),
}

assert(Opponent.isType(opponentArgs.type) and opponentArgs.type ~= Opponent.team,
'Missing or unsupported opponent type for "' .. sectionArgs[key] .. '"')

--unset wiki var for random events to not read players as random if prize pool already sets them as random
if config.isRandomEvent and opponentArgs.type == Opponent.solo then
Variables.varDefine(opponentArgs.name .. '_race', '')
Expand All @@ -142,7 +139,7 @@ function StarcraftParticipantTable:readEntry(sectionArgs, key, index, config)
dq = Logic.readBool(opponentArgs.dq),
note = opponentArgs.note,
opponent = opponent,
name = Opponent.toName(opponent),
name = Logic.emptyOr(Opponent.toName(opponent), opponent.template),
isQualified = Logic.nilOr(Logic.readBoolOrNil(sectionArgs[key .. 'qualified']), config.isQualified),
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ function StormgateParticipantTable:readEntry(sectionArgs, key, index, config)
faction = valueFromArgs('faction'),
}

assert(Opponent.isType(opponentArgs.type) and opponentArgs.type ~= Opponent.team,
'Missing or unsupported opponent type for "' .. sectionArgs[key] .. '"')

local opponent = Opponent.readOpponentArgs(opponentArgs) or {}

if config.sortPlayers and opponent.players then
Expand All @@ -136,7 +133,7 @@ function StormgateParticipantTable:readEntry(sectionArgs, key, index, config)
dq = Logic.readBool(opponentArgs.dq),
note = opponentArgs.note,
opponent = opponent,
name = Opponent.toName(opponent),
name = Logic.emptyOr(Opponent.toName(opponent), opponent.template),
isQualified = Logic.nilOr(Logic.readBoolOrNil(sectionArgs[key .. 'qualified']), config.isQualified),
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ function CustomParticipantTable:readEntry(sectionArgs, key, index, config)
race = valueFromArgs('race'),
}

assert(Opponent.isType(opponentArgs.type) and opponentArgs.type ~= Opponent.team,
'Missing or unsupported opponent type for "' .. sectionArgs[key] .. '"')

local opponent = Opponent.readOpponentArgs(opponentArgs) or {}

if config.sortPlayers and opponent.players then
Expand All @@ -123,7 +120,7 @@ function CustomParticipantTable:readEntry(sectionArgs, key, index, config)
dq = Logic.readBool(opponentArgs.dq),
note = opponentArgs.note,
opponent = opponent,
name = Opponent.toName(opponent),
name = Logic.emptyOr(Opponent.toName(opponent), opponent.template),
}
end

Expand Down
Loading