Skip to content

Commit

Permalink
Various minor fixes, reworked warg target priority and chase behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
Byak0 committed Oct 29, 2024
1 parent f9cc4ae commit ee8911a
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 92 deletions.
2 changes: 1 addition & 1 deletion Alliance.Client/_Module/SubModule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Module>
<Id value="Alliance" />
<Name value="Alliance" />
<Version value="v0.1.8.9" />
<Version value="v0.1.9.0" />
<ModuleCategory value="Multiplayer" />
<DependedModules>
<DependedModule Id="Native" />
Expand Down
2 changes: 1 addition & 1 deletion Alliance.Common/CommonProps.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<AllianceVersion>0.1.8.9</AllianceVersion>
<AllianceVersion>0.1.9.0</AllianceVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Alliance.Editor/_Module/SubModule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Module>
<Id value="Alliance.Editor" />
<Name value="Alliance.Editor" />
<Version value="v0.1.8.9" />
<Version value="v0.1.9.0" />
<ModuleCategory value="Singleplayer" />
<DependedModules>
<DependedModule Id="Native" />
Expand Down
6 changes: 4 additions & 2 deletions Alliance.Server/Core/Utils/CoreUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ public static void TakeDamage(Agent victim, Agent attacker, int damage, float ma

if (victim.Health <= 0) return;

if (attacker?.MissionPeer != null)
// Retrieve peer from either agent or rider agent
MissionPeer peer = attacker?.MissionPeer != null ? attacker.MissionPeer : attacker.RiderAgent?.MissionPeer != null ? attacker.RiderAgent.MissionPeer : null;
if (peer != null)
{
//Communicate damage to client to display PersonalKillFeed
GameNetwork.BeginModuleEventAsServer(attacker.MissionPeer.GetNetworkPeer());
GameNetwork.BeginModuleEventAsServer(peer.GetNetworkPeer());
GameNetwork.WriteMessage(new SyncPersonalKillFeedNotification(attacker, victim, false, false, false, victim.Health <= damage, false, false, damage));
GameNetwork.EndModuleEventAsServer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class BoneCheckDuringAnimationBehavior : MissionBehavior
private Agent target;
private List<sbyte> boneIds;
private float minDistanceSquared;
private float startDelay;
private float duration;
private bool isChecking;

Expand All @@ -37,12 +38,13 @@ public class BoneCheckDuringAnimationBehavior : MissionBehavior
public Action<Agent, Agent> OnBoneFoundParryCallback;

// Constructor callback
public BoneCheckDuringAnimationBehavior(Agent agent, Agent target, List<sbyte> boneIds, float duration, float minDistanceSquared, Action<Agent, Agent> onBoneFoundCallback, Action<Agent, Agent> onBoneFoundParryCallback)
public BoneCheckDuringAnimationBehavior(Agent agent, Agent target, List<sbyte> boneIds, float startDelay, float duration, float minDistanceSquared, Action<Agent, Agent> onBoneFoundCallback, Action<Agent, Agent> onBoneFoundParryCallback)
{
this.agent = agent;
this.target = target;
this.boneIds = boneIds;
this.minDistanceSquared = minDistanceSquared;
this.startDelay = startDelay;
this.duration = duration;
isChecking = true;
OnBoneFoundCallback = onBoneFoundCallback; // register callback
Expand All @@ -62,6 +64,8 @@ public override void OnMissionTick(float dt)
return;
}

if (time < startDelay) return;

sbyte boneInRange = SearchBoneInRange(agent, target, boneIds, minDistanceSquared);

// If a bone is found, call the callback.
Expand Down
Loading

0 comments on commit ee8911a

Please sign in to comment.