2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-12-22 19:57:21 +00:00
|
|
|
|
|
|
|
#include "World/CActor.hpp"
|
|
|
|
#include "Weapon/WeaponCommon.hpp"
|
2017-05-18 10:58:15 +00:00
|
|
|
#include "World/CDamageInfo.hpp"
|
2016-12-22 19:57:21 +00:00
|
|
|
#include "Collision/CMaterialFilter.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CWeapon : public CActor
|
|
|
|
{
|
2018-02-09 07:12:26 +00:00
|
|
|
protected:
|
2017-01-15 03:59:37 +00:00
|
|
|
EProjectileAttrib xe8_projectileAttribs;
|
2017-11-24 08:23:28 +00:00
|
|
|
TUniqueId xec_ownerId;
|
2017-05-18 10:58:15 +00:00
|
|
|
EWeaponType xf0_weaponType;
|
2018-02-01 23:19:34 +00:00
|
|
|
CMaterialFilter xf8_filter;
|
|
|
|
CDamageInfo x110_origDamageInfo;
|
|
|
|
CDamageInfo x12c_curDamageInfo;
|
2018-02-13 06:46:59 +00:00
|
|
|
float x148_curTime = 0.f;
|
|
|
|
float x14c_damageFalloffSpeed = 0.f;
|
|
|
|
float x150_damageDuration = 0.f;
|
|
|
|
float x154_interferenceDuration = 0.f;
|
2016-12-22 19:57:21 +00:00
|
|
|
public:
|
2017-09-05 03:00:19 +00:00
|
|
|
CWeapon(TUniqueId uid, TAreaId aid, bool active, TUniqueId owner, EWeaponType type,
|
2017-11-13 06:19:18 +00:00
|
|
|
std::string_view name, const zeus::CTransform& xf, const CMaterialFilter& filter,
|
2017-09-05 03:00:19 +00:00
|
|
|
const CMaterialList& mList, const CDamageInfo&, EProjectileAttrib attribs, CModelData&& mData);
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2017-01-15 03:59:37 +00:00
|
|
|
virtual void Accept(IVisitor &visitor);
|
2018-02-01 23:19:34 +00:00
|
|
|
bool HasAttrib(EProjectileAttrib attrib) const
|
|
|
|
{ return (int(xe8_projectileAttribs) & int(attrib)) == int(attrib); }
|
2017-01-15 03:59:37 +00:00
|
|
|
EProjectileAttrib GetAttribField() const { return xe8_projectileAttribs; }
|
2018-02-01 23:19:34 +00:00
|
|
|
const CMaterialFilter& GetFilter() const { return xf8_filter; }
|
|
|
|
void SetFilter(const CMaterialFilter& filter) { xf8_filter = filter; }
|
2017-11-24 08:23:28 +00:00
|
|
|
TUniqueId GetOwnerId() const { return xec_ownerId; }
|
|
|
|
void SetOwnerId(TUniqueId oid) { xec_ownerId = oid; }
|
2018-02-01 23:19:34 +00:00
|
|
|
EWeaponType GetType() const { return xf0_weaponType; }
|
|
|
|
const CDamageInfo& GetDamageInfo() const { return x12c_curDamageInfo; }
|
|
|
|
CDamageInfo& DamageInfo() { return x12c_curDamageInfo; }
|
|
|
|
void SetDamageInfo(const CDamageInfo& dInfo) { x12c_curDamageInfo = dInfo; }
|
2017-08-25 06:18:09 +00:00
|
|
|
float GetDamageDuration() const { return x150_damageDuration; }
|
2017-06-12 04:23:34 +00:00
|
|
|
float GetInterferenceDuration() const { return x154_interferenceDuration; }
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2018-02-01 23:19:34 +00:00
|
|
|
void Think(float, CStateManager &);
|
|
|
|
void Render(const CStateManager&) const;
|
2017-08-13 05:26:14 +00:00
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
|
2018-02-12 05:30:21 +00:00
|
|
|
const CWeaponMode&, EProjectileAttrib) const;
|
2018-02-01 23:19:34 +00:00
|
|
|
void FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr);
|
2016-12-22 19:57:21 +00:00
|
|
|
};
|
|
|
|
}
|