mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 20:19:57 +00:00
995d20348f
Previously, the player's currently selected weapon was being used in ranged attacks as in the original melee-oriented attack sync, which meant that shooting one type of projectile and then equipping another while the old projectile was still in the air turned the old projectile into the new projectile upon impact. Additionally, avoid running most of the code in MechanicsHelper::assignAttackTarget() for non-hitting melee and ranged attacks.
117 lines
2.2 KiB
C++
117 lines
2.2 KiB
C++
#ifndef OPENMW_BASESTRUCTS_HPP
|
|
#define OPENMW_BASESTRUCTS_HPP
|
|
|
|
#include <string>
|
|
|
|
#include <components/esm/loadcell.hpp>
|
|
#include <components/esm/statstate.hpp>
|
|
|
|
#include <RakNetTypes.h>
|
|
|
|
namespace mwmp
|
|
{
|
|
enum PACKET_ORIGIN
|
|
{
|
|
CLIENT_GAMEPLAY = 0,
|
|
CLIENT_CONSOLE = 1,
|
|
CLIENT_DIALOGUE = 2,
|
|
CLIENT_SCRIPT_LOCAL = 3,
|
|
CLIENT_SCRIPT_GLOBAL = 4,
|
|
SERVER_SCRIPT = 5
|
|
};
|
|
|
|
struct Time
|
|
{
|
|
float hour;
|
|
int day;
|
|
int month;
|
|
int year;
|
|
|
|
int daysPassed;
|
|
float timeScale;
|
|
};
|
|
|
|
struct Item
|
|
{
|
|
std::string refId;
|
|
int count;
|
|
int charge;
|
|
float enchantmentCharge;
|
|
std::string soul;
|
|
|
|
inline bool operator==(const Item& rhs)
|
|
{
|
|
return refId == rhs.refId && count == rhs.count && charge == rhs.charge &&
|
|
enchantmentCharge == rhs.enchantmentCharge && soul == rhs.soul;
|
|
}
|
|
};
|
|
|
|
struct Target
|
|
{
|
|
bool isPlayer;
|
|
|
|
std::string refId;
|
|
int refNum;
|
|
int mpNum;
|
|
|
|
std::string name; // Remove this once the server can get names corresponding to different refIds
|
|
|
|
RakNet::RakNetGUID guid;
|
|
};
|
|
|
|
class Attack
|
|
{
|
|
public:
|
|
|
|
Target target;
|
|
|
|
char type; // 0 - melee, 1 - magic, 2 - item magic, 3 - throwable
|
|
enum TYPE
|
|
{
|
|
MELEE = 0,
|
|
RANGED,
|
|
MAGIC,
|
|
ITEM_MAGIC,
|
|
THROWABLE
|
|
};
|
|
|
|
std::string spellId; // id of spell (e.g. "fireball")
|
|
std::string itemId;
|
|
|
|
std::string rangedWeaponId;
|
|
std::string rangedAmmoId;
|
|
|
|
ESM::Position hitPosition;
|
|
|
|
float damage;
|
|
float attackStrength;
|
|
|
|
bool isHit;
|
|
bool success;
|
|
bool block;
|
|
|
|
bool pressed;
|
|
bool instant;
|
|
bool knockdown;
|
|
bool applyWeaponEnchantment;
|
|
bool applyAmmoEnchantment;
|
|
|
|
bool shouldSend;
|
|
};
|
|
|
|
struct Animation
|
|
{
|
|
std::string groupname;
|
|
int mode;
|
|
int count;
|
|
bool persist;
|
|
};
|
|
|
|
struct SimpleCreatureStats
|
|
{
|
|
ESM::StatState<float> mDynamic[3];
|
|
bool mDead;
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_BASESTRUCTS_HPP
|