Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2507516a85 | |||
| 0398006fdc | |||
| ae13a2db6b | |||
| 984b8ad3e9 | |||
| b1148c0c6c | |||
| a5c1e34b8d | |||
| e55a399bad | |||
| 06b7052bf2 | |||
| 2dfcd3ad95 | |||
| 44924ea1f9 | |||
| 7943fc7ad6 | |||
| be331cb778 | |||
| a72dc94d5d | |||
| c5f3bfc0cd | |||
| 98366ec038 | |||
| 398bc725b6 | |||
| 8859f652b9 | |||
| da81f21799 | |||
| f84d1ac4a1 | |||
| b81bb9eeea |
@@ -30,6 +30,7 @@ public:
|
|||||||
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID);
|
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID);
|
||||||
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
|
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
|
||||||
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
|
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
|
||||||
|
bool SpecialAbilityKeyDown() const { return m_SpecialAbilityKeyDown; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const int m_PlayerID;
|
const int m_PlayerID;
|
||||||
@@ -145,9 +146,9 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
if (m_NumberOfMovementKeysDown == 0) {
|
if (m_NumberOfMovementKeysDown == 0) {
|
||||||
m_MovementKeyDown = false;
|
m_MovementKeyDown = false;
|
||||||
}
|
}
|
||||||
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
|
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
|
||||||
m_AssaultDashTapDirection = m_CurrentDirectionVector;
|
m_AssaultDashTapDirection = m_CurrentDirectionVector;
|
||||||
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,18 +162,11 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e.Command == "SpecialAbility") {
|
if (e.Command == "SpecialAbility") {
|
||||||
if (e.Value > 0) {
|
m_SpecialAbilityKeyDown = e.Value > 0;
|
||||||
m_SpecialAbilityKeyDown = true;
|
|
||||||
} else {
|
|
||||||
m_SpecialAbilityKeyDown = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m_SpecialAbilityKeyDown && m_MovementKeyDown) {
|
|
||||||
m_ShiftDashing = true;
|
|
||||||
} else {
|
|
||||||
m_ShiftDashing = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_ShiftDashing = m_SpecialAbilityKeyDown && m_MovementKeyDown;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ private:
|
|||||||
bool m_LeftFoot = false;
|
bool m_LeftFoot = false;
|
||||||
// To get a difference when calculating the walking state.
|
// To get a difference when calculating the walking state.
|
||||||
glm::vec3 m_LastPosition = glm::vec3();
|
glm::vec3 m_LastPosition = glm::vec3();
|
||||||
|
// Used to track afterimages for sprint effect.
|
||||||
|
float m_SprintEffectTimer;
|
||||||
// The logic for making the sound play when player is moving
|
// The logic for making the sound play when player is moving
|
||||||
void playerStep(double dt);
|
void playerStep(double dt);
|
||||||
// Spawn a hexagon at origin of an Entity
|
// Spawn a hexagon at origin of an Entity
|
||||||
|
|||||||
@@ -28,3 +28,4 @@ P=SwitchToPlayer
|
|||||||
K=TakeDamage,1500
|
K=TakeDamage,1500
|
||||||
F2=PerformanceTimingResetAllTimers
|
F2=PerformanceTimingResetAllTimers
|
||||||
F3=PerformanceTimingCreateExcelData
|
F3=PerformanceTimingCreateExcelData
|
||||||
|
F4=SwapToClassPick
|
||||||
@@ -59,4 +59,5 @@
|
|||||||
<xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/>
|
<xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/>
|
||||||
<xs:include schemaLocation="Components/FloatingEffect.xsd"/>
|
<xs:include schemaLocation="Components/FloatingEffect.xsd"/>
|
||||||
<xs:include schemaLocation="Components/BoostIconsHUD.xsd"/>
|
<xs:include schemaLocation="Components/BoostIconsHUD.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/InputCmdButton.xsd"/>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<InputCmdButton xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="InputCmdButton.xsd">
|
||||||
|
<Command></Command>
|
||||||
|
<PressValue>0.0</PressValue>
|
||||||
|
</InputCmdButton>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||||
|
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||||
|
|
||||||
|
<xs:element name="InputCmdButton">
|
||||||
|
<xs:annotation><xs:documentation>Used with a Button component, the button will send an inputCommand event instead of ButtonPressed/Released event.</xs:documentation></xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="Command" type="t:string" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The command name for the inputCommand.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="PressValue" type="t:float" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The value in inputCommand.Value that will be sent on button press.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
<SprintAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SprintAbility.xsd">
|
<SprintAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SprintAbility.xsd">
|
||||||
<CoolDownMaxTimer>2.0</CoolDownMaxTimer>
|
<StrengthOfEffect>1.3</StrengthOfEffect>
|
||||||
|
<Active>false</Active>
|
||||||
</SprintAbility>
|
</SprintAbility>
|
||||||
@@ -9,8 +9,11 @@
|
|||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="CoolDownMaxTimer" type="t:double" minOccurs="0">
|
<xs:element name="StrengthOfEffect" type="t:double" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>This is the cooldown on sprint</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>This is the strength of the sprint effect</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Active" type="t:bool" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>True if currently sprinting.</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,308 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="OverwatchCamera" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.049999997019767761</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-4" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="CameraAnchor">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="66" Y="59.2180023" Z="0"/>
|
||||||
|
<Orientation X="5.89000034" Y="1.57079637" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="SpectatorCamera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="SpectatorHUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<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>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<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>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<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>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<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>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<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>
|
||||||
|
<Percentage>0.10332605343919568</Percentage>
|
||||||
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="4.71238899"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<Color A="0.699999988" B="0" G="0" 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>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="RespawnTimer">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>16</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.178199276" Z="0"/>
|
||||||
|
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PickClassCamera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="PickClassHUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="DefenderClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>2</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.349999994" Y="0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AssaultClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitRaptor.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.349999994" Y="0.149504215" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SniperClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Test/aM4ME4GR.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>3</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.349999994" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
||||||
<Entity name="SpectatorCamera" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
|
||||||
|
|
||||||
<Components>
|
|
||||||
<c:Camera/>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
|
|
||||||
<Children>
|
|
||||||
<Entity name="SpectatorHUD">
|
|
||||||
<Components>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0" Z="-0.5"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="RespawnTimer">
|
|
||||||
<Components>
|
|
||||||
<c:Text>
|
|
||||||
<Content>Time to respawn: 0</Content>
|
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
|
||||||
<Color A="1" B="0" G="1" R="0.784313738"/>
|
|
||||||
<Alignment>
|
|
||||||
<Left/>
|
|
||||||
</Alignment>
|
|
||||||
</c:Text>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="-0.115000000" Y="0.15304254" Z="0"/>
|
|
||||||
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<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>
|
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
|
||||||
</c:Fill>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<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>
|
|
||||||
<Percentage>0.59265931447347009</Percentage>
|
|
||||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
|
||||||
</c:Fill>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</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="4.71238899"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="BackgroundHexagon">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<Color A="0.699999988" B="0" G="0" 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>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</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>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
|
|
||||||
</Entity>
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="SprintEffect" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Animation>
|
||||||
|
<AnimationName1></AnimationName1>
|
||||||
|
<AnimationName2></AnimationName2>
|
||||||
|
<AnimationName3></AnimationName3>
|
||||||
|
</c:Animation>
|
||||||
|
<c:Lifetime>
|
||||||
|
<Lifetime>0.15</Lifetime>
|
||||||
|
</c:Lifetime>
|
||||||
|
<c:ExplosionEffect>
|
||||||
|
<Velocity X="0" Y="0" Z="0"/>
|
||||||
|
<ExplosionDuration>0.15</ExplosionDuration>
|
||||||
|
</c:ExplosionEffect>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children/>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
<xs:element ref="c:DoubleJump" minOccurs="0"/>
|
<xs:element ref="c:DoubleJump" minOccurs="0"/>
|
||||||
<xs:element ref="c:HealthHUD" minOccurs="0"/>
|
<xs:element ref="c:HealthHUD" minOccurs="0"/>
|
||||||
<xs:element ref="c:SpriteIndicator" minOccurs="0"/>
|
<xs:element ref="c:SpriteIndicator" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:InputCmdButton" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "GUI/ButtonSystem.h"
|
#include "GUI/ButtonSystem.h"
|
||||||
|
#include "Input/EInputCommand.h"
|
||||||
|
|
||||||
ButtonSystem::ButtonSystem(SystemParams params, IRenderer* renderer)
|
ButtonSystem::ButtonSystem(SystemParams params, IRenderer* renderer)
|
||||||
: System(params)
|
: System(params)
|
||||||
@@ -37,10 +38,20 @@ bool ButtonSystem::OnMousePress(const Events::MousePress& e)
|
|||||||
m_PickEntity = EntityWrapper(m_World, m_PickData.Entity);
|
m_PickEntity = EntityWrapper(m_World, m_PickData.Entity);
|
||||||
|
|
||||||
//You have clicked on a button entity, send pressed event.
|
//You have clicked on a button entity, send pressed event.
|
||||||
Events::ButtonPressed ePressed;
|
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
||||||
ePressed.Entity = m_PickEntity;
|
Events::InputCommand eInputCmd;
|
||||||
ePressed.EntityName = m_PickEntity.Name();
|
eInputCmd.PlayerID = LocalPlayer.ID;
|
||||||
m_EventBroker->Publish(ePressed);
|
eInputCmd.Player = LocalPlayer;
|
||||||
|
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
||||||
|
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
||||||
|
eInputCmd.Value = (float)button["InputCmdButton"]["PressValue"];
|
||||||
|
m_EventBroker->Publish(eInputCmd);
|
||||||
|
} else {
|
||||||
|
Events::ButtonPressed ePressed;
|
||||||
|
ePressed.Entity = m_PickEntity;
|
||||||
|
ePressed.EntityName = m_PickEntity.Name();
|
||||||
|
m_EventBroker->Publish(ePressed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,10 +66,20 @@ bool ButtonSystem::OnMouseRelease(const Events::MouseRelease& e)
|
|||||||
if(m_PickData.Entity != EntityID_Invalid && m_PickData.World == m_World) {
|
if(m_PickData.Entity != EntityID_Invalid && m_PickData.World == m_World) {
|
||||||
EntityWrapper ent = EntityWrapper(m_World, m_PickData.Entity);
|
EntityWrapper ent = EntityWrapper(m_World, m_PickData.Entity);
|
||||||
|
|
||||||
Events::ButtonReleased eReleased;
|
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
||||||
eReleased.EntityName = m_PickEntity.Name();
|
Events::InputCommand eInputCmd;
|
||||||
eReleased.Entity = m_PickEntity;
|
eInputCmd.PlayerID = LocalPlayer.ID;
|
||||||
m_EventBroker->Publish(eReleased);
|
eInputCmd.Player = LocalPlayer;
|
||||||
|
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
||||||
|
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
||||||
|
eInputCmd.Value = 0;
|
||||||
|
m_EventBroker->Publish(eInputCmd);
|
||||||
|
} else {
|
||||||
|
Events::ButtonReleased eReleased;
|
||||||
|
eReleased.EntityName = m_PickEntity.Name();
|
||||||
|
eReleased.Entity = m_PickEntity;
|
||||||
|
m_EventBroker->Publish(eReleased);
|
||||||
|
}
|
||||||
|
|
||||||
if(m_World->HasComponent(m_PickData.Entity, "Button")) {
|
if(m_World->HasComponent(m_PickData.Entity, "Button")) {
|
||||||
if (ent == m_PickEntity) {
|
if (ent == m_PickEntity) {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ int UDPClient::readBuffer()
|
|||||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||||
if (sizeOfPacket > m_Socket->available()) {
|
if (sizeOfPacket > m_Socket->available()) {
|
||||||
LOG_WARNING("UDPClient::readBuffer(): We haven't got the whole packet yet.");
|
LOG_WARNING("UDPClient::readBuffer(): We haven't got the whole packet yet.");
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
// if the buffer is to small increase the size of it
|
// if the buffer is to small increase the size of it
|
||||||
if (sizeOfPacket > m_BufferSize) {
|
if (sizeOfPacket > m_BufferSize) {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ int UDPServer::readBuffer()
|
|||||||
|
|
||||||
if (sizeOfPacket > m_Socket->available()) {
|
if (sizeOfPacket > m_Socket->available()) {
|
||||||
LOG_WARNING("UDPServer::readBuffer(): We haven't got the whole packet yet.");
|
LOG_WARNING("UDPServer::readBuffer(): We haven't got the whole packet yet.");
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the buffer is to small increase the size of it
|
// if the buffer is to small increase the size of it
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
PlayerMovementSystem::PlayerMovementSystem(SystemParams params)
|
PlayerMovementSystem::PlayerMovementSystem(SystemParams params)
|
||||||
: System(params)
|
: System(params)
|
||||||
|
, m_SprintEffectTimer(0.f)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &PlayerMovementSystem::OnPlayerSpawned);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &PlayerMovementSystem::OnPlayerSpawned);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &PlayerMovementSystem::OnDoubleJump);
|
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &PlayerMovementSystem::OnDoubleJump);
|
||||||
@@ -19,8 +20,48 @@ void PlayerMovementSystem::Update(double dt)
|
|||||||
{
|
{
|
||||||
updateMovementControllers(dt);
|
updateMovementControllers(dt);
|
||||||
// Only do physics calculations on client and only for themselves.
|
// Only do physics calculations on client and only for themselves.
|
||||||
if (IsClient && LocalPlayer.Valid()) {
|
if (IsClient) {
|
||||||
updateVelocity(LocalPlayer, dt);
|
if (LocalPlayer.Valid()){
|
||||||
|
updateVelocity(LocalPlayer, dt);
|
||||||
|
}
|
||||||
|
m_SprintEffectTimer += dt;
|
||||||
|
if (m_SprintEffectTimer < 0.016f) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_SprintEffectTimer = 0.f;
|
||||||
|
const ComponentPool* pool = m_World->GetComponents("SprintAbility");
|
||||||
|
if (pool == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (auto cSprint : *pool) {
|
||||||
|
if (cSprint.EntityID != LocalPlayer.ID && (bool)cSprint["Active"]) {
|
||||||
|
// Spawn one afterimage for each player that sprints.
|
||||||
|
EntityWrapper player(m_World, cSprint.EntityID);
|
||||||
|
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/SprintEffect.xml");
|
||||||
|
EntityWrapper sprintEffect = entityFile->MergeInto(m_World);
|
||||||
|
auto playerModel = player.FirstChildByName("PlayerModel");
|
||||||
|
if (!playerModel.Valid()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!playerModel.HasComponent("Model")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!playerModel.HasComponent("Animation")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto playerEntityModel = playerModel["Model"];
|
||||||
|
auto playerEntityAnimation = playerModel["Animation"];
|
||||||
|
playerEntityModel.Copy(sprintEffect["Model"]);
|
||||||
|
playerEntityAnimation.Copy(sprintEffect["Animation"]);
|
||||||
|
sprintEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"];
|
||||||
|
((glm::vec4&)sprintEffect["ExplosionEffect"]["EndColor"]).w = 0.f;
|
||||||
|
sprintEffect["Animation"]["Speed1"] = 0.0;
|
||||||
|
sprintEffect["Animation"]["Speed2"] = 0.0;
|
||||||
|
sprintEffect["Animation"]["Speed3"] = 0.0;
|
||||||
|
sprintEffect["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
|
||||||
|
sprintEffect["Transform"]["Orientation"] = (glm::vec3)player["Transform"]["Orientation"];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +103,15 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
playerMovementSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
playerMovementSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||||
playerCrouchSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
playerCrouchSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||||
}
|
}
|
||||||
|
bool sniperSprinting = false;
|
||||||
|
if (player.HasComponent("SprintAbility")) {
|
||||||
|
(bool)player["SprintAbility"]["Active"] = controller->SpecialAbilityKeyDown();
|
||||||
|
if (controller->SpecialAbilityKeyDown()) {
|
||||||
|
playerMovementSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||||
|
playerCrouchSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||||
|
sniperSprinting = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (player.HasComponent("Physics")) {
|
if (player.HasComponent("Physics")) {
|
||||||
ComponentWrapper cPhysics = player["Physics"];
|
ComponentWrapper cPhysics = player["Physics"];
|
||||||
@@ -118,6 +167,9 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
if (playerBoostAssaultEntity.Valid()) {
|
if (playerBoostAssaultEntity.Valid()) {
|
||||||
accelerationSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
accelerationSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||||
}
|
}
|
||||||
|
if (sniperSprinting) {
|
||||||
|
accelerationSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||||
|
}
|
||||||
velocity += accelerationSpeed * wishDirection;
|
velocity += accelerationSpeed * wishDirection;
|
||||||
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ void PlayerSpawnSystem::Update(double dt)
|
|||||||
|
|
||||||
bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
||||||
{
|
{
|
||||||
if (e.Command != "PickTeam") {
|
if (e.Command != "PickTeam" && e.Command != "SwapToClassPick") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,11 +113,12 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A dead client should be able to swap to the spectator camera.
|
// A dead client should be able to swap to the overwatch camera.
|
||||||
if (IsClient && !LocalPlayer.Valid()) {
|
if (IsClient && !LocalPlayer.Valid()) {
|
||||||
// Set the spectator camera as active, if it exists.
|
// Set the camera as active, if it exists.
|
||||||
// Find the camera.
|
// Find the respawn camera or class pick camera.
|
||||||
EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera");
|
std::string camName = e.Command == "SwapToClassPick" ? "PickClassCamera" : "SpectatorCamera";
|
||||||
|
EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName);
|
||||||
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
|
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
|
||||||
Events::SetCamera eSetCamera;
|
Events::SetCamera eSetCamera;
|
||||||
eSetCamera.CameraEntity = spectatorCam;
|
eSetCamera.CameraEntity = spectatorCam;
|
||||||
@@ -135,10 +136,18 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
|||||||
auto iter = m_SpawnRequests.begin();
|
auto iter = m_SpawnRequests.begin();
|
||||||
for (; iter != m_SpawnRequests.end(); ++iter) {
|
for (; iter != m_SpawnRequests.end(); ++iter) {
|
||||||
if (iter->PlayerID == e.PlayerID) {
|
if (iter->PlayerID == e.PlayerID) {
|
||||||
|
// If player wants to switch class, remove their spawn request.
|
||||||
|
if (e.Command == "SwapToClassPick") {
|
||||||
|
m_SpawnRequests.erase(iter);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Command == "SwapToClassPick") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (iter != m_SpawnRequests.end()) {
|
if (iter != m_SpawnRequests.end()) {
|
||||||
// If player is in queue to spawn, then change their team affiliation in the request.
|
// If player is in queue to spawn, then change their team affiliation in the request.
|
||||||
iter->Team = (ComponentInfo::EnumType)e.Value;
|
iter->Team = (ComponentInfo::EnumType)e.Value;
|
||||||
|
|||||||
Reference in New Issue
Block a user