@@ -113,6 +113,11 @@ static boolean P_GiveAmmo(player_t *player, ammotype_t ammo, int num)
113113 else
114114 num = clipammo[ammo]/2 ;
115115
116+ // [WILLIAM] - trigger haptic effect for the player picking up ammo
117+ // printf("Player %d picked up ammo %d\n",
118+ // player - players, num);
119+ R_PlayerPickupAmmo (player, ammo, num);
120+
116121 // give double ammo in trainer mode, you'll need in nightmare
117122 if (gameskill == sk_baby || gameskill == sk_nightmare)
118123 num <<= 1 ;
@@ -210,6 +215,11 @@ static boolean P_GiveWeapon(player_t *player, weapontype_t weapon, boolean dropp
210215 gaveweapon = true ;
211216 player->weaponowned [weapon] = true ;
212217 player->pendingweapon = weapon;
218+ // [WILLIAM] - trigger haptic effect for the player picking up a weapon
219+ //
220+ // printf("Player %d picked up weapon %d\n",
221+ // player - players, weapon);
222+ R_PlayerPickupWeapon (player, weapon);
213223 }
214224 return gaveweapon || gaveammo;
215225}
@@ -227,6 +237,10 @@ static boolean P_GiveBody(player_t *player, int num)
227237 if (player->health > maxhealth)
228238 player->health = maxhealth;
229239 player->mo ->health = player->health ;
240+ // [WILLIAM] - trigger haptic effect for the player picking up health
241+ // printf("Player %d picked up health %d\n",
242+ // player - players, num);
243+ R_PlayerPickupHealth (player, num);
230244 return true ;
231245}
232246
@@ -243,6 +257,10 @@ static boolean P_GiveArmor(player_t *player, int armortype)
243257 return false ; // don't pick up
244258 player->armortype = armortype;
245259 player->armorpoints = hits;
260+ // [WILLIAM] - trigger haptic effect for the player picking up armor
261+ // printf("Player %d picked up armor %d\n",
262+ // player - players, armortype);
263+ R_PlayerPickupArmor (player, armortype);
246264 return true ;
247265}
248266
@@ -256,6 +274,11 @@ static void P_GiveCard(player_t *player, card_t card)
256274 return ;
257275 player->bonuscount = BONUSADD;
258276 player->cards [card] = 1 ;
277+
278+ // [WILLIAM] - trigger haptic effect for the player picking up a card
279+ // printf("Player %d picked up card %d\n",
280+ // player - players, card);
281+ R_PlayerPickupCard (player, card);
259282}
260283
261284//
@@ -289,6 +312,12 @@ boolean P_GivePower(player_t *player, int power)
289312
290313 if (player->powers [power] >= 0 )
291314 player->powers [power] = tics[power];
315+
316+ // [WILLIAM] - trigger haptic effect for the player picking up a powerup
317+ // printf("Player %d picked up powerup %d\n",
318+ // player - players, power);
319+ R_PlayerPickupPowerUp (player, power);
320+
292321 return true ;
293322}
294323
0 commit comments