Package marauroa.common.game

Examples of marauroa.common.game.RPClass


  /**
   * Generates the RPClass and specifies slots and attributes.
   */
  static void generateRPClass() {
    final RPClass player = new RPClass("player");
    player.isA("rpentity");

    // Note: text and private_text need to be kept because volatile
    //       attributes have been stored to the database in the past.
    //       And old characters, who logged out in the same turn as a
    //       private_text was set, cannot be loaded without this definition.
    player.addAttribute("text", Type.LONG_STRING, Definition.VOLATILE);
//    player.addAttribute("private_text", Type.LONG_STRING, (byte) (Definition.HIDDEN | Definition.VOLATILE));

    player.addRPEvent(Events.PRIVATE_TEXT, Definition.PRIVATE);
    player.addRPEvent(Events.PLAYER_LOGGED_ON, Definition.PRIVATE);
    player.addRPEvent(Events.PLAYER_LOGGED_OUT, Definition.PRIVATE);
    player.addRPEvent(Events.TRADE_STATE_CHANGE, Definition.PRIVATE);
    player.addRPEvent(Events.REACHED_ACHIEVEMENT, Definition.PRIVATE);

    player.addAttribute("poisoned", Type.SHORT, Definition.VOLATILE);
    player.addAttribute("eating", Type.SHORT, Definition.VOLATILE);
    player.addAttribute("choking", Type.SHORT, Definition.VOLATILE);

    player.addAttribute("dead", Type.FLAG, Definition.PRIVATE);

    player.addAttribute("outfit", Type.INT);
    player.addAttribute("outfit_org", Type.INT, Definition.HIDDEN);
    // player.addAttribute("outfit_path", Type.STRING);

    player.addAttribute("away", Type.LONG_STRING, Definition.VOLATILE);
    player.addAttribute("grumpy", Type.LONG_STRING, Definition.VOLATILE);

    // Use this for admin menus and usage.
    player.addAttribute("admin", Type.FLAG);
    player.addAttribute("adminlevel", Type.INT);
    player.addAttribute("invisible", Type.FLAG, Definition.HIDDEN);
    player.addAttribute("ghostmode", Type.FLAG);
    player.addAttribute("teleclickmode", Type.FLAG, Definition.HIDDEN);

    player.addAttribute("release", Type.STRING, Definition.PRIVATE);

    player.addAttribute("age", Type.INT, Definition.HIDDEN);

    // Store sheep at DB
    player.addRPSlot("#flock", 1, Definition.HIDDEN);
    player.addAttribute("sheep", Type.INT);

    // Store pets at DB
    player.addRPSlot("#pets", 1, Definition.HIDDEN);
    player.addAttribute("pet", Type.INT);
    player.addAttribute("cat", Type.INT);
    player.addAttribute("baby_dragon", Type.INT);

    // Bank system
    player.addRPSlot("bank", 30, Definition.HIDDEN);
    player.addRPSlot("bank_ados", 30, Definition.HIDDEN);
    player.addRPSlot("zaras_chest_ados", 30, Definition.HIDDEN);
    player.addRPSlot("bank_fado", 30, Definition.HIDDEN);
    player.addRPSlot("bank_nalwor", 30, Definition.HIDDEN);

    // Kills recorder - needed for quest
    player.addRPSlot("!kills", 1, Definition.HIDDEN);

    // Count looted items
    player.addAttribute("looted_items", Type.MAP, Definition.HIDDEN);

    // We use this for the buddy system
    player.addRPSlot("!buddy", 1, Definition.PRIVATE);
    // using additionally a proof of concept for buddies here
    player.addAttribute("buddies", Type.MAP, Definition.PRIVATE);

    player.addRPSlot("!ignore", 1, Definition.PRIVATE);
    player.addAttribute("online", Type.LONG_STRING,
        (byte) (Definition.PRIVATE | Definition.VOLATILE));
    player.addAttribute("offline", Type.LONG_STRING,
        (byte) (Definition.PRIVATE | Definition.VOLATILE));

    player.addRPSlot("!quests", 1, Definition.HIDDEN);
    player.addRPSlot("!tutorial", 1, Definition.HIDDEN);

    player.addAttribute("karma", Type.FLOAT, Definition.PRIVATE);
    player.addAttribute("tradescore", Type.INT, Definition.PRIVATE);
    player.addAttribute("sentence", Type.STRING, Definition.HIDDEN);

    player.addRPSlot("skills", 1, Definition.HIDDEN);

    // Non-removable while stored ones have values
    player.addRPSlot("!skills", 1,
        (byte) (Definition.HIDDEN | Definition.VOLATILE));

    player.addRPSlot("!visited", 1, Definition.HIDDEN);

    // This is the RPSlot for the spells. It's main purpose is to let us add
    // a GUI for the spells later on.
    player.addRPSlot("spells", 9, Definition.PRIVATE);

    player.addRPSlot("trade", 4);

    // The guild name
    player.addAttribute("guild", Type.STRING);

    // Player features
    player.addAttribute("features", Type.MAP, Definition.PRIVATE);
    // deprecated
    player.addRPSlot("!features", 1, Definition.PRIVATE);

    // Last time this player attacked another player
    player.addAttribute("last_pvp_action_time", Type.FLOAT, Definition.HIDDEN);
    player.addAttribute("last_player_kill_time", Type.FLOAT, Definition.STANDARD);

    player.addRPEvent("transition_graph", Definition.PRIVATE);
    player.addRPEvent("examine", Definition.PRIVATE);
    player.addRPEvent("show_item_list", Definition.PRIVATE);
    player.addRPEvent(Events.VIEW_CHANGE, Definition.PRIVATE);
    player.addRPEvent(Events.GROUP_CHANGE, Definition.PRIVATE);
    player.addRPEvent(Events.GROUP_INVITE, Definition.PRIVATE);
    player.addRPEvent(Events.PROGRESS_STATUS_CHANGE, Definition.PRIVATE);

    // Maps
    player.addAttribute("source_usage", Type.MAP, Definition.HIDDEN);
  }
