Skip to content

Commit

Permalink
Add Fire Orb pop message
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarkehs committed Sep 5, 2016
1 parent bef1157 commit a9ad8b3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Encounters/RMT/Engineers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ mod:RegisterEnglishLocale({
["fire_orb.next"] = "Next Fire Orb in",
["fire_orb.you"] = "FIRE ORB ON YOU",
["fire_orb.spawned"] = "Fire Orb spawned",
["fire_orb.pop"] = "Fire Orb is safe to pop in",
["fire_orb.pop.timer"] = "Fire Orb is safe to pop in",
["fire_orb.pop.msg"] = "Pop the Fire Orb!",
["core.health.high.warning"] = "%s pillar at 85%%!",
["core.health.low.warning"] = "%s pillar at 15%%!"
})
Expand Down Expand Up @@ -115,6 +116,8 @@ local coreUnits = {}
local engineerUnits
local player
local orbUnits

local fireOrbTargetTestTimer = ApolloTimer.Create(1, false, "RegisterOrbTarget", mod)
----------------------------------------------------------------------------------------------------
-- Settings.
----------------------------------------------------------------------------------------------------
Expand All @@ -126,6 +129,7 @@ mod:RegisterDefaultSetting("SoundElectroshockSwap")
mod:RegisterDefaultSetting("SoundElectroshockSwapYou")
mod:RegisterDefaultSetting("SoundFireOrb")
mod:RegisterDefaultSetting("SoundFireOrbAlt")
mod:RegisterDefaultSetting("SoundFireOrbPop")
mod:RegisterDefaultSetting("SoundCoreHealthWarning")
----------------------------------------------------------------------------------------------------
-- Raw event handlers.
Expand Down Expand Up @@ -358,14 +362,19 @@ mod:RegisterUnitEvents("Head Engineer Orvulgh",{
}
)

function mod:PopFireOrb()
if mod:IsPlayerOnPlatform(FUSION_CORE) then
mod:AddMsg("FIRE_ORB_POP_MSG", self.L["fire_orb.pop.msg"], 5, mod:GetSetting("SoundFireOrbPop") == true and "Alarm")
end
end

mod:RegisterUnitEvents("Discharged Plasma",{
["OnUnitCreated"] = function (self, id, unit, name)
core:WatchUnit(unit)
mod:RemoveTimerBar("NEXT_FIRE_ORB_TIMER")
mod:AddTimerBar("NEXT_FIRE_ORB_TIMER", self.L["fire_orb.next"], NEXT_FIRE_ORB_TIMER)
mod:AddTimerBar(string.format("FIRE_ORB_SAFE_TIMER %d", id), self.L["fire_orb.pop"], FIRE_ORB_SAFE_TIMER)
local testTimer = ApolloTimer.Create(1, false, "RegisterOrbTarget", mod)
testTimer:Start()
mod:AddTimerBar(string.format("FIRE_ORB_SAFE_TIMER %d", id), self.L["fire_orb.pop.timer"], FIRE_ORB_SAFE_TIMER, false, "Red", mod.PopFireOrb, mod)
fireOrbTargetTestTimer:Start()
orbUnits[id] = {
unit = unit,
checkedTarget = false,
Expand All @@ -388,7 +397,7 @@ function mod:RegisterOrbTarget()
local isOnMyself = target == player.unit
if isOnMyself then
mod:AddMsg("DISCHARGED_PLASMA_MSG", self.L["fire_orb.you"], 5, mod:GetSetting("SoundFireOrb") == true and "RunAway")
else
elseif mod:IsPlayerOnPlatform(FUSION_CORE) then
mod:AddMsg("DISCHARGED_PLASMA_MSG", self.L["fire_orb.spawned"], 2, mod:GetSetting("SoundFireOrbAlt") == true and "Info")
end
end
Expand Down
5 changes: 5 additions & 0 deletions RaidCore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,11 @@
<Event Name="ButtonUncheck" Function="OnButtonCheckBoxSwitched"/>
<Event Name="WindowLoad" Function="OnWindowLoad"/>
</Control>
<Control Class="Button" Base="HologramSprites:HoloCheckBoxBtn" Font="Nameplates" ButtonType="Check" RadioGroup="" LAnchorPoint="0.5" LAnchorOffset="5" TAnchorPoint="0" TAnchorOffset="105" RAnchorPoint="1" RAnchorOffset="-10" BAnchorPoint="0" BAnchorOffset="127" DT_VCENTER="1" DT_CENTER="0" BGColor="UI_BtnBGDefault" TextColor="gray" NormalTextColor="UI_BtnTextDefault" PressedTextColor="UI_BtnTextDefault" FlybyTextColor="UI_BtnTextDefault" PressedFlybyTextColor="UI_BtnTextDefault" DisabledTextColor="UI_BtnTextDefault" TooltipType="OnCursor" Name="Encounters_Engineers_SoundFireOrbPop" TooltipColor="" Text="Fire Orb ready to pop" TextId="" DT_SINGLELINE="1" Tooltip="" TooltipId="" Template="HologramControl1" NoClip="0" DoNotBlockTooltip="0" NotRelative="0" UseTemplateBG="0" DrawAsCheckbox="1" FocusedTextColor="ffffffff">
<Event Name="ButtonCheck" Function="OnButtonCheckBoxSwitched"/>
<Event Name="ButtonUncheck" Function="OnButtonCheckBoxSwitched"/>
<Event Name="WindowLoad" Function="OnWindowLoad"/>
</Control>
</Control>
</Form>
</Forms>

0 comments on commit a9ad8b3

Please sign in to comment.