/** * Suitable job title for this CreatureType. Might be pseudorandom from several, if it's a CCS * disguise type. * * @param c Which creature to give the job title for (random choices are based on their birthday, * so they don't change). * @return a suitable job title */ public String jobtitle(final Creature c) { if (lcsname.length() != 0 && c.squad() != null) { return lcsname; } if (names.size() == 1) { return names.get(0); } else if (names.size() == 0) { return "Unemployed"; } return names.get(c.birthDay() % names.size()); }
/** * Whether we are disguised as a particular creature... * * @param cr a creature to test (in the case of multiple matches, their birthday is used to * determine which one they're disguised as). * @return A CreatureType, or null. */ static CreatureType inCharacter(final Creature cr) { final List<CreatureType> valid = new ArrayList<CreatureType>(); for (final CreatureType c : Game.type.creature.values()) { if (!c.hasUniform()) { continue; } if (c.uniform != null && c.uniform.inCharacter(cr)) { valid.add(c); } } if (valid.size() == 0) { return cr.type(); } return valid.get(cr.birthDay() % valid.size()); }