sf-api 0.4.3

A simple API to send commands to the Shakes & Fidget servers and parse their responses into characters
Documentation
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
use chrono::{DateTime, Local};
use log::{error, warn};
use num_derive::FromPrimitive;
use num_traits::FromPrimitive;

use super::{
    CCGet, CFPGet, CSTGet, ExpeditionSetting, SFError, ServerTime, items::Item,
};
use crate::{
    command::{DiceReward, DiceType},
    gamestate::rewards::Reward,
    misc::soft_into,
};

/// Anything related to things you can do in the tavern
#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Tavern {
    /// All the available quests
    pub quests: [Quest; 3],
    /// How many seconds the character still has left to do adventures
    #[doc(alias = "alu")]
    pub thirst_for_adventure_sec: u32,
    /// Whether or not skipping with mushrooms is allowed
    pub mushroom_skip_allowed: bool,
    /// The amount of beers we already drank today
    pub beer_drunk: u8,
    /// The amount of quicksand glasses we have and can use to skip quests
    pub quicksand_glasses: u32,
    /// The thing the player is currently doing (either questing or working)
    pub current_action: CurrentAction,
    /// The amount of silver earned per hour working the guard jobs
    pub guard_wage: u64,
    /// The toilet, if it has been unlocked
    pub toilet: Option<Toilet>,
    /// The dice game you can play with the weird guy in the tavern
    pub dice_game: DiceGame,
    /// Information about everything related to expeditions
    pub expeditions: ExpeditionsEvent,
    /// Decides if you can go on expeditions, or quests, when this event is
    /// currently ongoing
    pub questing_preference: ExpeditionSetting,
    /// The result of playing the shell game
    pub gamble_result: Option<GambleResult>,
    /// Total amount of beers you can drink today
    pub beer_max: u8,
}

/// Information about everything related to expeditions
#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ExpeditionsEvent {
    /// The time the expeditions mechanic was enabled at
    pub start: Option<DateTime<Local>>,
    /// The time until which expeditions will be available
    pub end: Option<DateTime<Local>>,
    /// The expeditions available to do
    pub available: Vec<AvailableExpedition>,
    /// The expedition the player is currently doing. Accessible via the
    /// `active()` method.
    pub(crate) active: Option<Expedition>,
}

impl ExpeditionsEvent {
    /// Checks if the event has started and not yet ended compared to the
    /// current time
    #[must_use]
    pub fn is_event_ongoing(&self) -> bool {
        let now = Local::now();
        matches!((self.start, self.end), (Some(start), Some(end)) if end > now && start < now)
    }

    /// Expeditions finish after the last timer elapses. That means, this can
    /// happen without any new requests. To make sure you do not access an
    /// expedition, that has elapsed, you access expeditions with this
    #[must_use]
    pub fn active(&self) -> Option<&Expedition> {
        self.active.as_ref().filter(|a| !a.is_finished())
    }

    /// Expeditions finish after the last timer elapses. That means, this can
    /// happen without any new requests. To make sure you do not access an
    /// expedition, that has elapsed, you access expeditions with this
    #[must_use]
    pub fn active_mut(&mut self) -> Option<&mut Expedition> {
        self.active.as_mut().filter(|a| !a.is_finished())
    }
}

/// Information about the current state of the dice game
#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct DiceGame {
    /// The amount of dice games you can still play today
    pub remaining: u8,
    /// The next free dice game can be played at this point in time
    pub next_free: Option<DateTime<Local>>,
    /// These are the dices, that are laying on the table after the first
    /// round. The ones you can select to keep from
    pub current_dice: Vec<DiceType>,
    /// Whatever we won in the dice game
    pub reward: Option<DiceReward>,
}

