using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharBro : CharBase {
	public AudioClip sndBro;
	public int wait = 8;

	void Bro() {
		var ent = GetComponent<Entity>();
		if(ent.seat) {
			ent.HeadBump();
			var s = ent.seat.grid.AddRipple(ent.seat.x, ent.seat.z, 3, this);
			s.karmaDelta = -2;
			s.instigatorSound = sndBro;
			Game.instance.ui.Play(sndBro);
		}
	}

	public override void OnRippleTouch(AutomataState state) {
		if(state.instigator is CharBro && state.instigator != this) {
			wait = 1;
		}
	}

	protected override void OnPulseAction(int absPulse, int relPulse, Entity ent) {
		wait--;
		if(wait <= 0) {
			wait = 20;
			Bro();
		}

	}


}
