DEADSOFTWARE

Add sounds for flamethrower
[d2df-sdl.git] / src / game / g_triggers.pas
index f378cd1be611aad2b8a0b0197a64e0c50125a299..1673cefedadeab37f1f565cd3b100a7a6684119c 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C)  DooM 2D:Forever Developers
+(* 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
@@ -24,8 +24,6 @@ uses
   xdynrec, hashtable, exoma;
 
 type
-  THashStrVariant = specialize THashBase<AnsiString, Variant>;
-
   TActivator = record
     UID:     Word;
     TimeOut: Word;
@@ -237,7 +235,7 @@ begin
       if (Length(afldname) > 4) and (afldname[1] = 'u') and (afldname[2] = 's') and
          (afldname[3] = 'e') and (afldname[4] = 'r') then
       begin
-        if (me.userVars = nil) then me.userVars := THashStrVariant.Create(hashStrHash, hashStrEqu);
+        if (me.userVars = nil) then me.userVars := THashStrVariant.Create();
         me.userVars.put(afldname, aval);
         exit;
       end;
@@ -594,17 +592,17 @@ begin
   if (gLifts[PanelID].PanelType = PANEL_LIFTUP) or (gLifts[PanelID].PanelType = PANEL_LIFTDOWN) then
   begin
     case d of
-      0: t := 0;
-      1: t := 1;
-      else t := IfThen(gLifts[PanelID].LiftType = 1, 0, 1);
+      0: t := LIFTTYPE_UP;
+      1: t := LIFTTYPE_DOWN;
+      else t := IfThen(gLifts[PanelID].LiftType = LIFTTYPE_DOWN, LIFTTYPE_UP, LIFTTYPE_DOWN);
     end
   end
   else if (gLifts[PanelID].PanelType = PANEL_LIFTLEFT) or (gLifts[PanelID].PanelType = PANEL_LIFTRIGHT) then
   begin
     case d of
-      0: t := 2;
-      1: t := 3;
-      else t := IfThen(gLifts[PanelID].LiftType = 2, 3, 2);
+      0: t := LIFTTYPE_LEFT;
+      1: t := LIFTTYPE_RIGHT;
+      else t := IfThen(gLifts[PanelID].LiftType = LIFTTYPE_LEFT, LIFTTYPE_RIGHT, LIFTTYPE_LEFT);
     end;
   end;
 
@@ -808,6 +806,12 @@ begin
         snd := 'SOUND_WEAPON_EXPLODEBFG';
       end;
 
+    TRIGGER_SHOT_FLAME:
+      begin
+        g_Weapon_flame(wx, wy, dx, dy, 0, -1, True);
+        snd := 'SOUND_GAME_BURNING';
+      end;
+
     else exit;
   end;
 
@@ -849,7 +853,7 @@ begin
       dx += Random(tgcAccuracy)-Random(tgcAccuracy);
       dy += Random(tgcAccuracy)-Random(tgcAccuracy);
 
-      tr_SpawnShot(tgcShotType, wx, wy, dx, dy, not tgcQuiet, TargetUID);
+      tr_SpawnShot(tgcShotType, wx, wy, dx, dy, tgcShotSound, TargetUID);
     end
     else
     begin
@@ -2438,7 +2442,7 @@ begin
   // update cached trigger variables
   trigUpdateCacheData(ptg^, ptg.trigDataRec);
 
-  ptg.userVars := nil; //THashStrVariant.Create(hashStrHash, hashStrEqu);
+  ptg.userVars := nil;
 
   try
     ptg.exoThink := TExprBase.parseStatList(tgclist, VarToStr(trec.user['exoma_think']));
@@ -3339,7 +3343,7 @@ begin
     if (uvcount < 0) or (uvcount > 1024*1024) then raise XStreamError.Create('invalid number of user vars in trigger');
     if (uvcount > 0) then
     begin
-      gTriggers[i].userVars := THashStrVariant.Create(hashStrHash, hashStrEqu);
+      gTriggers[i].userVars := THashStrVariant.Create();
       vv := Unassigned;
       while (uvcount > 0) do
       begin