diff --git a/EndlessVendetta/Config/DefaultEditor.ini b/EndlessVendetta/Config/DefaultEditor.ini index 58552fae..e7314343 100644 --- a/EndlessVendetta/Config/DefaultEditor.ini +++ b/EndlessVendetta/Config/DefaultEditor.ini @@ -5,4 +5,7 @@ SimpleMapName=/Game/FirstPerson/Maps/FirstPersonExampleMap bAllowClassAndBlueprintPinMatching=true bReplaceBlueprintWithClass= true bDontLoadBlueprintOutsideEditor= true -bBlueprintIsNotBlueprintType= true \ No newline at end of file +bBlueprintIsNotBlueprintType= true + +[/Script/AdvancedPreviewScene.SharedProfiles] + diff --git a/EndlessVendetta/Config/DefaultEngine.ini b/EndlessVendetta/Config/DefaultEngine.ini index 61a9966a..126166fe 100644 --- a/EndlessVendetta/Config/DefaultEngine.ini +++ b/EndlessVendetta/Config/DefaultEngine.ini @@ -85,3 +85,6 @@ ConnectionType=USBOnly bUseManualIPAddress=False ManualIPAddress= + +[CoreRedirects] ++PropertyRedirects=(OldName="/Script/EndlessVendetta.BaseWeaponClass.player",NewName="/Script/EndlessVendetta.BaseWeaponClass.playerInWorld") \ No newline at end of file diff --git a/EndlessVendetta/Content/AI/Enemy/Basic/BP_BasicEnemyCharacter.uasset b/EndlessVendetta/Content/AI/Enemy/Basic/BP_BasicEnemyCharacter.uasset index 4ef4dffe..1274a0a0 100644 --- a/EndlessVendetta/Content/AI/Enemy/Basic/BP_BasicEnemyCharacter.uasset +++ b/EndlessVendetta/Content/AI/Enemy/Basic/BP_BasicEnemyCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:43f411636e7605c44c59066cacff070b330cc2e9853e487e55fa176b49e3ab6d -size 33434 +oid sha256:ebb90a9b178b2eda1dd206095562e9b4cbaa8a913ddf15003b87fa3c664e8dab +size 33587 diff --git a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset index 69ba91c0..c6396a47 100644 --- a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset +++ b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eec8c05a75e7932e3834cbc1cd1b112f29171212b871fa1552f458ceb1b65948 -size 8000 +oid sha256:f9c7063e48c0b3c23194a6a2fc3625da96d20bbd92fece19210001cf0cac8964 +size 8568 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 6f9ddff6..1cd92c0a 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:228cb8be1c293a528c0116b78bac09d6dd2a180ca322029dbe245df30e35c126 -size 49329 +oid sha256:5431985cf2ef161d75bd2da6d55c3513b80f5c5f13010f132c47f57f2e5b84dc +size 42521 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_PickUp_Rifle.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_PickUp_Rifle.uasset index 42fff7f9..a8f825b9 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_PickUp_Rifle.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_PickUp_Rifle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d156d6fe24779674a35f18f9209313b0c2096d22772400c4d10c241a2e59e9e -size 21649 +oid sha256:118d852be72576a513c2a8c719e1d94450907a5dc00f27dd98914deb48a18c09 +size 21604 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_BaseAssaultRifle.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_BaseAssaultRifle.uasset index 50209cd2..f0a16367 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_BaseAssaultRifle.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_BaseAssaultRifle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b311799aa263b7af6d3eb738da33d39b0d40d7883bf0a4e3cb6024e06157cec -size 37724 +oid sha256:99fdc6f5e7c67d7a44ca185fad64f6c99ad6142011c9de4566761ec07bdd68d0 +size 37860 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset index 0aef22ed..dc2d119d 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4dfbc572d0f67be5a3c6898946ce7fce2895174236407ce9910f99c59690367 -size 28778 +oid sha256:af36276c4e513a207e06ec1eaa8f5c4273ab5634330a999db47ac9128e7d02ec +size 29776 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_GunCameraShake.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_GunCameraShake.uasset new file mode 100644 index 00000000..a24df98a --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_GunCameraShake.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b5bc4f06eaeb74c61b627c02ff6e49dedeebfe047bc79fbfa8941b25c4674ef +size 7209 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Images/crosshair.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Images/crosshair.uasset new file mode 100644 index 00000000..aeb09d75 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Images/crosshair.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:110eea3093bb784d7c237753fcd6f029cc8d3b388991f886a9752d6960195e14 +size 12511 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Images/fadenkreuz-transparent-crosshair-slayer-god-hates-us-all-album-cover-11562902578sasayvkjg8.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Images/fadenkreuz-transparent-crosshair-slayer-god-hates-us-all-album-cover-11562902578sasayvkjg8.uasset new file mode 100644 index 00000000..2caf2972 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Images/fadenkreuz-transparent-crosshair-slayer-god-hates-us-all-album-cover-11562902578sasayvkjg8.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df1398829f499b8a95bd2a912851aa613d1b26519496f1bc38a58db91c2a7730 +size 62044 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset index 3f00099b..ea240160 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:202ab16b4ffa35b8b8140c728744b529514cd98e7cf595a674e0bd13bcfbaff9 -size 29227 +oid sha256:71b1463641785fe268bbea7f26c1e1d12cb0703f47b2ec1c50afd19ed3f061ed +size 30046 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WeaonRecoil/AssaultRecoilPattern.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WeaonRecoil/AssaultRecoilPattern.uasset new file mode 100644 index 00000000..423c7283 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WeaonRecoil/AssaultRecoilPattern.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b63c754fc78a67f950a91e30dd31a6778bac31a485191b9cc14560515d5012a5 +size 2033 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset new file mode 100644 index 00000000..bdd28701 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_Crosshair.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3c0a70c5b68ec66372ae8e29abcb76deb385319f24202e43395c9061b3d0f8a +size 24854 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_GunAimIn.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_GunAimIn.uasset new file mode 100644 index 00000000..e3118a9f --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_GunAimIn.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b9f2db74a440d4cbe20066719467311b6d43de3676027ec2162fc39a2c7ac85 +size 1370 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_HoldShoot.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_HoldShoot.uasset deleted file mode 100644 index ac52169f..00000000 --- a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_HoldShoot.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1360a5e75da75d76374ea2091191ab85eab8ae0407f660ec7e242bdb51056670 -size 1659 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Reload.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Reload.uasset new file mode 100644 index 00000000..5ed3f2f9 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Reload.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85ff514d76166f7c202ee64b678abe6314dcc24d3d662883b53edb7608ea2bfe +size 1647 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Shoot.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Shoot.uasset new file mode 100644 index 00000000..0186b774 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Shoot.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d92be41146c90185585f7a2de5a18d31a688d2cc8dfb22b24b9a7a92dbfd1ce1 +size 1355 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_TapShoot.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_TapShoot.uasset deleted file mode 100644 index b951ed44..00000000 --- a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_TapShoot.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d02927e6f81929b1b6715400ce5f1a62361f239a5baad938902ae86b61ddc55 -size 1657 diff --git a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset index aea937a7..2bc21ec7 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16c8e5300c4e8a4ec385de79af752132edd42ddda7a67010daca5a560dc82ac4 -size 16903 +oid sha256:e84853e2ab5cb8653ef3686fdd8ce458fbadd1261807bdc73feb5212015290ce +size 17496 diff --git a/EndlessVendetta/Content/FirstPerson/Input/IMC_Weapons.uasset b/EndlessVendetta/Content/FirstPerson/Input/IMC_Weapons.uasset index e0d25572..0f7cd254 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/IMC_Weapons.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/IMC_Weapons.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:99664f7a2d02cd77eec769cd0a690345e80de975fcacb8a615346583218e1b15 -size 4138 +oid sha256:24bf0d5a1ecce706cf33ff99e0ba7c1e0601dea5433ffd1f61732d522c9f4488 +size 4115 diff --git a/EndlessVendetta/Content/FirstPersonArms/Animations/FirstPerson_AnimBP.uasset b/EndlessVendetta/Content/FirstPersonArms/Animations/FirstPerson_AnimBP.uasset index c514eab5..44d21afa 100644 --- a/EndlessVendetta/Content/FirstPersonArms/Animations/FirstPerson_AnimBP.uasset +++ b/EndlessVendetta/Content/FirstPersonArms/Animations/FirstPerson_AnimBP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:175427d440d7f510cbbfa4630c82a677a83348f3b3b5cc555e09a7b03cf2e4ee -size 473991 +oid sha256:bd95413d072ec5535444d09946cfb0ec3f4f6392ff5712e60fa521c845b23cdc +size 478510 diff --git a/EndlessVendetta/Content/Gadgets/BP_DeadEnemy.uasset b/EndlessVendetta/Content/Gadgets/BP_DeadEnemy.uasset new file mode 100644 index 00000000..934ef0f7 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/BP_DeadEnemy.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45e0a403f0bfb807fb6b6b3fe987c02e2f1f79af908507e8071a0c6259d64ed1 +size 28624 diff --git a/EndlessVendetta/Content/Gadgets/BP_Grenade.uasset b/EndlessVendetta/Content/Gadgets/BP_Grenade.uasset new file mode 100644 index 00000000..92db3563 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/BP_Grenade.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b5b0aa3f0b0da4c979843a761e655ef147058bb43079f24e4ef358532a7d5cf +size 49595 diff --git a/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/BP_OM_Explosive.uasset b/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/BP_OM_Explosive.uasset new file mode 100644 index 00000000..7a2cb36f --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/BP_OM_Explosive.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0294c0bf210acc1dbff59e7259400d9dd1c0f2a6674c2a130a5a24dd7e8d6c9d +size 49878 diff --git a/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/CG_OverloadModule.uasset b/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/CG_OverloadModule.uasset new file mode 100644 index 00000000..918f8800 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/CG_OverloadModule.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54c29d51176ad4d6f3709487c680854c3f65197fd77c3fdf909aacebf0012925 +size 109955 diff --git a/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/WBP_OM_ScreenWidget.uasset b/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/WBP_OM_ScreenWidget.uasset new file mode 100644 index 00000000..f48c5af0 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/WBP_OM_ScreenWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ca74a9a4b471019294bae3731c5b9d96eedd3ef09a2c877a7b0966457437f6c +size 260939 diff --git a/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset b/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset index 3f170b83..659e6cc8 100644 --- a/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset +++ b/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:654adc50d788c8fb0546796c4a290967958f12c156d3a135034339350831dba6 -size 22655 +oid sha256:101873288135db576b1a0060f9872880d1b4aaa7eca4c80cb4aa05925c67e275 +size 22674 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/BP_RingingPhone.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/BP_RingingPhone.uasset new file mode 100644 index 00000000..c2168845 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/BP_RingingPhone.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b98c1ddcdd17636cb29a010217910419c7674894cef53127e723f4298fb714d +size 47866 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset new file mode 100644 index 00000000..0ed980f6 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d874ac6c73fe2ee1d7f1024877b2f448df3daf631d5dafbf4e23804549fa652 +size 108456 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_1.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_1.uasset new file mode 100644 index 00000000..e6ba3ca4 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d35033628bd5db17cb99027efbab8c2dd473e5388fb32d34558e11e7f338c73d +size 3852614 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_2.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_2.uasset new file mode 100644 index 00000000..ec55125b --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ea010e84dc996169f39e921770477b79303bccf4bb40972f258106064245e6e +size 3386251 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_4.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_4.uasset new file mode 100644 index 00000000..93fcaa59 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_4.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8386a474ed43859781c4a531ccb1236ba402a03b4f1927ed7b5d5079f1980661 +size 3390670 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_1.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_1.uasset new file mode 100644 index 00000000..d69e0e6a --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00265bc01e803ae78c9486a50cdb2fe60b93de0d265a599dec052b079cc724c8 +size 4272 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_2.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_2.uasset new file mode 100644 index 00000000..a81042d9 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8b96750f088380206ae1d2efbe770b4257e226e91e25931200a75e0816087dc +size 4272 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_4.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_4.uasset new file mode 100644 index 00000000..526aa997 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingTone_Cue_4.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:324f88c110dc7f51d064e81abab62461b423fa3fd69926a9e5c7a03d34e143e3 +size 4272 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingtone_3.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingtone_3.uasset new file mode 100644 index 00000000..50d48159 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingtone_3.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81979a2046a7663ac4f084d2824198b887b891f2dfb2d497ba58ebf5bf89d166 +size 4030169 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingtone_Cue_3.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingtone_Cue_3.uasset new file mode 100644 index 00000000..6d4ddfdd --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/Ringtones/TempRingtone_Cue_3.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7858b2bb4d57c53a0fa054ba19bda0f09e8c7b6bb797785be5c0e91a3ab9cb41 +size 4272 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/WBP_RM_ScreenWidget.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/WBP_RM_ScreenWidget.uasset new file mode 100644 index 00000000..747ddfc3 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/WBP_RM_ScreenWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffd72773986cdacf62029cebebc6b25f8a581d0270358c303b8a968c6bfd23da +size 254397 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset index a52acef6..f0c43d86 100644 --- a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:00ef54778dd4058c75ad6dca1b46531f8b20b3b154373294be43fa8d5e9ebbdc -size 106247 +oid sha256:f40722ce6381c0b65978b90489e162c36b1335524162d4b112fe22a6d382fc24 +size 108529 diff --git a/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap b/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap index cb32e614..ee781591 100644 --- a/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap +++ b/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b05392dd6ea5c33327b50c71be4e3b736b96c356d8de84d894562af209c1f75 -size 103876 +oid sha256:38cb9c3d251f43819b4908c0a95aff93c8c3185de87ef7051cf426b33797f636 +size 108254 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index caa0814c..a76d9a83 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81331a890b185a2c1bc418da80b947c289a8ab67ff91737e9b187c45c71d083d +oid sha256:35965626ed27917622aa4630a23b7a047248cb9b9b0e66e1843969c4b1e0aadb size 66790690 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index 56bddfc9..413bf4e9 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 -size 47333 +oid sha256:000a98212651fd0d1c6804c7636e5e4614f710bd1a19a87b394f13dda3bcbc17 +size 47710 diff --git a/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset b/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset index c3067fb0..06d1c788 100644 --- a/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset +++ b/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8a38d567de25b3df88bbe21626983ee66de938d460d4c22aabc81f9790376222 -size 14569 +oid sha256:3439980aab6831afe77137df063f00b63258da0e3ba5c3c8b84a00e86c48bbf9 +size 15025 diff --git a/EndlessVendetta/Content/__ExternalActors__/FirstPerson/Maps/GunMechanicTester/0/3Z/SNIBJQL2L6YHSC7MTTK1C2.uasset b/EndlessVendetta/Content/__ExternalActors__/FirstPerson/Maps/GunMechanicTester/0/3Z/SNIBJQL2L6YHSC7MTTK1C2.uasset deleted file mode 100644 index 4f6bab25..00000000 --- a/EndlessVendetta/Content/__ExternalActors__/FirstPerson/Maps/GunMechanicTester/0/3Z/SNIBJQL2L6YHSC7MTTK1C2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fdab805d14a7bc4f2fa61abc0106161cf2626e8857ae14089d5e4c93f9a320d6 -size 5061 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 0fd3afde..26f9566f 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -91,7 +91,12 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* EnhancedInputComponent->BindAction(EquipSecondaryWeapon, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::EquipSecondary); //Weapon Shooting - EnhancedInputComponent->BindAction(TapShootAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::TapFireCaller); + EnhancedInputComponent->BindAction(TapShootAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::FireCaller); + EnhancedInputComponent->BindAction(GunAimInAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::GunRightClick); + EnhancedInputComponent->BindAction(GunAimInAction, ETriggerEvent::Completed, this, &AEndlessVendettaCharacter::StopGunRightClick); + + //Weapon Reloading + EnhancedInputComponent->BindAction(GunReloadAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::GunReload); //Crouching EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::SetCrouch); @@ -168,6 +173,7 @@ void AEndlessVendettaCharacter::EquipPrimary() if (IsValid(PrimaryWeapon)) { PrimaryWeapon->Destroy(); + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); PrimaryWeapon = nullptr; bHasRifle = false; return; @@ -175,11 +181,9 @@ void AEndlessVendettaCharacter::EquipPrimary() if (IsValid(SecondaryWeapon)) EquipSecondary(); - // Marcel I respect you, like you and what not, please for the love of god don't touch these two guard clauses - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return; ///////////////////////// - if (GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return; /////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return; + if (GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return; + FActorSpawnParameters spawnParams; spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; @@ -193,34 +197,6 @@ void AEndlessVendettaCharacter::EquipPrimary() //We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor PrimaryWeapon = Cast(PrimaryWeaponActor); - //If primary weapon is not there but secondary weapon is it will call equipSecondary. - //EquipSecondary checks and sees that secondary is there so it will call to destroy itself - //Code goes back and sees primary weapon is not there anymore and spawns it in. - //Same thing for the EquipSecondary() - - - // if (!IsValid(PrimaryWeapon)) - // { - // if (IsValid(SecondaryWeapon)) EquipSecondary(); - // - // UE_LOG(LogTemp, Display, TEXT("Primary equipped")); - // bHasRifle = true; - // FActorSpawnParameters spawnParams; - // spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - // FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); - // //Creating a new actor object called PrimaryWeapon that is based off primaryweaponClass - // AActor* PrimaryWeaponActor = GetWorld()->SpawnActor(PrimaryWeaponClass, spawnParams); - // PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint")); - // //Changing PrimaryWeaponActor to ABaseWeaponClass type instead of actor and storing it into PrimaryWeapon which is a ABaseClass Object - // //We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor - // PrimaryWeapon = Cast(PrimaryWeaponActor); - // - // } - // else if (IsValid(PrimaryWeapon)) - // { - // PrimaryWeapon->Destroy(); - // bHasRifle = false; - // } } void AEndlessVendettaCharacter::EquipSecondary() @@ -228,6 +204,7 @@ void AEndlessVendettaCharacter::EquipSecondary() if (IsValid(SecondaryWeapon)) { SecondaryWeapon->Destroy(); + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); SecondaryWeapon = nullptr; bHasRifle = false; return; @@ -235,11 +212,9 @@ void AEndlessVendettaCharacter::EquipSecondary() if (IsValid(PrimaryWeapon)) EquipPrimary(); - // Marcel I respect you, like you and what not, please for the love of god don't touch these two guard clauses - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return; ///////////////////////// - if (GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return; /////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return; + if (GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return; + FActorSpawnParameters spawnParams; spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; @@ -249,73 +224,81 @@ void AEndlessVendettaCharacter::EquipSecondary() AActor* SecondaryWeaponActor = GetWorld()->SpawnActor(SecondaryWeaponClass, spawnParams); SecondaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint")); SecondaryWeapon = Cast(SecondaryWeaponActor); - - // if (!IsValid(SecondaryWeapon)) - // { - // if (IsValid(PrimaryWeapon)) EquipPrimary(); - // - // UE_LOG(LogTemp, Display, TEXT("Secondary equipped")); - // bHasRifle = true; - // FActorSpawnParameters spawnParams; - // spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - // FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); - // AActor* SecondaryWeaponActor = GetWorld()->SpawnActor(SecondaryWeaponClass, spawnParams); - // SecondaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint")); - // SecondaryWeapon = Cast(SecondaryWeaponActor); - // } - // else if (IsValid(SecondaryWeapon)) - // { - // SecondaryWeapon->Destroy(); - // bHasRifle = false; - // } } //Calls the fire function in the baseWeaponClass -void AEndlessVendettaCharacter::TapFireCaller() +void AEndlessVendettaCharacter::FireCaller() { UE_LOG(LogTemp, Warning, TEXT("Tap Fire")); - // if (IsValid(PrimaryWeapon) || IsValid(SecondaryWeapon)) - // { - // PrimaryWeaponClass.GetDefaultObject()->TapFire(); - // } + if (IsValid(PrimaryWeapon)) + { + PrimaryWeapon->Fire(); + } + if (IsValid(SecondaryWeapon)) + { + SecondaryWeapon->Fire(); + } } -//POTENTIAL PICKUP SYSTEM NEEDS CHANGING BUT YES - -//Called from Player BluePrints -/*void AEndlessVendettaCharacter::WeaponPickUpSystem(AActor* PickedUpWeapon) +void AEndlessVendettaCharacter::GunRightClick() { - ABaseWeaponClass* WeaponInWorld = Cast(PickedUpWeapon); - if(WeaponInWorld->IsA(ABaseWeaponClass::StaticClass())) + if (IsValid(PrimaryWeapon) && !bIsScoped) { - if(PrimaryWeapon) + for (UActorComponent* actorComp : this->GetComponentsByTag(UArrowComponent::StaticClass(), FName("ScopedLocationArrow"))) { - UE_LOG(LogTemp, Display, TEXT("Primary Weapon Picked up")); - bHasRifle = true; - FVector loc = GetActorLocation() + FVector(-50, 0, 0); - FRotator rot = GetActorRotation(); - FActorSpawnParameters spawnParams; - spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); - //WeaponInWorld = Cast(GetWorld()->SpawnActor(PrimaryWeapon, loc, rot, spawnParams)); - WeaponInWorld->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint")); - WeaponInWorld->Destroy(); - - //for some reason the spawning of the weapon is broken to the players hand so need to fix this. - - // potentially add a varibable to check if its a secondary or priamry weapon being picked up - // add this in the baseweaponclass variable + ScopedLocationArrow = Cast(actorComp); + break; } + if (!IsValid(ScopedLocationArrow)) return; + PrimaryWeapon->SetActorLocation(ScopedLocationArrow->GetComponentLocation()); + bIsScoped = true; + PrimaryWeapon->WeaponScopedFire(); + this->GetFirstPersonCameraComponent()->SetFieldOfView(50); //change this number to a number you can change in editor eventually } - if(WeaponInWorld->IsA(ABaseWeaponClass::StaticClass())) + if (IsValid(SecondaryWeapon) && !bIsScoped) { - if(SecondaryWeapon) + for (UActorComponent* actorComp : this->GetComponentsByTag(UArrowComponent::StaticClass(), FName("ScopedLocationArrow"))) { - UE_LOG(LogTemp, Display, TEXT("Secondary Weapon Picked up")); - + ScopedLocationArrow = Cast(actorComp); + break; } + if (!IsValid(ScopedLocationArrow)) return; + bIsScoped = true; + SecondaryWeapon->WeaponScopedFire(); + SecondaryWeapon->SetActorLocation(ScopedLocationArrow->GetComponentLocation()); + this->GetFirstPersonCameraComponent()->SetFieldOfView(50); //change this number to a number you can change in editor eventually } -}*/ +} + +void AEndlessVendettaCharacter::StopGunRightClick() +{ + if (IsValid(PrimaryWeapon)) + { + bIsScoped = false; + PrimaryWeapon->WeaponScopedFire(); + PrimaryWeapon->SetActorRelativeLocation(FVector(0,0,0)); + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); + } + if (IsValid(SecondaryWeapon)) + { + bIsScoped = false; + SecondaryWeapon->WeaponScopedFire(); + SecondaryWeapon->SetActorRelativeLocation(FVector(0,0,0)); + this->GetFirstPersonCameraComponent()->SetFieldOfView(90); + } +} + +void AEndlessVendettaCharacter::GunReload() +{ + if (IsValid(PrimaryWeapon)) + { + PrimaryWeapon->WeaponReload(); + } + if (IsValid(SecondaryWeapon)) + { + SecondaryWeapon->WeaponReload(); + } +} void AEndlessVendettaCharacter::Move(const FInputActionValue& Value) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index e1a503a7..4f8b754d 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -57,12 +57,15 @@ class AEndlessVendettaCharacter : public ACharacter UInputAction* EquipSecondaryWeapon; UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input, meta=(AllowPrivateAccess = "true")) - UInputAction* TapShootAction; + class UInputAction* TapShootAction; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input, meta=(AllowPrivateAccess = "true")) + class UInputAction* GunAimInAction; UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input, meta=(AllowPrivateAccess = "true")) - UInputAction* HoldShootAction; - - UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = ( AllowPrivateAccess = "true" )) + class UInputAction* GunReloadAction; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) UInputAction* CrouchAction; public: @@ -109,7 +112,21 @@ public: ABaseWeaponClass* SecondaryWeapon; UFUNCTION(BlueprintCallable, Category = "Weapons") - void TapFireCaller(); + void FireCaller(); + + UFUNCTION(BlueprintCallable, Category = "Weapons") + void GunRightClick(); + + UFUNCTION(BlueprintCallable, Category = "Weapons") + void StopGunRightClick(); + + UFUNCTION(BlueprintCallable, Category = "Weapons") + void GunReload(); + + UArrowComponent* ScopedLocationArrow; + + UPROPERTY(EditAnywhere, Category = "Dont Touch") + bool bIsScoped; protected: /** Called for movement input */ @@ -124,20 +141,18 @@ protected: void EquipPrimary(); void EquipSecondary(); - //Called from Player BluePrints - //UFUNCTION(BlueprintCallable, Category = "Weapons") - //void WeaponPickUpSystem(AActor* PickedUpWeapon); - + +protected: // APawn interface virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override; // End of APawn interface +public: UFUNCTION(BlueprintCallable, Category = "Stealth") void SetCrouch(); UFUNCTION(BlueprintCallable, Category = "Stealth") void SetUnCrouch(); -public: /** Returns Mesh1P Sub-object **/ USkeletalMeshComponent* GetMesh1P() const { return Mesh1P; } /** Returns FirstPersonCameraComponent Sub-object **/ diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.cpp new file mode 100644 index 00000000..4476d8d4 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.cpp @@ -0,0 +1,87 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Explosive.h" + +#include "CollisionDebugDrawingPublic.h" +#include "Kismet/KismetMathLibrary.h" + +// Sets default values +AExplosive::AExplosive() +{ + // 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 AExplosive::BeginPlay() +{ + Super::BeginPlay(); + + if (ExplosionDelayInSeconds <= 0) + { + Explosion(); + return; + } + + FTimerHandle ExplosionHandle; + GetWorld()->GetTimerManager().SetTimer(ExplosionHandle, this, &AExplosive::Explosion, ExplosionDelayInSeconds); +} + +// Called every frame +void AExplosive::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + +void AExplosive::Explosion() +{ + float PitchAngleIncrement = 180.f / ShrapnelPitchDensity; + float YawAngleIncrement = 360.f / ShrapnelYawDensity; + + FHitResult OutHit; + FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam; + QueryParams.bTraceComplex = false; + QueryParams.AddIgnoredActor(this); + FVector LT_Start = GetActorLocation(); + + for(int y = 1; y <= ShrapnelPitchDensity; y++) + { + for (int x = 1; x <= ShrapnelYawDensity; x++) + { + FRotator ShrapnelRotation = FRotator(-90.f + (y * PitchAngleIncrement), x * YawAngleIncrement, 0.f); + FVector LT_End = LT_Start + (UKismetMathLibrary::GetForwardVector(ShrapnelRotation) * ShrapnelTravelDistance); + bool HitSomething = GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams); + + if (DrawDebugLines) DrawShrapnelDebugLines(HitSomething, LT_Start, LT_End, OutHit.ImpactPoint); + if (!HitSomething || !OutHit.GetActor()->ActorHasTag(FName("Enemy")) || OutHit.GetActor()->ActorHasTag(FName("Dead"))) continue; + + float HitDistance = FVector::Distance(LT_Start, OutHit.ImpactPoint); + float DamageToApply = ShrapnelDamage; + if (HitDistance > ShrapnelDamageFalloffDistance) + { + // Damage linearly decrease from falloff distance to maximum travel distance, using straight line equation y = mx + c + float Magnitude = ShrapnelDamage / (ShrapnelDamageFalloffDistance - ShrapnelTravelDistance); + float DMG_Intercept = ShrapnelDamage - (Magnitude * ShrapnelDamageFalloffDistance); + DamageToApply = (Magnitude * HitDistance) + DMG_Intercept; + } + // When merged, call philips take damage function here + UE_LOG(LogTemp, Warning, TEXT("A shrapnel piece hit %s, dealing %f damage"), *OutHit.GetActor()->GetName(), DamageToApply); + } + } + PlayExplosionEffects(); +} + +void AExplosive::DrawShrapnelDebugLines(bool HitSomething, FVector StartVector, FVector EndVector, FVector ImpactPoint) +{ + if (!HitSomething) + { + DrawDebugLine(GetWorld(), StartVector, EndVector, FColor::Green, false, 5, 0, 2); + return; + } + DrawDebugLine(GetWorld(), ImpactPoint, EndVector, FColor::Red, false, 5, 0, 2); + DrawDebugLine(GetWorld(), StartVector, ImpactPoint, FColor::Green, false, 5, 0, 2); +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.h new file mode 100644 index 00000000..4ffb2806 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.h @@ -0,0 +1,63 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "Explosive.generated.h" + +UCLASS() +class ENDLESSVENDETTA_API AExplosive : public AActor +{ + GENERATED_BODY() + + void DrawShrapnelDebugLines(bool HitSomething, FVector StartVector, FVector EndVector, FVector ImpactPoint); + +protected: + // Maximum amount of damage dealt by an individual piece of shrapnel + UPROPERTY(EditDefaultsOnly, Category = "Explosion") + float ShrapnelDamage = 10; + + // Number of shrapnel pieces uniformly spread around the Y axis + UPROPERTY(EditDefaultsOnly, Category = "Explosion") + int ShrapnelPitchDensity = 40; + + // Number of shrapnel pieces uniformly spread around the Z axis + UPROPERTY(EditDefaultsOnly, Category = "Explosion") + int ShrapnelYawDensity = 40; + + // How far shrapnel should travel from origin point, given its not obstructed along its path + UPROPERTY(EditDefaultsOnly, Category = "Explosion") + float ShrapnelTravelDistance = 600; + + // After what distance travelled should shrapnel damage start to decrease + UPROPERTY(EditDefaultsOnly, Category = "Explosion") + float ShrapnelDamageFalloffDistance = 200; + + // Delay from spawning in before explosion happens + UPROPERTY(EditDefaultsOnly, Category = "Explosion") + float ExplosionDelayInSeconds = 0; + + /** + * Should debug lines be drawn to show planned travel trajectory of each + * shrapnel piece in red, and actual travelled shrapnel trajectory in green + */ + UPROPERTY(EditAnywhere, Category = "Explosion") + bool DrawDebugLines = false; + + UFUNCTION(BlueprintImplementableEvent, Category = "Explosion") + void PlayExplosionEffects(); + + void Explosion(); + + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Sets default values for this actor's properties + AExplosive(); + + // Called every frame + virtual void Tick(float DeltaTime) override; + +}; diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/OverloadModule/OverloadModule.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/OverloadModule/OverloadModule.cpp new file mode 100644 index 00000000..c89568ee --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/OverloadModule/OverloadModule.cpp @@ -0,0 +1,129 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "OverloadModule.h" + +#include "Components/SphereComponent.h" +#include "GameFramework/Character.h" + +void AOverloadModule::BeginPlay() +{ + Super::BeginPlay(); + + this->SetActorTickInterval(0.2); + PlayerChar = GetWorld()->GetFirstPlayerController()->GetCharacter(); + PlayerCam = Cast(PlayerChar->GetComponentByClass(UCameraComponent::StaticClass())); +} + + +void AOverloadModule::Tick(float DeltaSeconds) +{ + Super::Tick(DeltaSeconds); + + if (GadgetCantBeUsed()) return; + CheckForPotentialHackTarget(); +} + +void AOverloadModule::CheckForPotentialHackTarget() +{ + FHitResult OutHit; + FVector LT_Start = PlayerCam->GetComponentLocation(); + FVector LT_End = PlayerCam->GetComponentLocation() + (PlayerCam->GetForwardVector() * DeadBodyCheckDistance); + + //DrawDebugLine(GetWorld(), LT_Start, LT_End, FColor::Red, false, 0.2, 0, 1); + + FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam; + QueryParams.AddIgnoredActor(PlayerChar); + if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams) || !(OutHit.GetActor()->ActorHasTag(FName("Enemy")) && OutHit.GetActor()->ActorHasTag(FName("Dead")))) + { + PotentialHackTarget = nullptr; + DisplayNeedADeadEnemy(); + return; + } + + if (HackedEnemies.Contains(OutHit.GetActor()->GetUniqueID())) + { + PotentialHackTarget = nullptr; + DisplayAlreadyHacked(); + return; + } + + //DrawDebugLine(GetWorld(), LT_Start, OutHit.ImpactPoint, FColor::Green, false, 0.2, 0, 1); + PotentialHackTarget = OutHit.GetActor(); + DisplayFoundPotentialTarget(); +} + + +void AOverloadModule::Activate() +{ + if (GadgetCantBeUsed() || !IsValid(PotentialHackTarget)) return; + + Super::Activate(); + HackedEnemies.Add(PotentialHackTarget->GetUniqueID()); + ExplodeClosestAliveEnemy(); + PlayHackingAnim(GadgetMaxUptime); +} + +void AOverloadModule::FinishedUsing() +{ + IsValid(ClosestEnemy) ? DisplayHackingSuccess() : DisplayHackingFailure(); + SpawnExplosiveOnActor(ClosestEnemy); + Super::FinishedUsing(); + PlayRechargingAnim(CooldownTime); +} + +void AOverloadModule::ExplodeClosestAliveEnemy() +{ + FTransform EmptyTransform; + USphereComponent* SphereCollision = Cast(AddComponentByClass(USphereComponent::StaticClass(), false, EmptyTransform, false)); + + SphereCollision->SetSphereRadius(AreaOfEffectInMeters * 100, true); + + TArray OverlappingActors; + TArray EnemiesInRadius; + + // Find all living enemies within the radius + SphereCollision->GetOverlappingActors(OverlappingActors, ACharacter::StaticClass()); + for (AActor* OverlappingActor : OverlappingActors) + { + if (OverlappingActor->ActorHasTag(FName("Enemy")) && !OverlappingActor->ActorHasTag(FName("Dead"))) EnemiesInRadius.Add(OverlappingActor); + } + + if (EnemiesInRadius.IsEmpty()) + { + ClosestEnemy = nullptr; + SphereCollision->DestroyComponent(); + return; + } + + // Find the closest Enemy in radius + ClosestEnemy = EnemiesInRadius[0]; + float Dist = FVector::Distance(PlayerChar->GetActorLocation(), ClosestEnemy->GetActorLocation()); + if (EnemiesInRadius.Num() < 2) + { + SphereCollision->DestroyComponent(); + return; + } + + for (int i = 1; i < EnemiesInRadius.Num(); i++) + { + float ConsideredDist = FVector::Distance(PlayerChar->GetActorLocation(), EnemiesInRadius[i]->GetActorLocation()); + if (ConsideredDist <= Dist) + { + ClosestEnemy = EnemiesInRadius[i]; + Dist = ConsideredDist; + } + } + + SphereCollision->DestroyComponent(); + +} + +void AOverloadModule::SpawnExplosiveOnActor(AActor* ActortoExplode) +{ + if (!IsValid(ActortoExplode)) return; + FActorSpawnParameters SpawnParams; + SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + GetWorld()->SpawnActor(Explosive, ActortoExplode->GetActorLocation(), ActortoExplode->GetActorRotation(), SpawnParams); +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/OverloadModule/OverloadModule.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/OverloadModule/OverloadModule.h new file mode 100644 index 00000000..59ffdd3a --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Combat/OverloadModule/OverloadModule.h @@ -0,0 +1,75 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Camera/CameraComponent.h" +#include "EndlessVendetta/GadgetSystem/CombatGadget.h" +#include "EndlessVendetta/GadgetSystem/GadgetClasses/Combat/Explosive.h" +#include "OverloadModule.generated.h" + +/** + * + */ +UCLASS() +class ENDLESSVENDETTA_API AOverloadModule : public ACombatGadget +{ + GENERATED_BODY() + + ACharacter* PlayerChar; + + UCameraComponent* PlayerCam; + + AActor* PotentialHackTarget; + + AActor* ClosestEnemy; + + // An Array of previously hacked enemies, stops player from hacking the same Dead Enemy + TArray HackedEnemies; + + virtual void BeginPlay() override; + + virtual void Tick(float DeltaSeconds) override; + + virtual void Activate() override; + + virtual void FinishedUsing() override; + + void CheckForPotentialHackTarget(); + + void ExplodeClosestAliveEnemy(); + + void SpawnExplosiveOnActor(AActor* ActortoExplode); + +protected: + UPROPERTY(EditDefaultsOnly, Category = "Overload Module") + float AreaOfEffectInMeters = 20; + + UPROPERTY(EditDefaultsOnly, Category = "Overload Module") + float DeadBodyCheckDistance = 250; + + UPROPERTY(EditDefaultsOnly, Category = "Overload Module") + TSubclassOf Explosive; + +// --------------- Display Functions --------------- + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void DisplayAlreadyHacked(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void DisplayNeedADeadEnemy(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void DisplayFoundPotentialTarget(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void PlayHackingAnim(float Loadingtime); + + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void DisplayHackingFailure(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void DisplayHackingSuccess(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module") + void PlayRechargingAnim(float RechargingTime); +}; diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.cpp new file mode 100644 index 00000000..c3117259 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.cpp @@ -0,0 +1,27 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "PhoneRinging.h" + +// Sets default values +APhoneRinging::APhoneRinging() +{ + // 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 APhoneRinging::BeginPlay() +{ + Super::BeginPlay(); + +} + +// Called every frame +void APhoneRinging::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.h new file mode 100644 index 00000000..dd9f8cdc --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "PhoneRinging.generated.h" + +UCLASS() +class ENDLESSVENDETTA_API APhoneRinging : public AActor +{ + GENERATED_BODY() + +public: + // Sets default values for this actor's properties + APhoneRinging(); + +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void Tick(float DeltaTime) override; + +}; diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp new file mode 100644 index 00000000..d282dd8a --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp @@ -0,0 +1,102 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "RingModule.h" + +#include "Components/SphereComponent.h" +#include "GameFramework/Character.h" + +void ARingModule::BeginPlay() +{ + Super::BeginPlay(); + + this->SetActorTickInterval(0.2); + PlayerChar = GetWorld()->GetFirstPlayerController()->GetCharacter(); + PlayerCam = Cast(PlayerChar->GetComponentByClass(UCameraComponent::StaticClass())); +} + +void ARingModule::Tick(float DeltaSeconds) +{ + Super::Tick(DeltaSeconds); + + if (GadgetCantBeUsed()) return; + CheckForPotentialHackTarget(); +} + +void ARingModule::CheckForPotentialHackTarget() +{ + FHitResult OutHit; + FVector LT_Start = PlayerCam->GetComponentLocation(); + FVector LT_End = PlayerCam->GetComponentLocation() + (PlayerCam->GetForwardVector() * DeadBodyCheckDistance); + + //DrawDebugLine(GetWorld(), LT_Start, LT_End, FColor::Red, false, 0.2, 0, 1); + + FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam; + QueryParams.AddIgnoredActor(PlayerChar); + if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams) || !(OutHit.GetActor()->ActorHasTag(FName("Enemy")) && OutHit.GetActor()->ActorHasTag(FName("Dead")))) + { + PotentialHackTarget = nullptr; + DisplayNeedADeadEnemy(); + return; + } + + if (HackedEnemies.Contains(OutHit.GetActor()->GetUniqueID())) + { + PotentialHackTarget = nullptr; + DisplayAlreadyHacked(); + return; + } + + //DrawDebugLine(GetWorld(), LT_Start, OutHit.ImpactPoint, FColor::Green, false, 0.2, 0, 1); + PotentialHackTarget = OutHit.GetActor(); + DisplayFoundPotentialTarget(); +} + + +void ARingModule::Activate() +{ + if (GadgetCantBeUsed() || !IsValid(PotentialHackTarget)) return; + + Super::Activate(); + HackedEnemies.Add(PotentialHackTarget->GetUniqueID()); + PlayHackingAnim(GadgetMaxUptime); +} + +void ARingModule::FinishedUsing() +{ + SpawnRingingPhoneForAllNearbyEnemies() ? DisplayHackingSuccess() : DisplayHackingFailure(); + Super::FinishedUsing(); + PlayRechargingAnim(CooldownTime); +} + +bool ARingModule::SpawnRingingPhoneForAllNearbyEnemies() +{ + FTransform EmptyTransform; + USphereComponent* SphereCollision = Cast(AddComponentByClass(USphereComponent::StaticClass(), false, EmptyTransform, false)); + SphereCollision->SetSphereRadius(AreaOfEffectInMeters * 100, true); + + TArray OverlappingActors; + TArray EnemiesInRadius; + + SphereCollision->GetOverlappingActors(OverlappingActors, ACharacter::StaticClass()); + for (AActor* OverlappingActor : OverlappingActors) + { + if (OverlappingActor->ActorHasTag(FName("Enemy")) && !OverlappingActor->ActorHasTag(FName("Dead"))) EnemiesInRadius.Add(OverlappingActor); + } + + if (EnemiesInRadius.IsEmpty()) + { + SphereCollision->DestroyComponent(); + return false; + } + + FActorSpawnParameters SpawnParams; + SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); + for (AActor* Enemy : EnemiesInRadius) + { + AActor* SpawnedPhone = GetWorld()->SpawnActor(PhoneRingingClass, Enemy->GetActorLocation(), Enemy->GetActorRotation(), SpawnParams); + SpawnedPhone->AttachToComponent(Enemy->GetRootComponent(), AttachmentRules); + } + return true; +} diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h new file mode 100644 index 00000000..68dfb294 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h @@ -0,0 +1,72 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "PhoneRinging.h" +#include "EndlessVendetta/GadgetSystem/ReconGadget.h" +#include "Camera/CameraComponent.h" +#include "RingModule.generated.h" + +/** + * + */ +UCLASS() +class ENDLESSVENDETTA_API ARingModule : public AReconGadget +{ + GENERATED_BODY() + + ACharacter* PlayerChar; + + UCameraComponent* PlayerCam; + + AActor* PotentialHackTarget; + + // An Array of previously hacked enemies, stops player from hacking the same Dead Enemy + TArray HackedEnemies; + + virtual void BeginPlay() override; + + virtual void Tick(float DeltaSeconds) override; + + virtual void Activate() override; + + virtual void FinishedUsing() override; + + void CheckForPotentialHackTarget(); + + // Returns false if there are no nearby enemies + bool SpawnRingingPhoneForAllNearbyEnemies(); + +protected: + UPROPERTY(EditDefaultsOnly, Category = "Ring Module") + float AreaOfEffectInMeters = 20; + + UPROPERTY(EditDefaultsOnly, Category = "Ring Module") + float DeadBodyCheckDistance = 250; + + UPROPERTY(EditDefaultsOnly, Category = "Ring Module") + TSubclassOf PhoneRingingClass; + + // --------------- Display Functions --------------- + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void DisplayAlreadyHacked(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void DisplayNeedADeadEnemy(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void DisplayFoundPotentialTarget(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void PlayHackingAnim(float Loadingtime); + + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void DisplayHackingFailure(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void DisplayHackingSuccess(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module") + void PlayRechargingAnim(float RechargingTime); +}; diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp index 52c807f9..eb11bf58 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp @@ -60,12 +60,11 @@ void AVisionLinkEnemyLOSTest::TestLOS(TArray EnemiesInLink, AActor* LOSA return; } - for (AActor* Enemy : OverlappingEnemies) + /*for (AActor* Enemy : OverlappingEnemies) { FRotator LookAtRotation = UKismetMathLibrary::FindLookAtRotation(LOSActor->GetActorLocation(), Enemy->GetActorLocation()); UE_LOG(LogTemp, Warning, TEXT("Look at Rotation: %f"), LookAtRotation.Yaw); - UE_LOG(LogTemp, Warning, TEXT("enemy name: %s"), *Enemy->GetName()); - } + }*/ Destroy(); diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 0d14f19d..dd57b613 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -2,7 +2,10 @@ #include "BaseWeaponClass.h" + +#include "AIHelpers.h" #include "EndlessVendetta/EndlessVendettaCharacter.h" +#include "Kismet/KismetMathLibrary.h" #include "Components/CapsuleComponent.h" #include "Kismet/GameplayStatics.h" @@ -21,46 +24,180 @@ void ABaseWeaponClass::BeginPlay() // Attempt to find the player character APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0); - player = Cast(PlayerController->GetCharacter()); - if (PlayerController) + playerInWorld = Cast(PlayerController->GetCharacter()); + + endlessVendettaChar = Cast(playerInWorld); + + for (UActorComponent* actorComp : playerInWorld->GetComponentsByTag(UArrowComponent::StaticClass(), FName("GunStart"))) { - if (player) - { - UE_LOG(LogTemp, Display, TEXT("BeginPlay: Player found.")); - } - else - { - UE_LOG(LogTemp, Error, TEXT("BeginPlay: Player not found.")); - } + GunStartArrow = Cast(actorComp); + break; } - else + + if (!playerControllerRef) { - UE_LOG(LogTemp, Error, TEXT("BeginPlay: Player controller not found.")); + playerControllerRef = UGameplayStatics::GetPlayerController(GetWorld(), 0); } + + originalMagnitude = recoilMagnitude; + originalMaxAngleLeft = recoilMaxAngleLeft; + originalMaxAngleRight = recoilMaxAngleRight; + originalMinMultiplier = recoilMinMultiplier; + + currentAmmoCount = MagazineSize; + + UE_LOG(LogTemp, Display, TEXT("crnnt ammo: %d"), MagazineSize); } // Called every frame void ABaseWeaponClass::Tick(float DeltaTime) { Super::Tick(DeltaTime); -} -void ABaseWeaponClass::TapFire() -{ - FHitResult outHit; - FVector traceStart; - FVector traceEnd; - traceStart = player->GetActorLocation(); - traceEnd = traceStart + (player->GetActorForwardVector() * 50); - UE_LOG(LogTemp, Display, TEXT("World: %s"), *GetWorld()->GetName()); - FCollisionQueryParams collisionParams; - GetWorld()->LineTraceSingleByChannel(outHit, traceStart, traceEnd, ECC_Visibility, collisionParams); - - //Debug line to see where the trace hit - DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Red, true); - if (outHit.bBlockingHit) + if (playerInWorld) { - UE_LOG(LogTemp, Display, TEXT("Hit something")); + ApplyRecoil(DeltaTime); } - UE_LOG(LogTemp, Display, TEXT("BOOMBOOMBIMBAMBIM")); } + + +// Recoil Handling //////////////////////////////////////////////////////////////////////////////////////////////////////////// +void ABaseWeaponClass::GenerateRecoilVector() +{ + float angle = FMath::RandRange(recoilMaxAngleLeft, -recoilMaxAngleRight); //randomg recoil vector angle between left and right + float recMag = recoilMagnitude * 252.f; //converting degrees to controller units + float tempMag = -FMath::RandRange(recMag * recoilMinMultiplier, recMag); // recoil magnitude + + recoilResultYaw = FMath::Sin(FMath::DegreesToRadians(angle)); + recoilResultPitch = FMath::Cos(FMath::DegreesToRadians(angle)); + + //scaling direction to magnitude + recoilResultPitch *= -tempMag; + recoilResultYaw *= tempMag; + + //reset recoil to 0 of curve + recoilTime = 0; +} + +void ABaseWeaponClass::ApplyRecoil(float DeltaTime) +{ + if (recoilTime < 0.3) + { + float amplitude = RecoilCurve->GetFloatValue(recoilTime); //get current value of curve in time + recoilTime += DeltaTime; + playerInWorld->AddControllerPitchInput(GetRecoilPitch(amplitude, recoilTime)); + playerInWorld->AddControllerYawInput(GetRecoilYaw(amplitude, recoilTime)); + UpdateSamples(amplitude, recoilTime); + } +} + +void ABaseWeaponClass::nullSamples() +{ + recoilCurvet = 0; + recoilCurvez1 = 0; +} + +float ABaseWeaponClass::GetRecoilPitch(float Amp, float Time) +{ + //Using the trapez method and we are getting the surface under the curve, each trapezoid consist of square and right triangle + float lower = recoilCurvez1 < Amp ? recoilCurvez1 : Amp; //get which point is common for both triangle and square of trapezoid + //lower point + float mult = (Time - recoilCurvet) * lower; //getting surface of square + mult += (Time - recoilCurvet) * (Amp - recoilCurvez1) / 2.0f; //getting and adding surface of triangle + return (recoilResultPitch * mult) / playerControllerRef->InputPitchScale_DEPRECATED; //calculating and return recoil force for current frame +} + + +//Same as getrecoilpitch +float ABaseWeaponClass::GetRecoilYaw(float Amp, float Time) +{ + float lower = recoilCurvez1 < Amp ? recoilCurvez1 : Amp; + float mult = (Time - recoilCurvet) * lower; + + mult += (Time - recoilCurvet) * (Amp - recoilCurvez1) / 2.0f; + return (recoilResultYaw * mult) / playerControllerRef->InputYawScale_DEPRECATED; +} + +void ABaseWeaponClass::UpdateSamples(float Amp, float Time) +{ + recoilCurvez1 = Amp; + recoilCurvet = Time; +} + +// Fire handling ////////////////////////////////////////////////////////////////////////////////////////////////////////// +void ABaseWeaponClass::ClickDetectionTimer() +{ + GetWorldTimerManager().SetTimer(timerHandle, this, &ABaseWeaponClass::Fire, 1 / FireRate, false); +} + +void ABaseWeaponClass::CancelFire() +{ + GetWorldTimerManager().ClearTimer(timerHandle); +} + +void ABaseWeaponClass::Fire() +{ + if(currentAmmoCount > 0) + { + //do damage fallof based off distance + FHitResult outHit; + FVector traceStart; + FVector traceEnd; + traceStart = GunStartArrow->GetComponentLocation(); + traceEnd = traceStart + (GunStartArrow->GetForwardVector() * BulletDistance); + FCollisionQueryParams collisionParams; + collisionParams.AddIgnoredActor(playerInWorld); + collisionParams.AddIgnoredActor(this); + if (GetWorldTimerManager().IsTimerActive(timerHandle)) + { + return; + } + GetWorld()->LineTraceSingleByChannel(outHit, traceStart, traceEnd, ECC_Visibility, collisionParams); + //Debug line to see where the trace hit + DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Red, false, 5.0f, 0U, 2.5f); + playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1); + currentAmmoCount -= 1; + UE_LOG(LogTemp, Display, TEXT("Ammo Count: %d"), currentAmmoCount); + GenerateRecoilVector(); + ClickDetectionTimer(); + if (outHit.bBlockingHit) + { + UE_LOG(LogTemp, Display, TEXT("hit item: %s"), *outHit.GetActor()->GetName()); + } + } + else if(currentAmmoCount <= 0) + { + UE_LOG(LogTemp, Display, TEXT("No ammo, Ammo count: %d"), currentAmmoCount); + } + +} + +void ABaseWeaponClass::WeaponScopedFire() +{ + if (endlessVendettaChar->bIsScoped) + { + recoilMagnitude -= 0.2f; + recoilMaxAngleLeft /= 2.f; + recoilMaxAngleRight /= 2.f; + recoilMinMultiplier -= 0.2f; + + } + else + { + recoilMagnitude = originalMagnitude; + recoilMaxAngleLeft = originalMaxAngleLeft; + recoilMaxAngleRight = originalMaxAngleRight; + recoilMinMultiplier = originalMinMultiplier; + } +} + +void ABaseWeaponClass::WeaponReload() +{ + if(MagazineSize > currentAmmoCount) + { + UE_LOG(LogTemp, Display, TEXT("Weapon Reloading: mag size: %d"), MagazineSize); + currentAmmoCount = MagazineSize; + } +} + + diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index 2fc1219a..1d07fb65 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -4,6 +4,8 @@ #include "CoreMinimal.h" #include "WeaponItemClass.h" +#include "Components/ArrowComponent.h" +#include "Kismet/KismetMathLibrary.h" #include "BaseWeaponClass.generated.h" class AEndlessVendettaCharacter; @@ -22,6 +24,23 @@ protected: // Called when the game starts or when spawned virtual void BeginPlay() override; + void GenerateRecoilVector(); + + void ApplyRecoil(float DeltaTime); + + void nullSamples(); + + //recoil previous curve + float recoilCurvez1 = 0; + + //recoil previous curve time + float recoilCurvet = 0; + + float recoilTime = 0; + + float recoilResultPitch = 0; + float recoilResultYaw = 0; + public: // Called every frame virtual void Tick(float DeltaTime) override; @@ -42,17 +61,70 @@ public: UTexture2D* WeaponImage; UFUNCTION(BlueprintCallable, Category = "Weapons") - void TapFire(); + virtual void Fire(); + + UFUNCTION(BlueprintCallable, Category = "Weapons") + void ClickDetectionTimer(); + + void CancelFire(); UPROPERTY(VisibleAnywhere) - ACharacter* player; + ACharacter* playerInWorld; + + AEndlessVendettaCharacter* endlessVendettaChar; + + APlayerController* playerControllerRef; - - + FTimerHandle timerHandle; - //Add HoldFire functionality after pistol is complete for holding fire for pistol and make it start spraying innacuratly. - - // UFUNCTION(BlueprintCallable, Category = "Weapons") - // void HoldFire(); + bool bFirstBulletShot = false; + + UPROPERTY(EditAnywhere) + TSubclassOf CameraShakeClass; + + /* How far the gun goes up*/ + UPROPERTY(EditAnywhere, Category = "Recoil") + float recoilMagnitude; + + UPROPERTY(EditAnywhere, Category = "Recoil") + float recoilMaxAngleLeft; + + UPROPERTY(EditAnywhere, Category = "Recoil") + float recoilMaxAngleRight; + + UPROPERTY(EditAnywhere, Category = "Recoil") + float recoilMinMultiplier; + + UPROPERTY(EditAnywhere, Category = "Recoil") + class UCurveFloat* RecoilCurve; + + UFUNCTION(BlueprintCallable, Category = "Recoil") + float GetRecoilPitch(float Amp, float Time); + + UFUNCTION(BlueprintCallable, Category = "Recoil") + float GetRecoilYaw(float Amp, float Time); + + UFUNCTION(BlueprintCallable, Category = "Recoil") + void UpdateSamples(float Amp, float Time); + + UFUNCTION(BlueprintCallable, Category = "Weapons") + void WeaponScopedFire(); + + UFUNCTION(BlueprintCallable, Category = "Weapons") + void WeaponReload(); + +private: + + UArrowComponent* GunStartArrow; + + UPROPERTY(EditAnywhere) + float BulletDistance; + + float originalMagnitude; + float originalMaxAngleLeft; + float originalMaxAngleRight; + float originalMinMultiplier; + + int currentAmmoCount; }; diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.cpp index c40b9fdc..2b7dc95a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.cpp @@ -24,3 +24,9 @@ void APistolClass::Tick(float DeltaTime) Super::Tick(DeltaTime); } +void APistolClass::Fire() +{ + Super::Fire(); + UE_LOG(LogTemp, Display, TEXT("Testing overrides: Pistol has been fired")); +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.h index 4ad676b2..ca85b67e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/PistolClass.h @@ -22,4 +22,6 @@ protected: public: // Called every frame virtual void Tick(float DeltaTime) override; + + virtual void Fire() override; }; diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/WeaponCameraShake.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/WeaponCameraShake.cpp new file mode 100644 index 00000000..03a594a9 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/WeaponCameraShake.cpp @@ -0,0 +1,4 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "WeaponCameraShake.h" diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/WeaponCameraShake.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/WeaponCameraShake.h new file mode 100644 index 00000000..604113b5 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/WeaponCameraShake.h @@ -0,0 +1,16 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + +#include "WeaponCameraShake.generated.h" + +/** + * + */ +UCLASS() +class ENDLESSVENDETTA_API UWeaponCameraShake : public UCameraShakeBase +{ + GENERATED_BODY() +};