public static EffectSpell buildEffectSpell(ObjectJSON effect) { EffectSpell output = new EffectSpell(); output.affectAlly = effect.getBoolArray("affectAlly"); output.affectEnemy = effect.getBoolArray("affectEnemy"); output.affectSelf = effect.getBoolArray("affectSelf"); output.affectCell = effect.getBoolArray("affectCell"); output.minArea = effect.getIntArray("minArea"); output.maxArea = effect.getIntArray("maxArea"); output.areaType = SpellData.stringToRangeAreaType(effect.getStringArray("areaType")); output.quickHandler = buildEffectHandler(effect.getObjectJSON("quickHandler")); output.slowHandler = buildEffectHandler(effect.getObjectJSON("slowHandler")); output.conditions = buildEffectConditions(effect.getArrayJSON("conditions")); return(output); }
public static EffectBuff buildEffectBuff(ObjectJSON effect) { EffectBuff output = new EffectBuff(); output.affectAlly = effect.getBool("affectAlly"); output.affectEnemy = effect.getBool("affectEnemy"); output.affectSelf = effect.getBool("affectSelf"); output.affectCell = effect.getBool("affectCell"); output.minArea = effect.getInt("minArea", 0); output.maxArea = effect.getInt("maxArea", 0); output.areaType = SpellData.stringToRangeAreaType(effect.getString("areaType", "")); output.onGainedHandler = buildEffectHandler(effect.getObjectJSON("onGainedHandler")); output.onLostHandler = buildEffectHandler(effect.getObjectJSON("onLostHandler")); output.onDamageHandler = buildEffectHandler(effect.getObjectJSON("onDamageHandler")); output.onHealHandler = buildEffectHandler(effect.getObjectJSON("onHealHandler")); output.onSpellHandler = buildEffectHandler(effect.getObjectJSON("onSpellHandler")); output.onBuffedHandler = buildEffectHandler(effect.getObjectJSON("onBuffedHandler")); output.onEnterHandler = buildEffectHandler(effect.getObjectJSON("onEnterHandler")); output.onLeaveHandler = buildEffectHandler(effect.getObjectJSON("onLeaveHandler")); output.onTurnStartHandler = buildEffectHandler(effect.getObjectJSON("onTurnStartHandler")); output.onTurnEndHandler = buildEffectHandler(effect.getObjectJSON("onTurnEndHandler")); output.conditions = buildEffectConditions(effect.getArrayJSON("conditions")); return(output); }