[Action] ID=gate; 
	name=Gate;
	icon=icon_gate;
	mpCost=3;
	tooltip=Connect two points in space, teleporting yourself to the target.;
	rankUpTooltip=Each rank adds +1 range.;
	
	XPCost=200;
	XPCost=700;
	XPCost=950;
	
	AIRatingBias = -999;
	
	casterAnimation=spellcast;
	special=swapCasterWithTarget;
	maxRank=3;
	
	FXOnCaster=sfx_highestHum;
	FXOnCaster=horizSpark_many_wideArea;
	FXOnCaster=gateOpen_flicker_fast;
	FXOnCaster=gateClose_fast;
	
[ActionAoE] 
	ID=gate;
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 2;
	maxRangeBonus=c:rank;
	canSelectActors=false;
	bypassAll=true;
	occupyAll=false;
[AvAffecter]
	ID=gate; 
	harmful=false;
	actorValue=gate;
	magnitude=0;
	duration=-2;
	chance=100;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateOpen_fast;
	FXOnTile=gateClose_flicker_fast;
[AvAffecterAoE]
	ID=gate;
	cloneFrom=oneTile;

	
	
[Action] ID=gate_magma; 
	name=Gate: Magma;
	icon=icon_firegate;
	mpCost=13;
	chargeTime=18;
	tooltip=Summon a gate to fire from the depths of the earth.;
	rankUpTooltip=Each rank adds +1 range.;
	
	XPCost=350;
	XPCost=550;
	XPCost=800;
	
	special=requiresCasting;
	
	casterAnimation=spellcast;
	maxRank=3;
	
	FXOnCaster=darken_minor;
[ActionAoE] 
	ID=gate_magma; 
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 3;
	maxRangeBonus = c:rank;
	canFloatMidair=true;
	bypassAll=true;
	canSelectActors=false;
[AvAffecter]
	ID=gate_magma; 
	FXOnTile=sfx_higherHum;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateOpen_flicker;
	FXOnTile=gate_flicker;
	FXOnTile=sfx_infernoBlast;
[AvAffecterAoE]
	ID=gate_magma;
	cloneFrom=oneTile;
[AvAffecter]
	ID=gate_magma; 
	actorValue=HP;
	magnitude= d:fireDmg(13);
	duration=-2;
	chance=d:magicAcc;
	useCasterAsOriginForDirectionalEffects=false;
	element=magic;
	element=fire;
	element=kindle;
	FXOnTile=redden_minor;
	FXOnTile=medShakeHoriz;
	FXOnTile=flamethrower;
[AvAffecterAoE]
	ID=gate_magma;
	cloneFrom=adjacentAndSelf+1;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_magma; 
	FXOnTile=classicExplosion;
	FXOnTile=medExplosion;
	FXOnTile=gateClose_flicker;
[AvAffecterAoE]
	ID=gate_magma;
	cloneFrom=oneTile;
	
	
[Action] ID=gate_storm; 
	name=Gate: Storm;
	icon=icon_gate_storm;
	mpCost=13;
	chargeTime=18;
	tooltip=Summon a gate to storm clouds, covering an area with lightning.;
	rankUpTooltip=Each rank adds +1 range.;
	
	XPCost=350;
	XPCost=550;
	XPCost=800;
	
	special=requiresCasting;
	
	casterAnimation=spellcast;
	maxRank=3;
	
	FXOnCaster=darken_minor;
	FXOnTarget=delay;
[ActionAoE] 
	ID=gate_storm;
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 3;
	maxRangeBonus = c:rank;
	canFloatMidair=true;
	bypassAll=true;
	canSelectActors=false;
[AvAffecter]
	ID=gate_storm; 
	FXOnTile=whiten;
	FXOnTile=sfx_higherHum;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateOpen_flicker;
	FXOnTile=gate_flicker;
[AvAffecterAoE]
	ID=gate_storm;
	cloneFrom=oneTile;
[AvAffecter]
	ID=gate_storm; 
	actorValue=HP;
	magnitude= d:elecDmg(13);
	duration=-2;
	chance=d:magicAcc;
	useCasterAsOriginForDirectionalEffects=false;
	FXOnTile=gateStormLightning;
	element=magic;
	element=lightning;
