Merge remote-tracking branch 'origin/master' into Respawning

# Conflicts:
#	resources/Schema/Types/Entity.xsd
This commit is contained in:
William Moberg
2016-03-02 17:50:59 +01:00
18 changed files with 331 additions and 95 deletions
@@ -27,7 +27,7 @@ public:
virtual bool OnCommand(const Events::InputCommand& e) override;
virtual void Reset();
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer);
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID);
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
@@ -41,6 +41,7 @@ protected:
bool m_Crouching = false;
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
double m_AssaultDashDoubleTapDeltaTime = 0.0;
double m_DashEffectResetTimer = 0.0;
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
//and its very unlikely that someone wants to change that value
const float m_AssaultDashDoubleTapSensitivityTimer = 0.25f;
@@ -51,7 +52,7 @@ protected:
bool m_ShiftDashing = false;
bool m_ValidDoubleTap = false;
//specialabilitys
//specialabilities
bool m_MovementKeyDown = false;
bool m_SpecialAbilityKeyDown = false;
int m_NumberOfMovementKeysDown = 0;
@@ -190,12 +191,19 @@ bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMou
}
template <typename EventContext>
void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer) {
void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID) {
m_AssaultDashDoubleTapDeltaTime += dt;
m_DashEffectResetTimer += dt;
assaultDashCoolDownTimer -= dt;
//cooldown = assaultDashCoolDownMaxTimer sec, pretend the dash lasts 0.25 sec (for friction to do its work)
if (assaultDashCoolDownTimer > (assaultDashCoolDownMaxTimer - 0.25f)) {
m_PlayerIsDashing = true;
if (m_DashEffectResetTimer > 0.05) {
Events::DashAbility e;
e.Player = playerID;
m_EventBroker->Publish(e);
m_DashEffectResetTimer = 0.0;
}
} else {
m_PlayerIsDashing = false;
}
@@ -207,6 +215,9 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
m_AssaultDashDoubleTapped = true;
m_AssaultDashDoubleTapDeltaTime = 0.f;
Events::DashAbility e;
e.Player = playerID;
m_EventBroker->Publish(e);
return;
}
@@ -237,6 +248,7 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
Events::DashAbility e;
e.Player = playerID;
m_EventBroker->Publish(e);
}
+5
View File
@@ -28,6 +28,7 @@
#include "Core/EPlayerSpawned.h"
#include "Core/EAmmoPickup.h"
#include "Network/ESearchForServers.h"
#include "../Game/Events/EDashAbility.h"
struct ServerInfo
{
@@ -107,6 +108,7 @@ private:
void parsePlayerDamage(Packet& packet);
void parseComponentDeletion(Packet& packet);
void parseDoubleJump(Packet& packet);
void parseDashEffect(Packet& packet);
void parseAmmoPickup(Packet& packet);
void InterpolateFields(Packet& packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType);
void parseSnapshot(Packet& packet);
@@ -135,6 +137,9 @@ private:
EventRelay< Client, Events::SearchForServers> m_ESearchForServers;
EventRelay<Client, Events::DoubleJump> m_EDoubleJump;
bool OnDoubleJump(Events::DoubleJump & e);
EventRelay<Client, Events::DashAbility> m_EDashAbility;
bool OnDashAbility(const Events::DashAbility& e);
bool OnSearchForServers(const Events::SearchForServers& e);
UDPClient m_ServerlistRequest;
std::vector<ServerInfo> m_Serverlist;
+1
View File
@@ -20,6 +20,7 @@ enum class MessageType
ComponentDeleted,
PlayerTransform,
OnDoubleJump,
OnDashEffect,
ServerlistRequest,
AmmoPickup,
Invalid
+1
View File
@@ -83,6 +83,7 @@ private:
void parseClientPing();
void parsePing();
bool parseDoubleJump(Packet& packet);
void parseDashEffect(Packet& packet);
void parseUDPConnect(Packet& packet);
void parseTCPConnect(Packet& packet);
void parseDisconnect();
+5 -1
View File
@@ -2,11 +2,15 @@
#define Events_DashAbility_h__
#include "Core/Event.h"
#include "Core/EntityWrapper.h"
namespace Events
{
struct DashAbility : public Event { };
struct DashAbility : public Event
{
EntityID Player;
};
}
@@ -0,0 +1,19 @@
#include "Common.h"
#include "Core/System.h"
class FloatingEffectSystem : public PureSystem
{
public:
FloatingEffectSystem(SystemParams params)
: System(params)
, PureSystem("FloatingEffect")
{ }
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override
{
ComponentWrapper& transform = m_World->GetComponent(component.EntityID, "Transform");
(double&)component["Time"] += dt;
(glm::vec3&)transform["Position"] = (float)(double)component["Amplitude"] * glm::sin((glm::two_pi<float>() / (float)(double)component["Period"]) * (float)(double)component["Time"]) * (glm::vec3)component["Axis"];
}
};
@@ -41,6 +41,8 @@ private:
bool OnPlayerSpawned(Events::PlayerSpawned& e);
EventRelay<PlayerMovementSystem, Events::DoubleJump> m_EDoubleJump;
bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e);
EventRelay<PlayerMovementSystem, Events::DashAbility> m_EDashAbility;
bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e);
void updateMovementControllers(double dt);
void updateVelocity(EntityWrapper player, double dt);
+1
View File
@@ -56,4 +56,5 @@
<xs:include schemaLocation="Components/DefenderWeapon.xsd"/>
<xs:include schemaLocation="Components/CapturePointGameMode.xsd"/>
<xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/>
<xs:include schemaLocation="Components/FloatingEffect.xsd"/>
</xs:schema>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<FloatingEffect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FloatingEffect.xsd">
<Period>1</Period>
<Amplitude>1</Amplitude>
<Time>0</Time>
<Axis X="0" Y="0" Z="0"/>
<Position X="0" Y="0" Z="0"/>
</FloatingEffect>
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="FloatingEffect">
<xs:complexType>
<xs:all>
<xs:element name="Period" type="t:double" minOccurs="0"/>
<xs:element name="Amplitude" type="t:double" minOccurs="0"/>
<xs:element name="Time" type="t:double" minOccurs="0"/>
<xs:element name="Axis" type="t:Vector" minOccurs="0"/>
<xs:element name="Position" type="t:Vector" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="DashEffect" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Animation/>
<c:Lifetime>
<Lifetime>0.5</Lifetime>
</c:Lifetime>
<c:ExplosionEffect>
<Velocity X="0" Y="0" Z="0"/>
<TimeSinceDeath>0</TimeSinceDeath>
<ExplosionDuration>0.5</ExplosionDuration>
<EndColor A="0" B="0" G="0" R="0"/>
</c:ExplosionEffect>
<c:Model/>
<c:Transform/>
</Components>
</Entity>
+49 -49
View File
@@ -804,11 +804,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>3002.0048499272534</Time>
<Time>3297.0538973857279</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.00320033543" Z="0"/>
<Position X="-0" Y="-0.0338360146" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -825,7 +825,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23665.3672" Z="0"/>
<Orientation X="0" Y="23901.0449" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -851,11 +851,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2981.7884295114754</Time>
<Time>3276.8374769699499</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.123386621" Z="-0"/>
<Position X="0" Y="0.0977828354" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -872,7 +872,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23644.3164" Z="0"/>
<Orientation X="0" Y="23879.9941" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -898,11 +898,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2965.4934667508096</Time>
<Time>3260.542514209284</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.199960142" Z="-0"/>
<Position X="0" Y="0.19820635" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -919,7 +919,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23585.6074" Z="0"/>
<Orientation X="0" Y="23821.2852" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -945,11 +945,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2922.0307477781698</Time>
<Time>3217.0797952366443</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.0194334686" Z="0"/>
<Position X="-0" Y="-0.0497358106" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -966,7 +966,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5331.15967" Z="0"/>
<Orientation X="0" Y="5567.29199" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -992,11 +992,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2871.33224525081</Time>
<Time>3166.3812927092845</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.172897741" Z="-0"/>
<Position X="0" Y="0.186271787" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -1013,7 +1013,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5241.63037" Z="0"/>
<Orientation X="0" Y="5477.7627" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -1039,11 +1039,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2854.2794756870871</Time>
<Time>3149.3285231455616</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.154012829" Z="0"/>
<Position X="-0" Y="-0.171761468" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -1060,7 +1060,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="14694.2959" Z="0"/>
<Orientation X="0" Y="14930.6826" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -1086,11 +1086,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2839.2647225755118</Time>
<Time>3134.3137700339862</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.147846922" Z="-0"/>
<Position X="0" Y="0.166757002" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -1107,7 +1107,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="12585.2275" Z="0"/>
<Orientation X="0" Y="12821.6143" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -2242,7 +2242,7 @@
<Resource>Models/Props/Stones/AssaultHolder.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-3.47628784" Y="0.507368565" Z="0.99732101"/>
<Position X="-3.30188537" Y="0.507368565" Z="1.6052227"/>
</c:Transform>
</Components>
<Children/>
@@ -2355,11 +2355,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2746.6837512442808</Time>
<Time>3041.7327987027552</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.16754517" Z="0"/>
<Position X="-0" Y="-0.148809776" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -2376,7 +2376,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="16210.457" Z="0"/>
<Orientation X="0" Y="16446.9434" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -2402,11 +2402,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2732.8386366079758</Time>
<Time>3027.8876840664502</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.0970942229" Z="0"/>
<Position X="-0" Y="-0.0691253543" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -2423,7 +2423,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5167.40771" Z="0"/>
<Orientation X="0" Y="5403.54004" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -2904,11 +2904,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2969.073541383088</Time>
<Time>3264.1225888415624</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.0458931364" Z="-0"/>
<Position X="0" Y="0.0752089471" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -2925,7 +2925,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23639.0527" Z="0"/>
<Orientation X="0" Y="23874.7305" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -2951,11 +2951,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2948.85712096731</Time>
<Time>3243.9061684257845</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.0866934955" Z="0"/>
<Position X="-0" Y="-0.0580219813" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -2972,7 +2972,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23618.002" Z="0"/>
<Orientation X="0" Y="23853.6797" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -2998,11 +2998,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2932.5621582066442</Time>
<Time>3227.6112056651186</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.196187839" Z="0"/>
<Position X="-0" Y="-0.187905088" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -3019,7 +3019,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23559.293" Z="0"/>
<Orientation X="0" Y="23794.9707" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -3045,11 +3045,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2889.0994392340044</Time>
<Time>3184.1484866924789</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.0615537763" Z="-0"/>
<Position X="0" Y="0.0900137872" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -3066,7 +3066,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5304.81885" Z="0"/>
<Orientation X="0" Y="5540.95117" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -3092,11 +3092,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2838.4009367066446</Time>
<Time>3133.4499841651191</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.190397173" Z="0"/>
<Position X="-0" Y="-0.197535709" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -3113,7 +3113,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5215.28955" Z="0"/>
<Orientation X="0" Y="5451.42188" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -3139,11 +3139,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2821.3481671429217</Time>
<Time>3116.3972146013962</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.177647248" Z="-0"/>
<Position X="0" Y="0.189699799" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -3160,7 +3160,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="14667.9326" Z="0"/>
<Orientation X="0" Y="14904.3193" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -3186,11 +3186,11 @@
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>2806.3334140313464</Time>
<Time>3101.3824614898208</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.173328787" Z="0"/>
<Position X="-0" Y="-0.186583459" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -3207,7 +3207,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="12558.8643" Z="0"/>
<Orientation X="0" Y="12795.251" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
+114 -34
View File
@@ -802,8 +802,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>309.46063484238653</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.181836113" Z="0"/>
<Position X="-0" Y="-0.198473096" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -821,7 +826,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="24080.8184" Z="0"/>
<Orientation X="0" Y="24396.9355" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -844,8 +849,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>277.77588852554459</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.185762629" Z="-0"/>
<Position X="-0" Y="-0.129464492" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -863,7 +873,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="24059.7676" Z="0"/>
<Orientation X="0" Y="24375.8848" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -886,8 +896,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>265.69306053010564</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.167244121" Z="0"/>
<Position X="-0" Y="-0.164330602" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -905,7 +920,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="24001.0586" Z="0"/>
<Orientation X="0" Y="24317.1758" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -928,8 +943,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>254.01948784300018</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.0644967183" Z="0"/>
<Position X="0" Y="0.0122369174" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -947,7 +967,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5746.52246" Z="0"/>
<Orientation X="0" Y="6061.90527" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -970,8 +990,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>244.21618709850597</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.0994067639" Z="-0"/>
<Position X="0" Y="0.125630379" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -989,7 +1014,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5656.99316" Z="0"/>
<Orientation X="0" Y="5972.37598" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -1012,8 +1037,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>231.37430087102678</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.19803375" Z="-0"/>
<Position X="-0" Y="-0.184606224" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -1031,7 +1061,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="15110.7119" Z="0"/>
<Orientation X="0" Y="15425.6113" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -1054,8 +1084,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>219.21100328618962</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.11493478" Z="-0"/>
<Position X="-0" Y="-0.12308117" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -1073,7 +1108,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="13001.6436" Z="0"/>
<Orientation X="0" Y="13316.543" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -2318,8 +2353,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>192.42971043059836</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.143913418" Z="0"/>
<Position X="0" Y="0.195146352" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -2337,7 +2377,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="16626.7168" Z="0"/>
<Orientation X="0" Y="16942.834" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -2360,8 +2400,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>180.12130596231671</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.151800558" Z="0"/>
<Position X="0" Y="0.0743921027" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -2379,7 +2424,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5582.77051" Z="0"/>
<Orientation X="0" Y="5898.15332" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -2857,8 +2902,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>154.99927956894089</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.199556321" Z="-0"/>
<Position X="0" Y="0.000450141786" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -2876,7 +2926,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="24054.5039" Z="0"/>
<Orientation X="0" Y="24370.6191" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -2899,8 +2949,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>144.56072209865593</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.0983726978" Z="-0"/>
<Position X="0" Y="0.196372822" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -2918,7 +2973,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="24033.4531" Z="0"/>
<Orientation X="0" Y="24349.5703" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -2941,8 +2996,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>113.54515932497441</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="0" Y="0.199529812" Z="0"/>
<Position X="-0" Y="-0.197990373" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -2960,7 +3020,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="23974.7441" Z="0"/>
<Orientation X="0" Y="24290.8613" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -2983,8 +3043,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>101.62883282122999</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.129332498" Z="-0"/>
<Position X="-0" Y="-0.183840692" Z="-0"/>
</c:Transform>
</Components>
<Children>
@@ -3002,7 +3067,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5720.18164" Z="0"/>
<Orientation X="0" Y="6035.56445" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -3025,8 +3090,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>90.764091375525993</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.199750423" Z="-0"/>
<Position X="0" Y="0.135024786" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -3044,7 +3114,7 @@
<c:Transform>
<Position X="0" Y="2.36800003" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="5630.65234" Z="0"/>
<Orientation X="0" Y="5946.03516" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -3067,8 +3137,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>70.667870676407972</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.164693162" Z="-0"/>
<Position X="0" Y="0.172826052" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -3086,7 +3161,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="15084.3486" Z="0"/>
<Orientation X="0" Y="15399.248" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -3109,8 +3184,13 @@
<Children>
<Entity>
<Components>
<c:FloatingEffect>
<Axis X="0" Y="0.200000003" Z="0"/>
<Time>54.385750605052408</Time>
<Period>2</Period>
</c:FloatingEffect>
<c:Transform>
<Position X="-0" Y="-0.0709934905" Z="-0"/>
<Position X="0" Y="0.187255353" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -3128,7 +3208,7 @@
<c:Transform>
<Position X="0" Y="2.36784196" Z="0"/>
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
<Orientation X="0" Y="12975.2803" Z="0"/>
<Orientation X="0" Y="13290.1797" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -4222,7 +4302,7 @@
<HomePointForTeam>
<Blue/>
</HomePointForTeam>
<CapturePointMaxTimer>-15</CapturePointMaxTimer>
<CaptureTimer>-15</CaptureTimer>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePoint>
<c:Trigger/>
@@ -4444,7 +4524,7 @@
<Entity name="Directional">
<Components>
<c:DirectionalLight>
<Intensity>1</Intensity>
<Intensity>0.40000000596046448</Intensity>
</c:DirectionalLight>
<c:Transform>
<Orientation X="0" Y="1.16600001" Z="2.08000016"/>
+1
View File
@@ -53,6 +53,7 @@
<xs:element ref="c:WeaponAttachment" minOccurs="0"/>
<xs:element ref="c:DefenderWeapon" minOccurs="0"/>
<xs:element ref="c:CapturePointArrowHUD" minOccurs="0"/>
<xs:element ref="c:FloatingEffect" minOccurs="0"/>
<xs:element ref="c:AmmoPickup" minOccurs="0"/>
<xs:element ref="c:HealthPickup" minOccurs="0"/>
<xs:element ref="c:CapturePointGameMode" minOccurs="0"/>
+33 -3
View File
@@ -33,6 +33,7 @@ void Client::Connect(std::string address, int port)
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &Client::OnPlayerDamage);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Client::OnPlayerSpawned);
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &Client::OnDoubleJump);
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &Client::OnDashAbility);
EVENT_SUBSCRIBE_MEMBER(m_ESearchForServers, &Client::OnSearchForServers);
auto config = ResourceManager::Load<ConfigFile>("Config.ini");
m_Address = address;
@@ -143,6 +144,9 @@ void Client::parseMessageType(Packet& packet)
case MessageType::OnDoubleJump:
parseDoubleJump(packet);
break;
case MessageType::OnDashEffect:
parseDashEffect(packet);
break;
case MessageType::AmmoPickup:
parseAmmoPickup(packet);
break;
@@ -262,7 +266,7 @@ void Client::parseEntityDeletion(Packet & packet)
if (m_ServerIDToClientID.find(entityToDelete) != m_ServerIDToClientID.end()) {
EntityID localEntity = m_ServerIDToClientID.at(entityToDelete);
if (m_World->ValidEntity(localEntity)) {
if (m_World->HasComponent(localEntity,"Player")) {
if (m_World->HasComponent(localEntity, "Player")) {
Events::PlayerDeath e;
e.Player = EntityWrapper(m_World, localEntity);
m_EventBroker->Publish(e);
@@ -297,8 +301,22 @@ void Client::parseDoubleJump(Packet & packet)
}
}
void Client::parseDashEffect(Packet& packet)
{
EntityID serverID = packet.ReadPrimitive<EntityID>();
if (!serverClientMapsHasEntity(serverID)) {
return;
}
Events::DashAbility e;
e.Player = m_ServerIDToClientID.at(serverID);
if (e.Player != m_LocalPlayer.ID) {
m_EventBroker->Publish(e);
}
}
void Client::parseAmmoPickup(Packet & packet)
{
{
Events::AmmoPickup e;
e.AmmoGain = packet.ReadPrimitive<int>();
e.Player = m_LocalPlayer;
@@ -388,7 +406,7 @@ void Client::parseSnapshot(Packet& packet)
if (m_SnapshotFilter != nullptr) {
shouldApply = m_SnapshotFilter->FilterComponent(localEntity, newComponent);
}
if (shouldApply) {
if (shouldApply) {
ComponentWrapper currentComponent = m_World->GetComponent(localEntityID, componentType);
memcpy(currentComponent.Data, newComponent.Data, componentInfo.Stride);
}
@@ -518,6 +536,18 @@ bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e)
return true;
}
bool Client::OnDashAbility(const Events::DashAbility& e)
{
if (!clientServerMapsHasEntity(e.Player) || e.Player != m_LocalPlayer.ID) {
return false;
}
Packet packet(MessageType::OnDashEffect);
packet.WritePrimitive(m_ClientIDToServerID.at(e.Player));
m_Reliable.Send(packet);
return true;
}
bool Client::OnSearchForServers(const Events::SearchForServers& e)
{
m_SearchingForServers = true;
+8
View File
@@ -141,6 +141,9 @@ void Server::parseMessageType(Packet& packet)
case MessageType::OnDoubleJump:
parseDoubleJump(packet);
break;
case MessageType::OnDashEffect:
parseDashEffect(packet);
break;
default:
break;
}
@@ -555,6 +558,11 @@ bool Server::parseDoubleJump(Packet & packet)
return true;
}
void Server::parseDashEffect(Packet& packet)
{
reliableBroadcast(packet);
}
void Server::parseOnInputCommand(Packet& packet)
{
PlayerID player = -1;
+2
View File
@@ -10,6 +10,7 @@
#include "Systems/SpawnerSystem.h"
#include "Systems/PlayerSpawnSystem.h"
#include "Systems/PlayerDeathSystem.h"
#include "Systems/FloatingEffectSystem.h"
#include "Core/EntityFileWriter.h"
#include "Game/Systems/CapturePointSystem.h"
#include "Game/Systems/CapturePointHUDSystem.h"
@@ -120,6 +121,7 @@ Game::Game(int argc, char* argv[])
++updateOrderLevel;
m_SystemPipeline->AddSystem<SoundSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<RaptorCopterSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<FloatingEffectSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<ExplosionEffectSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<HealthSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<PlayerMovementSystem>(updateOrderLevel);
+32 -5
View File
@@ -5,6 +5,7 @@ PlayerMovementSystem::PlayerMovementSystem(SystemParams params)
{
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &PlayerMovementSystem::OnPlayerSpawned);
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &PlayerMovementSystem::OnDoubleJump);
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &PlayerMovementSystem::OnDashAbility);
}
PlayerMovementSystem::~PlayerMovementSystem()
@@ -72,7 +73,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
ComponentWrapper cPhysics = player["Physics"];
//Assault Dash Check
if (player.HasComponent("DashAbility")) {
controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"], player["DashAbility"]["CoolDownTimer"]);
controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"], player["DashAbility"]["CoolDownTimer"], player.ID);
}
wishDirection = controller->Movement() * glm::inverse(glm::quat(ori));
//this makes sure you can only dash in the 4 directions: forw,backw,left,right
@@ -313,11 +314,11 @@ bool PlayerMovementSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e)
{
// If entity does not exist, exit
if (!EntityWrapper(m_World, e.entityID).Valid()) {
if (!EntityWrapper(m_World, e.entityID).Valid()) {
return false;
}
// If entity IsLocalPlayer, exit
if (e.entityID == m_LocalPlayer.ID) {
if (e.entityID == m_LocalPlayer.ID) {
return false;
}
spawnHexagon(EntityWrapper(m_World, e.entityID));
@@ -325,11 +326,37 @@ bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e)
}
void PlayerMovementSystem::spawnHexagon(EntityWrapper target)
{
{
//put a hexagon at the entitys... feet?
auto hexagonEffect = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
EntityFileParser parser(hexagonEffect);
EntityID hexagonEffectID = parser.MergeEntities(m_World);
EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID);
hexagonEW["Transform"]["Position"] = (glm::vec3)target["Transform"]["Position"];
}
}
bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
{
EntityWrapper player(m_World, e.Player);
if (!player.Valid() || !IsClient || player.ID == LocalPlayer.ID) {
return false;
}
auto dashEffectResource = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
EntityFileParser parser(dashEffectResource);
EntityID dashEffectID = parser.MergeEntities(m_World);
EntityWrapper dashEffect(m_World, dashEffectID);
auto playerModel = player.FirstChildByName("PlayerModel");
auto playerEntityModel = playerModel["Model"];
auto playerEntityAnimation = playerModel["Animation"];
playerEntityModel.Copy(dashEffect["Model"]);
playerEntityAnimation.Copy(dashEffect["Animation"]);
dashEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"];
((glm::vec4&)dashEffect["ExplosionEffect"]["EndColor"]).w = 0.f;
dashEffect["Animation"]["Speed1"] = 0.0;
dashEffect["Animation"]["Speed2"] = 0.0;
dashEffect["Animation"]["Speed3"] = 0.0;
dashEffect["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
dashEffect["Transform"]["Orientation"] = (glm::vec3)player["Transform"]["Orientation"];
return true;
}