diff options
Diffstat (limited to 'AnodyneArchipelago/ArchipelagoTreasure.cs')
-rw-r--r-- | AnodyneArchipelago/ArchipelagoTreasure.cs | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/AnodyneArchipelago/ArchipelagoTreasure.cs b/AnodyneArchipelago/ArchipelagoTreasure.cs index 9074108..b160f0d 100644 --- a/AnodyneArchipelago/ArchipelagoTreasure.cs +++ b/AnodyneArchipelago/ArchipelagoTreasure.cs | |||
@@ -1,6 +1,7 @@ | |||
1 | using AnodyneSharp.Entities; | 1 | using AnodyneSharp.Entities; |
2 | using AnodyneSharp.Entities.Gadget.Treasures; | 2 | using AnodyneSharp.Entities.Gadget.Treasures; |
3 | using AnodyneSharp.Registry; | 3 | using AnodyneSharp.Registry; |
4 | using Archipelago.MultiClient.Net.Models; | ||
4 | using Microsoft.Xna.Framework; | 5 | using Microsoft.Xna.Framework; |
5 | 6 | ||
6 | namespace AnodyneArchipelago | 7 | namespace AnodyneArchipelago |
@@ -9,7 +10,80 @@ namespace AnodyneArchipelago | |||
9 | { | 10 | { |
10 | private string _location; | 11 | private string _location; |
11 | 12 | ||
12 | public ArchipelagoTreasure(string location, Vector2 pos) : base("archipelago", pos, 0, -1) | 13 | private static (string, int) GetSprite(string location) |
14 | { | ||
15 | NetworkItem? item = Plugin.ArchipelagoManager.GetScoutedLocation(location); | ||
16 | if (item == null) | ||
17 | { | ||
18 | return ("archipelago", 0); | ||
19 | } | ||
20 | |||
21 | if (item?.Player != Plugin.ArchipelagoManager.GetPlayer()) | ||
22 | { | ||
23 | return ("archipelago", 0); | ||
24 | } | ||
25 | |||
26 | string itemName = Plugin.ArchipelagoManager.GetItemName(item?.Item ?? 0); | ||
27 | if (itemName.StartsWith("Small Key")) | ||
28 | { | ||
29 | return ("key", 0); | ||
30 | } | ||
31 | else if (itemName == "Green Key") | ||
32 | { | ||
33 | return ("key_green", 0); | ||
34 | } | ||
35 | else if (itemName == "Blue Key") | ||
36 | { | ||
37 | return ("key_green", 4); | ||
38 | } | ||
39 | else if (itemName == "Red Key") | ||
40 | { | ||
41 | return ("key_green", 2); | ||
42 | } | ||
43 | else if (itemName == "Jump Shoes") | ||
44 | { | ||
45 | return ("item_jump_shoes", 0); | ||
46 | } | ||
47 | else if (itemName == "Health Cicada") | ||
48 | { | ||
49 | return ("life_cicada", 0); | ||
50 | } | ||
51 | else if (itemName == "Heal") | ||
52 | { | ||
53 | return ("small_health_pickup", 0); | ||
54 | } | ||
55 | else if (itemName == "Swap") | ||
56 | { | ||
57 | return ("item_tranformer", 0); | ||
58 | } | ||
59 | else if (itemName == "Extend") | ||
60 | { | ||
61 | return ("item_long_attack", 0); | ||
62 | } | ||
63 | else if (itemName == "Widen") | ||
64 | { | ||
65 | return ("item_wide_attack", 0); | ||
66 | } | ||
67 | else if (itemName == "Cardboard Box") | ||
68 | { | ||
69 | return ("fields_npcs", 31); | ||
70 | } | ||
71 | else if (itemName == "Biking Shoes") | ||
72 | { | ||
73 | return ("item_jump_shoes", 0); | ||
74 | } | ||
75 | |||
76 | return ("archipelago", 0); | ||
77 | } | ||
78 | |||
79 | public static ArchipelagoTreasure Create(string location, Vector2 pos) | ||
80 | { | ||
81 | (string textureName, int frame) = GetSprite(location); | ||
82 | |||
83 | return new(location, pos, textureName, frame); | ||
84 | } | ||
85 | |||
86 | private ArchipelagoTreasure(string location, Vector2 pos, string textureName, int frame) : base(textureName, pos, frame, -1) | ||
13 | { | 87 | { |
14 | _location = location; | 88 | _location = location; |
15 | } | 89 | } |