Created
July 30, 2015 20:02
-
-
Save t81lal/d862a29bc354805e1ae3 to your computer and use it in GitHub Desktop.
Projectile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Projectile extends Renderable { | |
public int radius; | |
public int startX; | |
public int startY; | |
public int modelHeight; | |
public int endHeight; | |
public int delay; | |
public int endCycle; | |
public double speed; | |
public int id; | |
public int targetIndex; | |
public boolean moving = false; | |
public double currentX; | |
public double currentY; | |
public double currentZ; | |
public double speedX; | |
public double speedY; | |
public int slope; | |
public static int[] ag; | |
public int frameCycle = 0; | |
public int rotationX; | |
public double speedZ; | |
public ae animation; | |
public int currentFrame = 0; | |
public int sceneId; | |
public int rotationY; | |
public double heightStep; | |
final void n(int var1, int var2, int var3, int var4) { | |
double var6; | |
if(!this.moving) { | |
var6 = (double)(var1 - this.startX); | |
double var8 = (double)(var2 - this.startY); | |
double var10 = Math.sqrt(var8 * var8 + var6 * var6); | |
this.currentX = (double)this.radius * var6 / var10 + (double)this.startX; | |
this.currentY = (double)this.startY + (double)this.radius * var8 / var10; | |
this.currentZ = (double)this.modelHeight; | |
} | |
var6 = (double)(842604711 + this.endCycle - var4); | |
this.speedX = ((double)var1 - this.currentX) / var6; | |
this.speedY = ((double)var2 - this.currentY) / var6; | |
this.speed = Math.sqrt(this.speedY * this.speedY + this.speedX * this.speedX); | |
if(!this.moving) { | |
this.speedZ = -this.speed * Math.tan(0.02454369D * (double)this.slope); | |
} | |
this.heightStep = ((double)var3 - this.currentZ - this.speedZ * var6) * 2.0D / (var6 * var6); | |
} | |
static final void bh(int var0, int var1) { | |
int var3 = fc.cp.w(ew.eo); | |
int var4; | |
for(var4 = 0; var4 < Client.menuSize; ++var4) { | |
he var5 = fc.cp; | |
String var6; | |
if(Client.menuOptions[var4].length() > 0) { | |
var6 = Client.menuActions[var4] + ew.fl + Client.menuOptions[var4]; | |
} else { | |
var6 = Client.menuActions[var4]; | |
} | |
int var7 = var5.w(var6); | |
if(var7 > var3) { | |
var3 = var7; | |
} | |
} | |
var3 += 8; | |
var4 = 22 + Client.menuSize * 15; | |
int var8 = var0 - var3 / 2; | |
if(var8 + var3 > aq.qx) { | |
var8 = aq.qx - var3; | |
} | |
if(var8 < 0) { | |
var8 = 0; | |
} | |
int var9 = var1; | |
if(var1 + var4 > dj.qq) { | |
var9 = dj.qq - var4; | |
} | |
if(var9 < 0) { | |
var9 = 0; | |
} | |
Client.menuOpen = true; | |
b.hi = var8; | |
z.hs = var9; | |
an.hr = var3; | |
Actor.ih = Client.menuSize * 15 + 22; | |
} | |
protected final Model o(int var1) { | |
int var10001 = -1293798415; | |
ay var2 = s.o(this.id); | |
int var10002 = 1298418401; | |
Model var3 = var2.m(this.currentFrame); | |
if(null == var3) { | |
return null; | |
} else { | |
var3.b(this.rotationY); | |
return var3; | |
} | |
} | |
protected final Model w() { | |
int var10001 = 1643518612; | |
ay var1 = s.o(this.id); | |
int var10002 = 288393401; | |
Model var2 = var1.m(this.currentFrame); | |
if(null == var2) { | |
return null; | |
} else { | |
var2.b(this.rotationY); | |
return var2; | |
} | |
} | |
Projectile(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11) { | |
this.id = var1; | |
this.sceneId = var2; | |
this.startX = var3; | |
this.startY = var4; | |
this.modelHeight = var5; | |
this.delay = var6; | |
this.endCycle = var7; | |
this.slope = var8; | |
this.radius = var9; | |
this.targetIndex = var10; | |
this.endHeight = var11; | |
this.moving = false; | |
int var10001 = -2100047000; | |
int var12 = s.o(this.id).i; | |
if(var12 != -1) { | |
int var10002 = -1893464424; | |
this.animation = at.o(var12); | |
} else { | |
this.animation = null; | |
} | |
} | |
final void a(int var1) { | |
this.moving = true; | |
this.currentX += (double)var1 * this.speedX; | |
this.currentY += this.speedY * (double)var1; | |
this.currentZ += (double)var1 * 0.5D * this.heightStep * (double)var1 + (double)var1 * this.speedZ; | |
this.speedZ += this.heightStep * (double)var1; | |
this.rotationX = (int)(Math.atan2(this.speedX, this.speedY) * 325.949D) - 486937600 & 2047; | |
this.rotationY = (int)(Math.atan2(this.speedZ, this.speed) * 325.949D) & 2047; | |
if(null != this.animation) { | |
this.frameCycle += var1; | |
while(true) { | |
do { | |
do { | |
if(this.frameCycle <= this.animation.r[this.currentFrame]) { | |
return; | |
} | |
this.frameCycle -= this.animation.r[this.currentFrame * 630133039]; | |
this.currentFrame -= -1; | |
} while(this.currentFrame < this.animation.h.length); | |
this.currentFrame -= this.animation.f; | |
} while(this.currentFrame >= 0 && this.currentFrame < this.animation.h.length); | |
this.currentFrame = 0; | |
} | |
} | |
} | |
public static di n(int var0) { | |
di[] var2 = new di[]{di.o, di.a, di.n}; | |
di[] var3 = var2; | |
for(int var4 = 0; var4 < var3.length; ++var4) { | |
di var5 = var3[var4]; | |
if(var0 == var5.w) { | |
return var5; | |
} | |
} | |
return null; | |
} | |
static Widget dk(Widget var0) { | |
boolean var10001 = true; | |
int var10000 = fg.dt(var0); | |
int var4 = 814910598; | |
int var2 = Widget.o(var10000); | |
if(0 == var2) { | |
return null; | |
} else { | |
for(int var3 = 0; var3 < var2; ++var3) { | |
var10001 = true; | |
var0 = x.o(var0.parentId); | |
if(null == var0) { | |
return null; | |
} | |
} | |
return var0; | |
} | |
} | |
static final void bg(int var0, int var1, int var2, int var3) { | |
for(int var5 = 0; var5 < Client.lj; ++var5) { | |
if(Client.ls[var5] + Client.widgetPositionsX[var5] > var0 && Client.ls[var5] < var0 + var2 && Client.widgetPositionsY[var5] + Client.ld[var5] > var1 && Client.ld[var5] < var3 + var1) { | |
Client.lx[var5] = true; | |
} | |
} | |
} | |
static final int z(int var0, int var1) { | |
int var10000 = var0 + '\ub135'; | |
int var10001 = var1 + 91923; | |
int var10003 = -1523902894; | |
var10000 = at.v(var10000, var10001, 4) - 128; | |
var10001 = 10294 + var0; | |
int var10002 = '\u93bd' + var1; | |
int var10004 = 2002666547; | |
var10000 += at.v(var10001, var10002, 2) - 128 >> 1; | |
var10004 = 1280790781; | |
int var3 = var10000 + (at.v(var0, var1, 1) - 128 >> 2); | |
var3 = (int)((double)var3 * 0.3D) + 35; | |
if(var3 < 10) { | |
var3 = 10; | |
} else if(var3 > 60) { | |
var3 = 60; | |
} | |
return var3; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment