Add Upgrades to Magic Wand
This commit is contained in:
		
							parent
							
								
									78ebf0624f
								
							
						
					
					
						commit
						43dad6b126
					
				
							
								
								
									
										
											BIN
										
									
								
								Content/Weapons/MagicWand/BP_MagicWandWeapon.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Content/Weapons/MagicWand/BP_MagicWandWeapon.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Content/Weapons/TestProjectileDataAsset.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Content/Weapons/TestProjectileDataAsset.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -8,6 +8,7 @@ | ||||
| #include "Kismet/KismetMathLibrary.h" | ||||
| #include "vampires/ObjectPoolManager.h" | ||||
| #include "vampires/Projectile.h" | ||||
| #include "vampires/ProjectileDataAsset.h" | ||||
| #include "vampires/Interfaces/Pools.h" | ||||
| 
 | ||||
| AMagicWandWeapon::AMagicWandWeapon() | ||||
| @ -22,7 +23,46 @@ void AMagicWandWeapon::BeginPlay() | ||||
| void AMagicWandWeapon::FireWeaponAction_Implementation() | ||||
| { | ||||
| 	Super::FireWeaponAction_Implementation(); | ||||
| } | ||||
| 
 | ||||
| bool AMagicWandWeapon::UpgradeWeapon_Implementation() | ||||
| { | ||||
| 	if (!Super::UpgradeWeapon_Implementation()) return false; | ||||
| 
 | ||||
| 	switch (CurrentLevel) | ||||
| 	{ | ||||
| 		case 1: | ||||
| 			ProjectilesPerActivation++; | ||||
| 			break; | ||||
| 		case 2: | ||||
| 			WeaponCooldown -= 0.2; | ||||
| 			break; | ||||
| 		case 3: | ||||
| 			ProjectilesPerActivation++; | ||||
| 			break; | ||||
| 		case 4: | ||||
| 			Damage += 10; | ||||
| 			break; | ||||
| 		case 5: | ||||
| 			ProjectilesPerActivation++; | ||||
| 			break; | ||||
| 		case 6: | ||||
| 			ProjectileTemplate->DamagableEnemies++; | ||||
| 			break; | ||||
| 		case 7: | ||||
| 			Damage += 10; | ||||
| 			break; | ||||
| 		default: | ||||
| 			return false; | ||||
| 	} | ||||
| 	 | ||||
| 	ResetWeaponTimer(); | ||||
| 	 | ||||
| 	return true; | ||||
| } | ||||
| 
 | ||||
| void AMagicWandWeapon::FireProjectile() | ||||
| { | ||||
| 	if (ProjectileTemplate && OverlappedEnemies.Num() > 0) | ||||
| 	{ | ||||
| 		float distance = 0.0f; | ||||
| @ -50,6 +90,8 @@ void AMagicWandWeapon::FireWeaponAction_Implementation() | ||||
| 
 | ||||
| 						IProjectilable::Execute_SetTargetDirection(projectile, direction); | ||||
| 					} | ||||
| 
 | ||||
| 					Super::FireProjectile(); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| @ -22,4 +22,9 @@ protected: | ||||
| 
 | ||||
| public: | ||||
| 	virtual void FireWeaponAction_Implementation() override; | ||||
| 
 | ||||
| 	virtual bool UpgradeWeapon_Implementation() override; | ||||
| 
 | ||||
| 	protected: | ||||
| 	virtual void FireProjectile() override; | ||||
| }; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user