5 Commits

Author SHA1 Message Date
Kukukakhew
7e393cd7bb DERP! 2026-01-03 01:19:00 -05:00
Kukukakhew
3bb02d3cf8 Some work on a weapon slot. 2026-01-01 21:11:08 -05:00
398ea98e43 fixeded? 2025-12-09 00:11:42 -05:00
Kukukakhew
0c657b9228 testing stuff - ads 2025-12-08 23:27:25 -05:00
Kukukakhew
39e416295b Added weapon class and data asset, weapons can be spawned to actor 2025-12-06 21:32:09 -05:00
82 changed files with 42 additions and 313 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
;METADATA=(Diff=true, UseCommands=true)
[/Script/GameplayTags.GameplayTagsSettings]
ImportTagsFromConfig=True
WarnOnInvalidTags=True
ClearInvalidTags=False
AllowEditorTagUnloading=True
AllowGameTagUnloading=False
FastReplication=False
bDynamicReplication=False
InvalidTagCharacters="\"\',"
NumBitsForContainerSize=6
NetIndexFirstBitSegment=16
+GameplayTagRedirects=(OldTagName="Weapon.Slot1",NewTagName="Weapon.PrimarySlot")
+GameplayTagList=(Tag="Aim",DevComment="")
+GameplayTagList=(Tag="Aim.CanAim",DevComment="")
+GameplayTagList=(Tag="Aim.IronSights",DevComment="")
+GameplayTagList=(Tag="Aim.IsADS",DevComment="")
+GameplayTagList=(Tag="Aim.Scope",DevComment="")
+GameplayTagList=(Tag="Aim.Sight",DevComment="")
+GameplayTagList=(Tag="Weapon",DevComment="")
+GameplayTagList=(Tag="Weapon.CanFire",DevComment="")
+GameplayTagList=(Tag="Weapon.CanReload",DevComment="")
+GameplayTagList=(Tag="Weapon.CanSwitch",DevComment="")
+GameplayTagList=(Tag="Weapon.PrimarySlot",DevComment="")
+GameplayTagList=(Tag="Weapon.SecondarySlot",DevComment="")
+GameplayTagList=(Tag="Weapon.SpecialSlot",DevComment="")

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/Input/Aim_IA.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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,4 @@
<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_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>

View File

@@ -9,7 +9,6 @@ UDDIHealth::UDDIHealth()
// 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;
SetIsReplicatedByDefault(true);
MaxHealth = 0;
CurrentHealth = 0;
ClassName = ClassNames::Scout;
@@ -42,7 +41,7 @@ void UDDIHealth::BeginPlay()
MaxHealth += seg;
CurrentHealth = MaxHealth;
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Emerald, FString::Printf(TEXT("CurrentHealth: %d"), CurrentHealth));
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Cyan, FString::Printf(TEXT("CurrentHealth: %d"), CurrentHealth));
}
@@ -82,9 +81,10 @@ void UDDIHealth::Heal()
// Called to cause damage
void UDDIHealth::TakeDamage(int DamageValue)
{
// if (HealTimer.IsValid())
// HealTimer.Invalidate();
GetWorld()->GetTimerManager().ClearTimer(HealTimer);
CurrentHealth -= DamageValue;
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Cyan, FString::Printf(TEXT("Client Hit\nHealth: %d"), CurrentHealth));
}

View File

@@ -36,13 +36,13 @@ protected:
ClassNames ClassName;
/*Functions*/
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Health")
void TakeDamage(int DamageValue);
public:
/*Properties*/
/*Functions*/
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Health")
void TakeDamage(int DamageValue);
/*C++ only declarations*/
private:

View File

@@ -9,7 +9,7 @@ struct FHealthSegment : public FTableRowBase
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments")
ClassNames Class = ClassNames::Basic;
ClassNames Class;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments")
TArray<int> SegmentList;

View File

@@ -2,10 +2,7 @@
#include "DDICharacter.h"
#include "Components/CapsuleComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "OpenConflict/Weapons/Projectiles/ProjectileBase.h"
// Sets default values
ADDICharacter::ADDICharacter()
@@ -20,12 +17,6 @@ ADDICharacter::ADDICharacter()
CameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, 50.0f));
CameraComponent->bUsePawnControlRotation = true;
HealthComponent = CreateDefaultSubobject<UDDIHealth>(TEXT("HealthComponent"));
GetCapsuleComponent()->SetCollisionProfileName(TEXT("BlockAllDynamic"));
GetCapsuleComponent()->SetGenerateOverlapEvents(true);
GetCapsuleComponent()->SetNotifyRigidBodyCollision(true);
}
@@ -34,11 +25,6 @@ void ADDICharacter::BeginPlay()
{
Super::BeginPlay();
if (GetCapsuleComponent())
{
GetCapsuleComponent()->OnComponentHit.AddDynamic(this, &ADDICharacter::OnHit);
}
}
// Called every frame
@@ -48,69 +34,4 @@ void ADDICharacter::Tick(float DeltaTime)
}
void ADDICharacter::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
Server_CharacterHit(HitComponent, OtherActor, OtherComp, NormalImpulse, Hit);
}
void ADDICharacter::TakeDamage(int Damage)
{
HealthComponent->TakeDamage(Damage);
}
bool ADDICharacter::Server_SpawnProjectile_Validate()
{
return true;
}
void ADDICharacter::Server_SpawnProjectile_Implementation()
{
FVector Location = GetActorLocation();
FRotator Rotation = GetActorRotation();
FVector Dir = GetActorForwardVector();
Location += Dir * 200.f;
if (!ProjectileClass)
{
GEngine->AddOnScreenDebugMessage(1, 10.f, FColor::Emerald, "No Projectile Set");
return;
}
GetWorld()->SpawnActor<AActor>(ProjectileClass, Location, Rotation);
}
void ADDICharacter::Client_CharacterHit_Implementation()
{
TakeDamage(10);
OnDamageTaken();
}
bool ADDICharacter::Client_CharacterHit_Validate()
{
return true;
}
void ADDICharacter::Server_CharacterHit_Implementation(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
if (AProjectileBase* Projectile = Cast<AProjectileBase>(OtherActor))
{
// if (Cast<ADDICharacter>(Projectile->Owner) == this)
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Emerald, "Damage dealt");
Client_CharacterHit();
}
}
bool ADDICharacter::Server_CharacterHit_Validate(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
return true;
}
void ADDICharacter::OnRep_Health()
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "Health Replicated");
}
void ADDICharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ADDICharacter, HealthComponent);
}

