jurpe.system
Class CoreCommands

java.lang.Object
  extended by jurpe.system.CoreHandles
      extended by jurpe.system.CoreCommands
Direct Known Subclasses:
Core

public abstract class CoreCommands
extends CoreHandles

Core related commands


Constructor Summary
CoreCommands()
           
 
Method Summary
 boolean addSkill(Skill skillToAdd)
          Add Skill to Playing Character.
 void cancelCharacter()
          Reset current Playing Character.
 boolean continueCombat()
          After having initialized Combat and TurnTable objects, this method return false until combat is ended.
 void enterCombatWith(java.lang.String monsterName)
          Starts a combat session.
 void enterHighScore()
          Saves high score
 boolean executeCommand(CommandSequence cs)
          Executes combat command(s).
 int firstAid(PCharacter pc, int sk, int tl)
          Get First Aid regained health points.
 BasicItem generateItem(ItemValueType ivt)
          Generate a random item
 Monster generateMonster(int value)
          Creates a random monster, with a random name.
 void generatePC(CharacterAttributes crpc)
          Creates a new Playing Character
 float getImprovingSkillCost(java.lang.String skillName)
          Get how much points an improvement of one level for a Skill costs
 float getSkillCost(java.lang.String skillName, int level)
          Get how much points a Skill costs it's valued, or the initial points needed to learn a skill
 void loadHighScores()
          Loads High Score Table.
 boolean loadPC(java.lang.String pcName)
          Restore serialized PCharacter.
 void playerDies()
          Procedure of current character death.
 void saveHighScores()
          Serialize High Scores
 boolean savePC()
          Serialize Playing Character and his references (Inventory, Skills and such)
 boolean savePC(java.lang.String namepath)
          Serialize Playing Character and his references (Inventory, Skills and such) Extension is taken from Config file.
 
Methods inherited from class jurpe.system.CoreHandles
getCombat, getDungeon, getHighScores, getInn, getLog, getPC, getShop, getSkills, getTurnTable, isPCgenerated, operatingSystem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoreCommands

public CoreCommands()
Method Detail

executeCommand

public boolean executeCommand(CommandSequence cs)
Executes combat command(s).

Parameters:
cs - CommandString to execute
Returns:
String with results in output (log)
See Also:
CommandSequence

getSkillCost

public float getSkillCost(java.lang.String skillName,
                          int level)
Get how much points a Skill costs it's valued, or the initial points needed to learn a skill

Parameters:
skillName - Skill name
level - Skill level
Returns:
points needed
See Also:
Skill

getImprovingSkillCost

public float getImprovingSkillCost(java.lang.String skillName)
Get how much points an improvement of one level for a Skill costs

Parameters:
skillName - name of Skill
Returns:
points needed
See Also:
Skill

addSkill

public boolean addSkill(Skill skillToAdd)
Add Skill to Playing Character. When character learns a new skill, this is automatically improved until this operation costs some character points (until improving it's free).

Parameters:
skillToAdd - Skill to Add to Playing Character
Returns:
false if skill was already learned by character.

firstAid

public int firstAid(PCharacter pc,
                    int sk,
                    int tl)
Get First Aid regained health points.

Parameters:
pc - PCharacter to be aided
sk - PCharacter Skill Level in First Aid
tl - Tech Level of the Game World
Returns:
gained HP

generateItem

public BasicItem generateItem(ItemValueType ivt)
                       throws JurpeException
Generate a random item

Parameters:
ivt - Rarity of item to generate
Returns:
A newly created random item
Throws:
JurpeException

generatePC

public void generatePC(CharacterAttributes crpc)
Creates a new Playing Character

Parameters:
crpc - Main character attributes for the character to create.

generateMonster

public Monster generateMonster(int value)
Creates a random monster, with a random name.

Parameters:
value - total starting points assigned to the new character
Returns:
newly generated monster

savePC

public boolean savePC()
Serialize Playing Character and his references (Inventory, Skills and such)

Returns:
true if character has been correctly saved

savePC

public boolean savePC(java.lang.String namepath)
Serialize Playing Character and his references (Inventory, Skills and such) Extension is taken from Config file.

Parameters:
namepath - complete path where you want to save your character, without extension.
Returns:
true if character has been correctly saved.

loadPC

public boolean loadPC(java.lang.String pcName)
               throws JurpeException
Restore serialized PCharacter.

Parameters:
pcName - complete path to file with extension.
Returns:
true if character has been correctly restored.
Throws:
JurpeException

loadHighScores

public void loadHighScores()
Loads High Score Table. If it's not present, it loads a default one.


saveHighScores

public void saveHighScores()
Serialize High Scores


enterHighScore

public void enterHighScore()
Saves high score


enterCombatWith

public void enterCombatWith(java.lang.String monsterName)
                     throws JurpeException
Starts a combat session. Updates TurnTable

Parameters:
monsterName - Name of the monster to fight
Throws:
JurpeException

continueCombat

public boolean continueCombat()
                       throws JurpeException
After having initialized Combat and TurnTable objects, this method return false until combat is ended.

Returns:
true, if next player is human (control is returned to GUI) or combat is ended
Throws:
JurpeException

cancelCharacter

public void cancelCharacter()
Reset current Playing Character. Usually when PC dies.


playerDies

public void playerDies()
Procedure of current character death.


Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net