1
This commit is contained in:
parent
0a06e5ce31
commit
02ddb2df40
@ -444,3 +444,13 @@ void Car::RecalcSelfCollider()
|
|||||||
self_collider_->pos = a8::Vec2(hero_meta_->i->move_offset_x(), hero_meta_->i->move_offset_y());
|
self_collider_->pos = a8::Vec2(hero_meta_->i->move_offset_x(), hero_meta_->i->move_offset_y());
|
||||||
self_collider_->rad = hero_meta_->i->radius();
|
self_collider_->rad = hero_meta_->i->radius();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Car::NeedCreatureCollision()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Car::CheckCreatureCollision()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -2771,13 +2771,3 @@ void Creature::OnBattleStart(Room* room)
|
|||||||
RemoveBuffByUniId(*itr);
|
RemoveBuffByUniId(*itr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature::NeedCreatureCollision()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Creature::CheckCreatureCollision()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -3498,7 +3498,7 @@ void Human::GMAddItem(int item_id, int item_num)
|
|||||||
Weapon* weapon = weapon = TakeonWeapon(item_meta);
|
Weapon* weapon = weapon = TakeonWeapon(item_meta);
|
||||||
if (weapon) {
|
if (weapon) {
|
||||||
if (GetCurrWeapon() != weapon) {
|
if (GetCurrWeapon() != weapon) {
|
||||||
SetCurWeapon(weapon);
|
SetCurrWeapon(weapon);
|
||||||
}
|
}
|
||||||
weapon->weapon_id = item_id;
|
weapon->weapon_id = item_id;
|
||||||
weapon->weapon_lv = std::max(1, 1);
|
weapon->weapon_lv = std::max(1, 1);
|
||||||
|
@ -833,17 +833,19 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
|
|||||||
} else {
|
} else {
|
||||||
Weapon* weapon = TakeonWeapon(item_meta);
|
Weapon* weapon = TakeonWeapon(item_meta);
|
||||||
if (weapon) {
|
if (weapon) {
|
||||||
weapon->weapon_id = entity->item_id;
|
weapon->weapon_id = item_meta->i->id();
|
||||||
weapon->weapon_lv = std::max(1, entity->item_level);
|
weapon->weapon_lv = std::max(1, 1);
|
||||||
weapon->ammo = 0;
|
weapon->ammo = 0;
|
||||||
weapon->meta = item_meta;
|
weapon->meta = item_meta;
|
||||||
weapon->Recalc();
|
weapon->Recalc();
|
||||||
if (GetCurrWeapon() != weapon) {
|
if (GetCurrWeapon() != weapon) {
|
||||||
SetCurrWeapon(weapon);
|
SetCurrWeapon(weapon);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
case EQUIP_TYPE_CAR:
|
break;
|
||||||
|
case EQUIP_TYPE_CAR:
|
||||||
{
|
{
|
||||||
int car_uniid = room->CreateAndTakeonCar(item_meta->i->id(), GetPos());
|
int car_uniid = room->CreateAndTakeonCar(item_meta->i->id(), GetPos());
|
||||||
if (car_uniid != -1) {
|
if (car_uniid != -1) {
|
||||||
|
@ -1386,11 +1386,10 @@ void Room::UpdateGasJump()
|
|||||||
gas_data_.pos_old = map_meta_->first_safearea_center;
|
gas_data_.pos_old = map_meta_->first_safearea_center;
|
||||||
gas_data_.pos_old_bk = gas_data_.pos_old;
|
gas_data_.pos_old_bk = gas_data_.pos_old;
|
||||||
{
|
{
|
||||||
bool gen_ok = GenSmallCircle(gas_data_.pos_old,
|
bool gen_ok = GenSmallCircle();
|
||||||
gas_data_.old_area_meta->i->rad(),
|
if (!gen_ok) {
|
||||||
gas_data_.new_area_meta->i->rad(),
|
abort();
|
||||||
gas_data_.pos_new);
|
}
|
||||||
assert(gen_ok);
|
|
||||||
}
|
}
|
||||||
gas_data_.rad_old = gas_data_.old_area_meta->i->rad();
|
gas_data_.rad_old = gas_data_.old_area_meta->i->rad();
|
||||||
gas_data_.rad_new = gas_data_.new_area_meta->i->rad();
|
gas_data_.rad_new = gas_data_.new_area_meta->i->rad();
|
||||||
@ -1408,12 +1407,12 @@ void Room::UpdateGasJump()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Room::GenSmallCircle(a8::Vec2 big_circle_pos, float big_circle_rad, float small_circle_rad,
|
bool Room::GenSmallCircle()
|
||||||
a8::Vec2& out_pos)
|
|
||||||
{
|
{
|
||||||
if (big_circle_rad <= small_circle_rad) {
|
if (gas_data_.new_area_meta->i->rad() >= gas_data_.old_area_meta->i->rad()) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
a8::Vec2 dir = a8::Vec2::UP;
|
a8::Vec2 dir = a8::Vec2::UP;
|
||||||
dir.Rotate(a8::RandAngle());
|
dir.Rotate(a8::RandAngle());
|
||||||
float rad = rand() % (int)(big_circle_rad - small_circle_rad);
|
float rad = rand() % (int)(big_circle_rad - small_circle_rad);
|
||||||
@ -1421,6 +1420,7 @@ bool Room::GenSmallCircle(a8::Vec2 big_circle_pos, float big_circle_rad, float s
|
|||||||
rad = 0.001f;
|
rad = 0.001f;
|
||||||
}
|
}
|
||||||
out_pos = big_circle_pos + dir * rad;
|
out_pos = big_circle_pos + dir * rad;
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3803,10 +3803,7 @@ void Room::ForwardGasRing(int n)
|
|||||||
gas_data_.pos_old = pre_pos;
|
gas_data_.pos_old = pre_pos;
|
||||||
gas_data_.pos_old_bk = gas_data_.pos_old;
|
gas_data_.pos_old_bk = gas_data_.pos_old;
|
||||||
{
|
{
|
||||||
bool gen_ok = GenSmallCircle(gas_data_.pos_old,
|
bool gen_ok = GenSmallCircle();
|
||||||
gas_data_.old_area_meta->i->rad(),
|
|
||||||
gas_data_.new_area_meta->i->rad(),
|
|
||||||
gas_data_.pos_new);
|
|
||||||
if (!gen_ok) {
|
if (!gen_ok) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -199,8 +199,7 @@ private:
|
|||||||
void UpdateGasWaiting();
|
void UpdateGasWaiting();
|
||||||
void UpdateGasMoving();
|
void UpdateGasMoving();
|
||||||
void UpdateGasJump();
|
void UpdateGasJump();
|
||||||
bool GenSmallCircle(a8::Vec2 big_circle_pos, float big_circle_rad, float small_circle_rad,
|
bool GenSmallCircle();
|
||||||
a8::Vec2& out_pos);
|
|
||||||
void MatchTeam(Human* hum);
|
void MatchTeam(Human* hum);
|
||||||
void CombineTeam();
|
void CombineTeam();
|
||||||
void AirDrop(int appear_time, int box_id, int airdrop_id);
|
void AirDrop(int appear_time, int box_id, int airdrop_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user