-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInsanityWolf.as
70 lines (58 loc) · 2.2 KB
/
InsanityWolf.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package classes {
import dragonBones.events.AnimationEvent;
public class InsanityWolf extends ArmatureCombatant {
[Embed(source = "../insanityWolf.png", mimeType = "application/octet-stream")]
public static const ResourcesData:Class;
public var slashMc:SuperMovieClip = new SuperMovieClip('clawEffect', GV.COMBATANT_SPRITESHEET, 0, 0, true);
public function InsanityWolf(){
introMessage = introMessageRandomizer(new <String>["I will EVICERATE YOU.", "RIP AND TEAR.", "DIE FASTER.", "YOUR SKIN IN MY CLAWS, NOW."]);
armatureName = "insanityWolf";
factory.parseData(new ResourcesData());
armatureComplete = uniqueArmatureComplete;
}
public function uniqueAi():void{
movementAI();
attackAI();
if(distanceBetween(GV.hero.pos, pos) <= 1 ){
startAbility(slots[GREEN]);
}
}
private function uniqueArmatureComplete(e:AnimationEvent):void{
switch(afterAnim){
case 'idle':
idleAnimation();
break;
case 'effects':
executeEffects();
break;
case 'moveBack':
moveBackToOurTile();
moveBack = false;
break;
case 'meleeAnimationPart2':
meleeAnimationPart2();
break;
}
}
public function uniqueMovementAnimation():void{armature.animation.gotoAndPlay("run");}
public function uniqueIdleAnimation():void{armature.animation.gotoAndPlay("idle");}
public function jumpAnimation():void{armature.animation.gotoAndPlay("jump"); afterAnim = 'effects'; FX.dogBark1Sound.play(GV.AUDIO_START_TIME, 0, GV.sfx);}
public function jumpAnimationInert():void{armature.animation.gotoAndPlay("jump"); afterAnim = 'idle'; FX.dogBark1Sound.play(GV.AUDIO_START_TIME, 0, GV.sfx);}
public function meleeAnimation():void{
armature.animation.gotoAndPlay("attack");
afterAnim = 'meleeAnimationPart2';
FX.dogBark2Sound.play(GV.AUDIO_START_TIME, 0, GV.sfx);
}
public function meleeAnimationPart2():void{
armature.animation.gotoAndPlay("attack"); afterAnim = 'meleeAnimationPart2';
var targTile:Tile = GV.arena.getTile(currTarg);
if(targTile.occupied){
GV.arena.aboveCombatantContainer.addChild(slashMc);
slashMc.x = targTile.occupant.x;
slashMc.y = targTile.occupant.y;
}
slashMc.genericFade();
moveBackToOurTile();
}
}
}