Add frost barrier spell

This commit is contained in:
Electroblob77
2020-09-27 17:48:37 +01:00
parent a72ac33768
commit c05f4001fd
18 changed files with 426 additions and 19 deletions
@@ -100,6 +100,13 @@ public final class GeometryUtils {
return new Vec3i(components[0], components[1], components[2]);
}
/**
* Returns a normalised {@link Vec3d} with the same yaw angle as the given vector, but with a y component of zero.
*/
public static Vec3d horizontalise(Vec3d vec){
return replaceComponent(vec, Axis.Y, 0).normalize();
}
/**
* Returns an array of {@code Vec3d} objects representing the vertices of the given bounding box.
* @param box The bounding box whose vertices are to be returned.
@@ -58,20 +58,15 @@ public final class SpellModifiers {
syncedMultiplierMap = new HashMap<>();
}
// /** Returns a deep copy of this {@code SpellModifiers} object. */
// @Override
// public SpellModifiers clone(){
// SpellModifiers clone;
// try {
// clone = (SpellModifiers)super.clone();
// }catch(CloneNotSupportedException e){
// Wizardry.logger.error("Whaaaaat?!", e);
// return null;
// }
// clone.multiplierMap = new HashMap<>(this.multiplierMap);
// clone.syncedMultiplierMap = new HashMap<>(this.syncedMultiplierMap);
// return clone;
// }
private SpellModifiers(Map<String, Float> multiplierMap, Map<String, Float> syncedMultiplierMap){
this.multiplierMap = multiplierMap;
this.syncedMultiplierMap = syncedMultiplierMap;
}
/** Returns a deep copy (with copies of the underlying maps) of this {@code SpellModifiers} object. */
public SpellModifiers copy(){
return new SpellModifiers(new HashMap<>(this.multiplierMap), new HashMap<>(this.syncedMultiplierMap));
}
/**
* Adds the given multiplier to this SpellModifiers object, using the string identifier that the given wand upgrade