This commit is contained in:
aozhiwei 2019-05-07 15:42:07 +08:00
parent 568e7449b4
commit 2236a9b640
3 changed files with 19 additions and 5 deletions

View File

@ -52,7 +52,13 @@ void Human::Initialize()
float Human::GetSpeed()
{
return meta->i->move_speed() + buff.speed;
if (a8::HasBitFlag(status, HS_Jump)) {
return meta->i->jump_speed() + buff.speed;
} if (downed) {
return meta->i->move_speed3() + buff.speed;
} else {
return meta->i->move_speed() + buff.speed;
}
}
float Human::GetSpeed4()

View File

@ -447,10 +447,14 @@ void Player::Shot()
CancelAction();
}
#if 1
if (true) {
#else
if (room->gas_data.gas_mode != GasInactive &&
!a8::HasBitFlag(status, HS_Fly) &&
!a8::HasBitFlag(status, HS_Jump)
) {
#endif
for (auto& tuple : curr_weapon->meta->bullet_born_offset) {
Vector2D bullet_born_offset = Vector2D(std::get<0>(tuple), std::get<1>(tuple));
bullet_born_offset.Rotate(attack_dir.CalcAngle(Vector2D::UP));
@ -465,13 +469,15 @@ void Player::Shot()
bullet_born_offset.Rotate(attack_dir.CalcAngle(Vector2D::UP));
Vector2D bullet_born_pos = pos + bullet_born_offset;
Vector2D bullet_dir = attack_dir;
float bullet_angle = std::get<0>(tuple);
float bullet_angle = std::get<2>(tuple);
if (curr_weapon->meta->i->bullet_angle() >= 1.0f) {
bullet_angle += (rand() % (int)curr_weapon->meta->i->bullet_angle()) * (rand() % 2 == 0 ? 1 : -1);
}
bullet_dir.Rotate(bullet_angle / 180.0f);
room->frame_event.AddBullet(this, bullet_born_pos, bullet_dir, fly_distance);
room->CreateBullet(this, curr_weapon->meta, bullet_born_pos, bullet_dir, fly_distance);
if (room->BattleStarted()) {
room->CreateBullet(this, curr_weapon->meta, bullet_born_pos, bullet_dir, fly_distance);
}
}
} else {
return;

View File

@ -88,9 +88,11 @@ message Player
optional float radius = 2; //
optional int32 health = 3; //
optional int32 move_speed = 4; //
optional int32 jump_speed = 5; //
optional int32 move_speed3 = 6;
optional int32 move_speed4 = 10; //4
optional float def = 5; //
optional string volume = 6; //
optional float def = 11; //
optional string volume = 12; //
}
message Skill