Class Arena
java.lang.Object
Arena
Arena of battling fighters (as gladiators).
- Since:
- 2014-05-20
-
Field Summary
Modifier and TypeFieldDescription(package private) Armor.Type
Base armor type for fighters.(package private) final Armor.Type
(package private) final int
(package private) final int
(package private) final int
(package private) final int
(package private) final int
(package private) boolean
Flag to escape after parsing arguments.(package private) Party
List of fighters for the arena.(package private) int
Fighter party size.(package private) boolean
Fight man vs.(package private) int
Fights held per simulated year.(package private) boolean
Create win percent matrix?(package private) int
Desired size of the fighter list.(package private) int
Number of years to run simulation.(package private) boolean
Report each individual XP award?(package private) boolean
Report every encounter?(package private) boolean
Report full details on each fighter?(package private) boolean
Report summary statistics?(package private) boolean
Report kills achieved by each monster type?(package private) boolean
Report total kills by monster level?(package private) boolean
Report XP award ratios?(package private) boolean
Report status at each year-end?(package private) int
Starting level for new recruits.(package private) int
Age of oldest fighter who ever lived.(package private) long
Total awarded monster XP.(package private) long
Total awarded treasure XP.(package private) Alignment
Typical alignment for generated men.(package private) boolean
Treasure award by monster type?(package private) boolean
XP awards use revised table from Sup-I? -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
addToKillTally
(Monster monster) Add to the kill tally for winning monster type.(package private) void
Award XP and magic to one creature/character.(package private) StatBin[]
Compile fighters into statistical bins by level.(package private) Party
createFighterParty
(Monster fighter, int numFighters) Create a party for a given fighter of same level.(package private) Party
createMonsterParty
(int dungeonLevel, int numFighters) Create a monster party to confront a number of fighters.(package private) void
Fight duels for all fighters in list.(package private) void
Duel each pair of fighters.(package private) void
Duel each fighter against random monsters.(package private) int
getMonsterNumber
(Monster monster, int dungeonLevel, int numFighters) Get number of monsters for encounter (a la Vol-3, p.(package private) Character
Find oldest fighter the list.(package private) int
Get integer following equals sign in command parameter.private Alignment
Get random alignment for one man.getTopFighters
(int number) Get the top fighters in list.(package private) void
grantFightAwards
(Party party1, Party party2, int level) Grant post-fight awards.(package private) void
grantVictorAwards
(Party victor, Party loser, int level) Grant awards from fight to victorious party.static void
Main application method.(package private) Character
newFighter
(int level) Create a new fighter of the indicated level.void
Parse arguments.(package private) int
partyFallenXPValue
(Party party) XP award value for given fallen party.(package private) void
Print program banner.void
Print usage.(package private) void
Fill out the fighter list.void
Print simulation ending info.(package private) void
Print every individual fighter (for testing small groups).void
Generate and print statistics for the fighter list.(package private) void
Prints number killed by each monster type.(package private) void
reportMonsterKillsAtLevel
(int level) Prints number killed by each monster at given level.void
Print simulation starting info.(package private) void
Prints total kills at each monster level.(package private) void
Report XP award ratios.(package private) void
reportYearEnd
(int year) Report year-end summary.void
Run one cycle of fights for the whole list.void
runSim()
Run the arena's top-level algorithm.void
setBaseArmor
(Armor.Type type) Set the base armor type.(package private) void
setBaseArmorFromInt
(int code) Set base armor type from integer code.void
setFightCycles
(int num) Set total number of fight cycles.void
setPctMagicPerLevel
(int percent) Set change of magic per level.(package private) void
Set reporting for param char code.void
setTypicalAlignment
(Alignment align) Set typical alignment.(package private) int
treasureValue
(Party party, int level) Value of treasure award (nominally in gold pieces).(package private) int
treasureValueByDungeon
(Party party, int level) Get treasure value as per level beneath surface.(package private) int
treasureValueByMonster
(Party party) Get treasure value as per monster treasure type.(package private) void
yearEnd
(int year) End the year.
-
Field Details
-
DEFAULT_NUM_YEARS
final int DEFAULT_NUM_YEARS- See Also:
-
DEFAULT_FIGHTS_PER_YEAR
final int DEFAULT_FIGHTS_PER_YEAR- See Also:
-
DEFAULT_NUM_FIGHTERS
final int DEFAULT_NUM_FIGHTERS- See Also:
-
DEFAULT_PARTY_SIZE
final int DEFAULT_PARTY_SIZE- See Also:
-
DEFAULT_PCT_MAGIC_PER_LEVEL
final int DEFAULT_PCT_MAGIC_PER_LEVEL- See Also:
-
DEFAULT_ARMOR
-
fighterList
Party fighterListList of fighters for the arena. -
numYears
int numYearsNumber of years to run simulation. -
fightsPerYear
int fightsPerYearFights held per simulated year. -
numFighters
int numFightersDesired size of the fighter list. -
startLevel
int startLevelStarting level for new recruits. -
fighterPartySize
int fighterPartySizeFighter party size. -
fightManVsMonster
boolean fightManVsMonsterFight man vs. monster? -
useMonsterTreasureType
boolean useMonsterTreasureTypeTreasure award by monster type? -
useRevisedXPAwards
boolean useRevisedXPAwardsXP awards use revised table from Sup-I? -
reportFighterStats
boolean reportFighterStatsReport summary statistics? -
reportFighterData
boolean reportFighterDataReport full details on each fighter? -
reportMonsterKills
boolean reportMonsterKillsReport kills achieved by each monster type? -
reportTotalMonsterKills
boolean reportTotalMonsterKillsReport total kills by monster level? -
reportYearEnd
boolean reportYearEndReport status at each year-end? -
reportXPAwards
boolean reportXPAwardsReport XP award ratios? -
reportAllXPAwards
boolean reportAllXPAwardsReport each individual XP award? -
reportEveryEncounter
boolean reportEveryEncounterReport every encounter? -
makeWinPercentMatrix
boolean makeWinPercentMatrixCreate win percent matrix? -
baseArmorType
Armor.Type baseArmorTypeBase armor type for fighters. -
supMaxAge
int supMaxAgeAge of oldest fighter who ever lived. -
exitAfterArgs
boolean exitAfterArgsFlag to escape after parsing arguments. -
totalMonsterXP
long totalMonsterXPTotal awarded monster XP. -
totalTreasureXP
long totalTreasureXPTotal awarded treasure XP. -
typicalAlignment
Alignment typicalAlignmentTypical alignment for generated men.
-
-
Constructor Details
-
Arena
public Arena()Constructor. -
Arena
public Arena(int numFighters, boolean manVsMon, boolean monTreas) Constructor (set size, sim modes).
-
-
Method Details
-
printBanner
void printBanner()Print program banner. -
printUsage
public void printUsage()Print usage. -
parseArgs
Parse arguments. -
getParamInt
Get integer following equals sign in command parameter. -
setBaseArmorFromInt
void setBaseArmorFromInt(int code) Set base armor type from integer code. -
setReportingFromParamCode
Set reporting for param char code. -
runSim
public void runSim()Run the arena's top-level algorithm. -
runOneCycle
public void runOneCycle()Run one cycle of fights for the whole list. -
recruitNewFighters
void recruitNewFighters()Fill out the fighter list. -
newFighter
Create a new fighter of the indicated level. -
fightDuels
void fightDuels()Fight duels for all fighters in list. -
fightDuelsManVsMan
void fightDuelsManVsMan()Duel each pair of fighters. -
fightDuelsManVsMonster
void fightDuelsManVsMonster()Duel each fighter against random monsters. -
createFighterParty
Create a party for a given fighter of same level. -
createMonsterParty
Create a monster party to confront a number of fighters. -
getMonsterNumber
Get number of monsters for encounter (a la Vol-3, p. 11). In tabletop practice, we would like to assume a party size of 4, and roll 1d6 * dungeonLevel / monsterEHD (round to closest, possibly 0). Note E(1d6) ~ expected nominal party size of 4. Extra calculations here are to scale for different party sizes. -
grantFightAwards
Grant post-fight awards. -
grantVictorAwards
Grant awards from fight to victorious party. -
partyFallenXPValue
XP award value for given fallen party. Conditional on Vol-1 or Sup-I method. -
treasureValue
Value of treasure award (nominally in gold pieces). Conditional on using monster treasure type. -
treasureValueByMonster
Get treasure value as per monster treasure type. (Recommended for wilderness encounters only.) -
treasureValueByDungeon
Get treasure value as per level beneath surface. (Officially valid for underworld only.) -
awardXP
Award XP and magic to one creature/character. -
addToKillTally
Add to the kill tally for winning monster type. -
yearEnd
void yearEnd(int year) End the year. -
reportStart
public void reportStart()Print simulation starting info. -
reportEnd
public void reportEnd()Print simulation ending info. -
reportFighterData
void reportFighterData()Print every individual fighter (for testing small groups). -
reportFighterStatistics
public void reportFighterStatistics()Generate and print statistics for the fighter list. -
compileStatBins
StatBin[] compileStatBins()Compile fighters into statistical bins by level. -
reportMonsterKills
void reportMonsterKills()Prints number killed by each monster type. -
reportMonsterKillsAtLevel
void reportMonsterKillsAtLevel(int level) Prints number killed by each monster at given level. -
reportTotalMonsterKills
void reportTotalMonsterKills()Prints total kills at each monster level. -
reportXPAwards
void reportXPAwards()Report XP award ratios. -
reportYearEnd
void reportYearEnd(int year) Report year-end summary. -
getOldestFighter
Character getOldestFighter()Find oldest fighter the list. Break ties by highest level. -
getTopFighters
Get the top fighters in list. -
setBaseArmor
Set the base armor type. -
setPctMagicPerLevel
public void setPctMagicPerLevel(int percent) Set change of magic per level. -
setFightCycles
public void setFightCycles(int num) Set total number of fight cycles. -
setTypicalAlignment
Set typical alignment. -
getRandomAlignment
Get random alignment for one man. -
main
Main application method.
-