Swapping attack tree to use unified animation obj
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
4b0064b761
commit
cc2ff6a93a
@ -133,26 +133,14 @@
|
|||||||
"nameThirdPerson" : "Jog",
|
"nameThirdPerson" : "Jog",
|
||||||
"priorityCategory" : "CORE_MOVEMENT"
|
"priorityCategory" : "CORE_MOVEMENT"
|
||||||
},
|
},
|
||||||
"animationFirstPersonStartup" : {
|
|
||||||
"nameFirstPerson" : "Jog",
|
|
||||||
"priorityCategory" : "CORE_MOVEMENT"
|
|
||||||
},
|
|
||||||
"animationLoop" : {
|
"animationLoop" : {
|
||||||
"nameThirdPerson" : "Jog",
|
"nameThirdPerson" : "Jog",
|
||||||
"priorityCategory" : "CORE_MOVEMENT"
|
"priorityCategory" : "CORE_MOVEMENT"
|
||||||
},
|
},
|
||||||
"animationFirstPersonLoop" : {
|
|
||||||
"nameFirstPerson" : "Jog",
|
|
||||||
"priorityCategory" : "CORE_MOVEMENT"
|
|
||||||
},
|
|
||||||
"animationWindDown" : {
|
"animationWindDown" : {
|
||||||
"nameThirdPerson" : "Jog",
|
"nameThirdPerson" : "Jog",
|
||||||
"priorityCategory" : "CORE_MOVEMENT"
|
"priorityCategory" : "CORE_MOVEMENT"
|
||||||
},
|
},
|
||||||
"animationFirstPersonWindDown" : {
|
|
||||||
"nameFirstPerson" : "Jog",
|
|
||||||
"priorityCategory" : "CORE_MOVEMENT"
|
|
||||||
},
|
|
||||||
"sprintSystem" : {
|
"sprintSystem" : {
|
||||||
"maxVelocity" : 0.058,
|
"maxVelocity" : 0.058,
|
||||||
"staminaMax" : 500,
|
"staminaMax" : 500,
|
||||||
@ -172,9 +160,6 @@
|
|||||||
"jumpForce" : 500,
|
"jumpForce" : 500,
|
||||||
"animationJump" : {
|
"animationJump" : {
|
||||||
"nameThirdPerson" : "Jump",
|
"nameThirdPerson" : "Jump",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
|
||||||
},
|
|
||||||
"animationFirstPersonJump" : {
|
|
||||||
"nameFirstPerson" : "Jump",
|
"nameFirstPerson" : "Jump",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
}
|
}
|
||||||
@ -331,7 +316,6 @@
|
|||||||
{
|
{
|
||||||
"attackMoveId" : "Sword1HSlash1",
|
"attackMoveId" : "Sword1HSlash1",
|
||||||
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
|
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
|
||||||
"attackAnimationName" : "Sword1HSlash1",
|
|
||||||
"windupFrames" : 5,
|
"windupFrames" : 5,
|
||||||
"attackFrames" : 5,
|
"attackFrames" : 5,
|
||||||
"cooldownFrames" : 25,
|
"cooldownFrames" : 25,
|
||||||
@ -345,23 +329,25 @@
|
|||||||
"driftFrameStart" : 7,
|
"driftFrameStart" : 7,
|
||||||
"driftFrameEnd" : 15,
|
"driftFrameEnd" : 15,
|
||||||
"initialMove" : true,
|
"initialMove" : true,
|
||||||
"animationFirstPersonWindup" : {
|
"animationWindup" : {
|
||||||
"nameFirstPerson" : "Jump",
|
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
|
||||||
},
|
|
||||||
"animationFirstPersonHold" : {
|
|
||||||
"nameFirstPerson" : "Jump",
|
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
|
||||||
},
|
|
||||||
"animationFirstPersonAttack" : {
|
|
||||||
"nameFirstPerson" : "Sword1HSlash1",
|
"nameFirstPerson" : "Sword1HSlash1",
|
||||||
|
"nameThirdPerson" : "Sword1HSlash1",
|
||||||
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
|
},
|
||||||
|
"animationHold" : {
|
||||||
|
"nameFirstPerson" : "Sword1HSlash1",
|
||||||
|
"nameThirdPerson" : "Sword1HSlash1",
|
||||||
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
|
},
|
||||||
|
"animationAttack" : {
|
||||||
|
"nameFirstPerson" : "Sword1HSlash1",
|
||||||
|
"nameThirdPerson" : "Sword1HSlash1",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"attackMoveId" : "Sword1HSlash2",
|
"attackMoveId" : "Sword1HSlash2",
|
||||||
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
|
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
|
||||||
"attackAnimationName" : "Sword1HSlash2",
|
|
||||||
"windupFrames" : 2,
|
"windupFrames" : 2,
|
||||||
"attackFrames" : 5,
|
"attackFrames" : 5,
|
||||||
"cooldownFrames" : 28,
|
"cooldownFrames" : 28,
|
||||||
@ -373,23 +359,25 @@
|
|||||||
"driftFrameStart" : 1,
|
"driftFrameStart" : 1,
|
||||||
"driftFrameEnd" : 10,
|
"driftFrameEnd" : 10,
|
||||||
"initialMove" : false,
|
"initialMove" : false,
|
||||||
"animationFirstPersonWindup" : {
|
"animationWindup" : {
|
||||||
"nameFirstPerson" : "Jump",
|
"nameFirstPerson" : "Jump",
|
||||||
|
"nameThirdPerson" : "Jump",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
},
|
},
|
||||||
"animationFirstPersonHold" : {
|
"animationHold" : {
|
||||||
"nameFirstPerson" : "Jump",
|
"nameFirstPerson" : "Jump",
|
||||||
|
"nameThirdPerson" : "Jump",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
},
|
},
|
||||||
"animationFirstPersonAttack" : {
|
"animationAttack" : {
|
||||||
"nameFirstPerson" : "Sword1HSlash2",
|
"nameFirstPerson" : "Sword1HSlash2",
|
||||||
|
"nameThirdPerson" : "Sword1HSlash2",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"attackMoveId" : "Sword2HSlash1",
|
"attackMoveId" : "Sword2HSlash1",
|
||||||
"type" : "MELEE_WEAPON_SWING_TWO_HAND",
|
"type" : "MELEE_WEAPON_SWING_TWO_HAND",
|
||||||
"attackAnimationName" : "SwordR2HSlash",
|
|
||||||
"windupFrames" : 2,
|
"windupFrames" : 2,
|
||||||
"attackFrames" : 5,
|
"attackFrames" : 5,
|
||||||
"cooldownFrames" : 28,
|
"cooldownFrames" : 28,
|
||||||
@ -400,25 +388,15 @@
|
|||||||
"driftFrameStart" : 1,
|
"driftFrameStart" : 1,
|
||||||
"driftFrameEnd" : 10,
|
"driftFrameEnd" : 10,
|
||||||
"initialMove" : true,
|
"initialMove" : true,
|
||||||
"animationFirstPersonWindup" : {
|
"animationAttack" : {
|
||||||
"nameFirstPerson" : "HoldItemR2H",
|
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
|
||||||
},
|
|
||||||
"animationFirstPersonHold" : {
|
|
||||||
"nameFirstPerson" : "HoldItemR2H",
|
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
|
||||||
},
|
|
||||||
"animationFirstPersonAttack" : {
|
|
||||||
"nameFirstPerson" : "SwordR2HSlash",
|
"nameFirstPerson" : "SwordR2HSlash",
|
||||||
|
"nameThirdPerson" : "SwordR2HSlash",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"attackMoveId" : "Bow2HFire",
|
"attackMoveId" : "Bow2HFire",
|
||||||
"type" : "RANGED_WEAPON_BOW_TWO_HAND",
|
"type" : "RANGED_WEAPON_BOW_TWO_HAND",
|
||||||
"windupAnimationName" : "HoldBowString",
|
|
||||||
"holdAnimationName" : "HoldBow",
|
|
||||||
"attackAnimationName" : "HoldBowString",
|
|
||||||
"damageStartFrame" : 30,
|
"damageStartFrame" : 30,
|
||||||
"damageEndFrame" : 60,
|
"damageEndFrame" : 60,
|
||||||
"firesProjectile" : true,
|
"firesProjectile" : true,
|
||||||
@ -429,16 +407,19 @@
|
|||||||
"movementEnd" : 0,
|
"movementEnd" : 0,
|
||||||
"movementGoal" : 0,
|
"movementGoal" : 0,
|
||||||
"initialMove" : true,
|
"initialMove" : true,
|
||||||
"animationFirstPersonWindup" : {
|
"animationWindup" : {
|
||||||
"nameFirstPerson" : "Jump",
|
"nameFirstPerson" : "Jump",
|
||||||
|
"nameThirdPerson" : "HoldBowString",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
},
|
},
|
||||||
"animationFirstPersonHold" : {
|
"animationHold" : {
|
||||||
"nameFirstPerson" : "Jump",
|
"nameFirstPerson" : "Jump",
|
||||||
|
"nameThirdPerson" : "HoldBow",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
},
|
},
|
||||||
"animationFirstPersonAttack" : {
|
"animationAttack" : {
|
||||||
"nameFirstPerson" : "Jump",
|
"nameFirstPerson" : "Jump",
|
||||||
|
"nameThirdPerson" : "HoldBowString",
|
||||||
"priorityCategory" : "MOVEMENT_MODIFIER"
|
"priorityCategory" : "MOVEMENT_MODIFIER"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -472,6 +472,7 @@ Tear out first person rendering pipeline
|
|||||||
Partially fix first person attachment to viewmodel
|
Partially fix first person attachment to viewmodel
|
||||||
Creature data validation
|
Creature data validation
|
||||||
Unify animation format data on disk
|
Unify animation format data on disk
|
||||||
|
Leverage animation masks to block while moving
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import electrosphere.entity.Entity;
|
|||||||
import electrosphere.entity.EntityDataStrings;
|
import electrosphere.entity.EntityDataStrings;
|
||||||
import electrosphere.entity.EntityUtils;
|
import electrosphere.entity.EntityUtils;
|
||||||
import electrosphere.entity.btree.BehaviorTree;
|
import electrosphere.entity.btree.BehaviorTree;
|
||||||
import electrosphere.entity.state.AnimationPriorities;
|
|
||||||
import electrosphere.entity.state.client.firstPerson.FirstPersonTree;
|
import electrosphere.entity.state.client.firstPerson.FirstPersonTree;
|
||||||
import electrosphere.entity.state.collidable.Impulse;
|
import electrosphere.entity.state.collidable.Impulse;
|
||||||
import electrosphere.entity.state.equip.ClientEquipState;
|
import electrosphere.entity.state.equip.ClientEquipState;
|
||||||
@ -238,52 +237,47 @@ public class ClientAttackTree implements BehaviorTree {
|
|||||||
if(parent.containsKey(EntityDataStrings.CLIENT_ROTATOR_TREE)){
|
if(parent.containsKey(EntityDataStrings.CLIENT_ROTATOR_TREE)){
|
||||||
RotatorTree.getClientRotatorTree(parent).setActive(true);
|
RotatorTree.getClientRotatorTree(parent).setActive(true);
|
||||||
}
|
}
|
||||||
if(currentMove != null){
|
if(currentMove != null && entityActor != null && currentMove.getAnimationWindup() != null){
|
||||||
if(entityActor != null){
|
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(currentMove.getAnimationWindup())){
|
||||||
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(currentMove.getWindupAnimationName())){
|
|
||||||
entityActor.playAnimation(
|
|
||||||
currentMove.getWindupAnimationName(),
|
|
||||||
AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER)
|
|
||||||
);
|
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
|
||||||
}
|
|
||||||
FirstPersonTree.conditionallyPlayAnimation(
|
|
||||||
Globals.firstPersonEntity,
|
|
||||||
currentMove.getAnimationFirstPersonWindup().getNameFirstPerson(),
|
|
||||||
AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case HOLD: {
|
|
||||||
if(entityActor != null){
|
|
||||||
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(currentMove.getHoldAnimationName())){
|
|
||||||
entityActor.playAnimation(
|
entityActor.playAnimation(
|
||||||
currentMove.getHoldAnimationName(),
|
currentMove.getAnimationWindup(),
|
||||||
AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER)
|
true
|
||||||
);
|
);
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(
|
FirstPersonTree.conditionallyPlayAnimation(
|
||||||
Globals.firstPersonEntity,
|
Globals.firstPersonEntity,
|
||||||
currentMove.getAnimationFirstPersonHold().getNameFirstPerson(),
|
currentMove.getAnimationWindup()
|
||||||
AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER)
|
);
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
case HOLD: {
|
||||||
|
if(entityActor != null && currentMove.getAnimationHold() != null){
|
||||||
|
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(currentMove.getAnimationHold())){
|
||||||
|
entityActor.playAnimation(
|
||||||
|
currentMove.getAnimationHold(),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
|
}
|
||||||
|
FirstPersonTree.conditionallyPlayAnimation(
|
||||||
|
Globals.firstPersonEntity,
|
||||||
|
currentMove.getAnimationHold()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case ATTACK: {
|
case ATTACK: {
|
||||||
if(entityActor != null && currentMove != null){
|
if(entityActor != null && currentMove != null){
|
||||||
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(currentMove.getAttackAnimationName())){
|
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(currentMove.getAnimationAttack())){
|
||||||
entityActor.playAnimation(
|
entityActor.playAnimation(
|
||||||
currentMove.getAttackAnimationName(),
|
currentMove.getAnimationAttack(),
|
||||||
AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER)
|
true
|
||||||
);
|
);
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(
|
FirstPersonTree.conditionallyPlayAnimation(
|
||||||
Globals.firstPersonEntity,
|
Globals.firstPersonEntity,
|
||||||
currentMove.getAnimationFirstPersonAttack().getNameFirstPerson(),
|
currentMove.getAnimationAttack()
|
||||||
AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
//activate hitboxes
|
//activate hitboxes
|
||||||
|
|||||||
@ -125,14 +125,14 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
projectileToFire = ItemUtils.getWeaponDataRaw(currentWeapon).getProjectileModel();
|
projectileToFire = ItemUtils.getWeaponDataRaw(currentWeapon).getProjectileModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
animationName = currentMove.getAttackAnimationName();
|
animationName = currentMove.getAnimationAttack().getNameThirdPerson();
|
||||||
//intuit windup from presence of windup anim
|
//intuit windup from presence of windup anim
|
||||||
currentMoveHasWindup = currentMove.getWindupAnimationName() != null;
|
currentMoveHasWindup = currentMove.getAnimationWindup() != null;
|
||||||
if(currentMoveHasWindup){
|
if(currentMoveHasWindup){
|
||||||
animationName = currentMove.getWindupAnimationName();
|
animationName = currentMove.getAnimationWindup().getNameThirdPerson();
|
||||||
}
|
}
|
||||||
//intuit can hold from presence of windup anim
|
//intuit can hold from presence of windup anim
|
||||||
currentMoveCanHold = currentMove.getHoldAnimationName() != null;
|
currentMoveCanHold = currentMove.getAnimationHold() != null;
|
||||||
//stop movement tree
|
//stop movement tree
|
||||||
if(parent.containsKey(EntityDataStrings.SERVER_MOVEMENT_BT)){
|
if(parent.containsKey(EntityDataStrings.SERVER_MOVEMENT_BT)){
|
||||||
BehaviorTree movementTree = CreatureUtils.serverGetEntityMovementTree(parent);
|
BehaviorTree movementTree = CreatureUtils.serverGetEntityMovementTree(parent);
|
||||||
@ -266,8 +266,8 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
} break;
|
} break;
|
||||||
case ATTACK: {
|
case ATTACK: {
|
||||||
if(entityPoseActor != null && currentMove != null){
|
if(entityPoseActor != null && currentMove != null){
|
||||||
if(!entityPoseActor.isPlayingAnimation() || !entityPoseActor.isPlayingAnimation(currentMove.getAttackAnimationName())){
|
if(!entityPoseActor.isPlayingAnimation() || !entityPoseActor.isPlayingAnimation(currentMove.getAnimationAttack())){
|
||||||
entityPoseActor.playAnimation(currentMove.getAttackAnimationName(),1);
|
entityPoseActor.playAnimation(currentMove.getAnimationAttack(),true);
|
||||||
entityPoseActor.incrementAnimationTime(0.0001);
|
entityPoseActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,7 +96,7 @@ public class FallTree implements BehaviorTree {
|
|||||||
entityActor.playAnimation(fallMovementSystem.getLandState().getAnimation().getNameThirdPerson(),AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER));
|
entityActor.playAnimation(fallMovementSystem.getLandState().getAnimation().getNameThirdPerson(),AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER));
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, fallMovementSystem.getLandState().getAnimation().getNameFirstPerson(), AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER));
|
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, fallMovementSystem.getLandState().getAnimation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class JumpTree implements BehaviorTree {
|
|||||||
entityActor.playAnimation(jumpData.getAnimationJump().getNameThirdPerson(),AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER));
|
entityActor.playAnimation(jumpData.getAnimationJump().getNameThirdPerson(),AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER));
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, jumpData.getAnimationFirstPersonJump().getNameFirstPerson(), AnimationPriorities.getValue(AnimationPriorities.MOVEMENT_MODIFIER));
|
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, jumpData.getAnimationJump());
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
currentJumpForce = currentJumpForce * jumpFalloff;
|
currentJumpForce = currentJumpForce * jumpFalloff;
|
||||||
|
|||||||
@ -294,7 +294,7 @@ public class ClientGroundMovementTree implements BehaviorTree {
|
|||||||
entityActor.playAnimation(animationToPlay,AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
entityActor.playAnimation(animationToPlay,AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, groundMovementData.getAnimationFirstPersonStartup().getNameThirdPerson(), AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, groundMovementData.getAnimationStartup().getNameFirstPerson(), AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
||||||
}
|
}
|
||||||
//run startup code
|
//run startup code
|
||||||
velocity = velocity + acceleration * (float)Globals.timekeeper.getSimFrameTime();
|
velocity = velocity + acceleration * (float)Globals.timekeeper.getSimFrameTime();
|
||||||
@ -328,7 +328,7 @@ public class ClientGroundMovementTree implements BehaviorTree {
|
|||||||
entityActor.playAnimation(animationToPlay,AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
entityActor.playAnimation(animationToPlay,AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, groundMovementData.getAnimationFirstPersonLoop().getNameThirdPerson(), AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, groundMovementData.getAnimationLoop().getNameFirstPerson(), AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
||||||
}
|
}
|
||||||
if(velocity != maxNaturalVelocity){
|
if(velocity != maxNaturalVelocity){
|
||||||
velocity = maxNaturalVelocity;
|
velocity = maxNaturalVelocity;
|
||||||
@ -356,7 +356,7 @@ public class ClientGroundMovementTree implements BehaviorTree {
|
|||||||
entityActor.playAnimation(animationToPlay,AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
entityActor.playAnimation(animationToPlay,AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
||||||
entityActor.incrementAnimationTime(0.0001);
|
entityActor.incrementAnimationTime(0.0001);
|
||||||
}
|
}
|
||||||
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, groundMovementData.getAnimationFirstPersonWindDown().getNameThirdPerson(), AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
FirstPersonTree.conditionallyPlayAnimation(Globals.firstPersonEntity, groundMovementData.getAnimationWindDown().getNameFirstPerson(), AnimationPriorities.getValue(AnimationPriorities.CORE_MOVEMENT));
|
||||||
}
|
}
|
||||||
//velocity stuff
|
//velocity stuff
|
||||||
velocity = velocity - acceleration * (float)Globals.timekeeper.getSimFrameTime();
|
velocity = velocity - acceleration * (float)Globals.timekeeper.getSimFrameTime();
|
||||||
|
|||||||
@ -84,9 +84,9 @@ public class CreatureDataValidator {
|
|||||||
List<TreeDataAnimation> animations = new LinkedList<TreeDataAnimation>();
|
List<TreeDataAnimation> animations = new LinkedList<TreeDataAnimation>();
|
||||||
if(data.getAttackMoves() != null){
|
if(data.getAttackMoves() != null){
|
||||||
for(AttackMove move : data.getAttackMoves()){
|
for(AttackMove move : data.getAttackMoves()){
|
||||||
animations.add(move.getAnimationFirstPersonAttack());
|
animations.add(move.getAnimationAttack());
|
||||||
animations.add(move.getAnimationFirstPersonHold());
|
animations.add(move.getAnimationHold());
|
||||||
animations.add(move.getAnimationFirstPersonWindup());
|
animations.add(move.getAnimationWindup());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(data.getEquipPoints() != null){
|
if(data.getEquipPoints() != null){
|
||||||
@ -100,16 +100,12 @@ public class CreatureDataValidator {
|
|||||||
for(MovementSystem system : data.getMovementSystems()){
|
for(MovementSystem system : data.getMovementSystems()){
|
||||||
if(system instanceof GroundMovementSystem){
|
if(system instanceof GroundMovementSystem){
|
||||||
GroundMovementSystem groundMovementSystem = (GroundMovementSystem)system;
|
GroundMovementSystem groundMovementSystem = (GroundMovementSystem)system;
|
||||||
animations.add(groundMovementSystem.getAnimationFirstPersonLoop());
|
|
||||||
animations.add(groundMovementSystem.getAnimationFirstPersonStartup());
|
|
||||||
animations.add(groundMovementSystem.getAnimationFirstPersonWindDown());
|
|
||||||
animations.add(groundMovementSystem.getAnimationLoop());
|
animations.add(groundMovementSystem.getAnimationLoop());
|
||||||
animations.add(groundMovementSystem.getAnimationStartup());
|
animations.add(groundMovementSystem.getAnimationStartup());
|
||||||
animations.add(groundMovementSystem.getAnimationWindDown());
|
animations.add(groundMovementSystem.getAnimationWindDown());
|
||||||
}
|
}
|
||||||
if(system instanceof JumpMovementSystem){
|
if(system instanceof JumpMovementSystem){
|
||||||
JumpMovementSystem jumpMovementSystem = (JumpMovementSystem)system;
|
JumpMovementSystem jumpMovementSystem = (JumpMovementSystem)system;
|
||||||
animations.add(jumpMovementSystem.getAnimationFirstPersonJump());
|
|
||||||
animations.add(jumpMovementSystem.getAnimationJump());
|
animations.add(jumpMovementSystem.getAnimationJump());
|
||||||
}
|
}
|
||||||
if(system instanceof FallMovementSystem){
|
if(system instanceof FallMovementSystem){
|
||||||
|
|||||||
@ -16,13 +16,9 @@ public class AttackMove {
|
|||||||
/*
|
/*
|
||||||
Animation stuff
|
Animation stuff
|
||||||
*/
|
*/
|
||||||
String windupAnimationName;
|
TreeDataAnimation animationWindup;
|
||||||
String holdAnimationName;
|
TreeDataAnimation animationHold;
|
||||||
String attackAnimationName;
|
TreeDataAnimation animationAttack;
|
||||||
|
|
||||||
TreeDataAnimation animationFirstPersonWindup;
|
|
||||||
TreeDataAnimation animationFirstPersonHold;
|
|
||||||
TreeDataAnimation animationFirstPersonAttack;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Damage stuff
|
Damage stuff
|
||||||
@ -65,51 +61,27 @@ public class AttackMove {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the name of the animation to play in 3rd person for the windup
|
* Gets the animation to play for the windup
|
||||||
* @return the animation name
|
* @return the animation
|
||||||
*/
|
*/
|
||||||
public String getWindupAnimationName() {
|
public TreeDataAnimation getAnimationWindup() {
|
||||||
return windupAnimationName;
|
return animationWindup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the name of the animation to play in 3rd person for the hold
|
* Gets the name of the animation to play for the hold
|
||||||
* @return the animation name
|
* @return the animation
|
||||||
*/
|
*/
|
||||||
public String getHoldAnimationName() {
|
public TreeDataAnimation getAnimationHold() {
|
||||||
return holdAnimationName;
|
return animationHold;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the name of the animation to play in 3rd person for the attack
|
* Gets the animation to play for the attack
|
||||||
* @return the animation name
|
* @return the animation
|
||||||
*/
|
*/
|
||||||
public String getAttackAnimationName() {
|
public TreeDataAnimation getAnimationAttack() {
|
||||||
return attackAnimationName;
|
return animationAttack;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the animation data for the 1st person windup
|
|
||||||
* @return the animation data
|
|
||||||
*/
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonWindup(){
|
|
||||||
return animationFirstPersonWindup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the animation data for the 1st person hold
|
|
||||||
* @return the animation data
|
|
||||||
*/
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonHold(){
|
|
||||||
return animationFirstPersonHold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the animation data for the 1st person attack
|
|
||||||
* @return the animation data
|
|
||||||
*/
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonAttack(){
|
|
||||||
return animationFirstPersonAttack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -20,15 +20,12 @@ public class GroundMovementSystem implements MovementSystem {
|
|||||||
|
|
||||||
//startup data
|
//startup data
|
||||||
TreeDataAnimation animationStartup;
|
TreeDataAnimation animationStartup;
|
||||||
TreeDataAnimation animationFirstPersonStartup;
|
|
||||||
|
|
||||||
//loop data
|
//loop data
|
||||||
TreeDataAnimation animationLoop;
|
TreeDataAnimation animationLoop;
|
||||||
TreeDataAnimation animationFirstPersonLoop;
|
|
||||||
|
|
||||||
//wind down data
|
//wind down data
|
||||||
TreeDataAnimation animationWindDown;
|
TreeDataAnimation animationWindDown;
|
||||||
TreeDataAnimation animationFirstPersonWindDown;
|
|
||||||
|
|
||||||
//sprint data
|
//sprint data
|
||||||
SprintSystem sprintSystem;
|
SprintSystem sprintSystem;
|
||||||
@ -51,7 +48,7 @@ public class GroundMovementSystem implements MovementSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the animation to play in 3rd person for startup
|
* Gets the animation to play for startup
|
||||||
* @return The animation data
|
* @return The animation data
|
||||||
*/
|
*/
|
||||||
public TreeDataAnimation getAnimationStartup() {
|
public TreeDataAnimation getAnimationStartup() {
|
||||||
@ -59,15 +56,7 @@ public class GroundMovementSystem implements MovementSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the animation to play in 1st person for startup
|
* Gets the animation to loop
|
||||||
* @return The animation data
|
|
||||||
*/
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonStartup(){
|
|
||||||
return animationFirstPersonStartup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the animation to loop in 3rd person
|
|
||||||
* @return The animation data
|
* @return The animation data
|
||||||
*/
|
*/
|
||||||
public TreeDataAnimation getAnimationLoop() {
|
public TreeDataAnimation getAnimationLoop() {
|
||||||
@ -75,29 +64,13 @@ public class GroundMovementSystem implements MovementSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the animation to loop in 1st person
|
* Gets the animation to play to wind down
|
||||||
* @return The animation data
|
|
||||||
*/
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonLoop(){
|
|
||||||
return animationFirstPersonLoop;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the animation to play in 3rd person to wind down
|
|
||||||
* @return The animation data
|
* @return The animation data
|
||||||
*/
|
*/
|
||||||
public TreeDataAnimation getAnimationWindDown() {
|
public TreeDataAnimation getAnimationWindDown() {
|
||||||
return animationWindDown;
|
return animationWindDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the animation to play in 1st person to wind down
|
|
||||||
* @return The animation data
|
|
||||||
*/
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonWindDown(){
|
|
||||||
return animationFirstPersonWindDown;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sprint system data
|
* Gets the sprint system data
|
||||||
* @return The sprint system data
|
* @return The sprint system data
|
||||||
|
|||||||
@ -2,34 +2,58 @@ package electrosphere.game.data.creature.type.movement;
|
|||||||
|
|
||||||
import electrosphere.game.data.common.TreeDataAnimation;
|
import electrosphere.game.data.common.TreeDataAnimation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A jump tree's data
|
||||||
|
*/
|
||||||
public class JumpMovementSystem implements MovementSystem {
|
public class JumpMovementSystem implements MovementSystem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name for this movement tree system
|
||||||
|
*/
|
||||||
public static final String JUMP_MOVEMENT_SYSTEM = "JUMP";
|
public static final String JUMP_MOVEMENT_SYSTEM = "JUMP";
|
||||||
|
|
||||||
|
//The type of tree
|
||||||
String type;
|
String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The animation to play when jumping
|
||||||
|
*/
|
||||||
TreeDataAnimation animationJump;
|
TreeDataAnimation animationJump;
|
||||||
TreeDataAnimation animationFirstPersonJump;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of frames to apply the jump force
|
||||||
|
*/
|
||||||
int jumpFrames;
|
int jumpFrames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The force to apply while jump state
|
||||||
|
*/
|
||||||
float jumpForce;
|
float jumpForce;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the number of frames to apply jump force for
|
||||||
|
* @return The number of frames
|
||||||
|
*/
|
||||||
public int getJumpFrames(){
|
public int getJumpFrames(){
|
||||||
return jumpFrames;
|
return jumpFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the force to jump with
|
||||||
|
* @return The force
|
||||||
|
*/
|
||||||
public float getJumpForce(){
|
public float getJumpForce(){
|
||||||
return jumpForce;
|
return jumpForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the animation to play while jumping
|
||||||
|
* @return The animation
|
||||||
|
*/
|
||||||
public TreeDataAnimation getAnimationJump(){
|
public TreeDataAnimation getAnimationJump(){
|
||||||
return animationJump;
|
return animationJump;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeDataAnimation getAnimationFirstPersonJump(){
|
|
||||||
return animationFirstPersonJump;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user