/// The tasks you will presented with, when clicking the person in the tavern.
/// Make sure you are not currently busy and have enough ALU/thirst of adventure
/// before trying to start them
#[derive(Debug, Clone)]
#[allow(missing_docs)]
pub enum AvailableTasks<'a> {
    Quests(&'a [Quest; 3]),
    Expeditions(&'a [AvailableExpedition]),
}

impl Tavern {
    /// Checks if the player is currently doing anything. Note that this may
    /// change between calls, as expeditions finish without sending any collect
    /// commands. In most cases you should match on the `current_action`
    /// yourself and collect/wait, if necessary, but if you want a quick sanity
    /// check somewhere, to make sure you are idle, this is the function for you
    #[must_use]
    pub fn is_idle(&self) -> bool {
        match self.current_action {
            CurrentAction::Idle => true,
            CurrentAction::Expedition => self.expeditions.active.is_none(),
            _ => false,
        }
    }

    /// Gives you the same tasks, that the person in the tavern would present
    /// you with. When expeditions are available and they are not disabled by
    /// the `questing_preference`, they will be shown. Otherwise you will get
    /// quests
    #[must_use]
    pub fn available_tasks(&self) -> AvailableTasks<'_> {
        if self.questing_preference == ExpeditionSetting::PreferExpeditions
            && self.expeditions.is_event_ongoing()
        {
            AvailableTasks::Expeditions(&self.expeditions.available)
        } else {
            AvailableTasks::Quests(&self.quests)
        }
    }

    /// The expedition/questing setting can only be changed, before any
    /// alu/thirst for adventure is used that day
    #[must_use]
    pub fn can_change_questing_preference(&self) -> bool {
        self.thirst_for_adventure_sec == 6000 && self.beer_drunk == 0
    }
}

/// One of the three possible quests in the tavern
#[derive(Debug, Default, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Quest {
    /// The length of this quest in sec (without item enchantment)
    pub base_length: u32,
    /// The silver reward for this quest (without item enchantment)
    pub base_silver: u32,
    /// The xp reward for this quest (without item enchantment)
    pub base_experience: u32,
    /// The item reward for this quest
    pub item: Option<Item>,
    /// The place where this quest takes place. Useful for the scrapbook
    pub location_id: Location,
    /// The enemy you fight in this quest. Useful for the scrapbook
    pub monster_id: u16,
}

/// The background/location for a quest, or another activity
#[derive(Debug, Default, Clone, PartialEq, Eq, Copy, FromPrimitive, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum Location {
    #[default]
    SprawlingJungle = 1,
    SkullIsland,
    EvernightForest,
    StumbleSteppe,
    ShadowrockMountain,
    SplitCanyon,
    BlackWaterSwamp,
    FloodedCaldwell,
    TuskMountain,
    MoldyForest,
    Nevermoor,
    BustedLands,
    Erogenion,
    Magmaron,
    SunburnDesert,
    Gnarogrim,
    Northrunt,
    BlackForest,
    Maerwynn,
    PlainsOfOzKorr,
    RottenLands,
}

impl Quest {
    /// Checks if this is a red quest, which means a special enemy + extra
    /// rewards
    #[must_use]
    pub fn is_red(&self) -> bool {
        matches!(self.monster_id, 139 | 145 | 148 | 152 | 155 | 157)
    }

    pub(crate) fn update(&mut self, data: &[i64]) -> Result<(), SFError> {
        // NOTE: I think [0], [1] was just flavor text
        self.monster_id = data.csimget(2, "quest monster id", 0, |a| -a)?;
        self.location_id = data
            .cfpget(3, "quest location id", |a| a)?
            .unwrap_or_default();
        self.base_length = data.csiget(4, "quest length", 100_000)?;
        self.base_experience = data.csiget(5, "quest xp", 0)?;
        self.base_silver = data.csiget(6, "quest silver", 0)?;
        Ok(())
    }
}

/// The thing the player is currently doing
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum CurrentAction {
    /// The character is not doing anything and can basically do anything
    #[default]
    Idle,
    /// The character is working on guard duty right now. If `busy_until <
    /// Local::now()`, you can send a `WorkFinish` command
    CityGuard {
        /// The total amount of hours the character has decided to work
        hours: u8,
        /// The time at which the guard job will be over
        busy_until: DateTime<Local>,
    },
    /// The character is doing a quest right now. If `busy_until <
    /// Local::now()` you can send a `FinishQuest` command
    Quest {
        /// 0-2 index into tavern quest array
        quest_idx: u8,
        /// The time, at which the quest can be finished
        busy_until: DateTime<Local>,
    },
    /// The player is currently doing an expedition. This can be wrong, if the
    /// last expedition timer elapsed since sending the last request
    Expedition,
    /// The character is not able to do something, but we do not know what.
    /// Most likely something from a new update
    Unknown(Option<DateTime<Local>>),
}

