@Override
 public List<Question> getQuestionPhrases(
     WorldObject performer,
     WorldObject target,
     HistoryItem questionHistoryItem,
     WorldObject subjectWorldObject,
     World world) {
   return Arrays.asList(
       new Question(null, "Would you like to have some " + intPropertyToGive.getName() + "?"));
 }
示例#2
0
 private WorldObject addDefault(double skillBonus) {
   Map<ManagedProperty<?>, Object> properties = new HashMap<>();
   properties.put(Constants.QUANTITY, quantity);
   properties.put(Constants.PRICE, 1);
   properties.put(propertyKey, 1);
   properties.put(Constants.SELLABLE, false);
   properties.put(Constants.NAME, propertyKey.getName());
   properties.put(Constants.IMAGE_ID, initialImageId);
   WorldObject worldObject = new WorldObjectImpl(properties);
   return worldObject;
 }
示例#3
0
 private static String formatAsString(IntProperty property, int quantity) {
   if (property == Constants.ENERGY) {
     return "sufficient energy";
   } else if (property == Constants.DISTANCE) {
     if (quantity <= 1) {
       return "person needs to be adjacent";
     } else {
       return "distance to target less than " + quantity + " tiles";
     }
   } else {
     return quantity + " " + property.getName();
   }
 }
 @Override
 public String getDescription(WorldObject performer, WorldObject target, World world) {
   return "giving " + target.getProperty(Constants.NAME) + " some " + intPropertyToGive.getName();
 }