Advertisement
Guest User

Weapon.h

a guest
Nov 6th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.79 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "WeaponMod.h"
  4.  
  5. #include "Classes/Items/Item.h"
  6. #include "Weapon.generated.h"
  7.  
  8. UENUM(BlueprintType)
  9. namespace EWeaponType
  10. {
  11.     enum Type
  12.     {
  13.         WT_POWDER UMETA(DisplayName = "Powder Weapon"),
  14.         WT_LASER UMETA(DisplayName = "Laser Weapon"),
  15.         WT_PLASMA UMETA(DisplayName = "Plasma Weapon"),
  16.         WT_EMPW UMETA(DisplayName = "EMPW"),
  17.         WT_THROWING UMETA(DisplayName = "Throwing Weapon"),
  18.         WT_MELEE UMETA(DisplayName = "Melee Weapon")
  19.     };
  20. }
  21.  
  22. UCLASS()
  23. class RESISTANCE_API AWeapon : public AItem
  24. {
  25.     GENERATED_UCLASS_BODY()
  26.  
  27.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item")
  28.     TEnumAsByte<EWeaponType::Type> WeaponType;
  29.  
  30.     // global characteristic
  31.     UPROPERTY(EditAnywhere, Category = "Weapon")
  32.     int32 _damage;
  33.     UPROPERTY(EditAnywhere, Category = "Weapon")
  34.     int32 _fireRate;
  35.     UPROPERTY(EditAnywhere, Category = "Weapon")
  36.     int32 _accuracy;
  37.     UPROPERTY(EditAnywhere, Category = "Weapon")
  38.     int32 _control;
  39.     UPROPERTY(EditAnywhere, Category = "Weapon")
  40.     int32 _reloadTime;
  41.     UPROPERTY(EditAnywhere, Category = "Weapon")
  42.     int32 _magazineSize;
  43.    
  44.     //mod slots
  45.     UPROPERTY(EditAnywhere, Category = "Modifications")
  46.     bool _useStockSlot;
  47.     UPROPERTY(EditAnywhere, Category = "Modifications")
  48.     TSubclassOf<class AWeaponMod> _stockSlot;
  49.  
  50.  
  51.     UPROPERTY(EditAnywhere, Category = "Modifications")
  52.     bool _useBarrelSlot;
  53.     UPROPERTY(EditAnywhere, Category = "Modifications")
  54.     TSubclassOf<class AWeaponMod> _barrelSlot;
  55.  
  56.  
  57.     UPROPERTY(EditAnywhere, Category = "Modifications")
  58.     bool _useAimingSlot;
  59.     UPROPERTY(EditAnywhere, Category = "Modifications")
  60.     TSubclassOf<class AWeaponMod> _aimingSlot;
  61.  
  62.  
  63.     UPROPERTY(EditAnywhere, Category = "Modifications")
  64.     bool _useMagazineSlot;
  65.     UPROPERTY(EditAnywhere, Category = "Modifications")
  66.     TSubclassOf<class AWeaponMod> _magazineSlot;
  67.  
  68.  
  69.     UPROPERTY(EditAnywhere, Category = "Modifications")
  70.     bool _useBarrelAttachmentSlot;
  71.     UPROPERTY(EditAnywhere, Category = "Modifications")
  72.     TSubclassOf<class AWeaponMod> _barrelAttachmentSlot;
  73.  
  74.  
  75.     UPROPERTY(EditAnywhere, Category = "Modifications")
  76.     bool _useBottomAttachmentSlot;
  77.     UPROPERTY(EditAnywhere, Category = "Modifications")
  78.     TSubclassOf<class AWeaponMod> _bottomAttachmentSlot;
  79.  
  80. public:
  81.     UFUNCTION(BlueprintCallable, Category = "Inventory")
  82.     bool equipMod(TSubclassOf<class AWeaponMod> _modToEquip, TEnumAsByte<EWeaponModType::Type> toSlot);
  83.  
  84.     UFUNCTION(BlueprintCallable, Category = "Weapon")
  85.     int32 getDamage();
  86.     UFUNCTION(BlueprintCallable, Category = "Weapon")
  87.     int32 getFireRate();
  88.     UFUNCTION(BlueprintCallable, Category = "Weapon")
  89.     int32 getAccuracy();
  90.     UFUNCTION(BlueprintCallable, Category = "Weapon")
  91.     int32 getControl();
  92.     UFUNCTION(BlueprintCallable, Category = "Weapon")
  93.     int32 getReloadTime();
  94.     UFUNCTION(BlueprintCallable, Category = "Weapon")
  95.     int32 getMagazineSize();
  96.  
  97. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement