shithub: choc

Download patch

ref: d112932e1efaa6588ed7276021847a28eb596900
parent: bdd800ded2c0e2df1b15372135b9cfd5901f6ecd
author: Samuel Villareal <svkaiser@gmail.com>
date: Mon Sep 6 23:16:54 EDT 2010

+ All linedef flags added
+ Translucent line/wall drawing supported
+ Jumpover/Blockfloater flag behavior implemented
+ Puff behavior implemented
+ Some changes to PIT_AttackRadius
+ Some changes to PIT_ChangeSector

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

--- a/src/strife/doomdata.h
+++ b/src/strife/doomdata.h
@@ -139,6 +139,18 @@
 // Set if already seen, thus drawn in automap.
 #define ML_MAPPED		256
 
+// villsa [STRIFE] jump over rails?
+#define ML_JUMPOVER             512
+
+// villsa [STRIFE] block flying things
+#define ML_BLOCKFLOATERS        1024
+
+// villsa [STRIFE] TODO - 25% or 75% transcluency?
+#define ML_TRANSPARENT1         2048
+
+// villsa [STRIFE] TODO - 25% or 75% transcluency?
+#define ML_TRANSPARENT2         4096
+
 
 
 
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -1619,7 +1619,7 @@
 
     A_FaceTarget(actor);
 
-    actor->z += (32*FRACUNIT);
+    actor->z += MAXRADIUS;
 
     // grenade 1
     actor->angle -= (ANG45 / 32);
@@ -1631,7 +1631,7 @@
     mo = P_SpawnFacingMissile(actor, actor->target, MT_INQGRENADE);
     mo->momz += (16*FRACUNIT);
 
-    actor->z -= (32*FRACUNIT);
+    actor->z -= MAXRADIUS;
 }
 
 //
@@ -2022,12 +2022,12 @@
     if(!actor->target)
         return;
 
-    actor->z += (32*FRACUNIT);
+    actor->z += MAXRADIUS;
 
     mo = P_SpawnMissile(actor, actor->target, MT_SEEKMISSILE);
     mo->tracer = actor->target;
 
-    actor->z -= (32*FRACUNIT);
+    actor->z -= MAXRADIUS;
 }
 
 //
--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -249,11 +249,19 @@
 		
     if (!(tmthing->flags & MF_MISSILE) )
     {
-	if ( ld->flags & ML_BLOCKING )
+        // villsa [STRIFE] include jumpover flag
+	if ( ld->flags & ML_BLOCKING &&
+            (!(ld->flags & ML_JUMPOVER) || tmfloorz + (32*FRACUNIT) > tmthing->z) )
 	    return false;	// explicitly blocking everything
 
-	if ( !tmthing->player && ld->flags & ML_BLOCKMONSTERS )
+        // villsa [STRIFE] exclude floaters from blockmonster lines
+	if ( !tmthing->player && ld->flags & ML_BLOCKMONSTERS &&
+            !(tmthing->flags & MF_FLOAT))
 	    return false;	// block monsters only
+
+        // villsa [STRIFE]
+        if ( ld->flags & ML_BLOCKFLOATERS && tmthing->flags & MF_FLOAT )
+            return false;   // block floaters only
     }
 
     // set openrange, opentop, openbottom
@@ -1053,6 +1061,7 @@
     line_t*		li;
     
     mobj_t*		th;
+    mobj_t*             th2;    // villsa [STRIFE]
 
     fixed_t		slope;
     fixed_t		dist;
@@ -1118,11 +1127,18 @@
 		return false;		
 	}
 
-	// Spawn bullet puffs.
-	P_SpawnPuff (x,y,z);
+        // villsa [STRIFE]
+        if(la_damage > 0)
+        {
+            // villsa [STRIFE] TODO - verify on whats the purpose with this
+            if(attackrange != (2112*FRACUNIT))
+                P_SpawnPuff(x, y, z); // Spawn bullet puffs.
+            else
+                P_SpawnMobj(x, y, z, MT_STRIFEPUFF3);
 	
-	// don't go any farther
-	return false;	
+	    // don't go any farther
+	    return false;	
+        }
     }
     
     // shoot a thing
@@ -1132,6 +1148,10 @@
     
     if (!(th->flags&MF_SHOOTABLE))
 	return true;		// corpse or something
+
+    // villsa [STRIFE] skip mvis flagged things?
+    if(th->flags & MF_MVIS)
+        return true;
 		
     // check angles to see if the thing can be aimed at
     dist = FixedMul (attackrange, in->frac);
@@ -1154,16 +1174,26 @@
     y = trace.y + FixedMul (trace.dy, frac);
     z = shootz + FixedMul (aimslope, FixedMul(frac, attackrange));
 
+    // villsa [STRIFE] TODO - verify purpose of this
+    if(attackrange == (2112*FRACUNIT))
+    {
+        th2 = P_SpawnMobj(x, y, z, MT_STRIFEPUFF3);
+        th2->momz = -FRACUNIT;
+        P_DamageMobj(th, th2, shootthing, la_damage);
+        return false;
+    }
+
+    // villsa [STRIFE] TODO - verify disabled check for damage?
+    //if (la_damage)
+	P_DamageMobj (th, shootthing, shootthing, la_damage);
+
     // Spawn bullet puffs or blod spots,
     // depending on target type.
     if (in->d.thing->flags & MF_NOBLOOD)
-	P_SpawnPuff (x,y,z);
+	P_SpawnSparkPuff(x, y, z);  // villsa [STRIFE] call spark puff function instead
     else
 	P_SpawnBlood (x,y,z, la_damage);
 