View Full Code Here


   */
  public static final String OFFER_RPCLASS_NAME = "offer";
  private static final String TIMESTAMP = "timestamp";

  public static void generateRPClass() {
    final RPClass offerRPClass = new RPClass(OFFER_RPCLASS_NAME);
    offerRPClass.isA("entity");
    offerRPClass.addAttribute(PRICE_ATTRIBUTE, Type.INT);
    offerRPClass.addAttribute(OFFERER_ATTRIBUTE_NAME, Type.STRING);
    offerRPClass.addAttribute(OFFERER_CID_ATTRIBUTE, Type.STRING);
    offerRPClass.addAttribute(TIMESTAMP, Type.STRING);
    offerRPClass.addRPSlot(OFFER_ITEM_SLOT_NAME, 1);
  }
View Full Code Here

/**
* Burning fire.
*/
public class Fire extends Entity implements UseListener {
  public static void generateRPClass() {
    final RPClass fire = new RPClass("fire");
    fire.isA("entity");
  }
View Full Code Here

 
  private final Integer value;
  private final String sellerName;
 
  public static void generateRPClass() {
    final RPClass earningClass = new RPClass(EARNING_RPCLASS_NAME);
    earningClass.isA("entity");
    earningClass.addAttribute(VALUE_ATTRIBUTE, Type.INT);
    earningClass.addAttribute(NAME_ATTRIBUTE, Type.STRING);
    earningClass.addAttribute(REWARD_ATTRIBUTE, Type.INT);
    earningClass.addAttribute(TIMESTAMP_ATTRIBUTE, Type.STRING);
  }
View Full Code Here

  //
  // FishSource
  //

  public static void generateRPClass() {
    final RPClass rpclass = new RPClass("fish_source");
    rpclass.isA("entity");
  }
View Full Code Here

  /** the logger instance. */
  private static final Logger logger = Logger.getLogger(Sign.class);

  public static void generateRPClass() {
    try {
      final RPClass sign = new RPClass("sign");
      sign.isA("entity");
      sign.addAttribute(ATTR_TEXT, Type.LONG_STRING, Definition.HIDDEN);
      sign.addAttribute(Actions.ACTION, Type.STRING);
      sign.addAttribute("class", Type.STRING);
    } catch (final SyntaxException e) {
      logger.error("cannot generate RPClass", e);
    }
  }
View Full Code Here

  /**
   * Generate the RPClass for the Market
   */
  public static void generateRPClass() {
    final RPClass shop = new RPClass(MARKET_RPCLASS_NAME);
    shop.isA("entity");
    shop.addRPSlot(OFFERS_SLOT_NAME, -1, Definition.HIDDEN);
    shop.addRPSlot(EARNINGS_SLOT_NAME, -1, Definition.HIDDEN);
    shop.addRPSlot(EXPIRED_OFFERS_SLOT_NAME, -1, Definition.HIDDEN);
  }
View Full Code Here

  //
  // WaterSpringSource
  //

  public static void generateRPClass() {
    final RPClass rpclass = new RPClass("water_source");
    rpclass.isA("entity");
  }
View Full Code Here

      if (TITLE.equals(stat) && (changed instanceof Player)) {
        player.sendPrivateText("The title attribute may not be changed directly.");
        return;
      }

      final RPClass clazz = changed.getRPClass();


      final Definition type = clazz.getDefinition(DefinitionClass.ATTRIBUTE, stat);
      if (type == null) {
        player.sendPrivateText("Attribute you are altering is not defined in RPClass("
            + changed.getRPClass().getName() + ")");
        return;
      } else {
View Full Code Here

    setResistance(0);
  }

  public static void generateRPClass() {
    final RPClass grower = new RPClass("plant_grower");
    grower.isA("entity");
    grower.addAttribute("class", Type.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.