Skip to content

Commit

Permalink
Convert /batfight to JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLVP committed Aug 1, 2020
1 parent c7cc461 commit 413ab5c
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 36 deletions.
14 changes: 14 additions & 0 deletions data/fights/batfight.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Batfight",
"command": "batfight",
"goal": "Beat your enemies with a bat on a baseball field.",

"settings": {
"deathmatch/spawn_armour": true,
"deathmatch/spawn_weapons": [
{ "weapon": 5, "ammo": 1 }
],
"fights/location": "Las Venturas Baseball",
"fights/pickups": false
}
}
56 changes: 56 additions & 0 deletions data/fights/locations/las_venturas_baseball.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "Las Venturas Baseball",
"shortName": "Baseball",

"spawnPositions": {
"individual": [
{ "position": [ 1306.3967, 2190.7493, 11.0234 ], "facingAngle": 220.0355 },
{ "position": [ 1306.7937, 2108.7700, 11.0156 ], "facingAngle": 314.7192 },
{ "position": [ 1388.9008, 2109.1624, 11.0156 ], "facingAngle": 40.9429 },
{ "position": [ 1387.7737, 2188.8848, 11.0234 ], "facingAngle": 131.2400 },
{ "position": [ 1371.7301, 2189.8931, 11.0234 ], "facingAngle": 181.3738 },
{ "position": [ 1351.6489, 2190.7031, 11.0234 ], "facingAngle": 179.1804 },
{ "position": [ 1333.5717, 2190.4817, 11.0234 ], "facingAngle": 185.4472 },
{ "position": [ 1306.8988, 2174.0811, 11.0234 ], "facingAngle": 261.0175 },
{ "position": [ 1306.0605, 2153.3977, 11.0234 ], "facingAngle": 267.3405 },
{ "position": [ 1306.3469, 2137.3967, 11.0234 ], "facingAngle": 268.9634 },
{ "position": [ 1324.7543, 2107.6001, 11.0156 ], "facingAngle": 354.8737 },
{ "position": [ 1345.5637, 2107.8203, 11.0156 ], "facingAngle": 356.4967 },
{ "position": [ 1364.0076, 2108.3547, 11.0156 ], "facingAngle": 357.8063 },
{ "position": [ 1389.3375, 2124.0510, 11.0234 ], "facingAngle": 56.7698 },
{ "position": [ 1389.2413, 2146.0474, 11.0234 ], "facingAngle": 85.6529 },
{ "position": [ 1389.0260, 2167.3130, 11.0234 ], "facingAngle": 102.9426 }
],
"teams": [
[
{ "position": [ 1308.7448, 2105.1543, 11.0156 ], "facingAngle": 328.4490 },
{ "position": [ 1304.3202, 2116.0625, 11.0234 ], "facingAngle": 310.5885 },
{ "position": [ 1310.6880, 2110.6404, 11.0156 ], "facingAngle": 313.0952 },
{ "position": [ 1315.0830, 2107.8213, 11.0156 ], "facingAngle": 313.0952 },
{ "position": [ 1320.0988, 2106.3037, 11.0156 ], "facingAngle": 313.0952 },
{ "position": [ 1323.4738, 2109.5583, 11.0156 ], "facingAngle": 332.5221 },
{ "position": [ 1304.6965, 2120.4802, 11.0234 ], "facingAngle": 314.0359 },
{ "position": [ 1307.0861, 2116.1521, 11.0234 ], "facingAngle": 314.0359 }
],
[
{ "position": [ 1378.3456, 2187.2456, 11.0234 ], "facingAngle": 132.6142 },
{ "position": [ 1374.4967, 2188.8735, 11.0234 ], "facingAngle": 147.3411 },
{ "position": [ 1379.0098, 2184.1326, 11.0234 ], "facingAngle": 147.3411 },
{ "position": [ 1384.4526, 2183.2107, 11.0234 ], "facingAngle": 138.8810 },
{ "position": [ 1387.7755, 2178.4912, 11.0234 ], "facingAngle": 136.3743 },
{ "position": [ 1382.1703, 2177.9924, 11.0234 ], "facingAngle": 136.3743 },
{ "position": [ 1372.4312, 2181.5957, 11.0234 ], "facingAngle": 141.0744 },
{ "position": [ 1366.0356, 2186.1987, 11.0234 ], "facingAngle": 141.0744 }
]
]
},

