Started working on an API, implemented ForWho I think
This commit is contained in:
parent
617bb0aa3f
commit
b102f2793d
72
common/api.iss
Normal file
72
common/api.iss
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
#ifndef _mr_api_
|
||||||
|
#define _mr_api_
|
||||||
|
objectdef MRApi
|
||||||
|
{
|
||||||
|
static member:bool IsForMe(string forWhoTarget)
|
||||||
|
{
|
||||||
|
variable string target = ${forWhoTarget};
|
||||||
|
variable string prefix = ${forWhoTarget.Token[1, ":"]};
|
||||||
|
variable bool negate = FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ${target.Count[":"]} > 0
|
||||||
|
{
|
||||||
|
negate:Set[${prefix.Equal["not"]}]
|
||||||
|
target:Set[${forWhoTarget.Token[2, ":"]}];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Target: ${target}"
|
||||||
|
echo "negate: ${negate}"
|
||||||
|
|
||||||
|
if ${prefix.Equal["igw"]}
|
||||||
|
{
|
||||||
|
return ${Me.Group["${target}"](exists)}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${prefix.Equal["igwbn"]}
|
||||||
|
{
|
||||||
|
|
||||||
|
return !${Me.Name.Equal["${target}"]) && ${Me.Group["${target}"](exists)}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${prefix.Equal["irw"]}
|
||||||
|
{
|
||||||
|
return ${Me.Raid["${target}"](exists)}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${prefix.Equal["irwbn"]}
|
||||||
|
{
|
||||||
|
|
||||||
|
return !${Me.Name.Equal["${target}"]) && ${Me.Raid["${target}"](exists)}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${target.Equal["${Me.Name}"]} || ${target.Equal["all"]}
|
||||||
|
{
|
||||||
|
return !${negate};
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${target.Equal["${Me.Class}"]} || ${target.Equal["${Me.SubClass}"]} || ${target.Equal["${Me.Archetype}"]}
|
||||||
|
{
|
||||||
|
return !${negate};
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${target.Equal["melee"]} && (${Me.Archetype.Equal["fighter"]} || ${Me.Archetype.Equal["scout"]})
|
||||||
|
{
|
||||||
|
echo "melee match"
|
||||||
|
return !${negate};
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${target.Equal["caster"]} && (${Me.Archetype.Equal["mage"]} || ${Me.Archetype.Equal["priest"]})
|
||||||
|
{
|
||||||
|
return !${negate};
|
||||||
|
}
|
||||||
|
|
||||||
|
return ${negate};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
2
mr.iss
2
mr.iss
@ -17,6 +17,6 @@ function main(... params)
|
|||||||
elseif ${params[1].Lower.Equal["test"]}
|
elseif ${params[1].Lower.Equal["test"]}
|
||||||
{
|
{
|
||||||
ConsoleClear
|
ConsoleClear
|
||||||
run mr/test
|
run mr/test ${params[2]}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
41
test.iss
41
test.iss
@ -1,39 +1,14 @@
|
|||||||
#include "${LavishScript.HomeDirectory}/Scripts/mr/common/KnowledgeBook.iss"
|
#include "${LavishScript.HomeDirectory}/Scripts/mr/common/api.iss"
|
||||||
|
|
||||||
function main()
|
function main(string forWho)
|
||||||
{
|
{
|
||||||
variable jsonvalue effect
|
echo "Checking forWho ${forWho}"
|
||||||
effect:SetValue[$$>{
|
if ${MRApi.IsForMe["${forWho}"]}
|
||||||
"description": "Inflicts 559 disease damage on targets in Area of Effect."
|
|
||||||
}<$$]
|
|
||||||
|
|
||||||
variable string description
|
|
||||||
|
|
||||||
description:Set["${effect.Get["description"]}"]
|
|
||||||
|
|
||||||
if ${description.Left[8].NotEqual["Inflicts"]}
|
|
||||||
{
|
{
|
||||||
echo "0"
|
echo "This is for me!"
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
variable int64 minDamage
|
|
||||||
variable int64 maxDamage
|
|
||||||
variable string damageType
|
|
||||||
|
|
||||||
minDamage:Set["${description.Token[2, " "].Replace[",", ""]}"]
|
|
||||||
if ${description.Token[3, " "].Equal["-"]}
|
|
||||||
{
|
{
|
||||||
maxDamage:Set["${description.Token[4, " "].Replace[",", ""]}"]
|
echo "This is not for me!"
|
||||||
damageType:Set["${description.Token[5, " "]}"]
|
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
maxDamage:Set["${description.Token[2, " "].Replace[",", ""]}"]
|
|
||||||
damageType:Set["${description.Token[3, " "]}"]
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "${description}"
|
|
||||||
echo "${minDamage} - ${maxDamage} ${damageType} damage"
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user