|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjurpe.combat.DualCombat
public class DualCombat
Class for combat between PCs. Every instance of DualCombat represents an
entire combat, from the beginning to the end. Variabile "isAlive" check if
current combat is still taking place. For instance, in a combat between JOE
and JAK we will have:
DualCombat combat = new DualCombat(Joe, Jak); // Joe vs. JackRemember to swap fighters at the end of every turn with combat.swapFighters()
Combat
Field Summary |
---|
Fields inherited from interface jurpe.combat.ICombat |
---|
AVAILABLE_COMBAT_COMMANDS, CM_AIM, CM_ALLOATT, CM_ALLODEF, CM_ATTAK, CM_MOVE, CM_RDYWPN, CM_RELOAD |
Constructor Summary | |
---|---|
DualCombat()
Creates a random, default Dual Combat for test purposes. |
|
DualCombat(TurnTable tt)
Constructor. |
Method Summary | |
---|---|
boolean |
aim()
Aim combat option |
boolean |
allOutAttack()
All Out Attack (AOA) combat option. |
boolean |
allOutDefense()
All Out Defense combat option. |
boolean |
attack()
Attack routine for DualCombat. |
float |
earnedExperiencePoints()
Returns the experience points earned in this combat. |
int |
earnedScore(int turnsPlayed)
Returns the score points earned in this combat. |
PC |
getFightee()
Get Fightee (first attacked) in this DualCombat |
PC |
getFighter()
Get Fighter (first attacker) in this DualCombat |
PCharacter |
getHumanFighter()
In a DualCombat one of the combatants could be a PCharacter. |
Monster |
getMonsterFighter()
In a DualCombat one of the combatants could be a Monster. |
TurnTable |
getTurnTable()
Return Turn Table associated with this DualCombat |
boolean |
isAlive()
Return true combat is alive (ie: will not terminate next turn). |
java.lang.String |
log()
Returns log, appending LINEFEED after every item. |
boolean |
move()
Combatants use this command to try to escape. |
boolean |
readyWeapon()
Ready Weapon combat option. |
boolean |
reload()
Reload combat option. |
void |
setAlive(boolean alive)
Use this method to quit a combat when combatants are still living. |
void |
setFighters(PC fighter,
PC fightee)
Set fighters. |
void |
swapFighters()
Call this method at the end of every combat turn, if combatants are still alive. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DualCombat()
public DualCombat(TurnTable tt)
tt
- is the active TurnTableTurnTable
Method Detail |
---|
public PC getFightee()
PC
public PCharacter getHumanFighter()
public Monster getMonsterFighter()
public TurnTable getTurnTable()
TurnTable
public PC getFighter()
PC
public void swapFighters()
public void setFighters(PC fighter, PC fightee)
fighter
- PC who is making the attackfightee
- PC who is defendingpublic boolean isAlive()
public void setAlive(boolean alive)
alive
- set boolean condition. If true, character is alive.public boolean move()
move
in interface ICombat
public boolean readyWeapon()
readyWeapon
in interface ICombat
public boolean reload()
reload
in interface ICombat
public boolean aim()
aim
in interface ICombat
public boolean attack()
attack
in interface ICombat
public boolean allOutAttack()
allOutAttack
in interface ICombat
public boolean allOutDefense()
allOutDefense
in interface ICombat
public java.lang.String log()
log
in interface ICombat
public int earnedScore(int turnsPlayed)
turnsPlayed
- number of turns played in this combat
public float earnedExperiencePoints()
|
Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |