diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index a46c84641..f456cb9c6 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -793,7 +793,8 @@ enum weaponflags { WEAPON_FLAG_SPAWNTYPE2 = 4096, // spawn like shotgun shells WEAPON_FLAG_SPAWNTYPE3 = 8192, // spawn like chaingun shells WEAPON_FLAG_SEMIAUTO = 16384, // cancel button press after each shot - WEAPON_FLAG_RELOAD_TIMING = 32768 // special casing for pistol reload sounds + WEAPON_FLAG_RELOAD_TIMING = 32768, // special casing for pistol reload sounds + WEAPON_FLAG_RESET = 65536 // cycle weapon back to frame 1 if fire is held, 0 if not }; #define TRIPBOMB_TRIPWIRE 1 diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 3f9c18618..95182299f 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8458,8 +8458,8 @@ void sanitizegametype() } Bsprintf(tempbuf,"%s\n",gametype_names[ud.m_coop]); initprintf(tempbuf); - if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_ITEMRESPAWN) ud.m_respawn_items = 1; - else ud.m_respawn_items = 0; + if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_ITEMRESPAWN) + ud.m_respawn_items = ud.m_respawn_inventory = 1; // initprintf("ud.m_coop=%i after sanitisation\n",ud.m_coop); } diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index e7f8090c3..ff5123b98 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5001,11 +5001,11 @@ void AddSystemVars() Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",PISTOL_WEAPON); AddGameVar(aszBuf, 2, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",PISTOL_WEAPON); - AddGameVar(aszBuf, 6, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, 5, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",PISTOL_WEAPON); AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_FLAGS",PISTOL_WEAPON); - AddGameVar(aszBuf, WEAPON_FLAG_AUTOMATIC | WEAPON_FLAG_RELOAD_TIMING, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, WEAPON_FLAG_RELOAD_TIMING, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_SHOOTS",PISTOL_WEAPON); AddGameVar(aszBuf, SHOTSPARK1, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",PISTOL_WEAPON); @@ -5071,14 +5071,13 @@ void AddSystemVars() Bsprintf(aszBuf,"WEAPON%d_RELOAD",CHAINGUN_WEAPON); AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",CHAINGUN_WEAPON); - AddGameVar(aszBuf, 4, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, 3, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",CHAINGUN_WEAPON); - AddGameVar(aszBuf, 10, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, 12, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",CHAINGUN_WEAPON); AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_FLAGS",CHAINGUN_WEAPON); - AddGameVar(aszBuf, WEAPON_FLAG_AUTOMATIC | WEAPON_FLAG_FIREEVERYTHIRD | WEAPON_FLAG_AMMOPERSHOT \ - | WEAPON_FLAG_SPAWNTYPE3, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, WEAPON_FLAG_AUTOMATIC | WEAPON_FLAG_FIREEVERYTHIRD | WEAPON_FLAG_AMMOPERSHOT | WEAPON_FLAG_SPAWNTYPE3 | WEAPON_FLAG_RESET, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_SHOOTS",CHAINGUN_WEAPON); AddGameVar(aszBuf, CHAINGUN, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",CHAINGUN_WEAPON); @@ -5218,7 +5217,7 @@ void AddSystemVars() Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",DEVISTATOR_WEAPON); AddGameVar(aszBuf, 3, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",DEVISTATOR_WEAPON); - AddGameVar(aszBuf, 5, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, 6, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",DEVISTATOR_WEAPON); AddGameVar(aszBuf, 5, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_FLAGS",DEVISTATOR_WEAPON); @@ -5290,11 +5289,11 @@ void AddSystemVars() Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",FREEZE_WEAPON); AddGameVar(aszBuf, 3, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",FREEZE_WEAPON); - AddGameVar(aszBuf, 8, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, 5, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",FREEZE_WEAPON); AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_FLAGS",FREEZE_WEAPON); - AddGameVar(aszBuf, WEAPON_FLAG_FIREEVERYTHIRD | WEAPON_FLAG_AUTOMATIC, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); + AddGameVar(aszBuf, WEAPON_FLAG_RESET, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_SHOOTS",FREEZE_WEAPON); AddGameVar(aszBuf, FREEZEBLAST, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM); Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",FREEZE_WEAPON); diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 78a72778c..328117f8e 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2394,7 +2394,7 @@ void displayweapon(short snum) myospalw(i+weapon_xoffset-4+184-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, CHAINGUN+5+((*kb-4)/5),gs,o,pal); } - if(*kb < *aplWeaponTotalTime[CHAINGUN_WEAPON]-2) + if(*kb < *aplWeaponTotalTime[CHAINGUN_WEAPON]-4) { i = rand()&7; myospalw(i+weapon_xoffset-4+162-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, @@ -4955,16 +4955,19 @@ SHOOTINCODE: } else *kb = 0; } - else *kb=0; + else if( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET) + { + if( sb_snum&(1<<2) ) *kb = 1; + else *kb = 0; + } + else *kb = 0; } } - else if ( *kb > aplWeaponFireDelay[p->curr_weapon][snum] && (*kb) < aplWeaponTotalTime[p->curr_weapon][snum] + else if ( *kb >= aplWeaponFireDelay[p->curr_weapon][snum] && (*kb) < aplWeaponTotalTime[p->curr_weapon][snum] && (aplWeaponWorksLike[p->curr_weapon][snum] & KNEE_WEAPON ? 1 : p->ammo_amount[p->curr_weapon] > 0)) { if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AUTOMATIC) { - if( ( sb_snum&(1<<2) ) == 0 ) - *kb = aplWeaponTotalTime[p->curr_weapon][snum]; if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYTHIRD) { if( ((*(kb))%3) == 0 ) @@ -4973,17 +4976,30 @@ SHOOTINCODE: DoSpawn(p); } } - if( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) + else if( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) { DoFire(p); DoSpawn(p); } + else + { + if(*kb == aplWeaponFireDelay[p->curr_weapon][snum]) + { + DoFire(p); + DoSpawn(p); + } + } + if(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && (*kb) > aplWeaponTotalTime[p->curr_weapon][snum]-3) + { + if( sb_snum&(1<<2) ) *kb = 1; + else *kb = 0; + } + } + else + { + if(*kb == aplWeaponFireDelay[p->curr_weapon][snum]) + DoFire(p); } - } - else if(*kb == aplWeaponFireDelay[p->curr_weapon][snum] - && (aplWeaponWorksLike[p->curr_weapon][snum]==KNEE_WEAPON ? 1 : p->ammo_amount[p->curr_weapon] > 0)) - { - DoFire(p); } } } @@ -5214,7 +5230,7 @@ void computergetinput(long snum, input *syn) } syn->avel = min(max((((daang+1024-damyang)&2047)-1024)>>1,-127),127); - syn->horz = min(max((zang-p->horiz)>>1,-MAXHORIZ),MAXHORIZ); + syn->horz = min(max((zang-p->horiz),-MAXHORIZ),MAXHORIZ); syn->bits |= (1<<23); return; } diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index edea12953..2d8f41b0f 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1063,16 +1063,11 @@ void newgame(char vn,char ln,char sk) p->curr_weapon = i; p->gotweapon[i] = 1; p->ammo_amount[i] = 48; - } else if(aplWeaponWorksLike[i][0]==KNEE_WEAPON) - { p->gotweapon[i] = 1; - } else if(aplWeaponWorksLike[i][0]==HANDREMOTE_WEAPON) - { p->gotweapon[i] = 1; - } } p->last_weapon = -1; }