View File

@@ -4,9 +4,7 @@
#include "CoreMinimal.h"
#include "Camera/CameraComponent.h"
#include "Components/DDIHealth.h"
#include "GameFramework/Character.h"
#include "Net/UnrealNetwork.h"
#include "DDICharacter.generated.h"
@@ -14,69 +12,20 @@ UCLASS()
class OPENCONFLICT_API ADDICharacter : public ACharacter
{
GENERATED_BODY()
/*UPROPERTY and UFUNCTION declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
UFUNCTION(BlueprintImplementableEvent, Category = "Events")
void OnDamageTaken();
public:
/*Properties*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera")
UCameraComponent* CameraComponent;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Health", ReplicatedUsing=OnRep_Health)
UDDIHealth* HealthComponent;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
TSubclassOf<AActor> ProjectileClass;
/*Functions*/
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
UFUNCTION()
void TakeDamage(int Damage);
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
void Server_SpawnProjectile();
UFUNCTION(Client, Reliable, WithValidation, BlueprintCallable)
void Client_CharacterHit();
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
void Server_CharacterHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
UFUNCTION()
void OnRep_Health();
/*C++ only declarations*/
private:
/*Properties*/
/*Functions*/
// Sets default values for this character's properties
ADDICharacter();
protected:
/*Properties*/
/*Functions*/
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
/*Properties*/
/*Functions*/
// Sets default values for this character's properties
ADDICharacter();
// Called every frame
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera")
UCameraComponent* CameraComponent;
};

View File

@@ -1,52 +0,0 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "ProjectileBase.h"
#include "OpenConflict/PlayerCharacter/DDICharacter.h"
// Sets default values
AProjectileBase::AProjectileBase()
{
// 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;
bNetLoadOnClient = true;
InitialLifeSpan = 3.f;
collision = CreateDefaultSubobject<USphereComponent>("Collision");
RootComponent = collision;
collision->BodyInstance.SetCollisionProfileName(TEXT("BlockAllDynamic"));
projectileMesh = CreateDefaultSubobject<UStaticMeshComponent>("ProjectileMesh");
projectileMesh->SetupAttachment(collision);
projectileMotion = CreateDefaultSubobject<UProjectileMovementComponent>("ProjectileMovementComponent");
}
// Called when the game starts or when spawned
void AProjectileBase::BeginPlay()
{
Super::BeginPlay();
if (collision)
collision->OnComponentHit.AddDynamic(this, &AProjectileBase::OnHit);
}
// Called every frame
void AProjectileBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AProjectileBase::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
// if (ADDICharacter* character = Cast<ADDICharacter>(OtherActor))
Destroy();
}

View File

@@ -1,64 +0,0 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/SphereComponent.h"
#include "GameFramework/Actor.h"
#include "GameFramework/ProjectileMovementComponent.h"
#include "ProjectileBase.generated.h"
UCLASS()
class OPENCONFLICT_API AProjectileBase : public AActor
{
GENERATED_BODY()
/*UPROPERTY and UFUNCTION declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
public:
/*Properties*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
UStaticMeshComponent* projectileMesh;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
USphereComponent* collision;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
UProjectileMovementComponent* projectileMotion;
/*Functions*/
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
/*C++ only declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
// Called when the game starts
virtual void BeginPlay() override;
public:
/*Properties*/
/*Functions*/
// Called every frame
virtual void Tick(float DeltaTime) override;
// Sets default values for this actor's properties
AProjectileBase();
};

View File

@@ -1,27 +0,0 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "WeaponBase.h"
// Sets default values
AWeaponBase::AWeaponBase()
{
// 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;
}
// Called when the game starts or when spawned
void AWeaponBase::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AWeaponBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@@ -1,26 +0,0 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "WeaponBase.generated.h"
UCLASS()
class OPENCONFLICT_API AWeaponBase : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AWeaponBase();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};