All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sso.PC

java.lang.Object
   |
   +----sso.Persistant
           |
           +----sso.GameObject
                   |
                   +----sso.Thing
                           |
                           +----sso.PC

public class PC
extends Thing
implements Attackable, Runnable
PC is abstract because it should never be directly instantiated. Instead, a Player or NPC class should be used. The big difference between Player and NPC is that a Player contains information about past connections, usage of the system, etc., while an NPC contains a monster memory, wander path, behaviors, etc.


Variable Index

 o base_mana
 o bStatus
 o cur_mana
 o group
 o heal_rate
 o LOC_ARMS
 o LOC_BUCKLER
 o LOC_COUNT
 o LOC_FEET
 o LOC_FINGER
 o LOC_HANDS
 o LOC_HEAD
 o LOC_HIPS
 o LOC_LEFT_HAND
 o LOC_NECK
 o LOC_NONE
 o LOC_RIGHT_HAND
 o LOC_SHINS
 o LOC_SHOULDERS
 o LOC_THIGHS
 o LOC_TORSO
 o LOC_WAIST
 o LOC_WRISTS
 o mana_rate
 o natural_weapon
 o size
 o SIZE_ANY
 o SIZE_GIANT
 o SIZE_HUGE
 o SIZE_LARGE
 o SIZE_MAN
 o SIZE_SMALL
 o SIZE_TINY
 o skills
 o tStatus

Constructor Index

 o PC()
Constructor (protected)

Method Index

 o addNaturalWeapon(Weapon)
Add a natural weapon
 o addSkill(Skill)
Add a skill.
 o attack(Attack)
Determine what happens when this PC gets attacked (is the defender) Implements Attackable.attack(Attack) Should be overridden by children (such as NPCs for hate lists).
 o createPC()
Public factory.
 o createRows()
Create rows to save PC
 o die()
Die
 o doAttack(Attackable)
Attack another attackable
 o drain(int)
Drain mana (due to spell, effect, etc)
 o getArmor(byte)
Get the armor at the given location
 o getBaseMana()
Get the base mana
 o getCapacity()
Get max capacity.
 o getGroup()
Get the current group.
 o getHealRate()
Get the heal rate (hits healed per minute)
 o getMana()
Get the current mana
 o getManaRate()
Get the mana recharge rate (mana per minute)
 o getNaturalWeapons()
Get natural weapons
 o getSize()
Get the PC size
 o getSkill(Skill)
Get the PC's skill by an existing skill's type.
 o getSkill(String)
Get the skill by class name.
 o getValue()
Get value.
 o getWielded()
Get the wielded weapon.
 o heal(int)
Heal the PC
 o hurt(int)
Hurt the PC
 o init()
Initializer for new PCs.
 o joinGroup(Group)
Join the specified group.
 o leaveGroup()
Remove the PC from the current group.
 o load()
Load this instance.
 o loadPC(int)
Load PC object
 o main(String[])
Tester
 o removeNaturalWeapon(Weapon)
Remove a natural weapon
 o removeSkill(Skill)
Remove the specified skill
 o removeSkill(String)
Remove the specified skill
 o restoreMana(int)
Restore mana
 o roll(String, int)
Perform a skill roll.
 o run()
Status thread.
 o setBaseMana(int)
Set the base mana
 o setHealRate(int)
Set the heal rate
 o setMana(int)
Set the current mana
 o setManaRate(int)
Set the mana recharge rate
 o setSize(byte)
Set the PC size
 o store()
Store this object in the database
 o unregister()
Remove the PC from the database.

Variables

 o tStatus
 protected transient Thread tStatus
 o bStatus
 protected transient boolean bStatus
 o skills
 protected Vector skills
 o base_mana
 protected int base_mana
 o cur_mana
 protected int cur_mana
 o heal_rate
 protected int heal_rate
 o mana_rate
 protected int mana_rate
 o natural_weapon
 protected Vector natural_weapon
 o group
 protected Group group
 o size
 protected byte size
 o SIZE_ANY
 public static final byte SIZE_ANY
 o SIZE_TINY
 public static final byte SIZE_TINY
 o SIZE_SMALL
 public static final byte SIZE_SMALL
 o SIZE_MAN
 public static final byte SIZE_MAN
 o SIZE_LARGE
 public static final byte SIZE_LARGE
 o SIZE_HUGE
 public static final byte SIZE_HUGE
 o SIZE_GIANT
 public static final byte SIZE_GIANT
 o LOC_COUNT
 public static int LOC_COUNT
 o LOC_NONE
 public static final byte LOC_NONE
 o LOC_HEAD
 public static final byte LOC_HEAD
 o LOC_SHOULDERS
 public static final byte LOC_SHOULDERS
 o LOC_TORSO
 public static final byte LOC_TORSO
 o LOC_ARMS
 public static final byte LOC_ARMS
 o LOC_WAIST
 public static final byte LOC_WAIST
 o LOC_HIPS
 public static final byte LOC_HIPS
 o LOC_THIGHS
 public static final byte LOC_THIGHS
 o LOC_SHINS
 public static final byte LOC_SHINS
 o LOC_FEET
 public static final byte LOC_FEET
 o LOC_NECK
 public static final byte LOC_NECK
 o LOC_WRISTS
 public static final byte LOC_WRISTS
 o LOC_FINGER
 public static final byte LOC_FINGER
 o LOC_HANDS
 public static final byte LOC_HANDS
 o LOC_BUCKLER
 public static final byte LOC_BUCKLER
 o LOC_LEFT_HAND
 public static final byte LOC_LEFT_HAND
 o LOC_RIGHT_HAND
 public static final byte LOC_RIGHT_HAND

