|
|||||||||
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
atavism.agis.arenas.DeathmatchArena
public class DeathmatchArena
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 |
DeathmatchArena.ArenaCleanup
Teleports all players out and then sends out a message to remove this arena instance from the Map stored in the ArenaPlugin. |
class |
DeathmatchArena.ArenaCountdown
|
class |
DeathmatchArena.ArenaEnd
The class to handle when the arenas timer has expired. |
class |
DeathmatchArena.ArenaReady
|
class |
DeathmatchArena.ArenaStart
Starts the arena. |
class |
DeathmatchArena.CollisionCheck
Iterates through every player in the arena and compares their location to all the other players in the other teams. |
Field Summary |
---|
Fields inherited from class atavism.agis.arenas.Arena |
---|
arenaDatabaseID, arenaGameType, arenaID, arenaName, arenaObjects, category, centreY, defeatPayment, defeatXP, goalType, instanceOid, instanceTemplateID, length, numTeams, PLAYER_IMMUNE, PLAYER_INACTIVE, PROP_HEALTH, PROP_MAX_HEALTH, PROP_WEAPON, scheduledExecutioner, startTime, state, STATE_END, STATE_RUNNING, STATE_SETUP, STATE_UNSET, teams, useWeapons, victoryCondition, victoryPayment, victoryXP |
Fields inherited from interface atavism.msgsys.MessageCallback |
---|
NO_FLAGS, RESPONSE_EXPECTED |
Constructor Summary | |
---|---|
DeathmatchArena(int numTeams)
The default constructor. |
|
DeathmatchArena(int numTeams,
java.util.ArrayList<ArenaQueue.QueueMember>[] members,
int type,
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 | |
---|---|
void |
activateAbility(OID playerOid,
OID targetOid,
int slot)
|
protected boolean |
addAbility(OID playerOid,
int team)
|
void |
addDotScore(OID attackerOid)
This is called whenever a pac eats a dot. |
void |
addKillScore(OID attackerOid,
OID victimOid)
This will be called whenever one player kills another. |
protected boolean |
addPowerup(ArenaMember member,
int playerTeam)
|
protected void |
alterTeamScore(int team,
int score)
Add the score to the teams score. |
protected boolean |
canPlaceObject(int x,
int z)
|
void |
completeTutorial(OID oid)
|
protected java.util.LinkedList<java.lang.Integer> |
getAbilityList(int team)
|
protected int |
getGridXTile(float f)
|
protected int |
getGridZTile(float f)
|
protected java.util.LinkedList<java.lang.Integer> |
getPowerupList(int team)
|
void |
handleDeath(OID attackerOid,
OID victimOid)
|
void |
handleMessage(Message msg,
int flags)
process network messages |
protected boolean |
placeObjectInGrid(int x,
int z,
java.lang.Object object)
|
void |
releaseRequest(OID playerOid)
|
protected boolean |
removeObjectFromGrid(int x,
int z,
java.lang.Object object)
|
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 |
setup()
This is run once the Arena object is created. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DeathmatchArena(int numTeams)
numTeams:
- the number of teams in the arenapublic DeathmatchArena(int numTeams, java.util.ArrayList<ArenaQueue.QueueMember>[] members, int type, 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()
setup
in class Arena
public void handleMessage(Message msg, int flags)
handleMessage
in interface MessageCallback
handleMessage
in class Arena
msg
- Message sent from other agent.flags
- Bitwise OR of MessageCallback.NO_FLAGS
, MessageCallback.RESPONSE_EXPECTED
.protected boolean addAbility(OID playerOid, int team)
addAbility
in class Arena
protected boolean addPowerup(ArenaMember member, int playerTeam)
protected boolean canPlaceObject(int x, int z)
protected boolean placeObjectInGrid(int x, int z, java.lang.Object object)
protected boolean removeObjectFromGrid(int x, int z, java.lang.Object object)
protected int getGridXTile(float f)
protected int getGridZTile(float f)
public void handleDeath(OID attackerOid, OID victimOid)
handleDeath
in class Arena
public void addKillScore(OID attackerOid, OID victimOid)
addKillScore
in class Arena
attackerOid:
- the oid of the attackervictimOid:
- the oid of the victimpublic void addDotScore(OID attackerOid)
attackerOid:
- the oid of the pac who ate the dotpublic void releaseRequest(OID playerOid)
releaseRequest
in class Arena
public void completeTutorial(OID oid)
completeTutorial
in class Arena
protected java.util.LinkedList<java.lang.Integer> getAbilityList(int team)
protected java.util.LinkedList<java.lang.Integer> getPowerupList(int team)
protected void alterTeamScore(int team, int score)
alterTeamScore
in class Arena
team:
- Which team to add score to.score:
- Score value to add. Can be negative.public boolean sendMessageSingle(java.lang.String msgType, OID oid, java.io.Serializable data)
sendMessageSingle
in class Arena
msgType:
- the message typeoid:
- the oid to send the message todata:
- some form of data to be sentpublic void activateAbility(OID playerOid, OID targetOid, int slot)
activateAbility
in class Arena
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |