添加前摇时间射击使用技能
This commit is contained in:
parent
568cc480b7
commit
4fd5414efc
@ -136,6 +136,13 @@ void InternalShot(Creature* c,
|
|||||||
c->room->xtimer.ModifyTimer(buff->remover_timer, weapon_meta->lock_time / FRAME_RATE_MS);
|
c->room->xtimer.ModifyTimer(buff->remover_timer, weapon_meta->lock_time / FRAME_RATE_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (weapon_meta->i->cast_time() > 0) {
|
||||||
|
int buff_uniid = c->TryAddBuff(c, kVertigoBuffId);
|
||||||
|
Buff* buff = c->GetBuffByUniId(buff_uniid);
|
||||||
|
if (buff && buff->remover_timer) {
|
||||||
|
c->room->xtimer.ModifyTimer(buff->remover_timer, weapon_meta->i->cast_time() / FRAME_RATE_MS);
|
||||||
|
}
|
||||||
|
}
|
||||||
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
||||||
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
||||||
bullet_born_offset.Rotate(c->GetAttackDir().CalcAngle(a8::Vec2::UP));
|
bullet_born_offset.Rotate(c->GetAttackDir().CalcAngle(a8::Vec2::UP));
|
||||||
@ -794,6 +801,7 @@ void Creature::DoSkill(int skill_id,
|
|||||||
context_dir = skill_dir_;
|
context_dir = skill_dir_;
|
||||||
context_pos = GetPos() + skill_dir_ * skill_distance_;
|
context_pos = GetPos() + skill_dir_ * skill_distance_;
|
||||||
CurrentSkill()->last_use_frameno = room->GetFrameNo();
|
CurrentSkill()->last_use_frameno = room->GetFrameNo();
|
||||||
|
skill->LockCastPhase();
|
||||||
if (CurrentSkill()->meta->i->skill_target() == kST_Self
|
if (CurrentSkill()->meta->i->skill_target() == kST_Self
|
||||||
) {
|
) {
|
||||||
skill_target_id_ = GetUniId();
|
skill_target_id_ = GetUniId();
|
||||||
|
@ -1029,6 +1029,16 @@ namespace MetaData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kBET_DelayAddBuff:
|
||||||
|
{
|
||||||
|
assert(param1 < i->duration_time());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kBET_IntervalAddBuff:
|
||||||
|
{
|
||||||
|
assert(int_param1 < i->duration_time() * 1000);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -155,3 +155,15 @@ void Skill::Accelerate(int time)
|
|||||||
NotifySkillState();
|
NotifySkillState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Skill::LockCastPhase()
|
||||||
|
{
|
||||||
|
if (meta->i->cast_time() > 0) {
|
||||||
|
int buff_uniid = owner->TryAddBuff(owner, kVertigoBuffId);
|
||||||
|
Buff* buff = owner->GetBuffByUniId(buff_uniid);
|
||||||
|
if (buff && buff->remover_timer) {
|
||||||
|
owner->room->xtimer.ModifyTimer(buff->remover_timer,
|
||||||
|
meta->i->cast_time() / FRAME_RATE_MS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -31,6 +31,7 @@ class Skill
|
|||||||
void FillMFSkill(cs::MFSkill* skill_pb);
|
void FillMFSkill(cs::MFSkill* skill_pb);
|
||||||
void ResetSkillCd();
|
void ResetSkillCd();
|
||||||
void Accelerate(int time);
|
void Accelerate(int time);
|
||||||
|
void LockCastPhase();
|
||||||
|
|
||||||
void ClearPassiveSkillBuff();
|
void ClearPassiveSkillBuff();
|
||||||
void AddPassiveSkillBuff();
|
void AddPassiveSkillBuff();
|
||||||
|
@ -142,6 +142,7 @@ message Equip
|
|||||||
optional int32 ispenetrate = 61;
|
optional int32 ispenetrate = 61;
|
||||||
optional int32 is_penetrate_thing = 62;
|
optional int32 is_penetrate_thing = 62;
|
||||||
optional int32 reload_delay_time = 63;
|
optional int32 reload_delay_time = 63;
|
||||||
|
optional int32 cast_time = 64;
|
||||||
|
|
||||||
optional string inventory_slot = 31; //库存槽位
|
optional string inventory_slot = 31; //库存槽位
|
||||||
optional int32 _inventory_slot = 32; //库存槽位
|
optional int32 _inventory_slot = 32; //库存槽位
|
||||||
@ -237,6 +238,7 @@ message Skill
|
|||||||
optional string phase3_param1 = 42;
|
optional string phase3_param1 = 42;
|
||||||
optional string phase3_param2 = 43;
|
optional string phase3_param2 = 43;
|
||||||
optional string phase3_param3 = 44;
|
optional string phase3_param3 = 44;
|
||||||
|
optional int32 cast_time = 45;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Buff
|
message Buff
|
||||||
|
Loading…
x
Reference in New Issue
Block a user