From: binarymaster Date: Thu, 2 Mar 2017 22:36:56 +0000 (+0300) Subject: trigger turret: add aim modes X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a33d1a6633afdd2423281fc8580addb084215873;p=d2df-editor.git trigger turret: add aim modes --- diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index a63b81e..18a5696 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -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( diff --git a/src/editor/g_language.pas b/src/editor/g_language.pas index 7a9b194..d8ee27f 100644 --- a/src/editor/g_language.pas +++ b/src/editor/g_language.pas @@ -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)', diff --git a/src/shared/MAPDEF.pas b/src/shared/MAPDEF.pas index c18b3f1..59fa0af 100644 --- a/src/shared/MAPDEF.pas +++ b/src/shared/MAPDEF.pas @@ -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;