package com.ezardlabs.lostsector.objects.enemies.corpus.crewmen;

import com.ezardlabs.dethsquare.Collider;
import com.ezardlabs.dethsquare.GameObject;
import com.ezardlabs.dethsquare.Renderer;
import com.ezardlabs.dethsquare.Transform;
import com.ezardlabs.lostsector.ai.RangedBehaviour;
import com.ezardlabs.lostsector.ai.RangedBehaviour.Builder.ShootAction;
import com.ezardlabs.lostsector.objects.enemies.corpus.Crewman;
import com.ezardlabs.lostsector.objects.projectiles.Laser;

public class SupraCrewman extends Crewman {

	public SupraCrewman() {
		super(new RangedBehaviour.Builder().setRange(1000).setShootAction(new ShootAction() {
			private boolean fired = false;

			@Override
			public void onShoot(Transform self, Transform target) {
				self.gameObject.animator.play("shoot");
				if (self.gameObject.animator.getCurrentAnimationFrame() == 1) {
					if (!fired) {
						GameObject laser = GameObject.instantiate(
								new GameObject("Laser", new Renderer("images/laser.png", 100, 100),
										new Collider(100, 100, true), new Laser(1)),
								self.position.offset(self.gameObject.transform.scale.x < 0 ? -12.5f : 87.5f, 60));
						laser.transform.scale.set(self.gameObject.transform.scale);
						fired = true;
					}
				} else {
					fired = false;
				}
			}
		}).setMoveSpeed(10).setVisionRange(2000).setWillPatrol(false).create());
	}

	@Override
	protected String getAtlasPath() {
		return "data/enemies/corpus/crewmen/supra";
	}

	@Override
	protected String getAnimationPath() {
		return "data/enemies/corpus/crewmen/supra";
	}
}

@@ -59,16 +59,173 @@
 ewmen;%0A%0A
+import com.ezardlabs.dethsquare.AudioManager.AudioGroup;%0Aimport com.ezardlabs.dethsquare.AudioSource;%0Aimport com.ezardlabs.dethsquare.AudioSource.AudioClip;%0A
 import c
@@ -1388,16 +1388,118 @@
 = true;%0A
+%09%09%09%09%09%09//noinspection ConstantConditions%0A%09%09%09%09%09%09self.gameObject.getComponent(AudioSource.class).play();%0A
 %09%09%09%09%09%7D%0A%09
@@ -1616,24 +1616,249 @@
 ate());%0A%09%7D%0A%0A
+%09@Override%0A%09public void start() %7B%0A%09%09super.start();%0A%09%09AudioSource audio = new AudioSource(AudioGroup.SFX);%0A%09%09audio.setAudioClip(new AudioClip(%22audio/sfx/weapons/ranged/supra/shoot.ogg%22));%0A%09%09gameObject.addComponent(audio);%0A%09%7D%0A%0A
 %09@Override%0A%09

Add supra SFX