Skip to content

Commit

Permalink
mirage underpass_to_A
Browse files Browse the repository at this point in the history
  • Loading branch information
lengran committed Mar 17, 2024
1 parent e82d01e commit 4d34e6e
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ jobs:
asset_path: ./OpenPrefirePrac-${{ github.sha }}.zip
asset_name: "openprefireprac-${{ github.event.release.tag_name }}.zip"
asset_content_type: application/zip

# - name: Upload release asset
# uses: softprops/action-gh-release@v2
# with:
# tag_name: openprefireprac-${{ github.event.release.tag_name }}.zip
# files:
# ./OpenPrefirePrac-${{ github.sha }}.zip

# - name: Upload release asset
# uses: actions/upload-artifact@v4
# with:
# name:
17 changes: 14 additions & 3 deletions OpenPrefirePrac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace OpenPrefirePrac;
public class OpenPrefirePrac : BasePlugin
{
public override string ModuleName => "Open Prefire Prac";
public override string ModuleVersion => "0.0.15";
public override string ModuleVersion => "0.0.16";
public override string ModuleAuthor => "Lengran";
public override string ModuleDescription => "A plugin for practicing prefire routes in CS2. https://github.com/lengran/OpenPrefirePrac";

Expand Down Expand Up @@ -364,16 +364,16 @@ public void OnRouteSelect(CCSPlayerController player, ChatMenuOption option)
}

int practiceNo = _playerStatuses[player].LocalizedPracticeNames[option.Text];
var previousPracticeNo = _playerStatuses[player].PracticeIndex;

// Check if selected practice route is compatible with other on-playing routes.
if (!_practiceEnabled[practiceNo])
if (previousPracticeNo != practiceNo && !_practiceEnabled[practiceNo])
{
player.PrintToChat($" {ChatColors.Green}[OpenPrefirePrac] {ChatColors.White}{_translator.Translate(player, "practice.incompatible")}");
return;
}

// Update practice status
var previousPracticeNo = _playerStatuses[player].PracticeIndex;
if (previousPracticeNo > -1)
{
// Enable disabled practice routes
Expand All @@ -385,6 +385,7 @@ public void OnRouteSelect(CCSPlayerController player, ChatMenuOption option)
_practiceEnabled[disabledPracticeNo] = true;
}
}
_practiceEnabled[previousPracticeNo] = true;

RemoveBots(player);
DeleteGuidingLine(player);
Expand All @@ -405,6 +406,7 @@ public void OnRouteSelect(CCSPlayerController player, ChatMenuOption option)
_practiceEnabled[disabledPracticeNo] = false;
}
}
_practiceEnabled[practiceNo] = false;

// Setup practice
AddBot(player, _practices[practiceNo].NumBots);
Expand Down Expand Up @@ -464,6 +466,14 @@ public void OpenPracticeMenu(CCSPlayerController player, ChatMenuOption option)
practiceMenu.AddMenuOption(tmpLocalizedPracticeName, OnRouteSelect); // practice name here is split by space instead of underline. TODO: Use localized text.
}
}
int practiceNo = _playerStatuses[player].PracticeIndex;
if (practiceNo > -1)
{
var tmpLocalizedPracticeName = _translator.Translate(player, $"map.{_mapName}.{_practices[practiceNo].PracticeName}");
_playerStatuses[player].LocalizedPracticeNames.Add(tmpLocalizedPracticeName, practiceNo);
practiceMenu.AddMenuOption(tmpLocalizedPracticeName, OnRouteSelect);
}


player.PrintToChat("============ [OpenPrefirePrac] ============");
MenuManager.OpenChatMenu(player, practiceMenu);
Expand Down Expand Up @@ -589,6 +599,7 @@ private void ExitPrefireMode(CCSPlayerController player)
_practiceEnabled[value] = true;
}
}
_practiceEnabled[previousPracticeNo] = true;

