Skip to content

Commit 413ab5c

Browse files
committed
Convert /batfight to JavaScript
1 parent c7cc461 commit 413ab5c

File tree

9 files changed

+74
-36
lines changed

9 files changed

+74
-36
lines changed

data/fights/batfight.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "Batfight",
3+
"command": "batfight",
4+
"goal": "Beat your enemies with a bat on a baseball field.",
5+
6+
"settings": {
7+
"deathmatch/spawn_armour": true,
8+
"deathmatch/spawn_weapons": [
9+
{ "weapon": 5, "ammo": 1 }
10+
],
11+
"fights/location": "Las Venturas Baseball",
12+
"fights/pickups": false
13+
}
14+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "Las Venturas Baseball",
3+
"shortName": "Baseball",
4+
5+
"spawnPositions": {
6+
"individual": [
7+
{ "position": [ 1306.3967, 2190.7493, 11.0234 ], "facingAngle": 220.0355 },
8+
{ "position": [ 1306.7937, 2108.7700, 11.0156 ], "facingAngle": 314.7192 },
9+
{ "position": [ 1388.9008, 2109.1624, 11.0156 ], "facingAngle": 40.9429 },
10+
{ "position": [ 1387.7737, 2188.8848, 11.0234 ], "facingAngle": 131.2400 },
11+
{ "position": [ 1371.7301, 2189.8931, 11.0234 ], "facingAngle": 181.3738 },
12+
{ "position": [ 1351.6489, 2190.7031, 11.0234 ], "facingAngle": 179.1804 },
13+
{ "position": [ 1333.5717, 2190.4817, 11.0234 ], "facingAngle": 185.4472 },
14+
{ "position": [ 1306.8988, 2174.0811, 11.0234 ], "facingAngle": 261.0175 },
15+
{ "position": [ 1306.0605, 2153.3977, 11.0234 ], "facingAngle": 267.3405 },
16+
{ "position": [ 1306.3469, 2137.3967, 11.0234 ], "facingAngle": 268.9634 },
17+
{ "position": [ 1324.7543, 2107.6001, 11.0156 ], "facingAngle": 354.8737 },
18+
{ "position": [ 1345.5637, 2107.8203, 11.0156 ], "facingAngle": 356.4967 },
19+
{ "position": [ 1364.0076, 2108.3547, 11.0156 ], "facingAngle": 357.8063 },
20+
{ "position": [ 1389.3375, 2124.0510, 11.0234 ], "facingAngle": 56.7698 },
21+
{ "position": [ 1389.2413, 2146.0474, 11.0234 ], "facingAngle": 85.6529 },
22+
{ "position": [ 1389.0260, 2167.3130, 11.0234 ], "facingAngle": 102.9426 }
23+
],
24+
"teams": [
25+
[
26+
{ "position": [ 1308.7448, 2105.1543, 11.0156 ], "facingAngle": 328.4490 },
27+
{ "position": [ 1304.3202, 2116.0625, 11.0234 ], "facingAngle": 310.5885 },
28+
{ "position": [ 1310.6880, 2110.6404, 11.0156 ], "facingAngle": 313.0952 },
29+
{ "position": [ 1315.0830, 2107.8213, 11.0156 ], "facingAngle": 313.0952 },
30+
{ "position": [ 1320.0988, 2106.3037, 11.0156 ], "facingAngle": 313.0952 },
31+
{ "position": [ 1323.4738, 2109.5583, 11.0156 ], "facingAngle": 332.5221 },
32+
{ "position": [ 1304.6965, 2120.4802, 11.0234 ], "facingAngle": 314.0359 },
33+
{ "position": [ 1307.0861, 2116.1521, 11.0234 ], "facingAngle": 314.0359 }
34+
],
35+
[
36+
{ "position": [ 1378.3456, 2187.2456, 11.0234 ], "facingAngle": 132.6142 },
37+
{ "position": [ 1374.4967, 2188.8735, 11.0234 ], "facingAngle": 147.3411 },
38+
{ "position": [ 1379.0098, 2184.1326, 11.0234 ], "facingAngle": 147.3411 },
39+
{ "position": [ 1384.4526, 2183.2107, 11.0234 ], "facingAngle": 138.8810 },
40+
{ "position": [ 1387.7755, 2178.4912, 11.0234 ], "facingAngle": 136.3743 },
41+
{ "position": [ 1382.1703, 2177.9924, 11.0234 ], "facingAngle": 136.3743 },
42+
{ "position": [ 1372.4312, 2181.5957, 11.0234 ], "facingAngle": 141.0744 },
43+
{ "position": [ 1366.0356, 2186.1987, 11.0234 ], "facingAngle": 141.0744 }
44+
]
45+
]
46+
},
47+
48+
"environment": {
49+
"boundaries": {
50+
"minimumX": 1297.0610,
51+
"maximumX": 1397.1653,
52+
"minimumY": 2098.2563,
53+
"maximumY": 2198.6494
54+
}
55+
}
56+
}

pawn/Elements/Player/playerHandler.pwn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#define STATUS_DERBY4 4
1010
#define STATUS_DERBY5 5
1111
#define STATUS_DERBY6 6
12-
#define STATUS_BATFIGHT 7
12+
#define STATUS_BATFIGHT 7 // Converted
1313
#define STATUS_CHAINSAW 8
1414
#define STATUS_DILDO 9
1515
#define STATUS_KNOCKOUT 10
1616
#define STATUS_GRENADE 11
1717
#define STATUS_ROCKET 12
18-
// #define STATUS_SNIPER 13
19-
// #define STATUS_MINIGUN 14
18+
#define STATUS_SNIPER 13 // Converted
19+
#define STATUS_MINIGUN 14 // Converted
2020
#define STATUS_SHIPTDM 15
2121
#define STATUS_SAWNOFF 16
2222
#define STATUS_WALKWEAPON 17

