Miese Corona Zeiten push für Lenhardt

This commit is contained in:
Siga
2020-05-10 19:19:53 +02:00
parent 15e4cec8ee
commit efbff34c21
159 changed files with 8042 additions and 8695 deletions

View File

@@ -1,7 +1,4 @@

export default function gangwarHandle(globalData: IGlobalData) {
export default function gangwarHandle(globalData: IGlobalData) {
function inside(point, vs) {
let x = point[0],
y = point[1];
@@ -35,7 +32,6 @@ export default function gangwarHandle(globalData: IGlobalData) {
};
var Gangturf = class {
name: string;
id: number;
range: number;
@@ -70,12 +66,11 @@ export default function gangwarHandle(globalData: IGlobalData) {
}
_setup(name, id, x, y, range, color, rot, owner, edit, vector, value) {
var self = this;
self.name = name;
self.id = id;
self.range = range;
self.setColor(owner);
self.setColor(owner);
self.x = x;
self.y = y;
self.rotation = rot;
@@ -97,7 +92,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
} else {
self.leaderBlipVector = null;
}
self.leaderColShape = null;
}
@@ -127,7 +122,6 @@ export default function gangwarHandle(globalData: IGlobalData) {
loadArea() {
var self = this;
self.blip = mp.game.ui.addBlipForRadius(self.x, self.y, 1, self.range);
mp.game.invoke(Natives.SET_BLIP_SPRITE, self.blip, 5);
@@ -137,25 +131,21 @@ export default function gangwarHandle(globalData: IGlobalData) {
self._colshape = mp.colshapes.newCircle(self.x, self.y, self.range * 1.5);
}
render() {
var self = this;
if (self._colshape) {
if (self.edit == true) {
let vector3 = mp.players.local.getRotation(2);
self.rotation = Math.round(vector3.z);
//self.blip.setPosition(mp.players.local.position.x, mp.players.local.position.y, 1);
mp.game.invoke(Natives.SET_BLIP_COORDS, self.blip, mp.players.local.position.x, mp.players.local.position.y, 1);
self.x = mp.players.local.position.x;
self.y = mp.players.local.position.y;
}
//self.blip.setRotation(self.rotation);
mp.game.invoke(Natives.SET_BLIP_ROTATION, self.blip, self.rotation);
mp.game.invoke(Natives.SET_BLIP_ROTATION, self.blip, self.rotation);
}
if (self._status == "attack" || self.edit == true) {
if (self._colshape) {
if (mp.game.gameplay.getDistanceBetweenCoords(mp.players.local.position.x, mp.players.local.position.y, 0, self.x, self.y, 0, true) < self.range * 1.5) {
@@ -191,7 +181,6 @@ export default function gangwarHandle(globalData: IGlobalData) {
mp.game.graphics.drawLine(bottom_left.x, bottom_left.y, i, top_left.x, top_left.y, i, 255, 0, 0, 255);
}
} else {
/*
let a = 0;
for (var i = z; i < z + 1; i += 0.001) {
@@ -202,10 +191,8 @@ export default function gangwarHandle(globalData: IGlobalData) {
a += 0.001
}
*/
}
}
}
if (self.isInsideArea()) {
mp.game.graphics.drawText(self.name, [self.x, self.y, mp.players.local.position.z + 20], {
@@ -215,7 +202,6 @@ export default function gangwarHandle(globalData: IGlobalData) {
outline: true,
centre: true
});
}
}
}
@@ -233,11 +219,9 @@ export default function gangwarHandle(globalData: IGlobalData) {
}
}
}
}
startGangWar() {
startGangWar() {
var self = this;
if (self._status == "normal") {
let dist = mp.game.gameplay.getDistanceBetweenCoords(mp.players.local.position.x, mp.players.local.position.y, 0, self.leaderBlipVector.x, self.leaderBlipVector.y, self.leaderBlipVector.z, false);
@@ -263,7 +247,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
if (status == "normal") {
self._status = "normal";
//self.blip.setFlashes(false);
mp.game.invoke(Natives.SET_BLIP_FLASHES, self.blip, false);
mp.game.invoke(Natives.SET_BLIP_FLASHES, self.blip, false);
return;
}
if (status == "conquered") {
@@ -287,7 +271,6 @@ export default function gangwarHandle(globalData: IGlobalData) {
self.attackBlip = mp.game.ui.addBlipForCoord(self.x, self.y, 0);
mp.game.invoke(Natives.SET_BLIP_SPRITE, self.attackBlip, 378);
mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, self.attackBlip, false);
} else if (!bool) {
mp.game.invoke(Natives.SET_BLIP_SPRITE, self.attackBlip, 5);
}
@@ -310,20 +293,18 @@ export default function gangwarHandle(globalData: IGlobalData) {
self.setLeaderColShape();
mp.game.invoke(Natives.SET_BLIP_SPRITE, self.leaderBlip, 437);
mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, self.leaderBlip, false);
}
}
}
setLeaderColShape() {
var self = this;
let newVector = new mp.Vector3(self.leaderBlipVector.x, self.leaderBlipVector.y, self.leaderBlipVector.z - 2)
self.leaderColShape = mp.markers.new(1, newVector, 2, {
color: [255, 255, 0, 150],
visible: true,
dimension: 0
});
let newVector = new mp.Vector3(self.leaderBlipVector.x, self.leaderBlipVector.y, self.leaderBlipVector.z - 2)
self.leaderColShape = mp.markers.new(1, newVector, 2, {
color: [255, 255, 0, 150],
visible: true,
dimension: 0
});
}
isTurfArea(shape) {
@@ -335,7 +316,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
}
check() {
var self = this
var self = this
if (self._entered == true) {
if (!self.isInsideArea() || (self.isNearGround() == false)) {
self._entered = false;
@@ -343,7 +324,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
}
}
}
enter() {
var self = this;
self._timerCheck = setInterval(function () {
@@ -354,8 +335,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
mp.game.audio.playSoundFrontend(1, "Enter_Capture_Zone", "DLC_Apartments_Drop_Zone_Sounds", true);
mp.game.graphics.stopScreenEffect("MinigameTransitionIn");
mp.game.graphics.startScreenEffect("MinigameTransitionOut", 500, false);
}
}
mp.events.callRemote("Gangarea:Enter", JSON.stringify(self.id));
}
} else if (self._entered == true) {
@@ -364,7 +344,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
if (self._status === "attack") {
mp.game.audio.playSoundFrontend(1, "Exit_Capture_Zone", "DLC_Apartments_Drop_Zone_Sounds", true);
mp.game.graphics.startScreenEffect("MinigameTransitionIn", 500, false);
}
}
mp.events.callRemote("Gangarea:Leave", JSON.stringify(self.id));
}
}
@@ -374,7 +354,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
leave() {
var self = this;
clearInterval(self._timerCheck);
self.check();
}
isNearGround() {
@@ -475,7 +455,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
while (mp.game.invoke(Natives.DOES_BLIP_EXIST, last_blip)) {
mp.game.invoke(Natives.SET_BLIP_SPRITE, last_blip, -1);
mp.game.ui.removeBlip(last_blip);
mp.game.ui.removeBlip(last_blip);
last_blip = mp.game.invoke(Natives.GET_NEXT_BLIP_INFO_ID, 5);
x++;
}
@@ -499,7 +479,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
mp.gui.chat.push("DEBUG: Attack blips not removed: " + y);
mp.gui.chat.push("DEBUG: LeaderBlips blips not removed: " + z);
}
mp.events.add('GangAreas:Create', (turfsJSON) => {
var turfs = JSON.parse(turfsJSON);
if (gangturfs.length > 0) {
@@ -512,9 +492,9 @@ export default function gangwarHandle(globalData: IGlobalData) {
turf.leaderColShape = null;
}
if (turf._marker)
if (turf.blip != null) {
mp.game.ui.removeBlip(turf.blip);
}
if (turf.blip != null) {
mp.game.ui.removeBlip(turf.blip);
}
if (turf.leaderBlip != null) {
mp.game.ui.removeBlip(turf.leaderBlip);
}
@@ -525,7 +505,6 @@ export default function gangwarHandle(globalData: IGlobalData) {
}
clearBlips();
if (turfs.length > 0) {
gangturfs = [];
turfs.forEach(function (turf) {
if (turf.Id != undefined) {
@@ -543,9 +522,8 @@ export default function gangwarHandle(globalData: IGlobalData) {
mp.events.add('ADMIN:SetTurf', (name) => {
gangturfs[gangturfs.length - 1].edit = false;
if (gangturfs[gangturfs.length - 1].id == -1) {
mp.events.callRemote("SERVER:SetTurf", JSON.stringify(gangturfs[gangturfs.length - 1].x), JSON.stringify(gangturfs[gangturfs.length - 1].y), JSON.stringify(gangturfs[gangturfs.length - 1].rotation), JSON.stringify(gangturfs[gangturfs.length - 1].range), name);
}
}
});
mp.events.add('ADMIN:DeleteTurf', () => {
@@ -581,13 +559,13 @@ export default function gangwarHandle(globalData: IGlobalData) {
mp.events.add('CLIENT:Turf_LoadLeaderBlip', () => {
gangturfs.forEach(function (turf) {
turf.setLeaderBlip(false);
turf.setLeaderBlip(false);
});
});
mp.events.add('ADMIN:Turf_CreateLeaderBlip', () => {
gangturfs.forEach(function (turf) {
if (turf._entered == true) {
if (turf._entered == true) {
turf.setLeaderBlip(true);
}
});
@@ -596,7 +574,7 @@ export default function gangwarHandle(globalData: IGlobalData) {
mp.events.add('CLIENT:StartGangwar', () => {
gangturfs.forEach(function (turf) {
if (turf._entered == true) {
turf.startGangWar();
turf.startGangWar();
}
});
});