_playerStatuses[player].PracticeIndex = -1;
_playerCount--;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Finished practices:
- Attack B site from B apartments
- Attack A site from A palace (to jungle)
- Attack B site from mid
- Attack A site from underpass
- de_dust2
- Attach A site from A long
- Attach A site from A short
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"map.de_mirage.b_apts": "Attack B site from B apartments",
"map.de_mirage.a_palace": "Attack A site from A palace (to jungle)",
"map.de_mirage.mid_to_b": "Attack B site from mid",
"map.de_mirage.under_to_jungle": "Attack A site from underpass",
"map.de_dust2.a_long": "Attach A site from A long",
"map.de_dust2.a_short": "Attach A site from A short"
}
1 change: 1 addition & 0 deletions lang/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"map.de_mirage.b_apts": "Ataque ao site B dos apartamentos B",
"map.de_mirage.a_palace": "Ataque ao site A do palácio A (para a selva)",
"map.de_mirage.mid_to_b": "Ataque ao site B a partir do meio",
"map.de_mirage.under_to_jungle": "Ataque ao site A a partir da passagem subterrânea",
"map.de_dust2.a_long": "Ataque ao site A do A longo",
"map.de_dust2.a_short": "Ataque ao site A do A curto"
}
1 change: 1 addition & 0 deletions lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"map.de_mirage.b_apts": "从 B 二楼进攻 B 包点",
"map.de_mirage.a_palace": "从 A 二楼进攻 A 包点(到 VIP)",
"map.de_mirage.mid_to_b": "从中路进攻 B 包点",
"map.de_mirage.under_to_jungle": "从下水道进攻 A 包点",
"map.de_dust2.a_long": "A 大到 A 包点",
"map.de_dust2.a_short": "A 小到 A 包点"
}
2 changes: 1 addition & 1 deletion maps/de_mirage/a_palace.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
a_ramp
a_ramp under_to_jungle
8 0.55
1352.044800 -860.743347 -163.968750 0.770012 -93.610558 0.000000
895.425293 -1975.103638 -72.96875 9.201502 76.450615 0.000000 False
Expand Down
2 changes: 1 addition & 1 deletion maps/de_mirage/a_ramp.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
a_palace
a_palace under_to_jungle
5 0.7
1189.604614 -880.362976 -196.598785 1.135750 -132.620117 0.000000
498.344238 -1623.469604 -264.237122 -0.481254 58.084442 0.000000 False
Expand Down
2 changes: 1 addition & 1 deletion maps/de_mirage/b_apts.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mid_to_b
mid_to_b under_to_jungle
8 0.65
508.819611 823.928589 -121.968750 1.693996 -177.773300 0.000000
-396.284607 479.972626 -105.152206 1.751813 55.272839 0.000000 False
Expand Down
2 changes: 1 addition & 1 deletion maps/de_mirage/mid_to_b.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
b_apts
b_apts under_to_jungle
6 0.65
1216.000000 -16.000000 -152.953156 0.000000 90.000000 0.000000
122.366753 -329.216309 -178.130783 5.601792 67.640160 0.000000 False
Expand Down
58 changes: 58 additions & 0 deletions maps/de_mirage/under_to_jungle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
b_apts a_palace a_ramp mid_to_b
6 0.75
595.968750 715.016113 -121.968750 4.003962 137.272141 0.000000
-396.830200 479.968750 -105.515907 3.176226 53.586567 0.000000 False
-148.031250 358.075287 -47.15522 8.046264 91.881073 0.000000 False
-1079.694702 509.333771 -80.96875 -0.365801 8.828425 0.000000 False
-1106.079956 602.499939 -80.96875 0.038450 -0.873572 0.000000 False
-1577.255005 771.617065 -48.96875 2.367713 -17.043747 0.000000 False
-974.587891 333.408356 -368.96875 -21.579508 13.299640 0.000000 False
-960.954590 475.961243 -368.96875 -22.715284 0.613892 0.000000 False
-1055.565552 -788.969604 -264.96875 5.543737 85.685379 0.000000 False
-952.090942 -221.443970 -367.919373 0.230739 91.691048 0.000000 False
-1100.249878 -660.399841 -135.96875 30.722860 73.770157 0.000000 True
-923.210938 -519.824585 -49.09375 57.729240 116.525337 0.000000 True
-520.030273 -1021.001160 -168.96875 12.510902 131.523865 0.000000 False
-367.969116 -814.451660 -168.96875 11.047883 155.246033 0.000000 False
376.697510 -794.999268 -165.72692899999998 5.022646 169.607056 0.000000 False
379.420258 -521.770325 -166.927414 4.368186 -178.131882 0.000000 False
-1178.799805 -333.092163 -56.96875 24.022223 -71.601845 0.000000 False
-819.838501 294.968750 -168.695694 2.385028 -90.661613 0.000000 False
-600.076538 -1309.030518 -168.96875 12.009980 101.741745 0.000000 False
-727.358215 -1306.031250 -168.96875 11.740481 88.574852 0.000000 False
-825.105042 -2520.172852 -36.96875 7.640225 84.718819 0.000000 False
-808.247620 -2307.052490 -178.677567 1.905611 84.931007 0.000000 False
-807.968750 -1204.848267 -168.96875 11.297721 65.854034 0.000000 False
-714.923889 -2181.968018 -180.96875 2.134730 88.728294 0.000000 False
-495.810791 -2093.833496 -180.96875 2.153980 98.776421 0.000000 False
-447.958313 -1574.596680 -40.96875 17.380583 120.816963 0.000000 False
-330.087646 -2206.322266 -174.810532 -0.598899 112.371567 0.000000 False
-496.029175 -1309.061035 -160.96875 -0.019473 177.915680 0.000000 False
223.972626 -2373.858643 -40.96875 4.887369 136.286133 0.000000 False
90.820152 -1996.480469 -168.96875 0.036367 150.487579 0.000000 False
-1275.284546 -1500.629150 -154.279022 0.844853 20.331661 0.000000 False
-1242.245239 -1246.632080 -168.96875 0.209602 -23.423708 0.000000 False
-1216.031250 -1526.968750 -157.013123 0.902610 84.145462 0.000000 False
-1247.968750 -856.525940 -130.96875 4.483114 -79.620369 0.000000 False
-1134.637207 -200.259460 -56.96875 6.080884 -92.633118 0.000000 False
-1121.028687 -456.192627 -168.96875 -0.541142 -95.386116 -0.000000 False
-1120.028198 -1175.968750 -168.96875 0.902617 -164.191727 0.000000 False
-1440.427368 -848.031250 -168.95784 1.942122 -50.707039 0.000000 False
-1722.980347 -650.411133 -168.96875 0.248117 -40.408154 0.000000 False
-1492.001221 -1081.442383 -230.828369 -9.877376 30.470440 0.000000 False
-1247.972290 -456.156250 -96.96875 7.986503 -79.909279 0.000000 False
-1247.968750 -759.968750 -129.96875 22.192945 -8.376370 0.000000 False
470.941376 799.073792 -126.96875
-236.683044 793.162598 -128.742935
-278.991211 625.612793 -70.384224
-351.364014 416.931061 -70.96875
-1003.491577 412.445953 -358.96875
-1009.418213 -356.216980 -356.437286
-1015.676270 -557.844299 -278.96875
-883.402893 -625.451782 -254.456573
-662.826111 -798.794495 -254.96875
-664.179626 -1155.724365 -158.96875
-674.819519 -1416.629883 -158.96875
-1196.768921 -1381.399048 -157.490646
-1158.498657 -869.768799 -158.96875
-1167.369385 -616.733459 -158.96875

0 comments on commit 4d34e6e

Please sign in to comment.