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.
-
base_mana
-
-
bStatus
-
-
cur_mana
-
-
group
-
-
heal_rate
-
-
LOC_ARMS
-
-
LOC_BUCKLER
-
-
LOC_COUNT
-
-
LOC_FEET
-
-
LOC_FINGER
-
-
LOC_HANDS
-
-
LOC_HEAD
-
-
LOC_HIPS
-
-
LOC_LEFT_HAND
-
-
LOC_NECK
-
-
LOC_NONE
-
-
LOC_RIGHT_HAND
-
-
LOC_SHINS
-
-
LOC_SHOULDERS
-
-
LOC_THIGHS
-
-
LOC_TORSO
-
-
LOC_WAIST
-
-
LOC_WRISTS
-
-
mana_rate
-
-
natural_weapon
-
-
size
-
-
SIZE_ANY
-
-
SIZE_GIANT
-
-
SIZE_HUGE
-
-
SIZE_LARGE
-
-
SIZE_MAN
-
-
SIZE_SMALL
-
-
SIZE_TINY
-
-
skills
-
-
tStatus
-
-
PC()
- Constructor (protected)
-
addNaturalWeapon(Weapon)
- Add a natural weapon
-
addSkill(Skill)
- Add a skill.
-
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).
-
createPC()
- Public factory.
-
createRows()
- Create rows to save PC
-
die()
- Die
-
doAttack(Attackable)
- Attack another attackable
-
drain(int)
- Drain mana (due to spell, effect, etc)
-
getArmor(byte)
- Get the armor at the given location
-
getBaseMana()
- Get the base mana
-
getCapacity()
- Get max capacity.
-
getGroup()
- Get the current group.
-
getHealRate()
- Get the heal rate (hits healed per minute)
-
getMana()
- Get the current mana
-
getManaRate()
- Get the mana recharge rate (mana per minute)
-
getNaturalWeapons()
- Get natural weapons
-
getSize()
- Get the PC size
-
getSkill(Skill)
- Get the PC's skill by an existing skill's type.
-
getSkill(String)
- Get the skill by class name.
-
getValue()
- Get value.
-
getWielded()
- Get the wielded weapon.
-
heal(int)
- Heal the PC
-
hurt(int)
- Hurt the PC
-
init()
- Initializer for new PCs.
-
joinGroup(Group)
- Join the specified group.
-
leaveGroup()
- Remove the PC from the current group.
-
load()
- Load this instance.
-
loadPC(int)
- Load PC object
-
main(String[])
- Tester
-
removeNaturalWeapon(Weapon)
- Remove a natural weapon
-
removeSkill(Skill)
- Remove the specified skill
-
removeSkill(String)
- Remove the specified skill
-
restoreMana(int)
- Restore mana
-
roll(String, int)
- Perform a skill roll.
-
run()
- Status thread.
-
setBaseMana(int)
- Set the base mana
-
setHealRate(int)
- Set the heal rate
-
setMana(int)
- Set the current mana
-
setManaRate(int)
- Set the mana recharge rate
-
setSize(byte)
- Set the PC size
-
store()
- Store this object in the database
-
unregister()
- Remove the PC from the database.
tStatus
protected transient Thread tStatus
bStatus
protected transient boolean bStatus
skills
protected Vector skills
base_mana
protected int base_mana
cur_mana
protected int cur_mana
heal_rate
protected int heal_rate
mana_rate
protected int mana_rate
natural_weapon
protected Vector natural_weapon
group
protected Group group
size
protected byte size
SIZE_ANY
public static final byte SIZE_ANY
SIZE_TINY
public static final byte SIZE_TINY
SIZE_SMALL
public static final byte SIZE_SMALL
SIZE_MAN
public static final byte SIZE_MAN
SIZE_LARGE
public static final byte SIZE_LARGE
SIZE_HUGE
public static final byte SIZE_HUGE
SIZE_GIANT
public static final byte SIZE_GIANT
LOC_COUNT
public static int LOC_COUNT
LOC_NONE
public static final byte LOC_NONE
LOC_HEAD
public static final byte LOC_HEAD
LOC_SHOULDERS
public static final byte LOC_SHOULDERS
LOC_TORSO
public static final byte LOC_TORSO
LOC_ARMS
public static final byte LOC_ARMS
LOC_WAIST
public static final byte LOC_WAIST
LOC_HIPS
public static final byte LOC_HIPS
LOC_THIGHS
public static final byte LOC_THIGHS
LOC_SHINS
public static final byte LOC_SHINS
LOC_FEET
public static final byte LOC_FEET
LOC_NECK
public static final byte LOC_NECK
LOC_WRISTS
public static final byte LOC_WRISTS
LOC_FINGER
public static final byte LOC_FINGER
LOC_HANDS
public static final byte LOC_HANDS
LOC_BUCKLER
public static final byte LOC_BUCKLER
LOC_LEFT_HAND
public static final byte LOC_LEFT_HAND
LOC_RIGHT_HAND
public static final byte LOC_RIGHT_HAND
PC
protected PC()
- Constructor (protected)
createPC
public static PC createPC()
- Public factory.
init
protected void init()
- Initializer for new PCs.
- Overrides:
- init in class Thing
getSize
public byte getSize()
- Get the PC size
setSize
public void setSize(byte size)
- Set the PC size
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.
getSkill
public Skill getSkill(String skill_name)
- Get the skill by class name.
addSkill
public boolean addSkill(Skill skill)
- Add a skill.
removeSkill
public void removeSkill(Skill skill)
- Remove the specified skill
removeSkill
public void removeSkill(String skill_name)
- Remove the specified skill
getBaseMana
public int getBaseMana()
- Get the base mana
setBaseMana
public void setBaseMana(int mana)
- Set the base mana
getMana
public int getMana()
- Get the current mana
setMana
public void setMana(int mana)
- Set the current mana
getHealRate
public int getHealRate()
- Get the heal rate (hits healed per minute)
setHealRate
public void setHealRate(int rate)
- Set the heal rate
getManaRate
public int getManaRate()
- Get the mana recharge rate (mana per minute)
setManaRate
public void setManaRate(int rate)
- Set the mana recharge rate
getNaturalWeapons
public Vector getNaturalWeapons()
- Get natural weapons
addNaturalWeapon
public void addNaturalWeapon(Weapon weapon)
- Add a natural weapon
removeNaturalWeapon
public void removeNaturalWeapon(Weapon weapon)
- Remove a natural weapon
getGroup
public Group getGroup()
- Get the current group.
leaveGroup
public void leaveGroup()
- Remove the PC from the current group.
joinGroup
public void joinGroup(Group spec)
- Join the specified group.
die
public void die()
- Die
hurt
public void hurt(int damage)
- Hurt the PC
heal
public void heal(int points)
- Heal the PC
drain
public void drain(int mana)
- Drain mana (due to spell, effect, etc)
restoreMana
public void restoreMana(int mana)
- Restore mana
run
public void run()
- Status thread.
getCapacity
public int getCapacity()
- Get max capacity. (str * 10)
OVERRIDE METHOD.
- Overrides:
- getCapacity in class Thing
getValue
public int getValue()
- Get value. Most PCs can't have value (no slavery).
- Overrides:
- getValue in class Thing
roll
public int roll(String skill_name,
int mod)
- Perform a skill roll. Account for skill defaulting.
getWielded
public Weapon getWielded()
- Get the wielded weapon.
getArmor
public Armor getArmor(byte loc)
- Get the armor at the given location
doAttack
public Attack doAttack(Attackable target)
- Attack another attackable
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).
createRows
protected void createRows()
- Create rows to save PC
- Overrides:
- createRows in class Thing
store
public void store()
- Store this object in the database
- Overrides:
- store in class Thing
loadPC
public static PC loadPC(int id)
- Load PC object
load
protected void load()
- Load this instance.
- Overrides:
- load in class Thing
unregister
public void unregister()
- Remove the PC from the database.
- Overrides:
- unregister in class Thing
main
public static void main(String args[])
- Tester
All Packages Class Hierarchy This Package Previous Next Index