Package games.stendhal.server.entity

Examples of games.stendhal.server.entity.Outfit


        // done outside
      }
    };

    //  npcs.add(npc);
    npc.setOutfit(new Outfit(0, 04, 07, 32, 13));
    npc.setPosition(4, 17);
    npc.setDirection(Direction.DOWN);
    npc.initHP(100);
    npc.setSpeed(1.0);
    zone.add(npc);
View Full Code Here


        addQuest("Go meet my daughter #Susi, she'd love to make friends.");
        addGoodbye("Bye, nice to meet you.");
      }
    };

    npc2.setOutfit(new Outfit(0, 27, 07, 34, 01));
    npc2.setPosition(21, 10);
    npc2.setDirection(Direction.LEFT);
    npc2.initHP(100);
    zone2.add(npc2);
  }
View Full Code Here

  private void buildTradeCenterAdvisor(StendhalRPZone zone) {
    SpeakerNPC speaker = new MarketManagerNPC(TRADE_ADVISOR_NAME);
    speaker.setPosition(COORDINATE_X,COORDINATE_Y);
    speaker.setEntityClass("tradecenteradvisornpc");
    speaker.setOutfit(new Outfit(0, 5, 1, 34, 1));
    speaker.initHP(100);
    speaker.setDescription("Harold is a friendly guy who is waiting for setting up some offers...");
    zone.add(speaker);
  }
View Full Code Here

    switchGameSwitch(gameSwitch);
    boolean completed = checkBoard();
    if (completed) {
      npc.say("Congratulations, " + user.getName() + " you won! Here take this balloon.");
      Outfit balloonOutfit = new Outfit(Rand.rand(4) + 1, null, null, null, null);
      user.setOutfit(balloonOutfit);
      playerName = null;
      TurnNotifier.get().dontNotify(this);
    }
  }
View Full Code Here

  private void initOutfits() {
    // these outfits must be put on over existing outfit
    // (what's null doesn't change that part of the outfit) 
    // so true means we put on over
      final Pair<Outfit, Boolean> GLASSES = new Pair<Outfit, Boolean>(new Outfit(null, null, Integer.valueOf(86), null, null), true);
      final Pair<Outfit, Boolean> GOBLIN_FACE = new Pair<Outfit, Boolean>(new Outfit(null, null, Integer.valueOf(88), null, null), true);
      final Pair<Outfit, Boolean> THING_FACE = new Pair<Outfit, Boolean>(new Outfit(null, null, Integer.valueOf(87), null, null), true);

    // these outfits must replace the current outfit (what's null simply isn't there)
      final Pair<Outfit, Boolean> PURPLE_SLIME = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(93)), false);
      final Pair<Outfit, Boolean> GREEN_SLIME = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(89)), false);
      final Pair<Outfit, Boolean> RED_SLIME = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(88)), false);
      final Pair<Outfit, Boolean> BLUE_SLIME = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(91)), false);
      final Pair<Outfit, Boolean> GINGERBREAD_MAN = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(92)), false);
    
   
      outfitTypes.put("glasses", GLASSES);
      outfitTypes.put("goblin face", GOBLIN_FACE);
      outfitTypes.put("thing face", THING_FACE);
