Skip to content

Commit e15beba

Browse files
committed
fix decompilation error
1 parent 71e6e2b commit e15beba

22 files changed

Lines changed: 2150 additions & 165 deletions

File tree

com/ankamagames/atouin/data/map/Map.as

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,79 @@ package com.ankamagames.atouin.data.map
381381
}
382382

383383
private function computeGfxList(skipBackground:Boolean = false) : void {
384-
/*
385-
* Decompilation error
386-
* Code may be obfuscated
387-
* Error type: TranslateException
388-
*/
389-
throw new IllegalOperationError("Not decompiled due to error");
384+
var l:* = 0;
385+
var c:* = 0;
386+
var e:* = 0;
387+
var lsCell:Array = null;
388+
var numCell:* = 0;
389+
var lsElement:Array = null;
390+
var numElement:* = 0;
391+
var layer:Layer = null;
392+
var cell:Cell = null;
393+
var element:BasicElement = null;
394+
var elementId:* = 0;
395+
var elementData:GraphicalElementData = null;
396+
var graphicalElementData:NormalGraphicalElementData = null;
397+
var s:String = null;
398+
var ele:Elements = Elements.getInstance();
399+
var gfxList:Array = new Array();
400+
this._gfxCount = new Array();
401+
var numLayer:int = this.layers.length;
402+
l = 0;
403+
while(l < numLayer)
404+
{
405+
layer = this.layers[l];
406+
if(!((skipBackground) && (l == 0)))
407+
{
408+
lsCell = layer.cells;
409+
numCell = lsCell.length;
410+
c = 0;
411+
while(c < numCell)
412+
{
413+
cell = lsCell[c];
414+
lsElement = cell.elements;
415+
numElement = lsElement.length;
416+
e = 0;
417+
while(e < numElement)
418+
{
419+
element = lsElement[e];
420+
if(element.elementType == ElementTypesEnum.GRAPHICAL)
421+
{
422+
elementId = GraphicalElement(element).elementId;
423+
elementData = ele.getElementData(elementId);
424+
if(elementData == null)
425+
{
426+
_log.error("Unknown graphical element ID " + elementId);
427+
}
428+
else
429+
{
430+
if(elementData is NormalGraphicalElementData)
431+
{
432+
graphicalElementData = elementData as NormalGraphicalElementData;
433+
gfxList[graphicalElementData.gfxId] = graphicalElementData;
434+
if(this._gfxCount[graphicalElementData.gfxId])
435+
{
436+
this._gfxCount[graphicalElementData.gfxId]++;
437+
}
438+
else
439+
{
440+
this._gfxCount[graphicalElementData.gfxId] = 1;
441+
}
442+
}
443+
}
444+
}
445+
e++;
446+
}
447+
c++;
448+
}
449+
}
450+
l++;
451+
}
452+
this._gfxList = new Array();
453+
for (s in gfxList)
454+
{
455+
this._gfxList.push(gfxList[s]);
456+
}
390457
}
391458
}
392459
}

com/ankamagames/atouin/entities/behaviours/movements/AnimatedMovementBehavior.as

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,74 @@ package com.ankamagames.atouin.entities.behaviours.movements
8787
Atouin.getInstance().handler.process(new EntityMovementStartMessage(entity));
8888
}
8989

