Seq#walk/idleStyle, general seq renaming, #9

This commit is contained in:
thedaneeffect committed 2022-09-04 16:53:35 -06:00
1 parent eff4f46c11
commit baa85e7454
6 files changed
+447 -387

No files matched your search

+343 -312
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -6,10 +6,10 @@ public class MouseRecorder implements Runnable {
public final Object lock = new Object();
public final Game aGame805;
public final int[] anIntArray807 = new int[500];
public final int[] anIntArray809 = new int[500];
public final int[] y = new int[500];
public final int[] x = new int[500];
public boolean aBoolean808 = true;
public int anInt810;
public int length;
public MouseRecorder(Game game1) {
aGame805 = game1;
@@ -19,10 +19,10 @@ public class MouseRecorder implements Runnable {
public void run() {
while (aBoolean808) {
synchronized (lock) {
if (anInt810 < 500) {
anIntArray809[anInt810] = aGame805.mouseX;
anIntArray807[anInt810] = aGame805.mouseY;
anInt810++;
if (length < 500) {
x[length] = aGame805.mouseX;
y[length] = aGame805.mouseY;
length++;
}
}
try {
+2 -2
View File
@@ -10,10 +10,10 @@ public class NPCEntity extends PathingEntity {
}
public Model getSequencedModel() {
if ((super.primarySeqID >= 0) && (super.anInt1529 == 0)) {
if ((super.primarySeqID >= 0) && (super.primarySeqDelay == 0)) {
int primaryTransformID = SeqType.instances[super.primarySeqID].transformIndices[super.primarySeqFrame];
int secondaryTransformID = -1;
if ((super.secondarySeqID >= 0) && (super.secondarySeqID != super.seqStand)) {
if ((super.secondarySeqID >= 0) && (super.secondarySeqID != super.seqStandID)) {
secondaryTransformID = SeqType.instances[super.secondarySeqID].transformIndices[super.secondarySeqFrame];
}
return type.getSequencedModel(secondaryTransformID, primaryTransformID, SeqType.instances[super.primarySeqID].mask);
+28 -28
View File
@@ -11,29 +11,29 @@ public class PathingEntity extends Entity {
public final int[] damageCycle = new int[4];
public final boolean[] pathRunning = new boolean[10];
public int index = -1;
public int anInt1503;
public int seqTrigger;
public int turnSpeed = 32;
public int seqRun = -1;
public int seqRunID = -1;
public String chat;
public int height = 200;
public int dstYaw;
public int seqStand = -1;
public int seqTurn = -1;
public int seqStandID = -1;
public int seqTurnID = -1;
public int chatColor;
public int secondarySeqID = -1;
public int secondarySeqFrame;
public int seqCycle;
public int secondarySeqCycle;
public int spotanim = -1;
public int spotanimFrame;
public int spotanimCycle;
public int anInt1523;
public int spotanimY;
public int pathRemaining;
public int pathLength;
public int primarySeqID = -1;
public int primarySeqFrame;
public int anInt1528;
public int anInt1529;
public int anInt1530;
public int primarySeqCycle;
public int primarySeqDelay;
public int primarySeqLoop;
public int chatStyle;
public int combatCycle = -1000;
public int health;
@@ -44,7 +44,7 @@ public class PathingEntity extends Entity {
public int faceTileZ;
public int size = 1;
public boolean aBoolean1541 = false;
public int anInt1542;
public int seqPathLength;
public int forceMoveStartSceneTileX;
public int forceMoveEndSceneTileX;
public int forceMoveStartSceneTileZ;
@@ -55,16 +55,16 @@ public class PathingEntity extends Entity {
public int x;
public int z;
public int yaw;
public int seqWalk = -1;
public int seqTurnAround = -1;
public int seqTurnLeft = -1;
public int seqTurnRight = -1;
public int seqWalkID = -1;
public int seqTurnAroundID = -1;
public int seqTurnLeftID = -1;
public int seqTurnRightID = -1;
public PathingEntity() {
}
public void move(int x, int z, boolean teleport) {
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].anInt364 == 1)) {
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].idleStyle == 1)) {
primarySeqID = -1;
}
if (!teleport) {
@@ -72,11 +72,11 @@ public class PathingEntity extends Entity {
int dz = z - pathTileZ[0];
if ((dx >= -8) && (dx <= 8) && (dz >= -8) && (dz <= 8)) {
if (pathRemaining < 9) {
pathRemaining++;
if (pathLength < 9) {
pathLength++;
}
for (int i = pathRemaining; i > 0; i--) {
for (int i = pathLength; i > 0; i--) {
pathTileX[i] = pathTileX[i - 1];
pathTileZ[i] = pathTileZ[i - 1];
pathRunning[i] = pathRunning[i - 1];
@@ -88,18 +88,18 @@ public class PathingEntity extends Entity {
return;
}
}
pathRemaining = 0;
anInt1542 = 0;
anInt1503 = 0;
pathLength = 0;
seqPathLength = 0;
seqTrigger = 0;
pathTileX[0] = x;
pathTileZ[0] = z;
this.x = (pathTileX[0] * 128) + (size * 64);
this.z = (pathTileZ[0] * 128) + (size * 64);
}
public void method446() {
pathRemaining = 0;
anInt1542 = 0;
public void resetPath() {
pathLength = 0;
seqPathLength = 0;
}
public void method447(int j, int k, int l) {
@@ -144,13 +144,13 @@ public class PathingEntity extends Entity {
j++;
k--;
}
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].anInt364 == 1)) {
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].idleStyle == 1)) {
primarySeqID = -1;
}
if (pathRemaining < 9) {
pathRemaining++;
if (pathLength < 9) {
pathLength++;
}
for (int l = pathRemaining; l > 0; l--) {
for (int l = pathLength; l > 0; l--) {
pathTileX[l] = pathTileX[l - 1];
pathTileZ[l] = pathTileZ[l - 1];
pathRunning[l] = pathRunning[l - 1];
+24 -24
View File
@@ -156,33 +156,33 @@ public class PlayerEntity extends PathingEntity {
colors[part] = color;
}
super.seqStand = buffer.get2U();
if (super.seqStand == 65535) {
super.seqStand = -1;
super.seqStandID = buffer.get2U();
if (super.seqStandID == 65535) {
super.seqStandID = -1;
}
super.seqTurn = buffer.get2U();
if (super.seqTurn == 65535) {
super.seqTurn = -1;
super.seqTurnID = buffer.get2U();
if (super.seqTurnID == 65535) {
super.seqTurnID = -1;
}
super.seqWalk = buffer.get2U();
if (super.seqWalk == 65535) {
super.seqWalk = -1;
super.seqWalkID = buffer.get2U();
if (super.seqWalkID == 65535) {
super.seqWalkID = -1;
}
super.seqTurnAround = buffer.get2U();
if (super.seqTurnAround == 65535) {
super.seqTurnAround = -1;
super.seqTurnAroundID = buffer.get2U();
if (super.seqTurnAroundID == 65535) {
super.seqTurnAroundID = -1;
}
super.seqTurnLeft = buffer.get2U();
if (super.seqTurnLeft == 65535) {
super.seqTurnLeft = -1;
super.seqTurnLeftID = buffer.get2U();
if (super.seqTurnLeftID == 65535) {
super.seqTurnLeftID = -1;
}
super.seqTurnRight = buffer.get2U();
if (super.seqTurnRight == 65535) {
super.seqTurnRight = -1;
super.seqTurnRightID = buffer.get2U();
if (super.seqTurnRightID == 65535) {
super.seqTurnRightID = -1;
}
super.seqRun = buffer.get2U();
if (super.seqRun == 65535) {
super.seqRun = -1;
super.seqRunID = buffer.get2U();
if (super.seqRunID == 65535) {
super.seqRunID = -1;
}
name = StringUtil.formatName(StringUtil.fromBase37(buffer.get8()));
combatLevel = buffer.get1U();
@@ -218,7 +218,7 @@ public class PlayerEntity extends PathingEntity {
public Model getSequencedModel() {
if (npcType != null) {
int transformID = -1;
if ((super.primarySeqID >= 0) && (super.anInt1529 == 0)) {
if ((super.primarySeqID >= 0) && (super.primarySeqDelay == 0)) {
transformID = SeqType.instances[super.primarySeqID].transformIndices[super.primarySeqFrame];
} else if (super.secondarySeqID >= 0) {
transformID = SeqType.instances[super.secondarySeqID].transformIndices[super.secondarySeqFrame];
@@ -232,11 +232,11 @@ public class PlayerEntity extends PathingEntity {
int rightHandValue = -1;
int leftHandValue = -1;
if ((super.primarySeqID >= 0) && (super.anInt1529 == 0)) {
if ((super.primarySeqID >= 0) && (super.primarySeqDelay == 0)) {
SeqType type = SeqType.instances[super.primarySeqID];
primaryTransformID = type.transformIndices[super.primarySeqFrame];
if ((super.secondarySeqID >= 0) && (super.secondarySeqID != super.seqStand)) {
if ((super.secondarySeqID >= 0) && (super.secondarySeqID != super.seqStandID)) {
secondaryTransformID = SeqType.instances[super.secondarySeqID].transformIndices[super.secondarySeqFrame];
}
+43 -14
View File
@@ -38,10 +38,39 @@ public class SeqType {
public int priority = 5;
public int rightHandOverride = -1;
public int leftHandOverride = -1;
public int anInt362 = 99;
public int anInt363 = -1;
public int anInt364 = -1;
public int anInt365 = 2;
public int loopCount = 99;
/**
* If 0, causes faster movement, allows looking at target
* If 1, pause while moving
* If 2, does not look at target, continues playing during movement
* @see Game#updateMovement(PathingEntity)
*/
public int moveStyle = -1;
/**
* If 0, allows looking at a target
* If 1, stops playing on move
* If 2, does not look at target, continues playing during movement
* @see Game#updateMovement(PathingEntity)
*/
public int idleStyle = -1;
/**
* Restarts the sequence when played in a NPC/Player mask.
*/
public static final int REPLAY_STYLE_RESTART = 1;
/**
* Does not restart the sequence.
*/
public static final int REPLAY_STYLE_CONTINUE = 2;
/**
* Describes how the seq should act if played while already active.
*/
public int replayStyle = REPLAY_STYLE_CONTINUE;
public int unusedInt;
public SeqType() {
@@ -100,13 +129,13 @@ public class SeqType {
} else if (op == 7) {
leftHandOverride = buffer.get2U();
} else if (op == 8) {
anInt362 = buffer.get1U();
loopCount = buffer.get1U();
} else if (op == 9) {
anInt363 = buffer.get1U();
moveStyle = buffer.get1U();
} else if (op == 10) {
anInt364 = buffer.get1U();
idleStyle = buffer.get1U();
} else if (op == 11) {
anInt365 = buffer.get1U();
replayStyle = buffer.get1U();
} else if (op == 12) {
unusedInt = buffer.get4();
} else {
@@ -124,20 +153,20 @@ public class SeqType {
frameDelays[0] = -1;
}
if (anInt363 == -1) {
if (moveStyle == -1) {
if (mask != null) {
anInt363 = 2;
moveStyle = 2;
} else {
anInt363 = 0;
moveStyle = 0;
}
}
if (anInt364 == -1) {
if (idleStyle == -1) {
if (mask != null) {
anInt364 = 2;
idleStyle = 2;
return;
}
anInt364 = 0;
idleStyle = 0;
}
}