Package org.moparscape.msc.gs.model

Examples of org.moparscape.msc.gs.model.Path


            player.getActionSender().sendSound("retreat");
            npc.unblock();
            npc.resetCombat(CombatState.RUNNING);
            player.resetCombat(CombatState.WAITING);
            npc.setRan(true);
            npc.setPath(new Path(attacker.getX(), attacker.getY(),
                DataConversions.random(npc.getLoc().minX(), npc
                    .getLoc().maxX()), DataConversions
                    .random(npc.getLoc().minY(), npc
                        .getLoc().maxY())));
            player.resetAll();
View Full Code Here


    if (!inBounds()) {
      failed();
      return;
    }

    owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob.getX(),
        affectedMob.getY()));

    if (owner.withinRange(affectedMob, radius)) {
      arrived();
      super.matchRunning = false;
View Full Code Here

      owner.resetPath();
      if (!inBounds()) {
        failed();
        return;
      }
      owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob
          .getX(), affectedMob.getY()));
      return; // Target is moving.. correcting path
    } else {
      if (GameEngine.getTime() - startTime <= 10000) // Make NPCs
      // give a 10
      // second
      // chase
      {
        if (loc != null) {
          if (!inBounds()) {
            failed();
            return;
          }
        } else if (owner.nextTo(affectedMob) && owner.finishedPath()) {
          return; // if stuck behind gate, keep chasing in case it
              // opens
        }

        if (owner.isBusy())
          return;

        owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob
            .getX(), affectedMob.getY()));
        return;
      } else
        failed();
    }
View Full Code Here

    byte[] waypointYoffsets = new byte[numWaypoints];
    for (int x = 0; x < numWaypoints; x++) {
      waypointXoffsets[x] = p.readByte();
      waypointYoffsets[x] = p.readByte();
    }
    Path path = new Path(startX, startY, waypointXoffsets, waypointYoffsets);
    player.setStatus(Action.IDLE);
    player.setPath(path);
  }
View Full Code Here

TOP

Related Classes of org.moparscape.msc.gs.model.Path

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.