Public Repository for the Magicbane Shadowbane Emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
5.8 KiB

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2024
// www.magicbane.com
package engine.wpakpowers;
import engine.mbEnums;
import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject;
import engine.util.Pair;
import engine.wpak.data.Effect;
import engine.wpak.data.ModifierEntry;
import engine.wpak.data.Power;
import engine.wpak.data.PowerAction;
public class Behaviours {
public static Object Flag(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return true;
}
public static Object MapIntToInts(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return powerAction.attackAnimations.clone();
}
public static Object Standard(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return WpakPowerManager.getModifierValues(modifierEntry, rank).first;
}
public static Object FPSubTypeAttr(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return WpakPowerManager.getModifierValues(modifierEntry, rank).first;
}
public static Object SubTypeSourceType(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return mbEnums.SourceType.valueOf(modifierEntry.arg1);
}
public static Object SubTypePowerType(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return modifierEntry.arg1;
}
public static Object SubTypeSkill(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return null; // Unused in data
}
public static Object FPSubTypeDmg(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
String key = modifierEntry.arg1;
float modifierValue = WpakPowerManager.getModifierValues(modifierEntry, rank).first;
return new Pair<>(key, modifierValue);
}
public static Object DD(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
System.out.println("Behavior method called");
return null;
}
public static Object StringBehaviour(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return new Pair<>(modifierEntry.arg1, modifierEntry.arg2); // We should filter this. No purpose.
}
public static Object SubTypeMod(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
mbEnums.ModType noMod = mbEnums.ModType.valueOf(modifierEntry.arg1);
return noMod;
}
public static Object SubTypePower(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return power.category;
}
public static Object SubTypeDmg(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return power.category;
}
public static Object FPSubTypeSkill(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
return WpakPowerManager.getModifierValues(modifierEntry, rank);
}
public static Object FPSubTypeMonster(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
System.out.println("Behavior method called");
return null;
}
public static Object ProcInfo(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target,
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry) {
System.out.println("Behavior method called");
return null;
}
}