Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d666bd893d | |||
| ba69c79821 | |||
| 2c3122bbdb | |||
| 7d732c75ca | |||
| 78e318c032 | |||
| bb66f95d43 | |||
| cc422cf73a | |||
| 2e5ee633ce | |||
| 1e04244590 | |||
| d357e365cb | |||
| a8a3366e8a | |||
| 787eecce26 | |||
| a15e01596a | |||
| b5e372896f | |||
| a54156fab3 | |||
| 47053285c8 | |||
| bee0630a26 | |||
| 1dc3756533 | |||
| b9ea314232 | |||
| 71533b52ae | |||
| 6442254575 | |||
| 021c4e36d7 | |||
| fb5164221f | |||
| 88c7c57671 | |||
| 5295133311 | |||
| 0370775820 | |||
| a36ed76a4e | |||
| 30f454e6a4 | |||
| c1860ae383 | |||
| 851418b1de | |||
| fee50ba3b6 |
@@ -109,7 +109,7 @@ public:
|
|||||||
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
||||||
EventRelay<Client, Events::PlayerSpawned> m_EPlayerSpawned;
|
EventRelay<Client, Events::PlayerSpawned> m_EPlayerSpawned;
|
||||||
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
|
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
|
||||||
|
void parsePlayerDamage(Packet& packet);
|
||||||
private:
|
private:
|
||||||
UDPClient m_Unreliable;
|
UDPClient m_Unreliable;
|
||||||
TCPClient m_Reliable;
|
TCPClient m_Reliable;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define NetworkClient_h__
|
#define NetworkClient_h__
|
||||||
|
|
||||||
#include "Network/Packet.h"
|
#include "Network/Packet.h"
|
||||||
#define BUFFERSIZE 32000
|
#define BUFFERSIZE 64000
|
||||||
typedef unsigned int PlayerID;
|
typedef unsigned int PlayerID;
|
||||||
typedef unsigned int PacketID;
|
typedef unsigned int PacketID;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include "Network/Packet.h"
|
#include "Network/Packet.h"
|
||||||
#include "Network/PlayerDefinition.h"
|
#include "Network/PlayerDefinition.h"
|
||||||
#define BUFFERSIZE 32000
|
#define BUFFERSIZE 64000
|
||||||
typedef unsigned int PlayerID;
|
typedef unsigned int PlayerID;
|
||||||
typedef unsigned int PacketID;
|
typedef unsigned int PacketID;
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ private:
|
|||||||
void parseUDPConnect(Packet & packet);
|
void parseUDPConnect(Packet & packet);
|
||||||
void parseTCPConnect(Packet & packet);
|
void parseTCPConnect(Packet & packet);
|
||||||
void parseDisconnect();
|
void parseDisconnect();
|
||||||
|
bool shouldSendToClient(EntityWrapper childEntity);
|
||||||
|
|
||||||
// Debug event
|
// Debug event
|
||||||
EventRelay<Server, Events::InputCommand> m_EInputCommand;
|
EventRelay<Server, Events::InputCommand> m_EInputCommand;
|
||||||
@@ -91,6 +92,8 @@ private:
|
|||||||
bool OnEntityDeleted(const Events::EntityDeleted& e);
|
bool OnEntityDeleted(const Events::EntityDeleted& e);
|
||||||
EventRelay<Server, Events::ComponentDeleted> m_EComponentDeleted;
|
EventRelay<Server, Events::ComponentDeleted> m_EComponentDeleted;
|
||||||
bool OnComponentDeleted(const Events::ComponentDeleted& e);
|
bool OnComponentDeleted(const Events::ComponentDeleted& e);
|
||||||
|
EventRelay<Server, Events::PlayerDamage> m_EPlayerDamage;
|
||||||
|
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef AmmunitionHUDSystem_h__
|
||||||
|
#define AmmunitionHUDSystem_h__
|
||||||
|
|
||||||
|
#include "../../Engine/Core/System.h"
|
||||||
|
#include "../../Engine/GLM.h"
|
||||||
|
|
||||||
|
class AmmunitionHUDSystem : public ImpureSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AmmunitionHUDSystem(SystemParams params)
|
||||||
|
: System(params)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
virtual void Update(double dt) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -3,13 +3,11 @@
|
|||||||
|
|
||||||
#include "../../Engine/Core/System.h"
|
#include "../../Engine/Core/System.h"
|
||||||
#include "../../Engine/GLM.h"
|
#include "../../Engine/GLM.h"
|
||||||
#include "../../Engine/Rendering/ESetCamera.h"
|
|
||||||
#include <imgui/imgui.h>
|
|
||||||
|
|
||||||
class PlayerHUDSystem : public ImpureSystem
|
class HealthHUDSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PlayerHUDSystem(SystemParams params)
|
HealthHUDSystem(SystemParams params)
|
||||||
: System(params)
|
: System(params)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "Sound/EPlaySoundOnEntity.h"
|
#include "Sound/EPlaySoundOnEntity.h"
|
||||||
#include "Collision/Collision.h"
|
#include "Collision/Collision.h"
|
||||||
#include "Rendering/AnimationSystem.h"
|
#include "Rendering/AnimationSystem.h"
|
||||||
|
#include "Core/ConfigFile.h"
|
||||||
#include "WeaponBehaviour.h"
|
#include "WeaponBehaviour.h"
|
||||||
#include "../SpawnerSystem.h"
|
#include "../SpawnerSystem.h"
|
||||||
#include "Core/EPlayerDamage.h"
|
#include "Core/EPlayerDamage.h"
|
||||||
@@ -19,11 +20,13 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
EntityWrapper m_FirstPersonModel;
|
EntityWrapper m_FirstPersonModel;
|
||||||
|
EntityWrapper m_ThirdPersonModel;
|
||||||
// State
|
// State
|
||||||
bool m_Firing = false;
|
bool m_Firing = false;
|
||||||
bool m_Reloading = false;
|
bool m_Reloading = false;
|
||||||
double m_ReloadTimer = 0.0;
|
double m_ReloadTimer = 0.0;
|
||||||
EntityWrapper m_ReloadImpersonator;
|
EntityWrapper m_FirstPersonReloadImpersonator;
|
||||||
|
EntityWrapper m_ThirdPersonReloadImpersonator;
|
||||||
double m_TimeSinceLastFire = 0.0;
|
double m_TimeSinceLastFire = 0.0;
|
||||||
|
|
||||||
EventRelay<WeaponBehaviour, Events::AnimationComplete> m_EAnimationComplete;
|
EventRelay<WeaponBehaviour, Events::AnimationComplete> m_EAnimationComplete;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ StartNetwork=false
|
|||||||
IsServer=false
|
IsServer=false
|
||||||
Name=Bob
|
Name=Bob
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=13
|
Port=27666
|
||||||
MaxConnections=8
|
MaxConnections=8
|
||||||
SnapshotInterval=0.05
|
SnapshotInterval=0.05
|
||||||
SendInputIntervalMs=33
|
SendInputIntervalMs=33
|
||||||
|
|||||||
@@ -40,4 +40,5 @@
|
|||||||
<xs:include schemaLocation="Components/Sprite.xsd"/>
|
<xs:include schemaLocation="Components/Sprite.xsd"/>
|
||||||
<xs:include schemaLocation="Components/Shielded.xsd"/>
|
<xs:include schemaLocation="Components/Shielded.xsd"/>
|
||||||
<xs:include schemaLocation="Components/CapturePointHUD.xsd"/>
|
<xs:include schemaLocation="Components/CapturePointHUD.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/AmmunitionHUD.xsd"/>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<AmmunitionHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AmmunitionHUD.xsd">
|
||||||
|
</AmmunitionHUD>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?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:include schemaLocation="../Types/TeamEnum.xsd"/>
|
||||||
|
<xs:element name="AmmunitionHUD">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Hud element for tracking ammunition from parent with AssaultWeapon component. Child with the name "MagazineAmmo" tracks clip ammunition. Child with the name "Ammo" tracks ammo.</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="AmmunitionHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:AmmunitionHUD/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
|
||||||
|
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="AmmunitionHUDBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.00200000009"/>
|
||||||
|
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MagazineAmmo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>0</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Ammo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>360</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
|
||||||
|
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00200000009" Y="0.00400000019" Z="-0.00100000005"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MagazineAmmo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>0</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Ammo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>360</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
|
||||||
|
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="AmmunitionHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:AmmunitionHUD/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
|
||||||
|
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="AmmunitionHUDBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.00200000009"/>
|
||||||
|
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AmmunitionText">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MagazineAmmo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>32</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Ammo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>360</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
|
||||||
|
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
+3
-2
@@ -1,9 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
<Entity name="HudOrigin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="CapturePointHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-24.3529072" Y="0" Z="6.95243597"/>
|
<Position X="0" Y="0.190541431" Z="0"/>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
@@ -2,27 +2,26 @@
|
|||||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Model>
|
|
||||||
<Resource>Models/Effects/JumpEffectHexagon.mesh</Resource>
|
|
||||||
<Color A="0.576470613" B="500" G="255" R="0.854901969"/>
|
|
||||||
<Transparent>true</Transparent>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.600000024" Y="0.800000012" Z="0"/>
|
|
||||||
<Scale X="0.50000012" Y="0.50000019" Z="0.50000014"/>
|
|
||||||
</c:Transform>
|
|
||||||
<c:Lifetime>
|
<c:Lifetime>
|
||||||
<Lifetime>0.5</Lifetime>
|
<Lifetime>0.5</Lifetime>
|
||||||
</c:Lifetime>
|
</c:Lifetime>
|
||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0" Y="-7.76300049" Z="0"/>
|
<Velocity X="3.60000014" Y="3.93700027" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="2.67900002" Z="0"/>
|
|
||||||
<ExponentialAccelaration>true</ExponentialAccelaration>
|
<ExponentialAccelaration>true</ExponentialAccelaration>
|
||||||
<ExplosionDuration>0.5</ExplosionDuration>
|
<ExplosionDuration>0.5</ExplosionDuration>
|
||||||
<EndColor A="0" B="0" G="0" R="1"/>
|
<EndColor A="0" B="1" G="1" R="1"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
</c:ExplosionEffect>
|
</c:ExplosionEffect>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/JumpEffectHexagon.mesh</Resource>
|
||||||
|
<Color A="0.545098066" B="500" G="255" R="0.854901969"/>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.600000024" Y="0.800000012" Z="0"/>
|
||||||
|
<Scale X="0.500000119" Y="0.500000179" Z="0.500000119"/>
|
||||||
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children/>
|
<Children/>
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="HealthHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="HealthText">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>1</Percentage>
|
||||||
|
<Color A="1" B="1" G="0" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:HealthHUD/>
|
||||||
|
<c:Text>
|
||||||
|
<Content>100/100</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="0.392156869" B="1" G="0" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
|
||||||
|
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
|
||||||
|
<Orientation X="0" Y="0.410000026" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="HealthBar">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>1</Percentage>
|
||||||
|
<Color A="0.196078435" B="1" G="0" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
|
||||||
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:HealthHUD/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.263000011" Y="-0.185000002" Z="0"/>
|
||||||
|
<Scale X="0.106000006" Y="0.333000004" Z="0.150000006"/>
|
||||||
|
<Orientation X="5.87300014" Y="0" Z="4.71200037"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -4925,7 +4925,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:PlayerSpawn/>
|
<c:PlayerSpawn/>
|
||||||
<c:Spawner>
|
<c:Spawner>
|
||||||
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
<EntityFile>Schema/Entities/PlayerRed.xml</EntityFile>
|
||||||
</c:Spawner>
|
</c:Spawner>
|
||||||
<c:Team>
|
<c:Team>
|
||||||
<Team>
|
<Team>
|
||||||
@@ -4987,6 +4987,72 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="SpawnerBlueTeam">
|
||||||
|
<Components>
|
||||||
|
<c:PlayerSpawn/>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Blue/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-4.2177043" Y="5.59916019" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-1" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -23,9 +23,7 @@
|
|||||||
<Blue/>
|
<Blue/>
|
||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Transform>
|
<c:Transform/>
|
||||||
<Position X="0" Y="0.0288832653" Z="2.64837074"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children>
|
<Children>
|
||||||
@@ -71,25 +69,6 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="HealthBar">
|
|
||||||
<Components>
|
|
||||||
<c:Fill>
|
|
||||||
<Percentage>1</Percentage>
|
|
||||||
<Color A="0" B="1" G="0" R="0"/>
|
|
||||||
</c:Fill>
|
|
||||||
<c:HealthHUD/>
|
|
||||||
<c:Model>
|
|
||||||
<Resource>Models/Core/UnitHexagon.mesh</Resource>
|
|
||||||
<Color A="1" B="0.70588237" G="0.70588237" R="0.70588237"/>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="-0.383000016" Y="-0.185000002" Z="0"/>
|
|
||||||
<Scale X="0.150000006" Y="0.150000006" Z="0.150000006"/>
|
|
||||||
<Orientation X="0" Y="0.594000041" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="Crosshair">
|
<Entity name="Crosshair">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
@@ -112,6 +91,221 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="HealthHUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="HealthText">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>1</Percentage>
|
||||||
|
<Color A="1" B="1" G="0" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:HealthHUD/>
|
||||||
|
<c:Text>
|
||||||
|
<Content>100/100</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="0.392156869" B="1" G="0" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
|
||||||
|
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
|
||||||
|
<Orientation X="0" Y="0.410000026" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="HealthBar">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>1</Percentage>
|
||||||
|
<Color A="0.196078435" B="1" G="0" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
|
||||||
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:HealthHUD/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.263000011" Y="-0.185000002" Z="0"/>
|
||||||
|
<Scale X="0.106000006" Y="0.333000004" Z="0.150000006"/>
|
||||||
|
<Orientation X="5.87300014" Y="0" Z="4.71200037"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="CapturePointHUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.190541431" Z="0"/>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.919596612" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>2</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.811270177" Y="0.440691769" Z="-0.100000001"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>3</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>0.80222018197612788</Percentage>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.62788737" Y="0.919596612" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>4</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.820431828" Y="0.441878349" Z="-0.100000001"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>1</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:CapturePointHUD/>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Hands">
|
<Entity name="Hands">
|
||||||
@@ -138,8 +332,8 @@
|
|||||||
<Transparent>true</Transparent>
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.120747983" Y="-0.228997007" Z="-0.151475653"/>
|
<Position X="0.120430604" Y="-0.229735136" Z="-0.181454614"/>
|
||||||
<Orientation X="0.0104046585" Y="-0.00268164417" Z="0.0428441912"/>
|
<Orientation X="0.0104046864" Y="-0.00268157595" Z="0.0428441279"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -154,17 +348,75 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="FirstPersonReloadSpawner">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/ReloadEffectView.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AmmunitionHUD">
|
||||||
|
<Components>
|
||||||
|
<c:AmmunitionHUD/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
|
||||||
|
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="AmmunitionHUDBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.00200000009"/>
|
||||||
|
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AmmunitionText">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MagazineAmmo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>32</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Ammo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>360</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
|
||||||
|
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="FirstPersonReloadSpawner">
|
|
||||||
<Components>
|
|
||||||
<c:Spawner>
|
|
||||||
<EntityFile>Schema/Entities/WeaponReloadEffect.xml</EntityFile>
|
|
||||||
</c:Spawner>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
@@ -198,6 +450,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
|
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0.309803933" R="0"/>
|
<Color A="1" B="1" G="0.309803933" R="0"/>
|
||||||
|
<Visible>false</Visible>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -209,11 +462,10 @@
|
|||||||
</c:BoneAttachment>
|
</c:BoneAttachment>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||||
<Visible>false</Visible>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.15859656" Y="1.02875519" Z="-0.21540691"/>
|
<Position X="0.158596605" Y="1.02875519" Z="-0.215406924"/>
|
||||||
<Orientation X="-0.0626692101" Y="-0.0361935496" Z="0.120095037"/>
|
<Orientation X="-0.0626692027" Y="-0.0361935981" Z="0.120094992"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -228,6 +480,15 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="ThirdPersonReloadSpawner">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/ReloadEffectWorld.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
<Entity name="Explosion" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="Explosion" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation/>
|
||||||
<Name>Hold Pos</Name>
|
|
||||||
</c:Animation>
|
|
||||||
<c:Lifetime>
|
<c:Lifetime>
|
||||||
<Lifetime>2.5</Lifetime>
|
<Lifetime>2.5</Lifetime>
|
||||||
</c:Lifetime>
|
</c:Lifetime>
|
||||||
|
|||||||
@@ -0,0 +1,272 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:AABB>
|
||||||
|
<Origin X="0" Y="0.772000015" Z="0"/>
|
||||||
|
<Size X="1" Y="1.60000002" Z="1"/>
|
||||||
|
</c:AABB>
|
||||||
|
<c:AssaultWeapon>
|
||||||
|
<RPM>600</RPM>
|
||||||
|
</c:AssaultWeapon>
|
||||||
|
<c:Collidable/>
|
||||||
|
<c:DashAbility/>
|
||||||
|
<c:Health/>
|
||||||
|
<c:Physics>
|
||||||
|
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||||
|
</c:Physics>
|
||||||
|
<c:Player>
|
||||||
|
<MovementSpeed>5</MovementSpeed>
|
||||||
|
</c:Player>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Red/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5519.44287" Y="0.0288832653" Z="2.64837074"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Camera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.27700007" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="PlayerName">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,100</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.100000001" Y="0.248000011" Z="-0.248000011"/>
|
||||||
|
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
|
||||||
|
<Orientation X="0" Y="3.14199996" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="CameraModel">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0331346765" Z="-0.0792061687"/>
|
||||||
|
<Scale X="1.30000007" Y="1.50000012" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="HUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="HealthBar">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>1</Percentage>
|
||||||
|
<Color A="0" B="1" G="0" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:HealthHUD/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Core/UnitHexagon.mesh</Resource>
|
||||||
|
<Color A="1" B="0.70588237" G="0.70588237" R="0.70588237"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.383000016" Y="-0.185000002" Z="0"/>
|
||||||
|
<Scale X="0.150000006" Y="0.150000006" Z="0.150000006"/>
|
||||||
|
<Orientation X="0" Y="0.594000041" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Crosshair">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.200000003"/>
|
||||||
|
<Scale X="0.0250000004" Y="0.0250000004" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="HitMarkerSpawner">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/HitMarker.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Hands">
|
||||||
|
<Components>
|
||||||
|
<c:Animation>
|
||||||
|
<AnimationName1>Idle</AnimationName1>
|
||||||
|
<Time1>0.1719161089749548</Time1>
|
||||||
|
<Speed1>1</Speed1>
|
||||||
|
</c:Animation>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="WeaponModel">
|
||||||
|
<Components>
|
||||||
|
<c:BoneAttachment>
|
||||||
|
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||||
|
</c:BoneAttachment>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.1204307" Y="-0.228431284" Z="-0.181454539"/>
|
||||||
|
<Orientation X="0.0104045458" Y="-0.00268182717" Z="0.0428440496"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="WeaponMuzzle">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/RayRed.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.00325386273" Y="0.0970000029" Z="-0.843000054"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="FirstPersonReloadSpawner">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/ReloadEffectView.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ThirdPersonCamera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.284000009" Y="1.83800006" Z="1.18900001"/>
|
||||||
|
<Orientation X="5.95600033" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlayerModel">
|
||||||
|
<Components>
|
||||||
|
<c:Animation>
|
||||||
|
<AnimationName1>Idle</AnimationName1>
|
||||||
|
<Time1>1.8038469763698401</Time1>
|
||||||
|
<Speed1>1</Speed1>
|
||||||
|
</c:Animation>
|
||||||
|
<c:AnimationOffset>
|
||||||
|
<AnimationName>AimRifle</AnimationName>
|
||||||
|
<Time>0.5</Time>
|
||||||
|
</c:AnimationOffset>
|
||||||
|
<c:HiddenForLocalPlayer/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.309803933" R="0"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ThirdPersonWeaponModel">
|
||||||
|
<Components>
|
||||||
|
<c:BoneAttachment>
|
||||||
|
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||||
|
</c:BoneAttachment>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.139178902" Y="0.782200813" Z="-0.246610582"/>
|
||||||
|
<Orientation X="-0.228463098" Y="0.0975924358" Z="0.182726845"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ThirdPersonWeaponMuzzle">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/RayRed.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.00644115033" Y="0.096679531" Z="-0.436609417"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ThirdPersonReloadSpawner">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/ReloadEffectWorld.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AABBStanding">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
|
<Color A="0.427450985" B="1" G="1" R="1"/>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.772000015" Z="0"/>
|
||||||
|
<Scale X="1" Y="1.60000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AABBCrouching">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
|
<Color A="0.745098054" B="1" G="0" R="1"/>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.772000015" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -6,12 +6,12 @@
|
|||||||
<Lifetime>0.25</Lifetime>
|
<Lifetime>0.25</Lifetime>
|
||||||
</c:Lifetime>
|
</c:Lifetime>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Weapons/CylinderBullet.mesh</Resource>
|
<Resource>Models/Effects/CylinderShot.mesh</Resource>
|
||||||
<Color A="0.156862751" B="0" G="0.525490224" R="39.2156868"/>
|
<Color A="0.149019614" B="0" G="0" R="39.2156868"/>
|
||||||
<Transparent>true</Transparent>
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Scale X="0.0110000009" Y="0.029000001" Z="100"/>
|
<Scale X="0.0690000057" Y="0.0690000057" Z="100"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
|
|||||||
+1
-8
@@ -2,9 +2,6 @@
|
|||||||
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:BoneAttachment>
|
|
||||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
|
||||||
</c:BoneAttachment>
|
|
||||||
<c:Lifetime>
|
<c:Lifetime>
|
||||||
<Lifetime>2</Lifetime>
|
<Lifetime>2</Lifetime>
|
||||||
</c:Lifetime>
|
</c:Lifetime>
|
||||||
@@ -18,12 +15,8 @@
|
|||||||
</c:ExplosionEffect>
|
</c:ExplosionEffect>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||||
<Transparent>true</Transparent>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform/>
|
||||||
<Position X="0.120747991" Y="-0.229502052" Z="-0.151475638"/>
|
|
||||||
<Orientation X="0.0104046296" Y="-0.00268167513" Z="0.0428442545"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Lifetime>
|
||||||
|
<Lifetime>2</Lifetime>
|
||||||
|
</c:Lifetime>
|
||||||
|
<c:ExplosionEffect>
|
||||||
|
<ColorByDistance>true</ColorByDistance>
|
||||||
|
<Velocity X="1.63300014" Y="0.0320000015" Z="0"/>
|
||||||
|
<ExplosionOrigin X="0" Y="0.0790000036" Z="-0.329000026"/>
|
||||||
|
<ExponentialAccelaration>true</ExponentialAccelaration>
|
||||||
|
<EndColor A="0" B="19.6078434" G="19.6078434" R="1"/>
|
||||||
|
<Randomness>true</Randomness>
|
||||||
|
</c:ExplosionEffect>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children/>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="MagazineAmmo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>0</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Ammo">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>360</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
|
||||||
|
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -43,6 +43,9 @@
|
|||||||
<xs:element ref="c:Shield" minOccurs="0"/>
|
<xs:element ref="c:Shield" minOccurs="0"/>
|
||||||
<xs:element ref="c:Shielded" minOccurs="0"/>
|
<xs:element ref="c:Shielded" minOccurs="0"/>
|
||||||
<xs:element ref="c:CapturePointHUD" minOccurs="0"/>
|
<xs:element ref="c:CapturePointHUD" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:AmmunitionHUD" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Sprite" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:AnimationOffset" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ void Client::parseMessageType(Packet& packet)
|
|||||||
case MessageType::ComponentDeleted:
|
case MessageType::ComponentDeleted:
|
||||||
parseComponentDeletion(packet);
|
parseComponentDeletion(packet);
|
||||||
break;
|
break;
|
||||||
|
case MessageType::OnPlayerDamage:
|
||||||
|
parsePlayerDamage(packet);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -181,14 +184,13 @@ void Client::parseSpawnEvents()
|
|||||||
std::vector<Events::PlayerSpawned> tempSpawn;
|
std::vector<Events::PlayerSpawned> tempSpawn;
|
||||||
for (int i = 0; i < m_PlayerSpawnEvents.size(); i++) {
|
for (int i = 0; i < m_PlayerSpawnEvents.size(); i++) {
|
||||||
Events::PlayerSpawned e;
|
Events::PlayerSpawned e;
|
||||||
if (!serverClientMapsHasEntity(m_PlayerSpawnEvents.at(i).Player.ID) ||
|
if (!serverClientMapsHasEntity(m_PlayerSpawnEvents.at(i).Player.ID)) {
|
||||||
!serverClientMapsHasEntity(m_PlayerSpawnEvents.at(i).Spawner.ID)) {
|
|
||||||
tempSpawn.push_back(m_PlayerSpawnEvents.at(i));
|
tempSpawn.push_back(m_PlayerSpawnEvents.at(i));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(m_PlayerSpawnEvents.at(i).Player.ID));
|
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(m_PlayerSpawnEvents.at(i).Player.ID));
|
||||||
e.Spawner = EntityWrapper(m_World, m_ServerIDToClientID.at(m_PlayerSpawnEvents.at(i).Spawner.ID));
|
//e.Spawner = EntityWrapper(m_World, m_ServerIDToClientID.at(m_PlayerSpawnEvents.at(i).Spawner.ID));
|
||||||
e.PlayerID = -1;
|
e.PlayerID = -1;
|
||||||
e.PlayerName = m_PlayerSpawnEvents.at(i).PlayerName;
|
e.PlayerName = m_PlayerSpawnEvents.at(i).PlayerName;
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
@@ -288,10 +290,14 @@ void Client::parseSnapshot(Packet& packet)
|
|||||||
Events::InputCommand e;
|
Events::InputCommand e;
|
||||||
e.PlayerID = packet.ReadPrimitive<EntityID>();
|
e.PlayerID = packet.ReadPrimitive<EntityID>();
|
||||||
EntityID player = packet.ReadPrimitive<EntityID>();
|
EntityID player = packet.ReadPrimitive<EntityID>();
|
||||||
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(player));
|
std::string command = packet.ReadString();
|
||||||
e.Command = packet.ReadString();
|
float value = packet.ReadPrimitive<float>();
|
||||||
e.Value = packet.ReadPrimitive<float>();
|
if (m_ServerIDToClientID.find(player) != m_ServerIDToClientID.end()) {
|
||||||
m_EventBroker->Publish(e);
|
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(player));
|
||||||
|
e.Command = command;
|
||||||
|
e.Value = value;
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read world state
|
// Read world state
|
||||||
@@ -406,12 +412,17 @@ bool Client::OnInputCommand(const Events::InputCommand & e)
|
|||||||
|
|
||||||
bool Client::OnPlayerDamage(const Events::PlayerDamage & e)
|
bool Client::OnPlayerDamage(const Events::PlayerDamage & e)
|
||||||
{
|
{
|
||||||
|
if (e.Inflictor != m_LocalPlayer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Packet packet(MessageType::OnPlayerDamage, m_SendPacketID);
|
Packet packet(MessageType::OnPlayerDamage, m_SendPacketID);
|
||||||
packet.WritePrimitive(m_ClientIDToServerID.at(e.Inflictor.ID));
|
packet.WritePrimitive(m_ClientIDToServerID.at(e.Inflictor.ID));
|
||||||
packet.WritePrimitive(m_ClientIDToServerID.at(e.Victim.ID));
|
packet.WritePrimitive(m_ClientIDToServerID.at(e.Victim.ID));
|
||||||
packet.WritePrimitive(e.Damage);
|
packet.WritePrimitive(e.Damage);
|
||||||
m_Reliable.Send(packet);
|
m_Reliable.Send(packet);
|
||||||
return false;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e)
|
bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e)
|
||||||
@@ -422,22 +433,48 @@ bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::parsePlayerDamage(Packet& packet)
|
||||||
|
{
|
||||||
|
Events::PlayerDamage e;
|
||||||
|
PlayerID victimID = packet.ReadPrimitive<EntityID>();
|
||||||
|
if(!serverClientMapsHasEntity(victimID)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.Inflictor = EntityWrapper(m_World, m_ServerIDToClientID.at(victimID));
|
||||||
|
e.Victim = EntityWrapper(m_World, m_ServerIDToClientID.at(packet.ReadPrimitive<EntityID>()));
|
||||||
|
e.Damage = packet.ReadPrimitive<double>();
|
||||||
|
// Don't rebroadcast our own player damage events or we'll have an infinite loop!
|
||||||
|
if (e.Inflictor != m_LocalPlayer) {
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Client::sendLocalPlayerTransform()
|
void Client::sendLocalPlayerTransform()
|
||||||
{
|
{
|
||||||
if (!m_LocalPlayer.Valid()) {
|
if (!m_LocalPlayer.Valid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Packet packet(MessageType::PlayerTransform, m_SendPacketID);
|
||||||
|
|
||||||
ComponentWrapper cTransform = m_LocalPlayer["Transform"];
|
ComponentWrapper cTransform = m_LocalPlayer["Transform"];
|
||||||
glm::vec3& position = cTransform["Position"];
|
glm::vec3& position = cTransform["Position"];
|
||||||
glm::vec3& orientation = cTransform["Orientation"];
|
glm::vec3& orientation = cTransform["Orientation"];
|
||||||
Packet packet(MessageType::PlayerTransform, m_SendPacketID);
|
|
||||||
packet.WritePrimitive(position.x);
|
packet.WritePrimitive(position.x);
|
||||||
packet.WritePrimitive(position.y);
|
packet.WritePrimitive(position.y);
|
||||||
packet.WritePrimitive(position.z);
|
packet.WritePrimitive(position.z);
|
||||||
packet.WritePrimitive(orientation.x);
|
packet.WritePrimitive(orientation.x);
|
||||||
packet.WritePrimitive(orientation.y);
|
packet.WritePrimitive(orientation.y);
|
||||||
packet.WritePrimitive(orientation.z);
|
packet.WritePrimitive(orientation.z);
|
||||||
|
|
||||||
|
bool hasAssaultWeapon = m_LocalPlayer.HasComponent("AssaultWeapon");
|
||||||
|
packet.WritePrimitive(hasAssaultWeapon);
|
||||||
|
if (hasAssaultWeapon) {
|
||||||
|
ComponentWrapper cAssaultWeapon = m_LocalPlayer["AssaultWeapon"];
|
||||||
|
packet.WritePrimitive((int)cAssaultWeapon["MagazineAmmo"]);
|
||||||
|
packet.WritePrimitive((int)cAssaultWeapon["Ammo"]);
|
||||||
|
}
|
||||||
|
|
||||||
m_Unreliable.Send(packet);
|
m_Unreliable.Send(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Server::Server(World* world, EventBroker* eventBroker, int port)
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Server::OnPlayerSpawned);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Server::OnPlayerSpawned);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &Server::OnEntityDeleted);
|
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &Server::OnEntityDeleted);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EComponentDeleted, &Server::OnComponentDeleted);
|
EVENT_SUBSCRIBE_MEMBER(m_EComponentDeleted, &Server::OnComponentDeleted);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &Server::OnPlayerDamage);
|
||||||
|
|
||||||
// Bind
|
// Bind
|
||||||
if (port == 0) {
|
if (port == 0) {
|
||||||
@@ -170,6 +171,12 @@ void Server::addChildrenToPacket(Packet & packet, EntityID entityID)
|
|||||||
// Loop through every child
|
// Loop through every child
|
||||||
for (auto it = itPair.first; it != itPair.second; it++) {
|
for (auto it = itPair.first; it != itPair.second; it++) {
|
||||||
EntityID childEntityID = it->second;
|
EntityID childEntityID = it->second;
|
||||||
|
// HACK: Only sync players for now, since the map turned out to be TOO LARGE to send in one snapshot and Simon's computer shits itself
|
||||||
|
EntityWrapper childEntity(m_World, childEntityID);
|
||||||
|
if (!shouldSendToClient(childEntity)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Write EntityID and parentsID and Entity name
|
// Write EntityID and parentsID and Entity name
|
||||||
packet.WritePrimitive(childEntityID);
|
packet.WritePrimitive(childEntityID);
|
||||||
packet.WritePrimitive(entityID);
|
packet.WritePrimitive(entityID);
|
||||||
@@ -328,6 +335,7 @@ void Server::disconnect(PlayerID playerID)
|
|||||||
//m_World->DeleteEntity(m_ConnectedPlayers[playerID].EntityID);
|
//m_World->DeleteEntity(m_ConnectedPlayers[playerID].EntityID);
|
||||||
m_ConnectedPlayers[playerID].TCPSocket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
|
m_ConnectedPlayers[playerID].TCPSocket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
|
||||||
m_ConnectedPlayers[playerID].TCPSocket->close();
|
m_ConnectedPlayers[playerID].TCPSocket->close();
|
||||||
|
m_World->DeleteEntity(m_ConnectedPlayers[playerID].EntityID);
|
||||||
m_ConnectedPlayers.erase(playerID);
|
m_ConnectedPlayers.erase(playerID);
|
||||||
// Send disconnect to the other players.
|
// Send disconnect to the other players.
|
||||||
}
|
}
|
||||||
@@ -401,14 +409,26 @@ bool Server::OnEntityDeleted(const Events::EntityDeleted & e)
|
|||||||
bool Server::OnComponentDeleted(const Events::ComponentDeleted & e)
|
bool Server::OnComponentDeleted(const Events::ComponentDeleted & e)
|
||||||
{
|
{
|
||||||
if (!e.Cascaded) {
|
if (!e.Cascaded) {
|
||||||
Packet packet = Packet(MessageType::ComponentDeleted);
|
if (shouldSendToClient(EntityWrapper(m_World, e.Entity))) {
|
||||||
packet.WritePrimitive<EntityID>(e.Entity);
|
Packet packet = Packet(MessageType::ComponentDeleted);
|
||||||
packet.WriteString(e.ComponentType);
|
packet.WritePrimitive<EntityID>(e.Entity);
|
||||||
reliableBroadcast(packet);
|
packet.WriteString(e.ComponentType);
|
||||||
|
reliableBroadcast(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Server::OnPlayerDamage(const Events::PlayerDamage& e)
|
||||||
|
{
|
||||||
|
Packet packet(MessageType::OnPlayerDamage);
|
||||||
|
packet.WritePrimitive(e.Inflictor.ID);
|
||||||
|
packet.WritePrimitive(e.Victim.ID);
|
||||||
|
packet.WritePrimitive(e.Damage);
|
||||||
|
reliableBroadcast(packet);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void Server::parseClientPing()
|
void Server::parseClientPing()
|
||||||
{
|
{
|
||||||
@@ -447,7 +467,7 @@ void Server::parseOnInputCommand(Packet& packet)
|
|||||||
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
|
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
|
||||||
e.Value = packet.ReadPrimitive<float>();
|
e.Value = packet.ReadPrimitive<float>();
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
if (e.Command == "PrimaryFire") {
|
if (e.Command == "PrimaryFire" || e.Command == "Reload") {
|
||||||
m_InputCommandsToBroadcast.push_back(e);
|
m_InputCommandsToBroadcast.push_back(e);
|
||||||
}
|
}
|
||||||
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
|
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
|
||||||
@@ -457,6 +477,11 @@ void Server::parseOnInputCommand(Packet& packet)
|
|||||||
|
|
||||||
void Server::parsePlayerTransform(Packet& packet)
|
void Server::parsePlayerTransform(Packet& packet)
|
||||||
{
|
{
|
||||||
|
PlayerID playerID = GetPlayerIDFromEndpoint();
|
||||||
|
if (playerID == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::vec3 orientation;
|
glm::vec3 orientation;
|
||||||
position.x = packet.ReadPrimitive<float>();
|
position.x = packet.ReadPrimitive<float>();
|
||||||
@@ -466,15 +491,31 @@ void Server::parsePlayerTransform(Packet& packet)
|
|||||||
orientation.y = packet.ReadPrimitive<float>();
|
orientation.y = packet.ReadPrimitive<float>();
|
||||||
orientation.z = packet.ReadPrimitive<float>();
|
orientation.z = packet.ReadPrimitive<float>();
|
||||||
|
|
||||||
PlayerID playerID = GetPlayerIDFromEndpoint();
|
bool hasAssaultWeapon = packet.ReadPrimitive<bool>();
|
||||||
EntityWrapper player(m_World, m_ConnectedPlayers.at(playerID).EntityID);
|
int magazineAmmo;
|
||||||
|
int ammo;
|
||||||
|
if (hasAssaultWeapon) {
|
||||||
|
magazineAmmo = packet.ReadPrimitive<int>();
|
||||||
|
ammo = packet.ReadPrimitive<int>();
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityWrapper player(m_World, m_ConnectedPlayers.at(playerID).EntityID);
|
||||||
if (player.Valid()) {
|
if (player.Valid()) {
|
||||||
player["Transform"]["Position"] = position;
|
player["Transform"]["Position"] = position;
|
||||||
player["Transform"]["Orientation"] = orientation;
|
player["Transform"]["Orientation"] = orientation;
|
||||||
|
|
||||||
|
if (hasAssaultWeapon) {
|
||||||
|
player["AssaultWeapon"]["MagazineAmmo"] = magazineAmmo;
|
||||||
|
player["AssaultWeapon"]["Ammo"] = ammo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Server::shouldSendToClient(EntityWrapper childEntity)
|
||||||
|
{
|
||||||
|
return childEntity.HasComponent("Player") || childEntity.FirstParentWithComponent("Player").Valid();
|
||||||
|
}
|
||||||
|
|
||||||
PlayerID Server::GetPlayerIDFromEndpoint()
|
PlayerID Server::GetPlayerIDFromEndpoint()
|
||||||
{
|
{
|
||||||
// check both tcp and udp connection
|
// check both tcp and udp connection
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ void RenderSystem::fillSprites(std::list<std::shared_ptr<RenderJob>>& jobs, Worl
|
|||||||
|
|
||||||
bool RenderSystem::isEntityVisible(EntityWrapper& entity)
|
bool RenderSystem::isEntityVisible(EntityWrapper& entity)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Only render children of a camera if that camera is currently active
|
// Only render children of a camera if that camera is currently active
|
||||||
if (isChildOfACamera(entity) && !isChildOfCurrentCamera(entity)) {
|
if (isChildOfACamera(entity) && !isChildOfCurrentCamera(entity)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -87,7 +86,11 @@ bool RenderSystem::isEntityVisible(EntityWrapper& entity)
|
|||||||
|
|
||||||
// Hide things parented to local player if they have the HiddenFromLocalPlayer component
|
// Hide things parented to local player if they have the HiddenFromLocalPlayer component
|
||||||
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
|
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
|
||||||
if (entity.HasComponent("HiddenForLocalPlayer") && (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) && !outOfBodyExperience) {
|
if (
|
||||||
|
(entity.HasComponent("HiddenForLocalPlayer") || entity.FirstParentWithComponent("HiddenForLocalPlayer").Valid())
|
||||||
|
&& (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer))
|
||||||
|
&& !outOfBodyExperience
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ void Renderer::SortRenderJobsByDepth(RenderScene &scene)
|
|||||||
//Sort all forward jobs so transparency is good.
|
//Sort all forward jobs so transparency is good.
|
||||||
scene.Jobs.TransparentObjects.sort(Renderer::DepthSort);
|
scene.Jobs.TransparentObjects.sort(Renderer::DepthSort);
|
||||||
scene.Jobs.SpriteJob.sort(Renderer::DepthSort);
|
scene.Jobs.SpriteJob.sort(Renderer::DepthSort);
|
||||||
|
scene.Jobs.Text.sort(Renderer::DepthSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type)
|
void Renderer::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type)
|
||||||
|
|||||||
+5
-2
@@ -18,12 +18,14 @@
|
|||||||
#include "Game/Systems/DamageIndicatorSystem.h"
|
#include "Game/Systems/DamageIndicatorSystem.h"
|
||||||
#include "Game/Systems/Weapon/WeaponSystem.h"
|
#include "Game/Systems/Weapon/WeaponSystem.h"
|
||||||
#include "Rendering/AnimationSystem.h"
|
#include "Rendering/AnimationSystem.h"
|
||||||
#include "Game/Systems/PlayerHUDSystem.h"
|
#include "Game/Systems/HealthHUDSystem.h"
|
||||||
#include "Rendering/BoneAttachmentSystem.h"
|
#include "Rendering/BoneAttachmentSystem.h"
|
||||||
#include "Game/Systems/LifetimeSystem.h"
|
#include "Game/Systems/LifetimeSystem.h"
|
||||||
#include "../Engine/Core/UniformScaleSystem.h"
|
#include "../Engine/Core/UniformScaleSystem.h"
|
||||||
#include "Rendering/AnimationSystem.h"
|
#include "Rendering/AnimationSystem.h"
|
||||||
#include "Network/MultiplayerSnapshotFilter.h"
|
#include "Network/MultiplayerSnapshotFilter.h"
|
||||||
|
#include "Game/Systems/AmmunitionHUDSystem.h"
|
||||||
|
|
||||||
|
|
||||||
Game::Game(int argc, char* argv[])
|
Game::Game(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
@@ -127,6 +129,7 @@ Game::Game(int argc, char* argv[])
|
|||||||
m_SystemPipeline->AddSystem<PickupSpawnSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<PickupSpawnSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<AmmoPickupSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<AmmoPickupSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<DamageIndicatorSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<DamageIndicatorSystem>(updateOrderLevel);
|
||||||
|
m_SystemPipeline->AddSystem<AmmunitionHUDSystem>(updateOrderLevel);
|
||||||
// Populate Octree with collidables
|
// Populate Octree with collidables
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
|
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
|
||||||
@@ -134,8 +137,8 @@ Game::Game(int argc, char* argv[])
|
|||||||
m_SystemPipeline->AddSystem<FillFrustumOctreeSystem>(updateOrderLevel, m_OctreeFrustrumCulling);
|
m_SystemPipeline->AddSystem<FillFrustumOctreeSystem>(updateOrderLevel, m_OctreeFrustrumCulling);
|
||||||
m_SystemPipeline->AddSystem<AnimationSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<AnimationSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<UniformScaleSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<UniformScaleSystem>(updateOrderLevel);
|
||||||
|
m_SystemPipeline->AddSystem<HealthHUDSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<PlayerDeathSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<PlayerDeathSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<PlayerHUDSystem>(updateOrderLevel);
|
|
||||||
// Collision and TriggerSystem should update after player.
|
// Collision and TriggerSystem should update after player.
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
m_SystemPipeline->AddSystem<BoneAttachmentSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<BoneAttachmentSystem>(updateOrderLevel);
|
||||||
|
|||||||
@@ -9,7 +9,15 @@ MultiplayerSnapshotFilter::MultiplayerSnapshotFilter(EventBroker* eventBroker)
|
|||||||
bool MultiplayerSnapshotFilter::FilterComponent(EntityWrapper entity, SharedComponentWrapper& component)
|
bool MultiplayerSnapshotFilter::FilterComponent(EntityWrapper entity, SharedComponentWrapper& component)
|
||||||
{
|
{
|
||||||
if (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) {
|
if (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) {
|
||||||
return false;
|
if (
|
||||||
|
component.Info.Name == "Transform"
|
||||||
|
|| component.Info.Name == "Physics"
|
||||||
|
|| component.Info.Name == "AssaultWeapon"
|
||||||
|
|| component.Info.Name == "Animation"
|
||||||
|
|| component.Info.Name == "AnimationOffset"
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.Info.Name == "Physics") {
|
if (component.Info.Name == "Physics") {
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#include "Game/Systems/AmmunitionHUDSystem.h"
|
||||||
|
|
||||||
|
void AmmunitionHUDSystem::Update(double dt)
|
||||||
|
{
|
||||||
|
//Hud element for tracking ammunition from parent with AssaultWeapon component.Child with the name "MagazineAmmo" tracks clip ammunition.Child with the name "Ammo" tracks ammo.</xs:documentation>
|
||||||
|
|
||||||
|
auto ammunitionHUDs = m_World->GetComponents("AmmunitionHUD");
|
||||||
|
if (ammunitionHUDs == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& ammunitionHUDComponent : *ammunitionHUDs) {
|
||||||
|
EntityWrapper entity = EntityWrapper(m_World, ammunitionHUDComponent.EntityID);
|
||||||
|
|
||||||
|
EntityWrapper playerEntity = entity.FirstParentWithComponent("AssaultWeapon");
|
||||||
|
|
||||||
|
if (!playerEntity.Valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EntityWrapper magazineAmmo = entity.FirstChildByName("MagazineAmmo");
|
||||||
|
if(magazineAmmo.Valid()) {
|
||||||
|
if(magazineAmmo.HasComponent("Text")) {
|
||||||
|
(std::string&)magazineAmmo["Text"]["Content"] = std::to_string((int)playerEntity["AssaultWeapon"]["MagazineAmmo"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityWrapper ammo = entity.FirstChildByName("Ammo");
|
||||||
|
if (ammo.Valid()) {
|
||||||
|
if (ammo.HasComponent("Text")) {
|
||||||
|
(std::string&)ammo["Text"]["Content"] = std::to_string((int)playerEntity["AssaultWeapon"]["Ammo"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,10 @@ void CapturePointHUDSystem::Update(double dt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!CapturePointHUDElements) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& cCapturePointHUD : *CapturePointHUDElements) {
|
for (auto& cCapturePointHUD : *CapturePointHUDElements) {
|
||||||
int HUD_ID = cCapturePointHUD["CapturePointNumber"];
|
int HUD_ID = cCapturePointHUD["CapturePointNumber"];
|
||||||
EntityWrapper entityHUD = EntityWrapper(m_World, cCapturePointHUD.EntityID);
|
EntityWrapper entityHUD = EntityWrapper(m_World, cCapturePointHUD.EntityID);
|
||||||
|
|||||||
@@ -6,15 +6,21 @@ CapturePointSystem::CapturePointSystem(SystemParams params)
|
|||||||
, PureSystem("CapturePoint")
|
, PureSystem("CapturePoint")
|
||||||
{
|
{
|
||||||
//subscribe/listenTo playerdamage,healthpickup events (using the eventBroker)
|
//subscribe/listenTo playerdamage,healthpickup events (using the eventBroker)
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &CapturePointSystem::OnTriggerTouch);
|
if (IsClient) {
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &CapturePointSystem::OnTriggerLeave);
|
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &CapturePointSystem::OnTriggerTouch);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &CapturePointSystem::OnCaptured);
|
EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &CapturePointSystem::OnTriggerLeave);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &CapturePointSystem::OnCaptured);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//here all capturepoints will update their component
|
//here all capturepoints will update their component
|
||||||
//NOTE: needs to run each frame, since we're possibly modifying the captureTimer for the capturePoints by dt
|
//NOTE: needs to run each frame, since we're possibly modifying the captureTimer for the capturePoints by dt
|
||||||
void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, ComponentWrapper& cCapturePoint, double dt)
|
void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, ComponentWrapper& cCapturePoint, double dt)
|
||||||
{
|
{
|
||||||
|
if (!IsClient) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_WinnerWasFound) {
|
if (m_WinnerWasFound) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,15 @@ bool DamageIndicatorSystem::OnPlayerDamage(Events::PlayerDamage& e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Victim != LocalPlayer) {
|
//if (e.Victim != LocalPlayer) {
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
if (e.Victim.Valid() && e.Victim != LocalPlayer && !e.Victim.IsChildOf(LocalPlayer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!e.Inflictor.Valid() || !e.Victim.Valid()) {
|
if (!e.Inflictor.Valid() || !e.Victim.Valid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//grab players direction
|
//grab players direction
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Game/Systems/PlayerHUDSystem.h"
|
#include "Game/Systems/HealthHUDSystem.h"
|
||||||
|
|
||||||
void PlayerHUDSystem::Update(double dt)
|
void HealthHUDSystem::Update(double dt)
|
||||||
{
|
{
|
||||||
auto healthHUDs = m_World->GetComponents("HealthHUD");
|
auto healthHUDs = m_World->GetComponents("HealthHUD");
|
||||||
if (healthHUDs == nullptr) {
|
if (healthHUDs == nullptr) {
|
||||||
@@ -27,13 +27,13 @@ void PlayerHUDSystem::Update(double dt)
|
|||||||
s = s + "/";
|
s = s + "/";
|
||||||
s = s + std::to_string((int)(double)entityIDParent["Health"]["MaxHealth"]);
|
s = s + std::to_string((int)(double)entityIDParent["Health"]["MaxHealth"]);
|
||||||
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
|
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
|
||||||
(glm::vec4&)entity["Text"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, 1.f);
|
(glm::vec4&)entity["Text"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Text"]["Color"]).a);
|
||||||
entity["Text"]["Content"] = s;
|
entity["Text"]["Content"] = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.HasComponent("Fill")) {
|
if(entity.HasComponent("Fill")) {
|
||||||
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
|
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
|
||||||
(glm::vec4&)entity["Fill"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, 0.f);
|
(glm::vec4&)entity["Fill"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Fill"]["Color"]).a);
|
||||||
(double&)entity["Fill"]["Percentage"] = healthPercentage;
|
(double&)entity["Fill"]["Percentage"] = healthPercentage;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,23 +10,27 @@ HealthSystem::HealthSystem(SystemParams params)
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &HealthSystem::OnInputCommand);
|
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &HealthSystem::OnInputCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
|
void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cHealth, double dt)
|
||||||
{
|
{
|
||||||
|
double& health = cHealth["Health"];
|
||||||
|
if (health <= 0.0) {
|
||||||
|
Events::PlayerDeath ePlayerDeath;
|
||||||
|
ePlayerDeath.Player = entity;
|
||||||
|
m_EventBroker->Publish(ePlayerDeath);
|
||||||
|
//Note: we will delete the entity in PlayerDeathSystem
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e)
|
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e)
|
||||||
{
|
{
|
||||||
|
if (!IsServer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ComponentWrapper cHealth = e.Victim["Health"];
|
ComponentWrapper cHealth = e.Victim["Health"];
|
||||||
double& health = cHealth["Health"];
|
double& health = cHealth["Health"];
|
||||||
health -= e.Damage;
|
health -= e.Damage;
|
||||||
|
|
||||||
if (health <= 0.0) {
|
|
||||||
Events::PlayerDeath ePlayerDeath;
|
|
||||||
ePlayerDeath.Player = e.Victim;
|
|
||||||
m_EventBroker->Publish(ePlayerDeath);
|
|
||||||
//Note: we will delete the entity in PlayerDeathSystem
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +38,7 @@ bool HealthSystem::OnInputCommand(Events::InputCommand& e)
|
|||||||
{
|
{
|
||||||
if (e.Command == "TakeDamage" && e.Value > 0 && LocalPlayer.Valid()) {
|
if (e.Command == "TakeDamage" && e.Value > 0 && LocalPlayer.Valid()) {
|
||||||
Events::PlayerDamage ev;
|
Events::PlayerDamage ev;
|
||||||
|
ev.Inflictor = LocalPlayer;
|
||||||
ev.Victim = LocalPlayer;
|
ev.Victim = LocalPlayer;
|
||||||
ev.Damage = e.Value;
|
ev.Damage = e.Value;
|
||||||
m_EventBroker->Publish(ev);
|
m_EventBroker->Publish(ev);
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
||||||
if (playerModel.Valid()) {
|
if (playerModel.Valid()) {
|
||||||
ComponentWrapper cAnimationOffset = playerModel["AnimationOffset"];
|
ComponentWrapper cAnimationOffset = playerModel["AnimationOffset"];
|
||||||
double time = (cameraOrientation.x + glm::half_pi<float>()) / glm::pi<float>();
|
float pitch = cameraOrientation.x + 0.2;
|
||||||
|
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
|
||||||
cAnimationOffset["Time"] = time;
|
cAnimationOffset["Time"] = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,15 +114,17 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
if (isOnGround) {
|
if (isOnGround) {
|
||||||
controller->SetDoubleJumping(false);
|
controller->SetDoubleJumping(false);
|
||||||
} else {
|
} else {
|
||||||
//put a hexagon at the players feet
|
if (IsClient) {
|
||||||
auto hexagonEffect = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
|
//put a hexagon at the players feet
|
||||||
EntityFileParser parser(hexagonEffect);
|
auto hexagonEffect = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
|
||||||
EntityID hexagonEffectID = parser.MergeEntities(m_World);
|
EntityFileParser parser(hexagonEffect);
|
||||||
EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID);
|
EntityID hexagonEffectID = parser.MergeEntities(m_World);
|
||||||
hexagonEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
|
EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID);
|
||||||
controller->SetDoubleJumping(true);
|
hexagonEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
|
||||||
Events::DoubleJump e;
|
controller->SetDoubleJumping(true);
|
||||||
m_EventBroker->Publish(e);
|
Events::DoubleJump e;
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
velocity.y = 4.f;
|
velocity.y = 4.f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,8 +176,15 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
|
|||||||
if ((ComponentInfo::EnumType)cTeam["Team"] == cTeam["Team"].Enum("Spectator")) {
|
if ((ComponentInfo::EnumType)cTeam["Team"] == cTeam["Team"].Enum("Spectator")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_PlayerIDs.count(e.Player.ID) == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SpawnRequest req;
|
SpawnRequest req;
|
||||||
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
|
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
|
||||||
req.Team = cTeam["Team"];
|
req.Team = cTeam["Team"];
|
||||||
m_SpawnRequests.push_back(req);
|
m_SpawnRequests.push_back(req);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,15 @@ SoundSystem::SoundSystem(SystemParams params)
|
|||||||
{
|
{
|
||||||
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
|
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||||
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
|
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
|
if (IsClient) {
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
|
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &SoundSystem::OnDashAbility);
|
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
|
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &SoundSystem::OnDashAbility);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
|
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt)
|
void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt)
|
||||||
@@ -20,6 +22,10 @@ void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComp
|
|||||||
|
|
||||||
void SoundSystem::Update(double dt)
|
void SoundSystem::Update(double dt)
|
||||||
{
|
{
|
||||||
|
if (!IsClient) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Temp for play test.
|
// Temp for play test.
|
||||||
if (m_DrumsIsPlaying) {
|
if (m_DrumsIsPlaying) {
|
||||||
m_DrumsIsPlaying = !drumTimer(dt);
|
m_DrumsIsPlaying = !drumTimer(dt);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ AssaultWeaponBehaviour::AssaultWeaponBehaviour(SystemParams systemParams, IRende
|
|||||||
: WeaponBehaviour(systemParams, renderer, collisionOctree, player)
|
: WeaponBehaviour(systemParams, renderer, collisionOctree, player)
|
||||||
{
|
{
|
||||||
m_FirstPersonModel = m_Player.FirstChildByName("Hands");
|
m_FirstPersonModel = m_Player.FirstChildByName("Hands");
|
||||||
|
m_ThirdPersonModel = m_Player.FirstChildByName("PlayerModel");
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EAnimationComplete, &AssaultWeaponBehaviour::OnAnimationComplete);
|
EVENT_SUBSCRIBE_MEMBER(m_EAnimationComplete, &AssaultWeaponBehaviour::OnAnimationComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,9 +51,14 @@ void AssaultWeaponBehaviour::Update(double dt)
|
|||||||
if (m_Reloading) {
|
if (m_Reloading) {
|
||||||
m_ReloadTimer -= dt;
|
m_ReloadTimer -= dt;
|
||||||
// Re-enable glow on reload impersonator half-way through the animation
|
// Re-enable glow on reload impersonator half-way through the animation
|
||||||
if (m_ReloadTimer <= (double)m_Player["AssaultWeapon"]["ReloadTime"] / 2.0) {
|
if (IsClient) {
|
||||||
if (m_ReloadImpersonator.Valid()) {
|
if (m_ReloadTimer <= (double)m_Player["AssaultWeapon"]["ReloadTime"] / 2.0) {
|
||||||
m_ReloadImpersonator["Model"]["GlowMap"] = true;
|
if (m_FirstPersonReloadImpersonator.Valid()) {
|
||||||
|
m_FirstPersonReloadImpersonator["Model"]["GlowMap"] = true;
|
||||||
|
}
|
||||||
|
if (m_ThirdPersonReloadImpersonator.Valid()) {
|
||||||
|
m_ThirdPersonReloadImpersonator["Model"]["GlowMap"] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_ReloadTimer <= 0) {
|
if (m_ReloadTimer <= 0) {
|
||||||
@@ -69,14 +75,18 @@ void AssaultWeaponBehaviour::Update(double dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_Firing && !m_Reloading) {
|
if (!m_Firing && !m_Reloading) {
|
||||||
playIdleAnimation();
|
if (IsClient) {
|
||||||
|
playIdleAnimation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable glow map on weapon if it's out of ammo
|
// Disable glow map on weapon if it's out of ammo
|
||||||
// Make real first person weapon model visible again
|
// Make real first person weapon model visible again
|
||||||
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
|
if (IsClient) {
|
||||||
if (firstPersonWeaponModel.Valid()) {
|
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
|
||||||
firstPersonWeaponModel["Model"]["GlowMap"] = hasAmmo();
|
if (firstPersonWeaponModel.Valid()) {
|
||||||
|
firstPersonWeaponModel["Model"]["GlowMap"] = hasAmmo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,16 +131,19 @@ void AssaultWeaponBehaviour::fireRound()
|
|||||||
|
|
||||||
// Fire
|
// Fire
|
||||||
magAmmo -= 1;
|
magAmmo -= 1;
|
||||||
spawnTracer();
|
|
||||||
playSound();
|
|
||||||
viewPunch();
|
|
||||||
playShootAnimation();
|
|
||||||
bool hit = shoot(cAssaultWeapon["BaseDamage"]);
|
|
||||||
if (hit) {
|
|
||||||
showHitMarker();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_TimeSinceLastFire = 0.0;
|
m_TimeSinceLastFire = 0.0;
|
||||||
|
|
||||||
|
// Effects
|
||||||
|
if (IsClient) {
|
||||||
|
spawnTracer();
|
||||||
|
playSound();
|
||||||
|
viewPunch();
|
||||||
|
playShootAnimation();
|
||||||
|
bool hit = shoot(cAssaultWeapon["BaseDamage"]);
|
||||||
|
if (hit) {
|
||||||
|
showHitMarker();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssaultWeaponBehaviour::spawnTracer()
|
void AssaultWeaponBehaviour::spawnTracer()
|
||||||
@@ -140,7 +153,8 @@ void AssaultWeaponBehaviour::spawnTracer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EntityWrapper spawner;
|
EntityWrapper spawner;
|
||||||
if (m_Player == LocalPlayer) {
|
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
|
||||||
|
if (m_Player == LocalPlayer && !outOfBodyExperience) {
|
||||||
spawner = m_Player.FirstChildByName("WeaponMuzzle");
|
spawner = m_Player.FirstChildByName("WeaponMuzzle");
|
||||||
} else {
|
} else {
|
||||||
spawner = m_Player.FirstChildByName("ThirdPersonWeaponMuzzle");
|
spawner = m_Player.FirstChildByName("ThirdPersonWeaponMuzzle");
|
||||||
@@ -206,7 +220,13 @@ void AssaultWeaponBehaviour::finishReload()
|
|||||||
|
|
||||||
// Make real first person weapon model visible again
|
// Make real first person weapon model visible again
|
||||||
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
|
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
|
||||||
firstPersonWeaponModel["Model"]["Visible"] = true;
|
if (firstPersonWeaponModel.Valid()) {
|
||||||
|
firstPersonWeaponModel["Model"]["Visible"] = true;
|
||||||
|
}
|
||||||
|
EntityWrapper thirdPersonWeaponModel = m_Player.FirstChildByName("ThirdPersonWeaponModel");
|
||||||
|
if (thirdPersonWeaponModel.Valid()) {
|
||||||
|
thirdPersonWeaponModel["Model"]["Visible"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_Reloading = false;
|
m_Reloading = false;
|
||||||
}
|
}
|
||||||
@@ -259,19 +279,45 @@ void AssaultWeaponBehaviour::playIdleAnimation()
|
|||||||
void AssaultWeaponBehaviour::playReloadAnimation()
|
void AssaultWeaponBehaviour::playReloadAnimation()
|
||||||
{
|
{
|
||||||
// Play animation
|
// Play animation
|
||||||
ComponentWrapper cAnimation = m_FirstPersonModel["Animation"];
|
// First person
|
||||||
cAnimation["AnimationName1"] = "ReloadSwitch";
|
if (IsClient)
|
||||||
cAnimation["Weight1"] = 1.0;
|
{
|
||||||
cAnimation["Time1"] = 0.0;
|
ComponentWrapper cAnimation = m_FirstPersonModel["Animation"];
|
||||||
cAnimation["Speed1"] = 0.5;
|
cAnimation["AnimationName1"] = "ReloadSwitch";
|
||||||
cAnimation["Loop1"] = true;
|
cAnimation["Weight1"] = 1.0;
|
||||||
|
cAnimation["Time1"] = 0.0;
|
||||||
|
cAnimation["Speed1"] = 0.5;
|
||||||
|
cAnimation["Loop1"] = true;
|
||||||
|
}
|
||||||
|
// TODO: Third person
|
||||||
|
//{
|
||||||
|
// ComponentWrapper cAnimation = m_ThirdPersonModel["Animation"];
|
||||||
|
// cAnimation["AnimationName1"] = "ReloadSwitch";
|
||||||
|
// cAnimation["Weight1"] = 1.0;
|
||||||
|
// cAnimation["Time1"] = 0.0;
|
||||||
|
// cAnimation["Speed1"] = 0.5;
|
||||||
|
// cAnimation["Loop1"] = true;
|
||||||
|
//}
|
||||||
|
|
||||||
// Hide weapon model and spawn the exploding version
|
// Hide weapon model and spawn the exploding version
|
||||||
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
|
{
|
||||||
EntityWrapper reloadSpawner = m_Player.FirstChildByName("FirstPersonReloadSpawner");
|
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
|
||||||
m_ReloadImpersonator = SpawnerSystem::Spawn(reloadSpawner, reloadSpawner);
|
EntityWrapper reloadSpawner = m_Player.FirstChildByName("FirstPersonReloadSpawner");
|
||||||
firstPersonWeaponModel["Model"].Copy(m_ReloadImpersonator["Model"]);
|
if (IsClient) {
|
||||||
firstPersonWeaponModel["Model"]["Visible"] = false;
|
m_FirstPersonReloadImpersonator = SpawnerSystem::Spawn(reloadSpawner, reloadSpawner);
|
||||||
|
firstPersonWeaponModel["Model"].Copy(m_FirstPersonReloadImpersonator["Model"]);
|
||||||
|
}
|
||||||
|
firstPersonWeaponModel["Model"]["Visible"] = false;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EntityWrapper thirdPersonWeaponModel = m_Player.FirstChildByName("ThirdPersonWeaponModel");
|
||||||
|
EntityWrapper reloadSpawner = m_Player.FirstChildByName("ThirdPersonReloadSpawner");
|
||||||
|
if (IsClient) {
|
||||||
|
m_ThirdPersonReloadImpersonator = SpawnerSystem::Spawn(reloadSpawner, reloadSpawner);
|
||||||
|
thirdPersonWeaponModel["Model"].Copy(m_ThirdPersonReloadImpersonator["Model"]);
|
||||||
|
}
|
||||||
|
thirdPersonWeaponModel["Model"]["Visible"] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssaultWeaponBehaviour::shoot(double damage)
|
bool AssaultWeaponBehaviour::shoot(double damage)
|
||||||
@@ -302,6 +348,9 @@ bool AssaultWeaponBehaviour::shoot(double damage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EntityWrapper victim(m_World, pickData.Entity);
|
EntityWrapper victim(m_World, pickData.Entity);
|
||||||
|
if (!victim.Valid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Don't let us shoot ourselves in the foot
|
// Don't let us shoot ourselves in the foot
|
||||||
if (victim == LocalPlayer) {
|
if (victim == LocalPlayer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user