Examples of Sheep


Examples of games.stendhal.server.entity.creature.Sheep

    @Override
    public boolean transactAgreedDeal(ItemParserResult res, final EventRaiser seller, final Player player) {
      // res.getAmount() is currently ignored.

      final Sheep sheep = player.getSheep();

      if (sheep != null) {
        if (seller.getEntity().squaredDistance(sheep) > 5 * 5) {
          seller.say("I can't see that sheep from here! Bring it over so I can assess it properly.");
        } else if (getValue(res, sheep) < SheepSellerNPC.BUYING_PRICE) {
          // prevent newbies from selling their sheep too early
          seller.say("Nah, that sheep looks too skinny. Feed it with red berries, and come back when it has become fatter.");
        } else {
          seller.say("Thanks! Here is your money.");
          payPlayer(res, player);
          player.removeSheep(sheep);

          player.notifyWorldAboutChanges();
          if(seller.getEntity() instanceof SheepBuyerSpeakerNPC) {
            ((SheepBuyerSpeakerNPC)seller.getEntity()).moveSheep(sheep);
          } else {
            // only to prevent that an error occurs and the sheep does not disappear
            sheep.getZone().remove(sheep);
          }

          return true;
        }
      } else {
View Full Code Here

Examples of games.stendhal.server.entity.creature.Sheep

    }

    @Override
    public int getCharge(ItemParserResult res, final Player player) {
      if (player.hasSheep()) {
        final Sheep sheep = player.getSheep();
        return Math.round(getUnitPrice(res.getChosenItemName()) * ((float) sheep.getWeight() / (float) Sheep.MAX_WEIGHT));
      } else {
        return 0;
      }
    }
View Full Code Here

Examples of games.stendhal.server.entity.creature.Sheep

    }

    @Override
    public boolean transactAgreedDeal(ItemParserResult res, final EventRaiser seller, final Player player) {
      // res.getAmount() is currently ignored.
      final Sheep sheep = player.getSheep();

      if (sheep != null) {
        if (seller.getEntity().squaredDistance(sheep) > 5 * 5) {
          seller.say("*drool* Sheep flesh! Bring da sheep here!");
        } else {
          seller.say("Mmm... Is look yummy! Here, you take dis gold!");
          payPlayer(res, player);

          player.removeSheep(sheep);
          player.notifyWorldAboutChanges();

          sheep.getZone().remove(sheep);

          return true;
        }
      } else {
        seller.say("Whut? Is not unnerstand... Maybe I hit you until you make sense!");
View Full Code Here

Examples of games.stendhal.server.entity.creature.Sheep

        // If quest is offered and player says yes, give a sheep to him.
        List<ChatAction> sheepActions = new LinkedList<ChatAction>();
        sheepActions.add(new SetQuestAction(QUEST_SLOT, "start"));
        sheepActions.add(new ChatAction() {
            public void fire(Player player, Sentence sentence, EventRaiser npc) {
                final Sheep sheep = new Sheep(player);
                StendhalRPAction.placeat(npc.getZone(), sheep, npc.getX(), npc.getY() + 1);
            }
        });
        npc.add(
                ConversationStates.QUEST_OFFERED,
View Full Code Here

Examples of games.stendhal.server.entity.creature.Sheep

        // Remove action
        final List<ChatAction> removeSheepAction = new LinkedList<ChatAction>();
        removeSheepAction.add(new ChatAction() {
            public void fire(Player player, Sentence sentence, EventRaiser npc) {
                // remove sheep
                final Sheep sheep = player.getSheep();
                if(sheep != null) {
                    player.removeSheep(sheep);
                    player.notifyWorldAboutChanges();
                    if(npc.getEntity() instanceof SheepBuyerSpeakerNPC) {
                        ((SheepBuyerSpeakerNPC)npc.getEntity()).moveSheep(sheep);
                    } else {
                        // only to prevent that an error occurs and the sheep does not disappear
                        sheep.getZone().remove(sheep);
                    }
                } else {
                    // should not happen
                    npc.say("What? What sheep? Did I miss something?");
                    npc.setCurrentState(ConversationStates.IDLE);
View Full Code Here

Examples of org.bitbucket.woolmark.object.Sheep

        addObject(atmosphere);
        addObject(ground);
        addObject(fence);

        Sheep sheep = createSheep(this);
        addObject(sheep);

        Shepherd shepherd = createShepherd(this);
        addObject(shepherd);
    }
View Full Code Here

Examples of org.bitbucket.woolmark.object.Sheep

    }

    @Override
    public void ticktack() {
        if (appendSheep) {
            Sheep sheep = createSheep(this);
            addObject(sheep);
        }

        super.ticktack();
View Full Code Here

Examples of org.bitbucket.woolmark.object.Sheep

    @Override
    public void ticktack() {

        for (Object object : getWorld().getObjects()) {
            if (Sheep.class.isInstance(object)) {
                Sheep sheep = (Sheep) object;

                if (sheep.getJumpFrame() == Sheep.JUMP_FRAME) {
                    count++;
                }
            }
        }
View Full Code Here

Examples of org.bukkit.entity.Sheep

        Villager villager = (Villager) entity1;
        villager.setProfession(ClosestMatches.villagerProfessions(type).get(0));
      } else if (type.startsWith("item:") && toSpawn == EntityType.DROPPED_ITEM){

      } else if (dye != null){
        Sheep sheep = (Sheep) entity1;
        sheep.setColor(dye);
      }
    }
   
    entity1.setVelocity(target.getEyeLocation().getDirection().multiply(2));
    entity1.setFallDistance(-999999999999F);
View Full Code Here

Examples of org.bukkit.entity.Sheep

            Villager villager = (Villager) entity1;
            villager.setProfession(ClosestMatches.villagerProfessions(type).get(0));
          } else if (type.startsWith("item:") && toSpawn == EntityType.DROPPED_ITEM){

          } else if (dye != null){
            Sheep sheep = (Sheep) entity1;
            sheep.setColor(dye);
          }
        }
       
        entity1.setVelocity(p.getEyeLocation().getDirection().multiply(2));
        entity1.setFallDistance(-999999999999F);
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.