Skip to content

Commit

Permalink
mirage b_retake & start practice logic tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
lengran committed Mar 23, 2024
1 parent 3df2a2e commit f92acb6
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 31 deletions.
57 changes: 31 additions & 26 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.16";
public override string ModuleVersion => "0.0.17";
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 @@ -373,43 +373,48 @@ public void OnRouteSelect(CCSPlayerController player, ChatMenuOption option)
return;
}

// Update practice status
if (previousPracticeNo > -1)

if (previousPracticeNo != practiceNo)
{
// Enable disabled practice routes
for (var i = 0; i < _practices[previousPracticeNo].IncompatiblePractices.Count; i++)
// Update practice status
if (previousPracticeNo > -1)
{
if (_practiceNameToId.ContainsKey(_practices[previousPracticeNo].IncompatiblePractices[i]))
// Enable disabled practice routes
for (var i = 0; i < _practices[previousPracticeNo].IncompatiblePractices.Count; i++)
{
var disabledPracticeNo = _practiceNameToId[_practices[previousPracticeNo].IncompatiblePractices[i]];
_practiceEnabled[disabledPracticeNo] = true;
if (_practiceNameToId.ContainsKey(_practices[previousPracticeNo].IncompatiblePractices[i]))
{
var disabledPracticeNo = _practiceNameToId[_practices[previousPracticeNo].IncompatiblePractices[i]];
_practiceEnabled[disabledPracticeNo] = true;
}
}
_practiceEnabled[previousPracticeNo] = true;

RemoveBots(player);
DeleteGuidingLine(player);
}
else
{
_playerCount++;
}
_practiceEnabled[previousPracticeNo] = true;

RemoveBots(player);
DeleteGuidingLine(player);
}
else
{
_playerCount++;
}

_playerStatuses[player].PracticeIndex = practiceNo;
_playerStatuses[player].PracticeIndex = practiceNo;

// Disable incompatible practices.
for (var i = 0; i < _practices[practiceNo].IncompatiblePractices.Count; i++)
{
if (_practiceNameToId.ContainsKey(_practices[practiceNo].IncompatiblePractices[i]))
// Disable incompatible practices.
for (var i = 0; i < _practices[practiceNo].IncompatiblePractices.Count; i++)
{
var disabledPracticeNo = _practiceNameToId[_practices[practiceNo].IncompatiblePractices[i]];
_practiceEnabled[disabledPracticeNo] = false;
if (_practiceNameToId.ContainsKey(_practices[practiceNo].IncompatiblePractices[i]))
{
var disabledPracticeNo = _practiceNameToId[_practices[practiceNo].IncompatiblePractices[i]];
_practiceEnabled[disabledPracticeNo] = false;
}
}
}
_practiceEnabled[practiceNo] = false;
_practiceEnabled[practiceNo] = false;

// Setup practice
AddBot(player, _practices[practiceNo].NumBots);
}


