Skip to content

Commit

Permalink
add clear_reagants determine for #261
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 26, 2019
1 parent 961bfeb commit 9c78bea
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -51,6 +51,7 @@ public class SpellCastScriptEvent extends BukkitScriptEvent implements Listener
// "REAGENT:<TYPE>:" + Element(Number) to change the reagent cost of the given type. Valid types are: mana, health, hunger, experience, levels, durability, money
// "REAGANT:VARIABLE:<NAME>:" + Element(Decimal) to change the reagant cost for the given variable name.
// "REAGENT:ITEMS:" + dList(dItem) to change the reagent item cost.
// "CLEAR_REAGENTS" to clear away all reagent costs.
//
// @Plugin DepenizenBukkit, MagicSpells
//
Expand Down Expand Up @@ -97,6 +98,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio
return false;
}
power = num.asFloat();
return true;
}
else if (lower.startsWith("cast_time:")) {
Element max = new Element(determination.substring("cast_time:".length()));
Expand All @@ -105,6 +107,7 @@ else if (lower.startsWith("cast_time:")) {
return false;
}
castTime = max.asInt();
return true;
}
else if (lower.startsWith("cooldown:")) {
Element num = new Element(determination.substring("cooldown:".length()));
Expand All @@ -113,6 +116,11 @@ else if (lower.startsWith("cooldown:")) {
return false;
}
cooldown = num.asFloat();
return true;
}
else if (lower.equals("clear_reagents")) {
event.setReagents(new SpellReagents());
return true;
}
else if (lower.startsWith("reagent:")) {
String type = determination.substring("reagent:".length());
Expand Down Expand Up @@ -158,6 +166,7 @@ else if (typeLower.startsWith("items:")) {
reagents.setItems(itemsToSet);
}
event.setReagents(reagents);
return true;
}
}
return super.applyDetermination(container, determination);
Expand Down

0 comments on commit 9c78bea

Please sign in to comment.