impl CurrentAction {
    pub(crate) fn parse(
        id: i64,
        sec: i64,
        busy_until: Option<DateTime<Local>>,
    ) -> Self {
        // XXX: Sometimes the game "forgets" when an action was supposed to end.
        // This only happens when the action is very old, so falling back to a
        // busy_until that is super old is fine here
        let busy_until = busy_until.unwrap_or_default();
        match id {
            0 => CurrentAction::Idle,
            1 => CurrentAction::CityGuard {
                hours: soft_into(sec, "city guard time", 10),
                busy_until,
            },
            2 => CurrentAction::Quest {
                quest_idx: soft_into(sec, "quest index", 0),
                busy_until,
            },
            4 => CurrentAction::Expedition,
            _ => {
                error!("Unknown action id combination: {id}, {busy_until:?}");
                CurrentAction::Unknown(Some(busy_until))
            }
        }
    }
}

/// The unlocked toilet, that you can throw items into
#[derive(Debug, Clone, Default, Copy)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Toilet {
    /// The level the aura is at currently
    pub aura: u32,
    /// The amount of mana currently in the toilet
    pub mana_currently: u32,
    /// The total amount of mana you have to collect to flush the toilet
    pub mana_total: u32,
    // The amount of sacrifices you have left today
    pub sacrifices_left: u32,
}

impl Toilet {
    pub(crate) fn update(
        &mut self,
        data: &[i64],
        server_time: ServerTime,
    ) -> Result<(), SFError> {
        self.aura = data.csiget(0, "aura level", 0)?;
        self.mana_currently = data.csiget(1, "mana now", 0)?;
        // TODO: What is this? Last time we flushed/got an item?
        let _unknown_time = data.cstget(2, "mana time", server_time)?;
        self.mana_total = data.csiget(3, "mana missing", 1000)?;
        Ok(())
    }
}

/// The state of an ongoing expedition
#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Expedition {
    /// The items collected durign the expedition
    pub items: [Option<ExpeditionThing>; 4],

    /// The thing, that we are searching on this expedition
    pub target_thing: ExpeditionThing,
    /// The amount of the target item we have found
    pub target_current: u8,
    /// The amount of the target item that we are supposed to find
    pub target_amount: u8,

    /// The level we are currently clearing. Starts at 1
    pub current_floor: u8,
    ///  The heroism we have collected so far
    pub heroism: i32,

    pub(crate) floor_stage: i64,

    /// Choose one of these rewards
    pub(crate) rewards: Vec<Reward>,
    pub(crate) halftime_for_boss_id: i64,
    /// If we encountered a boss, this will contain information about it
    pub(crate) boss: ExpeditionBoss,
    /// The different encounters, that you can choose between. Should be 3
    pub(crate) encounters: Vec<ExpeditionEncounter>,
    pub(crate) busy_until: Option<DateTime<Local>>,
    pub(crate) busy_since: Option<DateTime<Local>>,
}

impl Expedition {
    pub(crate) fn update_encounters(&mut self, data: &[i64]) {
        if !data.len().is_multiple_of(2) {
            warn!("weird encounters: {data:?}");
        }
        let default_ecp = |ci| {
            warn!("Unknown encounter: {ci}");
            ExpeditionThing::Unknown
        };
        self.encounters = data
            .chunks_exact(2)
            .filter_map(|ci| {
                let raw = *ci.first()?;
                let typ = FromPrimitive::from_i64(raw)
                    .unwrap_or_else(|| default_ecp(raw));
                let heroism = soft_into(*ci.get(1)?, "e heroism", 0);
                Some(ExpeditionEncounter { typ, heroism })
            })
            .collect();
    }

