shithub: choc

Download patch

ref: bc7f01df39827dee7e24fb461b4d48510e0e3582
parent: fd1f146713bfa70136284a33214be42467611af5
author: Samuel Villareal <[email protected]>
date: Sat Sep 11 20:27:22 EDT 2010

+ Items can be picked up now
+ Fixed targeter x/y offsets
+ Pickup Armor/Health/Ammo/Weapon updates

Subversion-branch: /branches/strife-branch
Subversion-revision: 2067

--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -31,20 +31,14 @@
 #include "doomdef.h"
 #include "dstrings.h"
 #include "sounds.h"
-
 #include "deh_main.h"
 #include "deh_misc.h"
 #include "doomstat.h"
-
 #include "m_random.h"
 #include "i_system.h"
-
 #include "am_map.h"
-
 #include "p_local.h"
-
 #include "s_sound.h"
-
 #include "p_inter.h"
 
 
@@ -71,29 +65,25 @@
 // Returns false if the ammo can't be picked up at all
 //
 
-boolean
-P_GiveAmmo
-( player_t*	player,
-  ammotype_t	ammo,
-  int		num )
+boolean P_GiveAmmo(player_t* player, ammotype_t ammo, int num)
 {
     int		oldammo;
 	
-    if (ammo == am_noammo)
+    if(ammo == am_noammo)
 	return false;
 		
-    if (ammo > NUMAMMO)
+    if(ammo > NUMAMMO)
 	I_Error ("P_GiveAmmo: bad type %i", ammo);
 		
-    if ( player->ammo[ammo] == player->maxammo[ammo]  )
+    if(player->ammo[ammo] == player->maxammo[ammo])
 	return false;
 		
-    if (num)
+    if(num)
 	num *= clipammo[ammo];
     else
 	num = clipammo[ammo]/2;
     
-    if (gameskill == sk_baby
+    if(gameskill == sk_baby
 	|| gameskill == sk_nightmare)
     {
 	// give double ammo in trainer mode,
@@ -105,13 +95,13 @@
     oldammo = player->ammo[ammo];
     player->ammo[ammo] += num;
 
-    if (player->ammo[ammo] > player->maxammo[ammo])
+    if(player->ammo[ammo] > player->maxammo[ammo])
 	player->ammo[ammo] = player->maxammo[ammo];
 
     // If non zero ammo, 
     // don't change up weapons,
     // player was lower on purpose.
-    if (oldammo)
+    if(oldammo)
 	return true;	
 
     // We were down to zero,
@@ -118,47 +108,35 @@
     // so select a new weapon.
     // Preferences are not user selectable.
 
-    // villsa [STRIFE] TODO - BEWARE! NO WEAPON PREFERENCE MUST FIX
-    /*switch (ammo)
+    // villsa [STRIFE] ammo update
+    // [STRIFE] TODO - where's the check for grenades?
+    switch(ammo && !player->readyweapon)
     {
-      case am_clip:
-	if (player->readyweapon == wp_fist)
-	{
-	    if (player->weaponowned[wp_chaingun])
-		player->pendingweapon = wp_chaingun;
-	    else
-		player->pendingweapon = wp_pistol;
-	}
-	break;
+    case am_bullets:
+        if(player->weaponowned[wp_rifle])
+            player->pendingweapon = wp_rifle;
+        break;
+
+    case am_elecbolts:
+    case am_poisonbolts:
+        if(player->weaponowned[wp_elecbow])
+            player->pendingweapon = wp_elecbow;
+        break;
+
+    case am_cell:
+        if(player->weaponowned[wp_mauler])
+            player->pendingweapon = wp_mauler;
+        break;
+
+    case am_missiles:
+        if(player->weaponowned[wp_missile])
+            player->pendingweapon = wp_missile;
+        break;
+
+    default:
+        break;
+    }
 	
-      case am_shell:
-	if (player->readyweapon == wp_fist
-	    || player->readyweapon == wp_pistol)
-	{
-	    if (player->weaponowned[wp_shotgun])
-		player->pendingweapon = wp_shotgun;
-	}
-	break;
-	
-      case am_cell:
-	if (player->readyweapon == wp_fist
-	    || player->readyweapon == wp_pistol)
-	{
-	    if (player->weaponowned[wp_plasma])
-		player->pendingweapon = wp_plasma;
-	}
-	break;
-	
-      case am_misl:
-	if (player->readyweapon == wp_fist)
-	{
-	    if (player->weaponowned[wp_missile])
-		player->pendingweapon = wp_missile;
-	}
-      default:
-	break;
-    }*/
-	
     return true;
 }
 
@@ -167,59 +145,75 @@
 // P_GiveWeapon
 // The weapon name may have a MF_DROPPED flag ored in.
 //
-boolean
-P_GiveWeapon
-( player_t*	player,
-  weapontype_t	weapon,
-  boolean	dropped )
+// villsa [STRIFE] some stuff has been changed/moved around
+//
+boolean P_GiveWeapon(player_t* player, weapontype_t weapon, boolean dropped)
 {
-    boolean	gaveammo;
-    boolean	gaveweapon;
-	
-    if (netgame
-	&& (deathmatch!=2)
-	 && !dropped )
+    boolean gaveammo;
+    boolean gaveweapon;
+
+    // villsa [STRIFE] new code for giving alternate version
+    // of the weapon to player
+    if(player->weaponowned[weapon])
+        gaveweapon = false;
+    else
     {
-	// leave placed weapons forever on net games
-	if (player->weaponowned[weapon])
-	    return false;
+        gaveweapon = true;
+        player->weaponowned[weapon] = true;
 
-	player->bonuscount += BONUSADD;
-	player->weaponowned[weapon] = true;
+        switch(weapon)
+        {
+        case wp_elecbow:
+            player->weaponowned[wp_poisonbow] = true;
+            break;
 
-	if (deathmatch)
-	    P_GiveAmmo (player, weaponinfo[weapon].ammo, 5);
-	else
-	    P_GiveAmmo (player, weaponinfo[weapon].ammo, 2);
-	player->pendingweapon = weapon;
+        case wp_hegrenade:
+            player->weaponowned[wp_wpgrenade] = true;
+            break;
 
-	if (player == &players[consoleplayer])
-	    S_StartSound (NULL, sfx_wpnup);
-	return false;
+        case wp_mauler:
+            player->weaponowned[wp_torpedo] = true;
+            break;
+        }
+
+        // check for the standard weapons only
+        if(weapon > player->readyweapon && weapon <= wp_sigil)
+            player->pendingweapon = weapon;
+
     }
-	
-    if (weaponinfo[weapon].ammo != am_noammo)
+
+    if(netgame && (deathmatch != 2) && !dropped)
     {
-	// give one clip with a dropped weapon,
-	// two clips with a found weapon
-	if (dropped)
-	    gaveammo = P_GiveAmmo (player, weaponinfo[weapon].ammo, 1);
-	else
-	    gaveammo = P_GiveAmmo (player, weaponinfo[weapon].ammo, 2);
+        // leave placed weapons forever on net games
+        if(!gaveweapon)
+            return false;
+
+        player->bonuscount += BONUSADD;
+        player->weaponowned[weapon] = true;
+
+        if(deathmatch)
+            P_GiveAmmo(player, weaponinfo[weapon].ammo, 5);
+        else
+            P_GiveAmmo(player, weaponinfo[weapon].ammo, 2);
+
+        if(player == &players[consoleplayer])
+            S_StartSound (NULL, sfx_wpnup);
+        return false;
     }
-    else
-	gaveammo = false;
-	
-    if (player->weaponowned[weapon])
-	gaveweapon = false;
-    else
+
+    if(weaponinfo[weapon].ammo != am_noammo)
     {
-	gaveweapon = true;
-	player->weaponowned[weapon] = true;
-	player->pendingweapon = weapon;
+        // give one clip with a dropped weapon,
+        // two clips with a found weapon
+        if(dropped)
+            gaveammo = P_GiveAmmo (player, weaponinfo[weapon].ammo, 1);
+        else
+            gaveammo = P_GiveAmmo (player, weaponinfo[weapon].ammo, 2);
     }
-	
-    return (gaveweapon || gaveammo);
+    else
+        gaveammo = false;
+
+    return(gaveweapon || gaveammo);
 }
 
  
@@ -228,18 +222,34 @@
 // P_GiveBody
 // Returns false if the body isn't needed at all
 //
-boolean
-P_GiveBody
-( player_t*	player,
-  int		num )
+// villsa [STRIFE] a lot of changes has been added for stamina
+//
+boolean P_GiveBody(player_t* player, int num)
 {
-    if (player->health >= MAXHEALTH)
-	return false;
-		
-    player->health += num;
-    if (player->health > MAXHEALTH)
-	player->health = MAXHEALTH;
-    player->mo->health = player->health;
+    int health;
+
+    if(num >= 0)
+    {
+        health = player->stamina + MAXHEALTH;
+
+        if(health <= player->health)
+            return false;
+
+        player->health += num;
+
+        if(health < player->health + num)
+            player->health = health;
+        player->mo->health = player->health;
+    }
+    // [STRIFE] handle healing from the front's medic
+    else
+    {
+        health = (-num * (player->stamina + MAXHEALTH)) / MAXHEALTH;
+        if(health <= player->health)
+            return false;
+
+        player->health = health;
+    }
 	
     return true;
 }
@@ -251,20 +261,26 @@
 // Returns false if the armor is worse
 // than the current armor.
 //
-boolean
-P_GiveArmor
-( player_t*	player,
-  int		armortype )
+boolean P_GiveArmor(player_t* player, int armortype)
 {
-    int		hits;
-	
-    hits = armortype*100;
-    if (player->armorpoints >= hits)
-	return false;	// don't pick up
-		
+    int hits;
+
+    // villsa [STRIFE]
+    if(armortype < 0)
+    {
+        if(player->armorpoints)
+            return false;
+
+        armortype = -armortype;
+    }
+
+    hits = armortype * 100;
+    if(player->armorpoints >= hits)
+        return false;	// don't pick up
+
     player->armortype = armortype;
     player->armorpoints = hits;
-	
+
     return true;
 }
 
@@ -344,38 +360,34 @@
     }
 
 
-    if (player->powers[power])
+    if(player->powers[power])
         return false;	// already got it
 
+
     player->powers[power] = 1;
     return true;
 }
 
 
