mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Player Death and Level Up Sounds, Cutscene Support (#383)
* Added Player death Sound Added a ton of Level Up Sounds (Some I do not know) * Added command to play "quicksongs" * adjusted chat message to properly name the command * Added Camera functionality for cutscenes Added Camera shake functionality for cutscenes/barrows/anything else Added Camera reset functionality to return the player to the normal player view Added some details on what each added method does Refactored some of the method names for uniformity * Added some commands to test the cutscene/camera features that were added in PlayerAssistant.java Co-authored-by: Qweqker <qweqker@mail.com> Co-authored-by: Daniel Ginovker <dcress01@uoguelph.ca>
This commit is contained in:
@@ -2142,4 +2142,51 @@ public class PlayerAssistant {
|
||||
public int totalGold() {
|
||||
return player.getItemAssistant().getBankQuantity(996) + player.getItemAssistant().getItemAmount(995);
|
||||
}
|
||||
|
||||
/**
|
||||
* anchors the camera to a specific view (for cutscenes)
|
||||
* @param x The X Coordinate (Within the player's loaded area)
|
||||
* @param y The Y Coordinate (Within the player's loaded area)
|
||||
* @param height The Height of Camera (not relative to the game world height)
|
||||
* @param speed The Camera Speed (Speed at which the camera turns to where it should point?)
|
||||
* @param angle The Camera Angle
|
||||
*/
|
||||
public void sendCameraCutscene(int x, int y, int height, int speed, int angle) {
|
||||
player.getOutStream().createFrame(177);
|
||||
player.getOutStream().writeByte(x / 64); //
|
||||
player.getOutStream().writeByte(y / 64); //
|
||||
player.getOutStream().writeWord(height); //
|
||||
player.getOutStream().writeByte(speed); //
|
||||
player.getOutStream().writeByte(angle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the player view shake (Cutscene use and other events like Barrows?)
|
||||
* @param i1
|
||||
* @param i2
|
||||
* @param i3
|
||||
* @param i4
|
||||
*/
|
||||
public void sendCameraShake(int i1, int i2, int i3, int i4)
|
||||
{
|
||||
player.getOutStream().createFrame(35); //Not sure of each specific integer, but some cannot be greater than 5 (maybe less)
|
||||
player.getOutStream().writeByte(i1);
|
||||
player.getOutStream().writeByte(i2);
|
||||
player.getOutStream().writeByte(i3);
|
||||
player.getOutStream().writeByte(i4);
|
||||
player.updateRequired = true;
|
||||
player.appearanceUpdateRequired = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the players camera from using sendCameraShake and sendCameraCutscene
|
||||
*/
|
||||
public void sendCameraReset() {
|
||||
synchronized(player) {
|
||||
if(player.getOutStream() != null && player != null) {
|
||||
player.getOutStream().createFrame(107);
|
||||
player.flushOutStream();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user