-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenericTarget.as
153 lines (130 loc) · 5.05 KB
/
GenericTarget.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
package classes {
import starling.events.Event;
import flash.utils.*;
public class GenericTarget extends Combatant {
public var idleMc:SuperMovieClip;
public var c:Combatant;
public var spriteSheet:int
private var avatar:String;
private var spamArray:Vector.<Spam> = new Vector.<Spam>();
private var isCombatant:Boolean = false;
public function GenericTarget(_avatar:String, _introMessage:String = null){
avatar = _avatar;
spriteSheet = GV.COMBATANT_SPRITESHEET;
switch(_avatar){
case "corruptedMalwareIdle": spriteSheet = GV.BOSS1_SPRITESHEET; break;
}
// Must match Conversationalist var of the same kind.
isCombatant = !(_avatar == 'eggplant' || _avatar == 'hate' || _avatar == 'someguy0' || _avatar == 'someguy1' || _avatar == 'jaysTweet' || _avatar == 'popUpSign' || _avatar == 'accessPointClean' || _avatar == 'heroCompanion' || _avatar == 'userGhost'|| _avatar == 'myself' || _avatar == 'oracleLight' || _avatar == 'corruptedMalwareIdle' || _avatar == 'pepe');
if(!isCombatant){
runBeforeInit();
var _fps = (_avatar == 'heroCompanion') ? 30 : 60;
idleMc = new SuperMovieClip(avatar, spriteSheet, 0, 0, false, _fps);
GV.s.juggler.add(idleMc);
sContainer.addChild(idleMc);
}
}
public function uniqueNullItAll():void{
superNull(idleMc); idleMc = null;
superNull(c); c = null;
superNull(spamArray); spamArray = null;
}
public function changeLook(name:String):void{
GV.s.juggler.remove(idleMc);
removeChild(idleMc);
idleMc = new SuperMovieClip(name, spriteSheet);
GV.s.juggler.add(idleMc);
addChild(idleMc);
uniqueRunAfterInit();
if(floats) initFloatTween();
if(grows) initSizeTween();
}
public function showAvatar(className:String){
var MyClass:Class = getDefinitionByName('classes::' + className) as Class;
c = new MyClass();
c.pos = pos;
c.init(2);
c.isSummon = false
GV.arena.summon = null;
c.ourTile.occupant = this;
}
public function runBeforeInit(){
switch(avatar){
case 'myself': floats = true; isFlat = true; break;
case 'userGhost': floats = true; isFlat = true; break;
case 'someguy0': floats = true; isFlat = true; break;
case 'someguy1': floats = true; isFlat = true; break;
case 'hateVirus': floats = true; isFlat = false; break;
case 'heroCompanion': floats = true; isFlat = true; break;
case 'hate': floats = true; isFlat = true; break;
case 'oracleLight': floats = true; break;
case 'popUpSign': floats = true; break;
case 'jaysTweet': floats = true; faceLeft(); break;
case 'popUpSign': floats = true; faceLeft(); isNotTurner = true; break;
}
}
override public function defaultHitAnimation():void{
if(c){
c.shakeAnimation(200, false);
}else{
shakeAnimation(200, false);
}
}
override public function defaultdeathAnimation():void{
if(c){
c.genericFade();
}else{
genericFade();
}
}
public function uniqueRunAfterInit(){
GV.arena.buttonContainer.removeChild(statUnit.abilityTimers[0]);
GV.arena.buttonContainer.removeChild(statUnit.abilityTimers[1]);
GV.arena.buttonContainer.removeChild(statUnit.abilityTimers[2]);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.statBack);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.swordIcon);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.shieldIcon);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.abilTextBacks[0]);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.abilTextBacks[1]);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.abilTextBacks[2]);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.apBar);
GV.arena.alwaysFlattenedContainer.removeChild(statUnit.square);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.abilText[0]);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.abilText[1]);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.abilText[2]);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.apText);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.powText);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.defText);
GV.arena.alwaysFlatTextContainer.removeChild(statUnit.lvlText);
colorIndicatorContainer.removeChild(colorIndicator);
statUnit.hpText.x += statUnit.square.width/2;
if(isCombatant){
showAvatar(avatar);
}
switch(avatar){
case 'myself':
case 'someguy0':
case 'someguy1':
myParticleEffect = FX.showParticleEffect(FX.randomDataPool, x, y, 0);
break;
case 'userGhost':
myParticleEffect = FX.showParticleEffect(FX.randomDataPool, x, y, 0);
break;
case 'oracleLight':
myParticleEffect = FX.showParticleEffect(FX.oraclePool, x + 3, y + 45, 0);
break;
case 'heroCompanion':
myParticleEffect = FX.showParticleEffect(FX.bitPool, x, y-10, 0, true);
break;
case 'hate':
myParticleEffect = FX.showParticleEffect(FX.hatePool, x, y, 0, true);
break;
case 'accessPointClean':
idleMc.x -= 38;
idleMc.y -= 12; // 12
shadow.width = 100;
break;
}
}
}
}