diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 95137cdf456c88c61a4a800f93efae210b53e6b8..96c46c8d4fc0cad7a2d0e36eeaf88b431addbaf9 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
uses
SysUtils, Classes, mempool,
- g_textures, g_basic, g_phys, xprofiler;
+ g_basic, g_phys, xprofiler;
type
SpawnerUID: Word;
Triggers: DWArray;
Obj: TObj;
- Animation: TAnimationState;
+ time: LongWord;
Timeout: DWORD;
Stopped: Byte;
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;
Math, g_map, g_player, g_sound, g_panel,
g_console, g_options, g_game,
g_triggers, MAPDEF, e_log, g_monsters, g_saveload,
- g_language, g_netmsg, g_grid,
+ g_language, g_netmsg, g_grid, g_window,
geom, binheap, hashtable, utils, xstreams
;
SetLength(Shots, find_id + 64)
end;
+ shots[find_id].time := gTime;
+
case ShotType of
WEAPON_ROCKETLAUNCHER:
begin
Obj.Rect.Width := SHOT_ROCKETLAUNCHER_WIDTH;
Obj.Rect.Height := SHOT_ROCKETLAUNCHER_HEIGHT;
- Animation := nil;
Triggers := nil;
ShotType := WEAPON_ROCKETLAUNCHER;
end;
Triggers := nil;
ShotType := WEAPON_PLASMA;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BFG;
- Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_FLAMETHROWER;
- // Animation := TAnimationState.Create(True, 6, 0); // drawed as gfx
end;
end;
Triggers := nil;
ShotType := WEAPON_IMP_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_CACO_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_MANCUB_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BARON_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BSP_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_SKEL_FIRE;
target := TargetUID;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
end;
end;
end;
end;
procedure g_Weapon_Free();
-var
- i: Integer;
begin
- if Shots <> nil then
- begin
- for i := 0 to High(Shots) do
- if Shots[i].ShotType <> 0 then
- Shots[i].Animation.Free();
-
- Shots := nil;
- end;
-
+ Shots := nil;
WaterMap := nil;
end;
procedure g_Weapon_LoadData();
begin
e_WriteLog('Loading weapons data...', TMsgType.Notify);
+ g_Game_SetLoadingText(_lc[I_LOAD_WEAPONS_DATA], 0, False);
g_Sound_CreateWADEx('SOUND_WEAPON_HITPUNCH', GameWAD+':SOUNDS\HITPUNCH');
g_Sound_CreateWADEx('SOUND_WEAPON_MISSPUNCH', GameWAD+':SOUNDS\MISSPUNCH');
ShotType := WEAPON_ROCKETLAUNCHER;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12);
- Animation := nil;
triggers := nil;
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
triggers := nil;
target := TargetUID;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := nil;
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
-
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
-
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ time := gTime;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
end;
end;
- // Àíèìàöèÿ ñíàðÿäà:
- if Animation <> nil then
- Animation.Update();
-
// Äâèæåíèå:
spl := (ShotType <> WEAPON_PLASMA) and
(ShotType <> WEAPON_BFG) and
begin
// Íà êëèåíòå ñêîðåå âñåãî è òàê óæå âûïàë.
ShotType := 0;
- Animation.Free();
+ time := 0;
Continue;
end;
begin
if gGameSettings.GameType = GT_SERVER then
MH_SEND_DeleteShot(i, Obj.X, Obj.Y, Loud);
- if Animation <> nil then
- begin
- Animation.Free();
- Animation := nil;
- end;
+ 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
// Êîñòûëèíà åáàíàÿ
Shots[i].Stopped := utils.readByte(st);
- // Óñòàíîâêà òåêñòóðû èëè àíèìàöèè
- Shots[i].Animation := nil;
-
- case Shots[i].ShotType of
- WEAPON_ROCKETLAUNCHER, WEAPON_SKEL_FIRE:
- begin
- end;
- WEAPON_PLASMA:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
- end;
- WEAPON_BFG:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
- end;
- WEAPON_IMP_FIRE:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
- end;
- WEAPON_BSP_FIRE:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
- end;
- WEAPON_CACO_FIRE:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
- end;
- WEAPON_BARON_FIRE:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
- end;
- WEAPON_MANCUB_FIRE:
- begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
- end;
- end;
+ Shots[i].time := gTime; // TODO save time?
end;
end;
end; // case ShotType of...
ShotType := 0;
- Animation.Free();
end;
end;