// Practice begin
SetupPrefireMode(player);
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
"map.de_ancient.b_house_to_b": "Attack B site from B house",
"map.de_ancient.mid_to_a": "Attack A site from donut",
"map.de_ancient.a_main": "Attack A site from A main",
"map.de_ancient.a_retake": "Retake A from CT",
"map.de_ancient.a_retake": "Retake A site from CT",
"map.de_mirage.a_ramp": "Attach A site from A ramp (to CT spawn)",
"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_mirage.b_retake": "Retake B site from CT spawn",
"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 @@ -41,6 +41,7 @@
"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_mirage.b_retake": "Recuperação de B do spawn dos CTs",
"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 @@ -41,6 +41,7 @@
"map.de_mirage.a_palace": "从 A 二楼进攻 A 包点(到 VIP)",
"map.de_mirage.mid_to_b": "从中路进攻 B 包点",
"map.de_mirage.under_to_jungle": "从下水道进攻 A 包点",
"map.de_mirage.b_retake": "从警家回防 B 包点",
"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 under_to_jungle
a_ramp under_to_jungle b_retake
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/b_apts.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mid_to_b under_to_jungle
mid_to_b under_to_jungle b_retake
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
43 changes: 43 additions & 0 deletions maps/de_mirage/b_retake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
b_apts mid_to_b under_to_jungle a_palace
6 0.8
-1656.237305 -1860.524780 -254.359100 2.463943 83.898087 0.000000
-1361.032471 -1173.968750 -118.75399 28.374416 -179.909821 0.000000 False
-1870.012817 -381.838379 -84.452454 9.259097 -55.261143 0.000000 True
-1985.900635 -205.440552 -168.70173599999998 0.673593 -56.242691 0.000000 False
-2288.030518 -451.410217 -168.96875 -0.288903 -20.662605 0.000000 False
-2306.701172 460.703491 -168.96875 -0.365906 -62.473877 0.000000 False
-2156.070801 823.448181 -127.33521999999999 1.501342 -78.091408 0.000000 False
-1768.766113 503.011566 -168.976837 -0.423477 -99.413391 0.000000 False
-1542.268921 863.969421 -16.380671999999997 6.718078 -108.351540 0.000000 False
-2585.545898 254.014893 -168.958908 -0.770182 -38.185932 0.000000 False
-1495.725098 408.558380 -167.96875 0.076847 -121.300941 0.000000 False
-1358.953735 320.794678 -168.96875 0.307847 -132.849731 0.000000 False
-2262.031250 -695.968750 -168.96875 1.597577 34.572479 0.000000 False
-2367.968750 -368.435791 -168.96875 -0.288929 -44.737499 0.000000 False
-2434.689209 421.066742 -168.568939 -0.231035 -80.373253 0.000000 False
-2368.049316 777.269287 -84.19693 4.292609 -86.747330 0.000000 False
-2247.194092 489.031250 -168.96875 -0.250394 -94.178314 0.000000 False
-1969.031250 450.027557 -160.96875 1.308853 -110.598473 0.000000 False
-2001.027588 167.193375 -160.96875 0.962355 -123.727402 0.000000 False
-2411.972168 -247.968994 -168.199738 -1.520915 -15.272323 0.000000 False
-1553.301758 -231.947632 -161.526474 0.250087 179.364609 0.000000 False
-2114.031250 831.968750 -125.299789 3.041205 -110.870392 0.000000 False
-2508.191406 400.336761 -168.96875 -1.135924 -64.962196 0.000000 False
-2635.968750 104.031250 -163.768723 1.116302 -1.033096 0.000000 False
-1906.583252 519.329346 -168.542038 0.057551 -135.090271 0.000000 False
-1713.465088 723.584961 -48.96875 8.662245 -134.245117 0.000000 False
-1359.793945 408.299377 -168.96875 -0.019451 -166.159470 0.000000 False
-792.445618 66.995956 -167.730377 -0.327450 171.298325 0.000000 False
-1856.452637 753.341553 -48.96875 8.508274 -146.063614 0.000000 False
-1830.972656 473.260345 -168.96875 -0.288943 178.900848 0.000000 False
-1543.434082 739.175476 -48.96875 6.621755 -161.232956 0.000000 False
-2329.031982 770.139343 -128.555618 2.328946 -14.335866 0.000000 False
-1406.838135 777.995361 -73.737045 -1.636597 -172.051010 0.000000 False
-1471.854248 691.822388 -48.96875 4.157654 174.204285 0.000000 False
-1575.712646 -1555.114258 -254.687561
-1607.577759 -1223.841187 -251.72464
-1598.253296 -817.276489 -158.80801400000001
-1625.150635 -618.429932 -158.96875
-2318.975830 -592.171204 -158.96875
-2331.591797 507.902161 -158.96875
-2114.031250 768.447876 -120.252365
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 under_to_jungle
b_apts under_to_jungle b_retake
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
2 changes: 1 addition & 1 deletion maps/de_mirage/under_to_jungle.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
b_apts a_palace a_ramp mid_to_b
b_apts a_palace a_ramp mid_to_b b_retake
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
Expand Down

0 comments on commit f92acb6

Please sign in to comment.