From 2f806801bc91dbcbbc089c1442759618c668019f Mon Sep 17 00:00:00 2001 From: smiki Date: Sun, 20 Jul 2025 11:48:35 +0200 Subject: [PATCH] [ADDED] `AUFTRAG:SetRepeatDelay` --- Moose Development/Moose/Ops/Auftrag.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index cae2c17c4..e2e94d412 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -397,6 +397,7 @@ AUFTRAG = { conditionPush = {}, conditionSuccessSet = false, conditionFailureSet = false, + repeatDelay = 1, } --- Global mission counter. @@ -3002,6 +3003,16 @@ function AUFTRAG:SetRepeat(Nrepeat) return self end + +--- **[LEGION, COMMANDER, CHIEF]** Set the repeat delay in seconds after a mission is successful/failed. Only valid if the mission is handled by a LEGION (AIRWING, BRIGADE, FLEET) or higher level. +-- @param #AUFTRAG self +-- @param #number Nrepeat Repeat delay in seconds. Default 1. +-- @return #AUFTRAG self +function AUFTRAG:SetRepeatDelay(RepeatDelay) + self.repeatDelay = RepeatDelay + return self +end + --- **[LEGION, COMMANDER, CHIEF]** Set how many times the mission is repeated if it fails. Only valid if the mission is handled by a LEGION (AIRWING, BRIGADE, FLEET) or higher level. -- @param #AUFTRAG self -- @param #number Nrepeat Number of repeats. Default 0. @@ -5203,7 +5214,7 @@ function AUFTRAG:onafterSuccess(From, Event, To) -- Repeat mission. self:T(self.lid..string.format("Mission SUCCESS! Repeating mission for the %d time (max %d times) ==> Repeat mission!", self.repeated+1, N)) - self:Repeat() + self:__Repeat(self.repeatDelay) else @@ -5245,7 +5256,7 @@ function AUFTRAG:onafterFailed(From, Event, To) -- Repeat mission. self:T(self.lid..string.format("Mission FAILED! Repeating mission for the %d time (max %d times) ==> Repeat mission!", self.repeated+1, N)) - self:Repeat() + self:__Repeat(self.repeatDelay) else