|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.agis.arenas.Arena
public abstract class Arena
The Arena class handles an arena instance. It has numerous scheduled executors and a state variable to control the flow of the arena from setup to the end. This class is complete, it relies on no other class to perform it's duties.
Nested Class Summary | |
---|---|
class |
Arena.ArenaCleanup
Teleports all players out and then sends out a message to remove this arena instance from the Map stored in the ArenaPlugin. |
class |
Arena.ArenaEnd
The class to handle when the arenas timer has expired. |
class |
Arena.ArenaStart
Starts the arena. |
Field Summary | |
---|---|
protected int |
arenaDatabaseID
|
protected int |
arenaGameType
|
protected int |
arenaID
|
protected java.lang.String |
arenaName
|
protected java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Integer,ArenaObject>> |
arenaObjects
|
protected int |
category
|
protected static int |
centreX
|
protected static int |
centreY
|
protected static int |
centreZ
|
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> |
defeatPayment
|
protected int |
defeatXP
|
protected int |
goalType
|
protected static int |
gridSize
|
protected OID |
instanceOid
|
protected int |
instanceTemplateID
|
protected int |
length
|
protected int |
numTeams
|
protected static int |
PLAYER_IMMUNE
|
protected static int |
PLAYER_INACTIVE
|
static java.lang.String |
PROP_HEALTH
|
protected static java.lang.String |
PROP_MAX_HEALTH
|
static java.lang.String |
PROP_WEAPON
|
protected java.util.concurrent.ScheduledFuture<?> |
scheduledExecutioner
|
protected int |
startTime
|
protected int |
state
Status of the arena 0: Not yet set 1: Starting 2: Running 3: Ending |
protected static int |
STATE_END
|
protected static int |
STATE_RUNNING
|
protected static int |
STATE_SETUP
|
protected static int |
STATE_UNSET
|
protected ArenaTeam[] |
teams
|
protected boolean |
useWeapons
|
protected int |
victoryCondition
|
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> |
victoryPayment
|
protected int |
victoryXP
|
Fields inherited from interface atavism.msgsys.MessageCallback |
---|
NO_FLAGS, RESPONSE_EXPECTED |
Constructor Summary | |
---|---|
Arena()
|
|
Arena(int numTeams)
The default constructor. |
|
Arena(int numTeams,
java.util.ArrayList<ArenaQueue.QueueMember>[] members,
int arenaGameType,
int arenaDatabaseID,
java.lang.String arenaName,
int category,
int dur,
int[] goals,
java.lang.String[] teamNames,
Point[] spawnPoints,
int condition,
int id,
int[] minPlayers,
int instanceTemplateID,
java.util.HashMap<java.lang.Integer,java.lang.Integer> victoryPayment,
java.util.HashMap<java.lang.Integer,java.lang.Integer> defeatPayment,
int victoryExp,
int defeatExp,
boolean useWeapons)
Constructor that takes in two lists that contain the oids of the players on each team. |
Method Summary | |
---|---|
abstract void |
activateAbility(OID playerOid,
OID targetOid,
int slot)
|
void |
activateMachine(OID oid,
int machineID)
|
protected abstract boolean |
addAbility(OID playerOid,
int team)
|
void |
addArenaObject(ArenaObject aObject)
|
protected boolean |
addHealth(ArenaMember member)
|
protected void |
addIndividualDeath(int team,
OID oid,
int adjustment)
Add the score to the players individual score. |
protected void |
addIndividualKill(int team,
OID oid,
int adjustment)
Add the score to the players individual score. |
protected void |
addIndividualScore(int team,
OID oid,
int score)
Add the score to the players individual score. |
void |
addKillScore(OID attackerOid,
OID victimOid)
This will be called whenever one player kills another. |
protected boolean |
addWeapon(ArenaMember member,
java.lang.String objectType)
|
protected abstract void |
alterTeamScore(int team,
int score)
Add the score to the teams score. |
protected void |
changePlayerRace(ArenaMember member,
java.lang.String race,
boolean temporary)
|
abstract void |
completeTutorial(OID oid)
|
protected void |
createSubs()
Creates a subscription for each player so we can catch their damage messages. |
protected void |
despawnGates()
|
int |
getArenaCategory()
|
int |
getArenaID()
|
OID |
getArenaInstanceOid()
|
ArenaMember |
getArenaPlayer(OID oid)
|
int |
getArenaType()
|
int |
getInstanceTemplateID()
|
int |
getLength()
|
java.util.LinkedList<java.lang.Integer> |
getOpposingTeams(int team)
|
int |
getPlayerTeam(OID oid)
Searches the target team for the index of the player |
int |
getState()
|
ArenaTeam |
getTeam(int team)
|
ArenaTeam[] |
getTeams()
|
protected java.util.ArrayList<java.lang.String> |
getUsableSkins()
Gets the list of skins the member can use. |
void |
handleDeath(OID attackerOid,
OID victimOid)
|
void |
handleMessage(Message msg,
int flags)
process network messages |
protected void |
logArenaResult(int winningTeam)
|
abstract void |
releaseRequest(OID playerOid)
|
void |
removePlayer(OID oid,
boolean teleport)
Removes a player from the arena. |
void |
sendAbilities(OID playerOid)
|
protected void |
sendChatMessageAll(java.lang.String msg)
Calls sendChatMessageTeam for each team in the arena. |
protected void |
sendChatMessageSingle(java.lang.String msg,
OID oid)
Sends the specified chat message to the specified player |
protected void |
sendChatMessageTeam(java.lang.String msg,
int team)
Calls sendChatMessageSingle for each player in the specified team. |
void |
sendMessageAll(java.lang.String msgType,
java.io.Serializable data)
Calls sendMessageTeam for each team in the arena. |
boolean |
sendMessageSingle(java.lang.String msgType,
OID oid,
java.io.Serializable data)
Sends an extension message of the specified type to the specified player |
void |
sendMessageTeam(java.lang.String msgType,
int team,
java.io.Serializable data)
Calls sendMessageSingle for each member in the specified team. |
protected void |
sendStatMessageAll(java.lang.String msgType,
int team,
OID oid,
java.lang.String stat,
int score)
Calls sendStateMessageSingle for each player in the arena. |
protected void |
sendStatMessageSingle(java.lang.String msgType,
OID oid,
int team,
OID scoreOid,
java.lang.String stat,
int score)
Sends a stat update extension message to the specified player. |
void |
setArenaCategory(int category)
|
void |
setArenaID(int arenaID)
|
void |
setArenaInstanceOid(OID instanceOid)
|
void |
setArenaType(int arenaGameType)
|
void |
setInstanceTemplateID(int instanceTemplateID)
|
void |
setLength(int length)
|
void |
setPlayerProperty(OID oid,
java.lang.String prop,
java.io.Serializable value)
Sends a property message with the given properties for the player. |
void |
setPlayerSkin(OID oid,
java.lang.String race)
|
protected void |
setPlayerTeamColour(OID oid,
int teamColour)
|
void |
setState(int state)
|
void |
setTeams(ArenaTeam[] teams)
|
void |
setup()
This is run once the Arena object is created. |
protected void |
teleportAllBase()
Teleports all players back to their bases. |
protected void |
teleportAllOut()
Goes through all the players in the arena and calls teleportOut. |
protected void |
teleportOut(OID oid)
Teleports the specified player out of the instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int numTeams
protected int arenaID
protected int arenaDatabaseID
protected int arenaGameType
protected int category
protected java.lang.String arenaName
protected OID instanceOid
protected int length
protected int startTime
protected int instanceTemplateID
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> victoryPayment
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> defeatPayment
protected int victoryXP
protected int defeatXP
protected boolean useWeapons
protected java.util.concurrent.ScheduledFuture<?> scheduledExecutioner
protected int state
protected ArenaTeam[] teams
protected int victoryCondition
protected int goalType
protected java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Integer,ArenaObject>> arenaObjects
protected static int gridSize
protected static int centreX
protected static int centreY
protected static int centreZ
protected static final int STATE_UNSET
protected static final int STATE_SETUP
protected static final int STATE_RUNNING
protected static final int STATE_END
protected static final int PLAYER_INACTIVE
protected static final int PLAYER_IMMUNE
public static final java.lang.String PROP_HEALTH
protected static final java.lang.String PROP_MAX_HEALTH
public static final java.lang.String PROP_WEAPON
Constructor Detail |
---|
public Arena()
public Arena(int numTeams)
numTeams:
- the number of teams in the arenapublic Arena(int numTeams, java.util.ArrayList<ArenaQueue.QueueMember>[] members, int arenaGameType, int arenaDatabaseID, java.lang.String arenaName, int category, int dur, int[] goals, java.lang.String[] teamNames, Point[] spawnPoints, int condition, int id, int[] minPlayers, int instanceTemplateID, java.util.HashMap<java.lang.Integer,java.lang.Integer> victoryPayment, java.util.HashMap<java.lang.Integer,java.lang.Integer> defeatPayment, int victoryExp, int defeatExp, boolean useWeapons)
one:
- the list of oids for players on team onetwo:
- the list of oids for players on team twotype:
- the arena typedur:
- the duration of the arenagoals:
- the goal score for the teamsloc:
- the centre point of the arenaid:
- the identification number of the arenaminPlayers:
- the minimum number of players in each teamMethod Detail |
---|
public void setup()
protected java.util.ArrayList<java.lang.String> getUsableSkins()
member
- public void setPlayerSkin(OID oid, java.lang.String race)
protected void setPlayerTeamColour(OID oid, int teamColour)
protected void changePlayerRace(ArenaMember member, java.lang.String race, boolean temporary)
public java.util.LinkedList<java.lang.Integer> getOpposingTeams(int team)
protected void createSubs()
public void addArenaObject(ArenaObject aObject)
public void handleMessage(Message msg, int flags)
handleMessage
in interface MessageCallback
msg
- Message sent from other agent.flags
- Bitwise OR of MessageCallback.NO_FLAGS
, MessageCallback.RESPONSE_EXPECTED
.protected void despawnGates()
protected abstract boolean addAbility(OID playerOid, int team)
public void sendAbilities(OID playerOid)
protected boolean addHealth(ArenaMember member)
protected boolean addWeapon(ArenaMember member, java.lang.String objectType)
protected void teleportAllBase()
protected void teleportAllOut()
protected void teleportOut(OID oid)
oid:
- The oid of the player being teleported outpublic void activateMachine(OID oid, int machineID)
public void removePlayer(OID oid, boolean teleport)
oid:
- The player being removed from the arenapublic void handleDeath(OID attackerOid, OID victimOid)
public void addKillScore(OID attackerOid, OID victimOid)
attackerOid:
- the oid of the attackervictimOid:
- the oid of the victimpublic abstract void activateAbility(OID playerOid, OID targetOid, int slot)
public abstract void completeTutorial(OID oid)
protected abstract void alterTeamScore(int team, int score)
team:
- Which team to add score to.score:
- Score value to add. Can be negative.public abstract void releaseRequest(OID playerOid)
protected void addIndividualScore(int team, OID oid, int score)
team:
- the team the player belongs tooid:
- the oid of the playerscore:
- the score value to add. Can be negative.protected void addIndividualKill(int team, OID oid, int adjustment)
team:
- the team the player belongs tooid:
- the oid of the playeradjustment:
- the value to adjustment the kill variable byprotected void addIndividualDeath(int team, OID oid, int adjustment)
team:
- the team the player belongs tooid:
- the oid of the playeradjustment:
- the value to adjustment the death variable bypublic int getPlayerTeam(OID oid)
oid:
- Player object idteam:
- Which team to search
public ArenaMember getArenaPlayer(OID oid)
public void sendMessageAll(java.lang.String msgType, java.io.Serializable data)
msgType:
- the message typedata:
- some form of data to be sentpublic void sendMessageTeam(java.lang.String msgType, int team, java.io.Serializable data)
msgType:
- the message typeteam:
- the team to send the message todata:
- some form of data to be sentpublic boolean sendMessageSingle(java.lang.String msgType, OID oid, java.io.Serializable data)
msgType:
- the message typeoid:
- the oid to send the message todata:
- some form of data to be sentprotected void sendStatMessageAll(java.lang.String msgType, int team, OID oid, java.lang.String stat, int score)
msgType:
- the message typeteam:
- the team which the player whose stat is being updated is fromoid:
- the oid of the player whose stat was changedstat:
- the type of stat that was changedscore:
- the value of the stat that was changedprotected void sendStatMessageSingle(java.lang.String msgType, OID oid, int team, OID scoreOid, java.lang.String stat, int score)
msgType:
- the message typeoid:
- the oid of the player the message is being sent toteam:
- the team which the player whose stat is being updated is fromscoreOid:
- the oid of the player whose stat was changedstat:
- the type of stat that was changedscore:
- the value of the stat that was changedprotected void sendChatMessageAll(java.lang.String msg)
msg:
- the chat message to sendprotected void sendChatMessageTeam(java.lang.String msg, int team)
msg:
- the chat message to sendteam:
- the team to send the chat message toprotected void sendChatMessageSingle(java.lang.String msg, OID oid)
msg:
- the chat message to sendoid:
- the oid of the player to send the message topublic void setPlayerProperty(OID oid, java.lang.String prop, java.io.Serializable value)
oid
- props
- protected void logArenaResult(int winningTeam)
public int getArenaID()
public void setArenaID(int arenaID)
public OID getArenaInstanceOid()
public void setArenaInstanceOid(OID instanceOid)
public int getArenaType()
public void setArenaType(int arenaGameType)
public int getArenaCategory()
public void setArenaCategory(int category)
public int getLength()
public void setLength(int length)
public int getInstanceTemplateID()
public void setInstanceTemplateID(int instanceTemplateID)
public int getState()
public void setState(int state)
public ArenaTeam[] getTeams()
public void setTeams(ArenaTeam[] teams)
public ArenaTeam getTeam(int team)
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |