Merge pull request #2658 from ThatGamerBlue/ext-player-debug
api: add methods for extended player dev tools
This commit is contained in:
@@ -246,4 +246,33 @@ public interface Actor extends Entity, Locatable
|
||||
*/
|
||||
int getActionFrame();
|
||||
int getActionFrameCycle();
|
||||
|
||||
/*
|
||||
This collection of methods gets extended debug information about the actor
|
||||
|
||||
Used by dev tools
|
||||
*/
|
||||
|
||||
int getIdleAnimation();
|
||||
|
||||
int getTurnLeftAnimation();
|
||||
|
||||
int getTurnRightAnimation();
|
||||
|
||||
int getWalkAnimation();
|
||||
|
||||
int getWalkBackAnimation();
|
||||
|
||||
int getWalkLeftAnimation();
|
||||
|
||||
int getWalkRightAnimation();
|
||||
|
||||
int getRunAnimation();
|
||||
|
||||
/**
|
||||
* This gets used for drawing the correct animation.
|
||||
*
|
||||
* The client moves one of the other animation fields into this field based off the actor's state
|
||||
*/
|
||||
int getMovementAnimation();
|
||||
}
|
||||
|
||||
@@ -45,4 +45,16 @@ public class Point
|
||||
{
|
||||
return (int) Math.hypot(getX() - other.getX(), getY() - other.getY());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new point offset by xOff and yOff
|
||||
*
|
||||
* @param xOff X offset to apply
|
||||
* @param yOff Y offset to apply
|
||||
* @return A new instance of Point, offset by x + xOff and y + yOff
|
||||
*/
|
||||
public Point offset(int xOff, int yOff)
|
||||
{
|
||||
return new Point(x + xOff, y + yOff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
|
||||
* Copyright (c) 2020, ThatGamerBlue <thatgamerblue@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -101,7 +102,7 @@ public interface RSActor extends RSEntity, Actor
|
||||
|
||||
// Idle animation
|
||||
|
||||
@Import("readySequence")
|
||||
@Import("idleSequence")
|
||||
@Override
|
||||
void setIdlePoseAnimation(int animation);
|
||||
|
||||
@@ -145,4 +146,40 @@ public interface RSActor extends RSEntity, Actor
|
||||
|
||||
@Import("hitSplatCycles")
|
||||
int[] getHitsplatCycles();
|
||||
|
||||
@Import("idleSequence")
|
||||
@Override
|
||||
int getIdleAnimation();
|
||||
|
||||
@Import("turnLeftSequence")
|
||||
@Override
|
||||
int getTurnLeftAnimation();
|
||||
|
||||
@Import("turnRightSequence")
|
||||
@Override
|
||||
int getTurnRightAnimation();
|
||||
|
||||
@Import("walkSequence")
|
||||
@Override
|
||||
int getWalkAnimation();
|
||||
|
||||
@Import("walkBackSequence")
|
||||
@Override
|
||||
int getWalkBackAnimation();
|
||||
|
||||
@Import("walkLeftSequence")
|
||||
@Override
|
||||
int getWalkLeftAnimation();
|
||||
|
||||
@Import("walkRightSequence")
|
||||
@Override
|
||||
int getWalkRightAnimation();
|
||||
|
||||
@Import("runSequence")
|
||||
@Override
|
||||
int getRunAnimation();
|
||||
|
||||
@Import("movementSequence")
|
||||
@Override
|
||||
int getMovementAnimation();
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ public abstract class Actor extends Entity {
|
||||
@ObfuscatedGetter(
|
||||
intValue = 399800473
|
||||
)
|
||||
@Export("readySequence")
|
||||
int readySequence;
|
||||
@Export("idleSequence")
|
||||
int idleSequence;
|
||||
@ObfuscatedName("am")
|
||||
@ObfuscatedGetter(
|
||||
intValue = -684262003
|
||||
@@ -318,7 +318,7 @@ public abstract class Actor extends Entity {
|
||||
Actor() {
|
||||
this.isWalking = false;
|
||||
this.field976 = 1;
|
||||
this.readySequence = -1;
|
||||
this.idleSequence = -1;
|
||||
this.turnLeftSequence = -1;
|
||||
this.turnRightSequence = -1;
|
||||
this.walkSequence = -1;
|
||||
|
||||
@@ -658,7 +658,7 @@ public class ClientPacket implements class190 {
|
||||
garbageValue = "135896742"
|
||||
)
|
||||
static final void method3686(Actor var0) {
|
||||
var0.movementSequence = var0.readySequence;
|
||||
var0.movementSequence = var0.idleSequence;
|
||||
if (var0.pathLength == 0) {
|
||||
var0.field1031 = 0;
|
||||
} else {
|
||||
|
||||
@@ -256,7 +256,7 @@ public class GrandExchangeOffer {
|
||||
var4.walkBackSequence = var4.definition.walkBackSequence;
|
||||
var4.walkLeftSequence = var4.definition.walkLeftSequence;
|
||||
var4.walkRightSequence = var4.definition.walkRightSequence;
|
||||
var4.readySequence = var4.definition.readySequence;
|
||||
var4.idleSequence = var4.definition.idleSequence;
|
||||
var4.turnLeftSequence = var4.definition.turnLeftSequence;
|
||||
var4.turnRightSequence = var4.definition.turnRightSequence;
|
||||
var4.method2136(ByteArrayPool.localPlayer.pathX[0] + var9, ByteArrayPool.localPlayer.pathY[0] + var5, var7 == 1);
|
||||
|
||||
@@ -137,7 +137,7 @@ public final class NPC extends Actor {
|
||||
return null;
|
||||
} else {
|
||||
SequenceDefinition var1 = super.sequence != -1 && super.sequenceDelay == 0 ? SpotAnimationDefinition.SequenceDefinition_get(super.sequence) : null;
|
||||
SequenceDefinition var2 = super.movementSequence != -1 && (super.readySequence != super.movementSequence || var1 == null) ? SpotAnimationDefinition.SequenceDefinition_get(super.movementSequence) : null;
|
||||
SequenceDefinition var2 = super.movementSequence != -1 && (super.idleSequence != super.movementSequence || var1 == null) ? SpotAnimationDefinition.SequenceDefinition_get(super.movementSequence) : null;
|
||||
Model var3 = this.definition.getModel(var1, super.sequenceFrame, var2, super.movementFrame);
|
||||
if (var3 == null) {
|
||||
return null;
|
||||
|
||||
@@ -55,8 +55,8 @@ public class NPCDefinition extends DualNode {
|
||||
@ObfuscatedGetter(
|
||||
intValue = -1727903795
|
||||
)
|
||||
@Export("readySequence")
|
||||
public int readySequence;
|
||||
@Export("idleSequence")
|
||||
public int idleSequence;
|
||||
@ObfuscatedName("s")
|
||||
@ObfuscatedGetter(
|
||||
intValue = 1188737805
|
||||
@@ -195,7 +195,7 @@ public class NPCDefinition extends DualNode {
|
||||
NPCDefinition() {
|
||||
this.name = "null";
|
||||
this.size = 1;
|
||||
this.readySequence = -1;
|
||||
this.idleSequence = -1;
|
||||
this.turnLeftSequence = -1;
|
||||
this.turnRightSequence = -1;
|
||||
this.walkSequence = -1;
|
||||
@@ -266,7 +266,7 @@ public class NPCDefinition extends DualNode {
|
||||
} else if (var2 == 12) {
|
||||
this.size = var1.readUnsignedByte();
|
||||
} else if (var2 == 13) {
|
||||
this.readySequence = var1.readUnsignedShort();
|
||||
this.idleSequence = var1.readUnsignedShort();
|
||||
} else if (var2 == 14) {
|
||||
this.walkSequence = var1.readUnsignedShort();
|
||||
} else if (var2 == 15) {
|
||||
|
||||
@@ -227,9 +227,9 @@ public final class Player extends Actor {
|
||||
var9[var6] = var7;
|
||||
}
|
||||
|
||||
super.readySequence = var1.readUnsignedShort();
|
||||
if (super.readySequence == 65535) {
|
||||
super.readySequence = -1;
|
||||
super.idleSequence = var1.readUnsignedShort();
|
||||
if (super.idleSequence == 65535) {
|
||||
super.idleSequence = -1;
|
||||
}
|
||||
|
||||
super.turnLeftSequence = var1.readUnsignedShort();
|
||||
@@ -373,7 +373,7 @@ public final class Player extends Actor {
|
||||
return null;
|
||||
} else {
|
||||
SequenceDefinition var1 = super.sequence != -1 && super.sequenceDelay == 0 ? SpotAnimationDefinition.SequenceDefinition_get(super.sequence) : null;
|
||||
SequenceDefinition var2 = super.movementSequence == -1 || this.isUnanimated || super.readySequence == super.movementSequence && var1 != null ? null : SpotAnimationDefinition.SequenceDefinition_get(super.movementSequence);
|
||||
SequenceDefinition var2 = super.movementSequence == -1 || this.isUnanimated || super.idleSequence == super.movementSequence && var1 != null ? null : SpotAnimationDefinition.SequenceDefinition_get(super.movementSequence);
|
||||
Model var3 = this.appearance.getModel(var1, super.sequenceFrame, var2, super.movementFrame);
|
||||
if (var3 == null) {
|
||||
return null;
|
||||
|
||||
@@ -304,7 +304,7 @@ public class WorldMapSection0 implements WorldMapSection {
|
||||
var3.walkBackSequence = var3.definition.walkBackSequence;
|
||||
var3.walkLeftSequence = var3.definition.walkLeftSequence;
|
||||
var3.walkRightSequence = var3.definition.walkRightSequence;
|
||||
var3.readySequence = var3.definition.readySequence;
|
||||
var3.idleSequence = var3.definition.idleSequence;
|
||||
var3.turnLeftSequence = var3.definition.turnLeftSequence;
|
||||
var3.turnRightSequence = var3.definition.turnRightSequence;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ public class class22 {
|
||||
static void addPlayerToScene(Player var0, boolean var1) {
|
||||
if (var0 != null && var0.isVisible() && !var0.isHidden) {
|
||||
var0.isUnanimated = false;
|
||||
if ((Client.isLowDetail && Players.Players_count > 50 || Players.Players_count > 200) && var1 && var0.movementSequence == var0.readySequence) {
|
||||
if ((Client.isLowDetail && Players.Players_count > 50 || Players.Players_count > 200) && var1 && var0.movementSequence == var0.idleSequence) {
|
||||
var0.isUnanimated = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class class41 {
|
||||
var10 = false;
|
||||
}
|
||||
|
||||
if (var0.movementSequence == var0.readySequence && (var0.field1025 > 25 || var10)) {
|
||||
if (var0.movementSequence == var0.idleSequence && (var0.field1025 > 25 || var10)) {
|
||||
if (var0.turnLeftSequence != -1) {
|
||||
var0.movementSequence = var0.turnLeftSequence;
|
||||
} else {
|
||||
@@ -137,7 +137,7 @@ public class class41 {
|
||||
var10 = false;
|
||||
}
|
||||
|
||||
if (var0.movementSequence == var0.readySequence && (var0.field1025 > 25 || var10)) {
|
||||
if (var0.movementSequence == var0.idleSequence && (var0.field1025 > 25 || var10)) {
|
||||
if (var0.turnRightSequence != -1) {
|
||||
var0.movementSequence = var0.turnRightSequence;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user