[AvAffecterAoE]
	ID=gate_storm;
	cloneFrom=adjacentAndSelf+1;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_storm; 
	FXOnTile=w_lightning;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateClose_flicker;
	FXOnTile=horizSpark_many_wideArea;
[AvAffecterAoE]
	ID=gate_storm;
	cloneFrom=oneTile;
	
	
	
	
	
[Action] ID=gate_flood; 
	name=Gate: Flood;
	icon=icon_gate_water;
	mpCost=15;
	chargeTime=20;
	tooltip=Summon a gate to the bottom of the ocean to flood a wide area.;
	rankUpTooltip=Each rank adds +1 range.;
	
	special=requiresCasting;
	
	XPCost=450;
	XPCost=500;
	XPCost=800;
	
	casterAnimation=spellcast;
	maxRank=3;
	
	FXOnCaster=darken_minor;
[ActionAoE] 
	ID=gate_flood; shape=0; 
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 3;
	maxRangeBonus=c:rank;
	canFloatMidair=true;
	bypassAll=true;
	canSelectActors=false;
[AvAffecter]
	ID=gate_flood; 
	FXOnTile=blue_minor;
	FXOnTile=sfx_higherHum;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateOpen_flicker;
	FXOnTile=gate_flicker;
	FXOnTile=sfx_loudSplash;
	FXOnTile=blue_major;
[AvAffecterAoE]
	ID=gate_flood;
	cloneFrom=oneTile;
[AvAffecter]
	ID=gate_flood; 
	actorValue=HP;
	magnitude= d:iceDmg(10);
	duration=-2;
	chance=d:magicAcc;
	element=magic;
	element=water;
	useCasterAsOriginForDirectionalEffects=false;
	
	FXOnTile=smallShockwaves_flood;
	FXOnTileColor=Blue;
	FXOnTile=smallShockwaves_flood2;
	FXOnTileColor=DarkBlue;
[AvAffecterAoE]
	ID=gate_flood;
	needsLoS = true;
	needsLoE = true;
	minRange = 0;
	maxRange = 3;
	bypassAll=true;
	occupyAll=true;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_flood; 
	FXOnTile=hugePing;
	FXOnTileColor=Blue;
[AvAffecterAoE]
	ID=gate_flood;
	cloneFrom=oneTile;
[AvAffecter]
	ID=gate_flood; 
	visibleEvaluations=false;
	actorValue=wet;
	magnitude= 1;
	duration=150;
	chance=d:magicAcc;
	element=water;
	useCasterAsOriginForDirectionalEffects=false;
	FXOnTile=smallShockwaves_flood_delay;
	FXOnTileColor=DarkBlue;
	FXOnTile=blue_major;
[AvAffecterAoE]
	ID=gate_flood;
	needsLoS = true;
	needsLoE = true;
	minRange = 0;
	maxRange = 3;
	bypassAll=true;
	occupyAll=true;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_flood; 
	visibleEvaluations=false;
	actorValue=summonItem;
	magnitude=puddle;
	duration=1 + m:rand(2);
	chance=100;
	useCasterAsOriginForDirectionalEffects=false;
	FXOnTile=smallShockwaves_flood;
	FXOnTileColor=Blue;
	FXOnTile=smallShockwaves_flood2;
	FXOnTileColor=DarkBlue;
[AvAffecterAoE]
	ID=gate_flood;
	needsLoS = true;
	needsLoE = true;
	minRange = 0;
	maxRange = 3;
	bypassAll=true;
	occupyAll=true;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_flood; 
	FXOnTile=gateClose_flicker;
[AvAffecterAoE]
	ID=gate_flood;
	cloneFrom=oneTile;

[Action] ID=gate_sky; 
	name=Gate: Sky;
	icon=icon_gate_sky;
	mpCost=15;
	chargeTime=18;
	tooltip=Create a gate to a vicious gale, damaging and pulling creatures inward.;
	rankUpTooltip=Each rank adds +1 range.;
	
	special=requiresCasting;
	
	XPCost=450;
	XPCost=600;
	XPCost=800;
	
	casterAnimation=spellcast;
	maxRank=3;
	
