Examples of TimePassedCondition


Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

  }

  @Override
  public boolean isRepeatable(final Player player) {
    return  new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
             new TimePassedCondition(QUEST_SLOT,1,delay)).fire(player, null, null);
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestCompletedCondition(QUEST_SLOT),
          new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
      ConversationStates.QUEST_OFFERED,
      "Hello again. Have you returned for more of my special soup?",
      null);

    // player returns after finishing the quest (it is repeatable) before
    // the time as finished
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES , "I hope you don't want more soup, because I haven't finished washing the dishes. Please check back in")
      );
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return  new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
             new TimePassedCondition(QUEST_SLOT,1,REQUIRED_MINUTES)).fire(player, null, null);
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

        null);
   
    // player can repeat quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "My throat is dry again from all this talking, could you fetch me a little more water?",
        null)
   
    // player can't repeat quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        "Thank you, I don't need anything right now.",
        null)
   
    // if the quest is active we deal with the response to quest/water in a following step
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
         new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)).fire(player,null, null);
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

      } else {
        res.add(String.format("I have " +Grammar.quantityplnoun(amount, questItem, "a") + " to feed the animals, and need to take it."));
      }
    }
    if (isCompleted(player)) {
      if(new TimePassedCondition(QUEST_SLOT, 1, DELAY).fire(player, null, null)) {
        res.add("The animals are hungry again! I need to ask Katinka what they need.");
      } else {
        res.add("The animals are not hungry! Yay, me!");
      }
    }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

        // Player returns within one week of completing quest
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
        ConversationStates.ATTENDING, "Welcome back to the Ados Wildlife Refuge! Thanks again for rescuing our animals!",
        null
    );

        // Player returns and longer than a week has passed, ask to help again
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new TimePassedCondition(QUEST_SLOT, 1, DELAY)),
        ConversationStates.QUEST_OFFERED, "Welcome back to the Ados Wildlife "
                + "Refuge! Our animals are hungry again, can you bring some more food please?",
                null);


        // Player has never done the zoo quest, player asks what the task was
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED, "Our animals are hungry. We need " +
            "more food to feed them. Can you help us?",
        null);

      final Map<String,Integer> items = new HashMap<String, Integer>();   
    items.put("ham",10);
    items.put("meat",15);
    items.put("grain",20);
    items.put("salad",10);
    items.put("button mushroom",5);
    items.put("carrot",5);
    items.put("spinach",5);
    items.put("apple",5);
    items.put("roach",3);
   
        // Player has done quest before and agrees to help again
    npc.add(ConversationStates.QUEST_OFFERED, ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING, null,
                new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "start;", 2.0),
        new StartRecordingRandomItemCollectionAction(QUEST_SLOT, 1, items, "Oh, thank you! Please help us by"
                + " bringing [item] as soon as you can."))
    );


    // player is not willing to help
    npc.add(ConversationStates.QUEST_OFFERED, ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.ATTENDING, "Oh dear... I guess we're going to have to feed them with the deer...",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0)
    );
   
        // Player returns within one week of completing quest
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
                                 new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
        ConversationStates.ATTENDING, null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, DELAY, "Thanks, we have enough food to feed the animals here for another"));

  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

    // player returns while quest is still active
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
      ConversationStates.ATTENDING, "Hello! Now that the animals have enough food, they don't get sick that easily, and I have time for other things. How can I help you?",
        null
    );

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new OrCondition(new QuestNotCompletedCondition(QUEST_SLOT),
                new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT, 1, DELAY))
            )),
        ConversationStates.IDLE, "Sorry, can't stop to chat. The animals are all sick because they don't have enough food. See yourself out, won't you?",
        null
    );
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return  new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
             new TimePassedCondition(QUEST_SLOT,1,DELAY)).fire(player, null, null);
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.TimePassedCondition

  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"killed;"),
         new TimePassedCondition(QUEST_SLOT, 1, MathHelper.MINUTES_IN_ONE_WEEK)).fire(player,null, null);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.