View Full Code Here

          @Override
          public void putOnOutfit(final Player player, final String outfitType) {
           
            final Pair<Outfit, Boolean> outfitPair = outfitTypes.get(outfitType);
            final Outfit outfit = outfitPair.first();
            final boolean type = outfitPair.second();
            if (type) {
              player.setOutfit(outfit.putOver(player.getOutfit()), true);
            } else {
              player.setOutfit(outfit, true);
            }
            if (endurance != NEVER_WEARS_OFF) {
              // restart the wear-off timer if the player was still wearing
              // another temporary outfit.
              SingletonRepository.getTurnNotifier().dontNotify(new OutwearClothes(player));
              // make the costume disappear after some time
              SingletonRepository.getTurnNotifier().notifyInTurns(endurance,
                  new OutwearClothes(player));
            }
          }
          // override transact agreed deal to only make the player rest to a normal outfit if they want a put on over type.
          @Override
          public boolean transactAgreedDeal(ItemParserResult res, final EventRaiser seller, final Player player) {
            final String outfitType = res.getChosenItemName();
            final Pair<Outfit, Boolean> outfitPair = outfitTypes.get(outfitType);
            final boolean type = outfitPair.second();

            if (type) {
              if (player.getOutfit().getBase() > 80
                  && player.getOutfit().getBase() < 99) {
                seller.say("You already have a magic outfit on which just wouldn't look good with another - could you please put yourself in something more conventional and ask again? Thanks!");
                return false;
              }
            }

            int charge = getCharge(res, player);

            if (player.isEquipped("money", charge)) {
              player.drop("money", charge);
              putOnOutfit(player, outfitType);
              return true;
            } else {
              seller.say("Sorry, you don't have enough money!");
              return false;
            }
          }
         
          // These outfits are not on the usual OutfitChangerBehaviour's
          // list, so they need special care when looking for them
          @Override
          public boolean wearsOutfitFromHere(final Player player) {
            final Outfit currentOutfit = player.getOutfit();

            for (final Pair<Outfit, Boolean> possiblePair : outfitTypes.values()) {
              if (possiblePair.first().isPartOf(currentOutfit)) {
                return true;
              }
View Full Code Here

          @Override
          public void putOnOutfit(final Player player, final String outfitType) {
           
            final Pair<Outfit, Boolean> outfitPair = outfitTypes.get(outfitType);
            final Outfit outfit = outfitPair.first();
            final boolean type = outfitPair.second();
            if (type) {
              player.setOutfit(outfit.putOver(player.getOutfit()), true);
            } else {
              player.setOutfit(outfit, true);
            }
            if (endurance != NEVER_WEARS_OFF) {
              // restart the wear-off timer if the player was still wearing
View Full Code Here

         
          // These outfits are not on the usual OutfitChangerBehaviour's
          // list, so they need special care when looking for them
          @Override
          public boolean wearsOutfitFromHere(final Player player) {
            final Outfit currentOutfit = player.getOutfit();

            for (final Pair<Outfit, Boolean> possiblePair : outfitTypes.values()) {
              if (possiblePair.first().isPartOf(currentOutfit)) {
                return true;
              }
View Full Code Here

  private void initOutfits() {
    // these outfits must be put on over existing outfit
    // (what's null doesn't change that part of the outfit) 
    // so true means we put on over
      final Pair<Outfit, Boolean> JUMPSUIT = new Pair<Outfit, Boolean>(new Outfit(null, null, null, Integer.valueOf(83), null), true);
      final Pair<Outfit, Boolean> DUNGAREES = new Pair<Outfit, Boolean>(new Outfit(null, null, null, Integer.valueOf(84), null), true);
      final Pair<Outfit, Boolean> GREEN_DRESS = new Pair<Outfit, Boolean>(new Outfit(null, null, null,  Integer.valueOf(78), null), true);

      final Pair<Outfit, Boolean> GOWN = new Pair<Outfit, Boolean>(new Outfit(null, null, null, Integer.valueOf(82), null), true);
      final Pair<Outfit, Boolean> NOOB = new Pair<Outfit, Boolean>(new Outfit(null, null, null, Integer.valueOf(80), null), true);
      final Pair<Outfit, Boolean> GLASSES = new Pair<Outfit, Boolean>(new Outfit(null, null, Integer.valueOf(99), null, null), true);
      final Pair<Outfit, Boolean> GLASSES_2 = new Pair<Outfit, Boolean>(new Outfit(null, null, Integer.valueOf(79), null, null), true);
      final Pair<Outfit, Boolean> HAT = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(99), null, null, null), true);

    // these outfits must replace the current outfit (what's null simply isn't there)
      final Pair<Outfit, Boolean> BUNNY = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(81), Integer.valueOf(98)), false);
      final Pair<Outfit, Boolean> HORSE = new Pair<Outfit, Boolean>(new Outfit(0, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(97)), false);
      final Pair<Outfit, Boolean> GIRL_HORSE = new Pair<Outfit, Boolean>(new Outfit(0, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(96)), false);
      final Pair<Outfit, Boolean> ALIEN = new Pair<Outfit, Boolean>(new Outfit(null, Integer.valueOf(00), Integer.valueOf(98), Integer.valueOf(00), Integer.valueOf(95)), false);

   
   
      outfitTypes.put("jumpsuit", JUMPSUIT);
      outfitTypes.put("dungarees", DUNGAREES);
View Full Code Here

          @Override
          public void putOnOutfit(final Player player, final String outfitType) {
           
            final Pair<Outfit, Boolean> outfitPair = outfitTypes.get(outfitType);
            final Outfit outfit = outfitPair.first();
            final boolean type = outfitPair.second();
            if (type) {
              player.setOutfit(outfit.putOver(player.getOutfit()), true);
            } else {
              player.setOutfit(outfit, true);
            }
            if (endurance != NEVER_WEARS_OFF) {
              // restart the wear-off timer if the player was still wearing
              // another temporary outfit.
              SingletonRepository.getTurnNotifier().dontNotify(new OutwearClothes(player));
              // make the costume disappear after some time
              SingletonRepository.getTurnNotifier().notifyInTurns(endurance,
                  new OutwearClothes(player));
            }
          }
          // override transact agreed deal to only make the player rest to a normal outfit if they want a put on over type.
          @Override
          public boolean transactAgreedDeal(ItemParserResult res, final EventRaiser seller, final Player player) {
            final String outfitType = res.getChosenItemName();
            final Pair<Outfit, Boolean> outfitPair = outfitTypes.get(outfitType);
            final boolean type = outfitPair.second();

            if (type) {
              if (player.getOutfit().getBase() > 80
                  && player.getOutfit().getBase() < 99) {
                seller.say("You already have a magic outfit on which just wouldn't look good with another - could you please put yourself in something more conventional and ask again? Thanks!");
                return false;
              }
            }

            int charge = getCharge(res, player);

            if (player.isEquipped("money", charge)) {
              player.drop("money", charge);
              putOnOutfit(player, outfitType);
              return true;
            } else {
              seller.say("Sorry, you don't have enough money!");
              return false;
            }
          }
         
          // These outfits are not on the usual OutfitChangerBehaviour's
          // list, so they need special care when looking for them
          @Override
          public boolean wearsOutfitFromHere(final Player player) {
            final Outfit currentOutfit = player.getOutfit();

            for (final Pair<Outfit, Boolean> possiblePair : outfitTypes.values()) {
              if (possiblePair.first().isPartOf(currentOutfit)) {
                return true;
              }
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.Outfit

Copyright © 2018 www.massapicom. 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.