28 if (pTarget ==
nullptr)
33 _log(DAMAGE__TRACE,
"Turret::GetToHit - distance:%.2f, range:%u, falloff:%u", distance, range, falloff);
42 float transversalV = vector.
length();
43 float angularVel = transversalV / distance;
47 _log(DAMAGE__TRACE,
"Turret::GetToHit - transversalV:%.3f, angularV:%.3f, tracking:%.3f, targetSig:%.1f, sigRes:%.1f", \
48 transversalV, angularVel, trackSpeed, targSig, sigRes);
60 float a = (angularVel / trackSpeed);
61 float b = (sigRes / targSig);
63 if ((a < 1) and (b > 1)) {
69 modifier = (targSig / sigRes);
71 float c = pow((a * b), 2);
72 float d =
EvE::max(distance - range);
73 float e = pow((d / falloff), 2);
74 float x = pow(0.5, c);
75 float y = pow(0.5, e);
76 float ChanceToHit = x *
y;
77 _log(DAMAGE__TRACE,
"Turret::GetToHit - (%.3f * %.3f)^2 = c:%.5f : (%.3f / %u)^2 = e:%.5f", a, b, c, d, falloff, e);
79 _log(DAMAGE__TRACE,
"Turret::GetToHit - %f * %f = %.5f - Rand:%.3f - %s", \
80 x, y, ChanceToHit, rNum, ((rNum <=
sConfig.rates.PlayerCritChance) ?
"Crit" : (rNum < ChanceToHit ?
"Hit" :
"Miss")));
81 if (rNum <=
sConfig.rates.PlayerCritChance)
83 if (rNum < ChanceToHit) {
93 if (pTarget ==
nullptr)
101 _log(DAMAGE__TRACE_NPC,
"NPC::GetToHit - distance:%.2f, range:%u, falloff:%u", distance, range, falloff);
104 float transversalV = vector.
length();
105 float angularVel = transversalV / distance;
106 _log(DAMAGE__TRACE_NPC,
"NPC::GetToHit - transversalV:%.3f, angularVel:%.3f tracking:%.3f, targetSig:%.1f, sigRes:%u", \
107 transversalV, angularVel, trackSpeed, targSig, sigRes);
109 float a = (angularVel / trackSpeed);
110 float b = (sigRes / targSig);
111 float modifier(0.0f);
112 if ((a < 1) and (b > 1)) {
114 modifier = (targSig / sigRes);
116 float c = pow((a * b), 2);
117 float d =
EvE::max(distance - range);
118 float e = pow((d / falloff), 2);
119 float x = pow(0.5, c);
120 float y = pow(0.5, e);
121 float ChanceToHit = x *
y;
122 _log(DAMAGE__TRACE_NPC,
"NPC::GetToHit - (%.3f * %.3f)^2 = c:%.5f : (%.3f / %u)^2 = e:%.5f", a, b, c, d, falloff, e);
123 _log(DAMAGE__TRACE_NPC,
"NPC::GetToHit - %f * %f = %.5f", x, y, ChanceToHit);
125 _log(DAMAGE__TRACE_NPC,
"NPC::GetToHit - ChanceToHit:%f, Rand:%.3f - %s", ChanceToHit, rNum, ((rNum <=
sConfig.rates.NpcCritChance) ?
"Crit" : (rNum < ChanceToHit ?
"Hit" :
"Miss")));
126 if (rNum <=
sConfig.rates.NpcCritChance)
128 if (rNum < ChanceToHit) {
131 return (rNum + 0.49);
138 if (pTarget ==
nullptr)
143 float transversalV = vector.
length();
146 float c = pow((a * b), 2);
148 float e = pow((d / falloff), 2);
149 float ChanceToHit = pow(0.5, c + e);
151 if (rNum <=
sConfig.rates.DroneCritChance)
153 if (rNum < ChanceToHit)
154 return (rNum + 0.49);
161 if (pTarget ==
nullptr)
168 float b = (sigRes / targSig);
169 float modifier = 0.0f;
170 if ((a < 1) and (b > 1)) {
172 modifier = (targSig / sigRes);
174 float c = pow((a * b), 2);
176 float e = pow((d / falloff), 2);
177 float ChanceToHit = pow(0.5, c + e);
179 if (rNum <=
sConfig.rates.SentryCritChance)
181 if (rNum < ChanceToHit) {
184 return (rNum + 0.49);
#define sConfig
A macro for easier access to the singleton.
GaExpInl GaFloat length() const
itemID[count] Create count or of the specified() x() y(z)-Jump to the specified position in space.Stopped." ) COMMAND( translocate
#define _log(type, fmt,...)
const GPoint & position() const
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
const GPoint & GetPosition() const
const GVector & GetVelocity()
DestinyManager * DestinyMgr()
InventoryItemRef GetSelf()
int64 max(int64 x, int64 y=0)
virtual Client * GetPilot()
EvilNumber GetAttribute(const uint16 attrID) const
const GPoint & GetPosition() const
GaExpInl GaFloat distance(const GaVec3 &oth) const
EvilNumber GetAttribute(uint32 attrID)
double GetTrackingSpeed()