[ActionAoE] 
	ID=gate_sky;
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 3;
	maxRangeBonus=c:rank;
	canFloatMidair=true;
	bypassAll=true;
	canSelectActors=false;
[AvAffecter]
	ID=gate_sky; 
	FXOnTile=whiten;
	FXOnTile=sfx_higherHum;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateOpen_flicker;
	FXOnTile=gate_flicker;
	FXOnTile=sfx_gustyBlast;
	FXOnTile=medquake;
	FXOnTile=giantPing;
	FXOnTile=chargeSpiralMany_huge;
	FXOnTile=windBlast_inward;
	FXOnTile=delay;
	FXOnTile=windBlast_inward;
[AvAffecterAoE]
	ID=gate_sky;
	cloneFrom=oneTile;
[AvAffecter]
	ID=gate_sky; 
	actorValue=HP;
	magnitude= d:windDmg(11);
	duration=-2;
	chance=d:magicAcc;
	element=magic;
	element=wind;
[AvAffecterAoE]
	ID=gate_sky;
	cloneFrom=adjacentAndSelf+1;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_sky; 
	useCasterAsOriginForDirectionalEffects=false;
	actorValue=pull;
	magnitude=2;
	duration=-2;
	chance=d:magicAcc;
	element=magic; 
	element=wind;
	FXOnTile=hitDustQuiet;
	FXOnHit=pop;
	FXOnHit=ThudShot;
[AvAffecterAoE]
	ID=gate_sky;
	cloneFrom=adjacentAndSelf+1;
	airborne=true;
	arc=true;
[AvAffecter]
	ID=gate_sky; 
	FXOnTile=chargeSpiralMany_huge;
	FXOnTile=chargeSpiralMany_big;
	FXOnTile=chargeSpiralMany_huge;
	FXOnTile=delay;
	FXOnTile=delay;
	FXOnTile=delay;
	FXOnTile=delay;
	FXOnTile=gateClose_flicker;
	FXOnTile=horizSpark_many_wideArea;
[AvAffecterAoE]
	ID=gate_sky;
	cloneFrom=oneTile;
	
	
	
[Action] ID=gate_trick; 
--not used. instead we're using wb_trick
	name=Gate Trick;
	icon=icon_gate_trick;
	mpCost=3;
	tooltip=Thrust your weapon through a gate, surprising the enemy on the other side.;
	rankUpTooltip=Each rank adds +1 range.;
	tooltipIcons=<icon=noRanged>;
	
	XPCost=150;
	XPCost=500;
	XPCost=900;
	
	casterAnimation=weapon;
	maxRank=3;
	requiredWeaponElement=melee;
	
	FXOnCaster=sfx_highestHum;
	FXOnCaster=gateOpen_small_flicker_fast;
	FXOnCaster=gateClose_small_flicker_fast;
	
	FXOnTarget=gateOpen_small_flicker_fast_overlap;
	FXOnTarget=weaponFX;
[ActionAoE] 
	ID=gate_trick; 
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 2;
	maxRangeBonus=c:rank;
	bypassAll=true;
	occupyAll=true;
[AvAffecter]
	ID=gate_trick; 
	weaponAvAffecter=true;
	magnitude=w:magnitude;
	chance=w:chance * 1.2;
	duration=-2;
	FXOnTile=gateClose_small_flicker_fast;
[AvAffecterAoE]
	ID=gate_trick;
	cloneFrom=oneTile;
	
	
[Action] ID=gate_item; 
	name=Gate: Item;
	icon=icon_gate_item;
	mpCost=2;
	tooltip=Swap items at the target with a personal storage space somewhere in the void. Does not work on obstructed terrain, or on certain items.;
	rankUpTooltip=;
	
	XPCost=200;
	
	AIRatingBias = -999;
	
	casterAnimation=spellcast;
	maxRank=1;
	
[ActionAoE] 
	ID=gate_item;
	needsLoS = true;
	needsLoE = false;
	teleporting=true;
	minRange = 1;
	maxRange = 0;
	maxRangeBonus=c:rank;
	canSelectActors=false;
	bypassAll=true;
	occupyAll=true;
