1
This commit is contained in:
parent
cf1a03f5c8
commit
150c578a60
@ -104,6 +104,9 @@ void Bullet::Update(int delta_time)
|
|||||||
|
|
||||||
void Bullet::OnHit(std::set<Entity*>& objects)
|
void Bullet::OnHit(std::set<Entity*>& objects)
|
||||||
{
|
{
|
||||||
|
if (gun_meta->id() == 60201) {
|
||||||
|
int i = 0;
|
||||||
|
}
|
||||||
std::shared_ptr<Ability> old_context_ability = sender.Get()->context_ability;
|
std::shared_ptr<Ability> old_context_ability = sender.Get()->context_ability;
|
||||||
glm::vec3 old_context_dir = sender.Get()->context_dir;
|
glm::vec3 old_context_dir = sender.Get()->context_dir;
|
||||||
Position old_context_pos = sender.Get()->context_pos;
|
Position old_context_pos = sender.Get()->context_pos;
|
||||||
@ -500,6 +503,9 @@ float Bullet::GetExplosionRange()
|
|||||||
|
|
||||||
void Bullet::Check(float distance)
|
void Bullet::Check(float distance)
|
||||||
{
|
{
|
||||||
|
if (gun_meta->id() == 60201) {
|
||||||
|
int i = 0;
|
||||||
|
}
|
||||||
BulletCheckResult result;
|
BulletCheckResult result;
|
||||||
result.flyed_distance = distance;
|
result.flyed_distance = distance;
|
||||||
GetHitThings(result);
|
GetHitThings(result);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "mt/Map.h"
|
#include "mt/Map.h"
|
||||||
#include "mt/MapThing.h"
|
#include "mt/MapThing.h"
|
||||||
|
#include "mt/Hero.h"
|
||||||
|
|
||||||
static const float GUN_HEIGHT = 3.0f;
|
static const float GUN_HEIGHT = 3.0f;
|
||||||
|
|
||||||
@ -25,14 +26,14 @@ bool Collision::CheckBullet(IBullet* bullet, Creature* c)
|
|||||||
bool ret = a8::IntersectCylinderCylinder
|
bool ret = a8::IntersectCylinderCylinder
|
||||||
(
|
(
|
||||||
bullet_real_pos, bullet_hit_radius * 1.0, GUN_HEIGHT,
|
bullet_real_pos, bullet_hit_radius * 1.0, GUN_HEIGHT,
|
||||||
c->GetPos().ToGlmVec3(), c->GetHitRadius(), GUN_HEIGHT
|
c->GetPos().ToGlmVec3(), c->GetHitRadius(), c->GetHeroMeta()->GetHeight()
|
||||||
);
|
);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
bullet_real_pos = bullet->GetPos().ToGlmVec3() - bullet->GetDir() * (bullet->GetHitRadius() - 2);
|
bullet_real_pos = bullet->GetPos().ToGlmVec3() - bullet->GetDir() * (bullet->GetHitRadius() - 2);
|
||||||
ret = a8::IntersectCylinderCylinder
|
ret = a8::IntersectCylinderCylinder
|
||||||
(
|
(
|
||||||
bullet_real_pos, bullet_hit_radius * 1.0, GUN_HEIGHT,
|
bullet_real_pos, bullet_hit_radius * 1.0, GUN_HEIGHT,
|
||||||
c->GetPos().ToGlmVec3(), c->GetHitRadius(), GUN_HEIGHT
|
c->GetPos().ToGlmVec3(), c->GetHitRadius(), c->GetHeroMeta()->GetHeight()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -138,6 +138,31 @@ namespace mt
|
|||||||
{
|
{
|
||||||
LoadHeroAndEquipShotData();
|
LoadHeroAndEquipShotData();
|
||||||
Equip::AdjustMuzzlePos();
|
Equip::AdjustMuzzlePos();
|
||||||
|
Traverse(
|
||||||
|
[] (const Hero* hero, bool& stop)
|
||||||
|
{
|
||||||
|
if (hero->GetHeight() < 0.1) {
|
||||||
|
if (!(hero->id() == 40001 ||
|
||||||
|
hero->id() == 40002 ||
|
||||||
|
hero->id() == 9001 ||
|
||||||
|
hero->id() == 9002 ||
|
||||||
|
hero->id() == 9003 ||
|
||||||
|
hero->id() == 9004 ||
|
||||||
|
hero->id() == 9005 ||
|
||||||
|
hero->id() == 9006 ||
|
||||||
|
hero->id() == 9007 ||
|
||||||
|
hero->id() == 9008 ||
|
||||||
|
hero->id() == 9009 ||
|
||||||
|
hero->id() == 9010 ||
|
||||||
|
hero->id() == 8001 ||
|
||||||
|
hero->id() == 8002 ||
|
||||||
|
hero->id() == 8003 ||
|
||||||
|
hero->id() == 8004 ||
|
||||||
|
hero->id() == 8005)) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const HeroShotAnimation* Hero::GetShotAnimi(int shotfire) const
|
const HeroShotAnimation* Hero::GetShotAnimi(int shotfire) const
|
||||||
@ -159,13 +184,14 @@ namespace mt
|
|||||||
int hero_id = a8::XValue(key);
|
int hero_id = a8::XValue(key);
|
||||||
std::vector<std::string> keys2;
|
std::vector<std::string> keys2;
|
||||||
hero_xobj->GetKeys(keys2);
|
hero_xobj->GetKeys(keys2);
|
||||||
|
const mt::Hero* hero_meta = mt::Hero::GetById(hero_id);
|
||||||
#if 1
|
#if 1
|
||||||
{
|
{
|
||||||
const mt::Hero* hero_meta = Hero::GetById(hero_id);
|
|
||||||
if (hero_meta) {
|
if (hero_meta) {
|
||||||
mt::Hero* mut_hero_meta = (mt::Hero*)hero_meta;
|
mt::Hero* mut_hero_meta = (mt::Hero*)hero_meta;
|
||||||
auto size_xobj = hero_xobj->At("size");
|
auto size_xobj = hero_xobj->At("size");
|
||||||
mut_hero_meta->hit_radius_ = size_xobj->At("radius")->AsXValue().GetDouble() * 10;
|
mut_hero_meta->hit_radius_ = size_xobj->At("radius")->AsXValue().GetDouble() * 10;
|
||||||
|
mut_hero_meta->height_ = size_xobj->At("height")->AsXValue().GetDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -222,7 +248,6 @@ namespace mt
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const mt::Hero* hero_meta = mt::Hero::GetById(hero_id);
|
|
||||||
if (hero_meta) {
|
if (hero_meta) {
|
||||||
mt::HeroShotAnimation anim;
|
mt::HeroShotAnimation anim;
|
||||||
anim.id = id;
|
anim.id = id;
|
||||||
|
@ -52,8 +52,11 @@ namespace mt
|
|||||||
|
|
||||||
int RandDrop() const;
|
int RandDrop() const;
|
||||||
const HeroShotAnimation* GetShotAnimi(int shotfire) const;
|
const HeroShotAnimation* GetShotAnimi(int shotfire) const;
|
||||||
|
float GetHeight() const { return height_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float height_ = 0.0f;
|
||||||
|
|
||||||
static void LoadHeroAndEquipShotData();
|
static void LoadHeroAndEquipShotData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user