Skip to content

Commit a677d35

Browse files
committed
Moving Species Numbers to fcea config files
1 parent 67bafd2 commit a677d35

3 files changed

Lines changed: 48 additions & 12 deletions

File tree

app/Domain/CatchEmAll/Enums/SpeciesRarity.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ public function getIcon(): string
6868
public function getPoints(): int
6969
{
7070
return match ($this) {
71-
self::COMMON => 1,
72-
self::UNCOMMON => 2,
73-
self::RARE => 5,
74-
self::EPIC => 10,
75-
self::LEGENDARY => 25,
71+
self::COMMON => config('fcea.species_rarity_value_common'),
72+
self::UNCOMMON => config('fcea.species_rarity_value_uncommon'),
73+
self::RARE => config('fcea.species_rarity_value_rare'),
74+
self::EPIC => config('fcea.species_rarity_value_epic'),
75+
self::LEGENDARY => config('fcea.species_rarity_value_legendary'),
7676
};
7777
}
78-
}
78+
}

app/Domain/CatchEmAll/Models/UserCatch.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public function getSpeciesRarity(): SpeciesRarity
5353
})->count();
5454

5555
return match (true) {
56-
$speciesCount >= 100 => SpeciesRarity::COMMON,
57-
$speciesCount >= 50 => SpeciesRarity::UNCOMMON,
58-
$speciesCount >= 20 => SpeciesRarity::RARE,
59-
$speciesCount >= 5 => SpeciesRarity::EPIC,
56+
$speciesCount >= config('fcea.species_rarity_threshold_common') => SpeciesRarity::COMMON,
57+
$speciesCount >= config('fcea.species_rarity_threshold_uncommon') => SpeciesRarity::UNCOMMON,
58+
$speciesCount >= config('fcea.species_rarity_threshold_rare') => SpeciesRarity::RARE,
59+
$speciesCount >= config('fcea.species_rarity_threshold_epic') => SpeciesRarity::EPIC,
6060
default => SpeciesRarity::LEGENDARY,
6161
};
6262
}
@@ -71,4 +71,4 @@ public function getActivitylogOptions(): LogOptions
7171
return LogOptions::defaults()
7272
->logOnly(['user_id', 'fursuit_id', 'points_earned']);
7373
}
74-
}
74+
}

config/fcea.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,52 @@
1313

1414
'fursuit_catch_code_length' => env('FURSUIT_CATCH_CODE_LENGTH', 5),
1515

16+
1617
/*
1718
|--------------------------------------------------------------------------
1819
| Fursuit Catch Attempts per Minute
1920
|--------------------------------------------------------------------------
2021
|
2122
| Amount of times per 60 seconds a user can submit a Fursuit Catch Code
2223
| in attempt to catch a fursuiter. Will respond "429 Too Many Requests" if triggered.
23-
| Used to prevent bruteforcing attempts.
24+
| Used to prevent bruteforce attempts.
2425
|
2526
*/
2627

2728
'fursuit_catch_attempts_per_minute' => env('FURSUIT_CATCH_ATTEMPTS_PER_MINUTE', 20),
29+
30+
31+
/*
32+
|--------------------------------------------------------------------------
33+
| Fursuit Species Rarity Threshold
34+
|--------------------------------------------------------------------------
35+
|
36+
| Fursuit Species is given a rarity based on the amount it appears among all fursuiter
37+
| If a species appear more often than the threshold, it is considered this rarity
38+
|
39+
*/
40+
41+
'species_rarity_threshold_common' => env('SPECIES_RARITY_THRESHOLD_COMMON', 100),
42+
'species_rarity_threshold_uncommon' => env('SPECIES_RARITY_THRESHOLD_UNCOMMON', 50),
43+
'species_rarity_threshold_rare' => env('SPECIES_RARITY_THRESHOLD_RARE', 20),
44+
'species_rarity_threshold_epic' => env('SPECIES_RARITY_THRESHOLD_EPIC', 5),
45+
// If none of this applies, the species is considered legendary
46+
//'species_rarity_threshold_legendary' => env('SPECIES_RARITY_THRESHOLD_LEGENDARY', 1),
47+
48+
49+
/*
50+
|--------------------------------------------------------------------------
51+
| Fursuit Species Value on catch
52+
|--------------------------------------------------------------------------
53+
|
54+
| Sets the points granted when catching a fursuiter.
55+
| The rarer the fursuit species exists among all registered fursuits the more points it shall grant
56+
|
57+
*/
58+
59+
'species_rarity_value_common' => env('SPECIES_RARITY_VALUE_COMMON', 1),
60+
'species_rarity_value_uncommon' => env('SPECIES_RARITY_VALUE_UNCOMMON', 2),
61+
'species_rarity_value_rare' => env('SPECIES_RARITY_VALUE_RARE', 5),
62+
'species_rarity_value_epic' => env('SPECIES_RARITY_VALUE_EPIC', 10),
63+
'species_rarity_value_legendary' => env('SPECIES_RARITY_VALUE_LEGENDARY', 25),
2864
];

0 commit comments

Comments
 (0)