Skip to content

Commit 72a20f7

Browse files
committed
feat: updated descriptions for critical protection, shocking strike, searing luminary and stone fetters.
feat: added update ignoring feature feat: introducing new enchantment perks, that consist of all perks that can function correctly as an enchantment with modified perks.xml fix: changed enchantment code for critical protection armor enchantment chore: bumped the version to 1.2.6
1 parent 62f0777 commit 72a20f7

File tree

12 files changed

+245
-95
lines changed

12 files changed

+245
-95
lines changed

assets/enchantments/medium.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[shockingStrike]
22
name = "Shocking Strike"
3-
description = "This enchantment is used only by the raid-bosses Tenebris, Banshee, Gatekeeper, and Power Mode Megalith. Currently has no known weapons that work with this enchantment, the game instantly discards it."
3+
description = "This enchantment is used only by the raid-bosses Tenebris, Banshee, Gatekeeper, and Power Mode Megalith. Currently has no known weapons that work with this enchantment, the game's Anti-Cheat instantly discards it."
44

55
[shockingStrike.equipment_ids]
66
weapon = "PERK_ITEM_SPECIAL_SHOCK"

assets/enchantments/mythical.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[stone_fetters]
22
name = "Stone Fetters"
33
id = "PERK_DRAGON_SET_STONE"
4-
description = "The mythical enchantment of the unused Dragon Set. Its mechanics are unknown."
4+
description = "The mythical enchantment of the unused Dragon Set. Its mechanics are unknown. This enchantment is normally being discarded by Anti-Cheat and doesn't have a sprite."
55

66
[searing_luminary]
77
name = "Searing Luminary"
88
id = "PERK_HEAVEN_SET_BURN"
99
description = """
1010
The mythical enchantment of the Heavenly Steel Set, which was later reused and rebranded as the Neo-wanderer Set with a new mythical enchantment associated to it (Arcane Martial Art).
1111
Its mechanics are unknown, but judging from the word "Burn" in its code name. it might've worked similarly to Bleeding or Burning.
12+
This enchantment is normally being discarded by Anti-Cheat and doesn't have a sprite.
1213
"""
1314

1415
[tempest_rage]

assets/enchantments/perk.toml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# For the rest of perks
2+
[invisibility]
3+
name = "Invisibility"
4+
id = "PERK_INVISIBILITY"
5+
description = "Invisibility used by Lynx, Eclipse May and Fatum"
6+
7+
[hermitstorm]
8+
name = "Hermit's Storm"
9+
id = "PERK_HERMITSTORM"
10+
description = "Hermit's boss ability"
11+
12+
[earthquake]
13+
name = "Earthquake"
14+
id = "PERK_EARTHQUAKE"
15+
description = "Earthquake used by Butcher and Fungus"
16+
17+
[wasp_fly]
18+
name = "Wasp Fly"
19+
id = "PERK_WASPFLY"
20+
description = "Flight ability used by Wasp"
21+
22+
[teleportation]
23+
name = "Teleportation"
24+
id = "PERK_TELEPORTATION"
25+
description = "Teleportation used by Widow, Eclipse May and Volcano"
26+
27+
[assistants]
28+
name = "Assistants"
29+
id = "PERK_ASSISTANTS"
30+
description = "Assistants used by Shogun"
31+
32+
[titans_shield]
33+
name = "Titan's Shield"
34+
id = "PERK_TITANS_SHIELD"
35+
description = "Shield perk used by Titan"
36+
37+
[rat_wave]
38+
name = "Rat Wave"
39+
id = "PERK_RAT_WAVE"
40+
description = "Rat wave used by Arkhos"
41+
42+
[hoaxen_tentacles]
43+
name = "Hoaxen's Tentacles"
44+
id = "PERK_HOAXEN_TENTACLES"
45+
description = "Tentacles used by Hoaxen"
46+
47+
[hunger_claws]
48+
name = "Hunger Claws"
49+
id = "PERK_HUNGER_CLAWS"
50+
description = "Ability used by Karcer"
51+
52+
[war_whirl]
53+
name = "War Whirl"
54+
id = "PERK_WAR_WHIRL"
55+
description = "Ability used by Drakaina"
56+
57+
[power_field]
58+
name = "Power Field"
59+
id = "PERK_POWER_FIELD"
60+
description = "Ability used by Gatekeeper"
61+
62+
[super_blaster]
63+
name = "Super Blaster"
64+
id = "PERK_SUPER_BLASTER"
65+
description = "Super blaster used by Saturn"
66+
67+
[grasp_of_darkness]
68+
name = "Grasp of Darkness"
69+
id = "PERK_GRASP_OF_DARKNESS"
70+
description = "Ability used by Blackness"
71+
72+
[hunterfly]
73+
name = "Hunter Fly"
74+
id = "PERK_HUNTERFLY"
75+
description = "Flight ability used by Stalker"

