From f07f00f94296b0a4e830a7e3563df5bf90a18efb Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Mon, 5 May 2014 18:03:14 +0000 Subject: [PATCH] Add WildMushroomIsCharged() to test if healing mushroom is charged. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1379 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- conditions/WildMushroomIsCharged.lua | 39 ++++++++++++++++++++++++++++++++++ conditions/files.xml | 1 + 2 files changed, 40 insertions(+) create mode 100644 conditions/WildMushroomIsCharged.lua diff --git a/conditions/WildMushroomIsCharged.lua b/conditions/WildMushroomIsCharged.lua new file mode 100644 index 0000000..d6cf092 --- /dev/null +++ b/conditions/WildMushroomIsCharged.lua @@ -0,0 +1,39 @@ +--[[-------------------------------------------------------------------- + Ovale Spell Priority + Copyright (C) 2014 Johnny C. Lam + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License in the LICENSE + file accompanying this program. +--]]-------------------------------------------------------------------- + +local _, Ovale = ... + +do + local OvaleCondition = Ovale.OvaleCondition + + local API_IsSpellOverlayed = IsSpellOverlayed + local ParseCondition = OvaleCondition.ParseCondition + local TestBoolean = OvaleCondition.TestBoolean + + local WILD_MUSHROOM_BLOOM = 102791 + + --- Test if the player's Wild Mushroom is fully charged for maximum healing. + -- @name WildMushroomIsCharged + -- @paramsig boolean + -- @param yesno Optional. If yes, then return true if the player's Wild Mushroom is fully charged. If no, then return true if it isn't fully charged. + -- Default is yes. + -- Valid values: yes, no. + -- @return A boolean value. + -- @usage + -- if WildMushroomIsCharged() Spell(wild_mushroom_bloom) + + local function WildMushroomIsCharged(condition) + local yesno = condition[1] + local target = ParseCondition(condition) + local boolean = API_IsSpellOverlayed(WILD_MUSHROOM_BLOOM) + return TestBoolean(boolean, yesno) + end + + OvaleCondition:RegisterCondition("wildmushroomischarged", false, WildMushroomIsCharged) +end diff --git a/conditions/files.xml b/conditions/files.xml index 4f2b019..b6aadcb 100644 --- a/conditions/files.xml +++ b/conditions/files.xml @@ -109,4 +109,5 @@