To do Find other code relevant to MT_RANDOMITEM (excluding A_ItemPop) in p_mobj.c, find sprite RPOP, and format object info table to allow for new item picture.
Thing type 2000, Random Item , is a random item box, exclusive to SRB2Kart . It will give a player an item based on their position and game mode. By rapidly pressing or holding the item button while the roulette is spinning an item will be generated faster, at the expense of it being worse.
Object type info – MT_RANDOMITEM
Thing type number
2000
RNDMA0
Object type
MT_RANDOMITEM
Sprite name prefix
RNDM
SpawnState
S_RANDOMITEM1
SeeState
S_NULL
SeeSound
sfx_None
AttackSound
sfx_None
PainState
S_NULL
PainSound
sfx_None
MeleeState
S_NULL
MissileState
S_NULL
DeathState
S_DEADRANDOMITEM
XDeathState
S_NULL
DeathSound
sfx_kc2e
ActiveSound
sfx_None
RaiseState
S_NULL
SpawnHealth
1000
ReactionTime
0
PainChance
0
Speed
60*FRACUNIT
Radius
48*FRACUNIT
Height
48*FRACUNIT
Display offset
0
Mass
100
Damage
MT_RANDOMITEMPOP
Flags
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP
Code – MT_RANDOMITEM
if ( G_BattleGametype ())
{
if ( mobj -> threshold != 69 )
break ;
}
else
{
// Respawn from mapthing if you have one!
if ( mobj -> spawnpoint )
{
P_SpawnMapThing ( mobj -> spawnpoint );
newmobj = mobj -> spawnpoint -> mobj ; // this is set to the new mobj in P_SpawnMapThing
}
else
newmobj = P_SpawnMobj ( mobj -> x , mobj -> y , mobj -> z , mobj -> type );
// Transfer flags2 (strongbox, objectflip)
newmobj -> flags2 = mobj -> flags2 & ~ MF2_DONTDRAW ;
}
P_RemoveMobj ( mobj ); // make sure they disappear
return ;
States – MT_RANDOMITEM
State
Sprite prefix
Frame
Duration (tics)
Action
Var 1
Var 2
Next state
Full brightness?
Translucency
S_RANDOMITEM1
RNDM
A
3
none
0
0
S_RANDOMITEM2
Yes
0%
S_RANDOMITEM2
RNDM
B
3
none
0
0
S_RANDOMITEM3
Yes
0%
S_RANDOMITEM3
RNDM
C
3
none
0
0
S_RANDOMITEM4
Yes
0%
S_RANDOMITEM4
RNDM
D
3
none
0
0
S_RANDOMITEM5
Yes
0%
S_RANDOMITEM5
RNDM
E
3
none
0
0
S_RANDOMITEM6
Yes
0%
S_RANDOMITEM6
RNDM
F
3
none
0
0
S_RANDOMITEM7
Yes
0%
S_RANDOMITEM7
RNDM
G
3
none
0
0
S_RANDOMITEM8
Yes
0%
S_RANDOMITEM8
RNDM
H
3
none
0
0
S_RANDOMITEM9
Yes
0%
S_RANDOMITEM9
RNDM
I
3
none
0
0
S_RANDOMITEM10
Yes
0%
S_RANDOMITEM10
RNDM
J
3
none
0
0
S_RANDOMITEM11
Yes
0%
S_RANDOMITEM11
RNDM
K
3
none
0
0
S_RANDOMITEM12
Yes
0%
S_RANDOMITEM12
RNDM
L
3
none
0
0
S_RANDOMITEM13
Yes
0%
S_RANDOMITEM13
RNDM
M
3
none
0
0
S_RANDOMITEM14
Yes
0%
S_RANDOMITEM14
RNDM
N
3
none
0
0
S_RANDOMITEM15
Yes
0%
S_RANDOMITEM15
RNDM
O
3
none
0
0
S_RANDOMITEM16
Yes
0%
S_RANDOMITEM16
RNDM
P
3
none
0
0
S_RANDOMITEM17
Yes
0%
S_RANDOMITEM17
RNDM
Q
3
none
0
0
S_RANDOMITEM18
Yes
0%
S_RANDOMITEM18
RNDM
R
3
none
0
0
S_RANDOMITEM19
Yes
0%
S_RANDOMITEM19
RNDM
S
3
none
0
0
S_RANDOMITEM20
Yes
0%
S_RANDOMITEM20
RNDM
T
3
none
0
0
S_RANDOMITEM21
Yes
0%
S_RANDOMITEM21
RNDM
U
3
none
0
0
S_RANDOMITEM22
Yes
0%
S_RANDOMITEM22
RNDM
V
3
none
0
0
S_RANDOMITEM23
Yes
0%
S_RANDOMITEM23
RNDM
W
3
none
0
0
S_RANDOMITEM24
Yes
0%
S_RANDOMITEM24
RNDM
X
3
none
0
0
S_RANDOMITEM1
Yes
0%
S_DEADRANDOMITEM
RNDM
A
1
A_ItemPop
0
0
S_NULL
Yes
0%
Object type info – MT_RANDOMITEMPOP
Thing type number
-1
File:RPOPA0.png RPOPA0
Object type
MT_RANDOMITEMPOP
Sprite name prefix
RPOP
SpawnState
S_INVISIBLE
SeeState
S_NULL
SeeSound
sfx_None
AttackSound
sfx_None
PainState
S_NULL
PainSound
sfx_None
MeleeState
S_NULL
MissileState
S_NULL
DeathState
S_NULL
XDeathState
S_NULL
DeathSound
sfx_None
ActiveSound
sfx_None
RaiseState
S_NULL
SpawnHealth
1
ReactionTime
0
PainChance
0
Speed
0
Radius
16*FRACUNIT
Height
32*FRACUNIT
Display offset
0
Mass
MT_EXPLODE
Damage
0
Flags
MF_NOCLIP|MF_DONTENCOREMAP
States – MT_RANDOMITEMPOP
State
Sprite prefix
Frame
Duration (tics)
Action
Var 1
Var 2
Next state
Full brightness?
Translucency
S_RANDOMITEMPOP1
RPOP
A
5
none
0
0
S_RANDOMITEMPOP2
Yes
0%
S_RANDOMITEMPOP2
RPOP
B
5
none
0
0
S_RANDOMITEMPOP3
Yes
0%
S_RANDOMITEMPOP3
RPOP
C
5
none
0
0
S_RANDOMITEMPOP4
Yes
0%
S_RANDOMITEMPOP4
RPOP
D
5
none
0
0
S_NULL
Yes
0%