"environment": {
"boundaries": {
"minimumX": 1297.0610,
"maximumX": 1397.1653,
"minimumY": 2098.2563,
"maximumY": 2198.6494
}
}
}
6 changes: 3 additions & 3 deletions pawn/Elements/Player/playerHandler.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#define STATUS_DERBY4 4
#define STATUS_DERBY5 5
#define STATUS_DERBY6 6
#define STATUS_BATFIGHT 7
#define STATUS_BATFIGHT 7 // Converted
#define STATUS_CHAINSAW 8
#define STATUS_DILDO 9
#define STATUS_KNOCKOUT 10
#define STATUS_GRENADE 11
#define STATUS_ROCKET 12
// #define STATUS_SNIPER 13
// #define STATUS_MINIGUN 14
#define STATUS_SNIPER 13 // Converted
#define STATUS_MINIGUN 14 // Converted
#define STATUS_SHIPTDM 15
#define STATUS_SAWNOFF 16
#define STATUS_WALKWEAPON 17
Expand Down
11 changes: 0 additions & 11 deletions pawn/Resources/Callbacks/OnPlayer/OnPlayerCommandText.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -528,17 +528,6 @@ public OnPlayerCommandText(playerid, cmdtext[]) {

#if Feature::DisableFights == 0

if(strcmp(cmd, "/batfight", true) == 0)
{
if(GetPlayerInterior(playerid) != 0)
{
ShowBoxForPlayer(playerid, "You cannot use this command while you're in an interior!");
return 1;
}
MiniGamesSignup(playerid, STATUS_BATFIGHT);
return 1;
}

if(strcmp(cmd, "/massacre", true) == 0)
{
if(GetPlayerInterior(playerid) != 0)
Expand Down
1 change: 0 additions & 1 deletion pawn/Resources/Callbacks/Others/OnDialogResponse.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ deprecated_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
}

switch (listitem) {
case 0: MiniGamesSignup(playerid, STATUS_BATFIGHT);
case 1: MiniGamesSignup(playerid, STATUS_CHAINSAW);
case 2: MiniGamesSignup(playerid, STATUS_DILDO);
case 3: MiniGamesSignup(playerid, STATUS_KNOCKOUT);
Expand Down
4 changes: 1 addition & 3 deletions pawn/Resources/Minigames/Core/DeathmatchHandler.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by the GPLv2 license, a copy of which can
// be found in the LICENSE file.

#include Resources/Minigames/Deathmatch/batfight.pwn
#include Resources/Minigames/Deathmatch/chainsaw_massacre.pwn
#include Resources/Minigames/Deathmatch/dildo_spanking.pwn
#include Resources/Minigames/Deathmatch/knockout.pwn
Expand All @@ -16,7 +15,7 @@

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

Expand Down Expand Up @@ -72,7 +71,6 @@ public DeathmatchStartFunc() {

// Let's call the specific minigame handler here.
switch(MinigameTypeInfo[CurrentMinigame]) {
case STATUS_BATFIGHT: SetPlayerUpForBatfight(contestant);
case STATUS_CHAINSAW: SetPlayerUpForChainsawMassacre(contestant);
case STATUS_DILDO: SetPlayerUpForDildoSpanking(contestant);
case STATUS_KNOCKOUT: SetPlayerUpForKnockout(contestant);
Expand Down
3 changes: 0 additions & 3 deletions pawn/Resources/Minigames/Core/MinigamesHandler.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ ReturnMinigameName(minigame) {
new minigameName[256];

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

switch (minigame) {
case STATUS_BATFIGHT: command = "/batfight";
case STATUS_CHAINSAW: command = "/massacre";
case STATUS_DILDO: command = "/spankme";
case STATUS_KNOCKOUT: command = "/knockout";
Expand All @@ -457,7 +455,6 @@ ReturnMinigameMaxPlayers(minigame) {
new maxPlayers;

switch (minigame) {
case STATUS_BATFIGHT: maxPlayers = 100;
case STATUS_CHAINSAW: maxPlayers = 100;
case STATUS_DILDO: maxPlayers = 10;
case STATUS_KNOCKOUT: maxPlayers = 2;
Expand Down
14 changes: 0 additions & 14 deletions pawn/Resources/Minigames/Deathmatch/batfight.pwn

This file was deleted.

1 change: 0 additions & 1 deletion pawn/lvp.ppr
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
<DiskObject>\Resources\Minigames\Core\WaterFight.pwn</DiskObject>
<DiskObject>\Resources\Minigames\Core\WWTW.pwn</DiskObject>
<DiskObject>\Resources\Minigames\Deathmatch\</DiskObject>
<DiskObject>\Resources\Minigames\Deathmatch\batfight.pwn</DiskObject>
<DiskObject>\Resources\Minigames\Deathmatch\chainsaw_massacre.pwn</DiskObject>
<DiskObject>\Resources\Minigames\Deathmatch\dildo_spanking.pwn</DiskObject>
<DiskObject>\Resources\Minigames\Deathmatch\grenade.pwn</DiskObject>
Expand Down

0 comments on commit 413ab5c

Please sign in to comment.