mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2026-08-17 08:25:14 -06:00
Refactored some anim/area sound classes
This commit is contained in:
parent
dbca509eb5
commit
fd3572f709
108 changed files with 1063 additions and 1078 deletions
|
|
@ -1,100 +1,141 @@
|
|||
package rt4;
|
||||
|
||||
import org.openrs2.deob.annotation.OriginalClass;
|
||||
import org.openrs2.deob.annotation.OriginalMember;
|
||||
import org.openrs2.deob.annotation.Pc;
|
||||
|
||||
public class AttachLocRequest {
|
||||
@OriginalMember(owner = "client!ph", name = "a", descriptor = "(B)V")
|
||||
public static void loop() {
|
||||
while (true) {
|
||||
@Pc(17) AttachLocRequest_Class3_Sub8 local17 = (AttachLocRequest_Class3_Sub8) Static128.aClass69_77.removeHead();
|
||||
if (local17 == null) {
|
||||
return;
|
||||
}
|
||||
@Pc(40) PathingEntity local40;
|
||||
@Pc(29) int local29;
|
||||
if (local17.anInt1192 < 0) {
|
||||
local29 = -local17.anInt1192 - 1;
|
||||
if (local29 == PlayerList.selfId) {
|
||||
local40 = PlayerList.self;
|
||||
} else {
|
||||
local40 = PlayerList.players[local29];
|
||||
}
|
||||
} else {
|
||||
local29 = local17.anInt1192 - 1;
|
||||
local40 = NpcList.npcs[local29];
|
||||
}
|
||||
if (local40 != null) {
|
||||
@Pc(63) LocType local63 = LocTypeList.get(local17.anInt1189);
|
||||
if (Player.level < 3) {
|
||||
}
|
||||
@Pc(86) int local86;
|
||||
@Pc(83) int local83;
|
||||
if (local17.anInt1206 == 1 || local17.anInt1206 == 3) {
|
||||
local83 = local63.width;
|
||||
local86 = local63.length;
|
||||
} else {
|
||||
local86 = local63.width;
|
||||
local83 = local63.length;
|
||||
}
|
||||
@Pc(103) int local103 = (local86 + 1 >> 1) + local17.anInt1190;
|
||||
@Pc(110) int local110 = (local86 >> 1) + local17.anInt1190;
|
||||
@Pc(117) int local117 = (local83 >> 1) + local17.anInt1204;
|
||||
@Pc(126) int local126 = (local83 + 1 >> 1) + local17.anInt1204;
|
||||
@Pc(130) int[][] local130 = Static83.activeTileHeightMap[Player.level];
|
||||
@Pc(157) int local157 = local130[local103][local126] + local130[local110][local126] + local130[local110][local117] + local130[local103][local117] >> 2;
|
||||
@Pc(159) Entity local159 = null;
|
||||
@Pc(164) int local164 = Static133.anIntArray453[local17.anInt1198];
|
||||
if (local164 == 0) {
|
||||
@Pc(176) Wall local176 = Static262.method4509(Player.level, local17.anInt1190, local17.anInt1204);
|
||||
if (local176 != null) {
|
||||
local159 = local176.aClass8_5;
|
||||
}
|
||||
} else if (local164 == 1) {
|
||||
@Pc(231) WallDecor local231 = Static83.method435(Player.level, local17.anInt1190, local17.anInt1204);
|
||||
if (local231 != null) {
|
||||
local159 = local231.aClass8_3;
|
||||
}
|
||||
} else if (local164 == 2) {
|
||||
@Pc(198) Scenery local198 = Static133.method4008(Player.level, local17.anInt1190, local17.anInt1204);
|
||||
if (local198 != null) {
|
||||
local159 = local198.aClass8_4;
|
||||
}
|
||||
} else if (local164 == 3) {
|
||||
@Pc(216) GroundDecor local216 = Static269.method2210(Player.level, local17.anInt1190, local17.anInt1204);
|
||||
if (local216 != null) {
|
||||
local159 = local216.aClass8_1;
|
||||
}
|
||||
}
|
||||
if (local159 != null) {
|
||||
Static29.method800(Player.level, local17.anInt1204, 0, local17.anInt1190, local17.anInt1205 + 1, -1, local164, 0, local17.anInt1187 + 1);
|
||||
local40.anInt3375 = local17.anInt1205 + client.loop;
|
||||
local40.anInt3426 = local83 * 64 + local17.anInt1204 * 128;
|
||||
local40.anInt3379 = local86 * 64 + local17.anInt1190 * 128;
|
||||
local40.attachment = local159;
|
||||
@Pc(292) int local292 = local17.anInt1188;
|
||||
local40.anInt3406 = local157;
|
||||
local40.anInt3390 = client.loop + local17.anInt1187;
|
||||
@Pc(304) int local304 = local17.anInt1191;
|
||||
@Pc(307) int local307 = local17.anInt1197;
|
||||
@Pc(310) int local310 = local17.anInt1200;
|
||||
@Pc(316) int local316;
|
||||
if (local292 > local304) {
|
||||
local316 = local292;
|
||||
local292 = local304;
|
||||
local304 = local316;
|
||||
}
|
||||
local40.anInt3411 = local17.anInt1190 + local304;
|
||||
if (local307 > local310) {
|
||||
local316 = local307;
|
||||
local307 = local310;
|
||||
local310 = local316;
|
||||
}
|
||||
local40.anInt3374 = local17.anInt1204 + local307;
|
||||
local40.anInt3410 = local310 + local17.anInt1204;
|
||||
local40.anInt3384 = local17.anInt1190 + local292;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@OriginalClass("client!cn")
|
||||
public final class AttachLocRequest extends Node {
|
||||
|
||||
@OriginalMember(owner = "client!ka", name = "q", descriptor = "Lclient!ih;")
|
||||
public static final LinkedList queue = new LinkedList();
|
||||
@OriginalMember(owner = "client!cn", name = "p", descriptor = "I")
|
||||
public int anInt1187;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "r", descriptor = "I")
|
||||
public int anInt1188;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "t", descriptor = "I")
|
||||
public int locId;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "u", descriptor = "I")
|
||||
public int x;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "v", descriptor = "I")
|
||||
public int anInt1191;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "w", descriptor = "I")
|
||||
public int entityId;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "D", descriptor = "I")
|
||||
public int anInt1197;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "E", descriptor = "I")
|
||||
public int shape;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "H", descriptor = "I")
|
||||
public int anInt1200;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "M", descriptor = "I")
|
||||
public int z;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "N", descriptor = "I")
|
||||
public int anInt1205;
|
||||
|
||||
@OriginalMember(owner = "client!cn", name = "O", descriptor = "I")
|
||||
public int angle;
|
||||
|
||||
@OriginalMember(owner = "client!ph", name = "a", descriptor = "(B)V")
|
||||
public static void loop() {
|
||||
while (true) {
|
||||
@Pc(17) AttachLocRequest request = (AttachLocRequest) queue.removeHead();
|
||||
if (request == null) {
|
||||
return;
|
||||
}
|
||||
@Pc(40) PathingEntity entity;
|
||||
@Pc(29) int playerId;
|
||||
if (request.entityId < 0) {
|
||||
playerId = -request.entityId - 1;
|
||||
if (playerId == PlayerList.selfId) {
|
||||
entity = PlayerList.self;
|
||||
} else {
|
||||
entity = PlayerList.players[playerId];
|
||||
}
|
||||
} else {
|
||||
playerId = request.entityId - 1;
|
||||
entity = NpcList.npcs[playerId];
|
||||
}
|
||||
if (entity != null) {
|
||||
@Pc(63) LocType type = LocTypeList.get(request.locId);
|
||||
if (Player.level < 3) {
|
||||
}
|
||||
@Pc(86) int width;
|
||||
@Pc(83) int length;
|
||||
if (request.angle == 1 || request.angle == 3) {
|
||||
length = type.width;
|
||||
width = type.length;
|
||||
} else {
|
||||
width = type.width;
|
||||
length = type.length;
|
||||
}
|
||||
@Pc(103) int centerX1 = (width + 1 >> 1) + request.x;
|
||||
@Pc(110) int centerX0 = (width >> 1) + request.x;
|
||||
@Pc(117) int centerZ0 = (length >> 1) + request.z;
|
||||
@Pc(126) int centerZ1 = (length + 1 >> 1) + request.z;
|
||||
@Pc(130) int[][] tileHeights = SceneGraph.activeTileHeightMap[Player.level];
|
||||
@Pc(157) int y = tileHeights[centerX1][centerZ1] + tileHeights[centerX0][centerZ1] + tileHeights[centerX0][centerZ0] + tileHeights[centerX1][centerZ0] >> 2;
|
||||
@Pc(159) Entity attachment = null;
|
||||
@Pc(164) int layer = Loc.LAYERS[request.shape];
|
||||
if (layer == 0) {
|
||||
@Pc(176) Wall wall = SceneGraph.getWall(Player.level, request.x, request.z);
|
||||
if (wall != null) {
|
||||
attachment = wall.primary;
|
||||
}
|
||||
} else if (layer == 1) {
|
||||
@Pc(231) WallDecor wallDecor = SceneGraph.getWallDecor(Player.level, request.x, request.z);
|
||||
if (wallDecor != null) {
|
||||
attachment = wallDecor.primary;
|
||||
}
|
||||
} else if (layer == 2) {
|
||||
@Pc(198) Scenery scenery = SceneGraph.getScenery(Player.level, request.x, request.z);
|
||||
if (scenery != null) {
|
||||
attachment = scenery.primary;
|
||||
}
|
||||
} else if (layer == 3) {
|
||||
@Pc(216) GroundDecor groundDecor = SceneGraph.getGroundDecor(Player.level, request.x, request.z);
|
||||
if (groundDecor != null) {
|
||||
attachment = groundDecor.primary;
|
||||
}
|
||||
}
|
||||
if (attachment != null) {
|
||||
ChangeLocRequest.push(Player.level, request.z, 0, request.x, request.anInt1205 + 1, -1, layer, 0, request.anInt1187 + 1);
|
||||
entity.anInt3375 = request.anInt1205 + client.loop;
|
||||
entity.attachmentZFine = length * 64 + request.z * 128;
|
||||
entity.attachmentXFine = width * 64 + request.x * 128;
|
||||
entity.attachment = attachment;
|
||||
@Pc(292) int x0Delta = request.anInt1188;
|
||||
entity.attachmentY = y;
|
||||
entity.anInt3390 = client.loop + request.anInt1187;
|
||||
@Pc(304) int x1Delta = request.anInt1191;
|
||||
@Pc(307) int z0Delta = request.anInt1197;
|
||||
@Pc(310) int z1Delta = request.anInt1200;
|
||||
@Pc(316) int temp;
|
||||
if (x0Delta > x1Delta) {
|
||||
temp = x0Delta;
|
||||
x0Delta = x1Delta;
|
||||
x1Delta = temp;
|
||||
}
|
||||
entity.attachmentX1 = request.x + x1Delta;
|
||||
if (z0Delta > z1Delta) {
|
||||
temp = z0Delta;
|
||||
z0Delta = z1Delta;
|
||||
z1Delta = temp;
|
||||
}
|
||||
entity.attachmentZ0 = request.z + z0Delta;
|
||||
entity.attachmentZ1 = z1Delta + request.z;
|
||||
entity.atachmentX0 = request.x + x0Delta;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue