Gez
Why don't I have a custom title by now?!
Posts: 9278
Registered: 07-07 |
I'm glad you asked!
First, the mobj_ts for the ID in questions. Pay attention to the namepointer fields.
code: { /*MT_KEY_ID_BLUE*/
184, //doomednum
S_CRD1_00, //spawnstate
1000, //spawnhealth
S_NULL, //seestate
sfx_None, //seesound
8, //reactiontime
sfx_None, //attacksound
S_NULL, //painstate
0, //painchance
sfx_None, //painsound
S_NULL, //meleestate
S_NULL, //missilestate
S_NULL, //crashstate
S_NULL, //deathstate
S_NULL, //xdeathstate
sfx_None, //deathsound
0, //speed
20*FRACUNIT, //radius
16*FRACUNIT, //height
100, //mass
0, //damage
sfx_None, //activesound
MF_SPECIAL|MF_NOTDMATCH, //flags
"ID_Badge", //namepointer
},
code: { /*MT_KEY_ID_GOLD*/
13, //doomednum
S_CRD2_00, //spawnstate
1000, //spawnhealth
S_NULL, //seestate
sfx_None, //seesound
8, //reactiontime
sfx_None, //attacksound
S_NULL, //painstate
0, //painchance
sfx_None, //painsound
S_NULL, //meleestate
S_NULL, //missilestate
S_NULL, //crashstate
S_NULL, //deathstate
S_NULL, //xdeathstate
sfx_None, //deathsound
0, //speed
20*FRACUNIT, //radius
16*FRACUNIT, //height
100, //mass
0, //damage
sfx_None, //activesound
MF_SPECIAL|MF_NOTDMATCH, //flags
"ID_Card", //namepointer
},
Then, the relevant function excerpts:
code: if(special->type >= MT_KEY_BASE && special->type <= MT_NEWKEY5)
{
// haleyjd 09/21/10: Strife player still picks up keys that
// he has already found. (break, not return)
if(!P_GiveCard(player, special->type - MT_KEY_BASE))
break;
}
code: if(!pickupmsg[0])
{
if(special->info->name)
{
DEH_snprintf(pickupmsg, sizeof(pickupmsg),
"You picked up the %s.", DEH_String(special->info->name));
}
else
DEH_snprintf(pickupmsg, sizeof(pickupmsg), "You picked up the item.");
}
The enums:
code: MT_KEY_BASE, //133
MT_GOVSKEY, //134
MT_KEY_TRAVEL, //135
MT_KEY_ID_BLUE, //136
MT_PRISONKEY, //137
MT_KEY_HAND, //138
MT_POWER1KEY, //139
MT_POWER2KEY, //140
MT_POWER3KEY, //141
MT_KEY_GOLD, //142
MT_KEY_ID_GOLD, //143
MT_KEY_SILVER, //144
MT_KEY_ORACLE, //145
MT_MILITARYID, //146
MT_KEY_ORDER, //147
MT_KEY_WAREHOUSE, //148
MT_KEY_BRASS, //149
MT_KEY_RED_CRYSTAL, //150
MT_KEY_BLUE_CRYSTAL, //151
MT_KEY_CHAPEL, //152
MT_CATACOMBKEY, //153
MT_SECURITYKEY, //154
MT_KEY_CORE, //155
MT_KEY_MAULER, //156
MT_KEY_FACTORY, //157
MT_KEY_MINE, //158
MT_NEWKEY5, //159
code: typedef enum
{
key_BaseKey, // 0
key_GovsKey, // 1
key_Passcard, // 2
key_IDCard, // 3
key_PrisonKey, // 4
key_SeveredHand, // 5
key_Power1Key, // 6
key_Power2Key, // 7
key_Power3Key, // 8
key_GoldKey, // 9
key_IDBadge, // 10
key_SilverKey, // 11
key_OracleKey, // 12
key_MilitaryID, // 13
key_OrderKey, // 14
key_WarehouseKey, // 15
key_BrassKey, // 16
key_RedCrystalKey, // 17
key_BlueCrystalKey, // 18
key_ChapelKey, // 19
key_CatacombKey, // 20
key_SecurityKey, // 21
key_CoreKey, // 22
key_MaulerKey, // 23
key_FactoryKey, // 24
key_MineKey, // 25
key_NewKey5, // 26
NUMCARDS // 27
} card_t;
So,
ID_Badge = MT_KEY_ID_BLUE = 136 - 133 = 3 = key_IDCard
ID_Card = MT_KEY_ID_GOLD = 143 - 133 = 10 = key_IDBadge
Therefore, here's a log of messages from a custom Strife map:
"You picked up the ID_Card."
"You need an id card."
|