X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_weapons.pas;h=c6f09a9d08dab480254b6657a86ed821a88e414d;hb=ba177dd9743397cb43dad787fbe7748c8ea51cba;hp=6f6b60be4f374bee6f2a45d9bce097425dbbfa72;hpb=88ce644db1b40111bdb380f4357fa59bdb5173be;p=d2df-sdl.git diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index 6f6b60b..c6f09a9 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -1,3 +1,19 @@ +(* Copyright (C) DooM 2D:Forever Developers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *) +{$MODE DELPHI} unit g_weapons; interface @@ -90,6 +106,9 @@ const WEAPON_MANCUB_FIRE = 25; WEAPON_SKEL_FIRE = 26; + WP_FIRST = WEAPON_KASTET; + WP_LAST = WEAPON_SUPERPULEMET; + implementation uses @@ -106,11 +125,11 @@ type end; const - SHOT_ROCKETLAUNCHER_WIDTH = 27; - SHOT_ROCKETLAUNCHER_HEIGHT = 12; + SHOT_ROCKETLAUNCHER_WIDTH = 14; + SHOT_ROCKETLAUNCHER_HEIGHT = 14; - SHOT_SKELFIRE_WIDTH = 32; - SHOT_SKELFIRE_HEIGHT = 16; + SHOT_SKELFIRE_WIDTH = 14; + SHOT_SKELFIRE_HEIGHT = 14; SHOT_PLASMA_WIDTH = 16; SHOT_PLASMA_HEIGHT = 16; @@ -1189,7 +1208,7 @@ begin Obj.Rect.Width := SHOT_ROCKETLAUNCHER_WIDTH; Obj.Rect.Height := SHOT_ROCKETLAUNCHER_HEIGHT; - dx := IfThen(xd>x, -Obj.Rect.Width, 0); + dx := IfThen(xd > x, -Obj.Rect.Width, 0); dy := -(Obj.Rect.Height div 2); throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12); @@ -1227,7 +1246,7 @@ begin Obj.Rect.Width := SHOT_SKELFIRE_WIDTH; Obj.Rect.Height := SHOT_SKELFIRE_HEIGHT; - dx := IfThen(xd>x, -Obj.Rect.Width, 0); + dx := -(Obj.Rect.Width div 2); dy := -(Obj.Rect.Height div 2); throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12); @@ -1462,7 +1481,7 @@ begin triggers := nil; ShotType := WEAPON_MANCUB_FIRE; - g_Frames_Get(FramesID, 'FRAMES_WEAPON_MANCUBFIRE'); + g_Frames_Get(FramesID, 'FRAMES_WEAPON_MANCUBFIRE'); Animation := TAnimation.Create(FramesID, True, 4); end; @@ -1486,7 +1505,7 @@ begin if Integer(find_id) >= High(Shots) then SetLength(Shots, find_id + 64) end; - + with Shots[find_id] do begin g_Obj_Init(@Obj); @@ -1675,7 +1694,7 @@ begin begin Anim := TAnimation.Create(_id, False, 3); Anim.Alpha := 150; - g_GFX_OnceAnim(Obj.X-8+Random(9), + g_GFX_OnceAnim(Obj.X-14+Random(9), Obj.Y+(Obj.Rect.Height div 2)-20+Random(9), Anim, ONCEANIM_SMOKE); Anim.Free(); @@ -1697,7 +1716,7 @@ begin begin Anim := TAnimation.Create(TextureID, False, 8); Anim.Blending := False; - g_GFX_OnceAnim((Obj.X+32)-32, (Obj.Y+8)-32, Anim); + g_GFX_OnceAnim((Obj.X+32)-58, (Obj.Y+8)-36, Anim); Anim.Free(); end; end @@ -1932,6 +1951,15 @@ begin else e_Draw(TextureID, Obj.X, Obj.Y, 0, True, False); end; + + if g_debug_Frames then + begin + e_DrawQuad(Obj.X+Obj.Rect.X, + Obj.Y+Obj.Rect.Y, + Obj.X+Obj.Rect.X+Obj.Rect.Width-1, + Obj.Y+Obj.Rect.Y+Obj.Rect.Height-1, + 0, 255, 0); + end; end; end; @@ -2097,7 +2125,7 @@ begin if Shots = nil then Exit; if (I > High(Shots)) or (I < 0) then Exit; - + with Shots[I] do begin if ShotType = 0 then Exit; @@ -2141,7 +2169,7 @@ begin s := 'FRAMES_EXPLODE_PLASMA' else s := 'FRAMES_EXPLODE_BSPFIRE'; - + if g_Frames_Get(TextureID, s) and loud then begin Anim := TAnimation.Create(TextureID, False, 3);