MCPcopy Create free account
hub / github.com/diasurgical/devilution / AddChest

Function AddChest

Source/objects.cpp:994–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994void AddChest(int i, int t)
995{
996 if (!random_(147, 2))
997 object[i]._oAnimFrame += 3;
998 object[i]._oRndSeed = GetRndSeed();
999 switch (t) {
1000 case OBJ_CHEST1:
1001 case OBJ_TCHEST1:
1002 if (setlevel) {
1003 object[i]._oVar1 = 1;
1004 break;
1005 }
1006 object[i]._oVar1 = random_(147, 2);
1007 break;
1008 case OBJ_TCHEST2:
1009 case OBJ_CHEST2:
1010 if (setlevel) {
1011 object[i]._oVar1 = 2;
1012 break;
1013 }
1014 object[i]._oVar1 = random_(147, 3);
1015 break;
1016 case OBJ_TCHEST3:
1017 case OBJ_CHEST3:
1018 if (setlevel) {
1019 object[i]._oVar1 = 3;
1020 break;
1021 }
1022 object[i]._oVar1 = random_(147, 4);
1023 break;
1024 }
1025 object[i]._oVar2 = random_(147, 8);
1026}
1027
1028void AddL2Door(int i, int x, int y, int ot)
1029{

Callers 1

AddObjectFunction · 0.85

Calls 2

random_Function · 0.85
GetRndSeedFunction · 0.85

Tested by

no test coverage detected