pawn/Resources/Callbacks/OnPlayer/OnPlayerCommandText.pwn

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -528,17 +528,6 @@ public OnPlayerCommandText(playerid, cmdtext[]) {
528528

529529
#if Feature::DisableFights == 0
530530

531-
if(strcmp(cmd, "/batfight", true) == 0)
532-
{
533-
if(GetPlayerInterior(playerid) != 0)
534-
{
535-
ShowBoxForPlayer(playerid, "You cannot use this command while you're in an interior!");
536-
return 1;
537-
}
538-
MiniGamesSignup(playerid, STATUS_BATFIGHT);
539-
return 1;
540-
}
541-
542531
if(strcmp(cmd, "/massacre", true) == 0)
543532
{
544533
if(GetPlayerInterior(playerid) != 0)

pawn/Resources/Callbacks/Others/OnDialogResponse.pwn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ deprecated_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
431431
}
432432

433433
switch (listitem) {
434-
case 0: MiniGamesSignup(playerid, STATUS_BATFIGHT);
435434
case 1: MiniGamesSignup(playerid, STATUS_CHAINSAW);
436435
case 2: MiniGamesSignup(playerid, STATUS_DILDO);
437436
case 3: MiniGamesSignup(playerid, STATUS_KNOCKOUT);

pawn/Resources/Minigames/Core/DeathmatchHandler.pwn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by the GPLv2 license, a copy of which can
33
// be found in the LICENSE file.
44

5-
#include Resources/Minigames/Deathmatch/batfight.pwn
65
#include Resources/Minigames/Deathmatch/chainsaw_massacre.pwn
76
#include Resources/Minigames/Deathmatch/dildo_spanking.pwn
87
#include Resources/Minigames/Deathmatch/knockout.pwn
@@ -16,7 +15,7 @@
1615

1716
ShowDeathmatchDialog(playerId) {
1817
ShowPlayerDialog(playerId, DIALOG_MINIGAME_DM, DIALOG_STYLE_LIST, "Deathmatch Minigames",
19-
"Bat Fight\nHidden Massacre\nDildo Spanking\nFist Fight Knockout\nGrenade Wars\nRocket Wars\nShip TDM\nSawnoff Fights\nWalkweapon Fights\nRandom DM\nIsland DM",
18+
"Hidden Massacre\nDildo Spanking\nFist Fight Knockout\nGrenade Wars\nRocket Wars\nShip TDM\nSawnoff Fights\nWalkweapon Fights\nRandom DM\nIsland DM",
2019
"Select", "Cancel");
2120
}
2221

@@ -72,7 +71,6 @@ public DeathmatchStartFunc() {
7271

7372
// Let's call the specific minigame handler here.
7473
switch(MinigameTypeInfo[CurrentMinigame]) {
75-
case STATUS_BATFIGHT: SetPlayerUpForBatfight(contestant);
7674
case STATUS_CHAINSAW: SetPlayerUpForChainsawMassacre(contestant);
7775
case STATUS_DILDO: SetPlayerUpForDildoSpanking(contestant);
7876
case STATUS_KNOCKOUT: SetPlayerUpForKnockout(contestant);

pawn/Resources/Minigames/Core/MinigamesHandler.pwn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ ReturnMinigameName(minigame) {
417417
new minigameName[256];
418418

419419
switch (minigame) {
420-
case STATUS_BATFIGHT: minigameName = "Bat Fight";
421420
case STATUS_CHAINSAW: minigameName = "Hidden Massacre";
422421
case STATUS_DILDO: minigameName = "Dildo Spanking";
423422
case STATUS_KNOCKOUT: minigameName = "Knockout";
@@ -437,7 +436,6 @@ ReturnMinigameCmd(minigame) {
437436
new command[256];
438437

439438
switch (minigame) {
440-
case STATUS_BATFIGHT: command = "/batfight";
441439
case STATUS_CHAINSAW: command = "/massacre";
442440
case STATUS_DILDO: command = "/spankme";
443441
case STATUS_KNOCKOUT: command = "/knockout";
@@ -457,7 +455,6 @@ ReturnMinigameMaxPlayers(minigame) {
457455
new maxPlayers;
458456

459457
switch (minigame) {
460-
case STATUS_BATFIGHT: maxPlayers = 100;
461458
case STATUS_CHAINSAW: maxPlayers = 100;
462459
case STATUS_DILDO: maxPlayers = 10;
463460
case STATUS_KNOCKOUT: maxPlayers = 2;

pawn/Resources/Minigames/Deathmatch/batfight.pwn

Lines changed: 0 additions & 14 deletions
This file was deleted.

pawn/lvp.ppr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@
310310
<DiskObject>\Resources\Minigames\Core\WaterFight.pwn</DiskObject>
311311
<DiskObject>\Resources\Minigames\Core\WWTW.pwn</DiskObject>
312312
<DiskObject>\Resources\Minigames\Deathmatch\</DiskObject>
313-
<DiskObject>\Resources\Minigames\Deathmatch\batfight.pwn</DiskObject>
314313
<DiskObject>\Resources\Minigames\Deathmatch\chainsaw_massacre.pwn</DiskObject>
315314
<DiskObject>\Resources\Minigames\Deathmatch\dildo_spanking.pwn</DiskObject>
316315
<DiskObject>\Resources\Minigames\Deathmatch\grenade.pwn</DiskObject>

0 commit comments

Comments
 (0)