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
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
pub mod arthropod;
pub mod biped_large;
pub mod biped_small;
pub mod bird_large;
pub mod bird_medium;
pub mod crustacean;
pub mod dragon;
pub mod fish_medium;
pub mod fish_small;
pub mod golem;
pub mod humanoid;
pub mod item_drop;
pub mod object;
pub mod quadruped_low;
pub mod quadruped_medium;
pub mod quadruped_small;
pub mod ship;
pub mod theropod;

use crate::{
    assets::{self, Asset},
    consts::{HUMAN_DENSITY, WATER_DENSITY},
    make_case_elim,
    npc::NpcKind,
};
use common_i18n::Content;
use serde::{Deserialize, Serialize};
use specs::{Component, DerefFlaggedStorage};
use strum::Display;
use vek::*;

use super::{BuffKind, Collider, Density, Mass, Scale};

make_case_elim!(
    body,
    #[derive(Copy, Clone, Debug, Display, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize)]
    #[repr(u32)]
    pub enum Body {
        Humanoid(body: humanoid::Body) = 0,
        QuadrupedSmall(body: quadruped_small::Body) = 1,
        QuadrupedMedium(body: quadruped_medium::Body) = 2,
        BirdMedium(body: bird_medium::Body) = 3,
        FishMedium(body: fish_medium::Body) = 4,
        Dragon(body: dragon::Body) = 5,
        BirdLarge(body: bird_large::Body) = 6,
        FishSmall(body: fish_small::Body) = 7,
        BipedLarge(body: biped_large::Body)= 8,
        BipedSmall(body: biped_small::Body)= 9,
        Object(body: object::Body) = 10,
        Golem(body: golem::Body) = 11,
        Theropod(body: theropod::Body) = 12,
        QuadrupedLow(body: quadruped_low::Body) = 13,
        Ship(body: ship::Body) = 14,
        Arthropod(body: arthropod::Body) = 15,
        ItemDrop(body: item_drop::Body) = 16,
        Crustacean(body: crustacean::Body) = 17,
    }
);

// Implemented for Buff, to be able to implement EnumIter.
impl Default for Body {
    fn default() -> Self {
        Body::QuadrupedSmall(quadruped_small::Body {
            species: quadruped_small::Species::Frog,
            body_type: quadruped_small::BodyType::Female,
        })
    }
}

/// Data representing data generic to the body together with per-species data.
///
/// NOTE: Deliberately don't (yet?) implement serialize.
#[derive(Clone, Debug, Deserialize)]
pub struct BodyData<BodyMeta, SpeciesData> {
    /// Shared metadata for this whole body type.
    pub body: BodyMeta,
    /// All the metadata for species with this body type.
    pub species: SpeciesData,
}

/// Metadata intended to be stored per-body, together with data intended to be
/// stored for each species for each body.
///
/// NOTE: Deliberately don't (yet?) implement serialize.
/// NOTE: If you are adding new body kind and it should be spawned via /spawn
/// please add it to `[ENTITIES](crate::cmd::ENTITIES)`
#[derive(Clone, Debug, Deserialize)]
pub struct AllBodies<BodyMeta, SpeciesMeta> {
    pub humanoid: BodyData<BodyMeta, humanoid::AllSpecies<SpeciesMeta>>,
    pub quadruped_small: BodyData<BodyMeta, quadruped_small::AllSpecies<SpeciesMeta>>,
    pub quadruped_medium: BodyData<BodyMeta, quadruped_medium::AllSpecies<SpeciesMeta>>,
    pub bird_medium: BodyData<BodyMeta, bird_medium::AllSpecies<SpeciesMeta>>,
    pub fish_medium: BodyData<BodyMeta, fish_medium::AllSpecies<SpeciesMeta>>,
    pub dragon: BodyData<BodyMeta, dragon::AllSpecies<SpeciesMeta>>,
    pub bird_large: BodyData<BodyMeta, bird_large::AllSpecies<SpeciesMeta>>,
    pub fish_small: BodyData<BodyMeta, fish_small::AllSpecies<SpeciesMeta>>,
    pub biped_large: BodyData<BodyMeta, biped_large::AllSpecies<SpeciesMeta>>,
    pub biped_small: BodyData<BodyMeta, biped_small::AllSpecies<SpeciesMeta>>,
    pub object: BodyData<BodyMeta, ()>,
    pub item_drop: BodyData<BodyMeta, ()>,
    pub golem: BodyData<BodyMeta, golem::AllSpecies<SpeciesMeta>>,
    pub theropod: BodyData<BodyMeta, theropod::AllSpecies<SpeciesMeta>>,
    pub quadruped_low: BodyData<BodyMeta, quadruped_low::AllSpecies<SpeciesMeta>>,
    pub ship: BodyData<BodyMeta, ()>,
    pub arthropod: BodyData<BodyMeta, arthropod::AllSpecies<SpeciesMeta>>,
    pub crustacean: BodyData<BodyMeta, crustacean::AllSpecies<SpeciesMeta>>,
}

impl<BodyMeta, SpeciesMeta> AllBodies<BodyMeta, SpeciesMeta> {
    /// Get species meta associated with the body.
    ///
    /// Returns `None` if the body doesn't have any associated meta, i.e ships,
    /// objects, itemdrops.
    pub fn get_species_meta<'a>(&'a self, body: &Body) -> Option<&'a SpeciesMeta> {
        Some(match body {
            Body::Humanoid(b) => &self.humanoid.species[&b.species],
            Body::QuadrupedSmall(b) => &self.quadruped_small.species[&b.species],
            Body::QuadrupedMedium(b) => &self.quadruped_medium.species[&b.species],
            Body::BirdMedium(b) => &self.bird_medium.species[&b.species],
            Body::BirdLarge(b) => &self.bird_large.species[&b.species],
            Body::FishMedium(b) => &self.fish_medium.species[&b.species],
            Body::Dragon(b) => &self.dragon.species[&b.species],
            Body::FishSmall(b) => &self.fish_small.species[&b.species],
            Body::BipedLarge(b) => &self.biped_large.species[&b.species],
            Body::BipedSmall(b) => &self.biped_small.species[&b.species],
            Body::Golem(b) => &self.golem.species[&b.species],
            Body::Theropod(b) => &self.theropod.species[&b.species],
            Body::QuadrupedLow(b) => &self.quadruped_low.species[&b.species],
            Body::Arthropod(b) => &self.arthropod.species[&b.species],
            Body::Crustacean(b) => &self.crustacean.species[&b.species],
            _ => return None,
        })
    }
}

/// Can only retrieve body metadata by direct index.
impl<BodyMeta, SpeciesMeta> core::ops::Index<NpcKind> for AllBodies<BodyMeta, SpeciesMeta> {
    type Output = BodyMeta;

    #[inline]
    fn index(&self, index: NpcKind) -> &Self::Output {
        match index {
            NpcKind::Humanoid => &self.humanoid.body,
            NpcKind::Pig => &self.quadruped_small.body,
            NpcKind::Wolf => &self.quadruped_medium.body,
            NpcKind::Duck => &self.bird_medium.body,
            NpcKind::Phoenix => &self.bird_large.body,
            NpcKind::Marlin => &self.fish_medium.body,
            NpcKind::Clownfish => &self.fish_small.body,
            NpcKind::Ogre => &self.biped_large.body,
            NpcKind::Gnome => &self.biped_small.body,
            NpcKind::StoneGolem => &self.golem.body,
            NpcKind::Archaeos => &self.theropod.body,
            NpcKind::Reddragon => &self.dragon.body,
            NpcKind::Crocodile => &self.quadruped_low.body,
            NpcKind::Tarantula => &self.arthropod.body,
            NpcKind::Crab => &self.crustacean.body,
        }
    }
}

/// Can only retrieve body metadata by direct index.
impl<'a, BodyMeta, SpeciesMeta> core::ops::Index<&'a Body> for AllBodies<BodyMeta, SpeciesMeta> {
    type Output = BodyMeta;

    #[inline]
    fn index(&self, index: &Body) -> &Self::Output {
        match index {
            Body::Humanoid(_) => &self.humanoid.body,
            Body::QuadrupedSmall(_) => &self.quadruped_small.body,
            Body::QuadrupedMedium(_) => &self.quadruped_medium.body,
            Body::BirdMedium(_) => &self.bird_medium.body,
            Body::BirdLarge(_) => &self.bird_large.body,
            Body::FishMedium(_) => &self.fish_medium.body,
            Body::Dragon(_) => &self.dragon.body,
            Body::FishSmall(_) => &self.fish_small.body,
            Body::BipedLarge(_) => &self.biped_large.body,
            Body::BipedSmall(_) => &self.biped_small.body,
            Body::Object(_) => &self.object.body,
            Body::ItemDrop(_) => &self.item_drop.body,
            Body::Golem(_) => &self.golem.body,
            Body::Theropod(_) => &self.theropod.body,
            Body::QuadrupedLow(_) => &self.quadruped_low.body,
            Body::Arthropod(_) => &self.arthropod.body,
            Body::Ship(_) => &self.ship.body,
            Body::Crustacean(_) => &self.crustacean.body,
        }
    }
}

