DEADSOFTWARE

trigger turret: add aim modes
authorbinarymaster <x86corez@gmail.com>
Thu, 2 Mar 2017 22:36:56 +0000 (01:36 +0300)
committerbinarymaster <x86corez@gmail.com>
Thu, 2 Mar 2017 23:11:45 +0000 (02:11 +0300)
src/editor/f_main.pas
src/editor/g_language.pas
src/shared/MAPDEF.pas

index a63b81e0b75abf83576ca7c4b60416b2253ef72b..18a5696d9383a46c13361eef99112e5ae16fee06 100644 (file)
@@ -1461,7 +1461,13 @@ begin
                   MaxLength := 3;
                 end;
 
-                with ItemProps[InsertRow(_lc[I_PROP_TR_SHOT_ALLMAP], BoolNames[Data.ShotAllMap], True)] do
+                case Data.ShotAim of
+                  1: str := _lc[I_PROP_TR_SHOT_AIM_1];
+                  2: str := _lc[I_PROP_TR_SHOT_AIM_2];
+                  3: str := _lc[I_PROP_TR_SHOT_AIM_3];
+                  else str := _lc[I_PROP_TR_SHOT_AIM_0];
+                end;
+                with ItemProps[InsertRow(_lc[I_PROP_TR_SHOT_AIM], str, True)-1] do
                 begin
                   EditStyle := esPickList;
                   ReadOnly := True;
@@ -3734,7 +3740,7 @@ begin
                       trigger.Data.ShotPanelID := -1;
                       trigger.Data.ShotTarget := 0;
                       trigger.Data.ShotIntSight := 0;
-                      trigger.Data.ShotAllMap := False;
+                      trigger.Data.ShotAim := TRIGGER_SHOT_AIM_DEFAULT;
                       trigger.Data.ShotPos.X := trigger.X-64;
                       trigger.Data.ShotPos.Y := trigger.Y-64;
                       trigger.Data.ShotAngle := 0;
@@ -4415,6 +4421,13 @@ begin
         Values.Add(_lc[I_PROP_TR_SHOT_TO_5]);
         Values.Add(_lc[I_PROP_TR_SHOT_TO_6]);
       end
+    else if KeyName = _lc[I_PROP_TR_SHOT_AIM] then
+      begin
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_0]);
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_1]);
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_2]);
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_3]);
+      end
     else if (KeyName = _lc[I_PROP_PANEL_BLEND]) or
             (KeyName = _lc[I_PROP_DM_ONLY]) or
             (KeyName = _lc[I_PROP_ITEM_FALLS]) or
@@ -4432,7 +4445,6 @@ begin
             (KeyName = _lc[I_PROP_TR_SCORE_CON]) or
             (KeyName = _lc[I_PROP_TR_SCORE_MSG]) or
             (KeyName = _lc[I_PROP_TR_HEALTH_MAX]) or
-            (KeyName = _lc[I_PROP_TR_SHOT_ALLMAP]) or
             (KeyName = _lc[I_PROP_TR_SHOT_SOUND]) or
             (KeyName = _lc[I_PROP_TR_EFFECT_CENTER]) then
       begin
@@ -4846,7 +4858,13 @@ begin
                   Data.ShotTarget := 6;
                 Data.ShotIntSight := Min(Max(
                   StrToIntDef(vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_SIGHT]], 0), 0), 65535);
-                Data.ShotAllMap := NameToBool(vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_ALLMAP]]);
+                Data.ShotAim := 0;
+                if vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_AIM]] = _lc[I_PROP_TR_SHOT_AIM_1] then
+                  Data.ShotAim := 1
+                else if vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_AIM]] = _lc[I_PROP_TR_SHOT_AIM_2] then
+                  Data.ShotAim := 2
+                else if vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_AIM]] = _lc[I_PROP_TR_SHOT_AIM_3] then
+                  Data.ShotAim := 3;
                 Data.ShotAngle := Min(
                   StrToIntDef(vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_ANGLE]], 0), 360);
                 Data.ShotWait := Min(Max(
index 7a9b194002a0a0f1ca487f542dc44d0307b509be..d8ee27f00c4b829c3086222d8bc208d2aba7b68c 100644 (file)
@@ -244,7 +244,11 @@ Type
     I_PROP_TR_SHOT_TO_4,
     I_PROP_TR_SHOT_TO_5,
     I_PROP_TR_SHOT_TO_6,
-    I_PROP_TR_SHOT_ALLMAP,
+    I_PROP_TR_SHOT_AIM,
+    I_PROP_TR_SHOT_AIM_0,
+    I_PROP_TR_SHOT_AIM_1,
+    I_PROP_TR_SHOT_AIM_2,
+    I_PROP_TR_SHOT_AIM_3,
     I_PROP_TR_SHOT_AMMO,
     I_PROP_TR_SHOT_RELOAD,
     I_PROP_TR_SHOT_SIGHT,
@@ -1091,8 +1095,16 @@ Const
                                        'Монстры, игроки'),
     ('PROP TR SHOT TO 6',              'Players, monsters',
                                        'Игроки, монстры'),
-    ('PROP TR SHOT ALLMAP',            'On entire map',
+    ('PROP TR SHOT AIM',               'Auto-aiming mode',
+                                       'Режим автонаведения'),
+    ('PROP TR SHOT AIM 0',             'Trigger area',
+                                       'Область триггера'),
+    ('PROP TR SHOT AIM 1',             'Entire map',
                                        'По всей карте'),
+    ('PROP TR SHOT AIM 2',             'Trace trigger area',
+                                       'Область триггера с трассировкой'),
+    ('PROP TR SHOT AIM 3',             'Trace entire map',
+                                       'Вся карта с трассировкой'),
     ('PROP TR SHOT AMMO',              'Ammo limit',
                                        'Кол-во патронов'),
     ('PROP TR SHOT RELOAD',            'Reload interval (in ticks)',
index c18b3f102b117e3d89115918d9c0d768ddd4accf..59fa0af273e1a01fe83ba89ee423e76bad13f4fe 100644 (file)
@@ -173,6 +173,11 @@ const
   TRIGGER_SHOT_TARGET_MONPLR = 5;
   TRIGGER_SHOT_TARGET_PLRMON = 6;
 
+  TRIGGER_SHOT_AIM_DEFAULT   = 0;
+  TRIGGER_SHOT_AIM_ALLMAP    = 1;
+  TRIGGER_SHOT_AIM_TRACE     = 2;
+  TRIGGER_SHOT_AIM_TRACEALL  = 3;
+
   TRIGGER_EFFECT_PARTICLE  = 0;
   TRIGGER_EFFECT_ANIMATION = 1;
 
@@ -294,7 +299,7 @@ Type
                              ShotType: Byte;
                              ShotTarget: Byte;
                              ShotSound: Boolean;
-                             ShotAllMap: Boolean;
+                             ShotAim: Byte;
                              ShotPanelID: Integer;
                              ShotIntSight: Word;
                              ShotAngle: Word;