public OctoBehavior(Octo actor, Actor target) : base(actor) { this.actor = actor; this.target = target; this.pathFindBehavior = new PathfindBehavior(actor, target, .06f); this.shootBehavior = new ShootAttack(actor); shootBehavior.target = target; shootBehavior.speed = 6; shootBehavior.projectileId = actor.world.actorFactory.getActorId("SlimeBall"); actor.octoball.addEndAct( (frame) => { shootBehavior.run(); actor.world.tileEngine.audioComponent.playSound(actor.audioSet[1], false); } ); actor.octoball.addEndAct( (frame) => { actor.anim.reset(); actor.anim = actor.floatingAnimation; shotcooldown = 100f; } ); this.shotcooldown = 160f; this.shotrate = 140f; }
public WizBlobBehavior(WizBlob actor, Actor target) : base(actor) { this.actor = actor; this.target = target; this.pathFindBehavior = new PathfindBehavior(actor, target, .1f); this.shootBehavior = new ShootAttack(actor); shootBehavior.target = target; shootBehavior.speed = 1; shootBehavior.projectileId = actor.world.actorFactory.getActorId("FireBlob"); this.shotcooldown = 160f; this.lockCooldown = 0; this.shotrate = 150f; Animation.Action shootFireblob = frame => { this.shootBehavior.run(); actor.anim.reset(); }; Animation.Action reset = frame => { determineDirectionAnimation(); }; int animNum = 0; foreach (Animation a in ((WizBlob)actor).shootFireblobAnimation) { switch (animNum) { case 0: a.addFrameAct(84, shootFireblob); break; case 1: a.addFrameAct(36, shootFireblob); break; case 2: a.addFrameAct(60, shootFireblob); break; case 3: a.addFrameAct(12, shootFireblob); break; } //a.addEndAct(reset); animNum++; } }
public BlobBehavior(Actor actor, Actor target) : base(actor) { this.shotcooldown = Constants.BLOB_BEHAVIOR_SHOTCOOLDOWN; this.shotrate = Constants.BLOB_BEHAVIOR_SHOTRATE; this.target = target; this.actor = actor; this.pathFindBehavior = new PathfindBehavior(actor, target, Constants.BLOB_BEHAVIOR_PATHFIND); this.shootBehavior = new ShootAttack(actor); shootBehavior.target = target; shootBehavior.projectileId = actor.world.actorFactory.getActorId(Constants.BLOB_BEHAVIOR_SHOT); }
public ZazzleBehavior(Actor actor, Actor target) : base(actor) { this.target = target; this.actor = actor; this.shootBehavior = new ShootAttack(actor); shootBehavior.target = target; shootBehavior.projectileId = actor.world.actorFactory.getActorId("ZazzleShot"); shootBehavior.speed = 3; this.shotcooldown = 160f; this.shotrate = 40f; }
public SentinelBehavior(Actor actor, Actor target) : base(actor) { this.actor = actor; this.target = target; this.pathFindBehavior = new PathfindBehavior(actor, target, 10f); this.shootBehavior = new ShootAttack(actor); shootBehavior.target = target; shootBehavior.projectileId = actor.world.actorFactory.getActorId("Laser"); shootBehavior.offset = new Vector2(0, -10); shootBehavior.radius = 0; this.shotcooldown = 160f; }
// Use this for initialization override public void Start() { shootAttack = self.GetComponent <ShootAttack> (); shootAttack.StartLightAttack(); return; }