assets/enchantments/simple.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[critical_protection]
22
name = "Critical Protection"
3-
description = "This enchantment is currently available to only two helms: both versions of Fur-Ear Flap helm from New Year 2018 and 2021. The helm Iron Mask which was obtainable from the Starter Pack prior to version 1.6.1 was also initially enchanted with Critical Protection. This enchantment can still be applied to the listed helmets with Stalker."
3+
description = "This enchantment is currently available to only two helms: both versions of Fur-Ear Flap helm from New Year 2018 and 2021. The helm Iron Mask which was obtainable from the Starter Pack prior to version 1.6.1 was also initially enchanted with Critical Protection. This enchantment can still be applied to the listed helmets with Stalker. For the rest of helms and armor, it is being removed by Anti-Cheat system."
44

55
[critical_protection.equipment_ids]
6-
armor = "PERK_ITEM_SPECIAL_CRITICAL_PROTECTION_ARMOR"
6+
armor = "PERK_ITEM_SPECIAL_CRITICAL_PROTECTION"
77
helm = "PERK_ITEM_SPECIAL_CRITICAL_PROTECTION_HELM"
88

99
[precision]

lib/app.dart

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ void showFatalErrorDialog(
6767
[List<Widget> actions = const []]) {
6868
showDialog(
6969
context: context,
70+
barrierDismissible: false,
7071
builder: (_) => AlertDialog(
7172
title: Text(title),
7273
content: Text(description),
@@ -219,12 +220,18 @@ class _AppState extends State<App> {
219220
Future<void> _tryToInitializeApp(BuildContext context) async {
220221
await getExternalStorageDirectory(); // to create the data folder
221222
package.value = await PackageInfo.fromPlatform();
222-
_isUpdateAvailable().then((updateAvailable) {
223-
if (updateAvailable) {
224-
logger.i("New update is available");
225-
_showUpdateDialog();
226-
}
227-
});
223+
final prefs = await SharedPreferences.getInstance();
224+
225+
if (prefs.getBool('ignoreUpdates') ?? false) {
226+
logger.i("Ignoring updates");
227+
} else {
228+
_isUpdateAvailable().then((updateAvailable) {
229+
if (updateAvailable) {
230+
logger.i("New update is available");
231+
_showUpdateDialog();
232+
}
233+
});
234+
}
228235
await _tryToShowNotice();
229236
if (await _tryToConnectToShizuku(context)) {
230237
logger.i("Shizuku is available");
@@ -326,17 +333,32 @@ class _AppState extends State<App> {
326333
}
327334

328335
Future<void> _showUpdateDialog() async {
329-
showFatalErrorDialog(
330-
context,
331-
"New version available",
332-
"In order for the app to function correctlty, please update it to the latest version.",
333-
[
334-
TextButton(
335-
onPressed: () {
336-
launchUrlString(GitHub.latestRelease);
337-
},
338-
child: const Text("Update"))
339-
]);
336+
showDialog(
337+
context: context,
338+
builder: (_) => AlertDialog(
339+
title: const Text("New version available"),
340+
content: const Text(
341+
"In order for the app to function correctlty, please update it to the latest version."),
342+
actions: [
343+
Row(
344+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
345+
children: [
346+
TextButton(
347+
onPressed: () {
348+
launchUrlString(GitHub.latestRelease);
349+
},
350+
child: const Text("Update")),
351+
TextButton(
352+
onPressed: () async {
353+
final prefs = await SharedPreferences.getInstance();
354+
prefs.setBool('ignoreUpdates', true);
355+
Navigator.of(context).pop();
356+
},
357+
child: const Text("Do not show again"))
358+
],
359+
)
360+
],
361+
));
340362
}
341363

342364
@override

lib/logic/enchantment.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import 'package:stalker/logic/equipment_type.dart';
2121
import 'package:toml/toml.dart';
2222
import 'package:xml/xml.dart';
2323

24-
enum EnchantmentTier { simple, medium, mythical }
24+
enum EnchantmentTier { simple, medium, mythical, perk }
2525

2626
extension EnchantmentTierExtension on EnchantmentTier {
2727
String get fileName {
@@ -32,6 +32,8 @@ extension EnchantmentTierExtension on EnchantmentTier {
3232
return "medium";
3333
case EnchantmentTier.mythical:
3434
return "mythical";
35+
case EnchantmentTier.perk:
36+
return "perk";
3537
}
3638
}
3739

@@ -43,6 +45,8 @@ extension EnchantmentTierExtension on EnchantmentTier {
4345
return 0xFFE6521F;
4446
case EnchantmentTier.mythical:
4547
return 0xFF441752;
48+
case EnchantmentTier.perk:
49+
return 0xFFB45253;
4650
}
4751
}
4852

@@ -54,6 +58,8 @@ extension EnchantmentTierExtension on EnchantmentTier {
5458
return "Medium";
5559
case EnchantmentTier.mythical:
5660
return "Mythical"; // either Mythical or Mythic, not tested
61+
case EnchantmentTier.perk:
62+
return "";
5763
}
5864
}
5965

@@ -75,7 +81,7 @@ class Enchantment {
7581

7682
factory Enchantment.fromToml(
7783
MapEntry<String, dynamic> entry, EnchantmentTier tier) {
78-
if (tier == EnchantmentTier.mythical) {
84+
if (tier == EnchantmentTier.mythical || tier == EnchantmentTier.perk) {
7985
final id = entry.value["id"] as String;
8086
return Enchantment(
8187
entry.value["name"] as String,

lib/main.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ import 'package:dynamic_color/dynamic_color.dart';
2020
import 'package:flutter/material.dart';
2121
import 'package:flutter/services.dart';
2222
import 'package:log_plus/log_plus.dart';
23+
import 'package:shared_preferences/shared_preferences.dart';
2324
import 'package:signals/signals_flutter.dart';
2425
import 'package:stalker/app.dart';
2526
import 'package:stalker/logic/item_database.dart';
27+
import 'package:stalker/pages/settings.dart';
2628
import 'package:stalker/themes.dart';
2729
import 'package:toml/toml.dart';
2830

@@ -35,10 +37,16 @@ final logger = Logs(
3537

3638
void main() async {
3739
WidgetsFlutterBinding.ensureInitialized();
38-
await loadThemeFromPrefs();
40+
await loadPrefsValues();
3941
runApp(const RootApp());
4042
}
4143

44+
Future<void> loadPrefsValues() async {
45+
final prefs = await SharedPreferences.getInstance();
46+
await loadThemeFromPrefs(prefs);
47+
ignoreUpdates.value = prefs.getBool("ignoreUpdates") ?? false;
48+
}
49+
4250
class RootApp extends StatefulWidget {
4351
const RootApp({super.key});
4452

lib/pages/inventory_view/inventory_view.dart

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ class _InventoryViewState extends State<InventoryView> {
259259
child: Stack(
260260
children: [
261261
Padding(
262-
padding: const EdgeInsets.only(
263-
right: 70),
262+
padding: const EdgeInsets.only(right: 70),
264263
child: Text(
265264
item.name,
266265
softWrap: true,
@@ -408,17 +407,19 @@ class _InventoryViewState extends State<InventoryView> {
408407
enchantments:
409408
EnchantmentsManager.enchantments,
410409
type: widget.equipmentType,
411-
onPressed: (selected) {
410+
onPressed: (selected, amount) {
412411
setState(() {
413-
item.enchantments.add(
414-
AppliedEnchantment(
415-
selected,
416-
selected.tier ==
417-
EnchantmentTier.mythical
418-
? null
419-
: 0,
420-
),
421-
);
412+
for (var i = 0; i < amount; i++) {
413+
item.enchantments.add(
414+
AppliedEnchantment(
415+
selected,
416+
selected.tier ==
417+
EnchantmentTier.mythical
418+
? null
419+
: AppliedEnchantment.maxAspect,
420+
),
421+
);
422+
}
422423
});
423424
Navigator.of(ctx).pop();
424425
}));

0 commit comments

Comments
 (0)