delete entity on death
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-08-13 16:08:46 -04:00
parent 1ca9c60640
commit 25fff94029
5 changed files with 18 additions and 13 deletions

View File

@ -57,7 +57,7 @@
"modelPath" : "Models/items/weapons/katana1alt.fbx",
"weaponData" : {
"weaponClass" : "sword2h",
"damage" : 10,
"damage" : 34,
"hitboxes" : [
{
"type": "hit_connected",

View File

@ -7,9 +7,7 @@
+ when popup is accepted, spawn an enemy with an effect
enemy ai
review combat code (lifestate, damage calculation, etc)
- Damage event accumulator each frame on server side
Use accumulator to negate all damage if block box was hit
I-frames
Maybe a fade-out before deleting entity on death?
+ rearchitecture

View File

@ -554,6 +554,7 @@ Hitbox support offsets now
Multiple hitboxes per bone
Potential fix for client concurrency issue
Debounce attack collisions
Remove entities on death
# TODO

View File

@ -77,7 +77,7 @@ public class StateTransitionUtil {
public void simulate(Object stateEnum){
StateTransitionUtilItem state = null;
for(StateTransitionUtilItem targetState : states){
if(targetState.stateEnum == stateEnum){
if(targetState != null && targetState.stateEnum == stateEnum){
state = targetState;
break;
}
@ -374,6 +374,13 @@ public class StateTransitionUtil {
treeData.getAudioData(),
onComplete
);
} else {
rVal = new StateTransitionUtilItem(
stateEnum,
(TreeDataAnimation)null,
null,
onComplete
);
}
return rVal;
}

View File

@ -5,6 +5,7 @@ import electrosphere.entity.btree.BehaviorTree;
import electrosphere.entity.btree.StateTransitionUtil;
import electrosphere.entity.btree.StateTransitionUtil.StateTransitionUtilItem;
import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.ServerEntityUtils;
import electrosphere.entity.Entity;
import electrosphere.server.datacell.utils.ServerBehaviorTreeUtils;
import electrosphere.net.parser.net.message.CombatMessage;
@ -77,6 +78,8 @@ public class ServerLifeTree implements BehaviorTree {
this.stateTransitionUtil.simulate(LifeStateEnum.DYING);
} break;
case DEAD: {
//delete the entity
ServerEntityUtils.destroyEntity(parent);
} break;
}
}
@ -163,13 +166,9 @@ public class ServerLifeTree implements BehaviorTree {
);
//do damage calculation
int damage = ItemUtils.getWeaponDataRaw(event.source).getDamage();
this.damage(damage);
if(!this.isAlive()){
throw new UnsupportedOperationException("Reviving not implemented yet!");
// Realm entityRealm = Globals.realmManager.getEntityRealm(receiverParent);
// EntityUtils.getPosition(receiverParent).set(entityRealm.getSpawnPoint());
// serverLifeTree.revive();
if(this.isAlive()){
int damage = ItemUtils.getWeaponDataRaw(event.source).getDamage();
this.damage(damage);
}
}
}
@ -263,7 +262,7 @@ public class ServerLifeTree implements BehaviorTree {
this.lifeCurrent = this.lifeMax;
this.iFrameMaxCount = this.healthSystem.getOnDamageIFrames();
this.iFrameCurrent = 0;
stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{
this.stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{
StateTransitionUtilItem.create(
LifeStateEnum.DYING,
this.healthSystem.getDyingState(),