[AvAffecter]
	ID=gate_item; 
	harmful=false;
	actorValue=gateItem;
	magnitude=0;
	duration=-2;
	chance=100;
	
	FXOnTile=sfx_highestHum;
	FXOnTile=horizSpark_many_wideArea;
	FXOnTile=gateOpen_flicker;
	FXOnTile=gateClose;
[AvAffecterAoE]
	ID=gate_item;
	cloneFrom=oneTile;
	

[Action] ID=gate_void; 
	name=Gate: Void;
	icon=icon_gate_void;
	mpCost=12;
	chargeTime=22;
	tooltip=Summon a gate to the blinding white void. All creatures looking in your direction are blinded for <icon=time>70.;
	
	XPCost=800;
	
	special=requiresCasting;
	
	casterAnimation=spellcast;
	maxRank=1;
	
	FXOnCaster=magicCharge;
	FXOnCaster=darken_minor;
	FXOnCaster=sfx_higherHum;
	FXOnCaster=circle_form_big;
	FXOnCaster=sfx_higherHum;
	FXOnCaster=gate_flicker;
	FXOnCaster=delay;
	FXOnCaster=gate_flicker;
	FXOnCaster=delay;
	FXOnCaster=gate_flicker;
	FXOnCaster=delay;
	FXOnCaster=gate_flicker;
	FXOnCaster=whiten;
	FXOnCaster=superSparkles;
	FXOnCaster=gateOpen_flicker_white;
	
	FXOnTarget=sfx_shingEcho;
	FXOnTarget=WHITEN;
	FXOnTarget=delay;
	FXOnTarget=whitePalette;
[ActionAoE] 
	ID=gate_void; shape=7;
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	minRange = 1;
	maxRange = 12;
	bypassAll=true;
	occupyAll=true;
[AvAffecter]
	ID=gate_void; 
	actorValue=blind;
	magnitude= 1;
	duration=70;
	chance=d:magicAcc * m:evaFacing - 200 * t:sight - 200 * t:blind;
	element=magic;
	FXOnHit=sparkles;
	FXOnMiss=sparkles;
[AvAffecterAoE]
	ID=gate_void; 
	aoeCasterAsOrigin=true;
	
	
	
[Action] ID=gate_avalanche; 
	name=Gate: Avalanche;
	icon=icon_gate_rock;
	mpCost=9;
	chargeTime=13;
	tooltip=Summon falling rocks from a mountain, dealing physical damage in a small area.;
	rankUpTooltip=Each rank adds +1 range.;
	
	XPCost=250;
	XPCost=600;
	
	special=requiresCasting;
	
	casterAnimation=spellcast;
	maxRank=2;
	
	FXOnCaster=darken_minor;
[ActionAoE] 
	ID=gate_avalanche; 
	needsLoS = true;
	needsLoE = false;
	airborne=true;
	arc=true;
	teleporting=true;
	minRange = 1;
	maxRange = 3;
	maxRangeBonus = c:rank;
	canFloatMidair=true;
	bypassAll=true;
[AvAffecter]
	ID=gate_avalanche; 
	FXOnTile=sfx_higherHum;
	FXOnTile=horizSpark_many_wideArea_high;
	FXOnTile=gateOpen_above_flicker;
	FXOnTile=gate_above_flicker_longer;
	FXOnTile=sfx_gustyBlast;
	FXOnTile=sfx_classicExplosion;
[AvAffecterAoE]
	ID=gate_avalanche;
	cloneFrom=oneTile;
[AvAffecter]
	ID=gate_avalanche; 
	actorValue=HP;
	magnitude= d:windDmg(9);
	duration=-2;
	chance=d:physicalAcc;
	useCasterAsOriginForDirectionalEffects=false;
	element=physical;
	element=smash;
	element=heavySmash;
	FXOnTile=boulder_drop;
[AvAffecterAoE]
	ID=gate_avalanche;
	cloneFrom=adjacentAndSelf;
	airborne=true;
	arc=true;
	