about summary refs log tree commit diff stats
path: root/AnodyneArchipelago/ArchipelagoTreasure.cs
blob: 90741080f042497f8c0b2995f6b3816ee4cacf6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using AnodyneSharp.Entities;
using AnodyneSharp.Entities.Gadget.Treasures;
using AnodyneSharp.Registry;
using Microsoft.Xna.Framework;

namespace AnodyneArchipelago
{
    internal class ArchipelagoTreasure : Treasure
    {
        private string _location;

        public ArchipelagoTreasure(string location, Vector2 pos) : base("archipelago", pos, 0, -1)
        {
            _location = location;
        }

        public override void GetTreasure()
        {
            if (_location == "Street - Broom Chest")
            {
                BroomTreasure broomTreasure = new("broom-icon", this.Position, BroomType.Normal);
                broomTreasure.GetTreasure();
                GlobalState.SpawnEntity(broomTreasure);
            }
            else if (_location == "Street - Key Chest")
            {
                KeyTreasure keyTreasure = new(this.Position);
                keyTreasure.GetTreasure();
                GlobalState.SpawnEntity(keyTreasure);
            }
            else
            {
                base.GetTreasure();
            }
            
            Plugin.ArchipelagoManager.SendLocation(_location);
        }
    }
}