impl<
    BodyMeta: Send + Sync + for<'de> serde::Deserialize<'de> + 'static,
    SpeciesMeta: Send + Sync + for<'de> serde::Deserialize<'de> + 'static,
> Asset for AllBodies<BodyMeta, SpeciesMeta>
{
    type Loader = assets::RonLoader;

    const EXTENSION: &'static str = "ron";
}

/// Semantic gender aka body_type
///
/// Should be used for localization with extreme care.
/// For basically everything except *maybe* humanoids, it's simply wrong to
/// assume that this may be used as grammatical gender.
///
/// TODO: remove this and instead add GUI for players to choose preferred
/// gender. Read a comment for `gender_str` in voxygen/i18n-helpers/src/lib.rs.
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum Gender {
    Masculine,
    Feminine,
}

impl Body {
    pub fn is_same_species_as(&self, other: &Body) -> bool {
        match self {
            Body::Humanoid(b1) => match other {
                Body::Humanoid(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::QuadrupedSmall(b1) => match other {
                Body::QuadrupedSmall(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::QuadrupedMedium(b1) => match other {
                Body::QuadrupedMedium(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::BirdMedium(b1) => match other {
                Body::BirdMedium(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::BirdLarge(b1) => match other {
                Body::BirdLarge(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::FishMedium(b1) => match other {
                Body::FishMedium(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::Dragon(b1) => match other {
                Body::Dragon(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::FishSmall(b1) => match other {
                Body::FishSmall(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::BipedLarge(b1) => match other {
                Body::BipedLarge(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::BipedSmall(b1) => match other {
                Body::BipedSmall(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::Object(_) => false,
            Body::ItemDrop(_) => false,
            Body::Golem(b1) => match other {
                Body::Golem(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::Theropod(b1) => match other {
                Body::Theropod(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::QuadrupedLow(b1) => match other {
                Body::QuadrupedLow(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::Arthropod(b1) => match other {
                Body::Arthropod(b2) => b1.species == b2.species,
                _ => false,
            },
            Body::Ship(_) => false,
            Body::Crustacean(b1) => match other {
                Body::Crustacean(b2) => b1.species == b2.species,
                _ => false,
            },
        }
    }

    pub fn is_humanoid(&self) -> bool { matches!(self, Body::Humanoid(_)) }

    pub fn is_campfire(&self) -> bool { matches!(self, Body::Object(object::Body::CampfireLit)) }

    pub fn is_portal(&self) -> bool {
        matches!(
            self,
            Body::Object(object::Body::Portal | object::Body::PortalActive)
        )
    }

    pub fn bleeds(&self) -> bool {
        !matches!(
            self,
            Body::Object(_) | Body::Ship(_) | Body::ItemDrop(_) | Body::Golem(_)
        )
    }

    /// The length of the stride of the body, in metres (not accounting for
    /// different legs)
    pub fn stride_length(&self) -> f32 {
        if let Body::Humanoid(body) = self {
            body.scaler() * 3.75
        } else {
            // Rough heuristic
            let dims = self.dimensions();
            0.65 + (dims.y + dims.z) * 0.6
        }
    }

    pub fn scale(&self) -> Scale {
        let s = match self {
            Body::BirdMedium(bird_medium) => match bird_medium.species {
                bird_medium::Species::Bat => 0.5,
                _ => 1.0,
            },
            _ => 1.0,
        };
        Scale(s)
    }

    /// Average density of the body
    // Units are based on kg/m³
    pub fn density(&self) -> Density {
        let d = match self {
            // based on a house sparrow (Passer domesticus)
            Body::BirdMedium(_) => 700.0,
            Body::BirdLarge(_) => 2_200.0,

            Body::Dragon(_) => 5_000.0,

            Body::Golem(_) => WATER_DENSITY * 2.5,
            Body::Humanoid(_) => HUMAN_DENSITY,
            Body::Ship(ship) => ship.density().0,
            Body::Object(object) => object.density().0,
            Body::ItemDrop(item_drop) => item_drop.density().0,
            _ => HUMAN_DENSITY,
        };
        Density(d)
    }

    // Values marked with ~✅ are checked based on their RL equivalent.
    // Discrepancy in size compared to their RL equivalents has not necessarily been
    // taken into account.
    pub fn mass(&self) -> Mass {
        let m = match self {
            Body::BipedLarge(body) => match body.species {
                biped_large::Species::Slysaurok => 400.0,
                biped_large::Species::Occultsaurok => 400.0,
                biped_large::Species::Mightysaurok => 400.0,
                biped_large::Species::Mindflayer => 420.0,
                biped_large::Species::Minotaur => 500.0,
                biped_large::Species::Cavetroll => 600.0,
                biped_large::Species::Mountaintroll => 600.0,
                biped_large::Species::Swamptroll => 600.0,
                biped_large::Species::Gigasfrost => 400.0,
                biped_large::Species::AdletElder => 350.0,
                biped_large::Species::HaniwaGeneral => 360.0,
                biped_large::Species::TerracottaBesieger
                | biped_large::Species::TerracottaDemolisher
                | biped_large::Species::TerracottaPunisher
                | biped_large::Species::TerracottaPursuer
                | biped_large::Species::Cursekeeper => 380.0,
                biped_large::Species::Forgemaster => 1600.0,
                _ => 400.0,
            },
            Body::BipedSmall(body) => match body.species {
                biped_small::Species::IronDwarf => 1000.0,
                biped_small::Species::Flamekeeper => 1000.0,
                _ => 50.0,
            },
            // ravens are 0.69-2 kg, crows are 0.51 kg on average.
            Body::BirdMedium(body) => match body.species {
                bird_medium::Species::SnowyOwl => 3.0,
                bird_medium::Species::HornedOwl => 3.0,
                bird_medium::Species::Duck => 3.5,
                bird_medium::Species::Cockatiel => 2.0,
                bird_medium::Species::Chicken => 2.5, // ~✅ Red junglefowl are 1-1.5 kg
                bird_medium::Species::Bat => 1.5,
                bird_medium::Species::Penguin => 10.0,
                bird_medium::Species::Eagle => 7.0, // ~✅ Steller's sea eagle are 5-9 kg
                bird_medium::Species::Goose => 3.5, // ~✅ Swan geese are 2.8-3.5 kg
                bird_medium::Species::Parrot => 1.0,
                bird_medium::Species::Peacock => 6.0,
                bird_medium::Species::Crow => 3.0,
                bird_medium::Species::Dodo => 4.0,
                bird_medium::Species::Parakeet => 1.0,
                bird_medium::Species::Puffin => 2.0,
                bird_medium::Species::Toucan => 4.5,
            },
            Body::BirdLarge(_) => 250.0,
            Body::Dragon(_) => 20_000.0,
            Body::FishMedium(_) => 5.0,
            Body::FishSmall(_) => 1.0,
            Body::Golem(_) => 10_000.0,
            Body::Humanoid(humanoid) => {
                // Understand that changing the mass values can have effects
                // on multiple systems.
                //
                // If you want to change that value, consult with
                // Physics and Combat teams
                //
                // Weight is proportional height, where
                // a 1.75m character would weigh 65kg
                65.0 * humanoid.height() / 1.75f32
            },
            Body::Object(obj) => obj.mass().0,
            Body::ItemDrop(item_drop) => item_drop.mass().0,
            Body::QuadrupedLow(body) => match body.species {
                quadruped_low::Species::Alligator => 360.0, // ~✅
                quadruped_low::Species::Snaretongue => 280.0,
                quadruped_low::Species::Asp => 300.0,
                // saltwater crocodiles can weigh around 1 ton, but our version is the size of an
                // alligator or smaller, so whatever
                quadruped_low::Species::Crocodile => 360.0,
                quadruped_low::Species::SeaCrocodile => 410.0,
                quadruped_low::Species::Deadwood => 200.0,
                quadruped_low::Species::Monitor => 200.0,
                quadruped_low::Species::Pangolin => 300.0,
                quadruped_low::Species::Salamander => 350.0,
                quadruped_low::Species::Elbst => 350.0,
                quadruped_low::Species::Tortoise => 300.0,
                quadruped_low::Species::Lavadrake => 700.0,
                quadruped_low::Species::Icedrake => 700.0,
                quadruped_low::Species::Mossdrake => 700.0,
                quadruped_low::Species::Rocksnapper => 450.0,
                quadruped_low::Species::Rootsnapper => 450.0,
                quadruped_low::Species::Reefsnapper => 450.0,
                quadruped_low::Species::Maneater => 350.0,
                quadruped_low::Species::Sandshark => 450.0,
                quadruped_low::Species::Hakulaq => 400.0,
                quadruped_low::Species::Dagon => 600.0,
                quadruped_low::Species::Basilisk => 800.0,
                quadruped_low::Species::Driggle => 55.0,
            },
            Body::QuadrupedMedium(body) => match body.species {
                quadruped_medium::Species::Bear => 500.0, // ~✅ (350-700 kg)
                quadruped_medium::Species::Cattle => 575.0, // ~✅ (500-650 kg)
                quadruped_medium::Species::Deer => 80.0,
                quadruped_medium::Species::Donkey => 200.0,
                quadruped_medium::Species::Highland => 200.0,
                quadruped_medium::Species::Horse => 300.0, // ~✅
                quadruped_medium::Species::Kelpie => 250.0,
                quadruped_medium::Species::Lion => 170.0, // ~✅ (110-225 kg)
                quadruped_medium::Species::Panda => 200.0,
                quadruped_medium::Species::Saber => 130.0,
                quadruped_medium::Species::Yak => 200.0,
                quadruped_medium::Species::Dreadhorn => 500.0,
                quadruped_medium::Species::Mammoth => 1500.0,
                quadruped_medium::Species::Catoblepas => 300.0,
                _ => 200.0,
            },
            Body::QuadrupedSmall(body) => match body.species {
                quadruped_small::Species::Axolotl => 1.0,
                quadruped_small::Species::Batfox => 10.0,
                quadruped_small::Species::Beaver => 10.0,
                quadruped_small::Species::Boar => 80.0, // ~✅ (60-100 kg)
                quadruped_small::Species::Cat => 4.0,   // ~✅ (4-5 kg)
                quadruped_small::Species::Dog => 30.0,  // ~✅ (German Shepherd: 30-40 kg)
                quadruped_small::Species::Fox => 10.0,
                quadruped_small::Species::Frog => 1.0,
                quadruped_small::Species::Fungome => 10.0,
                quadruped_small::Species::Gecko => 1.0,
                quadruped_small::Species::Goat => 50.0,
                quadruped_small::Species::Hare => 10.0,
                quadruped_small::Species::Holladon => 60.0,
                quadruped_small::Species::Hyena => 70.0, // ~✅ (vaguely)
                quadruped_small::Species::Jackalope => 10.0,
                quadruped_small::Species::Pig => 20.0,
                quadruped_small::Species::Porcupine => 5.0,
                quadruped_small::Species::Quokka => 10.0,
                quadruped_small::Species::Rabbit => 2.0,
                quadruped_small::Species::Raccoon => 30.0,
                quadruped_small::Species::Rat => 1.0,
                quadruped_small::Species::Sheep => 50.0,
                quadruped_small::Species::Skunk => 5.0,
                quadruped_small::Species::Squirrel => 1.0,
                quadruped_small::Species::Truffler => 70.0,
                quadruped_small::Species::Turtle => 40.0,
                quadruped_small::Species::Seal => 15.0,
                quadruped_small::Species::TreantSapling => 80.0,
                quadruped_small::Species::MossySnail => 5.0,
            },
            Body::Theropod(body) => match body.species {
                // for reference, elephants are in the range of 2.6-6.9 tons
                // and Tyrannosaurus rex were ~8.4-14 tons
                theropod::Species::Archaeos => 8_000.0,
                theropod::Species::Ntouka => 8_000.0,
                theropod::Species::Odonto => 8_000.0,
                theropod::Species::Dodarock => 700.0,
                theropod::Species::Sandraptor => 500.0,
                theropod::Species::Snowraptor => 500.0,
                theropod::Species::Sunlizard => 500.0,
                theropod::Species::Woodraptor => 500.0,
                theropod::Species::Yale => 1_000.0,
                theropod::Species::Axebeak => 300.0,
            },
            Body::Ship(ship) => ship.mass().0,
            Body::Arthropod(_) => 200.0,
            // TODO: mass
            Body::Crustacean(_) => 50.0,
        };
        Mass(m)
    }

    /// The width (shoulder to shoulder), length (nose to tail) and height
    /// respectively (in metres)
    // Code reviewers: should we replace metres with 'block height'?
    pub fn dimensions(&self) -> Vec3<f32> {
        match self {
            Body::BipedLarge(body) => match body.species {
                biped_large::Species::Cyclops => Vec3::new(5.6, 3.0, 8.0),
                biped_large::Species::Dullahan => Vec3::new(4.6, 3.0, 5.5),
                biped_large::Species::Mightysaurok => Vec3::new(4.0, 3.0, 3.4),
                biped_large::Species::Mindflayer => Vec3::new(4.4, 3.0, 8.0),
                biped_large::Species::Minotaur => Vec3::new(6.0, 3.0, 8.0),
                biped_large::Species::Occultsaurok => Vec3::new(4.0, 3.0, 3.4),
                biped_large::Species::Slysaurok => Vec3::new(4.0, 3.0, 3.4),
                biped_large::Species::Werewolf => Vec3::new(4.0, 3.0, 3.5),
                biped_large::Species::Harvester => Vec3::new(4.6, 3.0, 5.4),
                biped_large::Species::Cultistwarlord => Vec3::new(3.0, 3.0, 4.5),
                biped_large::Species::Cultistwarlock => Vec3::new(3.0, 3.0, 3.5),
                biped_large::Species::Huskbrute => Vec3::new(4.6, 3.0, 5.0),
                biped_large::Species::Tursus => Vec3::new(4.0, 3.0, 4.0),
                biped_large::Species::Gigasfrost => Vec3::new(6.0, 3.0, 8.0),
                biped_large::Species::AdletElder => Vec3::new(3.5, 3.0, 5.0),
                biped_large::Species::SeaBishop => Vec3::new(3.7, 2.5, 4.2),
                biped_large::Species::HaniwaGeneral => Vec3::new(3.3, 2.3, 3.8),
                biped_large::Species::TerracottaBesieger => Vec3::new(3.8, 3.0, 5.0),
                biped_large::Species::TerracottaDemolisher => Vec3::new(3.3, 2.5, 3.8),
                biped_large::Species::TerracottaPunisher => Vec3::new(3.3, 2.5, 3.8),
                biped_large::Species::TerracottaPursuer => Vec3::new(3.3, 2.5, 3.8),
                biped_large::Species::Cursekeeper => Vec3::new(3.8, 3.0, 5.0),
                biped_large::Species::Forgemaster => Vec3::new(6.5, 5.0, 8.0),
                _ => Vec3::new(4.6, 3.0, 6.0),
            },
            Body::BipedSmall(body) => match body.species {
                biped_small::Species::Gnarling => Vec3::new(1.0, 0.75, 1.4),
                biped_small::Species::Haniwa => Vec3::new(1.3, 1.0, 2.2),
                biped_small::Species::Adlet => Vec3::new(1.3, 1.0, 2.0),
                biped_small::Species::Sahagin => Vec3::new(1.3, 2.0, 1.7),
                biped_small::Species::Myrmidon => Vec3::new(1.3, 1.0, 2.2),
                biped_small::Species::Husk => Vec3::new(1.7, 0.7, 2.7),
                biped_small::Species::Boreal => Vec3::new(1.3, 2.0, 2.5),
                biped_small::Species::Bushly => Vec3::new(1.2, 1.3, 1.6),
                biped_small::Species::Irrwurz => Vec3::new(1.5, 1.5, 2.0),
                biped_small::Species::IronDwarf => Vec3::new(1.3, 2.0, 2.5),
                biped_small::Species::ShamanicSpirit => Vec3::new(1.3, 2.0, 2.3),
                biped_small::Species::Jiangshi => Vec3::new(1.3, 1.8, 2.5),
                biped_small::Species::Flamekeeper => Vec3::new(1.5, 1.5, 2.5),
                biped_small::Species::TreasureEgg => Vec3::new(1.1, 1.1, 1.4),
                _ => Vec3::new(1.0, 0.75, 1.4),
            },
            Body::BirdLarge(body) => match body.species {
                bird_large::Species::Cockatrice => Vec3::new(2.5, 5.5, 3.5),
                bird_large::Species::Roc => Vec3::new(2.2, 7.5, 4.0),
                bird_large::Species::FlameWyvern
                | bird_large::Species::FrostWyvern
                | bird_large::Species::CloudWyvern
                | bird_large::Species::SeaWyvern
                | bird_large::Species::WealdWyvern => Vec3::new(2.5, 9.0, 4.5),
                _ => Vec3::new(2.0, 6.0, 4.4),
            },
            Body::Dragon(_) => Vec3::new(16.0, 10.0, 16.0),
            Body::FishMedium(_) => Vec3::new(0.5, 2.0, 0.8),
            Body::FishSmall(_) => Vec3::new(0.3, 1.2, 0.6),
            Body::Golem(body) => match body.species {
                golem::Species::CoralGolem => Vec3::new(3.0, 5.0, 4.0),
                golem::Species::ClayGolem => Vec3::new(6.8, 3.5, 7.5),
                golem::Species::AncientEffigy => Vec3::new(2.5, 2.5, 3.8),
                golem::Species::Mogwai => Vec3::new(2.5, 2.5, 3.8),
                _ => Vec3::new(5.0, 4.5, 7.5),
            },
            Body::Humanoid(humanoid) => {
                let height = humanoid.height();
                Vec3::new(height / 1.3, 1.75 / 2.0, height)
            },
            Body::Object(object) => object.dimensions(),
            Body::ItemDrop(item_drop) => item_drop.dimensions(),
            Body::QuadrupedMedium(body) => match body.species {
                quadruped_medium::Species::Akhlut => Vec3::new(2.5, 7.0, 3.0),
                quadruped_medium::Species::Barghest => Vec3::new(2.0, 4.4, 2.7),
                quadruped_medium::Species::Bear => Vec3::new(2.0, 3.8, 3.0),
                quadruped_medium::Species::Catoblepas => Vec3::new(2.0, 4.0, 2.3),
                quadruped_medium::Species::Cattle => Vec3::new(2.0, 3.6, 2.4),
                quadruped_medium::Species::Deer => Vec3::new(2.0, 3.0, 2.2),
                quadruped_medium::Species::Dreadhorn => Vec3::new(3.5, 7.0, 4.0),
                quadruped_medium::Species::Frostfang => Vec3::new(1.5, 3.0, 1.5),
                quadruped_medium::Species::Grolgar => Vec3::new(2.0, 4.0, 2.0),
                quadruped_medium::Species::Highland => Vec3::new(2.0, 3.6, 2.4),
                quadruped_medium::Species::Horse => Vec3::new(1.6, 3.0, 2.4),
                quadruped_medium::Species::Lion => Vec3::new(2.0, 3.3, 2.0),
                quadruped_medium::Species::Moose => Vec3::new(2.0, 4.0, 2.5),
                quadruped_medium::Species::Bristleback => Vec3::new(2.0, 3.0, 2.0),
                quadruped_medium::Species::Roshwalr => Vec3::new(3.4, 5.2, 3.7),
                quadruped_medium::Species::Saber => Vec3::new(2.0, 3.0, 2.0),
                quadruped_medium::Species::Tarasque => Vec3::new(2.0, 4.0, 2.6),
                quadruped_medium::Species::Yak => Vec3::new(2.0, 3.6, 3.0),
                quadruped_medium::Species::Mammoth => Vec3::new(7.5, 11.5, 8.0),
                quadruped_medium::Species::Ngoubou => Vec3::new(2.0, 3.2, 2.4),
                quadruped_medium::Species::Llama => Vec3::new(2.0, 2.5, 2.6),
                quadruped_medium::Species::ClaySteed => Vec3::new(2.2, 4.8, 4.0),
                quadruped_medium::Species::Alpaca => Vec3::new(2.0, 2.0, 2.0),
                quadruped_medium::Species::Camel => Vec3::new(2.0, 4.0, 3.5),
                quadruped_medium::Species::Wolf => Vec3::new(1.25, 3.0, 1.8),
                // FIXME: We really shouldn't be doing wildcards here
                _ => Vec3::new(2.0, 3.0, 2.0),
            },
            Body::QuadrupedSmall(body) => match body.species {
                quadruped_small::Species::Batfox => Vec3::new(1.4, 1.7, 1.3),
                quadruped_small::Species::Holladon => Vec3::new(1.3, 1.9, 1.5),
                quadruped_small::Species::Hyena => Vec3::new(1.2, 1.4, 1.3),
                quadruped_small::Species::Truffler => Vec3::new(1.2, 1.8, 2.2),
                quadruped_small::Species::MossySnail => Vec3::new(1.4, 1.4, 1.2),
                _ => Vec3::new(1.2, 1.2, 1.0),
            },
            Body::QuadrupedLow(body) => match body.species {
                quadruped_low::Species::Asp => Vec3::new(2.0, 3.0, 1.7),
                quadruped_low::Species::Crocodile => Vec3::new(1.0, 2.8, 1.3),
                quadruped_low::Species::SeaCrocodile => Vec3::new(1.2, 4.5, 1.3),
                quadruped_low::Species::Deadwood => Vec3::new(1.3, 1.3, 1.4),
                quadruped_low::Species::Hakulaq => Vec3::new(1.8, 3.0, 2.0),
                quadruped_low::Species::Dagon => Vec3::new(3.0, 6.0, 2.0),
                quadruped_low::Species::Icedrake => Vec3::new(2.0, 5.5, 2.5),
                quadruped_low::Species::Lavadrake => Vec3::new(2.0, 5.5, 2.5),
                quadruped_low::Species::Mossdrake => Vec3::new(2.0, 5.5, 2.5),
                quadruped_low::Species::Maneater => Vec3::new(2.0, 3.7, 4.0),
                quadruped_low::Species::Monitor => Vec3::new(1.4, 3.2, 1.3),
                quadruped_low::Species::Pangolin => Vec3::new(1.0, 2.6, 1.1),
                quadruped_low::Species::Rocksnapper => Vec3::new(2.5, 3.5, 2.9),
                quadruped_low::Species::Rootsnapper => Vec3::new(2.5, 3.5, 2.9),
                quadruped_low::Species::Reefsnapper => Vec3::new(2.5, 3.5, 2.9),
                quadruped_low::Species::Sandshark => Vec3::new(2.1, 4.3, 1.7),
                quadruped_low::Species::Basilisk => Vec3::new(2.7, 6.0, 2.9),
                quadruped_low::Species::Salamander => Vec3::new(1.7, 4.0, 1.3),
                quadruped_low::Species::Elbst => Vec3::new(1.7, 4.0, 1.3),
                quadruped_low::Species::Tortoise => Vec3::new(1.7, 2.7, 1.5),
                quadruped_low::Species::Driggle => Vec3::new(1.6, 2.7, 1.0),
                quadruped_low::Species::Snaretongue => Vec3::new(2.0, 2.8, 1.6),
                _ => Vec3::new(1.0, 1.6, 1.3),
            },
            Body::Ship(ship) => ship.dimensions(),
            Body::Theropod(body) => match body.species {
                theropod::Species::Archaeos => Vec3::new(4.5, 8.5, 8.0),
                theropod::Species::Ntouka => Vec3::new(4.5, 9.0, 6.6),
                theropod::Species::Odonto => Vec3::new(4.5, 8.0, 6.6),
                theropod::Species::Dodarock => Vec3::new(2.0, 3.0, 2.6),
                theropod::Species::Sandraptor => Vec3::new(2.0, 3.0, 2.6),
                theropod::Species::Snowraptor => Vec3::new(2.0, 3.0, 2.6),
                theropod::Species::Sunlizard => Vec3::new(2.0, 3.6, 2.5),
                theropod::Species::Woodraptor => Vec3::new(2.0, 3.0, 2.6),
                theropod::Species::Yale => Vec3::new(2.0, 3.2, 4.0),
                theropod::Species::Axebeak => Vec3::new(2.0, 3.6, 3.0),
            },
            Body::Arthropod(body) => match body.species {
                arthropod::Species::Tarantula => Vec3::new(4.0, 4.0, 1.8),
                arthropod::Species::Blackwidow => Vec3::new(4.0, 4.0, 2.0),
                arthropod::Species::Antlion => Vec3::new(4.0, 4.0, 2.2),
                arthropod::Species::Hornbeetle => Vec3::new(3.2, 3.2, 1.3),
                arthropod::Species::Leafbeetle => Vec3::new(2.4, 2.8, 1.2),
                arthropod::Species::Stagbeetle => Vec3::new(3.2, 3.2, 1.3),
                arthropod::Species::Weevil => Vec3::new(2.2, 2.4, 1.1),
                arthropod::Species::Cavespider => Vec3::new(4.0, 4.0, 1.4),
                arthropod::Species::Moltencrawler => Vec3::new(3.2, 4.0, 1.5),
                arthropod::Species::Mosscrawler => Vec3::new(3.2, 4.0, 1.4),
                arthropod::Species::Sandcrawler => Vec3::new(3.2, 4.0, 1.4),
                arthropod::Species::Dagonite => Vec3::new(3.2, 4.7, 1.4),
                arthropod::Species::Emberfly => Vec3::new(1.3, 1.5, 0.9),
            },
            Body::BirdMedium(body) => match body.species {
                bird_medium::Species::SnowyOwl => Vec3::new(1.2, 1.2, 0.9),
                bird_medium::Species::HornedOwl => Vec3::new(1.2, 1.2, 0.9),
                bird_medium::Species::Duck => Vec3::new(0.8, 1.3, 0.8),
                bird_medium::Species::Cockatiel => Vec3::new(0.8, 1.0, 0.7),
                bird_medium::Species::Chicken => Vec3::new(1.2, 1.5, 0.9),
                bird_medium::Species::Bat => Vec3::new(2.0, 1.8, 1.3),
                bird_medium::Species::Penguin => Vec3::new(1.0, 1.0, 1.2),
                bird_medium::Species::Goose => Vec3::new(1.5, 1.5, 1.1),
                bird_medium::Species::Peacock => Vec3::new(1.6, 1.8, 1.4),
                bird_medium::Species::Eagle => Vec3::new(1.5, 2.2, 1.0),
                bird_medium::Species::Parrot => Vec3::new(1.2, 1.5, 1.1),
                bird_medium::Species::Crow => Vec3::new(1.0, 1.2, 0.8),
                bird_medium::Species::Dodo => Vec3::new(1.2, 1.8, 1.1),
                bird_medium::Species::Parakeet => Vec3::new(0.8, 0.9, 0.7),
                bird_medium::Species::Puffin => Vec3::new(1.0, 1.0, 1.0),
                bird_medium::Species::Toucan => Vec3::new(2.1, 1.1, 1.2),
            },
            Body::Crustacean(_) => Vec3::new(1.2, 1.2, 0.7),
        }
    }

    // Note: This is used for collisions, but it's not very accurate for shapes that
    // are very much not cylindrical. Eventually this ought to be replaced by more
    // accurate collision shapes.
    pub fn max_radius(&self) -> f32 {
        let dim = self.dimensions();
        let (x, y) = (dim.x, dim.y);

        x.max(y) / 2.0
    }

    pub fn min_radius(&self) -> f32 {
        let (_p0, _p1, radius) = self.sausage();

        radius
    }

    /// Base of our Capsule Prism used for collisions.
    /// Returns line segment and radius. See [this wiki page][stadium_wiki].
    ///
    /// [stadium_wiki]: <https://en.wikipedia.org/wiki/Stadium_(geometry)>
    pub fn sausage(&self) -> (Vec2<f32>, Vec2<f32>, f32) {
        // Consider this ascii-art stadium with radius `r` and line segment `a`
        //
        //      xxxxxxxxxxxxxxxxx
        //
        //        _ ----------_
        // y    -*      r      *-
        // y   *        r        *
        // y  * rrr aaaaaaaaa rrr *
        // y  *         r         *
        // y   *        r        *
        //       *____________ ^
        let dim = self.dimensions();
        // The width (shoulder to shoulder) and length (nose to tail)
        let (width, length) = (dim.x, dim.y);

        if length > width {
            // Dachshund-like
            let radius = width / 2.0;

            let a = length - 2.0 * radius;

            let p0 = Vec2::new(0.0, -a / 2.0);
            let p1 = Vec2::new(0.0, a / 2.0);

            (p0, p1, radius)
        } else {
            // Cyclops-like
            let radius = length / 2.0;

            let a = width - 2.0 * radius;

            let p0 = Vec2::new(-a / 2.0, 0.0);
            let p1 = Vec2::new(a / 2.0, 0.0);

            (p0, p1, radius)
        }
    }

    /// Body collider
    pub fn collider(&self) -> Collider {
        if let Body::Ship(ship) = self {
            ship.make_collider()
        } else {
            let (p0, p1, radius) = self.sausage();

            Collider::CapsulePrism {
                p0,
                p1,
                radius,
                z_min: 0.0,
                z_max: self.height(),
            }
        }
    }

    /// How far away other entities should try to be. Will be added upon the
    /// other entity's spacing_radius. So an entity with 2.0 and an entity
    /// with 3.0 will lead to that both entities will try to keep 5.0 units
    /// away from each other.
    pub fn spacing_radius(&self) -> f32 {
        self.max_radius()
            + match self {
                Body::QuadrupedSmall(body) => match body.species {
                    quadruped_small::Species::Rat => 0.0,
                    _ => 2.0,
                },
                Body::QuadrupedLow(body) => match body.species {
                    quadruped_low::Species::Hakulaq => 0.0,
                    _ => 2.0,
                },
                Body::BipedSmall(body) => match body.species {
                    biped_small::Species::Husk => 3.0,
                    _ => 2.0,
                },
                _ => 2.0,
            }
    }

    /// Height from the bottom to the top (in metres)
    pub fn height(&self) -> f32 { self.dimensions().z }

    pub fn base_energy(&self) -> u16 {
        match self {
            Body::BipedLarge(biped_large) => match biped_large.species {
                biped_large::Species::Dullahan => 400,
                _ => 300,
            },
            Body::BirdLarge(body) => match body.species {
                bird_large::Species::Cockatrice => 400,
                bird_large::Species::Phoenix => 600,
                bird_large::Species::Roc => 500,
                bird_large::Species::FlameWyvern => 600,
                bird_large::Species::CloudWyvern => 600,
                bird_large::Species::FrostWyvern => 600,
                bird_large::Species::SeaWyvern => 600,
                bird_large::Species::WealdWyvern => 600,
            },
            Body::Humanoid(_) => 100,
            _ => 100,
        }
    }

    pub fn base_health(&self) -> u16 {
        match self {
            Body::Humanoid(_) => 100,
            Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
                // T1
                quadruped_small::Species::Boar => 60,
                quadruped_small::Species::Holladon => 80,
                quadruped_small::Species::MossySnail => 85,
                quadruped_small::Species::Porcupine => 55,
                quadruped_small::Species::Truffler => 130,
                // T2
                quadruped_small::Species::Hyena => 90,
                // T0
                quadruped_small::Species::Batfox => 15,
                quadruped_small::Species::Beaver => 25,
                quadruped_small::Species::Cat => 25,
                quadruped_small::Species::Dog => 30,
                quadruped_small::Species::Fox => 15,
                quadruped_small::Species::Goat => 15,
                quadruped_small::Species::Hare => 15,
                quadruped_small::Species::Jackalope => 30,
                quadruped_small::Species::Pig => 15,
                quadruped_small::Species::Quokka => 10,
                quadruped_small::Species::Rabbit => 10,
                quadruped_small::Species::Raccoon => 15,
                quadruped_small::Species::Seal => 15,
                quadruped_small::Species::TreantSapling => 55,
                quadruped_small::Species::Sheep => 30,
                quadruped_small::Species::Squirrel => 10,
                _ => 5,
            },
            Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
                // T1
                quadruped_medium::Species::Antelope => 90,
                quadruped_medium::Species::Donkey => 110,
                quadruped_medium::Species::Horse => 100,
                quadruped_medium::Species::Mouflon => 80,
                quadruped_medium::Species::Zebra => 120,
                // T2
                quadruped_medium::Species::Barghest => 120,
                quadruped_medium::Species::Bear => 210,
                quadruped_medium::Species::Bristleback => 340,
                quadruped_medium::Species::Bonerattler => 90,
                quadruped_medium::Species::Cattle => 240,
                quadruped_medium::Species::Frostfang => 110,
                quadruped_medium::Species::Highland => 240,
                quadruped_medium::Species::Kelpie => 155,
                quadruped_medium::Species::Lion => 150,
                quadruped_medium::Species::Moose => 160,
                quadruped_medium::Species::Panda => 180,
                quadruped_medium::Species::Saber => 150,
                quadruped_medium::Species::Tarasque => 200,
                quadruped_medium::Species::Tiger => 170,
                quadruped_medium::Species::Tuskram => 200,
                quadruped_medium::Species::Wolf => 95,
                quadruped_medium::Species::Yak => 270,
                // T3A
                quadruped_medium::Species::Akhlut => 520,
                quadruped_medium::Species::Catoblepas => 350,
                quadruped_medium::Species::ClaySteed => 400,
                quadruped_medium::Species::Dreadhorn => 570,
                quadruped_medium::Species::Grolgar => 320,
                quadruped_medium::Species::Hirdrasil => 850,
                quadruped_medium::Species::Mammoth => 740,
                quadruped_medium::Species::Ngoubou => 450,
                quadruped_medium::Species::Roshwalr => 500,
                _ => 100,
            },
            Body::FishMedium(_) => 15,
            Body::Dragon(_) => 500,
            Body::BirdLarge(bird_large) => match bird_large.species {
                bird_large::Species::Roc => 280,
                bird_large::Species::FlameWyvern
                | bird_large::Species::CloudWyvern
                | bird_large::Species::FrostWyvern
                | bird_large::Species::SeaWyvern
                | bird_large::Species::WealdWyvern => 1000,
                bird_large::Species::Phoenix => 2000,
                _ => 300,
            },
            Body::BirdMedium(bird_medium) => match bird_medium.species {
                bird_medium::Species::SnowyOwl => 45,
                bird_medium::Species::HornedOwl => 45,
                bird_medium::Species::Duck => 10,
                bird_medium::Species::Cockatiel => 10,
                bird_medium::Species::Chicken => 10,
                bird_medium::Species::Bat => 20,
                bird_medium::Species::Goose => 30,
                bird_medium::Species::Peacock => 35,
                bird_medium::Species::Penguin => 35,
                bird_medium::Species::Eagle => 45,
                bird_medium::Species::Parrot => 20,
                bird_medium::Species::Crow => 20,
                bird_medium::Species::Dodo => 20,
                bird_medium::Species::Parakeet => 20,
                bird_medium::Species::Puffin => 20,
                bird_medium::Species::Toucan => 20,
            },
            Body::FishSmall(_) => 3,
            Body::BipedLarge(biped_large) => match biped_large.species {
                biped_large::Species::Ogre => 380,
                biped_large::Species::Cyclops => 1000,
                biped_large::Species::Wendigo => 300,
                biped_large::Species::Cavetroll => 340,
                biped_large::Species::Mountaintroll => 340,
                biped_large::Species::Swamptroll => 340,
                biped_large::Species::Dullahan => 600,
                biped_large::Species::Mindflayer => 1250,
                biped_large::Species::Tidalwarrior => 1600,
                biped_large::Species::Yeti => 1800,
                biped_large::Species::Minotaur => 3000,
                biped_large::Species::Harvester => 1500,
                biped_large::Species::Blueoni => 340,
                biped_large::Species::Redoni => 340,
                biped_large::Species::Huskbrute => 800,
                biped_large::Species::Cultistwarlord => 250,
                biped_large::Species::Cultistwarlock => 250,
                biped_large::Species::Gigasfrost => 30000,
                biped_large::Species::AdletElder => 1500,
                biped_large::Species::Tursus => 320,
                biped_large::Species::SeaBishop => 550,
                biped_large::Species::HaniwaGeneral => 600,
                biped_large::Species::TerracottaBesieger
                | biped_large::Species::TerracottaDemolisher
                | biped_large::Species::TerracottaPunisher
                | biped_large::Species::TerracottaPursuer => 300,
                biped_large::Species::Cursekeeper => 3000,
                biped_large::Species::Forgemaster => 10000,
                _ => 120,
            },
            Body::BipedSmall(biped_small) => match biped_small.species {
                biped_small::Species::Gnarling => 50,
                biped_small::Species::Adlet => 65,
                biped_small::Species::Sahagin => 85,
                biped_small::Species::Haniwa => 100,
                biped_small::Species::Myrmidon => 100,
                biped_small::Species::Husk => 50,
                biped_small::Species::Boreal => 100,
                biped_small::Species::IronDwarf => 250,
                biped_small::Species::Irrwurz => 100,
                biped_small::Species::ShamanicSpirit => 240,
                biped_small::Species::Jiangshi => 250,
                biped_small::Species::Flamekeeper => 2000,
                _ => 60,
            },
            Body::Object(object) => match object {
                object::Body::TrainingDummy => 1000,
                object::Body::Crossbow => 80,
                object::Body::Flamethrower => 80,
                object::Body::Lavathrower => 80,
                object::Body::BarrelOrgan => 500,
                object::Body::HaniwaSentry => 60,
                object::Body::SeaLantern => 100,
                object::Body::GnarlingTotemGreen => 25,
                object::Body::TerracottaStatue => 600,
                object::Body::GnarlingTotemRed | object::Body::GnarlingTotemWhite => 35,
                _ => 1000,
            },
            Body::ItemDrop(_) => 1000,
            Body::Golem(golem) => match golem.species {
                golem::Species::WoodGolem => 200,
                golem::Species::ClayGolem => 350,
                golem::Species::Gravewarden => 1000,
                golem::Species::CoralGolem => 550,
                golem::Species::AncientEffigy => 250,
                golem::Species::Mogwai => 500,
                golem::Species::IronGolem => 2500,
                _ => 1000,
            },
            Body::Theropod(theropod) => match theropod.species {
                // T1
                theropod::Species::Dodarock => 85,
                // T2
                theropod::Species::Axebeak => 275,
                theropod::Species::Sunlizard => 210,
                // T3A
                theropod::Species::Yale => 680,
                // T3B
                theropod::Species::Archaeos => 950,
                theropod::Species::Ntouka => 1150,
                theropod::Species::Odonto => 1350,
                _ => 240,
            },
            Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
                // T1
                quadruped_low::Species::Driggle => 40,
                quadruped_low::Species::Pangolin => 40,
                // T2
                quadruped_low::Species::Alligator => 420,
                quadruped_low::Species::Asp => 330,
                quadruped_low::Species::Crocodile => 380,
                quadruped_low::Species::Deadwood => 220,
                quadruped_low::Species::Elbst => 240,
                quadruped_low::Species::Hakulaq => 330,
                quadruped_low::Species::Monitor => 285,
                quadruped_low::Species::SeaCrocodile => 450,
                quadruped_low::Species::Tortoise => 120,
                // T3A
                quadruped_low::Species::Dagon => 1200,
                quadruped_low::Species::Icedrake => 640,
                quadruped_low::Species::Lavadrake => 460,
                quadruped_low::Species::Maneater => 800,
                quadruped_low::Species::Mossdrake => 720,
                quadruped_low::Species::Rocksnapper => 380,
                quadruped_low::Species::Reefsnapper => 390,
                quadruped_low::Species::Rootsnapper => 400,
                quadruped_low::Species::Sandshark => 550,
                // T3B
                quadruped_low::Species::Basilisk => 1300,
                quadruped_low::Species::Snaretongue => 1500,
                _ => 70,
            },
            Body::Arthropod(arthropod) => match arthropod.species {
                // T0
                arthropod::Species::Emberfly => 10,
                // T1
                arthropod::Species::Dagonite => 70,
                arthropod::Species::Leafbeetle => 125,
                arthropod::Species::Weevil => 110,
                // T2
                arthropod::Species::Cavespider => 320,
                arthropod::Species::Tarantula => 440,
                // T3A
                arthropod::Species::Antlion => 540,
                arthropod::Species::Blackwidow => 420,
                arthropod::Species::Hornbeetle => 480,
                arthropod::Species::Moltencrawler => 400,
                arthropod::Species::Mosscrawler => 600,
                arthropod::Species::Sandcrawler => 500,
                arthropod::Species::Stagbeetle => 440,
            },
            Body::Ship(_) => 1000,
            Body::Crustacean(_) => 40,
        }
    }

    pub fn flying_height(&self) -> f32 {
        match self {
            Body::BirdLarge(_) => 50.0,
            Body::BirdMedium(_) => 40.0,
            Body::Dragon(_) => 60.0,
            Body::Ship(ship) => ship.flying_height(),
            _ => 0.0,
        }
    }

    pub fn immune_to(&self, buff: BuffKind) -> bool {
        match buff {
            BuffKind::Bleeding => match self {
                Body::Object(_) | Body::Golem(_) | Body::Ship(_) => true,
                Body::BipedSmall(b) => matches!(
                    b.species,
                    biped_small::Species::Husk
                        | biped_small::Species::Boreal
                        | biped_small::Species::IronDwarf
                        | biped_small::Species::Haniwa
                        | biped_small::Species::ShamanicSpirit
                        | biped_small::Species::Jiangshi
                ),
                Body::BipedLarge(b) => matches!(
                    b.species,
                    biped_large::Species::Huskbrute
                        | biped_large::Species::Gigasfrost
                        | biped_large::Species::Dullahan
                        | biped_large::Species::HaniwaGeneral
                        | biped_large::Species::TerracottaBesieger
                        | biped_large::Species::TerracottaDemolisher
                        | biped_large::Species::TerracottaPunisher
                        | biped_large::Species::TerracottaPursuer
                        | biped_large::Species::Cursekeeper
                ),
                Body::QuadrupedMedium(b) => {
                    matches!(b.species, quadruped_medium::Species::ClaySteed)
                },
                _ => false,
            },
            BuffKind::Crippled => match self {
                Body::Object(_) | Body::Golem(_) | Body::Ship(_) => true,
                Body::BipedLarge(b) => matches!(
                    b.species,
                    biped_large::Species::Dullahan | biped_large::Species::HaniwaGeneral
                ),
                Body::BipedSmall(b) => matches!(b.species, biped_small::Species::Haniwa),
                Body::QuadrupedMedium(b) => {
                    matches!(b.species, quadruped_medium::Species::ClaySteed)
                },
                _ => false,
            },
            BuffKind::Burning => match self {
                Body::Golem(g) => matches!(
                    g.species,
                    golem::Species::Gravewarden
                        | golem::Species::AncientEffigy
                        | golem::Species::IronGolem
                ),
                Body::BipedSmall(b) => matches!(
                    b.species,
                    biped_small::Species::Haniwa
                        | biped_small::Species::Flamekeeper
                        | biped_small::Species::IronDwarf
                ),
                Body::Object(object) => matches!(
                    object,
                    object::Body::HaniwaSentry
                        | object::Body::Lavathrower
                        | object::Body::Flamethrower
                        | object::Body::TerracottaStatue
                ),
                Body::QuadrupedLow(q) => matches!(
                    q.species,
                    quadruped_low::Species::Lavadrake | quadruped_low::Species::Salamander
                ),
                Body::BirdLarge(b) => matches!(
                    b.species,
                    bird_large::Species::Phoenix
                        | bird_large::Species::Cockatrice
                        | bird_large::Species::FlameWyvern
                        | bird_large::Species::CloudWyvern
                        | bird_large::Species::FrostWyvern
                        | bird_large::Species::SeaWyvern
                        | bird_large::Species::WealdWyvern
                ),
                Body::Arthropod(b) => matches!(b.species, arthropod::Species::Moltencrawler),
                Body::BipedLarge(b) => matches!(
                    b.species,
                    biped_large::Species::Cyclops
                        | biped_large::Species::Minotaur
                        | biped_large::Species::Forgemaster
                ),
                _ => false,
            },
            BuffKind::Ensnared => match self {
                Body::BipedLarge(b) => matches!(b.species, biped_large::Species::Harvester),
                Body::Arthropod(_) => true,
                _ => false,
            },
            BuffKind::Regeneration => {
                matches!(
                    self,
                    Body::Object(
                        object::Body::GnarlingTotemRed
                            | object::Body::GnarlingTotemGreen
                            | object::Body::GnarlingTotemWhite
                    )
                )
            },
            BuffKind::Frozen => match self {
                Body::BipedLarge(b) => matches!(
                    b.species,
                    biped_large::Species::Yeti
                        | biped_large::Species::Gigasfrost
                        | biped_large::Species::Tursus
                ),
                Body::QuadrupedLow(q) => matches!(q.species, quadruped_low::Species::Icedrake),
                Body::BirdLarge(b) => matches!(b.species, bird_large::Species::FrostWyvern),
                Body::BipedSmall(b) => matches!(b.species, biped_small::Species::Boreal),
                Body::QuadrupedMedium(b) => matches!(
                    b.species,
                    quadruped_medium::Species::Roshwalr | quadruped_medium::Species::Frostfang
                ),
                _ => false,
            },
            BuffKind::ProtectingWard => matches!(self, Body::Object(object::Body::BarrelOrgan)),
            _ => false,
        }
    }

    /// Returns a multiplier representing increased difficulty not accounted for
    /// due to AI or not using an actual weapon
    // TODO: Match on species
    pub fn combat_multiplier(&self) -> f32 {
        match self {
            Body::Object(object) => match object {
                object::Body::BarrelOrgan | object::Body::ArrowTurret => 0.05,
                object::Body::TerracottaStatue => 1.5,
                _ => 0.0,
            },
            Body::Ship(_) => 0.0,
            Body::BipedLarge(b) => match b.species {
                biped_large::Species::Mindflayer => 4.35,
                biped_large::Species::Minotaur => 4.05,
                biped_large::Species::Tidalwarrior => 2.75,
                biped_large::Species::Yeti => 2.25,
                biped_large::Species::Harvester => 2.1,
                _ => 1.0,
            },
            Body::BipedSmall(b) => match b.species {
                biped_small::Species::IronDwarf => 2.0,
                biped_small::Species::Flamekeeper => 4.0,
                _ => 1.0,
            },
            Body::Golem(g) => match g.species {
                golem::Species::Gravewarden => 2.45,
                _ => 1.0,
            },
            Body::QuadrupedLow(b) => match b.species {
                quadruped_low::Species::Snaretongue => 2.0,
                _ => 1.0,
            },
            Body::QuadrupedSmall(b) => match b.species {
                quadruped_small::Species::Axolotl | quadruped_small::Species::Gecko => 0.6,
                _ => 1.0,
            },
            #[allow(unreachable_patterns)] // TODO: Remove when more medium fish species are added
            Body::FishMedium(b) => match b.species {
                fish_medium::Species::Marlin | fish_medium::Species::Icepike => 0.6,
                _ => 1.0,
            },
            #[allow(unreachable_patterns)] // TODO: Remove when more small fish species are added
            Body::FishSmall(b) => match b.species {
                fish_small::Species::Clownfish | fish_small::Species::Piranha => 0.6,
                _ => 1.0,
            },
            #[allow(unreachable_patterns)] // TODO: Remove when more crustacean species are added
            Body::Crustacean(b) => match b.species {
                crustacean::Species::Crab => 0.6,
                _ => 1.0,
            },
            _ => 1.0,
        }
    }

    pub fn base_poise(&self) -> u16 {
        match self {
            Body::Humanoid(_) => 100,
            Body::BipedLarge(biped_large) => match biped_large.species {
                biped_large::Species::Mindflayer => 320,
                biped_large::Species::Minotaur => 280,
                biped_large::Species::Forgemaster => 250,
                biped_large::Species::Gigasfrost => 800,
                _ => 250,
            },
            Body::BipedSmall(b) => match b.species {
                biped_small::Species::IronDwarf | biped_small::Species::Flamekeeper => 250,
                _ => 100,
            },
            Body::BirdLarge(b) => match b.species {
                bird_large::Species::FlameWyvern
                | bird_large::Species::FrostWyvern
                | bird_large::Species::CloudWyvern
                | bird_large::Species::SeaWyvern
                | bird_large::Species::WealdWyvern => 185,
                _ => 140,
            },
            Body::Golem(_) => 300,
            Body::QuadrupedMedium(b) => match b.species {
                quadruped_medium::Species::Bear | quadruped_medium::Species::Grolgar => 165,
                quadruped_medium::Species::Cattle
                | quadruped_medium::Species::Llama
                | quadruped_medium::Species::Alpaca
                | quadruped_medium::Species::Camel
                | quadruped_medium::Species::ClaySteed
                | quadruped_medium::Species::Zebra
                | quadruped_medium::Species::Donkey
                | quadruped_medium::Species::Highland
                | quadruped_medium::Species::Horse
                | quadruped_medium::Species::Kelpie
                | quadruped_medium::Species::Hirdrasil
                | quadruped_medium::Species::Antelope => 140,
                quadruped_medium::Species::Deer => 120,
                quadruped_medium::Species::Wolf
                | quadruped_medium::Species::Tiger
                | quadruped_medium::Species::Barghest
                | quadruped_medium::Species::Bonerattler
                | quadruped_medium::Species::Darkhound
                | quadruped_medium::Species::Moose
                | quadruped_medium::Species::Snowleopard
                | quadruped_medium::Species::Akhlut
                | quadruped_medium::Species::Bristleback
                | quadruped_medium::Species::Catoblepas
                | quadruped_medium::Species::Lion => 160,
                quadruped_medium::Species::Panda => 130,
                quadruped_medium::Species::Saber
                | quadruped_medium::Species::Yak
                | quadruped_medium::Species::Frostfang
                | quadruped_medium::Species::Tarasque
                | quadruped_medium::Species::Tuskram
                | quadruped_medium::Species::Mouflon
                | quadruped_medium::Species::Roshwalr
                | quadruped_medium::Species::Dreadhorn => 175,
                quadruped_medium::Species::Mammoth | quadruped_medium::Species::Ngoubou => 195,
            },
            Body::QuadrupedLow(b) => match b.species {
                quadruped_low::Species::Dagon => 225,
                quadruped_low::Species::Crocodile
                | quadruped_low::Species::Deadwood
                | quadruped_low::Species::SeaCrocodile
                | quadruped_low::Species::Alligator
                | quadruped_low::Species::Sandshark
                | quadruped_low::Species::Snaretongue
                | quadruped_low::Species::Asp => 160,
                quadruped_low::Species::Tortoise
                | quadruped_low::Species::Rocksnapper
                | quadruped_low::Species::Rootsnapper
                | quadruped_low::Species::Reefsnapper
                | quadruped_low::Species::Maneater
                | quadruped_low::Species::Hakulaq
                | quadruped_low::Species::Lavadrake
                | quadruped_low::Species::Icedrake
                | quadruped_low::Species::Basilisk
                | quadruped_low::Species::Mossdrake => 175,
                quadruped_low::Species::Elbst
                | quadruped_low::Species::Salamander
                | quadruped_low::Species::Monitor
                | quadruped_low::Species::Pangolin
                | quadruped_low::Species::Driggle => 115,
            },
            Body::Theropod(b) => match b.species {
                theropod::Species::Archaeos
                | theropod::Species::Ntouka
                | theropod::Species::Odonto => 200,
                theropod::Species::Yale => 185,
                _ => 165,
            },
            _ => 100,
        }
    }

    /// Returns the eye height for this creature.
    pub fn eye_height(&self, scale: f32) -> f32 { self.height() * 0.9 * scale }

    pub fn default_light_offset(&self) -> Vec3<f32> {
        // TODO: Make this a manifest
        match self {
            Body::Object(_) => Vec3::unit_z() * 0.5,
            _ => Vec3::unit_z(),
        }
    }

    pub fn can_strafe(&self) -> bool {
        matches!(
            self,
            Body::Humanoid(_)
                | Body::BipedSmall(_)
                | Body::BipedLarge(_)
                | Body::Crustacean(crustacean::Body {
                    species: crustacean::Species::Crab,
                    ..
                })
        )
    }

    /// Component of the mounting offset specific to the mount
    pub fn mount_offset(&self) -> Vec3<f32> {
        match self {
            Body::Humanoid(_) => (self.dimensions() * Vec3::new(0.5, 0.0, 0.6)).into_array(),
            Body::BipedLarge(_) => (self.dimensions() * Vec3::new(0.5, 0.0, 0.7)).into_array(),
            Body::BirdLarge(_) => (self.dimensions() * Vec3::new(0.0, 0.2, 0.7)).into_array(),
            Body::QuadrupedLow(_) => (self.dimensions() * Vec3::new(0.0, 0.15, 0.4)).into_array(),
            Body::QuadrupedMedium(quadruped_medium) => {
                match (quadruped_medium.species, quadruped_medium.body_type) {
                    (quadruped_medium::Species::Grolgar, _) => [0.0, 0.5, 1.8],
                    (quadruped_medium::Species::Saber, _) => [0.0, 0.3, 1.3],
                    (quadruped_medium::Species::Tiger, _) => [0.0, 0.2, 1.4],
                    (quadruped_medium::Species::Tuskram, _) => [0.0, -0.5, 1.5],
                    (quadruped_medium::Species::Lion, _) => [0.0, 0.3, 1.5],
                    (quadruped_medium::Species::Tarasque, _) => [0.0, 0.6, 2.0],
                    (quadruped_medium::Species::Wolf, _) => [0.0, 0.5, 1.3],
                    (quadruped_medium::Species::Frostfang, _) => [0.0, 0.5, 1.2],
                    (quadruped_medium::Species::Mouflon, _) => [0.0, 0.3, 1.2],
                    (quadruped_medium::Species::Catoblepas, _) => [0.0, 0.0, 2.0],
                    (quadruped_medium::Species::Bonerattler, _) => [0.0, 0.5, 1.2],
                    (quadruped_medium::Species::Deer, _) => [0.0, 0.2, 1.3],
                    (quadruped_medium::Species::Hirdrasil, _) => [0.0, 0.0, 1.4],
                    (quadruped_medium::Species::Roshwalr, _) => [0.0, 0.5, 1.8],
                    (quadruped_medium::Species::Donkey, _) => [0.0, 0.5, 1.5],
                    (quadruped_medium::Species::Camel, _) => [0.0, -0.1, 2.8],
                    (quadruped_medium::Species::Zebra, _) => [0.0, 0.5, 1.8],
                    (quadruped_medium::Species::Antelope, _) => [0.0, 0.3, 1.4],
                    (quadruped_medium::Species::Kelpie, _) => [0.0, 0.5, 1.9],
                    (quadruped_medium::Species::Horse, _) => [0.0, 0.0, 2.0],
                    (quadruped_medium::Species::Barghest, _) => [0.0, 0.5, 2.2],
                    (quadruped_medium::Species::Cattle, quadruped_medium::BodyType::Male) => {
                        [0.0, 0.5, 2.6]
                    },
                    (quadruped_medium::Species::Cattle, quadruped_medium::BodyType::Female) => {
                        [0.0, 0.7, 2.2]
                    },
                    (quadruped_medium::Species::Darkhound, _) => [0.0, 0.5, 1.4],
                    (quadruped_medium::Species::Highland, _) => [0.0, 0.5, 2.3],
                    (quadruped_medium::Species::Yak, _) => [0.0, 0.0, 3.0],
                    (quadruped_medium::Species::Panda, _) => [0.0, -0.2, 1.4],
                    (quadruped_medium::Species::Bear, _) => [0.0, -0.4, 2.5],
                    (quadruped_medium::Species::Dreadhorn, _) => [0.0, 0.2, 3.5],
                    (quadruped_medium::Species::Moose, _) => [0.0, -0.6, 2.1],
                    (quadruped_medium::Species::Bristleback, _) => [0.0, -0.6, 2.1],
                    (quadruped_medium::Species::Snowleopard, _) => [-0.5, -0.5, 1.4],
                    (quadruped_medium::Species::Mammoth, _) => [0.0, 4.9, 7.2],
                    (quadruped_medium::Species::Ngoubou, _) => [0.0, 0.3, 2.0],
                    (quadruped_medium::Species::Llama, _) => [0.0, 0.1, 1.5],
                    (quadruped_medium::Species::Alpaca, _) => [0.0, -0.1, 1.0],
                    (quadruped_medium::Species::Akhlut, _) => [0.6, 0.6, 2.0],
                    (quadruped_medium::Species::ClaySteed, _) => [0.0, 0.1, 1.5],
                }
            },
            Body::Ship(ship) => match ship {
                ship::Body::DefaultAirship => [0.0, 0.0, 10.0],
                ship::Body::AirBalloon => [0.0, 0.0, 5.0],
                ship::Body::SailBoat => [-2.0, -5.0, 4.0],
                ship::Body::Galleon => [-2.0, -5.0, 4.0],
                ship::Body::Skiff => [1.0, -2.0, 2.0],
                ship::Body::Submarine => [1.0, -2.0, 2.0],
                ship::Body::Carriage => [1.0, -2.0, 2.0],
                ship::Body::Cart => [1.0, -2.0, 2.0],
                ship::Body::Volume => [0.0, 0.0, 0.0],
            },
            _ => [0.0, 0.0, 0.0],
        }
        .into()
    }

    /// Component of the mounting offset specific to the rider
    pub fn rider_offset(&self) -> Vec3<f32> {
        match self {
            Body::Humanoid(_) => [0.0, 0.0, 0.0],
            _ => [0.0, 0.0, 0.0],
        }
        .into()
    }

    pub fn tether_offset_leader(&self) -> Vec3<f32> {
        Vec3::new(0.0, self.dimensions().y * -0.4, self.dimensions().z * 0.7)
    }

    pub fn tether_offset_follower(&self) -> Vec3<f32> {
        Vec3::new(0.0, self.dimensions().y * 0.6, self.dimensions().z * 0.7)
    }

    /// Should be only used with npc-tell_monster.
    ///
    /// If you want to use for displaying names in HUD, add new strings.
    /// If you want to use for anything else, add new strings.
    pub fn localize_npc(&self) -> Content {
        fn try_localize(body: &Body) -> Option<Content> {
            match body {
                Body::BipedLarge(biped_large) => biped_large.localize_npc(),
                _ => None,
            }
        }

        try_localize(self).unwrap_or_else(|| Content::localized("body-npc-speech-generic"))
    }

    /// Read comment on `Gender` for more
    pub fn humanoid_gender(&self) -> Option<Gender> {
        match self {
            Body::Humanoid(b) => match b.body_type {
                humanoid::BodyType::Male => Some(Gender::Masculine),
                humanoid::BodyType::Female => Some(Gender::Feminine),
            },
            _ => None,
        }
    }
}

impl Component for Body {
    type Storage = DerefFlaggedStorage<Self, specs::VecStorage<Self>>;
}