Class Party

All Implemented Interfaces:
Iterable<Monster>

public class Party extends Object implements Iterable<Monster>
One party (force, team, band, or group) of Monsters.
Since:
2016-01-31
  • Field Details

    • members

      List<Monster> members
      List of party members.
    • fallen

      List<Monster> fallen
      List of fallen members.
    • incoming

      List<Monster> incoming
      List of incoming members.
    • outgoing

      List<Monster> outgoing
      List of outgoing members.
  • Constructor Details

    • Party

      Party()
      Empty constructor
    • Party

      Party(Monster monster)
      Solo party
    • Party

      Party(Monster monster, int count)
      Spawn copies of a monster
    • Party

      Party(List<Monster> list)
      List constructor
  • Method Details

    • size

      public int size()
    • get

      public Monster get(int idx)
    • sizeFallen

      public int sizeFallen()
    • getFallen

      public Monster getFallen(int idx)
    • add

      public void add(Monster m)
    • isLive

      public boolean isLive()
      Is this party operational?
    • clearTimesMeleed

      public void clearTimesMeleed()
      Clear records of attacks taken.
    • random

      public Monster random()
      Pick a random party member.
    • getRandomMeleeTarget

      public Monster getRandomMeleeTarget()
      Pick a target for melee.
    • isOpenToMelee

      public boolean isOpenToMelee()
      Check if any members are yet un-melee'd.
    • randomGroup

      public List<Monster> randomGroup(int number)
      Get a random subset of this party.
    • prepBattle

      public void prepBattle(Party enemy)
      Prepare for battle against an enemy.
    • summonAllMinions

      private void summonAllMinions()
      Make all summons possible (add to party). Caution: Must not be recursive.
    • addMonsters

      public void addMonsters(Monster monster, int count)
      Add a number of some monster race to this party.
    • makeSpecialAttacks

      public void makeSpecialAttacks(Party enemy)
      Make special attacks against an enemy party.
    • takeTurn

      public void takeTurn(Party enemy)
      Have each member take its turn against an enemy.
    • bringOutYourDead

      public void bringOutYourDead()
      Move dead members to list of fallen.
    • clearFallen

      public void clearFallen()
      Clear out the list of fallen.
    • sortMembers

      public void sortMembers()
      Sort the list of members by increasing level/hit dice.
    • sortMembersDown

      public void sortMembersDown()
      Sort the list of members by decreasing level/hit dice.
    • shuffleMembers

      public void shuffleMembers()
      Shuffle the list of members.
    • healAll

      public void healAll()
      Heal the party fully.
    • getMaxLevels

      public int getMaxLevels()
      Get max level in the party.
    • getSumLevels

      public int getSumLevels()
      Get total levels in the party.
    • isModeFirstLevel

      public boolean isModeFirstLevel()
      Is this party mostly 1st level?
    • getTopMembers

      public List<Monster> getTopMembers(int number)
      Get a list of the top party members.
    • toString

      public String toString()
      Identify this object as a string.
      Overrides:
      toString in class Object
    • getHitPointList

      public List<Integer> getHitPointList()
      Make a list of the party's hit points.
    • allHaveCondition

      public boolean allHaveCondition(SpecialType condition)
      Do all members of this party have a given conditon?
    • iterator

      public Iterator<Monster> iterator()
      Return iterator for the iterable interface.
      Specified by:
      iterator in interface Iterable<Monster>
    • getRatioLive

      public double getRatioLive()
      Get ratio of original party still alive.
    • queueIncoming

      public void queueIncoming(Monster m)
      Add new monster to our incoming list.
    • queueOutgoing

      public void queueOutgoing(Monster m)
      Add new monster to our outgoing list.
    • handleMemberChanges

      public void handleMemberChanges()
      Handle all incoming & outgoing monsters.
    • main

      public static void main(String[] args)
      Main test method.