Added advanced effects

This commit is contained in:
Pax1601
2023-11-06 19:26:15 +01:00
parent 5273291e9a
commit 1e461250d5
8 changed files with 105 additions and 16 deletions

View File

@@ -56,7 +56,7 @@ export class MapContextMenu extends ContextMenu {
document.addEventListener("contextMenuExplosion", (e: any) => {
this.hide();
getApp().getServerManager().spawnExplosion(e.detail.strength, this.getLatLng());
getApp().getServerManager().spawnExplosion(e.detail.strength ?? 0, e.detail.explosionType, this.getLatLng());
});
document.addEventListener("editCoalitionArea", (e: any) => {

View File

@@ -160,8 +160,8 @@ export class ServerManager {
this.PUT(data, callback);
}
spawnExplosion(intensity: number, latlng: LatLng, callback: CallableFunction = () => {}) {
var command = { "intensity": intensity, "location": latlng };
spawnExplosion(intensity: number, explosionType: string, latlng: LatLng, callback: CallableFunction = () => {}) {
var command = { "explosionType": explosionType, "intensity": intensity, "location": latlng };
var data = { "explosion": command }
this.PUT(data, callback);
}