Constructors

 o PC
 protected PC()
Constructor (protected)

Methods

 o createPC
 public static PC createPC()
Public factory.

 o init
 protected void init()
Initializer for new PCs.

Overrides:
init in class Thing
 o getSize
 public byte getSize()
Get the PC size

 o setSize
 public void setSize(byte size)
Set the PC size

 o getSkill
 public Skill getSkill(Skill find_skill)
Get the PC's skill by an existing skill's type. If the PC doesn't know this skill, transparently substitute the parent skill.

 o getSkill
 public Skill getSkill(String skill_name)
Get the skill by class name.

 o addSkill
 public boolean addSkill(Skill skill)
Add a skill.

 o removeSkill
 public void removeSkill(Skill skill)
Remove the specified skill

 o removeSkill
 public void removeSkill(String skill_name)
Remove the specified skill

 o getBaseMana
 public int getBaseMana()
Get the base mana

 o setBaseMana
 public void setBaseMana(int mana)
Set the base mana

 o getMana
 public int getMana()
Get the current mana

 o setMana
 public void setMana(int mana)
Set the current mana

 o getHealRate
 public int getHealRate()
Get the heal rate (hits healed per minute)

 o setHealRate
 public void setHealRate(int rate)
Set the heal rate

 o getManaRate
 public int getManaRate()
Get the mana recharge rate (mana per minute)

 o setManaRate
 public void setManaRate(int rate)
Set the mana recharge rate

 o getNaturalWeapons
 public Vector getNaturalWeapons()
Get natural weapons

 o addNaturalWeapon
 public void addNaturalWeapon(Weapon weapon)
Add a natural weapon

 o removeNaturalWeapon
 public void removeNaturalWeapon(Weapon weapon)
Remove a natural weapon

 o getGroup
 public Group getGroup()
Get the current group.

 o leaveGroup
 public void leaveGroup()
Remove the PC from the current group.

 o joinGroup
 public void joinGroup(Group spec)
Join the specified group.

 o die
 public void die()
Die

 o hurt
 public void hurt(int damage)
Hurt the PC

 o heal
 public void heal(int points)
Heal the PC

 o drain
 public void drain(int mana)
Drain mana (due to spell, effect, etc)

 o restoreMana
 public void restoreMana(int mana)
Restore mana

 o run
 public void run()
Status thread.

 o getCapacity
 public int getCapacity()
Get max capacity. (str * 10) OVERRIDE METHOD.

Overrides:
getCapacity in class Thing
 o getValue
 public int getValue()
Get value. Most PCs can't have value (no slavery).

Overrides:
getValue in class Thing
 o roll
 public int roll(String skill_name,
                 int mod)
Perform a skill roll. Account for skill defaulting.

 o getWielded
 public Weapon getWielded()
Get the wielded weapon.

 o getArmor
 public Armor getArmor(byte loc)
Get the armor at the given location

 o doAttack
 public Attack doAttack(Attackable target)
Attack another attackable

 o attack
 public void attack(Attack attack)
Determine what happens when this PC gets attacked (is the defender) Implements Attackable.attack(Attack) Should be overridden by children (such as NPCs for hate lists).

 o createRows
 protected void createRows()
Create rows to save PC

Overrides:
createRows in class Thing
 o store
 public void store()
Store this object in the database

Overrides:
store in class Thing
 o loadPC
 public static PC loadPC(int id)
Load PC object

 o load
 protected void load()
Load this instance.

Overrides:
load in class Thing
 o unregister
 public void unregister()
Remove the PC from the database.

Overrides:
unregister in class Thing
 o main
 public static void main(String args[])
Tester


All Packages  Class Hierarchy  This Package  Previous  Next  Index