using UnityEngine;
using System.Collections;

using DG.Tweening;

public class Ritual_Sacrifice : Ritual {

	public GameObject fireGo;

	public override IEnumerator RitualEffectCO(){

		// Fai urlare e lanciare l'omino selezionato
		Debug.Log("RITUAL SACRIFICE!");
		
		var adept = selectedAdepts [0];

		//yield return new WaitForSeconds (0.2f);

		adept.RemoveMovements ();

		float jumpDuration = 0.7f;
		adept.transform.DOMove (Vector3.zero, jumpDuration).SetEase (Ease.InOutCubic);
		SfxController.instance.PlaySound ("effect_shout");

		adept.Animate ("Fire");

		yield return new WaitForSeconds (jumpDuration -0.2f );

		// TODO: MORE EXPLOSIVE HERE
		fireGo.SetActive(true);
		SfxController.instance.PlaySound ("effect_fire");

		fireLight.color = Color.red;
		fireLight.intensity = 2;

		yield return new WaitForSeconds (0.5f );

		fireLight.color = new Color(1f,0.5f,0f);
		fireLight.intensity = 0.7f;
	
		AdeptFactory.instance.KillAdept(adept);
		fireGo.SetActive(false);

	}

}