us.asciiroth.client.core
Class Flags

java.lang.Object
  extended by us.asciiroth.client.core.Flags

public class Flags
extends java.lang.Object

In order to make effective use of proxies, limited use can be made of the instanceof operator. Instead, flags are assigned to pieces to indicate basic characteristics of the piece.


Field Summary
static int AMMO_ENLIVENER
          A piece that enlivens ammo when it hits it, making the ammo dangerous to everyone, player and agents alike.
static int AMMUNITION
          This item is a form of ammunition (it is shot from another item marked as a RANGED_WEAPON.
static int AQUATIC
          This piece represents water, or an agent that can only move in water.
static int CARNIVORE
          This agent likes meat.
static int DETECT_HIDDEN
          This is a quality imparted to the player that makes him or her able to see hidden things.
static int ETHEREAL
          Items dropped on this terrain will disappear, rather than falling to the ground.
static int FIRE_RESISTANT
          This is a quality imparted to the player that makes him or her resistant to lava and fire.
static int FLIER
          This agent can fly.
static int HIDES_ITEMS
          A kind of terrain that hides the items that are located on it.
static int LAVITIC
          This piece represents lava, or an agent that can only move in lava.
static int MEAT
          This item is meat, and CARNIVORES will chase after it rather than the player.
static int MELEE_WEAPON
          This item is a melee weapon.
static int NOT_EDITABLE
          This piece should not be available in the map editor.
static int ORGANIC
          This agent is organic, and can be effected by fire.
static int PARALYSIS_RESISTANT
          This is a quality imparted to the player that makes him or her resistant to paralysis.
static int PARALYZED
          The agent has been paralyzed.
static int PENETRABLE
          Thrown items can fly over this terrain.
static int PLAYER
          This piece is the player (or a proxy for the player).
static int POISON_RESISTANT
          This is a quality imparted to the player that makes him or her resistant to poisoning.
static int POISONED
          The player is poisoned (cannot heal until the poisoning is removed).
static int PUSHABLE
          This agent is pushable.
static int RANGED_WEAPON
          This item is a ranged weapon.
static int REQUIRES_AMMO
          A ranged weapon that wants to consume some kind of ammo.
static int STONING_RESISTANT
          This is a quality imparted to the player that makes him or her resistant to stoning.
static int THEFT_RESISTANT
          This is a quality imparted to the player that makes him or her resistant to theft attacks.
static int TRANSIENT
           
static int TRAVERSABLE
          This terrain is traversable by agents.
static int TURNED_TO_STONE
          The agent has been turned to stone.
static int VERTICAL
          The terrain allows vertical movement.
static int WATER_RESISTANT
          This is a quality imparted to the player that makes him or her able to travel in water.
static int WEAK
          The player is too weak to hold or pick up anything.
static int WEAPON
          This item is a weapon.
 
Constructor Summary
Flags()
           
 
Method Summary
static java.lang.String description(int flags)
          Generates the description of those flags that are visible to the player, that are displayed in the "Flags" section of the game interface.
static int getFlag(java.lang.String label)
           
static boolean is(int flag, int flags)
           
static boolean matches(java.lang.String label, int flags)
           
static boolean not(int flag, int flags)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AMMO_ENLIVENER

public static final int AMMO_ENLIVENER
A piece that enlivens ammo when it hits it, making the ammo dangerous to everyone, player and agents alike. Typically ammo is not dangerous to the agent that shoots it, and non-player agents can't hit each other because that would be too easy.

See Also:
Constant Field Values

AMMUNITION

public static final int AMMUNITION
This item is a form of ammunition (it is shot from another item marked as a RANGED_WEAPON.

See Also:
Constant Field Values

AQUATIC

public static final int AQUATIC
This piece represents water, or an agent that can only move in water.

See Also:
Constant Field Values

CARNIVORE

public static final int CARNIVORE
This agent likes meat. It'll be distracted from chasing the player to chase a bone, a head, etc.

See Also:
Constant Field Values

DETECT_HIDDEN

public static final int DETECT_HIDDEN
This is a quality imparted to the player that makes him or her able to see hidden things.

See Also:
Constant Field Values

ETHEREAL

public static final int ETHEREAL
Items dropped on this terrain will disappear, rather than falling to the ground.

See Also:
Constant Field Values

FIRE_RESISTANT

public static final int FIRE_RESISTANT
This is a quality imparted to the player that makes him or her resistant to lava and fire.

See Also:
Constant Field Values

FLIER

public static final int FLIER
This agent can fly.

See Also:
Constant Field Values

HIDES_ITEMS

public static final int HIDES_ITEMS
A kind of terrain that hides the items that are located on it.

See Also:
Constant Field Values

LAVITIC

public static final int LAVITIC
This piece represents lava, or an agent that can only move in lava.

See Also:
Constant Field Values

MEAT

public static final int MEAT
This item is meat, and CARNIVORES will chase after it rather than the player.

See Also:
Constant Field Values

MELEE_WEAPON

public static final int MELEE_WEAPON
This item is a melee weapon.

See Also:
Constant Field Values

NOT_EDITABLE

public static final int NOT_EDITABLE
This piece should not be available in the map editor.

See Also:
Constant Field Values

ORGANIC

public static final int ORGANIC
This agent is organic, and can be effected by fire.

See Also:
Constant Field Values

PARALYSIS_RESISTANT

public static final int PARALYSIS_RESISTANT
This is a quality imparted to the player that makes him or her resistant to paralysis.

See Also:
Constant Field Values

PARALYZED

public static final int PARALYZED
The agent has been paralyzed.

See Also:
Constant Field Values

PENETRABLE

public static final int PENETRABLE
Thrown items can fly over this terrain.

See Also:
Constant Field Values

PLAYER

public static final int PLAYER
This piece is the player (or a proxy for the player).

See Also:
Constant Field Values

POISON_RESISTANT

public static final int POISON_RESISTANT
This is a quality imparted to the player that makes him or her resistant to poisoning.

See Also:
Constant Field Values

POISONED

public static final int POISONED
The player is poisoned (cannot heal until the poisoning is removed).

See Also:
Constant Field Values

PUSHABLE

public static final int PUSHABLE
This agent is pushable.

See Also:
Constant Field Values

RANGED_WEAPON

public static final int RANGED_WEAPON
This item is a ranged weapon. It should return an item of type ammunition from the event onFire

See Also:
Constant Field Values

REQUIRES_AMMO

public static final int REQUIRES_AMMO
A ranged weapon that wants to consume some kind of ammo. There is also an interface for this behavior, so this flag could go.

See Also:
Constant Field Values

STONING_RESISTANT

public static final int STONING_RESISTANT
This is a quality imparted to the player that makes him or her resistant to stoning.

See Also:
Constant Field Values

THEFT_RESISTANT

public static final int THEFT_RESISTANT
This is a quality imparted to the player that makes him or her resistant to theft attacks.

See Also:
Constant Field Values

TRANSIENT

public static final int TRANSIENT
See Also:
Constant Field Values

TRAVERSABLE

public static final int TRAVERSABLE
This terrain is traversable by agents.

See Also:
Constant Field Values

TURNED_TO_STONE

public static final int TURNED_TO_STONE
The agent has been turned to stone.

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
The terrain allows vertical movement.

See Also:
Constant Field Values

WATER_RESISTANT

public static final int WATER_RESISTANT
This is a quality imparted to the player that makes him or her able to travel in water.

See Also:
Constant Field Values

WEAK

public static final int WEAK
The player is too weak to hold or pick up anything.

See Also:
Constant Field Values

WEAPON

public static final int WEAPON
This item is a weapon.

See Also:
Constant Field Values
Constructor Detail

Flags

public Flags()
Method Detail

description

public static final java.lang.String description(int flags)
Generates the description of those flags that are visible to the player, that are displayed in the "Flags" section of the game interface.

Parameters:
flags -
Returns:
a string representation of those flags visible to the player

getFlag

public static int getFlag(java.lang.String label)

is

public static boolean is(int flag,
                         int flags)

matches

public static boolean matches(java.lang.String label,
                              int flags)

not

public static boolean not(int flag,
                          int flags)

0.7

© 2009 Alx Dark