Package marauroa.common.game

Examples of marauroa.common.game.RPClass


    setRPClass("item_information");
  }


  public static void generateRPClass() {
    final RPClass entity = new RPClass("item_information");
    entity.isA("item");

    // Some things may have a textual description
    entity.addAttribute("description_info", Type.LONG_STRING);

    // used for show_item_list events used as shop signs.
    entity.addAttribute("price", Type.INT, Definition.VOLATILE);
  }
View Full Code Here


  /**
   * Register RPClass for GrowingPassiveEntityRespawnPoints. The used
   * identifier is "growing_entity_spawner".
   */
  public static void generateRPClass() {
    final RPClass grainFieldClass = new RPClass("growing_entity_spawner");
    grainFieldClass.isA("plant_grower");
    grainFieldClass.addAttribute("action_name", Type.STRING);
    grainFieldClass.addAttribute("max_ripeness", Type.BYTE);
    grainFieldClass.addAttribute("ripeness", Type.BYTE);
  }
View Full Code Here

  public static final String RPCLASS_NAME = "rented_sign";
  private static final String RENTER = "renter";
  private static final String TIMESTAMP = "timestamp";

  public static void generateRPClass() {
    final RPClass clazz = new RPClass(RPCLASS_NAME);
    clazz.isA("sign");
    clazz.addAttribute(RENTER, Type.STRING, Definition.HIDDEN);
    clazz.addAttribute(TIMESTAMP, Type.FLOAT, Definition.HIDDEN);
  }
View Full Code Here

  /** How long it takes to grow one berry. originally 2000 tt */
  private static final int GROWING_RATE = 1200;

  public static void generateRPClass() {
    final RPClass food = new RPClass("food");
    food.isA("plant_grower");
    food.addAttribute("amount", Type.BYTE);
  }
View Full Code Here

 
  private boolean needsSaving = false;
 
  public static void generateRPClass() {
    if (!RPClass.hasRPClass(RPCLASS_NAME)) {
      final RPClass entity = new RPClass(RPCLASS_NAME);
      entity.isA("portal");
      entity.addAttribute(DOOR_ID, Type.STRING);
      entity.addAttribute(OWNER, Type.STRING);
      entity.addAttribute(LOCK_NUMBER, Type.INT);
      entity.addAttribute(EXPIRES, Type.STRING);
      entity.addAttribute(DESTINATION_ZONE, Type.STRING);
      entity.addAttribute(DESTINATION_ID, Type.STRING);
      entity.addAttribute(PORTAL_REFERENCE, Type.STRING);
    }
  }
View Full Code Here

  private static final String REASON = "reason";
  private static final String TIMESTAMP = "timestamp";
  private static final String STARTED = "started";

  public static void generateRPClass() {
    final RPClass clazz = new RPClass(RPCLASS_NAME);
    clazz.isA("entity");
    clazz.addAttribute(CRIMINAL, Type.STRING, Definition.HIDDEN);
    clazz.addAttribute(POLICE_OFFICER, Type.STRING, Definition.HIDDEN);
    clazz.addAttribute(MINUTES, Type.INT, Definition.HIDDEN);
    clazz.addAttribute(REASON, Type.LONG_STRING, Definition.HIDDEN);
    clazz.addAttribute(TIMESTAMP, Type.FLOAT, Definition.HIDDEN);
    clazz.addAttribute(STARTED, Type.FLAG, Definition.HIDDEN);
  }
View Full Code Here

    transformerMap.put("player", new PlayerTransformer());
    transformerMap.put(Spell.RPCLASS_SPELL, new SpellTransformer());
  }
 
  private void fixRPClass(final RPObject object) {
    final RPClass clazz = object.getRPClass();
    if ((clazz == null) || (clazz.getName() == null) || (clazz.getName().trim().equals(""))) {
      if (object.has("type")) {
        logger.warn("Fixing empty class, setting it to type=" + object.get("type") + " on object: " + object);
        object.setRPClass(object.get("type"));
      }
    }
View Full Code Here

  @Override
  public RPObject transform(final RPObject object) {

    fixRPClass(object);

    final RPClass clazz = object.getRPClass();
    if (clazz == null) {
      logger.error("Cannot create concrete object for " + object
          + " because it does not have an RPClass.");
      return super.transform(object);
    }

    final String name = clazz.getName();
    Transformer trafo = transformerMap.get(name);
    if (trafo == null) {

      return super.transform(object);
    }
View Full Code Here

    createRPClassesWithoutBaking();
    RPClass.bakeAll();
  }

  private void createTellActionRPClass() {
    RPClass chatAction;
    chatAction = new RPClass("tell");
    chatAction.add(DefinitionClass.ATTRIBUTE, "type", Type.STRING);
    chatAction.add(DefinitionClass.ATTRIBUTE, "text", Type.LONG_STRING);
    chatAction.add(DefinitionClass.ATTRIBUTE, "target", Type.LONG_STRING);
  }
View Full Code Here

    chatAction.add(DefinitionClass.ATTRIBUTE, "text", Type.LONG_STRING);
    chatAction.add(DefinitionClass.ATTRIBUTE, "target", Type.LONG_STRING);
  }

  private void createChatActionRPClass() {
    RPClass chatAction = new RPClass("chat");
    chatAction.add(DefinitionClass.ATTRIBUTE, "type", Type.STRING);
    chatAction.add(DefinitionClass.ATTRIBUTE, "text", Type.LONG_STRING);
  }
View Full Code Here

TOP

Related Classes of marauroa.common.game.RPClass

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.