Groovy Documentation

de.dewarim.goblin
[Groovy] Class MeleeService

java.lang.Object
  de.dewarim.goblin.MeleeService

class MeleeService

Property Summary
java.lang.Object featureService

java.lang.Object globalConfigService

java.lang.Object itemService

java.lang.Object playerMessageService

java.lang.Object tr

 
Constructor Summary
MeleeService()

 
Method Summary
MeleeAction addAttackAction(java.lang.Object pc, java.lang.Object opponent)

MeleeAction addUseItemAction(java.lang.Object pc, java.lang.Object opponent, java.lang.Object item, java.lang.Object itemTypeFeature)

void attack(MeleeAction action)

java.lang.Boolean checkAdversary(PlayerCharacter pc, PlayerCharacter opponent)

void checkOpponentAlive(java.lang.Object pc, java.lang.Object adversary)

MeleeAction createDefaultAction(MeleeFighter mf, java.util.Map pcFighters)

The default action is to attack the first player available who is not the current player.

Melee createMelee()

void executeAction(MeleeAction action)

MeleeAction fetchAction(java.lang.Object pc)

@return a player's current meleeAction (or null if he has not selected one yet)

MeleeFighter fetchMeleeFighter(java.lang.Object pc)

@param pc the PlayerCharacter whose MeleeFighter entry you need.

java.lang.Boolean fightIsOver(Melee melee)

void fightMelee(Melee melee)

Melee findOrCreateMelee()

MeleeFighter joinMelee(PlayerCharacter pc, Melee melee)

void leaveMelee(PlayerCharacter pc, Melee melee)

java.util.List listFighters(Melee melee)

java.lang.Boolean meleeIsReady(Melee melee)

java.lang.Boolean newFighterAllowed(PlayerCharacter pc, Melee melee)

Check if a player character is already on the team or has quit previously (by leaving or dying).

void notifyPlayerOfDeath(java.lang.Object pc, java.lang.Object adversary)

Send a "you are dead"-message to the player.

void notifyPlayerOfVictory(java.lang.Object pc, java.lang.Object adversary)

Send a "X is dead"-message to the survivor.

void notifyWinner(Melee melee)

java.util.List rollInitiative(java.util.Map pcFighters)

Compute the initiative value for all living fighters.

void startMelee(Melee melee)

void updateFighters(Melee melee)

void useItem(MeleeAction action)

Use an item during a melee fight.

java.lang.Boolean verifyPcIsActiveFighter(java.lang.Object pc, java.lang.Object melee)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

featureService

java.lang.Object featureService


globalConfigService

java.lang.Object globalConfigService


itemService

java.lang.Object itemService


playerMessageService

java.lang.Object playerMessageService


tr

java.lang.Object tr


 
Constructor Detail

MeleeService

MeleeService()


 
Method Detail

addAttackAction

MeleeAction addAttackAction(java.lang.Object pc, java.lang.Object opponent)


addUseItemAction

MeleeAction addUseItemAction(java.lang.Object pc, java.lang.Object opponent, java.lang.Object item, java.lang.Object itemTypeFeature)


attack

void attack(MeleeAction action)


checkAdversary

java.lang.Boolean checkAdversary(PlayerCharacter pc, PlayerCharacter opponent)


checkOpponentAlive

void checkOpponentAlive(java.lang.Object pc, java.lang.Object adversary)


createDefaultAction

MeleeAction createDefaultAction(MeleeFighter mf, java.util.Map pcFighters)
The default action is to attack the first player available who is not the current player. Note: this means a player can attack another with a higher initiative.


createMelee

Melee createMelee()


executeAction

void executeAction(MeleeAction action)


fetchAction

MeleeAction fetchAction(java.lang.Object pc)
Returns:
a player's current meleeAction (or null if he has not selected one yet)


fetchMeleeFighter

MeleeFighter fetchMeleeFighter(java.lang.Object pc)
Parameters:
pc - the PlayerCharacter whose MeleeFighter entry you need.
Returns:
the MeleeFighter entry for the player character and his current melee (or null).


fightIsOver

java.lang.Boolean fightIsOver(Melee melee)


fightMelee

void fightMelee(Melee melee)


findOrCreateMelee

Melee findOrCreateMelee()


joinMelee

MeleeFighter joinMelee(PlayerCharacter pc, Melee melee)


leaveMelee

void leaveMelee(PlayerCharacter pc, Melee melee)


listFighters

java.util.List listFighters(Melee melee)


meleeIsReady

java.lang.Boolean meleeIsReady(Melee melee)


newFighterAllowed

java.lang.Boolean newFighterAllowed(PlayerCharacter pc, Melee melee)
Check if a player character is already on the team or has quit previously (by leaving or dying).


notifyPlayerOfDeath

void notifyPlayerOfDeath(java.lang.Object pc, java.lang.Object adversary)
Send a "you are dead"-message to the player.


notifyPlayerOfVictory

void notifyPlayerOfVictory(java.lang.Object pc, java.lang.Object adversary)
Send a "X is dead"-message to the survivor.


notifyWinner

void notifyWinner(Melee melee)


rollInitiative

java.util.List rollInitiative(java.util.Map pcFighters)
Compute the initiative value for all living fighters.
Returns:
a list of MeleeActions sorted by initiative from highest to lowest.


startMelee

void startMelee(Melee melee)


updateFighters

void updateFighters(Melee melee)


useItem

void useItem(MeleeAction action)
Use an item during a melee fight. If the selected feature is not available for one reason or another, the player gets a message and forfeits his action.


verifyPcIsActiveFighter

java.lang.Boolean verifyPcIsActiveFighter(java.lang.Object pc, java.lang.Object melee)


 

Groovy Documentation