Compare commits
23 Commits
WeaponBase
...
e06de3f37e
| Author | SHA1 | Date | |
|---|---|---|---|
| e06de3f37e | |||
|
|
9056e32b00 | ||
|
|
2b4db1367d | ||
|
|
b1d862ded9 | ||
|
|
365442bbb7 | ||
|
|
94816eb54b | ||
|
|
7d9c2dfce8 | ||
|
|
bd5b2e9f3a | ||
|
|
c8ade04bc8 | ||
|
|
12add78480 | ||
|
|
9bdb9bac9a | ||
|
|
c959246bc7 | ||
|
|
e1986ef42f | ||
|
|
ee4371c320 | ||
|
|
6d97d86c1d | ||
|
|
9b0eef7e4f | ||
|
|
f40d53a6ba | ||
|
|
9d24abd287 | ||
|
|
f00d4d1baf | ||
|
|
0ddc2363c0 | ||
|
|
9e071fd29e | ||
|
|
5bf29d6cdb | ||
|
|
cc1c8fa880 |
@@ -113,3 +113,6 @@ ConnectionType=USBOnly
|
|||||||
bUseManualIPAddress=False
|
bUseManualIPAddress=False
|
||||||
ManualIPAddress=
|
ManualIPAddress=
|
||||||
|
|
||||||
|
[/Script/Engine.AudioSettings]
|
||||||
|
DefaultBaseSoundMix=/Game/Sounds/MainSoundMix.MainSoundMix
|
||||||
|
|
||||||
|
|||||||
BIN
Content/Characters/Mannequins/Anims/Unarmed/ABP_Unarmed.uasset
Normal file
BIN
Content/Characters/Mannequins/Anims/Unarmed/ABP_Unarmed.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Input/Controller/C_Aim_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Aim_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Crouch_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Crouch_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_FireMode_IA.uasset
Normal file
BIN
Content/Input/Controller/C_FireMode_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Fire_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Fire_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Gadget_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Gadget_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Grenade_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Grenade_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Interact_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Interact_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Jump_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Jump_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_LeanLeft_IA.uasset
Normal file
BIN
Content/Input/Controller/C_LeanLeft_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_LeanRight_IA.uasset
Normal file
BIN
Content/Input/Controller/C_LeanRight_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Look_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Look_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Melee_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Melee_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Move_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Move_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_OpticMode_IA.uasset
Normal file
BIN
Content/Input/Controller/C_OpticMode_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Pause_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Pause_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Ping_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Ping_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Prone_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Prone_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Reload_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Reload_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Sprint_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Sprint_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_SwapWeapon.uasset
Normal file
BIN
Content/Input/Controller/C_SwapWeapon.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_SwitchToPrimaryWeapon_IA.uasset
Normal file
BIN
Content/Input/Controller/C_SwitchToPrimaryWeapon_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_SwitchToSecondaryWeapon_IA.uasset
Normal file
BIN
Content/Input/Controller/C_SwitchToSecondaryWeapon_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_SwitchToSpecialWeapon_IA.uasset
Normal file
BIN
Content/Input/Controller/C_SwitchToSpecialWeapon_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/C_Voip_IA.uasset
Normal file
BIN
Content/Input/Controller/C_Voip_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Controller/Controller_IMC.uasset
Normal file
BIN
Content/Input/Controller/Controller_IMC.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Crouch_IA.uasset
Normal file
BIN
Content/Input/Crouch_IA.uasset
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/Input/FireMode_IA.uasset
Normal file
BIN
Content/Input/FireMode_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Fire_IA.uasset
Normal file
BIN
Content/Input/Fire_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Gadget_IA.uasset
Normal file
BIN
Content/Input/Gadget_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Grenade_IA.uasset
Normal file
BIN
Content/Input/Grenade_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Interact_IA.uasset
Normal file
BIN
Content/Input/Interact_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Melee_IA.uasset
Normal file
BIN
Content/Input/Melee_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/OpticMode_IA.uasset
Normal file
BIN
Content/Input/OpticMode_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Ping_IA.uasset
Normal file
BIN
Content/Input/Ping_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Prone_IA.uasset
Normal file
BIN
Content/Input/Prone_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Reload_IA.uasset
Normal file
BIN
Content/Input/Reload_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Sprint_IA.uasset
Normal file
BIN
Content/Input/Sprint_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/SwapWeapon.uasset
Normal file
BIN
Content/Input/SwapWeapon.uasset
Normal file
Binary file not shown.
BIN
Content/Input/SwitchToPrimaryWeapon_IA.uasset
Normal file
BIN
Content/Input/SwitchToPrimaryWeapon_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/SwitchToSecondaryWeapon_IA.uasset
Normal file
BIN
Content/Input/SwitchToSecondaryWeapon_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/SwitchToSpecialWeapon_IA.uasset
Normal file
BIN
Content/Input/SwitchToSpecialWeapon_IA.uasset
Normal file
Binary file not shown.
BIN
Content/Input/Voip_IA.uasset
Normal file
BIN
Content/Input/Voip_IA.uasset
Normal file
Binary file not shown.
BIN
Content/ProofOfConcept/CharacterMovementComponent_BP.uasset
Normal file
BIN
Content/ProofOfConcept/CharacterMovementComponent_BP.uasset
Normal file
Binary file not shown.
BIN
Content/ProofOfConcept/DDICharacterInterface_BP.uasset
Normal file
BIN
Content/ProofOfConcept/DDICharacterInterface_BP.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/UI_Menus/Common/DDI_CheckBox_BP1.uasset
Normal file
BIN
Content/UI_Menus/Common/DDI_CheckBox_BP1.uasset
Normal file
Binary file not shown.
BIN
Content/UI_Menus/Common/DDI_Selector.uasset
Normal file
BIN
Content/UI_Menus/Common/DDI_Selector.uasset
Normal file
Binary file not shown.
BIN
Content/UI_Menus/Common/DDI_Slider_BP.uasset
Normal file
BIN
Content/UI_Menus/Common/DDI_Slider_BP.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Weapons/Pistol_03/DA_Weapon_Pistol_03.uasset
Normal file
BIN
Content/Weapons/Pistol_03/DA_Weapon_Pistol_03.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_03/Fbx_Default_Material_0.uasset
Normal file
BIN
Content/Weapons/Pistol_03/Fbx_Default_Material_0.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_03/Test2.uasset
Normal file
BIN
Content/Weapons/Pistol_03/Test2.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_03/Test2_PhysicsAsset.uasset
Normal file
BIN
Content/Weapons/Pistol_03/Test2_PhysicsAsset.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_03/Test2_Skeleton.uasset
Normal file
BIN
Content/Weapons/Pistol_03/Test2_Skeleton.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_03/Weapon_Pistol_03_BP.uasset
Normal file
BIN
Content/Weapons/Pistol_03/Weapon_Pistol_03_BP.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_Test/DA_Weapon_Pistol_02.uasset
Normal file
BIN
Content/Weapons/Pistol_Test/DA_Weapon_Pistol_02.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_Test/Fbx_Default_Material_0.uasset
Normal file
BIN
Content/Weapons/Pistol_Test/Fbx_Default_Material_0.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_Test/Weapon_BP_Pistol_02.uasset
Normal file
BIN
Content/Weapons/Pistol_Test/Weapon_BP_Pistol_02.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_Test/test.uasset
Normal file
BIN
Content/Weapons/Pistol_Test/test.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_Test/test_PhysicsAsset.uasset
Normal file
BIN
Content/Weapons/Pistol_Test/test_PhysicsAsset.uasset
Normal file
Binary file not shown.
BIN
Content/Weapons/Pistol_Test/test_Skeleton.uasset
Normal file
BIN
Content/Weapons/Pistol_Test/test_Skeleton.uasset
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,5 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003AGameFramework_002Ff_003AActor_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003AGameFramework_002Ff_003AActor_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003AGameFramework_002Ff_003ACharacterMovementComponent_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003APhysicsEngine_002Ff_003APhysicsSpringComponent_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003APhysicsEngine_002Ff_003APhysicsSpringComponent_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AUMG_002Fd_003APublic_002Fd_003AComponents_002Ff_003AWidgetSwitcher_002Eh/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AUMG_002Fd_003APublic_002Fd_003AComponents_002Ff_003AWidgetSwitcher_002Eh/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||||
@@ -67,21 +67,17 @@ void ADDICharacter::Server_SpawnProjectile_Implementation()
|
|||||||
FVector Location = GetActorLocation();
|
FVector Location = GetActorLocation();
|
||||||
FRotator Rotation = GetActorRotation();
|
FRotator Rotation = GetActorRotation();
|
||||||
FVector Dir = GetActorForwardVector();
|
FVector Dir = GetActorForwardVector();
|
||||||
|
|
||||||
// GetActorEyesViewPoint(Location, Rotation);
|
|
||||||
|
|
||||||
Location += Dir * 55.f;
|
Location += Dir * 200.f;
|
||||||
|
|
||||||
if (!ProjectileClass)
|
if (!ProjectileClass)
|
||||||
{
|
{
|
||||||
GEngine->AddOnScreenDebugMessage(1, 10.f, FColor::Emerald, "No Projectile Set");
|
GEngine->AddOnScreenDebugMessage(1, 10.f, FColor::Emerald, "No Projectile Set");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
GetWorld()->SpawnActor<AActor>(ProjectileClass, Location, Rotation);
|
||||||
|
|
||||||
FActorSpawnParameters SpawnInfo;
|
|
||||||
SpawnInfo.Owner = this;
|
|
||||||
SpawnInfo.Instigator = GetInstigator();
|
|
||||||
GetWorld()->SpawnActor<AActor>(ProjectileClass, Location, Rotation, SpawnInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDICharacter::Client_CharacterHit_Implementation()
|
void ADDICharacter::Client_CharacterHit_Implementation()
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "MagazineActor.h"
|
|
||||||
|
|
||||||
#include "OpenConflict/PlayerCharacter/Components/DDIHealth.h"
|
|
||||||
|
|
||||||
// Sets default values
|
|
||||||
AMagazineActor::AMagazineActor()
|
|
||||||
{
|
|
||||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
|
||||||
PrimaryActorTick.bCanEverTick = true;
|
|
||||||
bReplicates = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// Called when the game starts or when spawned
|
|
||||||
void AMagazineActor::BeginPlay()
|
|
||||||
{
|
|
||||||
Super::BeginPlay();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called every frame
|
|
||||||
void AMagazineActor::Tick(float DeltaTime)
|
|
||||||
{
|
|
||||||
Super::Tick(DeltaTime);
|
|
||||||
if (!ActiveMag && CurrentCount < MAX_COUNT )
|
|
||||||
{
|
|
||||||
GetWorld()->GetTimerManager().SetTimer(RepackTimer, this, &AMagazineActor::PackMag, RepackDelay, true, RepackDelay);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMagazineActor::PackMag()
|
|
||||||
{
|
|
||||||
if (hasReserveAmmo)
|
|
||||||
{
|
|
||||||
CurrentCount += 1;
|
|
||||||
AMMO_REPACK.Broadcast();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurrentCount >= MAX_COUNT)
|
|
||||||
{
|
|
||||||
CurrentCount = MAX_COUNT;
|
|
||||||
GetWorld()->GetTimerManager().ClearTimer(RepackTimer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMagazineActor::StripRound()
|
|
||||||
{
|
|
||||||
CurrentCount -= 1;
|
|
||||||
if (CurrentCount <= 0)
|
|
||||||
{
|
|
||||||
CurrentCount = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMagazineActor::SetAmmoValues(int MaxCount)
|
|
||||||
{
|
|
||||||
MAX_COUNT = MaxCount;
|
|
||||||
CurrentCount = MAX_COUNT;
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "GameFramework/Actor.h"
|
|
||||||
#include "MagazineActor.generated.h"
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FAMMO_REPACK);
|
|
||||||
UCLASS()
|
|
||||||
class OPENCONFLICT_API AMagazineActor : public AActor
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
/*UPROPERTY and UFUNCTION declarations*/
|
|
||||||
private:
|
|
||||||
/*Properties*/
|
|
||||||
UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess=true))
|
|
||||||
int MAX_COUNT;
|
|
||||||
UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess=true))
|
|
||||||
int CurrentCount;
|
|
||||||
UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess=true))
|
|
||||||
bool ActiveMag = false;
|
|
||||||
UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess=true))
|
|
||||||
float RepackDelay = 0.5f;
|
|
||||||
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/*Properties*/
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
|
|
||||||
public:
|
|
||||||
/*Properties*/
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
|
||||||
FAMMO_REPACK AMMO_REPACK;
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
|
||||||
void EmptyMagEvent();
|
|
||||||
|
|
||||||
/*C++ only declarations*/
|
|
||||||
private:
|
|
||||||
/*Properties*/
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
void PackMag();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/*Properties*/
|
|
||||||
FTimerHandle RepackTimer;
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
// Called when the game starts or when spawned
|
|
||||||
virtual void BeginPlay() override;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
/*Properties*/
|
|
||||||
bool hasReserveAmmo = true;
|
|
||||||
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
// Sets default values for this actor's properties
|
|
||||||
AMagazineActor();
|
|
||||||
AMagazineActor(int MaxCount);
|
|
||||||
|
|
||||||
// Called every frame
|
|
||||||
virtual void Tick(float DeltaTime) override;
|
|
||||||
|
|
||||||
void StripRound();
|
|
||||||
void SetAmmoValues(int MaxCount);
|
|
||||||
};
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "MagazineComponenet.h"
|
|
||||||
|
|
||||||
// Sets default values for this component's properties
|
|
||||||
UMagazineComponenet::UMagazineComponenet()
|
|
||||||
{
|
|
||||||
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
|
|
||||||
// off to improve performance if you don't need them.
|
|
||||||
PrimaryComponentTick.bCanEverTick = true;
|
|
||||||
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Called when the game starts
|
|
||||||
void UMagazineComponenet::BeginPlay()
|
|
||||||
{
|
|
||||||
Super::BeginPlay();
|
|
||||||
|
|
||||||
// ...
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Called every frame
|
|
||||||
void UMagazineComponenet::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
|
||||||
{
|
|
||||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
|
||||||
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "Components/ActorComponent.h"
|
|
||||||
#include "MagazineComponenet.generated.h"
|
|
||||||
|
|
||||||
|
|
||||||
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
|
||||||
class OPENCONFLICT_API UMagazineComponenet : public UActorComponent
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Sets default values for this component's properties
|
|
||||||
UMagazineComponenet();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Called when the game starts
|
|
||||||
virtual void BeginPlay() override;
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Called every frame
|
|
||||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -8,8 +8,6 @@ AWeaponBase::AWeaponBase()
|
|||||||
{
|
{
|
||||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
PrimaryActorTick.bCanEverTick = true;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
bReplicates = true;
|
|
||||||
WeaponMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Weapon Component"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,13 +15,6 @@ AWeaponBase::AWeaponBase()
|
|||||||
void AWeaponBase::BeginPlay()
|
void AWeaponBase::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
// AMMO_REPACK.AddDynamic(this, &AWeaponBase::MagRepacking);
|
|
||||||
for (int i = 0; i < RESERVE_MAG_COUNT; i++)
|
|
||||||
{
|
|
||||||
// AMagazineActor* mag = new AMagazineActor();
|
|
||||||
// mag->SetAmmoValues(MAX_AMMO_COUNT);
|
|
||||||
// ActiveMags.Add(mag);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,15 +25,3 @@ void AWeaponBase::Tick(float DeltaTime)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AWeaponBase::MagRepacking()
|
|
||||||
{
|
|
||||||
RESERVE_AMMO_POOL_DEFAULT -= 1;
|
|
||||||
if (RESERVE_AMMO_POOL_DEFAULT <= 0)
|
|
||||||
{
|
|
||||||
RESERVE_AMMO_POOL_DEFAULT = 0;
|
|
||||||
// for (AMagazineActor* mag : ActiveMags)
|
|
||||||
// {
|
|
||||||
// mag->hasReserveAmmo = false;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,79 +4,23 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "WeaponEnums.h"
|
|
||||||
// #include "UMagazine.h"
|
|
||||||
#include "WeaponBase.generated.h"
|
#include "WeaponBase.generated.h"
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class OPENCONFLICT_API AWeaponBase : public AActor
|
class OPENCONFLICT_API AWeaponBase : public AActor
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
/*UPROPERTY and UFUNCTION declarations*/
|
|
||||||
private:
|
|
||||||
/*Properties*/
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon HUD", meta=(AllowPrivateAccess=true))
|
|
||||||
UTexture2D* Texture;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Anims", meta=(AllowPrivateAccess=true))
|
|
||||||
WeaponNames WeaponNameEnum;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Anims", meta=(AllowPrivateAccess=true))
|
|
||||||
FName AttachSocketName;
|
|
||||||
|
|
||||||
/*Ammo counter for in mags*/
|
public:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
|
// Sets default values for this actor's properties
|
||||||
int MAX_AMMO_COUNT = 30; //Tracks max ammo in one mag, not to be edited during runtime ever
|
AWeaponBase();
|
||||||
UPROPERTY(BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
|
|
||||||
int MagIndex; //Tracks index for ActiveMags Array
|
|
||||||
// UPROPERTY(BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
|
|
||||||
// TArray<UMagazine*> ActiveMags; //Tracks all mags for weapon
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
|
|
||||||
int RESERVE_MAG_COUNT = 2; //Tracks how many mags are kept in reserve. DO NOT INCLUDE MAG IN WEAPON
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
|
|
||||||
int RESERVE_AMMO_POOL_DEFAULT = 120;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta=(AllowPrivateAccess=true))
|
|
||||||
USkeletalMeshComponent* WeaponMesh;
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*Properties*/
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
|
|
||||||
public:
|
|
||||||
/*Properties*/
|
|
||||||
// UPROPERTY(BlueprintAssignable)
|
|
||||||
// FAMMO_REPACK AMMO_REPACK;
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
UFUNCTION()
|
|
||||||
void MagRepacking();
|
|
||||||
|
|
||||||
/*C++ only declarations*/
|
|
||||||
private:
|
|
||||||
/*Properties*/
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/*Properties*/
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*Properties*/
|
|
||||||
|
|
||||||
/*Functions*/
|
|
||||||
// Called every frame
|
// Called every frame
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
// Sets default values for this actor's properties
|
|
||||||
AWeaponBase();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "WeaponEnums.generated.h"
|
|
||||||
|
|
||||||
UENUM(BlueprintType)
|
|
||||||
enum class WeaponNames : uint8
|
|
||||||
{
|
|
||||||
Pistol = 0 UMETA(DisplayName = "Pistol"),
|
|
||||||
Rifle = 1 UMETA(DisplayName = "Rifle"),
|
|
||||||
Shotgun = 2 UMETA(DisplayName = "Shotgun"),
|
|
||||||
Sniper = 3 UMETA(DisplayName = "Sniper")
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user