[Client] Remove unimplemented Client Insight Method. (#2663)

* [Cleanup] Remove unused Insight Method, and cleanup Magic Numbers

* change emu->NPC back to 0, not Doug
This commit is contained in:
Aeadoin
2022-12-21 18:41:56 -05:00
committed by GitHub
parent d5aecb228a
commit 2f9a6daab5
11 changed files with 64 additions and 397 deletions
-330
View File
@@ -3595,336 +3595,6 @@ float Client::CalcPriceMod(Mob* other, bool reverse)
return chaformula; //Returns 1.10, expensive stuff!
}
//neat idea from winter's roar, not implemented
void Client::Insight(uint32 t_id)
{
Mob* who = entity_list.GetMob(t_id);
if (!who)
return;
if (!who->IsNPC())
{
Message(0,"This ability can only be used on NPCs.");
return;
}
if (Distance(static_cast<glm::vec3>(m_Position), static_cast<glm::vec3>(who->GetPosition())) > 200)
{
Message(0,"You must get closer to your target!");
return;
}
if (!CheckLosFN(who))
{
Message(0,"You must be able to see your target!");
return;
}
char hitpoints[64];
char resists[320];
char dmg[64];
memset(hitpoints,0,sizeof(hitpoints));
memset(resists,0,sizeof(resists));
memset(dmg,0,sizeof(dmg));
//Start with HP blah
int avg_hp = GetLevelHP(who->GetLevel());
int cur_hp = who->GetHP();
if (cur_hp == avg_hp)
{
strn0cpy(hitpoints,"averagely tough",32);
}
else if (cur_hp >= avg_hp*5)
{
strn0cpy(hitpoints,"extremely tough",32);
}
else if (cur_hp >= avg_hp*4)
{
strn0cpy(hitpoints,"exceptionally tough",32);
}
else if (cur_hp >= avg_hp*3)
{
strn0cpy(hitpoints,"very tough",32);
}
else if (cur_hp >= avg_hp*2)
{
strn0cpy(hitpoints,"quite tough",32);
}
else if (cur_hp >= avg_hp*1.25)
{
strn0cpy(hitpoints,"rather tough",32);
}
else if (cur_hp > avg_hp)
{
strn0cpy(hitpoints,"slightly tough",32);
}
else if (cur_hp <= avg_hp*0.20)
{
strn0cpy(hitpoints,"extremely frail",32);
}
else if (cur_hp <= avg_hp*0.25)
{
strn0cpy(hitpoints,"exceptionally frail",32);
}
else if (cur_hp <= avg_hp*0.33)
{
strn0cpy(hitpoints,"very frail",32);
}
else if (cur_hp <= avg_hp*0.50)
{
strn0cpy(hitpoints,"quite frail",32);
}
else if (cur_hp <= avg_hp*0.75)
{
strn0cpy(hitpoints,"rather frail",32);
}
else if (cur_hp < avg_hp)
{
strn0cpy(hitpoints,"slightly frail",32);
}
int avg_dmg = who->CastToNPC()->GetMaxDamage(who->GetLevel());
int cur_dmg = who->CastToNPC()->GetMaxDMG();
if (cur_dmg == avg_dmg)
{
strn0cpy(dmg,"averagely strong",32);
}
else if (cur_dmg >= avg_dmg*4)
{
strn0cpy(dmg,"extremely strong",32);
}
else if (cur_dmg >= avg_dmg*3)
{
strn0cpy(dmg,"exceptionally strong",32);
}
else if (cur_dmg >= avg_dmg*2)
{
strn0cpy(dmg,"very strong",32);
}
else if (cur_dmg >= avg_dmg*1.25)
{
strn0cpy(dmg,"quite strong",32);
}
else if (cur_dmg >= avg_dmg*1.10)
{
strn0cpy(dmg,"rather strong",32);
}
else if (cur_dmg > avg_dmg)
{
strn0cpy(dmg,"slightly strong",32);
}
else if (cur_dmg <= avg_dmg*0.20)
{
strn0cpy(dmg,"extremely weak",32);
}
else if (cur_dmg <= avg_dmg*0.25)
{
strn0cpy(dmg,"exceptionally weak",32);
}
else if (cur_dmg <= avg_dmg*0.33)
{
strn0cpy(dmg,"very weak",32);
}
else if (cur_dmg <= avg_dmg*0.50)
{
strn0cpy(dmg,"quite weak",32);
}
else if (cur_dmg <= avg_dmg*0.75)
{
strn0cpy(dmg,"rather weak",32);
}
else if (cur_dmg < avg_dmg)
{
strn0cpy(dmg,"slightly weak",32);
}
//Resists
int res;
int i = 1;
//MR
res = who->GetResist(i);
i++;
if (res >= 1000)
{
strcat(resists,"immune");
}
else if (res >= 500)
{
strcat(resists,"practically immune");
}
else if (res >= 250)
{
strcat(resists,"exceptionally resistant");
}
else if (res >= 150)
{
strcat(resists,"very resistant");
}
else if (res >= 100)
{
strcat(resists,"fairly resistant");
}
else if (res >= 50)
{
strcat(resists,"averagely resistant");
}
else if (res >= 25)
{
strcat(resists,"weakly resistant");
}
else
{
strcat(resists,"barely resistant");
}
strcat(resists," to magic, ");
//FR
res = who->GetResist(i);
i++;
if (res >= 1000)
{
strcat(resists,"immune");
}
else if (res >= 500)
{
strcat(resists,"practically immune");
}
else if (res >= 250)
{
strcat(resists,"exceptionally resistant");
}
else if (res >= 150)
{
strcat(resists,"very resistant");
}
else if (res >= 100)
{
strcat(resists,"fairly resistant");
}
else if (res >= 50)
{
strcat(resists,"averagely resistant");
}
else if (res >= 25)
{
strcat(resists,"weakly resistant");
}
else
{
strcat(resists,"barely resistant");
}
strcat(resists," to fire, ");
//CR
res = who->GetResist(i);
i++;
if (res >= 1000)
{
strcat(resists,"immune");
}
else if (res >= 500)
{
strcat(resists,"practically immune");
}
else if (res >= 250)
{
strcat(resists,"exceptionally resistant");
}
else if (res >= 150)
{
strcat(resists,"very resistant");
}
else if (res >= 100)
{
strcat(resists,"fairly resistant");
}
else if (res >= 50)
{
strcat(resists,"averagely resistant");
}
else if (res >= 25)
{
strcat(resists,"weakly resistant");
}
else
{
strcat(resists,"barely resistant");
}
strcat(resists," to cold, ");
//PR
res = who->GetResist(i);
i++;
if (res >= 1000)
{
strcat(resists,"immune");
}
else if (res >= 500)
{
strcat(resists,"practically immune");
}
else if (res >= 250)
{
strcat(resists,"exceptionally resistant");
}
else if (res >= 150)
{
strcat(resists,"very resistant");
}
else if (res >= 100)
{
strcat(resists,"fairly resistant");
}
else if (res >= 50)
{
strcat(resists,"averagely resistant");
}
else if (res >= 25)
{
strcat(resists,"weakly resistant");
}
else
{
strcat(resists,"barely resistant");
}
strcat(resists," to poison, and ");
//MR
res = who->GetResist(i);
i++;
if (res >= 1000)
{
strcat(resists,"immune");
}
else if (res >= 500)
{
strcat(resists,"practically immune");
}
else if (res >= 250)
{
strcat(resists,"exceptionally resistant");
}
else if (res >= 150)
{
strcat(resists,"very resistant");
}
else if (res >= 100)
{
strcat(resists,"fairly resistant");
}
else if (res >= 50)
{
strcat(resists,"averagely resistant");
}
else if (res >= 25)
{
strcat(resists,"weakly resistant");
}
else
{
strcat(resists,"barely resistant");
}
strcat(resists," to disease.");
Message(0,"Your target is a level %i %s. It appears %s and %s for its level. It seems %s",who->GetLevel(),GetClassIDName(who->GetClass(),1),dmg,hitpoints,resists);
}
void Client::GetGroupAAs(GroupLeadershipAA_Struct *into) const {
memcpy(into, &m_pp.leader_abilities.group, sizeof(GroupLeadershipAA_Struct));
}