C# Class Aura.Channel.World.Dungeons.Dungeon

Represents a dungeon with its regions.
Show file Open project: aura-project/aura Class Usage Examples

Public Methods

Method Description
AddBoss ( int raceId, int amount = 1 ) : void

Adds boss to list of bosses to spawn.

AddChest ( Prop chest ) : void

Adds chest to list of chests to spawn.

BossDoorBehavior ( Creature _, Prop prop ) : void

Behavior for this dungeon's boss door.

CheckDoors ( ) : bool

Returns true if all doors except the boss door have been opened.

CheckSectionClear ( ) : void

Checks if any sections have just been cleared, and calls the corresponding script method.

Complete ( ) : void
CompleteManually ( bool val ) : void

Sets whether the dungeon is completed automatically once all bosses have been killed.

If set to false, the dungeon script has to handle calling Complete, otherwise the dungeon won't be completable.

CountPlayers ( ) : int

Returns amount of players in all regions that are part of the dungeon.

Dungeon ( long instanceId, string dungeonName, int itemId, int seed, int floorPlan, Creature creature ) : Aura.Channel.Network.Sending

Creates new dungeon.

GetBossRoomCenter ( ) : Location

Returns the location at the center of the boss room.

GetCreators ( ) : List

Returns creators inside the dungeon. If dungeon has roles, it gets the creators by calling GetActualCreature on the RP characters.

GetCreature ( long entityId ) : Creature

Returns the creature with the given entity id if it could be found in the dungeon's regions, otherwise it returns null.

GetEndRoomCenter ( ) : Location

Returns the location at the center of the end room, behind the boss room.

GetPlayerListScrollMessage ( ) : string

Returns the text for the player location crawler.

GetRoles ( ) : List

Returns dungeon's roles registered with SetRole, sorted by their index. 0 = leader, 1 = first other party member, etc.

GetRpCharacters ( ) : List

Returns all RP characters inside the dungeon.

GetRpCharactersOrCreators ( ) : List

Returns either all RP characters or all creators currently in the dungeon, depending on whether this is an RP dungeon or not.

InitFloorRegion ( int iRegion ) : void

Initiates floor, creating puzzles and props.

InitLobbyRegion ( int iRegion ) : void

Initiates lobby, adding behavior to the stairs and statue.

InitRegions ( ) : void

Initiates regions, spawning props

IsInside ( long entityId ) : bool

Returns true if a creature with the given id is inside this dungeon.

OnPlayerEntersLobby ( Creature creature ) : void

Called when a creature enters the lobby region.

PlayCutscene ( string cutsceneName ) : void

Plays cutscene for all party members.

PlayCutscene ( string cutsceneName, Action onFinish ) : void

Plays cutscene for all party members.

RemoveAllPlayers ( ) : void

Removes all players from dungeon.

SetRole ( int index, string actorName ) : void

Registers a role-playing character.

Private Methods

Method Description
CreatePuzzles ( int iRegion ) : void

Calls OnCreate on all of region's puzzles.

GeneratePuzzles ( int iFloor ) : void

Generates random puzzles for the floor.

GenerateRegions ( ) : void

Generates lobby and floor regions.

OnBossDeath ( Creature creature, Creature killer ) : void

Raised when one of the bosses dies.

Rotation ( int direction ) : float

Returns the radian rotation for the given dungeon direction.

TODO: Move somewhere? Direction maybe? Or an extension?

SpawnTreasureChests ( ) : void

Spawns treasure chests in treasure room.

Method Details

AddBoss() public method

Adds boss to list of bosses to spawn.
public AddBoss ( int raceId, int amount = 1 ) : void
raceId int
amount int
return void

AddChest() public method

Adds chest to list of chests to spawn.
public AddChest ( Prop chest ) : void
chest Aura.Channel.World.Entities.Prop
return void

BossDoorBehavior() public method

Behavior for this dungeon's boss door.
public BossDoorBehavior ( Creature _, Prop prop ) : void
_ Aura.Channel.World.Entities.Creature
prop Aura.Channel.World.Entities.Prop
return void

CheckDoors() public method

Returns true if all doors except the boss door have been opened.
public CheckDoors ( ) : bool
return bool

CheckSectionClear() public method

Checks if any sections have just been cleared, and calls the corresponding script method.
public CheckSectionClear ( ) : void
return void

Complete() public method

public Complete ( ) : void
return void

CompleteManually() public method

Sets whether the dungeon is completed automatically once all bosses have been killed.
If set to false, the dungeon script has to handle calling Complete, otherwise the dungeon won't be completable.
public CompleteManually ( bool val ) : void
val bool
return void

CountPlayers() public method

Returns amount of players in all regions that are part of the dungeon.
public CountPlayers ( ) : int
return int

Dungeon() public method

Creates new dungeon.
public Dungeon ( long instanceId, string dungeonName, int itemId, int seed, int floorPlan, Creature creature ) : Aura.Channel.Network.Sending
instanceId long
dungeonName string
itemId int
seed int
floorPlan int
creature Aura.Channel.World.Entities.Creature
return Aura.Channel.Network.Sending

GetBossRoomCenter() public method

Returns the location at the center of the boss room.
public GetBossRoomCenter ( ) : Location
return Location

GetCreators() public method

Returns creators inside the dungeon. If dungeon has roles, it gets the creators by calling GetActualCreature on the RP characters.
public GetCreators ( ) : List
return List

GetCreature() public method

Returns the creature with the given entity id if it could be found in the dungeon's regions, otherwise it returns null.
public GetCreature ( long entityId ) : Creature
entityId long
return Aura.Channel.World.Entities.Creature

GetEndRoomCenter() public method

Returns the location at the center of the end room, behind the boss room.
public GetEndRoomCenter ( ) : Location
return Location

GetPlayerListScrollMessage() public method

Returns the text for the player location crawler.
public GetPlayerListScrollMessage ( ) : string
return string

GetRoles() public method

Returns dungeon's roles registered with SetRole, sorted by their index. 0 = leader, 1 = first other party member, etc.
public GetRoles ( ) : List
return List

GetRpCharacters() public method

Returns all RP characters inside the dungeon.
public GetRpCharacters ( ) : List
return List

GetRpCharactersOrCreators() public method

Returns either all RP characters or all creators currently in the dungeon, depending on whether this is an RP dungeon or not.
public GetRpCharactersOrCreators ( ) : List
return List

InitFloorRegion() public method

Initiates floor, creating puzzles and props.
public InitFloorRegion ( int iRegion ) : void
iRegion int
return void

InitLobbyRegion() public method

Initiates lobby, adding behavior to the stairs and statue.
public InitLobbyRegion ( int iRegion ) : void
iRegion int
return void

InitRegions() public method

Initiates regions, spawning props
public InitRegions ( ) : void
return void

IsInside() public method

Returns true if a creature with the given id is inside this dungeon.
public IsInside ( long entityId ) : bool
entityId long
return bool

OnPlayerEntersLobby() public method

Called when a creature enters the lobby region.
public OnPlayerEntersLobby ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
return void

PlayCutscene() public method

Plays cutscene for all party members.
public PlayCutscene ( string cutsceneName ) : void
cutsceneName string
return void

PlayCutscene() public method

Plays cutscene for all party members.
public PlayCutscene ( string cutsceneName, Action onFinish ) : void
cutsceneName string
onFinish Action
return void

RemoveAllPlayers() public method

Removes all players from dungeon.
public RemoveAllPlayers ( ) : void
return void

SetRole() public method

Registers a role-playing character.
public SetRole ( int index, string actorName ) : void
index int
actorName string
return void