    /// Returns the current stage the player is doing. This is dependent on
    /// time, because the timers are lazily evaluated. That means it might
    /// flip from Waiting->Encounters/Finished between calls
    #[must_use]
    pub fn current_stage(&self) -> ExpeditionStage {
        let cross_roads =
            || ExpeditionStage::Encounters(self.encounters.clone());

        match self.floor_stage {
            1 => cross_roads(),
            2 => ExpeditionStage::Boss(self.boss),
            3 => ExpeditionStage::Rewards(self.rewards.clone()),
            4 => match self.busy_until {
                Some(x) if x > Local::now() => ExpeditionStage::Waiting {
                    busy_until: x,
                    busy_since: self.busy_since.unwrap_or_default(),
                },
                _ if self.current_floor == 10 => ExpeditionStage::Finished,
                _ => cross_roads(),
            },
            _ => ExpeditionStage::Unknown,
        }
    }

    /// Checks, if the last timer of this expedition has run out
    #[must_use]
    pub fn is_finished(&self) -> bool {
        matches!(self.current_stage(), ExpeditionStage::Finished)
    }
}

/// The current thing, that would be on screen, when using the web client
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ExpeditionStage {
    /// Choose one of these rewards after winning against the boss
    Rewards(Vec<Reward>),
    /// If we encountered a boss, this will contain information about it
    Boss(ExpeditionBoss),
    /// The different encounters, that you can choose between. Should be <= 3
    Encounters(Vec<ExpeditionEncounter>),
    /// We have to wait until the specified time to continue in the expedition.
    /// When this is `< Local::now()`, you can send the update command to
    /// update the expedition stage, which will make `current_stage()`
    /// yield the new encounters
    Waiting {
        /// The time at which the next stage will be available
        busy_since: DateTime<Local>,
        /// The start time of this waiting period
        busy_until: DateTime<Local>,
    },
    /// The expedition has finished and you can choose another one
    Finished,
    /// Something strange happened and the current stage is not known. Feel
    /// free to try anything from logging in again to just continuing
    Unknown,
}

impl Default for ExpeditionStage {
    fn default() -> Self {
        ExpeditionStage::Encounters(Vec::new())
    }
}

/// The monster you fight after 5 and 10 expedition encounters
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ExpeditionBoss {
    /// The monster id of this boss
    pub id: i64,
    /// The amount of items this boss is supposed to drop
    pub items: u8,
}

/// One of up to three encounters you can find. In comparison to
/// `ExpeditionThing`, this also includes the expected heroism
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ExpeditionEncounter {
    /// The type of thing you engage, or find on this path
    pub typ: ExpeditionThing,
    /// The base heroism you get from picking this encounter. This does not
    /// contains the bonus from bounties
    pub heroism: i32,
}

/// The type of something you can encounter on the expedition. Can also be found
/// as the target, or in the items section
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs, clippy::doc_markdown)]
pub enum ExpeditionThing {
    #[default]
    Unknown = 0,

    Dummy1 = 1,
    Dummy2 = 2,
    Dummy3 = 3,

    ToiletPaper = 11,

    Bait = 21,
    /// New name: `DragonTaming`
    Dragon = 22,

    CampFire = 31,
    Phoenix = 32,
    /// New name: `ExtinguishedCampfire`
    BurntCampfire = 33,

    UnicornHorn = 41,
    Donkey = 42,
    Rainbow = 43,
    /// New name: `UnicornWhisperer`
    Unicorn = 44,

    CupCake = 51,
    /// New name: `SucklingPig`
    Cake = 61,

    SmallHurdle = 71,
    BigHurdle = 72,
    /// New name: `PodiumClimber`
    WinnersPodium = 73,

    Socks = 81,
    ClothPile = 82,
    /// New name: `RevealingLady`
    RevealingCouple = 83,

    SwordInStone = 91,
    BentSword = 92,
    BrokenSword = 93,

    Well = 101,
    Girl = 102,
    /// New name: `BewitchedStew`
    Balloons = 103,

    Prince = 111,
    /// New name: `ToxicFountainCure`
    RoyalFrog = 112,

    Hand = 121,
    Feet = 122,
    Body = 123,
    // New name: BuildAFriend
    Klaus = 124,

    Key = 131,
    Suitcase = 132,

    FishingRod = 141,
    FishingBait = 142,
    Merman = 143,

