Package games.stendhal.server.entity.creature

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


   */
  @Test
  public final void testOnDestroyRat() {
    CreatureTestHelper.generateRPClasses();
    final Player pl = PlayerTestHelper.createPlayer("hugo");
    final Creature rat = new RaidCreature(SingletonRepository.getEntityManager().getCreature("rat"));
    final StendhalRPZone testzone = new StendhalRPZone("Testzone");
    testzone.add(rat);
    testzone.add(pl);

    assertEquals(1, rat.getID().getObjectID());
    pl.setAdminLevel(5000);
    pl.clearEvents();

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    final RPAction action = new RPAction();
View Full Code Here


   */
  @Test
  public final void testOnDestroyRatWithTargetID() {

    final Player pl = PlayerTestHelper.createPlayer("hugo");
    final Creature rat = new RaidCreature(SingletonRepository.getEntityManager().getCreature("rat"));
    final StendhalRPZone testzone = new StendhalRPZone("Testzone");
    testzone.add(rat);
    testzone.add(pl);

    assertEquals(1, rat.getID().getObjectID());
    pl.setAdminLevel(5000);
    pl.clearEvents();

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    final RPAction action = new RPAction();
View Full Code Here

   * Tests for onInspectRatWithTargetID.
   */
  @Test
  public final void testOnInspectRatWithTargetID() {
    final Player pl = PlayerTestHelper.createPlayer("hugo");
    final Creature rat = new RaidCreature(SingletonRepository.getEntityManager().getCreature("rat"));
    final StendhalRPZone testzone = new StendhalRPZone("Testzone");
    testzone.add(rat);
    testzone.add(pl);

    assertEquals(1, rat.getID().getObjectID());
    pl.setAdminLevel(5000);
    pl.clearEvents();

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    final RPAction action = new RPAction();
View Full Code Here

          final EntityFactory factory = new EntityFactory(player) {
            @Override
            void found(final String type, final Entity entity) {
               final Entity entityToBePlaced;
              if (manager.isCreature(type)) { 
                entityToBePlaced = new RaidCreature((Creature) entity);
                if (((Creature) entity).isRare() && System.getProperty("stendhal.testserver") == null) {
                  // Rare creatures should not be summoned even in raids
                  // Require parameter -Dstendhal.testserver=junk
                  error("Rare creatures may not be summoned.");
                  return;
View Full Code Here

      // Require parameter -Dstendhal.testserver=junk
      admin.sendPrivateText("Rare creatures may not be summoned.");
      return;
    }

    final RaidCreature creature = new RaidCreature(tempCreature);
   
    // perhaps later have an option to set these, but think about how to do it correctly - dealing with spaces is hard
    // final String creaturename = args.get(1);
    // final int newatk = MathHelper.parseIntDefault(args.get(2), LOW_ATK);
    // final int newHP = MathHelper.parseIntDefault(args.get(3), HIGH_HP);
    final String creaturename = "enchanted " + creature.getTitle();
   
    final int newatk = LOW_ATK;
    final int newHP = HIGH_HP;
    creature.setName(creaturename);
    creature.setDescription(creature.describe() + " It has been magically enchanted, with its normal attack power converted into longer life.");
    creature.setAtk(newatk);
    creature.initHP(newHP);
   
    sandbox.add(creature, x, y );

  }
View Full Code Here

    sandbox.setZone(myZone);

    for (final Map.Entry<String, Integer> entry : createArmy().entrySet()) {
      Creature template = sandbox.getCreature(entry.getKey());
      if (template != null) {
        final RaidCreature creature = new RaidCreature(template);

        for (int i = 0; i < entry.getValue(); i++) {
          if(Rand.roll1D6()==1) {
            sandbox.add(creature, x + games.stendhal.common.Rand.randUniform(-RADIUS, RADIUS),
                              y + games.stendhal.common.Rand.randUniform(-RADIUS, RADIUS));
View Full Code Here

      // Rare creatures should not be summoned even in raids
      // Require parameter -Dstendhal.testserver=junk
      admin.sendPrivateText("Creatures with the rare property may only be summoned on test servers "
                        + "which are activated with the vm parameter: -Dstendhal.testserver=junk");
    } else {
      final Creature creature = new RaidCreature(tempCreature);

      final int k = MathHelper.parseIntDefault(args.get(0), 1);
      if (k <= MAX_RING_COUNT) {
        for (int dx = -k; dx <= k; dx++) {
          for (int dy = -k; dy <= k; dy++) {
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.creature.RaidCreature

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.