|
|
1.1 ! root 1: --- h:\quake2\code-3.14\game\p_weapon.c Thu Feb 26 12:38:57 1998 ! 2: +++ p_weapon.c Wed Apr 01 14:43:35 1998 ! 3: @@ -150,10 +150,38 @@ ! 4: ! 5: The old weapon has been dropped all the way, so make the new one ! 6: current ! 7: =============== ! 8: */ ! 9: + ! 10: +// ### Hentai ### BEGIN ! 11: +void ShowGun(edict_t *ent) ! 12: +{ ! 13: + char heldmodel[128]; ! 14: + int len; ! 15: + ! 16: + if(ent->s.modelindex != 255 || ent->deadflag || !ent->client->pers.weapon) ! 17: + { ! 18: + ent->s.modelindex2 = 0; ! 19: + return; ! 20: + } ! 21: + ! 22: + strcpy(heldmodel, "players/"); ! 23: + strcat(heldmodel, Info_ValueForKey (ent->client->pers.userinfo, "skin")); ! 24: + for(len = 8; heldmodel[len]; len++) ! 25: + { ! 26: + if(heldmodel[len] == '/') ! 27: + heldmodel[++len] = '\0'; ! 28: + } ! 29: + strcat(heldmodel, ent->client->pers.weapon->icon); ! 30: + strcat(heldmodel, ".md2"); ! 31: + //gi.dprintf ("%s\n", heldmodel); ! 32: + ent->s.modelindex2 = gi.modelindex(heldmodel); // Hentai's custom gun models ! 33: + ! 34: +} ! 35: +// ### Hentai ### END ! 36: + ! 37: void ChangeWeapon (edict_t *ent) ! 38: { ! 39: if (ent->client->grenade_time) ! 40: { ! 41: ent->client->grenade_time = level.time; ! 42: @@ -179,10 +207,28 @@ ! 43: } ! 44: ! 45: ent->client->weaponstate = WEAPON_ACTIVATING; ! 46: ent->client->ps.gunframe = 0; ! 47: ent->client->ps.gunindex = gi.modelindex(ent->client->pers.weapon->view_model); ! 48: + ! 49: + // ### Hentai ### BEGIN ! 50: + ent->client->anim_priority = ANIM_PAIN; ! 51: + if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 52: + { ! 53: + ent->s.frame = FRAME_crpain1; ! 54: + ent->client->anim_end = FRAME_crpain4; ! 55: + } ! 56: + else ! 57: + { ! 58: + ent->s.frame = FRAME_pain301; ! 59: + ent->client->anim_end = FRAME_pain304; ! 60: + ! 61: + } ! 62: + ! 63: + ShowGun(ent); ! 64: + ! 65: + // ### Hentai ### END ! 66: } ! 67: ! 68: /* ! 69: ================= ! 70: NoAmmoWeaponChange ! 71: @@ -336,18 +382,43 @@ ! 72: ! 73: void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int FRAME_IDLE_LAST, int FRAME_DEACTIVATE_LAST, int *pause_frames, int *fire_frames, void (*fire)(edict_t *ent)) ! 74: { ! 75: int n; ! 76: ! 77: + // ### Hentai ### BEGIN ! 78: + if(ent->deadflag || ent->s.modelindex != 255) // VWep animations screw up corpses ! 79: + { ! 80: + return; ! 81: + } ! 82: + // ### Hentai ### END ! 83: if (ent->client->weaponstate == WEAPON_DROPPING) ! 84: { ! 85: if (ent->client->ps.gunframe == FRAME_DEACTIVATE_LAST) ! 86: { ! 87: ChangeWeapon (ent); ! 88: return; ! 89: } ! 90: ! 91: + // ### Hentai ### BEGIN ! 92: + else if((FRAME_DEACTIVATE_LAST - ent->client->ps.gunframe) == 4) ! 93: + { ! 94: + ent->client->anim_priority = ANIM_REVERSE; ! 95: + if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 96: + { ! 97: + ent->s.frame = FRAME_crpain4+1; ! 98: + ent->client->anim_end = FRAME_crpain1; ! 99: + } ! 100: + else ! 101: + { ! 102: + ent->s.frame = FRAME_pain304+1; ! 103: + ent->client->anim_end = FRAME_pain301; ! 104: + ! 105: + } ! 106: + } ! 107: + // ### Hentai ### END ! 108: + ! 109: + ! 110: ent->client->ps.gunframe++; ! 111: return; ! 112: } ! 113: ! 114: if (ent->client->weaponstate == WEAPON_ACTIVATING) ! 115: @@ -365,10 +436,27 @@ ! 116: ! 117: if ((ent->client->newweapon) && (ent->client->weaponstate != WEAPON_FIRING)) ! 118: { ! 119: ent->client->weaponstate = WEAPON_DROPPING; ! 120: ent->client->ps.gunframe = FRAME_DEACTIVATE_FIRST; ! 121: + // ### Hentai ### BEGIN ! 122: + if((FRAME_DEACTIVATE_LAST - FRAME_DEACTIVATE_FIRST) < 4) ! 123: + { ! 124: + ent->client->anim_priority = ANIM_REVERSE; ! 125: + if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 126: + { ! 127: + ent->s.frame = FRAME_crpain4+1; ! 128: + ent->client->anim_end = FRAME_crpain1; ! 129: + } ! 130: + else ! 131: + { ! 132: + ent->s.frame = FRAME_pain304+1; ! 133: + ent->client->anim_end = FRAME_pain301; ! 134: + ! 135: + } ! 136: + } ! 137: + // ### Hentai ### END ! 138: return; ! 139: } ! 140: ! 141: if (ent->client->weaponstate == WEAPON_READY) ! 142: { ! 143: @@ -484,10 +572,31 @@ ! 144: ! 145: timer = ent->client->grenade_time - level.time; ! 146: speed = GRENADE_MINSPEED + (GRENADE_TIMER - timer) * ((GRENADE_MAXSPEED - GRENADE_MINSPEED) / GRENADE_TIMER); ! 147: fire_grenade2 (ent, start, forward, damage, speed, timer, radius, held); ! 148: ! 149: + // ### Hentai ### BEGIN ! 150: + if(ent->deadflag || ent->s.modelindex != 255) // VWep animations screw up corpses ! 151: + { ! 152: + return; ! 153: + } ! 154: + ! 155: + if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 156: + { ! 157: + ent->client->anim_priority = ANIM_ATTACK; ! 158: + ent->s.frame = FRAME_crattak1-1; ! 159: + ent->client->anim_end = FRAME_crattak3; ! 160: + } ! 161: + else ! 162: + { ! 163: + ent->client->anim_priority = ANIM_REVERSE; ! 164: + ent->s.frame = FRAME_wave08; ! 165: + ent->client->anim_end = FRAME_wave01; ! 166: + } ! 167: + // ### Hentai ### END ! 168: + ! 169: + ! 170: if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) ) ! 171: ent->client->pers.inventory[ent->client->ammo_index]--; ! 172: ! 173: ent->client->grenade_time = level.time + 1.0; ! 174: } ! 175: @@ -803,10 +912,28 @@ ! 176: if (deathmatch->value) ! 177: damage = 15; ! 178: else ! 179: damage = 20; ! 180: Blaster_Fire (ent, offset, damage, true, effect); ! 181: + ! 182: + // ### Hentai ### BEGIN ! 183: + ! 184: + ent->client->anim_priority = ANIM_ATTACK; ! 185: + if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 186: + { ! 187: + ent->s.frame = FRAME_crattak1 - 1; ! 188: + ent->client->anim_end = FRAME_crattak9; ! 189: + } ! 190: + else ! 191: + { ! 192: + ent->s.frame = FRAME_attack1 - 1; ! 193: + ent->client->anim_end = FRAME_attack8; ! 194: + } ! 195: + ! 196: + // ### Hentai ### END ! 197: + ! 198: + ! 199: if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) ) ! 200: ent->client->pers.inventory[ent->client->ammo_index]--; ! 201: } ! 202: ! 203: ent->client->ps.gunframe++; ! 204: @@ -906,10 +1033,27 @@ ! 205: gi.WriteByte (MZ_MACHINEGUN | is_silenced); ! 206: gi.multicast (ent->s.origin, MULTICAST_PVS); ! 207: ! 208: PlayerNoise(ent, start, PNOISE_WEAPON); ! 209: ! 210: + // ### Hentai ### BEGIN ! 211: + ! 212: + ent->client->anim_priority = ANIM_ATTACK; ! 213: + if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 214: + { ! 215: + ent->s.frame = FRAME_crattak1 - (int) (random()+0.25); ! 216: + ent->client->anim_end = FRAME_crattak9; ! 217: + } ! 218: + else ! 219: + { ! 220: + ent->s.frame = FRAME_attack1 - (int) (random()+0.25); ! 221: + ent->client->anim_end = FRAME_attack8; ! 222: + } ! 223: + ! 224: + // ### Hentai ### END ! 225: + ! 226: + ! 227: if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) ) ! 228: ent->client->pers.inventory[ent->client->ammo_index]--; ! 229: } ! 230: ! 231: void Weapon_Machinegun (edict_t *ent) ! 232: @@ -963,10 +1107,28 @@ ! 233: else ! 234: { ! 235: ent->client->weapon_sound = gi.soundindex("weapons/chngnl1a.wav"); ! 236: } ! 237: ! 238: + // ### Hentai ### BEGIN ! 239: + ! 240: + ent->client->anim_priority = ANIM_ATTACK; ! 241: + if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) ! 242: + { ! 243: + ent->s.frame = FRAME_crattak1 - (ent->client->ps.gunframe & 1); ! 244: + ent->client->anim_end = FRAME_crattak9; ! 245: + } ! 246: + else ! 247: + { ! 248: + ent->s.frame = FRAME_attack1 - (ent->client->ps.gunframe & 1); ! 249: + ent->client->anim_end = FRAME_attack8; ! 250: + } ! 251: + ! 252: + ! 253: + // ### Hentai ### END ! 254: + ! 255: + ! 256: if (ent->client->ps.gunframe <= 9) ! 257: shots = 1; ! 258: else if (ent->client->ps.gunframe <= 14) ! 259: { ! 260: if (ent->client->buttons & BUTTON_ATTACK) ! 261: @@ -1021,10 +1183,11 @@ ! 262: gi.WriteByte ((MZ_CHAINGUN1 + shots - 1) | is_silenced); ! 263: gi.multicast (ent->s.origin, MULTICAST_PVS); ! 264: ! 265: PlayerNoise(ent, start, PNOISE_WEAPON); ! 266: ! 267: + ! 268: if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) ) ! 269: ent->client->pers.inventory[ent->client->ammo_index] -= shots; ! 270: } ! 271: ! 272:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.