From 50ed00160b3aaaeb5ba9296236b37c437ce008dd Mon Sep 17 00:00:00 2001 From: arghvark Date: Tue, 23 Aug 2005 16:02:53 +0000 Subject: [PATCH] pickup and armour fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@34 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/autoexec.cfg | 17 +++-- config/menus.cfg | 29 ++++----- packages/maps/temp.cgz | Bin 1801 -> 1855 bytes source/src/clientgame.cpp | 16 +++-- source/src/cube.h | 7 +-- source/src/entities.cpp | 25 ++++---- source/src/physics.cpp | 5 +- source/src/renderextras.cpp | 4 +- source/src/savegamedemo.cpp | 4 +- source/src/weapon.cpp | 121 +++++++++++++++++++++++++++--------- 10 files changed, 152 insertions(+), 76 deletions(-) diff --git a/config/autoexec.cfg b/config/autoexec.cfg index 05a5f30c..197571a2 100755 --- a/config/autoexec.cfg +++ b/config/autoexec.cfg @@ -40,12 +40,10 @@ hudgun 1 maxroll 0 lighterror 1 -bind m show_acm - -alias sp [ mode -2; map $arg1 ] -alias dmsp [ mode -1; map $arg1 ] -alias ffa [ mode 0; map $arg1 ] -alias insta [ mode 4; map $arg1 ] +//alias sp [ mode -2; map $arg1 ] +//alias dmsp [ mode -1; map $arg1 ] +//alias ffa [ mode 0; map $arg1 ] +//alias insta [ mode 4; map $arg1 ] // below is a fun new way of editing, with all using the mousewheel @@ -67,8 +65,9 @@ alias universaldelta [ bind MOUSE4 [ universaldelta 1 ] bind MOUSE5 [ universaldelta -1 ] -bind 1 previous -bind 2 next +bind 1 primary +bind 2 secondary +bind 3 melee bind R reload bind MOUSE2 altattack @@ -92,5 +91,5 @@ alias delta_game_1 [ // change hudgun 1 -bind p [ connect 67.163.146.134 ] +bind p [ connect 67.163.146.120 ] showmenu maps diff --git a/config/menus.cfg b/config/menus.cfg index ea6b7114..2d16b105 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -1,15 +1,15 @@ // standard menu definitions -alias menu_music ac.ogg - -alias mainmenu [ - musicvol 128 - music $menu_music - showmenu main -] +alias menu_music ac.ogg + +alias mainmenu [ + musicvol 128 + music $menu_music + showmenu main +] bind ESCAPE mainmenu // it all starts here - + newmenu main menuitem "Join Game" "servermenu" @@ -46,8 +46,8 @@ genmapitems "ac_complex ac_mines ac_office" newmenu team -menuitem "Special Forces" -menuitem "Freedom Fighters" +menuitem "CT" +menuitem "T" newmenu gamemode @@ -56,7 +56,8 @@ menuitem "Team Deathmatch" "mode 1; showmenu maps" menuitem "Team Survivor" "mode 1; showmenu maps" menuitem "Capture the Flag" "mode 2; showmenu maps" menuitem "Deathmatch" "mode 0; showmenu maps" -menuitem "Deathmatch Arena (LMS)" "mode 0; showmenu maps" +menuitem "Deathmatch Arena" "mode 0; showmenu maps" +menuitem "Pistols" "mode 5; showmenu maps" newmenu spawnmode @@ -236,13 +237,13 @@ menuitem "Equipment" "showmenu equipment" newmenu "primary" -menuitem "Mtp 57 Assault Rifle" "echo MK-77 Assault Rifle chosen" +menuitem "Mtp 57 Assault Rifle" "echo MTP-57 Assault Rifle chosen" menuitem "A-ARD/10 Submachine Gun" "echo A-ARD/10 Submachine Gun chosen" -menuitem "Precision Tech AD-81 Sniper Rifle" "echo Precision Tech AD-81 Sniper Rifle chosen" +menuitem "Precision Tech AD-81 Sniper Rifle" "echo Precision Tech AD-81 Sniper Rifle chosen" menuitem "V-19 Combat Shotgun" "echo V-19 Combat Shotgun chosen" newmenu "secondary" -menuitem "Mk-77 Semi-Automatic Pistol" "echo MTP 57 Semi-Automatic Pistol Chosen" +menuitem "Mk-77 Semi-Automatic Pistol" "echo MK 77 Semi-Automatic Pistol Chosen" newmenu "equipment" menuitem "DR-17 HE-Grenade" "echo DR-17 HE-Grenade chosen" diff --git a/packages/maps/temp.cgz b/packages/maps/temp.cgz index 7ac9ef915b660c0c9789ff928e2e85063535581b..62372f08b1711f12a9739a386b3340acd0e96427 100644 GIT binary patch delta 1844 zcmV-42g~@04!;hNAb*Tfpg?IL6n9c6X&8mJKm!E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gf7?L}vD9pVIa>k_U zh~!F#;P_&~xE+>ptzcav2F!97m7}>WKDibYa$DAOEy(Avh2oaC&=w>H%*ngP62nv# zBn}i%kFyt&u01?*47BJUi zF6t=Grb)}PCIcq2JBpK&#ii{+!MO{=#vpfqT&_3i*m82Ydd_lfD)sa#xd)t5I>9Qg zl_17GT&ZKQp1}qN8yRe3u-SrAvuuI5%sz&3=#x_Co{wNTPdzE%Nq=FU6#lUe=FHhV z73Qrc6+EfTlgfK4a~`E4?8#F{8aUFJBhBW>W~4`wk-oWAtAkpdskOcEDKpgxm#5%3UU9wKYC2jiN>qv`M|Yu9ms71hdZf+%7U2XEM~Sziz0 zyfNu|%9QXIir~(9>~?s6^sw3qrd(I8u4u}2bLonvT(1JMVrmTcl1mU%-V@70>MKIk zFI51+Tx1%2Z&0E?G+wwZvN{qd! fgPL{?<@dN=*-V{oBVEgqz)$@jvS}28&N%=8timeinair = 0; d->health = 100; d->armour = 0; - d->armourtype = A_BLUE; - d->quadmillis = 0; + //d->hasarmour = false; + //d->armourtype = A_BLUE; + //d->quadmillis = 0; d->gunselect = GUN_PISTOL; d->gunwait = 0; d->attacking = false; d->lastaction = 0; + radd(d); + + //loopi(NUMGUNS) if(d->nextprimary!=i) d->ammo[i] = 0; //d->mag[GUN_KNIFE] = 1; //equp with default pistol @@ -140,6 +144,7 @@ dynent *newdynent() // create a new blank player or monster d->shots = 0; d->reloading = false; d->nextprimary = 1; + d->hasarmour = false; spawnstate(d); return d; }; @@ -221,12 +226,13 @@ void arenarespawn() void checkquad(int time) { - if(player1->quadmillis && (player1->quadmillis -= time)<0) +/* if(player1->quadmillis && (player1->quadmillis -= time)<0) { player1->quadmillis = 0; playsoundc(S_PUPOUT); conoutf("quad damage is over"); }; +*/ }; //generic function to check all kinds of crazy gamemode specific things @@ -269,7 +275,7 @@ void checkgame(int time) //reset zoom if dead //etc - checkquad(time); + //checkquad(time); if (player1->state==CS_DEAD) { @@ -437,7 +443,7 @@ void selfdamage(int damage, int actor, dynent *act) if(player1->state!=CS_ALIVE || editmode || intermission) return; damageblend(damage); demoblend(damage); - int ad = damage*(player1->armourtype+1)*20/100; // let armour absorb when possible + int ad = damage*30/100;//int ad = damage*(player1->armourtype+1)*20/100; // let armour absorb when possible if(ad>player1->armour) ad = player1->armour; player1->armour -= ad; damage -= ad; diff --git a/source/src/cube.h b/source/src/cube.h index a21120c0..1bdfe6cc 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -40,7 +40,6 @@ enum // static entity types NOTUSED = 0, // entity slot not in use in map LIGHT, // lightsource, attr1 = radius, attr2 = intensity PLAYERSTART, // attr1 = angle - //I_SHOTGUN, I_SUBGUN, I_SNIPER, I_ASSULT, I_GRENADE, I_PISTOL, I_CLIPS, I_AMMO,I_GRENADE, I_HEALTH, I_ARMOUR, I_QUAD, MAPMODEL, // attr1 = angle, attr2 = idx @@ -109,7 +108,7 @@ struct dynent // players & monsters int lifesequence; // sequence id for each respawn, used in damage test int state; // one of CS_* below int frags; - int health, armour, armourtype, quadmillis; + int health, armour; //armourtype, quadmillis; int gunselect, gunwait; int lastaction, lastattackgun, lastmove; bool attacking; @@ -126,14 +125,14 @@ struct dynent // players & monsters string name, team; int startheight; int shots; //keeps track of shots from auto weapons - bool reloading; + bool reloading, hasarmour; int primary; //primary gun int nextprimary; }; #define SAVEGAMEVERSION 6 // bump if dynent/netprotocol changes or any other savegame/demo data bumped from 5 -enum { A_BLUE, A_GREEN, A_YELLOW }; // armour types... take 20/40/60 % off +//enum { A_BLUE, A_GREEN, A_YELLOW }; // armour types... take 20/40/60 % off enum { M_NONE = 0, M_SEARCH, M_HOME, M_ATTACKING, M_PAIN, M_SLEEP, M_AIMING }; // monster states #define MAXCLIENTS 256 // in a multiplayer game, can be arbitrarily changed diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 32797a7c..14ea0704 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -111,11 +111,11 @@ void realpickup(int n, dynent *d) case I_ARMOUR: radditem(n, d->armour, 8); - d->armourtype = A_YELLOW; + //d->hasarmour = true; break; case I_QUAD: - radditem(n, d->quadmillis, 9); + //radditem(n, d->quadmillis, 9); conoutf("a lesser man would use a single pistol"); break; }; @@ -167,7 +167,7 @@ void pickup(int n, dynent *d) break; case I_QUAD: - additem(n, d->quadmillis, 60, 9); + //additem(n, d->quadmillis, 60, 9); break; case CARROT: @@ -225,22 +225,25 @@ void radd(dynent *d) } else if (d->primary==GUN_GRENADE) { - conoutf("you don't have to worry about blowing your hand off just yet..."); + //conoutf("you don't have to worry about blowing your hand off just yet..."); } - - - if (d->armour) + + if (d->hasarmour) { - d->armour = 100; + if(gamemode==m_arena) + d->armour = 100; } }; -void add(int num) +void item(int num) { + if (num>0 && num<6) player1->nextprimary = num; + if (num==6) conoutf("sorry, no nades yet"); + + if (num==7) { player1->hasarmour=!player1->hasarmour; /*toggle armour*/ }; - if (num>0 && num<8) player1->nextprimary = num; }; -COMMAND(add,ARG_1INT); \ No newline at end of file +COMMAND(item,ARG_1INT); \ No newline at end of file diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 03c6b939..669ddd33 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -251,7 +251,10 @@ void moveplayer(dynent *pl, int moveres, bool local, int curtime) if(pl->jumpnext) { pl->jumpnext = false; - pl->vel.z = 1.7f; // physics impulse upwards + if (pl->armour>0) + pl->vel.z = 1.9f; + else + pl->vel.z = 1.7f; // physics impulse upwards if(water) { pl->vel.x /= 8; pl->vel.y /= 8; }; // dampen velocity change even harder, gives correct water feel if(local) playsoundc(S_JUMP); else if(pl->monsterstate) playsound(S_JUMP, &pl->o); diff --git a/source/src/renderextras.cpp b/source/src/renderextras.cpp index 5e815fe3..9a837547 100644 --- a/source/src/renderextras.cpp +++ b/source/src/renderextras.cpp @@ -369,8 +369,8 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat glPushMatrix(); glOrtho(0, VIRTW, VIRTH, 0, -1, 1); glDisable(GL_BLEND); - drawicon(128, 128, 20, 1650); - if(player1->armour) drawicon((float)(player1->armourtype*64), 0, 620, 1650); + drawicon(64, 0, 20, 1650); //drawicon(128, 128, 20, 1650); + if(player1->armour) drawicon((float)(128), 0, 620, 1650); //if(player1->armour) drawicon((float)(player1->armourtype*64), 0, 620, 1650); int g = player1->gunselect; int r = 64; if(g>2) { g -= 3; r = 128; }; diff --git a/source/src/savegamedemo.cpp b/source/src/savegamedemo.cpp index 7cc79d41..172d4d37 100644 --- a/source/src/savegamedemo.cpp +++ b/source/src/savegamedemo.cpp @@ -166,7 +166,7 @@ void incomingdemodata(uchar *buf, int len, bool extras) gzputi(player1->gunwait); gzputi(player1->health); gzputi(player1->armour); - gzput(player1->armourtype); + //gzput(player1->armourtype); loopi(NUMGUNS) gzput(player1->ammo[i]); gzput(player1->state); gzputi(bdamage); @@ -271,7 +271,7 @@ void demoplaybackstep() target->gunwait = gzgeti(); target->health = gzgeti(); target->armour = gzgeti(); - target->armourtype = gzget(); + //target->armourtype = gzget(); loopi(NUMGUNS) target->ammo[i] = gzget(); target->state = gzget(); target->lastmove = playbacktime; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index f7734012..67e5b4e3 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -11,12 +11,18 @@ vec sg[SGRAYS]; //change the particales guninfo guns[NUMGUNS] = { - { S_KNIFE, S_NULL, 0, 250, 50, 0, 0, 1, 1, 1, "knife" }, - { S_PISTOL, S_RPISTOL, 1400, 170, 20, 0, 0, 20, 10, 8, "pistol" }, // *SGRAYS - { S_SHOTGUN, S_RSHOTGUN, 2400, 1100, 6, 0, 0, 1, 35, 7, "shotgun" }, //reload time is for 1 shell from 7 too powerful to 6 - { S_SUBGUN, S_RSUBGUN, 1650, 90, 14, 0, 0, 45, 15, 30, "subgun" }, - { S_SNIPER, S_RSNIPER, 1950, 1500, 72, 0, 0, 60, 50, 5, "sniper" }, - { S_ASSULT, S_RASSULT, 2000, 130, 33, 0, 0, 90, 40, 20, "assult" }, //recoil was 44 + { S_KNIFE, S_NULL, 0, 250, 50, 0, 0, 1, 1, 1, "knife" }, + + { S_PISTOL, S_RPISTOL, 1400, 170, 20, 0, 0, 20, 10, 8, "pistol" }, // *SGRAYS + + { S_SHOTGUN, S_RSHOTGUN, 2400, 1100, 6, 0, 0, 1, 35, 7, "shotgun" }, //reload time is for 1 shell from 7 too powerful to 6 + + { S_SUBGUN, S_RSUBGUN, 1650, 90, 14, 0, 0, 45, 15, 30, "subgun" }, + + { S_SNIPER, S_RSNIPER, 1950, 1500, 72, 0, 0, 60, 50, 5, "sniper" }, + + { S_ASSULT, S_RASSULT, 2000, 130, 33, 0, 0, 90, 40, 20, "assult" }, //recoil was 44 + { S_GRENADE, S_NULL, 0, 2000, 40, 30, 6, 1, 1, 1, "grenade" }, }; @@ -45,23 +51,40 @@ void wdw() conoutf("%s selected", (int)guns[player1->gunselect].name); }; -void primary() -{ - player1->gunselect=player1->primary; -}; - -void secondary() -{ - player1->gunselect=GUN_PISTOL; -}; - -void melee() -{ - player1->gunselect=GUN_KNIFE; -}; - -COMMAND(primary,ARG_NONE); -COMMAND(secondary,ARG_NONE); +void primary() + +{ + + player1->gunselect=player1->primary; + +}; + + + +void secondary() + +{ + + player1->gunselect=GUN_PISTOL; + +}; + + + +void melee() + +{ + + player1->gunselect=GUN_KNIFE; + +}; + + + +COMMAND(primary,ARG_NONE); + +COMMAND(secondary,ARG_NONE); + COMMAND(melee,ARG_NONE); COMMAND(wup,ARG_NONE); COMMAND(wdw,ARG_NONE); @@ -245,7 +268,8 @@ void moveprojectiles(float time) { projectile *p = &projs[i]; if(!p->inuse) continue; - int qdam = guns[p->gun].damage*(p->owner->quadmillis ? 4 : 1); + //int qdam = guns[p->gun].damage*(p->owner->quadmillis ? 4 : 1); + int qdam = guns[p->gun].damage; vdist(dist, v, p->o, p->to); float dtime = dist*1000/p->speed; if(time>dtime) dtime = time; @@ -320,7 +344,7 @@ void raydamage(dynent *o, vec &from, vec &to, dynent *d, int i) { if(o->state!=CS_ALIVE) return; int qdam = guns[d->gunselect].damage; - if(d->quadmillis) qdam *= 4; + //if(d->quadmillis) qdam *= 4; if(d->gunselect==GUN_SHOTGUN) { int damage = 0; @@ -331,7 +355,48 @@ void raydamage(dynent *o, vec &from, vec &to, dynent *d, int i) }; void spreadandrecoil(vec & from, vec & to, dynent * d) { - //nothing specail for a knife + //nothing specail for a knife + if (d->gunselect==GUN_KNIFE) return; + + //spread + vdist(dist, unitv, from, to); + float f = dist/1000; + int spd = guns[d->gunselect].spread; + + //recoil + int rcl = guns[d->gunselect].recoil*-0.01f; + + if (d->gunselect==GUN_ASSULT) + { + if (d->shots<=3) + spd = spd / 5; + + rcl += (rnd(8)*-0.01f); + }; + + if ((d->gunselect==GUN_SNIPER) && (d->vel.x<.25f && d->vel.y<.25f)) + { + spd = 1; + rcl = rcl / 3; + }; + + if (d->gunselect!=GUN_SHOTGUN) //no spread on shotgun + { + vec r = { RNDD, RNDD, RNDD }; + vadd(to, r); + }; + + + + //increase pitch for recoil + vdiv(unitv, dist); + vec recoil = unitv; + vmul(recoil, rcl); + vadd(d->vel, recoil); + if(d->pitch<80.0f) d->pitch += guns[d->gunselect].recoil*0.05f; + + /* old + //nothing specail for a knife if (d->gunselect==GUN_KNIFE) return; //spread @@ -366,7 +431,7 @@ void spreadandrecoil(vec & from, vec & to, dynent * d) vmul(recoil, rcl); vadd(d->vel, recoil); if(d->pitch<80.0f) d->pitch += guns[d->gunselect].recoil*0.05f; - +*/ }; void shoot(dynent *d, vec &targ) @@ -403,7 +468,7 @@ void shoot(dynent *d, vec &targ) }; if(d->gunselect==GUN_SHOTGUN) createrays(from, to); - if(d->quadmillis && attacktime>200) playsoundc(S_ITEMPUP); + //if(d->quadmillis && attacktime>200) playsoundc(S_ITEMPUP); shootv(d->gunselect, from, to, d, true); addmsg(1, 8, SV_SHOT, d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF)); d->gunwait = guns[d->gunselect].attackdelay;