From 13d3cfaffadd7d32c5377260bfe6ed566b59d679 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 15 Apr 2006 08:05:02 +0000 Subject: [PATCH] Modified shoot() to have an extra parameter for the projectile tilenum and added an option to disable autoaim on RPG type projectiles. Also added "advanced options" to the "video settings" menu. git-svn-id: https://svn.eduke32.com/eduke32@18 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/funct.h | 2 +- polymer/eduke32/source/menus.c | 20 +++++++++++------ polymer/eduke32/source/player.c | 39 ++++++++++++++++++++++++--------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index 423d161a1..dfed7c352 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -119,7 +119,7 @@ extern void tracers(long x1,long y1,long z1,long x2,long y2,long z2,long n); extern long hits(short i); extern long hitasprite(short i,short *hitsp); extern long hitawall(struct player_struct *p,short *hitw); -extern short aim(spritetype *s,short aang); +extern short aim(spritetype *s,short aang,short atwith); extern short shoot(short i,short atwith); extern void displayloogie(short snum); extern char animatefist(short gs,short snum); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 16c4f746c..c238cfa61 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -1917,7 +1917,7 @@ cheat_for_port_credits: case 230: rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); - menutext(320>>1,24,0,0,"OMFG LOL VIDEO S3TT1NGZ"); + menutext(320>>1,24,0,0,"ADVANCED VIDEO"); c = (320>>1)-120; @@ -1942,7 +1942,7 @@ cheat_for_port_credits: "-", "-", "-", - "Boobs", + "-", NULL }; @@ -1959,7 +1959,7 @@ cheat_for_port_credits: onbar = (probey == 0); x = probesm(c,yy+5,0,io); - if (x == -1) { cmenu(202); break; } + if (x == -1) { cmenu(203); break; } yy = 34; for (ii=io=0; opts[ii]; ii++) { @@ -2068,9 +2068,10 @@ cheat_for_port_credits: modval(0,1,(int *)&ud.mouseflip,1,probey==5); gametextpal(d,yy, ud.mouseflip ? "On" : "Off", 0, 0); break; case 6: if (ps[myconnectindex].gm&MODE_GAME || numplayers > 1) enabled = 0; - if (enabled && x==io) AutoAim = 1-AutoAim; - if (enabled) modval(0,1,(int *)&AutoAim,1,probey==6); - gametextpal(d,yy, AutoAim ? "On" : "Off", enabled?0:10, 0); break; + if (enabled && x==io) { AutoAim = (AutoAim == 2) ? 0 : AutoAim+1; } + if (enabled) modval(0,2,(int *)&AutoAim,1,probey==6); + { char *s[] = { "Off", "Full", "Hitscan" }; + gametextpal(d,yy, s[AutoAim], enabled?0:10, 0); break; } case 7: if (x==io) ud.runkey_mode = 1-ud.runkey_mode; modval(0,1,(int *)&ud.runkey_mode,1,probey==7); gametextpal(d,yy, ud.runkey_mode ? "Classic" : "Modern", 0, 0); break; @@ -2294,7 +2295,7 @@ cheat_for_port_credits: c = (320>>1)-120; #if defined(POLYMOST) && defined(USE_OPENGL) - x = 7; + x = 8; #else x = 5; #endif @@ -2486,6 +2487,9 @@ cheat_for_port_credits: if (glanisotropy > glinfo.maxanisotropy) glanisotropy = 1; gltexapplyprops(); break; + case 7: + cmenu(230); + break; #endif } @@ -2528,6 +2532,8 @@ cheat_for_port_credits: if (glanisotropy == 1) strcpy(tempbuf,"NONE"); else sprintf(tempbuf,"%ld-tap",glanisotropy); menutext(c+154,50+62+16+16+16,0,bpp==8,tempbuf); + menutext(c,50+62+16+16+16+16,0,0,"ADVANCED OPTIONS"); + #endif break; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index ebf2ae1e3..a6d65a940 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -268,7 +268,7 @@ long hitawall(struct player_struct *p,short *hitw) return ( FindDistance2D(sx-p->posx,sy-p->posy) ); } -short aim(spritetype *s,short aang) +short aim(spritetype *s,short aang,short atwith) { char gotshrinker,gotfreezer; short i, j, a, k, cans; @@ -279,8 +279,27 @@ short aim(spritetype *s,short aang) a = s->ang; j = -1; - if(s->picnum == APLAYER && !ps[s->yvel].auto_aim) return -1; - + if(s->picnum == APLAYER) { + if(!ps[s->yvel].auto_aim) + return -1; + if(ps[s->yvel].auto_aim == 2) + { + if(checkspriteflagsp(atwith,SPRITE_FLAG_PROJECTILE) && (projectile[atwith].workslike & PROJECTILE_FLAG_RPG)) + return -1; + else switch(dynamictostatic[atwith]) { + case TONGUE__STATIC: + case FREEZEBLAST__STATIC: + case SHRINKSPARK__STATIC: + case RPG__STATIC: + case FIRELASER__STATIC: + case SPIT__STATIC: + case COOLEXPLOSION1__STATIC: + return -1; + default: + break; + } + } + } gotshrinker = s->picnum == APLAYER && *aplWeaponWorksLike[ps[s->yvel].curr_weapon] == SHRINKER_WEAPON; gotfreezer = s->picnum == APLAYER && *aplWeaponWorksLike[ps[s->yvel].curr_weapon] == FREEZE_WEAPON; @@ -617,7 +636,7 @@ short shoot(short i,short atwith) j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0) { @@ -903,7 +922,7 @@ DOSKIPBULLETHOLE: j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0) { @@ -1142,7 +1161,7 @@ DOSKIPBULLETHOLE: j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0) { @@ -1386,7 +1405,7 @@ SKIPBULLETHOLE: j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0) @@ -1482,7 +1501,7 @@ SKIPBULLETHOLE: j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0) @@ -1682,7 +1701,7 @@ SKIPBULLETHOLE: j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0) @@ -1773,7 +1792,7 @@ SKIPBULLETHOLE: j=-1; if( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p)); + j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if(j >= 0)