    Mugs = 151,
    DraftBeer = 152,
    Barkeeper = 153,

    Chicken = 161,
    Tiger = 162,
    RidingStan = 163,

    // These may just be the event ones
    Cupid = 171,
    LovestruckShakes = 172,
    LoveBirds = 173,

    // Dont know if they all exist tbh
    DummyBounty = 1000,
    ToiletPaperBounty = 1001,
    DragonBounty = 1002,
    BurntCampfireBounty = 1003,
    UnicornBounty = 1004,
    WinnerPodiumBounty = 1007,
    RevealingCoupleBounty = 1008,
    BrokenSwordBounty = 1009,
    BaloonBounty = 1010,
    FrogBounty = 1011,
    KlausBounty = 1012,
    // 1013 has to be a bounty for something, right?
    MermanBounty = 1014,
    BarkeeperBounty = 1015,
    StanBounty = 1016,
    LoveBirdBounty = 1017,
}

impl ExpeditionThing {
    /// Returns the associated bounty item required to get a +10 bonus for
    /// picking up this item
    #[must_use]
    #[allow(clippy::enum_glob_use)]
    pub fn required_bounty(&self) -> Option<ExpeditionThing> {
        use ExpeditionThing::*;
        Some(match self {
            Dummy1 | Dummy2 | Dummy3 => DummyBounty,
            ToiletPaper => ToiletPaperBounty,
            Dragon => DragonBounty,
            BurntCampfire => BurntCampfireBounty,
            Unicorn => UnicornBounty,
            WinnersPodium => WinnerPodiumBounty,
            RevealingCouple => RevealingCoupleBounty,
            BrokenSword => BrokenSwordBounty,
            Balloons => BaloonBounty,
            RoyalFrog => FrogBounty,
            Klaus => KlausBounty,
            Merman => MermanBounty,
            RidingStan => StanBounty,
            Barkeeper => BarkeeperBounty,
            LoveBirds => LoveBirdBounty,
            _ => return None,
        })
    }

    /// If the thing is a bounty, this will contain all the things, that receive
    /// a bonus
    #[must_use]
    #[allow(clippy::enum_glob_use)]
    pub fn is_bounty_for(&self) -> Option<&'static [ExpeditionThing]> {
        use ExpeditionThing::*;
        Some(match self {
            DummyBounty => &[Dummy1, Dummy2, Dummy3],
            ToiletPaperBounty => &[ToiletPaper],
            DragonBounty => &[Dragon],
            BurntCampfireBounty => &[BurntCampfire],
            UnicornBounty => &[Unicorn],
            WinnerPodiumBounty => &[WinnersPodium],
            RevealingCoupleBounty => &[RevealingCouple],
            BrokenSwordBounty => &[BrokenSword],
            BaloonBounty => &[Balloons],
            FrogBounty => &[RoyalFrog],
            KlausBounty => &[Klaus],
            MermanBounty => &[Merman],
            StanBounty => &[RidingStan],
            BarkeeperBounty => &[Barkeeper],
            LoveBirdBounty => &[LoveBirds],
            _ => return None,
        })
    }
}

/// Information about a possible expedition, that you could start
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct AvailableExpedition {
    /// The target, that will be collected during the expedition
    pub target: ExpeditionThing,
    /// The amount of thirst for adventure, that selecting this expedition
    /// costs and also the expected time the two waiting periods take
    pub thirst_for_adventure_sec: u32,
    /// The first location, that you visit during the expedition. Might
    /// influence the haltime monsters type
    pub location_1: Location,
    /// The second location, that you visit during the expedition. Might
    /// influence the final monsters type
    pub location_2: Location,
    /// Anything special about this expedition, that may be relevant for us to
    /// pick this
    pub special: Option<ExpeditionSpecial>,
}

/// A special reward, that will be encountered, or earned by going on this
/// expedition
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum ExpeditionSpecial {
    /// This expedition will have an egg to collect
    Egg = 1,
    /// This expedition will advance a daily task
    DailyTask,
}

/// The amount, that you either won or lost gambling. If the value is negative,
/// you lost
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum GambleResult {
    SilverChange(i64),
    MushroomChange(i32),
}