X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_weapons.pas;h=8fdde869c0bcda1b9a175a3805bc0c2bc528be53;hb=a0269440c6b9e8f1f0f578f26864804f9a412b13;hp=cf80f5914848fbb53451aaf3dc3cd1c90285dd14;hpb=c1fadc464add5e4a2de943234f229dc243b39db4;p=d2df-sdl.git diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index cf80f59..8fdde86 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -20,7 +20,7 @@ interface uses SysUtils, Classes, mempool, - g_textures, g_basic, g_phys, xprofiler; + g_basic, g_phys, xprofiler; type @@ -30,7 +30,7 @@ type SpawnerUID: Word; Triggers: DWArray; Obj: TObj; - Animation: TAnimState; + time: LongWord; Timeout: DWORD; Stopped: Byte; @@ -100,6 +100,7 @@ const WEAPON_BARON_FIRE = 24; WEAPON_MANCUB_FIRE = 25; WEAPON_SKEL_FIRE = 26; + WEAPON_LAST = WEAPON_SKEL_FIRE; WP_FIRST = WEAPON_KASTET; WP_LAST = WEAPON_FLAMETHROWER; @@ -588,6 +589,8 @@ begin SetLength(Shots, find_id + 64) end; + shots[find_id].time := gTime; + case ShotType of WEAPON_ROCKETLAUNCHER: begin @@ -600,7 +603,6 @@ begin Triggers := nil; ShotType := WEAPON_ROCKETLAUNCHER; - Animation.Invalidate; end; end; @@ -615,7 +617,6 @@ begin Triggers := nil; ShotType := WEAPON_PLASMA; - Animation := TAnimState.Create(True, 5, 2); // !!! put values into table end; end; @@ -630,7 +631,6 @@ begin Triggers := nil; ShotType := WEAPON_BFG; - Animation := TAnimState.Create(True, 6, 2); // !!! put values into table end; end; @@ -645,8 +645,6 @@ begin Triggers := nil; ShotType := WEAPON_FLAMETHROWER; - Animation.Invalidate; - // Animation := TAnimState.Create(True, 6, 0); // drawed as gfx end; end; @@ -661,7 +659,6 @@ begin Triggers := nil; ShotType := WEAPON_IMP_FIRE; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table end; end; @@ -676,7 +673,6 @@ begin Triggers := nil; ShotType := WEAPON_CACO_FIRE; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table end; end; @@ -691,7 +687,6 @@ begin Triggers := nil; ShotType := WEAPON_MANCUB_FIRE; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table end; end; @@ -706,7 +701,6 @@ begin Triggers := nil; ShotType := WEAPON_BARON_FIRE; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table end; end; @@ -721,7 +715,6 @@ begin Triggers := nil; ShotType := WEAPON_BSP_FIRE; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table end; end; @@ -737,7 +730,6 @@ begin Triggers := nil; ShotType := WEAPON_SKEL_FIRE; target := TargetUID; - Animation := TAnimState.Create(True, 5, 2); // !!! put values into table end; end; end; @@ -1653,8 +1645,8 @@ begin ShotType := WEAPON_ROCKETLAUNCHER; throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12); - Animation.Invalidate; triggers := nil; + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1693,7 +1685,7 @@ begin triggers := nil; target := TargetUID; - Animation := TAnimState.Create(True, 5, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1734,7 +1726,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - Animation := TAnimState.Create(True, 5, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1775,7 +1767,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - Animation.Invalidate; + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1816,7 +1808,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1857,7 +1849,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1898,7 +1890,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1939,8 +1931,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -1981,8 +1972,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - - Animation := TAnimState.Create(True, 4, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -2023,7 +2013,7 @@ begin throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16); triggers := nil; - Animation := TAnimState.Create(True, 6, 2); // !!! put values into table + time := gTime; end; Shots[find_id].SpawnerUID := SpawnerUID; @@ -2182,10 +2172,6 @@ begin end; end; - // Àíèìàöèÿ ñíàðÿäà: - if Animation.IsValid() then - Animation.Update(); - // Äâèæåíèå: spl := (ShotType <> WEAPON_PLASMA) and (ShotType <> WEAPON_BFG) and @@ -2207,7 +2193,7 @@ begin begin // Íà êëèåíòå ñêîðåå âñåãî è òàê óæå âûïàë. ShotType := 0; - Animation.Invalidate(); + time := 0; Continue; end; @@ -2481,7 +2467,7 @@ begin begin if gGameSettings.GameType = GT_SERVER then MH_SEND_DeleteShot(i, Obj.X, Obj.Y, Loud); - Animation.Invalidate; + time := 0; end else if (ShotType <> WEAPON_FLAMETHROWER) and ((oldvx <> Obj.Vel.X) or (oldvy <> Obj.Vel.Y)) then if gGameSettings.GameType = GT_SERVER then @@ -2587,42 +2573,7 @@ begin // Êîñòûëèíà åáàíàÿ Shots[i].Stopped := utils.readByte(st); - // Óñòàíîâêà òåêñòóðû èëè àíèìàöèè - Shots[i].Animation.Invalidate; - - case Shots[i].ShotType of - WEAPON_ROCKETLAUNCHER, WEAPON_SKEL_FIRE: - begin - end; - WEAPON_PLASMA: - begin - Shots[i].Animation := TAnimState.Create(True, 5, 2); // !!! put values into table - end; - WEAPON_BFG: - begin - Shots[i].Animation := TAnimState.Create(True, 6, 2); // !!! put values into table - end; - WEAPON_IMP_FIRE: - begin - Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table - end; - WEAPON_BSP_FIRE: - begin - Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table - end; - WEAPON_CACO_FIRE: - begin - Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table - end; - WEAPON_BARON_FIRE: - begin - Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table - end; - WEAPON_MANCUB_FIRE: - begin - Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table - end; - end; + Shots[i].time := gTime; // TODO save time? end; end; @@ -2707,7 +2658,6 @@ begin end; // case ShotType of... ShotType := 0; - Animation.Invalidate; end; end;