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:
Qweqker
2020-03-06 18:53:53 -05:00
committed by GitHub
parent e5799200d7
commit db58bc868b
3 changed files with 117 additions and 1 deletions
@@ -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();
}
}
}
}