90-
public function synchroniseSubEntitiesPosition(entityRef:IMovable, subEntityContainer:DisplayObject = null) : void {
91-
/*
92-
* Decompilation error
93-
* Code may be obfuscated
94-
* Error type: TranslateException
95-
*/
96-
throw new IllegalOperationError("Not decompiled due to error");
90+
public function synchroniseSubEntitiesPosition(entityRef:IMovable, subEntityContainer:DisplayObject=null) : void {
91+
var ts:TiphonSprite = null;
92+
var carriedEntity:IMovable = null;
93+
var subEntities:Array = null;
94+
var subEntity:* = undefined;
95+
var mount:TiphonSprite = null;
96+
var subSubEntities:Array = null;
97+
var subSubEntity:* = undefined;
98+
if(entityRef is TiphonSprite)
99+
{
100+
ts = entityRef as TiphonSprite;
101+
if((subEntityContainer) && (subEntityContainer is TiphonSprite))
102+
{
103+
ts = TiphonSprite(subEntityContainer);
104+
}
105+
if(ts.carriedEntity)
106+
{
107+
carriedEntity = ts.carriedEntity as IMovable;
108+
}
109+
else
110+
{
111+
mount = ts.getSubEntitySlot(2,0) as TiphonSprite;
112+
if((mount) && (mount.carriedEntity))
113+
{
114+
carriedEntity = mount.carriedEntity as IMovable;
115+
}
116+
}
117+
while(carriedEntity)
118+
{
119+
if((carriedEntity.position) && (entityRef.position))
120+
{
121+
carriedEntity.position.x = entityRef.position.x;
122+
carriedEntity.position.y = entityRef.position.y;
123+
carriedEntity.position.cellId = entityRef.position.cellId;
124+
}
125+
carriedEntity = (carriedEntity as TiphonSprite).carriedEntity as IMovable;
126+
}
127+
subEntities = ts.getSubEntitiesList();
128+
for each (subEntity in subEntities)
129+
{
130+
if(subEntity is IMovable)
131+
{
132+
if((subEntity.position) && (entityRef.position))
133+
{
134+
subEntity.position.x = entityRef.position.x;
135+
subEntity.position.y = entityRef.position.y;
136+
}
137+
if((subEntity.movementBehavior) && (!(subEntity == entityRef)))
138+
{
139+
subEntity.movementBehavior.synchroniseSubEntitiesPosition(subEntity);
140+
}
141+
}
142+
else
143+
{
144+
if(subEntity is TiphonSprite)
145+
{
146+
subSubEntities = TiphonSprite(subEntity).getSubEntitiesList();
147+
for each (subSubEntity in subSubEntities)
148+
{
149+
if((subSubEntity is IMovable) && (subSubEntity.movementBehavior) && (!(subSubEntity == entityRef)))
150+
{
151+
IMovable(subSubEntity).movementBehavior.synchroniseSubEntitiesPosition(entityRef,subEntity);
152+
}
153+
}
154+
}
155+
}
156+
}
157+
}
97158
}
98159

99160
public function jump(entity:IMovable, newPosition:MapPoint) : void {

com/ankamagames/atouin/renderers/TrapZoneRenderer.as

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,85 @@ package com.ankamagames.atouin.renderers
2323

2424
public var strata:uint;
2525

26-
public function render(cells:Vector.<uint>, oColor:Color, mapContainer:DataMapContainer, alpha:Boolean = false, updateStrata:Boolean = false) : void {
27-
/*
28-
* Decompilation error
29-
* Code may be obfuscated
30-
* Error type: TranslateException
31-
*/
32-
throw new IllegalOperationError("Not decompiled due to error");
26+
public function render(cells:Vector.<uint>, oColor:Color, mapContainer:DataMapContainer, alpha:Boolean=false, updateStrata:Boolean=false) : void {
27+
var tzt:TrapZoneTile = null;
28+
var daCellId:uint = 0;
29+
var daPoint:MapPoint = null;
30+
var zzTop:* = false;
31+
var zzBottom:* = false;
32+
var zzRight:* = false;
33+
var zzLeft:* = false;
34+
var cid:uint = 0;
35+
var mp:MapPoint = null;
36+
var j:int = 0;
37+
while(j < cells.length)
38+
{
39+
if(!this._aZoneTile[j])
40+
{
41+
this._aZoneTile[j] = tzt = new TrapZoneTile();
42+
tzt.mouseChildren = false;
43+
tzt.mouseEnabled = false;
44+
tzt.strata = this.strata;
45+
tzt.filters = [new ColorMatrixFilter([0,0,0,0,oColor.red,0,0,0,0,oColor.green,0,0,0,0,oColor.blue,0,0,0,0.7,0])];
46+
}
47+
this._aCellTile[j] = cells[j];
48+
daCellId = cells[j];
49+
daPoint = MapPoint.fromCellId(daCellId);
50+
TrapZoneTile(this._aZoneTile[j]).cellId = daCellId;
51+
zzTop = false;
52+
zzBottom = false;
53+
zzRight = false;
54+
zzLeft = false;
55+
for each (cid in cells)
56+
{
57+
if(cid != daCellId)
58+
{
59+
mp = MapPoint.fromCellId(cid);
60+
if(mp.x == daPoint.x)
61+
{
62+
if(mp.y == daPoint.y - 1)
63+
{
64+
zzTop = true;
65+
}
66+
else
67+
{
68+
if(mp.y == daPoint.y + 1)
69+
{
70+
zzBottom = true;
71+
}
72+
}
73+
}
74+
else
75+
{
76+
if(mp.y == daPoint.y)
77+
{
78+
if(mp.x == daPoint.x - 1)
79+
{
80+
zzRight = true;
81+
}
82+
else
83+
{
84+
if(mp.x == daPoint.x + 1)
85+
{
86+
zzLeft = true;
87+
}
88+
}
89+
}
90+
}
91+
}
92+
}
93+
TrapZoneTile(this._aZoneTile[j]).drawStroke(zzTop,zzRight,zzBottom,zzLeft);
94+
TrapZoneTile(this._aZoneTile[j]).display(this.strata);
95+
j++;
96+
}
97+
while(j < this._aZoneTile.length)
98+
{
99+
if(this._aZoneTile[j])
100+
{
101+
(this._aZoneTile[j] as TrapZoneTile).remove();
102+
}
103+
j++;
104+
}
33105
}
34106

35107
public function remove(cells:Vector.<uint>, mapContainer:DataMapContainer) : void {

com/ankamagames/atouin/renderers/ZoneDARenderer.as

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,43 @@ package com.ankamagames.atouin.renderers
5656

5757
public var currentStrata:uint = 0;
5858

59-
public function render(cells:Vector.<uint>, oColor:Color, mapContainer:DataMapContainer, bAlpha:Boolean = false, updateStrata:Boolean = false) : void {
60-
/*
61-
* Decompilation error
62-
* Code may be obfuscated
63-
* Error type: TranslateException
64-
*/
65-
throw new IllegalOperationError("Not decompiled due to error");
59+
public function render(cells:Vector.<uint>, oColor:Color, mapContainer:DataMapContainer, bAlpha:Boolean=false, updateStrata:Boolean=false) : void {
60+
var j:* = 0;
61+
var zt:ZoneTile = null;
62+
var ct:ColorTransform = null;
63+
this._cells = cells;
64+
var num:int = cells.length;
65+
j = 0;
66+
while(j < num)
67+
{
68+
zt = this._aZoneTile[j];
69+
if(!zt)
70+
{
71+
zt = getZoneTile();
72+
this._aZoneTile[j] = zt;
73+
zt.strata = this.currentStrata;
74+
ct = new ColorTransform();
75+
zt.color = oColor.color;
76+
}
77+
this._aCellTile[j] = cells[j];
78+
zt.cellId = cells[j];
79+
zt.text = this.getText(j);
80+
if((updateStrata) || (!(EntitiesDisplayManager.getInstance()._dStrataRef[zt] == this.currentStrata)))
81+
{
82+
zt.strata = EntitiesDisplayManager.getInstance()._dStrataRef[zt] = this.currentStrata;
83+
}
84+
zt.display();
85+
j++;
86+
}
87+
while(j < num)
88+
{
89+
zt = this._aZoneTile[j];
90+
if(zt)
91+
{
92+
destroyZoneTile(zt);
93+
}
94+
j++;
95+
}
6696
}
6797

6898
protected function getText(count:int) : String {

0 commit comments

Comments
 (0)