Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add melding repulsor #51

Merged
merged 2 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Cleanup, use better repulsor deployable
  • Loading branch information
SzymonKaminski committed Oct 3, 2024
commit 49ac0ed63e0415700e657183ea5fedb70836c887
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ insert_final_newline = false

# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = # this. and Me. preferences
dotnet_sort_system_directives_first = true
file_header_template = unset # this. and Me. preferences

dotnet_style_qualification_for_event = false:silent
dotnet_style_qualification_for_field = false:silent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,4 @@ public void UiQueryResponse(INetworkClient client, IPlayer player, ulong entityI

client.AssignedShard.EncounterMan.HandleUiQueryResponse(response, (INetworkPlayer)player);
}
}
}
2 changes: 1 addition & 1 deletion UdpHosts/GameServer/Entities/EncounterComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public enum Event : uint
public bool Handles(Event type) => Events.HasFlag(type);
public void StartHandling(Event type) => Events |= type;
public void StopHandling(Event type) => Events &= ~type;
}
}
2 changes: 1 addition & 1 deletion UdpHosts/GameServer/StaticDB/CustomDBInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,4 @@ public static void Init()
public static Dictionary<uint, Melding> GetZoneMeldings(uint zoneId) => Melding.GetValueOrDefault(zoneId);
public static Dictionary<uint, Outpost> GetZoneOutposts(uint zoneId) => Outpost.GetValueOrDefault(zoneId);
public static Dictionary<uint, MeldingRepulsor> GetZoneMeldingRepulsors(uint zoneId) => MeldingRepulsor.GetValueOrDefault(zoneId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"zone_id": 448,
"perimiter_set_name": "Hydro_Core_Melding_02",
"repulsor": {
"type": 2785,
"type": 3695,
"orientation": {
"IsIdentity": false,
"W": -0.96569586,
Expand Down
1 change: 1 addition & 0 deletions UdpHosts/GameServer/StaticDB/Loaders/CustomDBLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ public Dictionary<uint, Dictionary<uint, Outpost>> LoadOutpost()
.GroupBy(row => row.ZoneId)
.ToDictionary(group => group.Key, group => group.ToDictionary(row => row.Id, row => row));
}

public Dictionary<uint, Dictionary<uint, MeldingRepulsor>> LoadMeldingRepulsor()
{
return LoadJSON<MeldingRepulsor>("./StaticDB/CustomData/meldingRepulsor.json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public record MeldingPosition
{
public uint ControlPointIndex { get; set; }
public Vector3 Position;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public bool Execute(Context context)

return true;
}
}
}
2 changes: 1 addition & 1 deletion UdpHosts/GameServer/Systems/Encounters/EncounterManager.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AeroMessages.Common;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Numerics;
using System.Threading;
using AeroMessages.Common;
using AeroMessages.GSS.V66.Character.Command;
using AeroMessages.GSS.V66.Character.Event;
using AeroMessages.GSS.V66.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public class MeldingRepulsor : BaseEncounter, IInteractionHandler, IDonationHand
private const uint EffectOffline = 2958;
private const uint EffectOnline = 2957;
private const uint EffectInitializing = 3285;
private const uint EffectWhispers = 5157;
private const uint EffectCollapse = 5157;

private const uint MaxMeldedCrystite = 4000;
private const uint PushbackDurationMs = 1224_000;

private readonly DeployableEntity _meldingRepulsor;
private readonly DeployableEntity _repulsor;
private readonly DeployableEntity _terminal;

private readonly MeldingEntity _melding;
Expand All @@ -39,8 +39,8 @@ public MeldingRepulsor(IShard shard, ulong entityId, HashSet<INetworkPlayer> par
: base(shard, entityId, participants)
{
var r = repulsor.Repulsor;
_meldingRepulsor = Shard.EntityMan.SpawnDeployable(r.Type, r.Position, r.Orientation);
_meldingRepulsor.Encounter = new EncounterComponent { EncounterId = entityId, Instance = this, Events = EncounterComponent.Event.Signal };
_repulsor = Shard.EntityMan.SpawnDeployable(r.Type, r.Position, r.Orientation);
_repulsor.Encounter = new EncounterComponent { EncounterId = entityId, Instance = this, Events = EncounterComponent.Event.Signal };

var t = repulsor.Terminal;
_terminal = Shard.EntityMan.SpawnDeployable(t.Type, t.Position, t.Orientation);
Expand Down Expand Up @@ -118,7 +118,7 @@ public void OnDonation(UiQueryResponse response, INetworkPlayer player)
Shard.Abilities.DoRemoveEffect(_terminal, EffectOffline);
Shard.Abilities.DoApplyEffect(EffectInitializing, _terminal, new Context(Shard, _terminal) { InitTime = Shard.CurrentTime });

Shard.Abilities.HandleActivateAbility(Shard, _meldingRepulsor, _meldingRepulsor.Interaction.CompletedAbilityId);
Shard.Abilities.HandleActivateAbility(Shard, _repulsor, _repulsor.Interaction.CompletedAbilityId);
}

public override void OnSignal()
Expand Down Expand Up @@ -146,10 +146,10 @@ public void OnTimeOut()
{
foreach (var participant in Participants)
{
Shard.Abilities.DoApplyEffect(EffectWhispers, participant.CharacterEntity, new Context(Shard, _meldingRepulsor) { InitTime = Shard.CurrentTime });
Shard.Abilities.DoApplyEffect(EffectCollapse, participant.CharacterEntity, new Context(Shard, _repulsor) { InitTime = Shard.CurrentTime });
}

Shard.Abilities.DoApplyEffect(9487, _meldingRepulsor, new Context(Shard, _meldingRepulsor) { InitTime = Shard.CurrentTime });
Shard.Abilities.DoApplyEffect(9487, _repulsor, new Context(Shard, _repulsor) { InitTime = Shard.CurrentTime });

Shard.Abilities.DoRemoveEffect(_terminal, EffectOnline);
Shard.Abilities.DoApplyEffect(EffectOffline, _terminal, new Context(Shard, _terminal) { InitTime = Shard.CurrentTime });
Expand Down Expand Up @@ -196,4 +196,4 @@ public override void OnUpdate(ulong currentTime)
_terminal.Encounter.StartHandling(EncounterComponent.Event.Interaction);
}
}
}
}
2 changes: 1 addition & 1 deletion UdpHosts/GameServer/Systems/Encounters/ICanTimeout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ public interface ICanTimeout
ulong EntityId { get; }

void OnTimeOut();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public interface IInteractionHandler
public interface IDonationHandler
{
void OnDonation(UiQueryResponse response, INetworkPlayer player);
}
}
Loading