+// villsa [STRIFE]
+static char pickupmsg[80];
 
 //
 // P_TouchSpecialThing
 //
-void
-P_TouchSpecialThing
-( mobj_t*	special,
-  mobj_t*	toucher )
+void P_TouchSpecialThing(mobj_t* special, mobj_t* toucher)
 {
-    player_t*	player;
-    int		i;
-    fixed_t	delta;
-    int		sound;
-		
+    player_t*   player;
+    int         i;
+    fixed_t     delta;
+    int         sound;
+
     delta = special->z - toucher->z;
 
-    if (delta > toucher->height
-	|| delta < -8*FRACUNIT)
-    {
-	// out of reach
-	return;
-    }
-    
-	
+    if(delta > toucher->height || delta < -8*FRACUNIT)
+        return; // out of reach
+
+
     sound = sfx_itemup;	
     player = toucher->player;
 
@@ -382,311 +394,218 @@
     // Dead thing touching.
     // Can happen with a sliding player corpse.
     if (toucher->health <= 0)
-	return;
+        return;
 
+    // villsa [STRIFE]
+    pickupmsg[0] = 0;
+
     // Identify by sprite.
-    switch (special->sprite)
+    // villsa [STRIFE] new items
+    switch(special->sprite)
     {
-        // villsa [STRIFE] TODO - update actual strife sprite pickups
-/*	// armor
-      case SPR_ARM1:
-	if (!P_GiveArmor (player, deh_green_armor_class))
-	    return;
-	player->message = DEH_String(GOTARMOR);
-	break;
-		
-      case SPR_ARM2:
-	if (!P_GiveArmor (player, deh_blue_armor_class))
-	    return;
-	player->message = DEH_String(GOTMEGA);
-	break;
-	
-	// bonus items
-      case SPR_BON1:
-	player->health++;		// can go over 100%
-	if (player->health > deh_max_health)
-	    player->health = deh_max_health;
-	player->mo->health = player->health;
-	player->message = DEH_String(GOTHTHBONUS);
-	break;
-	
-      case SPR_BON2:
-	player->armorpoints++;		// can go over 100%
-	if (player->armorpoints > deh_max_armor)
-	    player->armorpoints = deh_max_armor;
-        // deh_green_armor_class only applies to the green armor shirt;
-        // for the armor helmets, armortype 1 is always used.
-	if (!player->armortype)
-	    player->armortype = 1;
-	player->message = DEH_String(GOTARMBONUS);
-	break;
-	
-      case SPR_SOUL:
-	player->health += deh_soulsphere_health;
-	if (player->health > deh_max_soulsphere)
-	    player->health = deh_max_soulsphere;
-	player->mo->health = player->health;
-	player->message = DEH_String(GOTSUPER);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-      case SPR_MEGA:
-	if (gamemode != commercial)
-	    return;
-	player->health = deh_megasphere_health;
-	player->mo->health = player->health;
-        // We always give armor type 2 for the megasphere; dehacked only 
-        // affects the MegaArmor.
-	P_GiveArmor (player, 2);
-	player->message = DEH_String(GOTMSPHERE);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-	// cards
-	// leave cards for everyone
-      case SPR_BKEY:
-	if (!player->cards[it_bluecard])
-	    player->message = DEH_String(GOTBLUECARD);
-	P_GiveCard (player, it_bluecard);
-	if (!netgame)
-	    break;
-	return;
-	
-      case SPR_YKEY:
-	if (!player->cards[it_yellowcard])
-	    player->message = DEH_String(GOTYELWCARD);
-	P_GiveCard (player, it_yellowcard);
-	if (!netgame)
-	    break;
-	return;
-	
-      case SPR_RKEY:
-	if (!player->cards[it_redcard])
-	    player->message = DEH_String(GOTREDCARD);
-	P_GiveCard (player, it_redcard);
-	if (!netgame)
-	    break;
-	return;
-	
-      case SPR_BSKU:
-	if (!player->cards[it_blueskull])
-	    player->message = DEH_String(GOTBLUESKUL);
-	P_GiveCard (player, it_blueskull);
-	if (!netgame)
-	    break;
-	return;
-	
-      case SPR_YSKU:
-	if (!player->cards[it_yellowskull])
-	    player->message = DEH_String(GOTYELWSKUL);
-	P_GiveCard (player, it_yellowskull);
-	if (!netgame)
-	    break;
-	return;
-	
-      case SPR_RSKU:
-	if (!player->cards[it_redskull])
-	    player->message = DEH_String(GOTREDSKULL);
-	P_GiveCard (player, it_redskull);
-	if (!netgame)
-	    break;
-	return;
-	
-	// medikits, heals
-      case SPR_STIM:
-	if (!P_GiveBody (player, 10))
-	    return;
-	player->message = DEH_String(GOTSTIM);
-	break;
-	
-      case SPR_MEDI:
-	if (!P_GiveBody (player, 25))
-	    return;
+    // bullets
+    case SPR_BLIT:
+        if(!P_GiveAmmo(player, am_bullets, 1))
+            return;
+        break;
+
+    // box of bullets
+    case SPR_BBOX:
+        if(!P_GiveAmmo(player, am_bullets, 5))
+            return;
+        break;
+
+    // missile
+    case SPR_ROKT:
+        if(!P_GiveAmmo(player, am_missiles, 1))
+            return;
+        break;
+
+    // box of missiles
+    case SPR_MSSL:
+        if(!P_GiveAmmo(player, am_missiles, 5))
+            return;
+        break;
+
+    // battery
+    case SPR_BRY1:
+        if(!P_GiveAmmo(player, am_cell, 1))
+            return;
+        break;
+
+    // cell pack
+    case SPR_CPAC:
+        if(!P_GiveAmmo(player, am_cell, 5))
+            return;
+        break;
+
+    // poison bolts
+    case SPR_PQRL:
+        if(!P_GiveAmmo(player, am_poisonbolts, 5))
+            return;
+        break;
+
+    // electric bolts
+    case SPR_XQRL:
+        if(!P_GiveAmmo(player, am_elecbolts, 5))
+            return;
+        break;
+
+    // he grenades
+    case SPR_GRN1:
+        if(!P_GiveAmmo(player, am_hegrenades, 1))
+            return;
+        break;
+
+    // wp grenades
+    case SPR_GRN2:
+        if(!P_GiveAmmo(player, am_wpgrenades, 1))
+            return;
+        break;
+
+    // rifle
+    case SPR_RIFL:
+        if(!P_GiveWeapon(player, wp_rifle, special->flags&MF_DROPPED))
+            return;
+        break;
+
+    // flame thrower
+    case SPR_FLAM:
+        if(!P_GiveWeapon(player, wp_flame, false))
+            return;
+        break;
+
+    // missile launcher
+    case SPR_MMSL:
+        if(!P_GiveWeapon(player, wp_missile, false))
+            return;
+        break;
+
+    // missile launcher
+    case SPR_GRND:
+        if(!P_GiveWeapon(player, wp_hegrenade, special->flags&MF_DROPPED))
+            return;
+        break;
+
+    // mauler
+    case SPR_TRPD:
+        if(!P_GiveWeapon(player, wp_mauler, false))
+            return;
+        break;
+
+    // crossbow
+    case SPR_CBOW:
+        if(!P_GiveWeapon(player, wp_elecbow, special->flags&MF_DROPPED))
+            return;
+        break;
+
+    // backpack
+    case SPR_BKPK:
+        if(!player->backpack)
+        {
+            for(i = 0; i < NUMAMMO; i++)
+                player->maxammo[i] *= 2;
 
-	if (player->health < 25)
-	    player->message = DEH_String(GOTMEDINEED);
-	else
-	    player->message = DEH_String(GOTMEDIKIT);
-	break;
+            player->backpack = true;
+        }
+        for(i = 0; i < NUMAMMO; i++)
+	    P_GiveAmmo(player, i, 1);
+        break;
 
-	
-	// power ups
-      case SPR_PINV:
-	if (!P_GivePower (player, pw_invulnerability))
-	    return;
-	player->message = DEH_String(GOTINVUL);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-      case SPR_PSTR:
-	if (!P_GivePower (player, pw_strength))
-	    return;
-	player->message = DEH_String(GOTBERSERK);
-	if (player->readyweapon != wp_fist)
-	    player->pendingweapon = wp_fist;
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-      case SPR_PINS:
-	if (!P_GivePower (player, pw_invisibility))
-	    return;
-	player->message = DEH_String(GOTINVIS);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-      case SPR_SUIT:
-	if (!P_GivePower (player, pw_ironfeet))
-	    return;
-	player->message = DEH_String(GOTSUIT);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-      case SPR_PMAP:
-	if (!P_GivePower (player, pw_allmap))
-	    return;
-	player->message = DEH_String(GOTMAP);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-      case SPR_PVIS:
-	if (!P_GivePower (player, pw_infrared))
-	    return;
-	player->message = DEH_String(GOTVISOR);
-	sound = sfx_swish; // villsa [STRIFE] TODO - fix sounds
-	break;
-	
-	// ammo
-      case SPR_CLIP:
-	if (special->flags & MF_DROPPED)
-	{
-	    if (!P_GiveAmmo (player,am_clip,0))
-		return;
-	}
-	else
-	{
-	    if (!P_GiveAmmo (player,am_clip,1))
-		return;
-	}
-	player->message = DEH_String(GOTCLIP);
-	break;
-	
-      case SPR_AMMO:
-	if (!P_GiveAmmo (player, am_clip,5))
-	    return;
-	player->message = DEH_String(GOTCLIPBOX);
-	break;
-	
-      case SPR_ROCK:
-	if (!P_GiveAmmo (player, am_misl,1))
-	    return;
-	player->message = DEH_String(GOTROCKET);
-	break;
-	
-      case SPR_BROK:
-	if (!P_GiveAmmo (player, am_misl,5))
-	    return;
-	player->message = DEH_String(GOTROCKBOX);
-	break;
-	
-      case SPR_CELL:
-	if (!P_GiveAmmo (player, am_cell,1))
-	    return;
-	player->message = DEH_String(GOTCELL);
-	break;
-	
-      case SPR_CELP:
-	if (!P_GiveAmmo (player, am_cell,5))
-	    return;
-	player->message = DEH_String(GOTCELLBOX);
-	break;
-	
-      case SPR_SHEL:
-	if (!P_GiveAmmo (player, am_shell,1))
-	    return;
-	player->message = DEH_String(GOTSHELLS);
-	break;
-	
-      case SPR_SBOX:
-	if (!P_GiveAmmo (player, am_shell,5))
-	    return;
-	player->message = DEH_String(GOTSHELLBOX);
-	break;
-	
-      case SPR_BPAK:
-	if (!player->backpack)
-	{
-	    for (i=0 ; i<NUMAMMO ; i++)
-		player->maxammo[i] *= 2;
-	    player->backpack = true;
-	}
-	for (i=0 ; i<NUMAMMO ; i++)
-	    P_GiveAmmo (player, i, 1);
-	player->message = DEH_String(GOTBACKPACK);
-	break;
-	
-	// weapons
-      case SPR_BFUG:
-	if (!P_GiveWeapon (player, wp_bfg, false) )
-	    return;
-	player->message = DEH_String(GOTBFG9000);
-	sound = sfx_wpnup;	
-	break;
-	
-      case SPR_MGUN:
-	if (!P_GiveWeapon (player, wp_chaingun, special->flags&MF_DROPPED) )
-	    return;
-	player->message = DEH_String(GOTCHAINGUN);
-	sound = sfx_wpnup;	
-	break;
-	
-      case SPR_CSAW:
-	if (!P_GiveWeapon (player, wp_chainsaw, false) )
-	    return;
-	player->message = DEH_String(GOTCHAINSAW);
-	sound = sfx_wpnup;	
-	break;
-	
-      case SPR_LAUN:
-	if (!P_GiveWeapon (player, wp_missile, false) )
-	    return;
-	player->message = DEH_String(GOTLAUNCHER);
-	sound = sfx_wpnup;	
-	break;
-	
-      case SPR_PLAS:
-	if (!P_GiveWeapon (player, wp_plasma, false) )
-	    return;
-	player->message = DEH_String(GOTPLASMA);
-	sound = sfx_wpnup;	
-	break;
-	
-      case SPR_SHOT:
-	if (!P_GiveWeapon (player, wp_shotgun, special->flags&MF_DROPPED ) )
-	    return;
-	player->message = DEH_String(GOTSHOTGUN);
-	sound = sfx_wpnup;	
-	break;
-		
-      case SPR_SGN2:
-	if (!P_GiveWeapon (player, wp_supershotgun, special->flags&MF_DROPPED ) )
-	    return;
-	player->message = DEH_String(GOTSHOTGUN2);
-	sound = sfx_wpnup;	
-	break;*/
-		
-      default:
-          // villsa [STRIFE] TODO - disabled for now until all things are filled
-          return;
-	//I_Error ("P_SpecialThing: Unknown gettable thing");
+    case SPR_COIN:
+        P_GiveInventoryItem(player, SPR_COIN, MT_MONY_1);
+        break;
+
+    case SPR_CRED:
+        for(i = 0; i < 10; i++)
+            P_GiveInventoryItem(player, SPR_COIN, MT_MONY_1);
+        break;
+
+    case SPR_SACK:
+        for(i = 0; i < 25; i++)
+            P_GiveInventoryItem(player, SPR_COIN, MT_MONY_1);
+        break;
+
+    case SPR_CHST:
+        for(i = 0; i < 50; i++)
+            P_GiveInventoryItem(player, SPR_COIN, MT_MONY_1);
+        break;
+
+    case SPR_ARM1:
+        if(!P_GiveArmor(player, -2))
+            if(!P_GiveInventoryItem(player, special->sprite, special->type))
+                pickupmsg[0] = '!';
+        break;
+
+    case SPR_ARM2:
+        if(!P_GiveArmor(player, -1))
+            if(!P_GiveInventoryItem(player, special->sprite, special->type))
+                pickupmsg[0] = '!';
+        break;
+
+    case SPR_PMAP:
+        if(!P_GivePower(player, pw_allmap))
+            return;
+        sound = sfx_yeah;	
+        break;
+
+    case SPR_COMM:
+        if(!P_GivePower(player, pw_communicator))
+            return;
+        sound = sfx_yeah;
+        break;
+
+    // villsa [STRIFE] check default items
+    case SPR_TOKN:
+    default:
+        if(special->type >= MT_KEY_BASE && special->type <= MT_NEWKEY5)
+        {
+            if(!P_GiveCard(player, special->type - MT_KEY_BASE))
+                return;
+        }
+        else
+        {
+            if(!P_GiveInventoryItem(player, special->sprite, special->type))
+                    pickupmsg[0] = '!';
+        }
     }
 
+    // villsa [STRIFE] set message
+    if(!pickupmsg[0])
+    {
+        if(special->info->name)
+            sprintf(pickupmsg, "You picked up the %s.", special->info->name);
+        else
+            sprintf(pickupmsg, "You picked up the item.");
+    }
+    // use the first character to indicate that the player is full on items
+    else if(pickupmsg[0] == '!')
+    {
+        sprintf(pickupmsg, "You cannot hold any more.");
+        player->message = pickupmsg;
+        return;
+    }
+
+    if(special->flags & MF_GIVEQUEST)
+    {
+        // [STRIFE] TODO - verify this. Seems that questflag isn't
+        // applied if the special's speed is equal to 8 or if
+        // the player has recieved the SLIDESHOW token
+        if(special->info->speed != 8 || !(player->questflags & 32))
+            player->questflags |= 1 << (special->info->speed - 1);
+    }
+
+
     // haleyjd 08/30/10: [STRIFE] No itemcount
     //if (special->flags & MF_COUNTITEM)
     //    player->itemcount++;
-    P_RemoveMobj (special);
+
+    P_RemoveMobj(special);
+    player->message = pickupmsg;
     player->bonuscount += BONUSADD;
-    if (player == &players[consoleplayer])
-	S_StartSound (NULL, sound);
+
+    if(player == &players[consoleplayer])
+        S_StartSound(NULL, sound);
 }
 
 
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -966,8 +966,11 @@
     player->psprites[ps_flash].sy = player->psprites[ps_weapon].sy;
 
     // villsa [STRIFE] extra stuff for targeter
-    player->psprites[ps_targleft].sx    = (100 - player->accuracy) - (160*FRACUNIT);
-    player->psprites[ps_targright].sx   = (100 - player->accuracy) + (160*FRACUNIT);
+    player->psprites[ps_targleft].sx =
+        (160*FRACUNIT) - ((100 - player->accuracy) << FRACBITS);
+
+    player->psprites[ps_targright].sx =
+        ((100 - player->accuracy) << FRACBITS) + (160*FRACUNIT);
 }