diff --git a/doomclassic/doom/d_deh.cpp b/doomclassic/doom/d_deh.cpp index d9257319..58a6afe9 100644 --- a/doomclassic/doom/d_deh.cpp +++ b/doomclassic/doom/d_deh.cpp @@ -401,7 +401,13 @@ dehbits mobfl[] = { {"E4M6BOSS", MF2_E4M6BOSS}, {"E4M8BOSS", MF2_E4M8BOSS}, {"RIP", MF2_RIP}, -{"FULLVOLSOUNDS", MF2_FULLVOLSOUNDS} +{"FULLVOLSOUNDS", MF2_FULLVOLSOUNDS}, +{"NOTHRUST", WPF_NOTHRUST}, +{"SILENT", WPF_SILENT}, +{"NOAUTOFIRE", WPF_NOAUTOFIRE}, +{"FLEEMELEE", WPF_FLEEMELEE}, +{"AUTOSWITCHFROM", WPF_AUTOSWITCHFROM}, +{"NOAUTOSWITCHTO", WPF_NOAUTOSWITCHTO} }; int checkstate(char* text) { @@ -431,7 +437,7 @@ int checkstate(char* text) { void setThing(int pos, char* varname, int varval) { //GK: This works (suprisingly) - dehobj tvars[28] = { + dehobj tvars[29] = { {"Initial frame ",MAXINT,NULL,&mobjinfo[pos].spawnstate}, {"Hit points ",MAXINT,NULL,&mobjinfo[pos].spawnhealth}, {"First moving frame ",MAXINT,NULL,&mobjinfo[pos].seestate}, @@ -460,8 +466,9 @@ void setThing(int pos, char* varname, int varval) { {"Splash group", MAXINT, NULL, &mobjinfo[pos].splashGroup}, {"MBF21 Bits ",MAXINT,NULL, NULL, NULL, NULL, NULL, NULL, NULL, &mobjinfo[pos].flags2}, {"Fast speed ",MAXINT,NULL, &mobjinfo[pos].altSpeed}, + {"Melee range ", MAXINT, NULL, &mobjinfo[pos].meleeRange} }; - for (int i = 0; i < 28; i++) { + for (int i = 0; i < 29; i++) { if (!idStr::Icmp(varname, tvars[i].name)) { if (varval < tvars[i].limit) { if (tvars[i].llval != NULL) { @@ -538,15 +545,16 @@ void setFrame(int pos, char* varname, int varval) { } void setWeapon(int pos, char* varname, int varval) { - dehobj wvars[6] = { + dehobj wvars[7] = { {"Select frame ",MAXINT,NULL,&weaponinfo[pos].downstate}, {"Deselect frame ",MAXINT,NULL,&weaponinfo[pos].upstate}, {"Bobbing frame ",MAXINT,NULL,&weaponinfo[pos].readystate}, {"Shooting frame ",MAXINT,NULL,&weaponinfo[pos].atkstate}, {"Firing frame ",MAXINT,NULL,&weaponinfo[pos].flashstate}, - {"Ammo type ",NUMAMMO,NULL,NULL,NULL,NULL,NULL,NULL,&weaponinfo[pos].ammo} + {"Ammo type ",NUMAMMO,NULL,NULL,NULL,NULL,NULL,NULL,&weaponinfo[pos].ammo}, + {"MBF21 Bits ", MAXINT, NULL, &weaponinfo[pos].flags} }; - for (int i = 0; i < 6; i++) { + for (int i = 0; i < 7; i++) { if (!idStr::Icmp(varname, wvars[i].name)) { if (varval < wvars[i].limit) { switch (i) { @@ -911,7 +919,7 @@ void parsetext(char* text) { if (!tv3.empty()) { if (state != 6 && state != 9) { varval = atoi(tv3.c_str()); - if (state == 1 && (!idStr::Icmp(varname, "Bits ") || !idStr::Icmp(varname, "MBF21 Bits ")) && varval == 0) { + if ((state == 1 || state == 4)&& (!idStr::Icmp(varname, "Bits ") || !idStr::Icmp(varname, "MBF21 Bits ")) && varval == 0) { varval = Generateflags(strdup(tv3.c_str())); } } diff --git a/doomclassic/doom/d_items.cpp b/doomclassic/doom/d_items.cpp index 28b5f7f0..37a4f698 100644 --- a/doomclassic/doom/d_items.cpp +++ b/doomclassic/doom/d_items.cpp @@ -62,7 +62,8 @@ void initWeapons() { S_PUNCHDOWN, S_PUNCH, S_PUNCH1, - S_NULL + S_NULL, + WPF_FLEEMELEE | WPF_AUTOSWITCHFROM | WPF_NOAUTOSWITCHTO }, { // pistol @@ -71,7 +72,8 @@ void initWeapons() { S_PISTOLDOWN, S_PISTOL, S_PISTOL1, - S_PISTOLFLASH + S_PISTOLFLASH, + WPF_AUTOSWITCHFROM }, { // shotgun @@ -98,7 +100,8 @@ void initWeapons() { S_MISSILEDOWN, S_MISSILE, S_MISSILE1, - S_MISSILEFLASH1 + S_MISSILEFLASH1, + WPF_NOAUTOFIRE }, { // plasma rifle @@ -116,7 +119,8 @@ void initWeapons() { S_BFGDOWN, S_BFG, S_BFG1, - S_BFGFLASH1 + S_BFGFLASH1, + WPF_NOAUTOFIRE }, { // chainsaw @@ -125,7 +129,8 @@ void initWeapons() { S_SAWDOWN, S_SAW, S_SAW1, - S_NULL + S_NULL, + WPF_FLEEMELEE | WPF_NOTHRUST | WPF_NOAUTOSWITCHTO }, { // super shotgun diff --git a/doomclassic/doom/d_items.h b/doomclassic/doom/d_items.h index c83089b3..e7b17650 100644 --- a/doomclassic/doom/d_items.h +++ b/doomclassic/doom/d_items.h @@ -45,8 +45,19 @@ typedef struct int readystate; int atkstate; int flashstate; - + int flags; } weaponinfo_t; + +typedef enum +{ + WPF_NOTHRUST = 0x001, + WPF_SILENT = 0x002, + WPF_NOAUTOFIRE = 0x004, + WPF_FLEEMELEE = 0x008, + WPF_AUTOSWITCHFROM = 0x010, + WPF_NOAUTOSWITCHTO = 0x020 +} weaponflags_t; + //GK: No more constant variable extern /*const*/ weaponinfo_t weaponinfo[NUMWEAPONS]; void initWeapons(); diff --git a/doomclassic/doom/info.cpp b/doomclassic/doom/info.cpp index 148a11cb..e2d458f1 100644 --- a/doomclassic/doom/info.cpp +++ b/doomclassic/doom/info.cpp @@ -1180,7 +1180,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_POSSESSED @@ -1211,7 +1212,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SHOTGUY @@ -1242,7 +1244,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_VILE @@ -1273,7 +1276,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_SHORTMRANGE | MF2_DMGIGNORED | MF2_NOTHRESHOLD, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_FIRE @@ -1304,7 +1308,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_UNDEAD @@ -1335,7 +1340,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_RANGEHALF | MF2_LONGMELEE, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_TRACER @@ -1366,7 +1372,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SMOKE @@ -1397,7 +1404,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_FATSO @@ -1428,7 +1436,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_MAP07BOSS1, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_FATSHOT @@ -1459,7 +1468,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_CHAINGUY @@ -1490,7 +1500,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_TROOP @@ -1521,7 +1532,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SERGEANT @@ -1552,7 +1564,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SHADOWS @@ -1583,7 +1596,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_HEAD @@ -1614,7 +1628,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BRUISER @@ -1645,7 +1660,8 @@ extern "C" 1, //projectileGroup 0, //splashGroup MF2_E1M8BOSS, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BRUISERSHOT @@ -1676,7 +1692,8 @@ extern "C" 1, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_KNIGHT @@ -1707,7 +1724,8 @@ extern "C" 1, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SKULL @@ -1738,7 +1756,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_RANGEHALF, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SPIDER @@ -1769,7 +1788,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_NORADIUSDMG | MF2_RANGEHALF | MF2_E3M8BOSS | MF2_E4M8BOSS | MF2_FULLVOLSOUNDS, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BABY @@ -1800,7 +1820,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_MAP07BOSS2, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_CYBORG @@ -1831,7 +1852,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_NORADIUSDMG | MF2_HIGHERMPROB | MF2_RANGEHALF | MF2_E2M8BOSS | MF2_E4M6BOSS | MF2_FULLVOLSOUNDS, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_PAIN @@ -1862,7 +1884,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_WOLFSS @@ -1893,7 +1916,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_KEEN @@ -1924,7 +1948,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BOSSBRAIN @@ -1955,7 +1980,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BOSSSPIT @@ -1986,7 +2012,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BOSSTARGET @@ -2017,7 +2044,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SPAWNSHOT @@ -2048,7 +2076,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SPAWNFIRE @@ -2079,7 +2108,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BARREL @@ -2110,7 +2140,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup MF2_NEUTRAL_SPLASH, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_TROOPSHOT @@ -2141,7 +2172,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_HEADSHOT @@ -2172,7 +2204,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_ROCKET @@ -2203,7 +2236,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_PLASMA @@ -2234,7 +2268,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BFG @@ -2265,7 +2300,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_ARACHPLAZ @@ -2296,7 +2332,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_PUFF @@ -2327,7 +2364,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_BLOOD @@ -2358,7 +2396,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_TFOG @@ -2389,7 +2428,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_IFOG @@ -2420,7 +2460,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_TELEPORTMAN @@ -2451,7 +2492,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_EXTRABFG @@ -2482,7 +2524,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC0 @@ -2513,7 +2556,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC1 @@ -2544,7 +2588,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC2 @@ -2575,7 +2620,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC3 @@ -2606,7 +2652,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC4 @@ -2637,7 +2684,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC5 @@ -2668,7 +2716,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC6 @@ -2699,7 +2748,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC7 @@ -2730,7 +2780,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC8 @@ -2761,7 +2812,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC9 @@ -2792,7 +2844,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC10 @@ -2823,7 +2876,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC11 @@ -2854,7 +2908,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC12 @@ -2885,7 +2940,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_INV @@ -2916,7 +2972,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC13 @@ -2947,7 +3004,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_INS @@ -2978,7 +3036,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC14 @@ -3009,7 +3068,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC15 @@ -3040,7 +3100,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC16 @@ -3071,7 +3132,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MEGA @@ -3102,7 +3164,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_CLIP @@ -3133,7 +3196,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC17 @@ -3164,7 +3228,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC18 @@ -3195,7 +3260,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC19 @@ -3226,7 +3292,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC20 @@ -3257,7 +3324,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC21 @@ -3288,7 +3356,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC22 @@ -3319,7 +3388,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC23 @@ -3350,7 +3420,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC24 @@ -3381,7 +3452,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC25 @@ -3412,7 +3484,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_CHAINGUN @@ -3443,7 +3516,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC26 @@ -3474,7 +3548,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC27 @@ -3505,7 +3580,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC28 @@ -3536,7 +3612,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SHOTGUN @@ -3567,7 +3644,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_SUPERSHOTGUN @@ -3598,7 +3676,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC29 @@ -3629,7 +3708,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC30 @@ -3660,7 +3740,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC31 @@ -3691,7 +3772,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC32 @@ -3722,7 +3804,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC33 @@ -3753,7 +3836,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC34 @@ -3784,7 +3868,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC35 @@ -3815,7 +3900,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC36 @@ -3846,7 +3932,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC37 @@ -3877,7 +3964,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC38 @@ -3908,7 +3996,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC39 @@ -3939,7 +4028,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC40 @@ -3970,7 +4060,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC41 @@ -4001,7 +4092,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC42 @@ -4032,7 +4124,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC43 @@ -4063,7 +4156,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC44 @@ -4094,7 +4188,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC45 @@ -4125,7 +4220,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC46 @@ -4156,7 +4252,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC47 @@ -4187,7 +4284,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC48 @@ -4218,7 +4316,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC49 @@ -4249,7 +4348,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC50 @@ -4280,7 +4380,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC51 @@ -4311,7 +4412,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC52 @@ -4342,7 +4444,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC53 @@ -4373,7 +4476,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC54 @@ -4404,7 +4508,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC55 @@ -4435,7 +4540,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC56 @@ -4466,7 +4572,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC57 @@ -4497,7 +4604,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC58 @@ -4528,7 +4636,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC59 @@ -4559,7 +4668,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC60 @@ -4590,7 +4700,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC61 @@ -4621,7 +4732,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC62 @@ -4652,7 +4764,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC63 @@ -4683,7 +4796,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC64 @@ -4714,7 +4828,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC65 @@ -4745,7 +4860,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC66 @@ -4776,7 +4892,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC67 @@ -4807,7 +4924,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC68 @@ -4838,7 +4956,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC69 @@ -4869,7 +4988,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC70 @@ -4900,7 +5020,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC71 @@ -4931,7 +5052,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC72 @@ -4962,7 +5084,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC73 @@ -4993,7 +5116,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC74 @@ -5024,7 +5148,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC75 @@ -5055,7 +5180,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC76 @@ -5086,7 +5212,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC77 @@ -5117,7 +5244,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC78 @@ -5148,7 +5276,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC79 @@ -5179,7 +5308,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC80 @@ -5210,7 +5340,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC81 @@ -5241,7 +5372,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC82 @@ -5272,7 +5404,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC83 @@ -5303,7 +5436,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC84 @@ -5334,7 +5468,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC85 @@ -5365,7 +5500,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, { // MT_MISC86 @@ -5396,7 +5532,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange } , @@ -5429,7 +5566,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange }, // For use with wind and current effects @@ -5461,7 +5599,8 @@ extern "C" 0, //projectileGroup 0, //splashGroup 0, //flags2 - -1 //altspeed + -1, //altspeed + MELEERANGE //meleeRange } }; //std::vector tempStates(arrStates, arrStates + NUMSTATES); diff --git a/doomclassic/doom/info.h b/doomclassic/doom/info.h index 76091f9a..16ef6c3c 100644 --- a/doomclassic/doom/info.h +++ b/doomclassic/doom/info.h @@ -1386,7 +1386,7 @@ typedef struct int splashGroup; uint64 flags2; int altSpeed; - + int meleeRange; } mobjinfo_t; extern /*const*/ std::vector mobjinfo; diff --git a/doomclassic/doom/p_enemy.cpp b/doomclassic/doom/p_enemy.cpp index 75e426b8..52ca3fa0 100644 --- a/doomclassic/doom/p_enemy.cpp +++ b/doomclassic/doom/p_enemy.cpp @@ -167,7 +167,7 @@ qboolean P_CheckMeleeRange (mobj_t* actor) pl = actor->target; dist = P_AproxDistance (pl->x-actor->x, pl->y-actor->y); - if (dist >= MELEERANGE-20*FRACUNIT+pl->info->radius) + if (dist >= actor->info->meleeRange-20*FRACUNIT+pl->info->radius) return false; if (! P_CheckSight (actor, actor->target) ) @@ -523,7 +523,7 @@ P_LookForPlayers dist = P_AproxDistance (player->mo->x - actor->x, player->mo->y - actor->y); // if real close, react anyway - if (dist > MELEERANGE) + if (dist > actor->target->info->meleeRange) continue; // behind back } } diff --git a/doomclassic/doom/p_inter.cpp b/doomclassic/doom/p_inter.cpp index 2d125127..8b60d0bc 100644 --- a/doomclassic/doom/p_inter.cpp +++ b/doomclassic/doom/p_inter.cpp @@ -137,7 +137,7 @@ P_GiveAmmo switch (ammo) { case am_clip: - if (player->readyweapon == wp_fist) + if (weaponinfo[player->readyweapon].flags & WPF_AUTOSWITCHFROM) { if (player->weaponowned[wp_chaingun]) player->pendingweapon = wp_chaingun; @@ -147,8 +147,7 @@ P_GiveAmmo break; case am_shell: - if (player->readyweapon == wp_fist - || player->readyweapon == wp_pistol) + if (weaponinfo[player->readyweapon].flags & WPF_AUTOSWITCHFROM) { if (player->weaponowned[wp_shotgun]) player->pendingweapon = wp_shotgun; @@ -156,8 +155,7 @@ P_GiveAmmo break; case am_cell: - if (player->readyweapon == wp_fist - || player->readyweapon == wp_pistol) + if (weaponinfo[player->readyweapon].flags & WPF_AUTOSWITCHFROM) { if (player->weaponowned[wp_plasma]) player->pendingweapon = wp_plasma; @@ -165,7 +163,7 @@ P_GiveAmmo break; case am_misl: - if (player->readyweapon == wp_fist) + if (weaponinfo[player->readyweapon].flags & WPF_AUTOSWITCHFROM) { if (player->weaponowned[wp_missile]) player->pendingweapon = wp_missile; @@ -1003,7 +1001,7 @@ P_DamageMobj && !(target->flags & MF_NOCLIP) && (!source || !source->player - || source->player->readyweapon != wp_chainsaw)) + || !(weaponinfo[source->player->readyweapon].flags & WPF_NOTHRUST))) { ang = R_PointToAngle2 ( inflictor->x, inflictor->y, diff --git a/doomclassic/doom/p_pspr.cpp b/doomclassic/doom/p_pspr.cpp index 3c89bc22..6051c1a7 100644 --- a/doomclassic/doom/p_pspr.cpp +++ b/doomclassic/doom/p_pspr.cpp @@ -370,8 +370,7 @@ A_WeaponReady if (player->cmd.buttons & BT_ATTACK) { if ( !player->attackdown - || (player->readyweapon != wp_missile - && player->readyweapon != wp_bfg) ) + || !(weaponinfo[player->readyweapon].flags & WPF_NOAUTOFIRE) ) { player->attackdown = true; P_FireWeapon (player); @@ -547,14 +546,14 @@ A_Punch angle = player->mo->angle; angle += (P_Random()-P_Random())<<18; - slope = P_AimLineAttack (player->mo, angle, MELEERANGE); + slope = P_AimLineAttack (player->mo, angle, player->mo->info->meleeRange); //GK: Move puffs up and down based on player's view if (cl_freelook.GetBool() && !::g->demorecording && ::g->gamestate != GS_DEMOLEVEL) { angle -= 2 << 26; slope = -(((::g->mouseposy) << FRACBITS) / 473); } - P_LineAttack (player->mo, angle, MELEERANGE, slope, damage); + P_LineAttack (player->mo, angle, player->mo->info->meleeRange, slope, damage); // turn to face target if (::g->linetarget) @@ -585,14 +584,14 @@ A_Saw angle += (P_Random()-P_Random())<<18; // use meleerange + 1 se the puff doesn't skip the flash - slope = P_AimLineAttack (player->mo, angle, MELEERANGE+1); + slope = P_AimLineAttack (player->mo, angle, player->mo->info->meleeRange+1); //GK: Move puffs up and down based on player's view if (cl_freelook.GetBool() && !::g->demorecording && ::g->gamestate != GS_DEMOLEVEL) { angle -= 2 << 26; slope = -(((::g->mouseposy) << FRACBITS) / 473); } - P_LineAttack (player->mo, angle, MELEERANGE+1, slope, damage); + P_LineAttack (player->mo, angle, player->mo->info->meleeRange+1, slope, damage); if (!::g->linetarget) {