-    if (la_damage)
-	P_DamageMobj (th, shootthing, shootthing, la_damage);
-
     // don't go any farther
     return false;
 	
@@ -1205,6 +1235,11 @@
 		
     if (linetarget)
 	return aimslope;
+    else    // villsa [STRIFE] checks for player pitch
+    {
+        if(t1->player)
+            return (t1->player->pitch << FRACBITS) / 160;
+    }
 
     return 0;
 }
@@ -1225,6 +1260,7 @@
 {
     fixed_t	x2;
     fixed_t	y2;
+    int         traverseflags;
 	
     angle >>= ANGLETOFINESHIFT;
     shootthing = t1;
@@ -1235,9 +1271,15 @@
     attackrange = distance;
     aimslope = slope;
 
+    // villsa [STRIFE] test lines only if damage is <= 0
+    if(damage >= 1)
+        traverseflags = (PT_ADDLINES|PT_ADDTHINGS);
+    else
+        traverseflags = PT_ADDLINES;
+
     P_PathTraverse(t1->x, t1->y,
                    x2, y2,
-                   PT_ADDLINES|PT_ADDTHINGS,
+                   traverseflags,
                    PTR_ShootTraverse);
 }
  
@@ -1387,6 +1429,14 @@
     for (y=yl ; y<=yh ; y++)
 	for (x=xl ; x<=xh ; x++)
 	    P_BlockThingsIterator (x, y, PIT_RadiusAttack );
+
+    // villsa [STRIFE] TODO - verify. what on earth is it trying to do here?
+    spot->z += MAXRADIUS;
+    P_LineAttack(spot, 0, dist, 1, 0);
+    P_LineAttack(spot, ANG90, dist, 1, 0);
+    P_LineAttack(spot, ANG180, dist, 1, 0);
+    P_LineAttack(spot, ANG270, dist, 1, 0);
+    spot->z -= MAXRADIUS;
 }
 
 
@@ -1425,8 +1475,15 @@
     // crunch bodies to giblets
     if (thing->health <= 0)
     {
-	//P_SetMobjState (thing, S_GIBS);   // villsa [STRIFE] TODO - update proper gib state
+        // villsa [STRIFE] do something with the player
+        if(thing->player && thing->subsector->sector->specialdata)
+        {
+            nofit = true;
+            return false;
+        }
+	//P_SetMobjState (thing, S_GIBS);   // villsa [STRIFE] unused
 
+        A_BodyParts(thing); // villsa [STRIFE] spit out meat/junk stuff
 	thing->flags &= ~MF_SOLID;
 	thing->height = 0;
 	thing->radius = 0;
@@ -1454,10 +1511,10 @@
 
     if (crushchange && !(leveltime&3) )
     {
+        S_StartSound(thing, sfx_pcrush);   // villsa [STRIFE]
 	P_DamageMobj(thing,NULL,NULL,10);
 
 	// spray blood in a random direction
-        // villsa [STRIFE] TODO - verify
 	mo = P_SpawnMobj (thing->x,
 			  thing->y,
 			  thing->z + thing->height/2, MT_BLOOD_DEATH);
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -961,18 +961,13 @@
     th->momz = FRACUNIT;
     th->tics -= P_Random()&3;
 
-    // villsa [STRIFE] TODO - verify and update
-    /*if(shootdist == (80*FRACUNIT))
-        P_SetMobjState(th, S_POW2_00);*/
+    // don't make punches spark on the wall
+    if(attackrange == MELEERANGE)
+        P_SetMobjState(th, S_POW2_00);
 
     // villsa [STRIFE] unused
     /*if (th->tics < 1)
 	th->tics = 1;*/
-	
-    // don't make punches spark on the wall
-    // villsa [STRIFE] TODO - proper puff state
-    //if (attackrange == MELEERANGE)
-	//P_SetMobjState (th, S_PUFF3);
 }
 
 //
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -562,9 +562,9 @@
     st2 = &states[weaponinfo[player->readyweapon].atkstate];
     P_SetPsprite(player, ps_flash, st1 - st2);
 
-    player->mo->z += (32*FRACUNIT); // ugh
+    player->mo->z += MAXRADIUS; // ugh
     mo = P_SpawnMortar(player->mo, type);
-    player->mo->z -= (32*FRACUNIT); // ugh
+    player->mo->z -= MAXRADIUS; // ugh
 
     // change momz based on player's pitch
     mo->momz = FixedMul((player->pitch<<FRACBITS) / 160, mo->info->speed) + (8*FRACUNIT);
--- a/src/strife/r_segs.c
+++ b/src/strife/r_segs.c
@@ -158,6 +158,14 @@
 			
     if (fixedcolormap)
 	dc_colormap = fixedcolormap;
+
+    // villsa [STRIFE] render as transparent (25% or 75%?)
+    if(curline->linedef->flags & ML_TRANSPARENT1)
+        colfunc = fuzzcolfunc;
+
+    // villsa [STRIFE] render as transparent (25% or 75%?)
+    if(curline->linedef->flags & ML_TRANSPARENT2)
+        colfunc = R_DrawMVisTLColumn;
     
     // draw the columns
     for (dc_x = x1 ; dc_x <= x2 ; dc_x++)
@@ -188,6 +196,8 @@
 	}
 	spryscale += rw_scalestep;
     }
+
+    colfunc = basecolfunc;  // villsa [STRIFE] reset draw routines
 	
 }